Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: third_party/harfbuzz-ng/src/hb-ot-layout.cc

Issue 2163983005: Roll HarfBuzz to 1.3.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright © 1998-2004 David Turner and Werner Lemberg 2 * Copyright © 1998-2004 David Turner and Werner Lemberg
3 * Copyright © 2006 Behdad Esfahbod 3 * Copyright © 2006 Behdad Esfahbod
4 * Copyright © 2007,2008,2009 Red Hat, Inc. 4 * Copyright © 2007,2008,2009 Red Hat, Inc.
5 * Copyright © 2012,2013 Google, Inc. 5 * Copyright © 2012,2013 Google, Inc.
6 * 6 *
7 * This is part of HarfBuzz, a text shaping library. 7 * This is part of HarfBuzz, a text shaping library.
8 * 8 *
9 * Permission is hereby granted, without written agreement and without 9 * Permission is hereby granted, without written agreement and without
10 * license or royalty fees, to use, copy, modify, and distribute this 10 * license or royalty fees, to use, copy, modify, and distribute this
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 { 86 {
87 /* In certain versions of Times New Roman Italic and Bold Italic, 87 /* In certain versions of Times New Roman Italic and Bold Italic,
88 * ASCII double quotation mark U+0022, mapped to glyph 5, has wrong 88 * ASCII double quotation mark U+0022, mapped to glyph 5, has wrong
89 * glyph class 3 (mark) in GDEF. Nuke the GDEF to avoid zero-width 89 * glyph class 3 (mark) in GDEF. Nuke the GDEF to avoid zero-width
90 * double-quote. See: 90 * double-quote. See:
91 * https://lists.freedesktop.org/archives/harfbuzz/2016-February/005489.ht ml 91 * https://lists.freedesktop.org/archives/harfbuzz/2016-February/005489.ht ml
92 */ 92 */
93 if (3 == layout->gdef->get_glyph_class (5)) 93 if (3 == layout->gdef->get_glyph_class (5))
94 layout->gdef = &OT::Null(OT::GDEF); 94 layout->gdef = &OT::Null(OT::GDEF);
95 } 95 }
96 else if (0
97 /* sha1sum:96eda93f7d33e79962451c6c39a6b51ee893ce8c tahoma.ttf from Windo ws 8 */
98 || (898 == gdef_len && 46470 == gpos_len && 12554 == gsub_len)
99 /* sha1sum:20928dc06014e0cd120b6fc942d0c3b1a46ac2bc tahomabd.ttf from Win dows 8 */
100 || (910 == gdef_len && 47732 == gpos_len && 12566 == gsub_len)
101 /* sha1sum:4f95b7e4878f60fa3a39ca269618dfde9721a79e tahoma.ttf from Windo ws 8.1 */
102 || (928 == gdef_len && 59332 == gpos_len && 23298 == gsub_len)
103 /* sha1sum:6d400781948517c3c0441ba42acb309584b73033 tahomabd.ttf from Win dows 8.1 */
104 || (940 == gdef_len && 60732 == gpos_len && 23310 == gsub_len)
105 /* sha1sum:e55fa2dfe957a9f7ec26be516a0e30b0c925f846 tahoma.ttf from Windo ws 10 */
106 || (994 == gdef_len && 60336 == gpos_len && 24474 == gsub_len)
107 /* sha1sum:7199385abb4c2cc81c83a151a7599b6368e92343 tahomabd.ttf from Win dows 10 */
108 || (1006 == gdef_len && 61740 == gpos_len && 24470 == gsub_len)
109 /* sha1sum:b0d36cf5a2fbe746a3dd277bffc6756a820807a7 Tahoma.ttf from Mac O S X 10.9 */
110 || (832 == gdef_len && 47162 == gpos_len && 7324 == gsub_len)
111 /* sha1sum:12fc4538e84d461771b30c18b5eb6bd434e30fba Tahoma Bold.ttf from Mac OS X 10.9 */
112 || (844 == gdef_len && 45474 == gpos_len && 7302 == gsub_len)
113 /* sha1sum:73da7f025b238a3f737aa1fde22577a6370f77b0 himalaya.ttf from Win dows 8 */
114 || (192 == gdef_len && 7254 == gpos_len && 12638 == gsub_len)
115 /* sha1sum:6e80fd1c0b059bbee49272401583160dc1e6a427 himalaya.ttf from Win dows 8.1 */
116 || (192 == gdef_len && 7254 == gpos_len && 12690 == gsub_len)
117 /* 8d9267aea9cd2c852ecfb9f12a6e834bfaeafe44 cantarell-fonts-0.0.21/otf/Ca ntarell-Regular.otf */
118 /* 983988ff7b47439ab79aeaf9a45bd4a2c5b9d371 cantarell-fonts-0.0.21/otf/Ca ntarell-Oblique.otf */
119 || (188 == gdef_len && 3852 == gpos_len && 248 == gsub_len)
120 /* 2c0c90c6f6087ffbfea76589c93113a9cbb0e75f cantarell-fonts-0.0.21/otf/Ca ntarell-Bold.otf */
121 /* 55461f5b853c6da88069ffcdf7f4dd3f8d7e3e6b cantarell-fonts-0.0.21/otf/Ca ntarell-Bold-Oblique.otf */
122 || (188 == gdef_len && 3426 == gpos_len && 264 == gsub_len)
123 )
124 {
125 /* Many versions of Tahoma have bad GDEF tables that incorrectly classify some spacing marks
126 * such as certain IPA symbols as glyph class 3. So do older versions of M icrosoft Himalaya,
127 * and the version of Cantarell shipped by Ubuntu 16.04.
128 * Nuke the GDEF tables of these fonts to avoid unwanted width-zeroing.
129 * See https://bugzilla.mozilla.org/show_bug.cgi?id=1279925
130 * https://bugzilla.mozilla.org/show_bug.cgi?id=1279693
131 * https://bugzilla.mozilla.org/show_bug.cgi?id=1279875
132 */
133 layout->gdef = &OT::Null(OT::GDEF);
134 }
96 } 135 }
97 136
98 layout->gsub_lookup_count = layout->gsub->get_lookup_count (); 137 layout->gsub_lookup_count = layout->gsub->get_lookup_count ();
99 layout->gpos_lookup_count = layout->gpos->get_lookup_count (); 138 layout->gpos_lookup_count = layout->gpos->get_lookup_count ();
100 139
101 layout->gsub_accels = (hb_ot_layout_lookup_accelerator_t *) calloc (layout->gs ub->get_lookup_count (), sizeof (hb_ot_layout_lookup_accelerator_t)); 140 layout->gsub_accels = (hb_ot_layout_lookup_accelerator_t *) calloc (layout->gs ub->get_lookup_count (), sizeof (hb_ot_layout_lookup_accelerator_t));
102 layout->gpos_accels = (hb_ot_layout_lookup_accelerator_t *) calloc (layout->gp os->get_lookup_count (), sizeof (hb_ot_layout_lookup_accelerator_t)); 141 layout->gpos_accels = (hb_ot_layout_lookup_accelerator_t *) calloc (layout->gp os->get_lookup_count (), sizeof (hb_ot_layout_lookup_accelerator_t));
103 142
104 if (unlikely ((layout->gsub_lookup_count && !layout->gsub_accels) || 143 if (unlikely ((layout->gsub_lookup_count && !layout->gsub_accels) ||
105 (layout->gpos_lookup_count && !layout->gpos_accels))) 144 (layout->gpos_lookup_count && !layout->gpos_accels)))
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 apply (proxy, plan, font, buffer); 1175 apply (proxy, plan, font, buffer);
1137 } 1176 }
1138 1177
1139 HB_INTERNAL void 1178 HB_INTERNAL void
1140 hb_ot_layout_substitute_lookup (OT::hb_apply_context_t *c, 1179 hb_ot_layout_substitute_lookup (OT::hb_apply_context_t *c,
1141 const OT::SubstLookup &lookup, 1180 const OT::SubstLookup &lookup,
1142 const hb_ot_layout_lookup_accelerator_t &accel) 1181 const hb_ot_layout_lookup_accelerator_t &accel)
1143 { 1182 {
1144 apply_string<GSUBProxy> (c, lookup, accel); 1183 apply_string<GSUBProxy> (c, lookup, accel);
1145 } 1184 }
OLDNEW
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-ot-font.cc ('k') | third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698