ttfunk 1.6.2.1 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -1
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +15 -1
- data/lib/ttfunk.rb +3 -2
- data/lib/ttfunk/bit_field.rb +1 -1
- data/lib/ttfunk/collection.rb +8 -2
- data/lib/ttfunk/encoded_string.rb +3 -3
- data/lib/ttfunk/max.rb +1 -0
- data/lib/ttfunk/min.rb +1 -0
- data/lib/ttfunk/one_based_array.rb +1 -1
- data/lib/ttfunk/otf_encoder.rb +1 -1
- data/lib/ttfunk/reader.rb +3 -3
- data/lib/ttfunk/sci_form.rb +1 -1
- data/lib/ttfunk/subset.rb +3 -3
- data/lib/ttfunk/subset/base.rb +24 -21
- data/lib/ttfunk/subset/code_page.rb +16 -19
- data/lib/ttfunk/subset/unicode.rb +8 -6
- data/lib/ttfunk/subset/unicode_8bit.rb +14 -12
- data/lib/ttfunk/sum.rb +1 -0
- data/lib/ttfunk/table/cff.rb +17 -17
- data/lib/ttfunk/table/cff/charset.rb +31 -30
- data/lib/ttfunk/table/cff/charsets.rb +3 -3
- data/lib/ttfunk/table/cff/charstring.rb +54 -55
- data/lib/ttfunk/table/cff/dict.rb +6 -4
- data/lib/ttfunk/table/cff/encoding.rb +20 -21
- data/lib/ttfunk/table/cff/encodings.rb +1 -1
- data/lib/ttfunk/table/cff/fd_selector.rb +14 -11
- data/lib/ttfunk/table/cff/font_index.rb +7 -6
- data/lib/ttfunk/table/cff/index.rb +6 -5
- data/lib/ttfunk/table/cff/one_based_index.rb +7 -3
- data/lib/ttfunk/table/cff/path.rb +5 -3
- data/lib/ttfunk/table/cff/top_dict.rb +7 -6
- data/lib/ttfunk/table/cff/top_index.rb +5 -4
- data/lib/ttfunk/table/cmap.rb +8 -6
- data/lib/ttfunk/table/cmap/format00.rb +7 -6
- data/lib/ttfunk/table/cmap/format04.rb +16 -15
- data/lib/ttfunk/table/cmap/format06.rb +6 -5
- data/lib/ttfunk/table/cmap/format10.rb +6 -5
- data/lib/ttfunk/table/cmap/format12.rb +13 -12
- data/lib/ttfunk/table/cmap/subtable.rb +4 -4
- data/lib/ttfunk/table/dsig.rb +11 -9
- data/lib/ttfunk/table/glyf.rb +3 -3
- data/lib/ttfunk/table/glyf/compound.rb +8 -8
- data/lib/ttfunk/table/hmtx.rb +6 -5
- data/lib/ttfunk/table/kern.rb +4 -4
- data/lib/ttfunk/table/kern/format0.rb +1 -1
- data/lib/ttfunk/table/loca.rb +7 -6
- data/lib/ttfunk/table/name.rb +6 -5
- data/lib/ttfunk/table/os2.rb +261 -151
- data/lib/ttfunk/table/post.rb +1 -1
- data/lib/ttfunk/table/sbix.rb +15 -13
- data/lib/ttfunk/table/vorg.rb +1 -1
- data/lib/ttfunk/ttf_encoder.rb +4 -4
- metadata +29 -99
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c6a1d61ab884e88dd7424c80680f5dac53de5d891645f5b3fb5699ebbcffce3
|
4
|
+
data.tar.gz: 7031ece12dacbf351ea1e98fceccca054bca245ddd7437a62ca746e1d85b40e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2481488976f0015fb0abf49c8fa510cf6b8ee6120d17eebd04a01d4fcda5c96397c8bcf729bf42efae8f08238ebe3cba914f082bac2966d92f867f62e87b92b
|
7
|
+
data.tar.gz: fc4561d7ff2892a7a8f1c752c473a4b6e0a1e7b17042e60c175c98ef83bea9cbbdf6893ddab92c841f9ec9759af9fa41617445d304903c585a6f20d111e59e6e
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
��5�*���pl�}�[���@p��-Q�������Ɗ������Ogs{s_IfBy��.˥�����y䩙��G�y&�@ӳ��B)<�w�U�D@4o���}�S#����q�e�NP�ki|x�}�B�sj��٭؏
|
2
|
+
AD�
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## 1.7.0
|
11
|
+
|
12
|
+
### Changes
|
13
|
+
|
14
|
+
* Allow gem installation on Ruby 3.0
|
15
|
+
|
16
|
+
Pavel Lobashov
|
17
|
+
|
18
|
+
* Allow TTC files to be read from IO object
|
19
|
+
|
20
|
+
Tom de Grunt
|
21
|
+
|
10
22
|
## [1.6.2.1]
|
11
23
|
|
12
24
|
### Fixed
|
@@ -198,7 +210,9 @@ Initial release as a standalone gem
|
|
198
210
|
|
199
211
|
|
200
212
|
|
201
|
-
[Unreleased]: https://github.com/prawnpdf/ttfunk/compare/1.
|
213
|
+
[Unreleased]: https://github.com/prawnpdf/ttfunk/compare/1.7.0...HEAD
|
214
|
+
[1.7.0]: https://github.com/prawnpdf/ttfunk/compare/1.6.2.1...1.7.0
|
215
|
+
[1.6.2.1]: https://github.com/prawnpdf/ttfunk/compare/1.6.2...1.6.2.1
|
202
216
|
[1.6.2]: https://github.com/prawnpdf/ttfunk/compare/1.6.1...1.6.2
|
203
217
|
[1.6.1]: https://github.com/prawnpdf/ttfunk/compare/1.6.0...1.6.1
|
204
218
|
[1.6.0]: https://github.com/prawnpdf/ttfunk/compare/1.5.1...1.6.0
|
data/lib/ttfunk.rb
CHANGED
@@ -21,6 +21,8 @@ require_relative 'ttfunk/sum'
|
|
21
21
|
require_relative 'ttfunk/one_based_array'
|
22
22
|
|
23
23
|
module TTFunk
|
24
|
+
class Error < StandardError; end
|
25
|
+
|
24
26
|
class File
|
25
27
|
attr_reader :contents
|
26
28
|
attr_reader :directory
|
@@ -53,8 +55,7 @@ module TTFunk
|
|
53
55
|
io_or_path = Pathname.new(io_or_path)
|
54
56
|
raise ArgumentError, "#{io_or_path} not found" unless io_or_path.file?
|
55
57
|
|
56
|
-
|
57
|
-
io
|
58
|
+
io_or_path.open('rb')
|
58
59
|
end
|
59
60
|
|
60
61
|
def initialize(contents, offset = 0)
|
data/lib/ttfunk/bit_field.rb
CHANGED
data/lib/ttfunk/collection.rb
CHANGED
@@ -5,8 +5,14 @@ module TTFunk
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
7
|
def self.open(path)
|
8
|
-
|
9
|
-
yield new(
|
8
|
+
if path.respond_to?(:read)
|
9
|
+
result = yield new(path)
|
10
|
+
path.rewind
|
11
|
+
result
|
12
|
+
else
|
13
|
+
::File.open(path, 'rb') do |io|
|
14
|
+
yield new(io)
|
15
|
+
end
|
10
16
|
end
|
11
17
|
end
|
12
18
|
|
@@ -34,7 +34,7 @@ module TTFunk
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def align!(width = 4)
|
37
|
-
if length % width
|
37
|
+
if (length % width).positive?
|
38
38
|
self << "\0" * (width - length % width)
|
39
39
|
end
|
40
40
|
|
@@ -47,8 +47,8 @@ module TTFunk
|
|
47
47
|
|
48
48
|
def string
|
49
49
|
unless placeholders.empty?
|
50
|
-
raise UnresolvedPlaceholderError,
|
51
|
-
"#{placeholders.size} unresolved placeholder(s)"
|
50
|
+
raise UnresolvedPlaceholderError,
|
51
|
+
"string contains #{placeholders.size} unresolved placeholder(s)"
|
52
52
|
end
|
53
53
|
|
54
54
|
io.string
|
data/lib/ttfunk/max.rb
CHANGED
data/lib/ttfunk/min.rb
CHANGED
data/lib/ttfunk/otf_encoder.rb
CHANGED
data/lib/ttfunk/reader.rb
CHANGED
@@ -33,15 +33,15 @@ module TTFunk
|
|
33
33
|
bytes = string.unpack('C*')
|
34
34
|
bytes.each_with_index do |c, i|
|
35
35
|
printf('%02X', c)
|
36
|
-
if (i + 1) % 16
|
36
|
+
if ((i + 1) % 16).zero?
|
37
37
|
puts
|
38
|
-
elsif (i + 1) % 8
|
38
|
+
elsif ((i + 1) % 8).zero?
|
39
39
|
print ' '
|
40
40
|
else
|
41
41
|
print ' '
|
42
42
|
end
|
43
43
|
end
|
44
|
-
puts unless bytes.length % 16
|
44
|
+
puts unless (bytes.length % 16).zero?
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
data/lib/ttfunk/sci_form.rb
CHANGED
data/lib/ttfunk/subset.rb
CHANGED
@@ -9,10 +9,10 @@ module TTFunk
|
|
9
9
|
module Subset
|
10
10
|
def self.for(original, encoding)
|
11
11
|
case encoding.to_sym
|
12
|
-
when :unicode
|
12
|
+
when :unicode then Unicode.new(original)
|
13
13
|
when :unicode_8bit then Unicode8Bit.new(original)
|
14
|
-
when :mac_roman
|
15
|
-
when :windows_1252 then Windows1252.new(original)
|
14
|
+
when :mac_roman then MacRoman.new(original)
|
15
|
+
when :windows_1252 then Windows1252.new(original) # rubocop: disable Naming/VariableNumber
|
16
16
|
else raise NotImplementedError, "encoding #{encoding} is not supported"
|
17
17
|
end
|
18
18
|
end
|
data/lib/ttfunk/subset/base.rb
CHANGED
@@ -54,14 +54,15 @@ module TTFunk
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def collect_glyphs(glyph_ids)
|
57
|
-
collected =
|
58
|
-
|
59
|
-
|
57
|
+
collected =
|
58
|
+
glyph_ids.each_with_object({}) do |id, h|
|
59
|
+
h[id] = glyph_for(id)
|
60
|
+
end
|
60
61
|
|
61
62
|
additional_ids = collected.values
|
62
|
-
|
63
|
-
|
64
|
-
|
63
|
+
.select { |g| g && g.compound? }
|
64
|
+
.map(&:glyph_ids)
|
65
|
+
.flatten
|
65
66
|
|
66
67
|
collected.update(collect_glyphs(additional_ids)) if additional_ids.any?
|
67
68
|
|
@@ -69,23 +70,25 @@ module TTFunk
|
|
69
70
|
end
|
70
71
|
|
71
72
|
def old_to_new_glyph
|
72
|
-
@old_to_new_glyph ||=
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
73
|
+
@old_to_new_glyph ||=
|
74
|
+
begin
|
75
|
+
charmap = new_cmap_table[:charmap]
|
76
|
+
old_to_new =
|
77
|
+
charmap.each_with_object(0 => 0) do |(_, ids), map|
|
78
|
+
map[ids[:old]] = ids[:new]
|
79
|
+
end
|
80
|
+
|
81
|
+
next_glyph_id = new_cmap_table[:max_glyph_id]
|
82
|
+
|
83
|
+
glyphs.each_key do |old_id|
|
84
|
+
unless old_to_new.key?(old_id)
|
85
|
+
old_to_new[old_id] = next_glyph_id
|
86
|
+
next_glyph_id += 1
|
87
|
+
end
|
84
88
|
end
|
85
|
-
end
|
86
89
|
|
87
|
-
|
88
|
-
|
90
|
+
old_to_new
|
91
|
+
end
|
89
92
|
end
|
90
93
|
|
91
94
|
def new_to_old_glyph
|
@@ -9,19 +9,15 @@ module TTFunk
|
|
9
9
|
class CodePage < Base
|
10
10
|
class << self
|
11
11
|
def unicode_mapping_for(encoding)
|
12
|
-
mapping_cache[encoding] ||=
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
# There is not a strict 1:1 mapping between all code page
|
21
|
-
# characters and unicode.
|
12
|
+
mapping_cache[encoding] ||=
|
13
|
+
(0..255).each_with_object({}) do |c, ret|
|
14
|
+
codepoint =
|
15
|
+
c.chr(encoding)
|
16
|
+
.encode(Encoding::UTF_8, undef: :replace, replace: '')
|
17
|
+
.codepoints
|
18
|
+
.first
|
19
|
+
ret[c] = codepoint if codepoint
|
22
20
|
end
|
23
|
-
# rubocop:enable Lint/SuppressedException
|
24
|
-
end
|
25
21
|
end
|
26
22
|
|
27
23
|
private
|
@@ -65,15 +61,16 @@ module TTFunk
|
|
65
61
|
end
|
66
62
|
|
67
63
|
def new_cmap_table
|
68
|
-
@new_cmap_table ||=
|
69
|
-
|
64
|
+
@new_cmap_table ||=
|
65
|
+
begin
|
66
|
+
mapping = {}
|
70
67
|
|
71
|
-
|
72
|
-
|
73
|
-
|
68
|
+
@subset.each_with_index do |unicode, roman|
|
69
|
+
mapping[roman] = unicode_cmap[unicode]
|
70
|
+
end
|
74
71
|
|
75
|
-
|
76
|
-
|
72
|
+
TTFunk::Table::Cmap.encode(mapping, :mac_roman)
|
73
|
+
end
|
77
74
|
end
|
78
75
|
|
79
76
|
def original_glyph_ids
|
@@ -39,13 +39,15 @@ module TTFunk
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def new_cmap_table
|
42
|
-
@new_cmap_table ||=
|
43
|
-
|
44
|
-
|
42
|
+
@new_cmap_table ||=
|
43
|
+
begin
|
44
|
+
mapping =
|
45
|
+
@subset.each_with_object({}) do |code, map|
|
46
|
+
map[code] = unicode_cmap[code]
|
47
|
+
end
|
48
|
+
|
49
|
+
TTFunk::Table::Cmap.encode(mapping, :unicode)
|
45
50
|
end
|
46
|
-
|
47
|
-
TTFunk::Table::Cmap.encode(mapping, :unicode)
|
48
|
-
end
|
49
51
|
end
|
50
52
|
|
51
53
|
def original_glyph_ids
|
@@ -42,19 +42,21 @@ module TTFunk
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def new_cmap_table
|
45
|
-
@new_cmap_table ||=
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
45
|
+
@new_cmap_table ||=
|
46
|
+
begin
|
47
|
+
mapping =
|
48
|
+
@subset.each_with_object({}) do |(code, unicode), map|
|
49
|
+
map[code] = unicode_cmap[unicode]
|
50
|
+
map
|
51
|
+
end
|
50
52
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
53
|
+
# since we're mapping a subset of the unicode glyphs into an
|
54
|
+
# arbitrary 256-character space, the actual encoding we're
|
55
|
+
# using is irrelevant. We choose MacRoman because it's a 256-character
|
56
|
+
# encoding that happens to be well-supported in both TTF and
|
57
|
+
# PDF formats.
|
58
|
+
TTFunk::Table::Cmap.encode(mapping, :mac_roman)
|
59
|
+
end
|
58
60
|
end
|
59
61
|
|
60
62
|
def original_glyph_ids
|
data/lib/ttfunk/sum.rb
CHANGED
data/lib/ttfunk/table/cff.rb
CHANGED
@@ -3,24 +3,24 @@
|
|
3
3
|
module TTFunk
|
4
4
|
class Table
|
5
5
|
class Cff < TTFunk::Table
|
6
|
-
autoload :Charset,
|
7
|
-
autoload :Charsets,
|
8
|
-
autoload :Charstring,
|
6
|
+
autoload :Charset, 'ttfunk/table/cff/charset'
|
7
|
+
autoload :Charsets, 'ttfunk/table/cff/charsets'
|
8
|
+
autoload :Charstring, 'ttfunk/table/cff/charstring'
|
9
9
|
autoload :CharstringsIndex, 'ttfunk/table/cff/charstrings_index'
|
10
|
-
autoload :Dict,
|
11
|
-
autoload :Encoding,
|
12
|
-
autoload :Encodings,
|
13
|
-
autoload :FdSelector,
|
14
|
-
autoload :FontDict,
|
15
|
-
autoload :FontIndex,
|
16
|
-
autoload :Header,
|
17
|
-
autoload :Index,
|
18
|
-
autoload :OneBasedIndex,
|
19
|
-
autoload :Path,
|
20
|
-
autoload :PrivateDict,
|
21
|
-
autoload :SubrIndex,
|
22
|
-
autoload :TopDict,
|
23
|
-
autoload :TopIndex,
|
10
|
+
autoload :Dict, 'ttfunk/table/cff/dict'
|
11
|
+
autoload :Encoding, 'ttfunk/table/cff/encoding'
|
12
|
+
autoload :Encodings, 'ttfunk/table/cff/encodings'
|
13
|
+
autoload :FdSelector, 'ttfunk/table/cff/fd_selector'
|
14
|
+
autoload :FontDict, 'ttfunk/table/cff/font_dict'
|
15
|
+
autoload :FontIndex, 'ttfunk/table/cff/font_index'
|
16
|
+
autoload :Header, 'ttfunk/table/cff/header'
|
17
|
+
autoload :Index, 'ttfunk/table/cff/index'
|
18
|
+
autoload :OneBasedIndex, 'ttfunk/table/cff/one_based_index'
|
19
|
+
autoload :Path, 'ttfunk/table/cff/path'
|
20
|
+
autoload :PrivateDict, 'ttfunk/table/cff/private_dict'
|
21
|
+
autoload :SubrIndex, 'ttfunk/table/cff/subr_index'
|
22
|
+
autoload :TopDict, 'ttfunk/table/cff/top_dict'
|
23
|
+
autoload :TopIndex, 'ttfunk/table/cff/top_index'
|
24
24
|
|
25
25
|
TAG = 'CFF ' # the extra space is important
|
26
26
|
|
@@ -56,7 +56,7 @@ module TTFunk
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def [](glyph_id)
|
59
|
-
return FIRST_GLYPH_STRING if glyph_id
|
59
|
+
return FIRST_GLYPH_STRING if glyph_id.zero?
|
60
60
|
|
61
61
|
find_string(sid_for(glyph_id))
|
62
62
|
end
|
@@ -83,12 +83,13 @@ module TTFunk
|
|
83
83
|
ranges = TTFunk::BinUtils.rangify(sids)
|
84
84
|
range_max = ranges.map(&:last).max
|
85
85
|
|
86
|
-
range_bytes =
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
86
|
+
range_bytes =
|
87
|
+
if range_max.positive?
|
88
|
+
(Math.log2(range_max) / 8).floor + 1
|
89
|
+
else
|
90
|
+
# for cases when there are no sequences at all
|
91
|
+
Float::INFINITY
|
92
|
+
end
|
92
93
|
|
93
94
|
# calculate whether storing the charset as a series of ranges is
|
94
95
|
# more efficient (i.e. takes up less space) vs storing it as an
|
@@ -99,7 +100,7 @@ module TTFunk
|
|
99
100
|
if total_array_size <= total_range_size
|
100
101
|
([format_int(:array_format)] + sids).pack('Cn*')
|
101
102
|
else
|
102
|
-
fmt = range_bytes == 1 ? :
|
103
|
+
fmt = range_bytes == 1 ? :range_format8 : :range_format16
|
103
104
|
element_fmt = element_format(fmt)
|
104
105
|
result = [format_int(fmt)].pack('C')
|
105
106
|
ranges.each { |range| result << range.pack(element_fmt) }
|
@@ -110,7 +111,7 @@ module TTFunk
|
|
110
111
|
private
|
111
112
|
|
112
113
|
def sid_for(glyph_id)
|
113
|
-
return 0 if glyph_id
|
114
|
+
return 0 if glyph_id.zero?
|
114
115
|
|
115
116
|
# rather than validating the glyph as part of one of the predefined
|
116
117
|
# charsets, just pass it through
|
@@ -120,8 +121,8 @@ module TTFunk
|
|
120
121
|
when :array_format
|
121
122
|
entries[glyph_id]
|
122
123
|
|
123
|
-
when :
|
124
|
-
entries.
|
124
|
+
when :range_format8, :range_format16
|
125
|
+
entries.reduce(glyph_id) do |remaining, range|
|
125
126
|
if range.size >= remaining
|
126
127
|
break (range.first + remaining) - 1
|
127
128
|
end
|
@@ -156,7 +157,7 @@ module TTFunk
|
|
156
157
|
@length = count * element_width
|
157
158
|
@entries = OneBasedArray.new(read(length, 'n*'))
|
158
159
|
|
159
|
-
when :
|
160
|
+
when :range_format8, :range_format16
|
160
161
|
# The number of ranges is not explicitly specified in the font.
|
161
162
|
# Instead, software utilizing this data simply processes ranges
|
162
163
|
# until all glyphs in the font are covered.
|
@@ -174,37 +175,37 @@ module TTFunk
|
|
174
175
|
end
|
175
176
|
|
176
177
|
def element_width(fmt = format_sym)
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
178
|
+
{
|
179
|
+
array_format: 2, # SID
|
180
|
+
range_format8: 3, # SID + Card8
|
181
|
+
range_format16: 4 # SID + Card16
|
182
|
+
}[fmt]
|
182
183
|
end
|
183
184
|
|
184
185
|
def element_format(fmt = format_sym)
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
186
|
+
{
|
187
|
+
array_format: 'n',
|
188
|
+
range_format8: 'nC',
|
189
|
+
range_format16: 'nn'
|
190
|
+
}[fmt]
|
190
191
|
end
|
191
192
|
|
192
193
|
def format_sym
|
193
194
|
case @format
|
194
195
|
when ARRAY_FORMAT then :array_format
|
195
|
-
when RANGE_FORMAT_8 then :
|
196
|
-
when RANGE_FORMAT_16 then :
|
196
|
+
when RANGE_FORMAT_8 then :range_format8
|
197
|
+
when RANGE_FORMAT_16 then :range_format16
|
197
198
|
else
|
198
|
-
raise "unsupported charset format '#{fmt}'"
|
199
|
+
raise Error, "unsupported charset format '#{fmt}'"
|
199
200
|
end
|
200
201
|
end
|
201
202
|
|
202
203
|
def format_int(sym = format_sym)
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
204
|
+
{
|
205
|
+
array_format: ARRAY_FORMAT,
|
206
|
+
range_format8: RANGE_FORMAT_8,
|
207
|
+
range_format16: RANGE_FORMAT_16
|
208
|
+
}[sym]
|
208
209
|
end
|
209
210
|
end
|
210
211
|
end
|