Subsetting for webfonts

I’m trying to subset a complex font (understand complex as a lot of classes and calt and not auto-updatable lists). Well, at first Remove Glyphs, Remove Features, Remove Classes was working well, until the point that I had to Replace Classes, I can do it, but is risky… and boring =P

So I asked @mekkablue if he knew an option to subset after exporting, and he suggested me pyftsubset, perfect, works as I wished. I exported a “full” woff from Glyphs, and subsetted via pyftsubset. The weird thing is: the subsetted font is about 10Kb bigger than the full one. Any idea why this happens? Or how to adjust that?

Check the table size with OTMaster. That should give you some ideas.

1 Like

Thanks Georg,
I don’t have OTMaster… any other way?

If you have fontTools/ttx installed, you can list the table sizes like this:

ttx -l TheMixOffice-Regular.woff2
Listing table info for "TheMixOffice-Regular.woff2":
    tag     checksum    length    offset
    ----  ----------  --------  --------
    GDEF  0x10C01559       182         0
    GPOS  0x629F2413     14448       182
    GSUB  0x7025CC1C      3728     14630
    OS/2  0x6232885D        96     18434
    cmap  0xDA7A7FFB      6158     18530
    cvt   0x1A6B04B0       128     24688
    fpgm  0x67F1330D       415     24816
    gasp  0x0017002B        16     25231
    glyf  0xB6BC1F85     54585     25247
    head  0xE39C41E1        54     79832
    hhea  0x064303E9        36     79886
    hmtx  0x41CA5669      2092     79922
    loca  0x00000000         0     82014
    maxp  0x06330488        32     82014
    name  0x79E99CE9      1142     82046
    post  0x01E52A12      3604     83188
    prep  0x56E18E99       960     86792

thanks, I’ll try that. =)

Can you paste the pyftsubset line you used?

You mean this?

