Closed Bug 702505 Opened 13 years ago Closed 13 years ago

ots is stripping out GPOS/GSUB tables for Caflisch Script Pro

Categories

(Core :: Graphics, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla11

People

(Reporter: jtd, Assigned: jfkthame)

References

()

Details

Attachments

(3 files, 1 obsolete file)

Steps to reproduce: 1. Load URL Result: contextual shaping and alternates are disabled With OTS debugging enabled: ERROR at /builds/mozcentral/gfx/ots/src/layout.cc:158 (bool<unnamed>::ParseFeatureTable(const uint8_t*, size_t, uint16_t)) ERROR at /builds/mozcentral/gfx/ots/src/layout.cc:1263 (bool ots::ParseFeatureListTable(const uint8_t*, size_t, uint16_t, uint16_t*)) WARNING at /builds/mozcentral/gfx/ots/src/gpos.cc:771: faild to parse feature list table WARNING at /builds/mozcentral/gfx/ots/src/layout.cc:398: glyph range is overlapping. ERROR at /builds/mozcentral/gfx/ots/src/layout.cc:399 (bool<unnamed>::ParseCoverageFormat2(const uint8_t*, size_t, uint16_t)) ERROR at /builds/mozcentral/gfx/ots/src/layout.cc:1142 (bool<unnamed>::ParseChainContextFormat3(const uint8_t*, size_t, uint16_t, uint16_t)) ERROR at /builds/mozcentral/gfx/ots/src/layout.cc:1429 (bool ots::ParseChainingContextSubtable(const uint8_t*, size_t, uint16_t, uint16_t)) ERROR at /builds/mozcentral/gfx/ots/src/layout.cc:1159 (bool ots::LookupSubtableParser::Parse(const ots::OpenTypeFile*, const uint8_t*, size_t, uint16_t) const) ERROR at /builds/mozcentral/gfx/ots/src/layout.cc:248 (bool<unnamed>::ParseLookupTable(ots::OpenTypeFile*, const uint8_t*, size_t, const ots::LookupSubtableParser*)) ERROR at /builds/mozcentral/gfx/ots/src/layout.cc:1307 (bool ots::ParseLookupListTable(ots::OpenTypeFile*, const uint8_t*, size_t, const ots::LookupSubtableParser*, uint16_t*)) WARNING at /builds/mozcentral/gfx/ots/src/gsub.cc:626: faild to parse lookup list table The test uses Adobe's Caflisch Script Pro so I have a feeling the OTS code is wrong but I haven't looked at it closely yet.
OTS is rejecting 926 out of 3320 Postscript CFF fonts in Font Folio 11.
Argh, was counting errors, not fonts with errors: 163 fonts out of 3320 are rejected, not the number in the comment above.
Attachment #574522 - Attachment is obsolete: true
How to build the standalong ots tool: http://code.google.com/p/ots/wiki/HowToTestOts 1. Get ots source svn checkout http://ots.googlecode.com/svn/trunk/ ots 2. Get gyp source svn checkout http://gyp.googlecode.com/svn/trunk/ gyp 3. Build the standalone tool (OSX version) $ gyp --depth=. -f xcode ots-standalone.gyp $ xcodebuild -configuration Default -project ots-standalone.xcodeproj -target All 4. Run the tool over the font set for f in ~/fontfolio11/*.otf; do echo $f; build/Default/idempotent $f; done &>fontfolio11.out
In both v1.010 and v2.015 of CaflischScriptPro-Regular, there appears to be an error in (at least one of) the GSUB lookup coverage tables: there are glyph ranges in CoverageFormat2 that overlap (i.e. the first glyph ID of a range is the same as the last glyph ID of the preceding range). The spec[1] requires that glyph ranges do not overlap, so OTS is correct to treat this as an error. This explains the message "WARNING at /builds/mozcentral/gfx/ots/src/layout.cc:398: glyph range is overlapping." and the following errors in comment #0. It's possible to "fix" this by relaxing the check at gfx/ots/src/layout.cc:398: if (start > end || (last_end && start <= last_end)) { OTS_WARNING("glyph range is overlapping."); return OTS_FAILURE(); } If we replace the test "start <= last_end" here by "start < last_end", thus permitting a one-glyph overlap between ranges (when start == last_end), the font loads successfully without discarding the OpenType features. However, this is not correct as per the OT spec. It appears that the version deployed by TypeKit and used by the test in the URL field may have an additional problem in a GPOS feature table, but this does not occur with either of the versions I have examined as local files. [1] http://www.microsoft.com/typography/otspec/chapter2.htm
Changing the condition noted in comment 6 from '<=' to '<' (i.e. to allow a one glyph overlap) reduces the number of failing fonts in Font Folio 11 from 163 to 20.
In addition to the coverage table issue (which is a bug in CaflischScriptPro and other fonts), the GPOS table is rejected by OTS because of the presence (in the version served by typekit) of the 'size' optical-size feature. This is an OTS bug, just filed as http://code.google.com/p/chromium/issues/detail?id=104389.
This fixes the OTS bug that causes fonts with an optical size feature to be rejected; it won't actually make the current Caflisch Script Pro work, however, because of the coverage table issue in that font.
Attachment #574706 - Flags: review?(jdaggett)
Attachment #574706 - Flags: review?(jdaggett) → review+
Pushed the patch for GPOS 'size' to mozilla-inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/cdf1844ffd59 This will not fully resolve the issue for Caflisch Script Pro, as it _also_ has the Coverage Table bug (see comment 6), so OTS will still discard its layout tables.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
(In reply to Jonathan Kew (:jfkthame) from comment #8) > In addition to the coverage table issue (which is a bug in CaflischScriptPro > and other fonts), the GPOS table is rejected by OTS because of the presence > (in the version served by typekit) of the 'size' optical-size feature. This > is an OTS bug, just filed as > http://code.google.com/p/chromium/issues/detail?id=104389. FTR, this is now fixed upstream in OTS (rev 75).
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: