Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken SVG table for Aref Ruqaa Ink fonts downloaded from the website #6295

Closed
khaledhosny opened this issue May 23, 2023 · 10 comments
Closed
Labels
-- Needs Eng team opinion API related stuff only eng team can answer I API / Website / Platform fonts.google.com related stuff I Font Bug

Comments

@khaledhosny
Copy link
Contributor

The fonts downloaded from https://fonts.google.com/specimen/Aref+Ruqaa+Ink have broken SVG table with glyph IDs not matching between SVG table and the rest of the font. The files from https://github.com/google/fonts/tree/main/ofl/arefruqaaink seem to be fine.

@khaledhosny
Copy link
Contributor Author

@RosaWagner RosaWagner added I API / Website / Platform fonts.google.com related stuff -- Needs Eng team opinion API related stuff only eng team can answer labels May 24, 2023
@RosaWagner
Copy link
Contributor

Maybe @anthrotype or @rsheeter want to take a look at this issue?

@anthrotype
Copy link
Member

thanks for filing this, yeah the GID look all messed up. Interestingly the SVG table from the fonts inside the ZIP is identical to the one on Github https://github.com/google/fonts/tree/main/ofl/arefruqaaink, the rest of the font (especially the GlyphOrder) is different though (even though they both claim to be the same fontRevision=1.005). The number of glyphs is different, 1184 (downloaded font) vs 1192 (Github copy). Also the cmap is the same... 🤔 💭
Maybe the downloaded font has gone through some subsetting operation that left the SVG table intact but didn't keep the old glyph IDs. FontTools subsetter can subset the SVG table but hb-subset cannot. In theory I would expect that if we do use hb-subset at all on SVG fonts we at least retain the glyph IDs. I will keep investigating.

@anthrotype
Copy link
Member

ok yes, I was able to reproduce using hb-subset command line tool.
If you take the original unsubsetted font from Github at https://github.com/google/fonts/tree/main/ofl/arefruqaaink, and pass it through hb-subset without passing the --retain-gids option, the glyph indices are going to be messed up exactly in the same way as the font from the download zip.
There seems to be 8 glyphs that are unreachable when subsetting with --unicodes='*' so hb-subset drops them (which explains the the difference in the number of glyphs between the two fonts 1192 - 8 = 1184).

# with --retain-gids the font works
$ hb-subset --retain-gids --drop-tables-=SVG --passthrough-tables --output-file=ArefRuqaaInk-Regular-GH.hb-subset.ttf --unicodes='*' ArefRuqaaInk-Regular-GH.ttf
# without --retain-gids the indices are messed up because 8 unreferenced glyphs get dropped but SVG table is kept as is
$ hb-subset --drop-tables-=SVG --passthrough-tables --output-file=ArefRuqaaInk-Regular-GH.hb-subset-no-retain-gids.ttf --unicodes='*' ArefRuqaaInk-Regular-GH.ttf

@anthrotype
Copy link
Member

I filed an issue internally (b/284117255)

@garretrieger
Copy link
Member

A fix for this should be coming early next week.

@HinTak
Copy link

HinTak commented May 27, 2023

I reckon you'll regenerated all the zip files involving fonts with SVG tables, but FWIW, another font, Blaka Ink Regular, is also broken. (I was the one who played with all the non-sans Google arabic fonts recently, and draw Werner's attention to Aref Ruqaa at the beginning).

@garretrieger
Copy link
Member

Yes that's right. The plan is to update all families which have SVG tables. That should be happening tomorrow or Wednesday.

@garretrieger
Copy link
Member

This should be fixed now.

@anthrotype
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-- Needs Eng team opinion API related stuff only eng team can answer I API / Website / Platform fonts.google.com related stuff I Font Bug
Projects
None yet
Development

No branches or pull requests

5 participants