MPEGGroup / OpenFontFormat

Official MPEG repository to discuss issues on Open Font Format (ISO/IEC 14496-22)
31 stars 6 forks source link

[sbix] Specify placement of images within lines, to aid 3 major implementations converging on 1 behavior #18

Open davelab6 opened 3 years ago

davelab6 commented 3 years ago

In https://github.com/MPEGGroup/OpenFontFormat/issues/1#issuecomment-698113180 @peterconstable wrote,

[OFF has] ambiguity about the placement of bitmap graphics from the 'sbix' table within a line of text, with the result that three major implementations have three different behaviours (see OT issue 191.

While MSOT issue 191 is closed, and so I expect that wording to arrive in OFF, I thought it would be valuable to file this issue on this repo to track not only this being fixed in OFF, but the 3 implementations (and any others) aligning on the new standard definition of the behavior.

Peter, which are the 3 implementations were you referring to?

bungeman commented 3 years ago

CoreText, DirectWrite, and FreeType. To summarize the behaviors: FreeType applies (and still applies, need to fix that) the originOffsetY in the wrong direction. FreeType and DirectWrite do not use the lower left of the corresponding 'glyf' entry as the origin. CoreText doesn't recognize 'sbix' fonts without a 'glyf' table (the other two do) and also only provides the bounds of the 'glyf' entry (does not allow for proper repaint if the bitmap extends outside those bounds).