rghost 0.7.4 → 0.8
Sign up to get free protection for your applications and to get access to all the features.
- 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/show.rb
CHANGED
@@ -1,31 +1,88 @@
|
|
1
1
|
require "ps_object"
|
2
2
|
require "ruby_to_ps" #to_string
|
3
3
|
|
4
|
-
#
|
5
|
-
class Show < PsObject
|
4
|
+
#Writes a text on the current row or point with align.
|
5
|
+
class RGhost::Show < RGhost::PsObject
|
6
6
|
|
7
|
-
attr_accessor :text, :align
|
7
|
+
attr_accessor :text, :align, :tag
|
8
|
+
DEFAULT_OPTIONS={:tag => :default_font, :align => :show_left}
|
9
|
+
include RGhost::RubyToPs
|
10
|
+
#===Options
|
11
|
+
#
|
12
|
+
#* <tt>:tag or :with</tt> - Use predefined tag
|
13
|
+
#* <tt>:color</tt> - Override color of the tag
|
14
|
+
#* <tt>:align</tt> - Align of the text
|
15
|
+
#===Examples
|
16
|
+
#The vertical line is the current point. For align by point
|
17
|
+
# doc.moveto :x => 3, :y => 4
|
18
|
+
# doc.show "Foo Bar Baz", :align => :show_left #default
|
19
|
+
#link:images/show01.png
|
20
|
+
#
|
21
|
+
# doc.moveto :x => 3, :y => 4
|
22
|
+
# doc.show "Foo Bar Baz", :align => :show_center
|
23
|
+
#link:images/show02.png
|
24
|
+
#
|
25
|
+
# doc.moveto :x => 3, :y => 4
|
26
|
+
# doc.show "Foo Bar Baz", :align => :show_right
|
27
|
+
#link:images/show03.png
|
28
|
+
#
|
29
|
+
#For the the current row it's not necessary positioned using moveto. Like below
|
30
|
+
# doc.show "Foo Bar Baz", :align => :show_right
|
31
|
+
#Now justification in page
|
32
|
+
#
|
33
|
+
# doc.show "Foo Bar Baz", :align => :page_left
|
34
|
+
#
|
35
|
+
#link:images/show04.png
|
36
|
+
#
|
37
|
+
# doc.show "Foo Bar Baz", :align => :page_center
|
38
|
+
#
|
39
|
+
#link:images/show05.png
|
40
|
+
#
|
41
|
+
# doc.show "Foo Bar Baz", :align => :page_right
|
42
|
+
#
|
43
|
+
#link:images/show06.png
|
44
|
+
#
|
45
|
+
#====Overrinding tag's color
|
46
|
+
#
|
47
|
+
# doc.show "Foo Bar Baz", :with => :my_italic, :align => :page_center, :color => :red
|
48
|
+
#
|
49
|
+
#link:images/show07.png
|
50
|
+
#
|
51
|
+
#Many tags per row
|
52
|
+
# doc=Document.new
|
53
|
+
# doc.define_tags do
|
54
|
+
# tag :font1, :name => 'Helvetica', :size => 10, :color => '#F34811'
|
55
|
+
# tag :font2, :name => 'Times', :size => 14, :color => '#A4297A'
|
56
|
+
# tag :font3, :name => 'TimesBold', :size => 18, :color => '#AA3903'
|
57
|
+
# end
|
58
|
+
#
|
59
|
+
# doc.show "foo bar baz ", :with => :font1
|
60
|
+
# doc.show "qux quux ", :with => :font2
|
61
|
+
# doc.show "corge ", :with => :font3
|
62
|
+
# doc.show "grault garply ",:with => :font2
|
63
|
+
# doc.show "qux quux", :with => :font1
|
64
|
+
#
|
65
|
+
#link:images/show08.png
|
8
66
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
# Show.new("Frog say", :align => :show_right) #antes do ponto corrente
|
15
|
-
#Alinhamento pela p�gina
|
16
|
-
# Show.new("Page align", :align => :page_center) #centro da p�gina
|
17
|
-
# Show.new("Page align", :align => :page_left) #esquerda da p�gina
|
18
|
-
# Show.new("Page align", :align => :page_right) #direita da p�gina
|
19
|
-
def initialize(text,align={ :align=>:show_left } )
|
20
|
-
super(text)
|
21
|
-
@align=align[:align]
|
22
|
-
|
67
|
+
|
68
|
+
|
69
|
+
def initialize(text,options={ :align=>:show_left, :tag => :default_font, :color => 0 } )
|
70
|
+
@text = text
|
71
|
+
@options=DEFAULT_OPTIONS.dup.merge(options)
|
23
72
|
end
|
24
73
|
|
25
74
|
def ps
|
26
|
-
|
27
|
-
|
75
|
+
rtext=RGhost::PsObject.new
|
76
|
+
#rtext.raw Color.create(@options[:color] || 0)
|
77
|
+
if @options[:with] || @options[:tag]
|
78
|
+
f="_#{@options[:with] || @options[:tag]}"
|
79
|
+
rtext.raw f
|
80
|
+
end
|
81
|
+
rtext.raw RGhost::Color.create(@options[:color]) if @options[:color]
|
82
|
+
rtext.raw to_string(@text)
|
83
|
+
rtext.raw @options[:align]
|
84
|
+
|
85
|
+
rtext.graphic_scope
|
28
86
|
end
|
29
87
|
|
30
88
|
end
|
31
|
-
|
@@ -1,17 +1,13 @@
|
|
1
1
|
require "ps_object"
|
2
|
-
require
|
3
|
-
|
4
|
-
class StaticDocumentCallback < Function
|
2
|
+
require 'function'
|
3
|
+
|
4
|
+
class RGhost::StaticDocumentCallback < RGhost::Function #:nodoc:
|
5
5
|
ACCEPT=[:before_document_create,
|
6
6
|
:first_page,
|
7
7
|
:last_page,
|
8
8
|
:after_document_create
|
9
9
|
]
|
10
10
|
|
11
|
-
#Nova inst�ncia de StaticDocumentCallback. N�o aceita :only ou :excpet
|
12
|
-
# sc=StaticDocumentCallback.new :before_document_create do
|
13
|
-
# set HorizontalLine.new
|
14
|
-
# end
|
15
11
|
def initialize(name,&block)
|
16
12
|
raise NameError.new("#{name} no accept in #{self.class}") unless ACCEPT.include? name
|
17
13
|
super(name,&block)
|
data/lib/rghost/text.rb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
require "ps_object"
|
2
|
+
require "units"
|
3
|
+
require "font"
|
4
|
+
require "ruby_to_ps"
|
5
|
+
#Wraps the text so as the it fits on the page(:area_x). Wrapping happens at whitespace characters without hyphenation.
|
6
|
+
#Additionally you can make use of predefined tag and the special tag <br/> to break row. You can disable the parse with second parameter tag_parse=false.
|
7
|
+
#===Examples
|
8
|
+
# doc=Document.new
|
9
|
+
# doc.define_tags do
|
10
|
+
# tag :font1, :name => 'Helvetica', :size => 10, :color => '#F34811'
|
11
|
+
# tag :font2, :name => 'Times', :size => 11, :color => '#A4297A'
|
12
|
+
# tag :font3, :name => 'TimesBold', :size => 12, :color => '#AA3903'
|
13
|
+
# end
|
14
|
+
# my_text="<font1>foo, bar, baz</font1>,<font2>qux, quux</font2>, corge, grault, garply, waldo, <font3>fred, plugh,</font3> xyzzy,<br/> thud, bing"
|
15
|
+
# doc.text my_text
|
16
|
+
#
|
17
|
+
#link:images/text01.png
|
18
|
+
#
|
19
|
+
#===Without parse
|
20
|
+
# text="<font1>foo, bar, baz</font1>,<font2>qux, quux</font2>, corge, grault, garply, waldo, <font3>fred, plugh,</font3> xyzzy,<br/> thud, bing"
|
21
|
+
# doc.text text,false
|
22
|
+
#
|
23
|
+
#link:images/text02.png
|
24
|
+
class RGhost::Text < RGhost::PsObject
|
25
|
+
include RGhost::RubyToPs
|
26
|
+
include RGhost::ParseText
|
27
|
+
attr_reader :rows
|
28
|
+
|
29
|
+
def initialize(text,tag_parse=true)
|
30
|
+
super("")
|
31
|
+
@text=text
|
32
|
+
@tag_parse=tag_parse
|
33
|
+
@options={:text_align => :left}
|
34
|
+
end
|
35
|
+
|
36
|
+
def ps
|
37
|
+
text_to_ps #from RGhost::ParseText
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
end
|
44
|
+
|
data/lib/rghost/text_in.rb
CHANGED
@@ -1,27 +1,49 @@
|
|
1
1
|
require "ps_object"
|
2
2
|
require "cursor"
|
3
3
|
require "ruby_to_ps"
|
4
|
-
#
|
5
|
-
class TextIn < PsObject
|
6
|
-
include RubyToPs
|
7
|
-
DEFAULT_OPTIONS={:x=> :limit_left, :
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
#TextIn is a helper to combine the cursor positioning and text output into one step.
|
5
|
+
class RGhost::TextIn < RGhost::PsObject
|
6
|
+
include RGhost::RubyToPs
|
7
|
+
DEFAULT_OPTIONS={:x=> :limit_left,:y=> :current_row, :tag => :default_font, :write => "Ruby Ghost API - current_row = %row% "}
|
8
|
+
#===Options
|
9
|
+
#* <tt>:x and :y</tt> - Initial position.
|
10
|
+
#* <tt>:tag or :with</tt> - Use predefined tag.
|
11
|
+
#* <tt>:color</tt> - Override color of the tag.
|
12
|
+
#* <tt>:text or :write</tt> - The text.
|
13
|
+
#===Examples
|
14
|
+
# doc=RGhost::Document.new
|
15
|
+
# doc.text_in :x => 3, :y => 4, :write => "Foo Bar Baz", :tag => :h1
|
16
|
+
#====Rotating
|
17
|
+
# doc.newpath do
|
18
|
+
# translate :x => 3, :y=> 4
|
19
|
+
# rotate 45
|
20
|
+
# text_in :x => 0, :y => 0, :write => "Foo Bar Baz1", :tag => :font2
|
21
|
+
# end
|
22
|
+
#====Eval postscript internal
|
23
|
+
#TextIn will eval postscript internal variables you pass in between % signs. Sounds complex, huh? Let's see an example:
|
24
|
+
# doc.text_in :x=> 3.5, :y=> 5.5, :text => "this is %row% row and current page %current_page%"
|
14
25
|
def initialize(options={})
|
15
26
|
|
16
27
|
@options=DEFAULT_OPTIONS.dup.merge(options)
|
17
28
|
end
|
18
29
|
|
19
30
|
def ps
|
20
|
-
text=PsObject.new
|
21
|
-
text.set Cursor.moveto(@options)
|
22
|
-
text.raw
|
31
|
+
text=RGhost::PsObject.new
|
32
|
+
text.set RGhost::Cursor.moveto(@options)
|
33
|
+
#text.raw "currentfont"
|
34
|
+
#text.raw "currentrgbcolor"
|
35
|
+
text.raw RGhost::Color.create(@options[:color]) if @options[:color]
|
36
|
+
f="_#{@options[:with] || @options[:tag] || :default_font}"
|
37
|
+
text.raw f
|
38
|
+
#text.call @options[:with] || @options[:tag] || :default_font
|
39
|
+
|
40
|
+
text.raw string_eval(@options[:write] || @options[:text])
|
41
|
+
#text.raw "setrgbcolor"
|
42
|
+
#text.raw "setfont"
|
43
|
+
text.graphic_scope
|
23
44
|
#text.set PsObject.new(@options[:text])
|
24
|
-
|
45
|
+
|
46
|
+
|
25
47
|
|
26
48
|
|
27
49
|
end
|
data/lib/rghost/textarea.rb
CHANGED
@@ -2,114 +2,87 @@ require "ps_object"
|
|
2
2
|
require "units"
|
3
3
|
require "font"
|
4
4
|
require "ruby_to_ps"
|
5
|
+
require 'parse_text'
|
6
|
+
#TextArea wraps the text so as the it fits in a box of a given width. Wrapping happens at whitespace characters without hyphenation.
|
7
|
+
#Additionally you can make use of predefined tag and the special tag <br/> to break row.
|
8
|
+
#The alignment can be left, right and centered.
|
9
|
+
#
|
10
|
+
#PS: It not jumps pages.
|
5
11
|
|
6
|
-
|
7
|
-
|
8
|
-
include
|
12
|
+
class RGhost::TextArea < RGhost::PsObject
|
13
|
+
include RGhost::RubyToPs
|
14
|
+
include RGhost::ParseText
|
15
|
+
|
9
16
|
DEFAULT_OPTIONS={
|
10
17
|
:width => :area_x,
|
11
18
|
:row_height => :row_height,
|
12
|
-
:x
|
13
|
-
:y
|
14
|
-
:
|
15
|
-
|
16
|
-
:italic => :font_italic,
|
17
|
-
:bold_italic => :font_bold_italic
|
19
|
+
:x=> :limit_left,
|
20
|
+
:y=> :current_row,
|
21
|
+
:text_align => :left
|
22
|
+
|
18
23
|
}
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#TextArea personalizando fontes
|
30
|
-
# doc=Document.new
|
31
|
-
# doc.define(:title_font) do
|
32
|
-
# set Font.new(:name => "Times", :size => 24)
|
33
|
-
# end
|
34
|
-
# doc.define(:my_italic) do
|
35
|
-
# set Font.new(:name => "HelveticaOblique", :size => 10)
|
36
|
-
# end
|
37
|
-
# text="<b>My Report</b><br><br>You will notice a new <i>Services</i> tab on your project"
|
38
|
-
# ta=TextArea.new(text, :x=> 6, :y=> 20, :bold => :title_font, :italic => :my_italic)
|
39
|
-
# doc.set ta
|
40
|
-
# doc.render :pdf
|
24
|
+
|
25
|
+
#===Options
|
26
|
+
#* <tt>:x and :y</tt> - Initial position.
|
27
|
+
#* <tt>:row_height</tt> - Row height :)
|
28
|
+
#* <tt>:with</tt> - Max wide of the text
|
29
|
+
#* <tt>:text_align</tt> - Align of the text in the virtual box using :left, :right and :center.
|
30
|
+
#===Examples
|
31
|
+
# doc=RGhost::Document.new
|
32
|
+
# my_text="<font1>foo, bar, baz</font1><font2>qux, quux</font2>, corge, grault, garply, waldo, <font3>fred, plugh,</font3> xyzzy,<br/> thud, bing"
|
33
|
+
# doc.text_area my_text
|
41
34
|
#
|
42
|
-
|
35
|
+
#link:images/text_area01.png
|
36
|
+
#
|
37
|
+
# doc.text_area my_text, :width =>3
|
38
|
+
#
|
39
|
+
#link:images/text_area02.png
|
40
|
+
#
|
41
|
+
# doc.text_area my_text, :width =>3, :text_align => :center
|
42
|
+
#
|
43
|
+
#link:images/text_area03.png
|
44
|
+
#
|
45
|
+
# doc.text_area my_text, :width =>3, :text_align => :right
|
46
|
+
#
|
47
|
+
#link:images/text_area04.png
|
48
|
+
#
|
49
|
+
# doc.text_area my_text, :width =>3, :text_align => :right, :x => 3
|
50
|
+
#
|
51
|
+
#link:images/text_area05.png
|
52
|
+
#
|
53
|
+
# doc.text_area my_text, :width =>3, :text_align => :right, :x => 3, :row_height => 0.6
|
54
|
+
#
|
55
|
+
#link:images/text_area06.png
|
56
|
+
|
57
|
+
def initialize(text,options={},tag_parse=true)
|
43
58
|
super("")
|
44
|
-
@text=
|
59
|
+
@text=text
|
60
|
+
@tag_parse=tag_parse
|
61
|
+
options||={}
|
45
62
|
@options=DEFAULT_OPTIONS.dup.merge(options)
|
46
63
|
|
47
|
-
|
48
64
|
end
|
49
65
|
|
50
66
|
def ps
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
y=Units::parse( @options[:y] )
|
55
|
-
|
56
|
-
<<TEXT_AREA_HEAD
|
57
|
-
/textbox {
|
58
|
-
/line_space { #{ls} } def
|
59
|
-
/lm 0 def
|
60
|
-
/bm 0 def
|
61
|
-
/rm #{w} def
|
62
|
-
/tm 0 def
|
63
|
-
lm tm moveto
|
64
|
-
} def
|
65
|
-
/newline {
|
66
|
-
tm line_space sub
|
67
|
-
/tm exch def
|
68
|
-
lm tm moveto
|
69
|
-
} def
|
70
|
-
textarea_defaults
|
71
|
-
gsave
|
72
|
-
#{x} #{y} translate
|
73
|
-
textbox
|
74
|
-
#{@options[:normal]}
|
75
|
-
#{text_to_ps(@text)}
|
76
|
-
grestore
|
77
|
-
TEXT_AREA_HEAD
|
78
|
-
|
79
|
-
end
|
80
|
-
|
81
|
-
private
|
82
|
-
|
83
|
-
def text_to_ps(text)
|
84
|
-
text.gsub!(/<br\/?>/,"<br></br>")
|
85
|
-
text="<b></b>"+text
|
86
|
-
t=text.scan(/(<\w{1,2}>[^<]*<\/\w{1,2}>)([^<>]*)/).flatten
|
87
|
-
t.shift
|
67
|
+
bw=RGhost::Units::parse(@options[:width])
|
68
|
+
ta=@options[:text_align]
|
69
|
+
rh=RGhost::Units::parse(@options[:row_height])
|
88
70
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
when /^<b>/: formated_text << "#{@options[:bold]} (#{exp.gsub(/<\/?b>/,'')})S \n"
|
95
|
-
when /^<i>/: formated_text << "#{@options[:italic]} (#{exp.gsub(/<\/?i>/,'')})S \n"
|
96
|
-
when /^<bi>/: formated_text << "#{@options[:bold_italic]} (#{exp.gsub(/<\/?bi>/,'')})S \n"
|
97
|
-
when /^<br><\/br>/: formated_text << " L \n"
|
98
|
-
when /^\s?$/:
|
99
|
-
else formated_text << "#{@options[:normal]} (#{exp})S\n"
|
100
|
-
end
|
101
|
-
|
71
|
+
graph=RGhost::Graphic.new do
|
72
|
+
set RGhost::Variable.new(':bw',bw)
|
73
|
+
set RGhost::Variable.new('text_align',"/#{ta}")
|
74
|
+
# set Variable.new(':rp',rp)
|
75
|
+
set RGhost::Variable.new(':rh',rh)
|
102
76
|
end
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
77
|
+
graph.set RGhost::Cursor.translate(@options)
|
78
|
+
graph.set RGhost::Cursor.moveto(:x => 0, :y =>0)
|
79
|
+
#graph.raw ":text_area #{text_to_ps} :text_proc"
|
80
|
+
graph.raw text_to_ps
|
81
|
+
graph
|
82
|
+
#final_text=text_to_ps
|
83
|
+
|
109
84
|
end
|
110
85
|
|
86
|
+
|
111
87
|
end
|
112
88
|
|
113
|
-
|
114
|
-
#puts TextArea.new
|
115
|
-
#puts text_to_ps(texto)
|
data/lib/rghost/units.rb
CHANGED
@@ -1,81 +1,82 @@
|
|
1
1
|
require "function"
|
2
2
|
require "ps_object"
|
3
|
-
#
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
#The postscript default unit is the 1/72th inch. RGhost uses the centimeters (cm) as it's default, mainly for positioning coordinates and numeric object sizes (if the size is a String, it won't be parsed to the default unit). This setting can be changed setting the value of RGhost::Config::GS[:unit] before the document is created using any of the Units child classes.
|
4
|
+
#===Example:
|
5
|
+
#
|
6
|
+
#====Setting to inches.
|
7
|
+
# RGhost::Config::GS[:unit]=Units::Inch
|
8
|
+
# doc.moveto :x => 1, :y => 2 #=> 1 inch x 2 inches
|
9
|
+
#====Explicitly setting to Cm.
|
10
|
+
# doc.moveto :x => '1 cm' , :y => '2 cm'
|
11
|
+
#====Using the Postscript unit
|
12
|
+
# doc.moveto :x => '100' , :y => '200'
|
13
|
+
module RGhost::Units
|
14
|
+
|
15
|
+
class Unit < RGhost::PsObject
|
7
16
|
|
8
|
-
|
17
|
+
attr_accessor :value
|
9
18
|
|
10
|
-
|
11
|
-
|
12
|
-
|
19
|
+
def initialize(value=0)
|
20
|
+
@value=value
|
21
|
+
end
|
13
22
|
|
14
|
-
|
23
|
+
def ps
|
15
24
|
|
16
|
-
|
17
|
-
|
25
|
+
"#{@value} #{self.class.to_s.gsub('RGhost::Units::','').downcase} "
|
26
|
+
end
|
18
27
|
|
19
|
-
|
20
|
-
|
21
|
-
|
28
|
+
def Unit.define
|
29
|
+
""
|
30
|
+
end
|
22
31
|
end
|
23
32
|
#n/72 * 2.545
|
24
33
|
class Cm < Unit
|
25
34
|
|
26
|
-
|
27
|
-
|
35
|
+
def Cm.define
|
36
|
+
Function.new("cm","72 div 2.545 mul")
|
28
37
|
|
29
|
-
|
38
|
+
end
|
30
39
|
|
31
40
|
end
|
32
41
|
#n*72
|
33
42
|
class Inch < Unit
|
34
43
|
|
35
|
-
|
36
|
-
|
37
|
-
|
44
|
+
def Inch.define
|
45
|
+
RGhost::Function.new("inch","72 mul")
|
46
|
+
end
|
38
47
|
|
39
48
|
end
|
40
49
|
|
41
50
|
class PSUnit < Unit
|
42
51
|
|
43
52
|
def ps
|
44
|
-
|
53
|
+
"#{@value} "
|
45
54
|
end
|
46
55
|
|
47
56
|
end
|
48
57
|
|
49
58
|
|
50
59
|
|
51
|
-
#
|
60
|
+
#Parses units
|
52
61
|
# Units::DEFAULT=Utits::Cm
|
53
|
-
# Units.parse(2)
|
54
|
-
# Units.parse(:
|
55
|
-
# Units.parse("3 inch")
|
56
|
-
# Units.parse("2")
|
57
|
-
#
|
62
|
+
# Units.parse(2) #=> "2 cm"
|
63
|
+
# Units.parse(:current_row) #=> "current_row"
|
64
|
+
# Units.parse("3 inch") #=> "3 inch"
|
65
|
+
# Units.parse("2") #=> "2"
|
66
|
+
#
|
67
|
+
#Using US metric
|
58
68
|
# Units::DEFAULT=Utits::Inch
|
59
|
-
# Units.parse(2)
|
60
|
-
# Units.parse(:
|
61
|
-
# Units.parse("3 cm")
|
62
|
-
# Units.parse("5")
|
63
|
-
def
|
69
|
+
# Units.parse(2) #=> "2 inch"
|
70
|
+
# Units.parse(:current_row) #=> "current_row"
|
71
|
+
# Units.parse("3 cm") #=> "3 cm"
|
72
|
+
# Units.parse("5") #=> "5"
|
73
|
+
def self.parse(value)
|
64
74
|
if value.is_a? Numeric
|
65
|
-
|
75
|
+
RGhost::Config::GS[:unit].new(value)
|
66
76
|
else
|
67
|
-
PsObject.new(value)
|
77
|
+
RGhost::PsObject.new(value)
|
68
78
|
end
|
69
79
|
end
|
70
80
|
end
|
71
|
-
|
72
|
-
#puts c.ps
|
73
|
-
#puts Cm.define
|
74
|
-
#
|
75
|
-
# u=Unit.new(3)
|
76
|
-
# puts u.to_ps+c.to_ps
|
77
|
-
#
|
78
|
-
# i=Inch.new(9)
|
79
|
-
# puts i.to_ps
|
80
|
-
# puts Inch.define
|
81
|
+
|
81
82
|
|
data/lib/rghost/variable.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
require "ps_object"
|
2
|
-
#
|
3
|
-
class Variable < PsObject
|
2
|
+
#Creates Postscript variable
|
3
|
+
class RGhost::Variable < RGhost::PsObject
|
4
4
|
|
5
|
-
|
6
|
-
# v=Variable.new(:mytext, "
|
5
|
+
#===Example
|
6
|
+
# v=Variable.new(:mytext, Show.new("Fooo Barrr") )
|
7
7
|
# doc.set v
|
8
8
|
def initialize(name,value)
|
9
9
|
super("/#{name} #{value} def")
|
data/lib/rghost/vertical_line.rb
CHANGED
@@ -2,27 +2,35 @@ require "ps_object"
|
|
2
2
|
require "units"
|
3
3
|
require "load"
|
4
4
|
|
5
|
-
#
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
#
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
5
|
+
#Creates vertical line starting from current row.
|
6
|
+
class RGhost::VerticalLine < RGhost::PsObject
|
7
|
+
DEFAULT_OPTIONS={
|
8
|
+
:start_in=>:limit_left,:size=>:area_y,
|
9
|
+
:border => RGhost::Border::DEFAULT_OPTIONS
|
10
|
+
}
|
11
|
+
#Draws a vertical line where :start_in => y position and :size => size of line.
|
12
|
+
#===Example
|
13
|
+
# doc=Document.new
|
14
|
+
# doc.vertical_line :start_in => 1, :size => 2, :border => {:color => :red}
|
15
|
+
def initialize(options=RGhost::Border::DEFAULT_OPTIONS)
|
16
|
+
super(""){}
|
17
|
+
options=DEFAULT_OPTIONS.dup.merge(options)
|
18
|
+
start_in= RGhost::Units::parse(options[:start_in] || :limit_left)
|
19
|
+
size= RGhost::Units::parse(options[:size]|| :area_y)
|
20
|
+
g=RGhost::Graphic.new
|
21
|
+
g.set RGhost::Border.new(options[:border]) if options[:border]
|
22
|
+
g.raw "#{start_in} #{size} vertical_line "
|
23
|
+
set g
|
19
24
|
end
|
20
|
-
#
|
25
|
+
#Draws a vertical line with size or :row_height of the document.
|
21
26
|
# doc=Document.new
|
22
|
-
# doc.
|
23
|
-
def
|
24
|
-
|
25
|
-
|
27
|
+
# doc.vertical_line_row
|
28
|
+
def self.row(border=RGhost::Border::DEFAULT_OPTIONS)
|
29
|
+
|
30
|
+
g=RGhost::Graphic.new
|
31
|
+
g.set RGhost::Border.new(border)
|
32
|
+
g.raw :vlrf
|
33
|
+
g
|
26
34
|
end
|
27
35
|
|
28
36
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
#Defines virtual pages for the Document by method virtual_pages
|
2
|
+
class RGhost::VirtualPages < RGhost::PsObject
|
3
|
+
|
4
|
+
DEFAULT_OPTIONS={:width => 5, :margin_left => 0}
|
5
|
+
include RGhost::RubyToPs
|
6
|
+
def initialize(&block)
|
7
|
+
super(''){}
|
8
|
+
@pages=[]
|
9
|
+
instance_eval(&block) if block
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
def new_page(options=RGhost::VirtualPages::DEFAULT_OPTIONS)
|
14
|
+
options.merge(RGhost::VirtualPages::DEFAULT_OPTIONS)
|
15
|
+
|
16
|
+
@pages << options
|
17
|
+
end
|
18
|
+
|
19
|
+
def ps
|
20
|
+
first=true
|
21
|
+
all_pages=@pages.map do |p|
|
22
|
+
w=RGhost::Units::parse(p[:width])
|
23
|
+
if first
|
24
|
+
first=false
|
25
|
+
"[#{w}]"
|
26
|
+
else
|
27
|
+
m=RGhost::Units::parse(p[:margin_left])
|
28
|
+
|
29
|
+
"[#{w} #{m}]"
|
30
|
+
|
31
|
+
end
|
32
|
+
#"[#{m} #{w}]"
|
33
|
+
end
|
34
|
+
o=RGhost::PsObject.new
|
35
|
+
o.set RGhost::Variable.new(:has_vp?, true)
|
36
|
+
o.raw "/vp_params [ #{all_pages.join('')} ] def "
|
37
|
+
o.call :vp_proc
|
38
|
+
o
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|