googlefonts / roboto-classic

Development of a Roboto Variable font
SIL Open Font License 1.1
151 stars 15 forks source link

File size diet test: remove latin composite glyphs #49

Closed sannorozco closed 4 years ago

sannorozco commented 4 years ago

Hallo everyone,

In testing this we’ve encountered some issues, but first here’s what’s been done:

There’s a new branch now: harfbuzz-test, where for all masters the following glyphs were removed, also updated component references, groups, kerning pairs:

Agrave Aacute Acircumflex Atilde Adieresis Aring Ccedilla Egrave Eacute Ecircumflex Edieresis Igrave Iacute Icircumflex Idieresis Ntilde Ograve Oacute Ocircumflex Otilde Odieresis Ugrave Uacute Ucircumflex Udieresis Yacute agrave aacute acircumflex atilde adieresis aring ccedilla egrave eacute ecircumflex edieresis igrave iacute icircumflex idieresis ntilde ograve oacute ocircumflex otilde odieresis ugrave uacute ucircumflex udieresis yacute ydieresis Amacron amacron Abreve abreve Cacute cacute Ccircumflex ccircumflex uni010A Cdotaccent uni010B cdotaccent Ccaron ccaron Dcaron Emacron emacron Ebreve ebreve Edotaccent edotaccent Ecaron ecaron Gcircumflex gcircumflex Gbreve gbreve uni0120 Gdotaccent uni0121 gdotaccent Gcommaaccent gcommaaccent Hcircumflex hcircumflex Itilde itilde Imacron imacron Ibreve ibreve Idotaccent Jcircumflex jcircumflex Kcommaaccent kcommaaccent Lacute lacute Lcommaaccent lcommaaccent Nacute nacute Ncommaaccent ncommaaccent Ncaron ncaron Omacron omacron Obreve obreve Ohungarumlaut ohungarumlaut Racute racute Rcommaaccent rcommaaccent Rcaron rcaron Sacute sacute Scircumflex scircumflex Scedilla scedilla Scaron scaron uni0162 Tcedilla uni0163 tcedilla Tcaron Utilde utilde Umacron umacron Ubreve ubreve Uring uring Uhungarumlaut uhungarumlaut Wcircumflex wcircumflex Ycircumflex ycircumflex Ydieresis Zacute zacute Zdotaccent zdotaccent Zcaron zcaron Gcaron gcaron AEacute aeacute Oslashacute oslashacute uni0218 Scommaaccent uni0219 scommaaccent uni021A Tcommaaccent uni021B tcommaaccent Ymacron uni0232 ymacron uni0233 Wgrave wgrave Wacute wacute Wdieresis wdieresis Ygrave ygrave

  1. All masters have anchor marks: top, bottom, top_dd, bottom_dd, top_0315, parent_top. The last three are not standard.

  2. Using GlyphConstruction I tested the composites using the anchor and combining marks mentioned above, there are minor differences, that I think were done manually after Google made them (image, bottom right, atilde)

  3. NOTE: the combining accent block have no standard names (like Adobe’s acutecmb, gravecmb, etc…), but all unicode ranges are in there, so I assume is what HarfBuzz looks to build on the fly?

  4. There are a lot more glyphs that can be treated like this, but they’re really a lot, and also the names are not standard, so if we have to do it for all, it should be done by unicode.

  5. Removing these glyphs resulted in 100k file size reduction.

**BUT, there are some important issues, that hit me when doing this, how some things will be handled on the fly by Harfbuzz… described in next issue

image_2
brawer commented 4 years ago

Re. (4), yes, you should be able to do it by Unicode. In total, there’s abut 13K precomposed characters in Unicode but I don’t know how many are supported by Roboto.