googlefonts / gf-glyphs-scripts

Scripts for Glyphs
21 stars 11 forks source link

Implement workaround for util.download_gf_family. #41

Closed m4rc1e closed 5 years ago

m4rc1e commented 5 years ago

Previous implementation would 'open' a font from a zipfile. Opened files from zipfile objects are unseekable streams. FontTools recently lost support to intantiate a TTFont object from such streams, https://github.com/fonttools/fonttools/issues/1362

New implementation will 'read' the font from a zipfile which returns the bytes of the read file. The bytes are then stored as a StringIO object which is a seekable stream.

m4rc1e commented 5 years ago

One day I hope we can have these util functions in their own repo. FB, GFR, Diffbrowsers etc have variants of these functions. It would be great to have them all in one place and polish them beautifully.

Previously written about this, https://github.com/googlefonts/gftools/issues/50