adobe-type-tools / afdko

Adobe Font Development Kit for OpenType
https://adobe-type-tools.github.io/afdko/
Other
1.05k stars 167 forks source link

Subsetting with makeotf #1299

Closed dy closed 3 years ago

dy commented 3 years ago

Trying to subset a TTF font with makeotf, and getting an error:

> makeotf -ff ./Noto/diacritics.fea -gs -nshw -r -f ./Noto/original/NotoSerif-Bold.ttf -o ./Noto/NotoSerif-Bold.otf

makeotf [Error] For TTF fonts, the GlyphOrderAndAliasDB file must preserve the original font glyph order, and use the same names as they are derived by the 'tx' tool. C:\projects\fonts\Noto\GlyphOrderAndAliasDB.
Glyphs in TTF font missing from GlyphOrderAndAliasDB: afii10023 afii10051 afii10052 afii10053 afii10054 afii10055 afii10056 afii10057 afii10058 afii10059 afii10060 afii10061 afii10062 afii10145 afii10017 afii10018 afii10019 afii10020 afii10021 afii10022 afii10024 afii10025 afii10026 afii10027 afii10028 afii10029 afii10030 afii10031 afii10...

GlyphOrderAndAliasDB file contains first N glyphs obtained by tx command:

Show content ``` .notdef .notdef uni0000 uni0000 uni000D uni000D space space exclam exclam quotedbl quotedbl numbersign numbersign dollar dollar percent percent ampersand ampersand quotesingle quotesingle parenleft parenleft parenright parenright asterisk asterisk plus plus comma comma hyphen hyphen period period slash slash zero zero one one two two three three four four five five six six seven seven eight eight nine nine colon colon semicolon semicolon less less equal equal greater greater question question at at A A B B C C D D E E F F G G H H I I J J K K L L M M N N O O P P Q Q R R S S T T U U V V W W X X Y Y Z Z bracketleft bracketleft backslash backslash bracketright bracketright asciicircum asciicircum underscore underscore grave grave a a b b c c d d e e f f g g h h i i j j k k l l m m n n o o p p q q r r s s t t u u v v w w x x y y z z braceleft braceleft bar bar braceright braceright asciitilde asciitilde uni00A0 uni00A0 exclamdown exclamdown cent cent sterling sterling currency currency yen yen brokenbar brokenbar section section dieresis dieresis copyright copyright ordfeminine ordfeminine guillemotleft guillemotleft logicalnot logicalnot uni00AD uni00AD registered registered macron macron degree degree plusminus plusminus twosuperior twosuperior threesuperior threesuperior acute acute mu mu paragraph paragraph periodcentered periodcentered cedilla cedilla onesuperior onesuperior ordmasculine ordmasculine guillemotright guillemotright onequarter onequarter onehalf onehalf threequarters threequarters questiondown questiondown Agrave Agrave Aacute Aacute Acircumflex Acircumflex Atilde Atilde Adieresis Adieresis Aring Aring AE AE Ccedilla Ccedilla Egrave Egrave Eacute Eacute Ecircumflex Ecircumflex Edieresis Edieresis Igrave Igrave Iacute Iacute Icircumflex Icircumflex Idieresis Idieresis Eth Eth Ntilde Ntilde Ograve Ograve Oacute Oacute Ocircumflex Ocircumflex Otilde Otilde Odieresis Odieresis multiply multiply Oslash Oslash Ugrave Ugrave Uacute Uacute Ucircumflex Ucircumflex Udieresis Udieresis Yacute Yacute Thorn Thorn germandbls germandbls agrave agrave aacute aacute acircumflex acircumflex atilde atilde adieresis adieresis aring aring ae ae ccedilla ccedilla egrave egrave eacute eacute ecircumflex ecircumflex edieresis edieresis igrave igrave iacute iacute icircumflex icircumflex idieresis idieresis eth eth ntilde ntilde ograve ograve oacute oacute ocircumflex ocircumflex otilde otilde odieresis odieresis divide divide oslash oslash ugrave ugrave uacute uacute ucircumflex ucircumflex udieresis udieresis yacute yacute thorn thorn ydieresis ydieresis Amacron Amacron amacron amacron Abreve Abreve abreve abreve Aogonek Aogonek aogonek aogonek Cacute Cacute cacute cacute Ccircumflex Ccircumflex ccircumflex ccircumflex Cdotaccent Cdotaccent cdotaccent cdotaccent Ccaron Ccaron ccaron ccaron Dcaron Dcaron dcaron dcaron Dcroat Dcroat dcroat dcroat Emacron Emacron emacron emacron Ebreve Ebreve ebreve ebreve Edotaccent Edotaccent edotaccent edotaccent Eogonek Eogonek eogonek eogonek Ecaron Ecaron ecaron ecaron Gcircumflex Gcircumflex gcircumflex gcircumflex Gbreve Gbreve gbreve gbreve Gdotaccent Gdotaccent gdotaccent gdotaccent Gcommaaccent Gcommaaccent gcommaaccent gcommaaccent Hcircumflex Hcircumflex hcircumflex hcircumflex Hbar Hbar hbar hbar Itilde Itilde itilde itilde Imacron Imacron imacron imacron Ibreve Ibreve ibreve ibreve Iogonek Iogonek iogonek iogonek Idotaccent Idotaccent dotlessi dotlessi IJ IJ ij ij Jcircumflex Jcircumflex jcircumflex jcircumflex Kcommaaccent Kcommaaccent kcommaaccent kcommaaccent kgreenlandic kgreenlandic Lacute Lacute lacute lacute Lcommaaccent Lcommaaccent lcommaaccent lcommaaccent Lcaron Lcaron lcaron lcaron Ldot Ldot ldot ldot Lslash Lslash lslash lslash Nacute Nacute nacute nacute Ncommaaccent Ncommaaccent ncommaaccent ncommaaccent Ncaron Ncaron ncaron ncaron napostrophe napostrophe Eng Eng eng eng Omacron Omacron omacron omacron Obreve Obreve obreve obreve Ohungarumlaut Ohungarumlaut ohungarumlaut ohungarumlaut OE OE oe oe Racute Racute racute racute Rcommaaccent Rcommaaccent rcommaaccent rcommaaccent Rcaron Rcaron rcaron rcaron Sacute Sacute sacute sacute Scircumflex Scircumflex scircumflex scircumflex Scedilla Scedilla scedilla scedilla Scaron Scaron scaron scaron uni021A uni021A uni021B uni021B Tcaron Tcaron tcaron tcaron Tbar Tbar tbar tbar Utilde Utilde utilde utilde Umacron Umacron umacron umacron Ubreve Ubreve ubreve ubreve Uring Uring uring uring Uhungarumlaut Uhungarumlaut uhungarumlaut uhungarumlaut Uogonek Uogonek uogonek uogonek Wcircumflex Wcircumflex wcircumflex wcircumflex Ycircumflex Ycircumflex ycircumflex ycircumflex Ydieresis Ydieresis Zacute Zacute zacute zacute Zdotaccent Zdotaccent zdotaccent zdotaccent Zcaron Zcaron zcaron zcaron longs longs florin florin Aringacute Aringacute aringacute aringacute AEacute AEacute aeacute aeacute Oslashacute Oslashacute oslashacute oslashacute Scommaaccent Scommaaccent scommaaccent scommaaccent circumflex circumflex caron caron uni02C9 uni02C9 breve breve dotaccent dotaccent ring ring ogonek ogonek tilde tilde hungarumlaut hungarumlaut tonos tonos dieresistonos dieresistonos Alphatonos Alphatonos anoteleia anoteleia Epsilontonos Epsilontonos Etatonos Etatonos Iotatonos Iotatonos Omicrontonos Omicrontonos Upsilontonos Upsilontonos Omegatonos Omegatonos iotadieresistonos iotadieresistonos Alpha Alpha Beta Beta Gamma Gamma uni0394 uni0394 Epsilon Epsilon Zeta Zeta Eta Eta Theta Theta Iota Iota Kappa Kappa Lambda Lambda Mu Mu Nu Nu Xi Xi Omicron Omicron Pi Pi Rho Rho Sigma Sigma Tau Tau Upsilon Upsilon Phi Phi Chi Chi Psi Psi uni03A9 uni03A9 Iotadieresis Iotadieresis Upsilondieresis Upsilondieresis alphatonos alphatonos epsilontonos epsilontonos etatonos etatonos iotatonos iotatonos upsilondieresistonos upsilondieresistonos alpha alpha beta beta gamma gamma delta delta epsilon epsilon zeta zeta eta eta theta theta iota iota kappa kappa lambda lambda uni03BC uni03BC nu nu xi xi omicron omicron pi pi rho rho sigma1 sigma1 sigma sigma tau tau upsilon upsilon phi phi chi chi psi psi omega omega iotadieresis iotadieresis upsilondieresis upsilondieresis omicrontonos omicrontonos upsilontonos upsilontonos omegatonos omegatonos ```

The same command works as intended with otf file as source.

miguelsousa commented 3 years ago

If you want to subset a sfnt-based font the best tool is pyftsubset which is part of the FontTools package, not makeotf.

dy commented 3 years ago

Great, many thanks, I was looking for that.