Nastaleeq (ttf) subsetting missing ligature

urdud's picture

Hi All,

My first post, so abt me:
I'm a programmer (c/c++/python/perl), but fonts are my hobby. So, please forgive me for any gaps in my knowledge on fonts.
I've successfully converted a free nastaleeq font to woff and am able to use it on my server and results are great.
Now, I'm trying to optimize the load time of the page, which is obnoxious given the fine nastaleeq font.
So, I got into subsetting. I'm using a script to subset based on text I'm going to send out, and the resulting font looks fine to me.
I checked it in FontForge and compared with the original to the best of my (sparse) knowledge. Things look OK to me.
However, the text that looks correct (using ligatures) with the original ttf or woff, renders with isolated forms with the subset font.
I verifed that the subset font had the ligature at the same place as the original.
My text is unicode and so is the font. I can see GSUB(ccmp,init,medi,fina,rlig,calt,single) and GPOS(curs,mark,kern,mkmk etc) in the subset font

Please help me identify why the ligatures stop working with the subset font. In other words, please let me know what is required in the font to make ligatures work, that might be getting left behind. Thanks.

Bob H's picture

When doing the subsetting, you also have to modify the GSUB and GPOS tables to account for the new repertoire of glyphs -- I assume you are doing that?

You might verify the font with Microsoft Font Validator or some other integrity-checking tool.

PS: What free nastaleeq font did you start with?

urdud's picture

Thank you Bob,
I will try Microsoft Font Validator.

I assume that the script(bitbucket.org/philip/font-optimizer/src) is doing the right stuff, but I don't have any basis to judge except for FontForge being able to open it and the subset being present in there. So, a validator would be the right thing to use.

After posting here, I converted the subset font to woff using FontSquirrel and the woff is working as expected. Now, I'm curious what FS must have fixed in the subset font?

I'm experimenting with Jameel Noori Nastaleeq.ttf which is ~10MB(~6MB woff)

jasonc's picture

When you say it doesn't render correctly in your subset, are you testing with a browser? Or in a desktop program?

urdud's picture

I'm testing with a browser(Firefox). My subset has individual/isolated forms of meem, qaaf, ta & daal, as well as a replacement glyph of these combined nicely in a nastaleeq ligature. With the subset font, these letters are rendered in isolated forms, not the ligature. However, once passed through fontsquirrel, it renders properly.

urdud's picture

Bob, I tried font validator. It displays a lot of warnings and errors for both the working and the problematic subset. I'm confused. It there a quick reference that clearly states what constitutes a (minimal) font with ligature and hinting/kerning functionality?

Syndicate content Syndicate content