pyftsubset /Users/diegomaldonado/Desktop/PudimExport/Web\ PYFT\ Test/Full/ndPudim-Rg-Web.woff .notdef CR space a ae b uni0253 c d eth uni0257 e uni0259 uni0258 f f.short g g.short h i j ij k k.short kgreenlandic uni0199 l m n eng uni0272 o oe thorn p p.short q r s germandbls t t.short u v w x y uni01B4 z f_f f_f_i f_f_l fi fl k_i.dlig A A.alt01 AE B uni0181 C D Eth uni018A E uni018F uni018E F G G.alt01 H I IJ J J.short K uni0198 L M M.alt01 N N.alt01 Eng uni019D O OE Thorn P P.alt01 Q R R.longleg S uni1E9E T T.narrow U V V.alt01 W X Y uni01B3 Z A_T.dlig E_Y.dlig F_T.dlig G_H.dlig L_A.dlig R_N.dlig T_E.dlig T_T.dlig T_U.dlig zero one two three four five six seven eight nine ampersand at hyphen uni00AD endash emdash underscore underscore_underscore.liga period ellipsis colon comma semicolon quotesingle quotedbl quoteleft quoteright quotedblleft quotedblright quotesinglbase quotedblbase guilsinglleft guilsinglright exclamdown exclam questiondown question parenleft parenright bracketleft bracketright braceleft braceright slash backslash fraction percent perthousand bar brokenbar section paragraph copyright registered trademark ordfeminine ordmasculine degree asterisk dagger daggerdbl numbersign asciicircum asciitilde plus minus plusminus multiply divide equal approxequal notequal less greater lessequal greaterequal periodcentered bullet lozenge logicalnot radical integral infinity estimated partialdiff currency cent florin sterling dollar yen lira uni20A8 uni20AA dong uni20B5 uni20BF colonmonetary Euro franc uni20BA uni20B9 uni20A6 uni0394 uni03A9 uni03BC pi aacute abreve uni1EAF uni1EB7 uni1EB1 uni1EB3 uni1EB5 uni01CE acircumflex uni1EA5 uni1EAD uni1EA7 uni1EA9 uni1EAB adieresis uni1EA1 agrave uni1EA3 amacron aogonek aring aringacute atilde atilde.alt aeacute cacute ccaron ccedilla ccircumflex cdotaccent dcaron dcroat eacute ebreve ecaron ecircumflex uni1EBF uni1EC7 uni1EC1 uni1EC3 uni1EC5 edieresis edotaccent uni1EB9 egrave uni1EBB emacron eogonek uni1EBD gbreve gcaron gcircumflex uni0123 gdotaccent uni01E5 hbar hcircumflex dotlessi iacute ibreve uni01D0 icircumflex idieresis uni1ECB igrave uni1EC9 imacron iogonek itilde uni0268 istrokedotless ijacute uni0237 jcircumflex uni0137 lacute lcaron uni013C ldot lslash uni1E3F nacute uni01F9 napostrophe ncaron uni0146 uni1E45 ntilde ntilde.alt oacute obreve uni01D2 ocircumflex uni1ED1 uni1ED9 uni1ED3 uni1ED5 uni1ED7 odieresis uni1ECD ograve uni1ECF ohorn uni1EDB uni1EE3 uni1EDD uni1EDF uni1EE1 ohungarumlaut omacron uni01EB oslash oslashacute otilde otilde.alt racute rcaron uni0157 sacute scaron scedilla scircumflex uni0219 uni1E63 tbar tcaron uni0163 uni021B uacute ubreve uni01D4 ucircumflex udieresis uni01D8 uni01DA uni01DC uni01D6 uni1EE5 ugrave uni1EE7 uhorn uni1EE9 uni1EF1 uni1EEB uni1EED uni1EEF uhungarumlaut umacron uogonek uring utilde uni0289 wacute wcircumflex wdieresis wgrave yacute ycircumflex ydieresis uni1EF5 ygrave uni1EF7 uni0233 uni1EF9 zacute zcaron zdotaccent gbreve.short gdotaccent.short hbar.short tcaron.short Aacute Abreve uni1EAE uni1EB6 uni1EB0 uni1EB2 uni1EB4 uni01CD Acircumflex uni1EA4 uni1EAC uni1EA6 uni1EA8 uni1EAA Adieresis uni1EA0 Agrave uni1EA2 Amacron Aogonek Aring Aringacute Atilde Atilde.alt AEacute Cacute Ccaron Ccedilla Ccircumflex Cdotaccent Dcaron Dcroat Eacute Ebreve Ecaron Ecircumflex uni1EBE uni1EC6 uni1EC0 uni1EC2 uni1EC4 Edieresis Edotaccent uni1EB8 Egrave uni1EBA Emacron Eogonek uni1EBC Gbreve Gcaron Gcircumflex uni0122 Gdotaccent uni01E4 Hbar Hcircumflex Iacute Ibreve uni01CF Icircumflex Idieresis Idotaccent uni1ECA Igrave uni1EC8 Imacron Iogonek Itilde uni0197 IJacute Jcircumflex uni0136 Lacute Lcaron uni013B Ldot Lslash uni1E3E Nacute uni01F8 Ncaron uni0145 uni1E44 Ntilde Ntilde.alt Oacute Obreve uni01D1 Ocircumflex uni1ED0 uni1ED8 uni1ED2 uni1ED4 uni1ED6 Odieresis uni1ECC Ograve uni1ECE Ohorn uni1EDA uni1EE2 uni1EDC uni1EDE uni1EE0 Ohungarumlaut Omacron uni01EA Oslash Oslashacute Otilde Otilde.alt Racute Rcaron uni0156 Sacute Scaron Scedilla Scircumflex uni0218 uni1E62 Tbar Tcaron uni0162 uni021A Uacute Ubreve uni01D3 Ucircumflex Udieresis uni01D7 uni01D9 uni01DB uni01D5 uni1EE4 Ugrave uni1EE6 Uhorn uni1EE8 uni1EF0 uni1EEA uni1EEC uni1EEE Uhungarumlaut Umacron Uogonek Uring Utilde uni0244 Wacute Wcircumflex Wdieresis Wgrave Yacute Ycircumflex Ydieresis uni1EF4 Ygrave uni1EF6 uni0232 uni1EF8 Zacute Zcaron Zdotaccent Aacute.alt01 Abreve.alt01 Acircumflex.alt01 Adieresis.alt01 Agrave.alt01 Amacron.alt01 Aogonek.alt01 Aring.alt01 Aringacute.alt01 Atilde.alt01 Gbreve.alt01 Gcaron.alt01 Gcircumflex.alt01 Gdotaccent.alt01 Nacute.alt01 Ncaron.alt01 Ntilde.alt01 Racute.longleg Rcaron.longleg Tbar.narrow Tcaron.narrow Jcircumflex.short A_Tcaron.dlig L_Aacute.dlig L_Abreve.dlig L_Acircumflex.dlig L_Adieresis.dlig L_Agrave.dlig L_Amacron.dlig L_Aring.dlig L_Atilde.dlig R_Ncaron.dlig Racute_N.dlig Racute_Ncaron.dlig Rcaron_N.dlig Rcaron_Ncaron.dlig T_Eogonek.dlig Tcaron_U.dlig k_iacute.dlig k_imacron.dlig zero.dnom one.dnom two.dnom three.dnom four.dnom five.dnom six.dnom seven.dnom eight.dnom nine.dnom zero.numr one.numr two.numr three.numr four.numr five.numr six.numr seven.numr eight.numr nine.numr exclamdown.case questiondown.case colon.hour period.narrow question.narrow parenleft.case parenright.case hyphen.case guillemotleft guillemotright quoteright.narrow uni2003 uni2002 uni200A uni00A0 uni2009 uni2215 dotmath uni2126 uni2206 product summation uni00B5 arrowup arrowright arrowdown arrowleft uniF8FF uni2117 uni2113 uni2116 u1F36E at.case dieresis dotaccent grave acute hungarumlaut circumflex caron breve ring ring_acutecomb tilde macron cedilla ogonek uni0308 uni0307 gravecomb acutecomb uni030B uni0302 uni030C uni0306 uni030A tildecomb uni0304 hookabovecomb uni0312 uni031B dotbelowcomb dotbelow.loclYBA uni0326 uni0327 uni0328 dieresisacutecomb dieresiscaroncomb dieresisgravecomb dieresismacroncomb uni0330 uni0331 tildecomb.alt tildecomb.alt.case gravecomb.narrow acutecomb.narrow tildecomb.narrow gravecomb.short acutecomb.short tildecomb.short hookabovecomb.short

