prawn 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -1
- data/data/fonts/Action Man.dfont +0 -0
- data/examples/general/measurement_units.rb +2 -2
- data/examples/graphics/image_flow.rb +2 -2
- data/examples/graphics/stroke_bounds.rb +1 -1
- data/examples/m17n/win_ansi_charset.rb +3 -3
- data/examples/text/dfont.rb +49 -0
- data/examples/text/flowing_text_with_header_and_footer.rb +2 -48
- data/examples/text/font_calculations.rb +7 -6
- data/examples/text/font_size.rb +4 -4
- data/examples/text/text_flow.rb +1 -1
- data/lib/prawn.rb +6 -3
- data/lib/prawn/compatibility.rb +12 -17
- data/lib/prawn/document.rb +10 -10
- data/lib/prawn/document/internals.rb +8 -3
- data/lib/prawn/document/text.rb +39 -57
- data/lib/prawn/document/text/box.rb +1 -2
- data/lib/prawn/document/text/wrapping.rb +59 -0
- data/lib/prawn/errors.rb +0 -8
- data/lib/prawn/font.rb +192 -277
- data/lib/prawn/font/afm.rb +199 -0
- data/lib/prawn/font/dfont.rb +31 -0
- data/lib/prawn/font/ttf.rb +318 -0
- data/lib/prawn/graphics.rb +7 -2
- data/lib/prawn/images/png.rb +1 -1
- data/lib/prawn/reference.rb +7 -4
- data/spec/font_spec.rb +154 -61
- data/spec/text_spec.rb +47 -6
- data/vendor/pdf-inspector/lib/pdf/inspector.rb +1 -1
- data/vendor/ttfunk/example.rb +42 -2
- data/vendor/ttfunk/lib/ttfunk.rb +96 -42
- data/vendor/ttfunk/lib/ttfunk/directory.rb +17 -0
- data/vendor/ttfunk/lib/ttfunk/encoding/mac_roman.rb +88 -0
- data/vendor/ttfunk/lib/ttfunk/encoding/windows_1252.rb +69 -0
- data/vendor/ttfunk/lib/ttfunk/reader.rb +44 -0
- data/vendor/ttfunk/lib/ttfunk/resource_file.rb +78 -0
- data/vendor/ttfunk/lib/ttfunk/subset.rb +18 -0
- data/vendor/ttfunk/lib/ttfunk/subset/base.rb +141 -0
- data/vendor/ttfunk/lib/ttfunk/subset/mac_roman.rb +46 -0
- data/vendor/ttfunk/lib/ttfunk/subset/unicode.rb +48 -0
- data/vendor/ttfunk/lib/ttfunk/subset/unicode_8bit.rb +63 -0
- data/vendor/ttfunk/lib/ttfunk/subset/windows_1252.rb +51 -0
- data/vendor/ttfunk/lib/ttfunk/subset_collection.rb +72 -0
- data/vendor/ttfunk/lib/ttfunk/table.rb +37 -18
- data/vendor/ttfunk/lib/ttfunk/table/cmap.rb +24 -84
- data/vendor/ttfunk/lib/ttfunk/table/cmap/format00.rb +54 -0
- data/vendor/ttfunk/lib/ttfunk/table/cmap/format04.rb +126 -0
- data/vendor/ttfunk/lib/ttfunk/table/cmap/subtable.rb +79 -0
- data/vendor/ttfunk/lib/ttfunk/table/glyf.rb +64 -0
- data/vendor/ttfunk/lib/ttfunk/table/glyf/compound.rb +81 -0
- data/vendor/ttfunk/lib/ttfunk/table/glyf/simple.rb +37 -0
- data/vendor/ttfunk/lib/ttfunk/table/head.rb +38 -19
- data/vendor/ttfunk/lib/ttfunk/table/hhea.rb +35 -21
- data/vendor/ttfunk/lib/ttfunk/table/hmtx.rb +40 -13
- data/vendor/ttfunk/lib/ttfunk/table/kern.rb +69 -38
- data/vendor/ttfunk/lib/ttfunk/table/kern/format0.rb +62 -0
- data/vendor/ttfunk/lib/ttfunk/table/loca.rb +43 -0
- data/vendor/ttfunk/lib/ttfunk/table/maxp.rb +34 -11
- data/vendor/ttfunk/lib/ttfunk/table/name.rb +109 -42
- data/vendor/ttfunk/lib/ttfunk/table/os2.rb +78 -0
- data/vendor/ttfunk/lib/ttfunk/table/post.rb +91 -0
- data/vendor/ttfunk/lib/ttfunk/table/post/format10.rb +43 -0
- data/vendor/ttfunk/lib/ttfunk/table/post/format20.rb +35 -0
- data/vendor/ttfunk/lib/ttfunk/table/post/format25.rb +23 -0
- data/vendor/ttfunk/lib/ttfunk/table/post/format30.rb +17 -0
- data/vendor/ttfunk/lib/ttfunk/table/post/format40.rb +17 -0
- data/vendor/ttfunk/lib/ttfunk/table/simple.rb +14 -0
- metadata +54 -25
- data/examples/table/addressbook.csv +0 -6
- data/examples/table/cell.rb +0 -40
- data/examples/table/currency.csv +0 -1834
- data/examples/table/fancy_table.rb +0 -62
- data/examples/table/ruport_formatter.rb +0 -53
- data/examples/table/table.rb +0 -51
- data/examples/table/table_alignment.rb +0 -18
- data/examples/table/table_border_color.rb +0 -17
- data/examples/table/table_colspan.rb +0 -19
- data/examples/table/table_header_color.rb +0 -19
- data/examples/table/table_header_underline.rb +0 -15
- data/lib/prawn/document/table.rb +0 -338
- data/lib/prawn/font/cmap.rb +0 -59
- data/lib/prawn/font/metrics.rb +0 -378
- data/lib/prawn/font/wrapping.rb +0 -47
- data/lib/prawn/graphics/cell.rb +0 -264
- data/spec/metrics_spec.rb +0 -62
- data/spec/table_spec.rb +0 -179
- data/vendor/ttfunk/lib/ttfunk/table/directory.rb +0 -25
@@ -1,25 +0,0 @@
|
|
1
|
-
module TTFunk
|
2
|
-
class Table
|
3
|
-
class Directory < Table
|
4
|
-
def initialize(fh)
|
5
|
-
@scaler_type, @table_count, @search_range,
|
6
|
-
@entry_selector, @range_shift = fh.read(12).unpack("Nnnnn")
|
7
|
-
parse_table_list(fh)
|
8
|
-
end
|
9
|
-
|
10
|
-
def parse_table_list(fh)
|
11
|
-
first_table = parse_table(fh)
|
12
|
-
@tables = first_table
|
13
|
-
offset = first_table[first_table.keys.first][:offset]
|
14
|
-
|
15
|
-
@tables.update(parse_table(fh)) while fh.pos < offset
|
16
|
-
end
|
17
|
-
|
18
|
-
def parse_table(fh)
|
19
|
-
tag, checksum, offset, length = fh.read(16).unpack("a4NNN")
|
20
|
-
{ tag => {
|
21
|
-
:checksum => checksum, :offset => offset, :length => length } }
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|