rghost 0.7.4 → 0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rghost/border.rb +44 -0
- data/lib/rghost/callback.rb +25 -22
- data/lib/rghost/circle.rb +102 -0
- data/lib/rghost/color.rb +81 -56
- data/lib/rghost/constants.rb +599 -589
- data/lib/rghost/convert.rb +26 -7
- data/lib/rghost/cursor.rb +90 -58
- data/lib/rghost/dash.rb +59 -0
- data/lib/rghost/document.rb +334 -311
- data/lib/rghost/document_callback_facade.rb +64 -0
- data/lib/rghost/dsc_entry.rb +12 -12
- data/lib/rghost/dynamic_document_callback.rb +6 -18
- data/lib/rghost/eps.rb +17 -8
- data/lib/rghost/font.rb +19 -23
- data/lib/rghost/font_map.rb +40 -0
- data/lib/rghost/frame.rb +105 -0
- data/lib/rghost/function.rb +19 -21
- data/lib/rghost/gif.rb +22 -9
- data/lib/rghost/graphic.rb +3 -3
- data/lib/rghost/grid/base_grid.rb +218 -0
- data/lib/rghost/grid/callback_facade.rb +136 -0
- data/lib/rghost/grid/csv_grid.rb +50 -0
- data/lib/rghost/{data_grid → grid}/dynamic_callback.rb +2 -2
- data/lib/rghost/grid/field_format.rb +43 -0
- data/lib/rghost/grid/grid.rb +15 -0
- data/lib/rghost/grid/header.rb +120 -0
- data/lib/rghost/grid/matrix.rb +10 -0
- data/lib/rghost/grid/rails_grid.rb +70 -0
- data/lib/rghost/{data_grid → grid}/static_callback.rb +4 -4
- data/lib/rghost/grid/style/border_lines.rb +46 -0
- data/lib/rghost/grid/style/bottom_lines.rb +30 -0
- data/lib/rghost/grid/style/old_forms.rb +30 -0
- data/lib/rghost/grid/style/style.rb +8 -0
- data/lib/rghost/gs_alone.rb +7 -5
- data/lib/rghost/helpers.rb +4 -4
- data/lib/rghost/horizontal_line.rb +35 -19
- data/lib/rghost/how_to.rb +75 -0
- data/lib/rghost/image.rb +8 -8
- data/lib/rghost/jpeg.rb +21 -8
- data/lib/rghost/line.rb +66 -17
- data/lib/rghost/line_width.rb +19 -8
- data/lib/rghost/load.rb +24 -22
- data/lib/rghost/newpath.rb +8 -7
- data/lib/rghost/paper.rb +100 -41
- data/lib/rghost/parse_text.rb +53 -0
- data/lib/rghost/point.rb +9 -8
- data/lib/rghost/point_with_command.rb +5 -5
- data/lib/rghost/polygon.rb +75 -0
- data/lib/rghost/ps/AdobeExpert.enc +0 -0
- data/lib/rghost/ps/AdobeLatinEncoding.enc +0 -0
- data/lib/rghost/ps/Bengali.enc +0 -0
- data/lib/rghost/ps/CodePage1250.enc +0 -0
- data/lib/rghost/ps/CodePage1251.enc +0 -0
- data/lib/rghost/ps/CodePage1252.enc +0 -0
- data/lib/rghost/ps/CodePage1253.enc +0 -0
- data/lib/rghost/ps/CodePage1254.enc +0 -0
- data/lib/rghost/ps/CodePage1256.enc +0 -0
- data/lib/rghost/ps/CodePage1257.enc +0 -0
- data/lib/rghost/ps/CodePage1258.enc +0 -0
- data/lib/rghost/ps/CodePage874.enc +0 -0
- data/lib/rghost/ps/Fontmap +5 -0
- data/lib/rghost/ps/IsoLatin.enc +0 -0
- data/lib/rghost/ps/MacCentralEuropean.enc +0 -0
- data/lib/rghost/ps/{MacCyrillice.enc → MacCyrillice.desnc} +0 -0
- data/lib/rghost/ps/MacGreek.enc +0 -0
- data/lib/rghost/ps/MacHebrew.enc +0 -0
- data/lib/rghost/ps/TeX-CorkEncoding.enc +0 -0
- data/lib/rghost/ps/TeX-LGR-Greek.enc +0 -0
- data/lib/rghost/ps/TeX-T2AModified2Encoding.enc +0 -0
- data/lib/rghost/ps/TeX-T2BAdobeEncoding.enc +0 -0
- data/lib/rghost/ps/TeX-T2CAdobeEncoding.enc +0 -0
- data/lib/rghost/ps/TeX-X2AdobeEncoding.enc +0 -0
- data/lib/rghost/ps/TeX-XL2encoding.enc +0 -0
- data/lib/rghost/ps/TeXMathExtensionEncoding.enc +0 -0
- data/lib/rghost/ps/TeXMathItalicEncoding.enc +0 -0
- data/lib/rghost/ps/TeXMathSymbolEncoding.enc +0 -0
- data/lib/rghost/ps/US-ASCII.enc +0 -0
- data/lib/rghost/ps/UTF-8.enc +0 -0
- data/lib/rghost/ps/__datagrid.ps +52 -0
- data/lib/rghost/ps/_cusor.ps +46 -0
- data/lib/rghost/ps/basic.ps +12 -1
- data/lib/rghost/ps/begin_document.ps +1 -0
- data/lib/rghost/ps/callbacks.ps +32 -3
- data/lib/rghost/ps/code128.font +0 -0
- data/lib/rghost/ps/code39.font +0 -0
- data/lib/rghost/ps/cursor.ps +77 -13
- data/lib/rghost/ps/datagrid.ps +4 -1
- data/lib/rghost/ps/developer.ps +237 -0
- data/lib/rghost/ps/ean.font +0 -0
- data/lib/rghost/ps/eps.ps +0 -0
- data/lib/rghost/ps/font.ps +8 -1
- data/lib/rghost/ps/frame.ps +16 -0
- data/lib/rghost/ps/gif.ps +0 -0
- data/lib/rghost/ps/horizontal_line.ps +4 -3
- data/lib/rghost/ps/i25.font +0 -0
- data/lib/rghost/ps/jpeg.ps +0 -0
- data/lib/rghost/ps/paper.ps +0 -0
- data/lib/rghost/ps/rectangle.ps +0 -0
- data/lib/rghost/ps/rghost_default_template.eps +1532 -0
- data/lib/rghost/ps/row.ps +0 -0
- data/lib/rghost/ps/show.ps +2 -1
- data/lib/rghost/ps/table_callbacks.ps +0 -0
- data/lib/rghost/ps/text.ps +63 -0
- data/lib/rghost/ps/textarea.ps +1 -1
- data/lib/rghost/ps/type.ps +0 -0
- data/lib/rghost/ps/unit.ps +0 -0
- data/lib/rghost/ps/vertical_line.ps +2 -4
- data/lib/rghost/ps/virtual_pages.ps +55 -0
- data/lib/rghost/ps_facade.rb +256 -0
- data/lib/rghost/ps_object.rb +24 -20
- data/lib/rghost/rgengine.so +0 -0
- data/lib/rghost/ruby_ghost_config.rb +224 -16
- data/lib/rghost/ruby_ghost_engine.rb +32 -55
- data/lib/rghost/ruby_ghost_version.rb +8 -0
- data/lib/rghost/ruby_to_ps.rb +52 -78
- data/lib/rghost/scale.rb +22 -7
- data/lib/rghost/shape_content.rb +23 -0
- data/lib/rghost/show.rb +77 -20
- data/lib/rghost/static_document_callback.rb +3 -7
- data/lib/rghost/text.rb +44 -0
- data/lib/rghost/text_in.rb +36 -14
- data/lib/rghost/textarea.rb +66 -93
- data/lib/rghost/units.rb +45 -44
- data/lib/rghost/variable.rb +4 -4
- data/lib/rghost/vertical_line.rb +27 -19
- data/lib/rghost/virtual_pages.rb +42 -0
- data/lib/rghost.rb +16 -2
- metadata +153 -500
- data/lib/rghost/arc.rb +0 -39
- data/lib/rghost/barcode.rb +0 -40
- data/lib/rghost/data_grid/basic_grid.rb +0 -136
- data/lib/rghost/data_grid/csv_grid.rb +0 -27
- data/lib/rghost/data_grid/data_grid.rb +0 -14
- data/lib/rghost/data_grid/field_format.rb +0 -60
- data/lib/rghost/data_grid/grid.rb +0 -18
- data/lib/rghost/data_grid/header.rb +0 -111
- data/lib/rghost/data_grid/rails_grid.rb +0 -62
- data/lib/rghost/data_grid/style/border_lines.rb +0 -47
- data/lib/rghost/data_grid/style/bottom_lines.rb +0 -30
- data/lib/rghost/data_grid/style/old_forms.rb +0 -30
- data/lib/rghost/data_grid/style/style.rb +0 -8
- data/lib/rghost/doc/classes/Arc.html +0 -200
- data/lib/rghost/doc/classes/Arc.src/M000049.html +0 -18
- data/lib/rghost/doc/classes/Arc.src/M000050.html +0 -23
- data/lib/rghost/doc/classes/Barcode.html +0 -214
- data/lib/rghost/doc/classes/Barcode.src/M000001.html +0 -19
- data/lib/rghost/doc/classes/Barcode.src/M000002.html +0 -18
- data/lib/rghost/doc/classes/Barcode.src/M000003.html +0 -19
- data/lib/rghost/doc/classes/Barcode.src/M000004.html +0 -27
- data/lib/rghost/doc/classes/CMYK.html +0 -209
- data/lib/rghost/doc/classes/CMYK.src/M000047.html +0 -18
- data/lib/rghost/doc/classes/CMYK.src/M000048.html +0 -24
- data/lib/rghost/doc/classes/Callback.html +0 -220
- data/lib/rghost/doc/classes/Callback.src/M000071.html +0 -21
- data/lib/rghost/doc/classes/Callback.src/M000072.html +0 -26
- data/lib/rghost/doc/classes/Color.html +0 -175
- data/lib/rghost/doc/classes/Color.src/M000028.html +0 -33
- data/lib/rghost/doc/classes/Constants/Colors.html +0 -129
- data/lib/rghost/doc/classes/Constants/Devices.html +0 -163
- data/lib/rghost/doc/classes/Constants/Devices.src/M000168.html +0 -22
- data/lib/rghost/doc/classes/Constants/Fonts.html +0 -144
- data/lib/rghost/doc/classes/Constants/Papers.html +0 -124
- data/lib/rghost/doc/classes/Constants.html +0 -120
- data/lib/rghost/doc/classes/Convert.html +0 -189
- data/lib/rghost/doc/classes/Convert.src/M000067.html +0 -20
- data/lib/rghost/doc/classes/Convert.src/M000068.html +0 -24
- data/lib/rghost/doc/classes/Cursor.html +0 -330
- data/lib/rghost/doc/classes/Cursor.src/M000031.html +0 -21
- data/lib/rghost/doc/classes/Cursor.src/M000032.html +0 -21
- data/lib/rghost/doc/classes/Cursor.src/M000033.html +0 -20
- data/lib/rghost/doc/classes/Cursor.src/M000034.html +0 -18
- data/lib/rghost/doc/classes/Cursor.src/M000035.html +0 -18
- data/lib/rghost/doc/classes/Cursor.src/M000036.html +0 -19
- data/lib/rghost/doc/classes/Cursor.src/M000037.html +0 -22
- data/lib/rghost/doc/classes/Cursor.src/M000038.html +0 -18
- data/lib/rghost/doc/classes/Cursor.src/M000039.html +0 -18
- data/lib/rghost/doc/classes/DSCEntry.html +0 -173
- data/lib/rghost/doc/classes/DSCEntry.src/M000059.html +0 -19
- data/lib/rghost/doc/classes/DSCEntry.src/M000060.html +0 -19
- data/lib/rghost/doc/classes/DataGrid/BasicGrid.html +0 -343
- data/lib/rghost/doc/classes/DataGrid/BasicGrid.src/M000140.html +0 -27
- data/lib/rghost/doc/classes/DataGrid/BasicGrid.src/M000141.html +0 -26
- data/lib/rghost/doc/classes/DataGrid/BasicGrid.src/M000142.html +0 -22
- data/lib/rghost/doc/classes/DataGrid/BasicGrid.src/M000143.html +0 -19
- data/lib/rghost/doc/classes/DataGrid/BasicGrid.src/M000144.html +0 -26
- data/lib/rghost/doc/classes/DataGrid/BasicGrid.src/M000145.html +0 -34
- data/lib/rghost/doc/classes/DataGrid/BasicGrid.src/M000146.html +0 -18
- data/lib/rghost/doc/classes/DataGrid/BasicGrid.src/M000147.html +0 -37
- data/lib/rghost/doc/classes/DataGrid/BasicGrid.src/M000148.html +0 -26
- data/lib/rghost/doc/classes/DataGrid/CSVGrid.html +0 -152
- data/lib/rghost/doc/classes/DataGrid/CSVGrid.src/M000139.html +0 -32
- data/lib/rghost/doc/classes/DataGrid/DynamicCallback.html +0 -158
- data/lib/rghost/doc/classes/DataGrid/DynamicCallback.src/M000149.html +0 -19
- data/lib/rghost/doc/classes/DataGrid/FieldFormat/Custom.html +0 -176
- data/lib/rghost/doc/classes/DataGrid/FieldFormat/Custom.src/M000136.html +0 -18
- data/lib/rghost/doc/classes/DataGrid/FieldFormat/Custom.src/M000137.html +0 -18
- data/lib/rghost/doc/classes/DataGrid/FieldFormat/Custom.src/M000138.html +0 -18
- data/lib/rghost/doc/classes/DataGrid/FieldFormat.html +0 -216
- data/lib/rghost/doc/classes/DataGrid/FieldFormat.src/M000131.html +0 -19
- data/lib/rghost/doc/classes/DataGrid/FieldFormat.src/M000132.html +0 -18
- data/lib/rghost/doc/classes/DataGrid/FieldFormat.src/M000133.html +0 -23
- data/lib/rghost/doc/classes/DataGrid/FieldFormat.src/M000134.html +0 -18
- data/lib/rghost/doc/classes/DataGrid/FieldFormat.src/M000135.html +0 -22
- data/lib/rghost/doc/classes/DataGrid/Grid.html +0 -148
- data/lib/rghost/doc/classes/DataGrid/Grid.src/M000160.html +0 -19
- data/lib/rghost/doc/classes/DataGrid/Header.html +0 -367
- data/lib/rghost/doc/classes/DataGrid/Header.src/M000150.html +0 -26
- data/lib/rghost/doc/classes/DataGrid/Header.src/M000151.html +0 -25
- data/lib/rghost/doc/classes/DataGrid/Header.src/M000152.html +0 -24
- data/lib/rghost/doc/classes/DataGrid/Header.src/M000153.html +0 -19
- data/lib/rghost/doc/classes/DataGrid/Header.src/M000154.html +0 -18
- data/lib/rghost/doc/classes/DataGrid/Header.src/M000155.html +0 -18
- data/lib/rghost/doc/classes/DataGrid/Header.src/M000156.html +0 -18
- data/lib/rghost/doc/classes/DataGrid/Header.src/M000157.html +0 -18
- data/lib/rghost/doc/classes/DataGrid/Header.src/M000158.html +0 -19
- data/lib/rghost/doc/classes/DataGrid/Header.src/M000159.html +0 -19
- data/lib/rghost/doc/classes/DataGrid/RailsGrid.html +0 -234
- data/lib/rghost/doc/classes/DataGrid/RailsGrid.src/M000161.html +0 -27
- data/lib/rghost/doc/classes/DataGrid/RailsGrid.src/M000162.html +0 -23
- data/lib/rghost/doc/classes/DataGrid/RailsGrid.src/M000163.html +0 -18
- data/lib/rghost/doc/classes/DataGrid/StaticCallback.html +0 -158
- data/lib/rghost/doc/classes/DataGrid/StaticCallback.src/M000164.html +0 -19
- data/lib/rghost/doc/classes/DataGrid/Style/BorderLines.html +0 -137
- data/lib/rghost/doc/classes/DataGrid/Style/BorderLines.src/M000128.html +0 -55
- data/lib/rghost/doc/classes/DataGrid/Style/BottomLines.html +0 -137
- data/lib/rghost/doc/classes/DataGrid/Style/BottomLines.src/M000129.html +0 -38
- data/lib/rghost/doc/classes/DataGrid/Style/OldForms.html +0 -137
- data/lib/rghost/doc/classes/DataGrid/Style/OldForms.src/M000130.html +0 -38
- data/lib/rghost/doc/classes/DataGrid/Style.html +0 -113
- data/lib/rghost/doc/classes/DataGrid.html +0 -133
- data/lib/rghost/doc/classes/Document.html +0 -990
- data/lib/rghost/doc/classes/Document.src/M000075.html +0 -32
- data/lib/rghost/doc/classes/Document.src/M000076.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000077.html +0 -29
- data/lib/rghost/doc/classes/Document.src/M000078.html +0 -33
- data/lib/rghost/doc/classes/Document.src/M000079.html +0 -20
- data/lib/rghost/doc/classes/Document.src/M000080.html +0 -21
- data/lib/rghost/doc/classes/Document.src/M000081.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000082.html +0 -19
- data/lib/rghost/doc/classes/Document.src/M000083.html +0 -21
- data/lib/rghost/doc/classes/Document.src/M000084.html +0 -22
- data/lib/rghost/doc/classes/Document.src/M000085.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000086.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000087.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000088.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000089.html +0 -19
- data/lib/rghost/doc/classes/Document.src/M000090.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000091.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000092.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000093.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000094.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000095.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000096.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000097.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000098.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000099.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000100.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000101.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000102.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000103.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000104.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000105.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000106.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000107.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000108.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000109.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000110.html +0 -18
- data/lib/rghost/doc/classes/Document.src/M000111.html +0 -20
- data/lib/rghost/doc/classes/Document.src/M000112.html +0 -19
- data/lib/rghost/doc/classes/Document.src/M000113.html +0 -19
- data/lib/rghost/doc/classes/DynamicDocumentCallback.html +0 -175
- data/lib/rghost/doc/classes/DynamicDocumentCallback.src/M000022.html +0 -19
- data/lib/rghost/doc/classes/Eps.html +0 -168
- data/lib/rghost/doc/classes/Eps.src/M000063.html +0 -20
- data/lib/rghost/doc/classes/Eps.src/M000064.html +0 -20
- data/lib/rghost/doc/classes/Font.html +0 -205
- data/lib/rghost/doc/classes/Font.src/M000061.html +0 -22
- data/lib/rghost/doc/classes/Font.src/M000062.html +0 -37
- data/lib/rghost/doc/classes/Function.html +0 -196
- data/lib/rghost/doc/classes/Function.src/M000045.html +0 -27
- data/lib/rghost/doc/classes/Function.src/M000046.html +0 -20
- data/lib/rghost/doc/classes/GSAlone.html +0 -154
- data/lib/rghost/doc/classes/GSAlone.src/M000065.html +0 -19
- data/lib/rghost/doc/classes/GSAlone.src/M000066.html +0 -22
- data/lib/rghost/doc/classes/Gif.html +0 -148
- data/lib/rghost/doc/classes/Gif.src/M000040.html +0 -30
- data/lib/rghost/doc/classes/Graphic.html +0 -153
- data/lib/rghost/doc/classes/Graphic.src/M000014.html +0 -18
- data/lib/rghost/doc/classes/Gray.html +0 -181
- data/lib/rghost/doc/classes/Gray.src/M000026.html +0 -18
- data/lib/rghost/doc/classes/Gray.src/M000027.html +0 -19
- data/lib/rghost/doc/classes/Helpers/HashKeyMethod.html +0 -131
- data/lib/rghost/doc/classes/Helpers/HashKeyMethod.src/M000127.html +0 -18
- data/lib/rghost/doc/classes/Helpers/HashKeyMethodClass.html +0 -118
- data/lib/rghost/doc/classes/Helpers.html +0 -112
- data/lib/rghost/doc/classes/HorizontalLine.html +0 -186
- data/lib/rghost/doc/classes/HorizontalLine.src/M000023.html +0 -23
- data/lib/rghost/doc/classes/Image.html +0 -176
- data/lib/rghost/doc/classes/Image.src/M000042.html +0 -20
- data/lib/rghost/doc/classes/Image.src/M000043.html +0 -26
- data/lib/rghost/doc/classes/Jpeg.html +0 -148
- data/lib/rghost/doc/classes/Jpeg.src/M000013.html +0 -28
- data/lib/rghost/doc/classes/Line.html +0 -190
- data/lib/rghost/doc/classes/Line.src/M000069.html +0 -20
- data/lib/rghost/doc/classes/Line.src/M000070.html +0 -19
- data/lib/rghost/doc/classes/LineWidth.html +0 -172
- data/lib/rghost/doc/classes/LineWidth.src/M000005.html +0 -18
- data/lib/rghost/doc/classes/LineWidth.src/M000006.html +0 -18
- data/lib/rghost/doc/classes/Load.html +0 -161
- data/lib/rghost/doc/classes/Load.src/M000165.html +0 -21
- data/lib/rghost/doc/classes/Load.src/M000166.html +0 -34
- data/lib/rghost/doc/classes/Load.src/M000167.html +0 -19
- data/lib/rghost/doc/classes/NewPath.html +0 -153
- data/lib/rghost/doc/classes/NewPath.src/M000041.html +0 -18
- data/lib/rghost/doc/classes/Paper.html +0 -213
- data/lib/rghost/doc/classes/Paper.src/M000010.html +0 -20
- data/lib/rghost/doc/classes/Paper.src/M000011.html +0 -24
- data/lib/rghost/doc/classes/Paper.src/M000012.html +0 -20
- data/lib/rghost/doc/classes/Point.html +0 -180
- data/lib/rghost/doc/classes/Point.src/M000073.html +0 -20
- data/lib/rghost/doc/classes/Point.src/M000074.html +0 -18
- data/lib/rghost/doc/classes/PointWithCommand.html +0 -150
- data/lib/rghost/doc/classes/PointWithCommand.src/M000115.html +0 -22
- data/lib/rghost/doc/classes/PsObject.html +0 -269
- data/lib/rghost/doc/classes/PsObject.src/M000015.html +0 -25
- data/lib/rghost/doc/classes/PsObject.src/M000016.html +0 -18
- data/lib/rghost/doc/classes/PsObject.src/M000017.html +0 -18
- data/lib/rghost/doc/classes/PsObject.src/M000018.html +0 -18
- data/lib/rghost/doc/classes/PsObject.src/M000019.html +0 -21
- data/lib/rghost/doc/classes/PsObject.src/M000020.html +0 -19
- data/lib/rghost/doc/classes/PsObject.src/M000021.html +0 -18
- data/lib/rghost/doc/classes/RGB.html +0 -213
- data/lib/rghost/doc/classes/RGB.src/M000024.html +0 -21
- data/lib/rghost/doc/classes/RGB.src/M000025.html +0 -25
- data/lib/rghost/doc/classes/Rectangle.html +0 -226
- data/lib/rghost/doc/classes/Rectangle.src/M000056.html +0 -18
- data/lib/rghost/doc/classes/Rectangle.src/M000057.html +0 -24
- data/lib/rghost/doc/classes/Rectangle.src/M000058.html +0 -21
- data/lib/rghost/doc/classes/RubyGhostConfig.html +0 -144
- data/lib/rghost/doc/classes/RubyGhostConfig.src/M000118.html +0 -22
- data/lib/rghost/doc/classes/RubyGhostEngine.html +0 -261
- data/lib/rghost/doc/classes/RubyGhostEngine.src/M000007.html +0 -24
- data/lib/rghost/doc/classes/RubyGhostEngine.src/M000008.html +0 -96
- data/lib/rghost/doc/classes/RubyGhostEngine.src/M000009.html +0 -21
- data/lib/rghost/doc/classes/RubyToPs.html +0 -272
- data/lib/rghost/doc/classes/RubyToPs.src/M000119.html +0 -23
- data/lib/rghost/doc/classes/RubyToPs.src/M000120.html +0 -18
- data/lib/rghost/doc/classes/RubyToPs.src/M000121.html +0 -18
- data/lib/rghost/doc/classes/RubyToPs.src/M000122.html +0 -19
- data/lib/rghost/doc/classes/RubyToPs.src/M000123.html +0 -30
- data/lib/rghost/doc/classes/RubyToPs.src/M000124.html +0 -18
- data/lib/rghost/doc/classes/RubyToPs.src/M000125.html +0 -18
- data/lib/rghost/doc/classes/RubyToPs.src/M000126.html +0 -30
- data/lib/rghost/doc/classes/Scale.html +0 -153
- data/lib/rghost/doc/classes/Scale.src/M000114.html +0 -18
- data/lib/rghost/doc/classes/Show.html +0 -203
- data/lib/rghost/doc/classes/Show.src/M000052.html +0 -20
- data/lib/rghost/doc/classes/Show.src/M000053.html +0 -19
- data/lib/rghost/doc/classes/StaticDocumentCallback.html +0 -168
- data/lib/rghost/doc/classes/StaticDocumentCallback.src/M000051.html +0 -19
- data/lib/rghost/doc/classes/TextArea.html +0 -217
- data/lib/rghost/doc/classes/TextArea.src/M000029.html +0 -22
- data/lib/rghost/doc/classes/TextArea.src/M000030.html +0 -24
- data/lib/rghost/doc/classes/TextIn.html +0 -201
- data/lib/rghost/doc/classes/TextIn.src/M000054.html +0 -19
- data/lib/rghost/doc/classes/TextIn.src/M000055.html +0 -24
- data/lib/rghost/doc/classes/Units/Cm.html +0 -145
- data/lib/rghost/doc/classes/Units/Cm.src/M000175.html +0 -19
- data/lib/rghost/doc/classes/Units/Inch.html +0 -145
- data/lib/rghost/doc/classes/Units/Inch.src/M000174.html +0 -18
- data/lib/rghost/doc/classes/Units/PSUnit.html +0 -139
- data/lib/rghost/doc/classes/Units/PSUnit.src/M000170.html +0 -18
- data/lib/rghost/doc/classes/Units/Unit.html +0 -190
- data/lib/rghost/doc/classes/Units/Unit.src/M000171.html +0 -18
- data/lib/rghost/doc/classes/Units/Unit.src/M000172.html +0 -19
- data/lib/rghost/doc/classes/Units/Unit.src/M000173.html +0 -18
- data/lib/rghost/doc/classes/Units.html +0 -166
- data/lib/rghost/doc/classes/Units.src/M000169.html +0 -22
- data/lib/rghost/doc/classes/Variable.html +0 -152
- data/lib/rghost/doc/classes/Variable.src/M000044.html +0 -18
- data/lib/rghost/doc/classes/VerticalLine.html +0 -175
- data/lib/rghost/doc/classes/VerticalLine.src/M000116.html +0 -23
- data/lib/rghost/doc/classes/VerticalLine.src/M000117.html +0 -19
- data/lib/rghost/doc/created.rid +0 -1
- data/lib/rghost/doc/files/arc_rb.html +0 -109
- data/lib/rghost/doc/files/barcode_rb.html +0 -108
- data/lib/rghost/doc/files/callback_rb.html +0 -109
- data/lib/rghost/doc/files/color_rb.html +0 -110
- data/lib/rghost/doc/files/constants_rb.html +0 -108
- data/lib/rghost/doc/files/convert_rb.html +0 -107
- data/lib/rghost/doc/files/cursor_rb.html +0 -110
- data/lib/rghost/doc/files/data_grid/basic_grid_rb.html +0 -108
- data/lib/rghost/doc/files/data_grid/csv_grid_rb.html +0 -108
- data/lib/rghost/doc/files/data_grid/data_grid_rb.html +0 -116
- data/lib/rghost/doc/files/data_grid/dynamic_callback_rb.html +0 -108
- data/lib/rghost/doc/files/data_grid/field_format_rb.html +0 -109
- data/lib/rghost/doc/files/data_grid/grid_rb.html +0 -108
- data/lib/rghost/doc/files/data_grid/header_rb.html +0 -113
- data/lib/rghost/doc/files/data_grid/rails_grid_rb.html +0 -108
- data/lib/rghost/doc/files/data_grid/static_callback_rb.html +0 -109
- data/lib/rghost/doc/files/data_grid/style/border_lines_rb.html +0 -101
- data/lib/rghost/doc/files/data_grid/style/bottom_lines_rb.html +0 -101
- data/lib/rghost/doc/files/data_grid/style/old_forms_rb.html +0 -101
- data/lib/rghost/doc/files/data_grid/style/style_rb.html +0 -110
- data/lib/rghost/doc/files/document_rb.html +0 -150
- data/lib/rghost/doc/files/dsc_entry_rb.html +0 -108
- data/lib/rghost/doc/files/dynamic_document_callback_rb.html +0 -108
- data/lib/rghost/doc/files/eps_rb.html +0 -108
- data/lib/rghost/doc/files/font_rb.html +0 -110
- data/lib/rghost/doc/files/function_rb.html +0 -108
- data/lib/rghost/doc/files/gif_rb.html +0 -114
- data/lib/rghost/doc/files/graphic_rb.html +0 -113
- data/lib/rghost/doc/files/gs_alone_rb.html +0 -101
- data/lib/rghost/doc/files/helpers_rb.html +0 -101
- data/lib/rghost/doc/files/horizontal_line_rb.html +0 -109
- data/lib/rghost/doc/files/image_rb.html +0 -108
- data/lib/rghost/doc/files/jpeg_rb.html +0 -112
- data/lib/rghost/doc/files/line_rb.html +0 -109
- data/lib/rghost/doc/files/line_width_rb.html +0 -108
- data/lib/rghost/doc/files/load_rb.html +0 -108
- data/lib/rghost/doc/files/newpath_rb.html +0 -113
- data/lib/rghost/doc/files/paper_rb.html +0 -112
- data/lib/rghost/doc/files/point_rb.html +0 -109
- data/lib/rghost/doc/files/point_with_command_rb.html +0 -109
- data/lib/rghost/doc/files/ps_object_rb.html +0 -107
- data/lib/rghost/doc/files/rectangle_rb.html +0 -110
- data/lib/rghost/doc/files/rghost_rb.html +0 -109
- data/lib/rghost/doc/files/ruby_ghost_config_rb.html +0 -109
- data/lib/rghost/doc/files/ruby_ghost_engine_rb.html +0 -111
- data/lib/rghost/doc/files/ruby_to_ps_rb.html +0 -107
- data/lib/rghost/doc/files/scale_rb.html +0 -108
- data/lib/rghost/doc/files/show_rb.html +0 -109
- data/lib/rghost/doc/files/static_document_callback_rb.html +0 -109
- data/lib/rghost/doc/files/text_in_rb.html +0 -110
- data/lib/rghost/doc/files/textarea_rb.html +0 -111
- data/lib/rghost/doc/files/units_rb.html +0 -109
- data/lib/rghost/doc/files/variable_rb.html +0 -108
- data/lib/rghost/doc/files/version_rb.html +0 -101
- data/lib/rghost/doc/files/vertical_line_rb.html +0 -110
- data/lib/rghost/doc/fr_class_index.html +0 -93
- data/lib/rghost/doc/fr_file_index.html +0 -81
- data/lib/rghost/doc/fr_method_index.html +0 -201
- data/lib/rghost/doc/index.html +0 -24
- data/lib/rghost/ps/functions.ps +0 -646
- data/lib/rghost/rectangle.rb +0 -39
- data/lib/rghost/rghost.rb +0 -3
- data/lib/rghost/version.rb +0 -9
data/lib/rghost/paper.rb
CHANGED
|
@@ -3,29 +3,54 @@ require "units"
|
|
|
3
3
|
require "load"
|
|
4
4
|
require "constants"
|
|
5
5
|
require "ruby_to_ps"
|
|
6
|
-
|
|
7
|
-
#
|
|
8
|
-
|
|
6
|
+
#Paper is the area where the Postscript elements/objects are drawn.
|
|
7
|
+
#The margin is the document's non-printable area (both by the cursors and by the page's internal controllers).
|
|
8
|
+
#The :area_x and :area_y are the printable section of the paper.
|
|
9
|
+
#It's used to configure definitions of paper. It automatically defined into Document by :paper parameter.
|
|
10
|
+
#
|
|
11
|
+
#link:images/paper01.png
|
|
12
|
+
#
|
|
13
|
+
class RGhost::Paper < RGhost::PsObject
|
|
9
14
|
|
|
10
15
|
|
|
11
16
|
DEFAULT_OPTIONS={ :landscape => false,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
#
|
|
23
|
-
|
|
24
|
-
#
|
|
25
|
-
|
|
26
|
-
#
|
|
27
|
-
|
|
28
|
-
#
|
|
17
|
+
:margin_top => 1,
|
|
18
|
+
:margin_right => 1,
|
|
19
|
+
:margin_bottom => 1,
|
|
20
|
+
:margin_left => 1,
|
|
21
|
+
:duplex => false,
|
|
22
|
+
:tumble => false
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
include RGhost::RubyToPs
|
|
26
|
+
#===Examples
|
|
27
|
+
#
|
|
28
|
+
#====Create paper by name
|
|
29
|
+
# doc=Document.new :paper => :A4
|
|
30
|
+
#====Create paper by name in landscape
|
|
31
|
+
# doc=Document.new :paper => :A4 , :landscape => true
|
|
32
|
+
#====Create custom paper
|
|
33
|
+
# doc=Document.new :paper => [10,15]
|
|
34
|
+
#====Defining all margins
|
|
35
|
+
# doc=Document.new :paper => :A5, :margin => 0.5
|
|
36
|
+
#====Defining custom margins
|
|
37
|
+
# doc=Document.new :paper => :A5, :margin => [0.5, 1, 0.5, 2] #=>[top,right,bottom,left] clockwise
|
|
38
|
+
#====Defining particular margin
|
|
39
|
+
# doc=Document.new :paper => :A5, :margin_top => 1, :margin_left => 0.3
|
|
40
|
+
#====Defining two faces document to printer
|
|
41
|
+
# doc=Document.new :paper => :A5, :duplex => true
|
|
42
|
+
#===Parameters
|
|
43
|
+
#* paper - The paper parameter can be either a Symbol or a Array. If paper parameter is a Symbol its value will search in RGhost::Constants::Papers . If paper parameter is a Array(with two numeric elements) will be position [0] width and [1] height of page. Example:
|
|
44
|
+
# doc=Document.new :paper => :A3 #=> Build new A3 paper
|
|
45
|
+
# doc=Document.new :paper => [5,5] #=> Build new custom paper 5x5, using default unit defined in RGhost::Config::GS[:unit].
|
|
46
|
+
#
|
|
47
|
+
#====Configuration options:
|
|
48
|
+
#* <tt>:landscape</tt> - If set to true will invert width to height and height to width.
|
|
49
|
+
#* <tt>:margin</tt> - Specifies margins non-printable area. It can be one Numeric for all margins or Array [top,right,bottom,left] margins.
|
|
50
|
+
#* <tt>:duplex</tt> - Specifies two faces(for print)
|
|
51
|
+
#* <tt>:tumble</tt> - Specifies kind of duplex
|
|
52
|
+
#
|
|
53
|
+
#
|
|
29
54
|
def initialize(paper=:A4, options={})
|
|
30
55
|
|
|
31
56
|
@options=DEFAULT_OPTIONS.merge(options)
|
|
@@ -37,44 +62,78 @@ class Paper < PsObject
|
|
|
37
62
|
p=format_paper[:rg]
|
|
38
63
|
m=format_margin
|
|
39
64
|
|
|
40
|
-
lib=Load.library :paper
|
|
65
|
+
lib=RGhost::Load.library :paper
|
|
41
66
|
|
|
42
67
|
d<< p << m << lib.ps
|
|
43
68
|
end
|
|
44
69
|
|
|
45
|
-
|
|
46
|
-
def gs_paper
|
|
47
|
-
|
|
48
|
-
|
|
70
|
+
|
|
71
|
+
def gs_paper #:nodoc:
|
|
72
|
+
fp=format_paper
|
|
73
|
+
p=fp[:gs]
|
|
74
|
+
#["-dDEVICEWIDTHPOINTS=#{p[0]}", "-dDEVICEHEIGHTPOINTS=#{p[1]}"]
|
|
75
|
+
if fp[:done]
|
|
76
|
+
["-dDEVICEWIDTHPOINTS=#{p[0]}", "-dDEVICEHEIGHTPOINTS=#{p[1]}"]
|
|
77
|
+
else
|
|
78
|
+
["-dDEVICEWIDTHPOINTS=#{to_pt(p[0])}", "-dDEVICEHEIGHTPOINTS=#{to_pt(p[1])}"]
|
|
79
|
+
end
|
|
49
80
|
|
|
50
81
|
end
|
|
51
82
|
|
|
52
83
|
|
|
53
84
|
private
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
85
|
+
|
|
86
|
+
def to_pt(value)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
return case RGhost::Config::GS[:unit].new
|
|
90
|
+
when RGhost::Units::Cm: (value.to_f*72/2.545).to_i
|
|
91
|
+
when RGhost::Units::Inch: (value.to_f*72).to_i
|
|
57
92
|
else
|
|
58
|
-
|
|
59
|
-
mr=Units::parse(@options[:margin_right])
|
|
60
|
-
mb=Units::parse(@options[:margin_bottom])
|
|
61
|
-
ml=Units::parse(@options[:margin_left])
|
|
93
|
+
value
|
|
62
94
|
end
|
|
95
|
+
|
|
96
|
+
end
|
|
97
|
+
def format_margin
|
|
98
|
+
#if @options[:margin]
|
|
99
|
+
# mt=mr=mb=ml=RGhost::Units::parse(@options[:margin])
|
|
100
|
+
#else
|
|
101
|
+
# mt=RGhost::Units::parse(@options[:margin_top])
|
|
102
|
+
# mr=RGhost::Units::parse(@options[:margin_right])
|
|
103
|
+
# mb=RGhost::Units::parse(@options[:margin_bottom])
|
|
104
|
+
# ml=RGhost::Units::parse(@options[:margin_left])
|
|
105
|
+
#end
|
|
63
106
|
|
|
64
|
-
|
|
107
|
+
case @options[:margin]
|
|
108
|
+
when Numeric: mt=mr=mb=ml=RGhost::Units::parse(@options[:margin])
|
|
109
|
+
when Array:
|
|
110
|
+
mt=RGhost::Units::parse(@options[:margin][0] || DEFAULT_OPTIONS[:margin_top] )
|
|
111
|
+
mr=RGhost::Units::parse(@options[:margin][1] || DEFAULT_OPTIONS[:margin_right])
|
|
112
|
+
mb=RGhost::Units::parse(@options[:margin][2] || DEFAULT_OPTIONS[:margin_bottom])
|
|
113
|
+
ml=RGhost::Units::parse(@options[:margin][3] || DEFAULT_OPTIONS[:margin_left] )
|
|
114
|
+
when Hash,NilClass
|
|
115
|
+
mt=RGhost::Units::parse(@options[:margin_top ] || DEFAULT_OPTIONS[:margin_top] )
|
|
116
|
+
mr=RGhost::Units::parse(@options[:margin_right ] || DEFAULT_OPTIONS[:margin_right])
|
|
117
|
+
mb=RGhost::Units::parse(@options[:margin_bottom] || DEFAULT_OPTIONS[:margin_bottom])
|
|
118
|
+
ml=RGhost::Units::parse(@options[:margin_left ] || DEFAULT_OPTIONS[:margin_left] )
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
"/margin 3 dict def margin begin /top #{mt} def /right #{mr} def /bottom #{mb} def /left #{ml} def end\n"
|
|
65
122
|
end
|
|
66
123
|
|
|
67
124
|
def format_paper
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
125
|
+
|
|
126
|
+
case @paper
|
|
127
|
+
when Symbol:
|
|
128
|
+
|
|
129
|
+
p=RGhost::Constants::Papers::STANDARD[@paper.to_s.downcase.to_sym]
|
|
130
|
+
p.reverse! if @options[:landscape]
|
|
131
|
+
{:rg => "/pagesize #{to_array( p ) } def\n", :gs => p, :done => true}
|
|
132
|
+
when Array:
|
|
133
|
+
@paper.reverse! if @options[:landscape]
|
|
134
|
+
{:rg => "/pagesize #{to_array( @paper.map{|v| to_pt(v) } ) } def\n", :gs => @paper, :done => false}
|
|
71
135
|
end
|
|
72
136
|
|
|
73
|
-
p.reverse! if @options[:landscape] #Rotate paper
|
|
74
|
-
|
|
75
|
-
#p.map!{|size| Units::parse(size)} #repack with unit default or no
|
|
76
|
-
#formated as rg and gs
|
|
77
|
-
{:rg => "/pagesize #{to_array(p)} def\n", :gs => p}
|
|
78
137
|
|
|
79
138
|
end
|
|
80
139
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
module RGhost::ParseText #:nodoc:
|
|
3
|
+
|
|
4
|
+
def text_to_ps
|
|
5
|
+
|
|
6
|
+
unless @tag_parse
|
|
7
|
+
case @options[:text_align]
|
|
8
|
+
when :center, :right:
|
|
9
|
+
@text.split(/\n/).map{|l| "#{to_string(l)} :text_proc_cr :nbw " }.to_s
|
|
10
|
+
jump_with=':nbw'
|
|
11
|
+
when :left,nil:
|
|
12
|
+
if self.class == RGhost::Text
|
|
13
|
+
return @text.split(/\n/).map{|l| " :text #{to_string(l)} :text_proc nrdp " }.to_s
|
|
14
|
+
|
|
15
|
+
else
|
|
16
|
+
@text.split(/\n/).map{|l| " :text_area #{to_string(l)} :text_proc_cr :nbw " }.to_s
|
|
17
|
+
jump_with='nrdp'
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
jump_with=':nbw' if self.class == RGhost::TextArea
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
ret=@text.split(/<br\/?>|\n/).map do |piece|
|
|
28
|
+
text_ok=""
|
|
29
|
+
piece.scan(/<([^>]+)>([^<]*.)<\/\1>|([^<>]+)/).each do |t|
|
|
30
|
+
t.compact!
|
|
31
|
+
if t && t.size == 1
|
|
32
|
+
text_ok << ta_entry(t.first.to_s)
|
|
33
|
+
else
|
|
34
|
+
text_ok << ta_entry(t[1],t.first)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
text_ok
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
ret.join(" #{jump_with || 'nrdp' } ").gsub(/</,'<').gsub(/>/,'>')
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def ta_entry(e,tag="default_font")
|
|
44
|
+
if self.class == RGhost::Text and @options[:text_align] == :left
|
|
45
|
+
" :text _#{tag} #{to_string(e)} :text_proc "
|
|
46
|
+
elsif self.class == RGhost::TextArea and @options[:text_align] == :left
|
|
47
|
+
" :text_area _#{tag} #{to_string(e)} :text_proc "
|
|
48
|
+
else
|
|
49
|
+
" _#{tag} #{to_string(e)} :text_proc_cr "
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
data/lib/rghost/point.rb
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
require "ps_object"
|
|
2
2
|
require "units"
|
|
3
3
|
|
|
4
|
-
#
|
|
5
|
-
class Point < PsObject
|
|
4
|
+
#Creates one point using default unit defined in RGhost::Config::GS[:unit]
|
|
5
|
+
class RGhost::Point < RGhost::PsObject
|
|
6
6
|
attr_accessor :x,:y
|
|
7
7
|
|
|
8
8
|
def initialize(x,y)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
if x.is_a? Hash
|
|
10
|
+
point=x
|
|
11
|
+
@x,@y=point[:x],point[:y]
|
|
12
|
+
else
|
|
13
|
+
@x,@y=x,y
|
|
14
|
+
end
|
|
12
15
|
end
|
|
13
16
|
|
|
14
17
|
def ps
|
|
15
|
-
"#{Units::parse(@x)} #{Units::parse(@y)} "
|
|
18
|
+
"#{RGhost::Units::parse(@x)} #{RGhost::Units::parse(@y)} "
|
|
16
19
|
end
|
|
17
20
|
|
|
18
21
|
|
|
19
22
|
end
|
|
20
23
|
|
|
21
|
-
#p=Point.new(10,20,Cm,Cm)
|
|
22
|
-
#puts p.ps
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
require "ps_object"
|
|
2
2
|
require "units"
|
|
3
3
|
|
|
4
|
-
class PointWithCommand
|
|
4
|
+
class RGhost::PointWithCommand #:nodoc:
|
|
5
5
|
DEFAULT_POINT={:x => :limit_left , :y => :current_row}
|
|
6
6
|
|
|
7
|
-
def
|
|
8
|
-
|
|
7
|
+
def self.to(command,point={})
|
|
8
|
+
|
|
9
9
|
p=DEFAULT_POINT.dup.merge(point)
|
|
10
10
|
|
|
11
|
-
p=Point.new(p[:x],p[:y])
|
|
12
|
-
PsObject.new "#{p.ps}#{command}"
|
|
11
|
+
p=RGhost::Point.new(p[:x],p[:y])
|
|
12
|
+
RGhost::PsObject.new "#{p.ps}#{command}"
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#Draw one shape based in relative node points.
|
|
2
|
+
#===Options
|
|
3
|
+
#
|
|
4
|
+
#* <tt>:x and :y</tt> - Initial position.
|
|
5
|
+
#* <tt>:content</tt> - Facade to ShapeContent with same parameters.
|
|
6
|
+
#* <tt>:border</tt> - Facade to Border with same parameters.
|
|
7
|
+
#===Examples
|
|
8
|
+
#
|
|
9
|
+
# doc.polygon :x => 3.5, :y => 5.5 do
|
|
10
|
+
# node :x => 4, :y => 0
|
|
11
|
+
# node :x => 0, :y => -4
|
|
12
|
+
# node :x => -4, :y => 0
|
|
13
|
+
# node :x => 0, :y => 4
|
|
14
|
+
# end
|
|
15
|
+
#
|
|
16
|
+
#link:images/polygon01.png
|
|
17
|
+
#
|
|
18
|
+
# doc.polygon :x => 3.5, :y => 4.5 do
|
|
19
|
+
# node :x => 2, :y => 2
|
|
20
|
+
# node :x => 2, :y => -2
|
|
21
|
+
# node :x => -2, :y => -2
|
|
22
|
+
# end
|
|
23
|
+
#
|
|
24
|
+
#link:images/polygon02.png
|
|
25
|
+
#
|
|
26
|
+
# doc.polygon :x => 1, :y => 5, :border => {:width => 2, :linejoin => 1} do
|
|
27
|
+
# node :x => 2, :y => 2/2
|
|
28
|
+
# node :x => 2*2,:y => -2
|
|
29
|
+
# node :x => -1, :y => -3
|
|
30
|
+
# node :x => 2, :y => 1
|
|
31
|
+
# node :x => 3, :y => 2
|
|
32
|
+
# end
|
|
33
|
+
#
|
|
34
|
+
#link:images/polygon03.png
|
|
35
|
+
class RGhost::Polygon < RGhost::PsObject
|
|
36
|
+
attr_reader :points
|
|
37
|
+
|
|
38
|
+
DEFAULT_OPTIONS={
|
|
39
|
+
:x => :limit_left,
|
|
40
|
+
:y => :current_row,
|
|
41
|
+
:content => RGhost::ShapeContent::DEFAULT_OPTIONS,
|
|
42
|
+
:border => RGhost::Border::DEFAULT_OPTIONS
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
def initialize(options={},&block)
|
|
47
|
+
super(''){}
|
|
48
|
+
|
|
49
|
+
@options = DEFAULT_OPTIONS.dup.merge(options)
|
|
50
|
+
@points=[]
|
|
51
|
+
instance_eval(&block) if block
|
|
52
|
+
end
|
|
53
|
+
#Creates new relative point by :x => 2 and :y => 4. Used as instance_eval
|
|
54
|
+
def node(point)
|
|
55
|
+
@points << point
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def ps
|
|
59
|
+
graph=RGhost::Graphic.new
|
|
60
|
+
graph.set Cursor.moveto(@options)
|
|
61
|
+
graph.set RGhost::Border.new(@options[:border]) if @options[:border]
|
|
62
|
+
|
|
63
|
+
@points.each{|p| graph.set RGhost::Line.rlineto(p) }
|
|
64
|
+
|
|
65
|
+
graph.raw :closepath
|
|
66
|
+
#graph.raw :gsave
|
|
67
|
+
graph.set RGhost::ShapeContent.new(@options[:content]) if @options[:content]
|
|
68
|
+
#graph.raw :grestore
|
|
69
|
+
graph.raw :stroke
|
|
70
|
+
graph
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
end
|
|
File without changes
|
|
File without changes
|
data/lib/rghost/ps/Bengali.enc
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/rghost/ps/IsoLatin.enc
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/rghost/ps/MacGreek.enc
CHANGED
|
File without changes
|
data/lib/rghost/ps/MacHebrew.enc
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/rghost/ps/US-ASCII.enc
CHANGED
|
File without changes
|
data/lib/rghost/ps/UTF-8.enc
CHANGED
|
File without changes
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/col_padding 0.1 cm def
|
|
2
|
+
|
|
3
|
+
/st_center{ exch strlen 3 -1 roll sub -2 div dup 0 rmoveto exch show 0 rmoveto } def
|
|
4
|
+
/st_right{ exch strlen 3 -1 roll X add sub neg col_padding sub current_row moveto show col_padding 0 rmoveto } def
|
|
5
|
+
/st_left{ X add exch X col_padding add current_row moveto show current_row moveto }def
|
|
6
|
+
|
|
7
|
+
/col 0 def
|
|
8
|
+
/current_table_row 0 def %current row table
|
|
9
|
+
/nextcol{ /col inc } def
|
|
10
|
+
|
|
11
|
+
/headings? true def
|
|
12
|
+
|
|
13
|
+
/header_proc {
|
|
14
|
+
new_page? {
|
|
15
|
+
%before_row_create callback_row
|
|
16
|
+
before_header_create
|
|
17
|
+
header_titles {
|
|
18
|
+
before_column_header callback_col
|
|
19
|
+
headings? {
|
|
20
|
+
table_header col get aload pop cvx exec nextcol
|
|
21
|
+
|
|
22
|
+
}{ pop } ifelse
|
|
23
|
+
after_column_header callback_col
|
|
24
|
+
} forall
|
|
25
|
+
after_header_create
|
|
26
|
+
after_row
|
|
27
|
+
/new_page? false def
|
|
28
|
+
}if
|
|
29
|
+
} def
|
|
30
|
+
|
|
31
|
+
/after_row{
|
|
32
|
+
/current_table_row inc
|
|
33
|
+
/col 0 def
|
|
34
|
+
next_row
|
|
35
|
+
new_current_row_point
|
|
36
|
+
limit_left current_row moveto
|
|
37
|
+
}def
|
|
38
|
+
|
|
39
|
+
/table_proc {
|
|
40
|
+
{limit_left current_row moveto
|
|
41
|
+
header_proc
|
|
42
|
+
before_row callback_row
|
|
43
|
+
row_odd_or_even callback_row
|
|
44
|
+
{
|
|
45
|
+
before_column callback_col
|
|
46
|
+
table_params col get aload pop cvx exec nextcol
|
|
47
|
+
after_column callback_col
|
|
48
|
+
} forall
|
|
49
|
+
after_row
|
|
50
|
+
} forall
|
|
51
|
+
after_table_create
|
|
52
|
+
}bind def
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/current_page 1 def
|
|
2
|
+
/X{ currentpoint pop } def
|
|
3
|
+
/Y{ currentpoint exch pop} def
|
|
4
|
+
/nrdp{ next_row default_point } def
|
|
5
|
+
/next_page{
|
|
6
|
+
after_page_create callback
|
|
7
|
+
/row 1 def
|
|
8
|
+
%(Page: ) print current_page 8 string cvs print (\n) print
|
|
9
|
+
|
|
10
|
+
showpage
|
|
11
|
+
/new_page? true def
|
|
12
|
+
|
|
13
|
+
/current_page inc
|
|
14
|
+
/current_row limit_top row row_height mul sub def
|
|
15
|
+
%before_page_create callback
|
|
16
|
+
%odd_or_even callback
|
|
17
|
+
current_page count_pages eq { last_page } if
|
|
18
|
+
new_current_row_point
|
|
19
|
+
default_point
|
|
20
|
+
before_page_create callback
|
|
21
|
+
odd_or_even callback
|
|
22
|
+
|
|
23
|
+
} def
|
|
24
|
+
/default_point { limit_left current_row moveto} def
|
|
25
|
+
/new_current_row_point{ /current_row limit_top row row_height row_padding add mul sub def }def
|
|
26
|
+
|
|
27
|
+
/next_row{
|
|
28
|
+
row rows_per_page lt current_row limit_bottom ge and { /row inc
|
|
29
|
+
new_current_row_point
|
|
30
|
+
}{ next_page }ifelse
|
|
31
|
+
} def
|
|
32
|
+
|
|
33
|
+
/jump_rows{
|
|
34
|
+
%dup 1 le { { next_row }repeat} if
|
|
35
|
+
{ next_row }repeat
|
|
36
|
+
} def
|
|
37
|
+
/jump_rows{
|
|
38
|
+
%dup 1 le { { next_row }repeat} if
|
|
39
|
+
dup 0 ge {{ next_row }repeat
|
|
40
|
+
}{ neg { /row dec } repeat new_current_row_point } ifelse
|
|
41
|
+
} def
|
|
42
|
+
|
|
43
|
+
/goto_row{
|
|
44
|
+
/row exch def
|
|
45
|
+
new_current_row_point
|
|
46
|
+
} def
|
data/lib/rghost/ps/basic.ps
CHANGED
|
@@ -5,10 +5,21 @@
|
|
|
5
5
|
/new_page? true def
|
|
6
6
|
/strlen { dup stringwidth pop } def
|
|
7
7
|
/current_page 1 def
|
|
8
|
-
|
|
8
|
+
/puts { to_s print (\n) print } def
|
|
9
9
|
/row 1 def
|
|
10
10
|
%if include in array
|
|
11
11
|
/include? { /_atual 1 def exch dup length /_s exch def exch /_v exch def
|
|
12
12
|
{ _v eq {true exit}{ _atual _s eq { false exit }{ /_atual inc } ifelse } ifelse }forall
|
|
13
13
|
_s 0 eq {false} if
|
|
14
14
|
} def
|
|
15
|
+
|
|
16
|
+
/beging{
|
|
17
|
+
currentrgbcolor
|
|
18
|
+
currentfont
|
|
19
|
+
|
|
20
|
+
}bind def
|
|
21
|
+
|
|
22
|
+
/endg{
|
|
23
|
+
setfont
|
|
24
|
+
setrgbcolor
|
|
25
|
+
}bind def
|
data/lib/rghost/ps/callbacks.ps
CHANGED
|
@@ -43,14 +43,27 @@ end
|
|
|
43
43
|
pop
|
|
44
44
|
}ifelse
|
|
45
45
|
} bind def
|
|
46
|
+
%execute virtual page callbacks
|
|
47
|
+
/vp_callback{
|
|
48
|
+
dup dup
|
|
49
|
+
/except get length 0 ne { /except get current_vp include? not}{
|
|
50
|
+
dup /only get length 0 ne { /only get current_vp include?}{
|
|
51
|
+
pop true
|
|
52
|
+
}ifelse
|
|
53
|
+
}ifelse
|
|
54
|
+
{ /proc get exec }{
|
|
55
|
+
pop
|
|
56
|
+
}ifelse
|
|
57
|
+
} bind def
|
|
46
58
|
|
|
47
59
|
/odd? { 2 mod 0 eq {true}{false} ifelse } bind def
|
|
48
60
|
/odd_or_even { current_page odd? {odd_pages}{even_pages}ifelse }def
|
|
49
61
|
|
|
50
|
-
|
|
62
|
+
%TABLE
|
|
51
63
|
/before_table_create {} def
|
|
52
64
|
/after_table_create {} def
|
|
53
|
-
|
|
65
|
+
|
|
66
|
+
%TABLE ROW
|
|
54
67
|
/row_odd_or_even {
|
|
55
68
|
current_table_row odd? {odd_row}{even_row} ifelse
|
|
56
69
|
}def
|
|
@@ -59,6 +72,11 @@ end
|
|
|
59
72
|
/except [ ] def
|
|
60
73
|
/only [ ] def
|
|
61
74
|
end
|
|
75
|
+
/after_row 3 dict def after_row begin
|
|
76
|
+
/proc { } bind def
|
|
77
|
+
/except [ ] def
|
|
78
|
+
/only [ ] def
|
|
79
|
+
end
|
|
62
80
|
|
|
63
81
|
/odd_row 3 dict def odd_row begin
|
|
64
82
|
/proc { } bind def
|
|
@@ -143,4 +161,15 @@ dup dup
|
|
|
143
161
|
}ifelse
|
|
144
162
|
} bind def
|
|
145
163
|
|
|
146
|
-
|
|
164
|
+
/before_virtual_page_create 3 dict def
|
|
165
|
+
before_virtual_page_create begin
|
|
166
|
+
/proc {} bind def
|
|
167
|
+
/except [ ] def
|
|
168
|
+
/only [ ] def
|
|
169
|
+
end
|
|
170
|
+
/after_virtual_page_create 3 dict def
|
|
171
|
+
after_virtual_page_create begin
|
|
172
|
+
/proc {} bind def
|
|
173
|
+
/except [ ] def
|
|
174
|
+
/only [ ] def
|
|
175
|
+
end
|
data/lib/rghost/ps/code128.font
CHANGED
|
File without changes
|
data/lib/rghost/ps/code39.font
CHANGED
|
File without changes
|