by the way, the lists… (begginer here… but I don’t see anything so strange)

Original

Listing table info for "/Users/diegomaldonado/Desktop/PudimExport/Web PYFT Test/Full/ndPudim-Rg-Web.woff":
    tag     checksum    length    offset
    ----  ----------  --------  --------
    CFF   0xCDB8AFC2     59302      6068
    GDEF  0xBBB4BD00       438     65372
    GPOS  0xACAAB3FF     14110     65812
    GSUB  0xBFF770FE      7487     79924
    OS/2  0xBDA05DFB        82      2100
    cmap  0xED930F23      3462      2584
    head  0x25ECF4BD        49       292
    hhea  0x077206E7        32      2068
    hmtx  0x82E7F347      1724       344
    maxp  0x05415000         6       284
    name  0x689A9CC8       398      2184
    post  0xFF9F0032        19      6048```

Subset

Listing table info for "/Users/diegomaldonado/Desktop/PudimExport/Web PYFT Test/Full/ndPudim-Rg-Web.subset.woff":
    tag     checksum    length    offset
    ----  ----------  --------  --------
    CFF   0x963B7A70     44811       212
    GDEF  0x4AA64F52       524     56496
    GPOS  0xC51CE78F     31364     57020
    GSUB  0x26F1F6DE      3936     88384
    OS/2  0x79905DFB        96     48092
    cmap  0x0B7F7E57      8008     48456
    head  0x25ECF4BD        54     45024
    hhea  0x0772049F        36     48056
    hmtx  0x05879119      2974     45080
    maxp  0x02F25000         6       204
    name  0x10EB2BF5       268     48188
    post  0xFF9F0032        32     56464```

I also added
--layout-features+=dlig --no-hinting
at the end.

The GPOS is more than twice as big. That is not good.

if I export the table with ttx, they are exactly the same

<?xml version="1.0" encoding="UTF-8"?>
<ttFont sfntVersion="OTTO" ttLibVersion="4.37">

</ttFont>