Created attachment 115035 [details] Rendering of sample words in Safari on the left (correct), and Chrome on the right (incorrect) Chrome, Firefox, and XeTeX all exhibit a rendering bug with the IranNastaliq Persian font. In these program, glyphs overlap, and context-dependent changes do not happen as they should. The bug is shown in Chrome on the right hand side in the attachment. Safari (shown on the left) and other native OS X applications do not exhibit these problems. It is therefore likely that the problem lies with HarfBuzz. To reproduce this bug, visit googledrive.com/host/0B5t7PI2Cb4XIfjBROUhucnBSOUdMcnpwNUlDb2t2eW9JQnBSckpYV04xd0M5anBIeW5pVnc
Created attachment 115036 [details] Rendering of sample words in Safari on the left (correct), and Chrome on the right (incorrect)
The IranNastaliq font uses the 'cswh' feature for such ligatures. 'cswh' is default-off according to the OpenType spec. The font should use 'calt' instead. It's unfortunate, but I'm under the impression that it doesn't work under Windows either.
Hi Behdad, Thanks for your response and explanation. I am able to get the preferred behavior in Chrome/Firefox with: -webkit-font-feature-settings: "cswh"; -moz-font-feature-settings: "cswh"; and in XeLaTex with \newfontfamily\nastaliq[Script=Arabic,Scale=1.5,Contextuals=Swash]{IranNastaliq} So it seems that Apple is not following the spec by enabling the swashes by default? I wonder if this is true for all fonts.
This feature used to be enabled by default in previous versions of Windows, but disabled in Windows 8 on and the spec was updated. We followed. Best to update IranNastaliq to use calt for these, and publish the font somewhere. Thanks.
Given the prominence of the IranNastaliq font, I think we need to address this issue somehow. I'm still thinking about possibilities. Since this is a feature that used to be on, I like to bring it up with Microsoft first.
Jonathan, Since this is something that changed in Windows 8, do you think we should try to do something about older fonts?
(In reply to Behdad Esfahbod from comment #6) > Jonathan, > > Since this is something that changed in Windows 8, do you think we should > try to do something about older fonts? Can you envisage an approach that would allow harfbuzz to figure out whether the feature was intended to be applied by default or not? I can't. The only "solution" I can think of here would involve specifically recognizing this font and special-casing it, and I'd be reluctant to do that -- especially at the harfbuzz library level. If a client app (such as Chrome, Firefox, XeTeX, etc) wants to special-case the IranNastaliq font and pass the extra feature to harfbuzz, that option is open to them, but IMO it'd be wrong to hard-code such behavior into the library.
Thanks Jonathan. I can't think of a good solution either. If someone wants to either contact IranNastaliq owners and ask them to create a new version, or fix and distribute it themselves, please go ahead and also report here. Thanks.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.