File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed
Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
77
88## [ Unreleased]
99
10+ ### Fixed
11+
12+ * ` maxp ` table encoding
13+
14+ The table was encoded with the reverse subset indexinx. This resulted in
15+ incorrect values being encoded in ` maxp ` table. This tripped some of the more
16+ fussy renderers like Adobe Acrobat, but also constrained implementations such
17+ as in most printers.
18+
19+ Thomas Dy
20+
1021## [ 1.8.0] [ ] - 2024-03-05
1122
1223### Fixed
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ def hhea_table
107107 end
108108
109109 def maxp_table
110- @maxp_table ||= TTFunk ::Table ::Maxp . encode ( original . maximum_profile , old_to_new_glyph )
110+ @maxp_table ||= TTFunk ::Table ::Maxp . encode ( original . maximum_profile , new_to_old_glyph )
111111 end
112112
113113 def post_table
Original file line number Diff line number Diff line change 99 let ( :original ) { TTFunk ::File . open ( original_font_path ) }
1010
1111 let ( :encoder_options ) { { } }
12+ let ( :subset_characters ) { 'a' ..'z' }
1213 let ( :encoder ) do
1314 subset =
1415 TTFunk ::Subset ::Unicode . new ( original ) . tap do |sub_set |
1516 # ASCII lowercase
16- ( 97 .. 122 ) . each { |char | sub_set . use ( char ) }
17+ subset_characters . each { |char | sub_set . use ( char . ord ) }
1718 end
1819
1920 described_class . new ( original , subset , encoder_options )
6566
6667 # verified via the Font-Validator tool at:
6768 # https://github.com/HinTak/Font-Validator
68- expect ( checksum ) . to eq ( 0xEEAE9DCF )
69+ expect ( checksum ) . to eq ( 0xEEB49DA9 )
70+ end
71+
72+ example_group 'maxp regression' , issue : 102 do
73+ let ( :subset_characters ) { [ 'A' ] }
74+
75+ it 'correctly encodes maxp table for subset' do
76+ maxp = new_font . maximum_profile
77+ expect ( maxp . max_points ) . to eq 11
78+ end
6979 end
7080 end
7181end
You can’t perform that action at this time.
0 commit comments