This repository has been archived on 2025-10-02. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
inter-font/misc/pylib/robofab/tools/glyphConstruction.py
Rasmus Andersson 8234b62ab7 Speeds up font compilation by around 200%
Cython is used to compile some hot paths into native Python extensions.
These hot paths were identified through running ufocompile with the hotshot
profiler and then converting file by file to Cython, starting with the "hottest"
paths and continuing until returns were deminishing. This means that only a few
Python files were converted to Cython.

Closes #23
Closes #20 (really this time)
2017-09-04 11:12:34 -04:00

565 lines
No EOL
17 KiB
Python

_glyphConstruction = """\
#
# RoboFab Glyph Construction Database
#
# format:
# Glyphname: BaseGlyph Accent.RelativePosition* Accent.RelativePosition*
# *RelativePosition can be top, bottom, left, right
#
# NOTE: this is not a comprehensive, or even accurate, glyph list.
# It was built by Python robots and, in many cases, by tired human hands.
# Please report any omissions, errors or praise to the local RoboFab authorities.
#
##: Uppercase
AEacute: AE acute.top
AEmacron: AE macron.top
Aacute: A acute.top
Abreve: A breve.top
Abreveacute: A breve.top acute.top
Abrevedotaccent: A breve.top dotaccent.bottom
Abrevegrave: A breve.top grave.top
Abrevetilde: A breve.top tilde.top
Acaron: A caron.top
Acircumflex: A circumflex.top
Acircumflexacute: A circumflex.top acute.top
Acircumflexdotaccent: A circumflex.top dotaccent.bottom
Acircumflexgrave: A circumflex.top grave.top
Acircumflextilde: A circumflex.top tilde.top
Adblgrave: A dblgrave.top
Adieresis: A dieresis.top
Adieresismacron: A dieresis.top macron.top
Adotaccent: A dotaccent.top
Adotaccentmacron: A dotaccent.top macron.top
Agrave: A grave.top
Amacron: A macron.top
Aogonek: A ogonek.bottom
Aring: A ring.top
Aringacute: A ring.top acute.top
Atilde: A tilde.top
Bdotaccent: B dotaccent.top
Cacute: C acute.top
Ccaron: C caron.top
Ccedilla: C cedilla.bottom
Ccedillaacute: C cedilla.bottom acute.top
Ccircumflex: C circumflex.top
Cdotaccent: C dotaccent.top
Dcaron: D caron.top
Dcedilla: D cedilla.bottom
Ddotaccent: D dotaccent.top
Eacute: E acute.top
Ebreve: E breve.top
Ecaron: E caron.top
Ecedilla: E cedilla.bottom
Ecedillabreve: E cedilla.bottom breve.top
Ecircumflex: E circumflex.top
Ecircumflexacute: E circumflex.top acute.top
Ecircumflexdotaccent: E circumflex.top dotaccent.bottom
Ecircumflexgrave: E circumflex.top grave.top
Ecircumflextilde: E circumflex.top tilde.top
Edblgrave: E dblgrave.top
Edieresis: E dieresis.top
Edotaccent: E dotaccent.top
Egrave: E grave.top
Emacron: E macron.top
Emacronacute: E macron.top acute.top
Emacrongrave: E macron.top grave.top
Eogonek: E ogonek.bottom
Etilde: E tilde.top
Fdotaccent: F dotaccent.top
Gacute: G acute.top
Gbreve: G breve.top
Gcaron: G caron.top
Gcedilla: G cedilla.bottom
Gcircumflex: G circumflex.top
Gcommaaccent: G commaaccent.bottom
Gdotaccent: G dotaccent.top
Gmacron: G macron.top
Hcaron: H caron.top
Hcedilla: H cedilla.top
Hcircumflex: H circumflex.top
Hdieresis: H dieresis.top
Hdotaccent: H dotaccent.top
Iacute: I acute.top
Ibreve: I breve.top
Icaron: I caron.top
Icircumflex: I circumflex.top
Idblgrave: I dblgrave.top
Idieresis: I dieresis.top
Idieresisacute: I dieresis.top acute.top
Idotaccent: I dotaccent.top
Igrave: I grave.top
Imacron: I macron.top
Iogonek: I ogonek.bottom
Itilde: I tilde.top
Jcircumflex: J circumflex.top
Kacute: K acute.top
Kcaron: K caron.top
Kcedilla: K cedilla.bottom
Kcommaaccent: K commaaccent.bottom
Lacute: L acute.top
Lcaron: L commaaccent.right
Lcedilla: L cedilla.bottom
Lcommaaccent: L commaaccent.bottom
Ldot: L dot.right
Ldotaccent: L dotaccent.bottom
Ldotaccentmacron: L dotaccent.bottom macron.top
Macute: M acute.top
Mdotaccent: M dotaccent.top
Nacute: N acute.top
Ncaron: N caron.top
Ncedilla: N cedilla.bottom
Ncommaaccent: N commaaccent.bottom
Ndotaccent: N dotaccent.top
Ngrave: N grave.top
Ntilde: N tilde.top
Oacute: O acute.top
Obreve: O breve.top
Ocaron: O caron.top
Ocircumflex: O circumflex.top
Ocircumflexacute: O circumflex.top acute.top
Ocircumflexdotaccent: O circumflex.top dotaccent.bottom
Ocircumflexgrave: O circumflex.top grave.top
Ocircumflextilde: O circumflex.top tilde.top
Odblgrave: O dblgrave.top
Odieresis: O dieresis.top
Odieresismacron: O dieresis.top macron.top
Ograve: O grave.top
Ohungarumlaut: O hungarumlaut.top
Omacron: O macron.top
Omacronacute: O macron.top acute.top
Omacrongrave: O macron.top grave.top
Oogonek: O ogonek.bottom
Oogonekmacron: O ogonek.bottom macron.top
Oslashacute: Oslash acute.top
Otilde: O tilde.top
Otildeacute: O tilde.top acute.top
Otildedieresis: O tilde.top dieresis.top
Otildemacron: O tilde.top macron.top
Pacute: P acute.top
Pdotaccent: P dotaccent.top
Racute: R acute.top
Rcaron: R caron.top
Rcedilla: R cedilla.bottom
Rcommaaccent: R commaaccent.bottom
Rdblgrave: R dblgrave.top
Rdotaccent: R dotaccent.top
Rdotaccentmacron: R dotaccent.top macron.top
Sacute: S acute.top
Sacutedotaccent: S acute.top dotaccent.top
Scaron: S caron.top
Scarondotaccent: S caron.top dotaccent.top
Scedilla: S cedilla.bottom
Scircumflex: S circumflex.top
Scommaaccent: S commaaccent.bottom
Sdotaccent: S dotaccent.top
Tcaron: T caron.top
Tcedilla: T cedilla.bottom
Tcommaaccent: T commaaccent.bottom
Tdotaccent: T dotaccent.top
Uacute: U acute.top
Ubreve: U breve.top
Ucaron: U caron.top
Ucircumflex: U circumflex.top
Udblgrave: U dblgrave.top
Udieresis: U dieresis.top
Udieresisacute: U dieresis.top acute.top
Udieresiscaron: U dieresis.top caron.top
Udieresisgrave: U dieresis.top grave.top
Udieresismacron: U dieresis.top macron.top
Ugrave: U grave.top
Uhungarumlaut: U hungarumlaut.top
Umacron: U macron.top
Umacrondieresis: U macron.top dieresis.top
Uogonek: U ogonek.bottom
Uring: U ring.top
Utilde: U tilde.top
Utildeacute: U tilde.top acute.top
Vtilde: V tilde.top
Wacute: W acute.top
Wcircumflex: W circumflex.top
Wdieresis: W dieresis.top
Wdotaccent: W dotaccent.top
Wgrave: W grave.top
Xdieresis: X dieresis.top
Xdotaccent: X dotaccent.top
Yacute: Y acute.top
Ycircumflex: Y circumflex.top
Ydieresis: Y dieresis.top
Ydotaccent: Y dotaccent.top
Ygrave: Y grave.top
Ytilde: Y tilde.top
Zacute: Z acute.top
Zcaron: Z caron.top
Zcircumflex: Z circumflex.top
Zdotaccent: Z dotaccent.top
##: Lowercase
aacute: a acute.top
abreve: a breve.top
abreveacute: a breve.top acute.top
abrevedotaccent: a breve.top dotaccent.bottom
abrevegrave: a breve.top grave.top
abrevetilde: a breve.top tilde.top
acaron: a caron.top
acircumflex: a circumflex.top
acircumflexacute: a circumflex.top acute.top
acircumflexdotaccent: a circumflex.top dotaccent.bottom
acircumflexgrave: a circumflex.top grave.top
acircumflextilde: a circumflex.top tilde.top
adblgrave: a dblgrave.top
adieresis: a dieresis.top
adieresismacron: a dieresis.top macron.top
adotaccent: a dotaccent.top
adotaccentmacron: a dotaccent.top macron.top
aeacute: ae acute.top
aemacron: ae macron.top
agrave: a grave.top
amacron: a macron.top
aogonek: a ogonek.bottom
aring: a ring.top
aringacute: a ring.top acute.top
atilde: a tilde.top
bdotaccent: b dotaccent.top
cacute: c acute.top
ccaron: c caron.top
ccedilla: c cedilla.bottom
ccedillaacute: c cedilla.bottom acute.top
ccircumflex: c circumflex.top
cdotaccent: c dotaccent.top
dcaron: d commaaccent.right
dcedilla: d cedilla.bottom
ddotaccent: d dotaccent.top
dmacron: d macron.top
eacute: e acute.top
ebreve: e breve.top
ecaron: e caron.top
ecedilla: e cedilla.bottom
ecedillabreve: e cedilla.bottom breve.top
ecircumflex: e circumflex.top
ecircumflexacute: e circumflex.top acute.top
ecircumflexdotaccent: e circumflex.top dotaccent.bottom
ecircumflexgrave: e circumflex.top grave.top
ecircumflextilde: e circumflex.top tilde.top
edblgrave: e dblgrave.top
edieresis: e dieresis.top
edotaccent: e dotaccent.top
egrave: e grave.top
emacron: e macron.top
emacronacute: e macron.top acute.top
emacrongrave: e macron.top grave.top
eogonek: e ogonek.bottom
etilde: e tilde.top
fdotaccent: f dotaccent.top
gacute: g acute.top
gbreve: g breve.top
gcaron: g caron.top
gcedilla: g cedilla.top
gcircumflex: g circumflex.top
gcommaaccent: g commaaccent.top
gdotaccent: g dotaccent.top
gmacron: g macron.top
hcaron: h caron.top
hcedilla: h cedilla.bottom
hcircumflex: h circumflex.top
hdieresis: h dieresis.top
hdotaccent: h dotaccent.top
iacute: dotlessi acute.top
ibreve: dotlessi breve.top
icaron: dotlessi caron.top
icircumflex: dotlessi circumflex.top
idblgrave: dotlessi dblgrave.top
idieresis: dotlessi dieresis.top
idieresisacute: dotlessi dieresis.top acute.top
igrave: dotlessi grave.top
imacron: dotlessi macron.top
iogonek: i ogonek.bottom
itilde: dotlessi tilde.top
jcaron: dotlessj caron.top
jcircumflex: dotlessj circumflex.top
jacute: dotlessj acute.top
kacute: k acute.top
kcaron: k caron.top
kcedilla: k cedilla.bottom
kcommaaccent: k commaaccent.bottom
lacute: l acute.top
lcaron: l commaaccent.right
lcedilla: l cedilla.bottom
lcommaaccent: l commaaccent.bottom
ldot: l dot.right
ldotaccent: l dotaccent.bottom
ldotaccentmacron: l dotaccent.bottom macron.top
macute: m acute.top
mdotaccent: m dotaccent.top
nacute: n acute.top
ncaron: n caron.top
ncedilla: n cedilla.bottom
ncommaaccent: n commaaccent.bottom
ndotaccent: n dotaccent.top
ngrave: n grave.top
ntilde: n tilde.top
oacute: o acute.top
obreve: o breve.top
ocaron: o caron.top
ocircumflex: o circumflex.top
ocircumflexacute: o circumflex.top acute.top
ocircumflexdotaccent: o circumflex.top dotaccent.bottom
ocircumflexgrave: o circumflex.top grave.top
ocircumflextilde: o circumflex.top tilde.top
odblgrave: o dblgrave.top
odieresis: o dieresis.top
odieresismacron: o dieresis.top macron.top
ograve: o grave.top
ohungarumlaut: o hungarumlaut.top
omacron: o macron.top
omacronacute: o macron.top acute.top
omacrongrave: o macron.top grave.top
oogonek: o ogonek.bottom
oogonekmacron: o ogonek.bottom macron.top
oslashacute: oslash acute.top
otilde: o tilde.top
otildeacute: o tilde.top acute.top
otildedieresis: o tilde.top dieresis.top
otildemacron: o tilde.top macron.top
pacute: p acute.top
pdotaccent: p dotaccent.top
racute: r acute.top
rcaron: r caron.top
rcedilla: r cedilla.bottom
rcommaaccent: r commaaccent.bottom
rdblgrave: r dblgrave.top
rdotaccent: r dotaccent.top
rdotaccentmacron: r dotaccent.top macron.top
sacute: s acute.top
sacutedotaccent: s acute.top dotaccent.top
scaron: s caron.top
scarondotaccent: s caron.top dotaccent.top
scedilla: s cedilla.bottom
scircumflex: s circumflex.top
scommaaccent: s commaaccent.bottom
sdotaccent: s dotaccent.top
tcaron: t commaaccent.right
tcedilla: t cedilla.bottom
tcommaaccent: t commaaccent.bottom
tdieresis: t dieresis.top
tdotaccent: t dotaccent.top
uacute: u acute.top
ubreve: u breve.top
ucaron: u caron.top
ucircumflex: u circumflex.top
udblgrave: u dblgrave.top
udieresis: u dieresis.top
udieresisacute: u dieresis.top acute.top
udieresiscaron: u dieresis.top caron.top
udieresisgrave: u dieresis.top grave.top
udieresismacron: u dieresis.top macron.top
ugrave: u grave.top
uhungarumlaut: u hungarumlaut.top
umacron: u macron.top
umacrondieresis: u macron.top dieresis.top
uogonek: u ogonek.bottom
uring: u ring.top
utilde: u tilde.top
utildeacute: u tilde.top acute.top
vtilde: v tilde.top
wacute: w acute.top
wcircumflex: w circumflex.top
wdieresis: w dieresis.top
wdotaccent: w dotaccent.top
wgrave: w grave.top
wring: w ring.top
xdieresis: x dieresis.top
xdotaccent: x dotaccent.top
yacute: y acute.top
ycircumflex: y circumflex.top
ydieresis: y dieresis.top
ydotaccent: y dotaccent.top
ygrave: y grave.top
yring: y ring.top
ytilde: y tilde.top
zacute: z acute.top
zcaron: z caron.top
zcircumflex: z circumflex.top
zdotaccent: z dotaccent.top
##: Small: Caps
AEacute.sc: AE.sc acute.top
AEmacron.sc: AE.sc macron.top
Aacute.sc: A.sc acute.top
Abreve.sc: A.sc breve.top
Abreveacute.sc: A.sc breve.top acute.top
Abrevedotaccent.sc: A.sc breve.top dotaccent.bottom
Abrevegrave.sc: A.sc breve.top grave.top
Abrevetilde.sc: A.sc breve.top tilde.top
Acaron.sc: A.sc caron.top
Acircumflex.sc: A.sc circumflex.top
Acircumflexacute.sc: A.sc circumflex.top acute.top
Acircumflexdotaccent.sc: A.sc circumflex.top dotaccent.bottom
Acircumflexgrave.sc: A.sc circumflex.top grave.top
Acircumflextilde.sc: A.sc circumflex.top tilde.top
Adblgrave.sc: A.sc dblgrave.top
Adieresis.sc: A.sc dieresis.top
Adieresismacron.sc: A.sc dieresis.top macron.top
Adotaccent.sc: A.sc dotaccent.top
Adotaccentmacron.sc: A.sc dotaccent.top macron.top
Agrave.sc: A.sc grave.top
Amacron.sc: A.sc macron.top
Aogonek.sc: A.sc ogonek.bottom
Aring.sc: A.sc ring.top
Aringacute.sc: A.sc ring.top acute.top
Atilde.sc: A.sc tilde.top
Bdotaccent.sc: B.sc dotaccent.top
Cacute.sc: C.sc acute.top
Ccaron.sc: C.sc caron.top
Ccedilla.sc: C.sc cedilla.bottom
Ccedillaacute.sc: C.sc cedilla.bottom acute.top
Ccircumflex.sc: C.sc circumflex.top
Cdotaccent.sc: C.sc dotaccent.top
Dcaron.sc: D.sc caron.top
Dcedilla.sc: D.sc cedilla.bottom
Ddotaccent.sc: D.sc dotaccent.top
Eacute.sc: E.sc acute.top
Ebreve.sc: E.sc breve.top
Ecaron.sc: E.sc caron.top
Ecedilla.sc: E.sc cedilla.bottom
Ecedillabreve.sc: E.sc cedilla.bottom breve.top
Ecircumflex.sc: E.sc circumflex.top
Ecircumflexacute.sc: E.sc circumflex.top acute.top
Ecircumflexdotaccent.sc: E.sc circumflex.top dotaccent.bottom
Ecircumflexgrave.sc: E.sc circumflex.top grave.top
Ecircumflextilde.sc: E.sc circumflex.top tilde.top
Edblgrave.sc: E.sc dblgrave.top
Edieresis.sc: E.sc dieresis.top
Edotaccent.sc: E.sc dotaccent.top
Egrave.sc: E.sc grave.top
Emacron.sc: E.sc macron.top
Emacronacute.sc: E.sc macron.top acute.top
Emacrongrave.sc: E.sc macron.top grave.top
Eogonek.sc: E.sc ogonek.bottom
Etilde.sc: E.sc tilde.top
Fdotaccent.sc: F.sc dotaccent.top
Gacute.sc: G.sc acute.top
Gbreve.sc: G.sc breve.top
Gcaron.sc: G.sc caron.top
Gcedilla.sc: G.sc cedilla.bottom
Gcircumflex.sc: G.sc circumflex.top
Gcommaaccent.sc: G.sc commaaccent.bottom
Gdotaccent.sc: G.sc dotaccent.top
Gmacron.sc: G.sc macron.top
Hcaron.sc: H.sc caron.top
Hcedilla.sc: H.sc cedilla.top
Hcircumflex.sc: H.sc circumflex.top
Hdieresis.sc: H.sc dieresis.top
Hdotaccent.sc: H.sc dotaccent.top
Iacute.sc: I.sc acute.top
Ibreve.sc: I.sc breve.top
Icaron.sc: I.sc caron.top
Icircumflex.sc: I.sc circumflex.top
Idblgrave.sc: I.sc dblgrave.top
Idieresis.sc: I.sc dieresis.top
Idieresisacute.sc: I.sc dieresis.top acute.top
Idotaccent.sc: I.sc dotaccent.top
Igrave.sc: I.sc grave.top
Imacron.sc: I.sc macron.top
Iogonek.sc: I.sc ogonek.bottom
Itilde.sc: I.sc tilde.top
Jcircumflex.sc: J.sc circumflex.top
Kacute.sc: K.sc acute.top
Kcaron.sc: K.sc caron.top
Kcedilla.sc: K.sc cedilla.bottom
Kcommaaccent.sc: K.sc commaaccent.bottom
Lacute.sc: L.sc acute.top
Lcaron.sc: L.sc commaaccent.right
Lcedilla.sc: L.sc cedilla.bottom
Lcommaaccent.sc: L.sc commaaccent.bottom
Ldot.sc: L.sc dot.right
Ldotaccent.sc: L.sc dotaccent.bottom
Ldotaccentmacron.sc: L.sc dotaccent.bottom macron.top
Macute.sc: M.sc acute.top
Mdotaccent.sc: M.sc dotaccent.top
Nacute.sc: N.sc acute.top
Ncaron.sc: N.sc caron.top
Ncedilla.sc: N.sc cedilla.bottom
Ncommaaccent.sc: N.sc commaaccent.bottom
Ndotaccent.sc: N.sc dotaccent.top
Ngrave.sc: N.sc grave.top
Ntilde.sc: N.sc tilde.top
Oacute.sc: O.sc acute.top
Obreve.sc: O.sc breve.top
Ocaron.sc: O.sc caron.top
Ocircumflex.sc: O.sc circumflex.top
Ocircumflexacute.sc: O.sc circumflex.top acute.top
Ocircumflexdotaccent.sc: O.sc circumflex.top dotaccent.bottom
Ocircumflexgrave.sc: O.sc circumflex.top grave.top
Ocircumflextilde.sc: O.sc circumflex.top tilde.top
Odblgrave.sc: O.sc dblgrave.top
Odieresis.sc: O.sc dieresis.top
Odieresismacron.sc: O.sc dieresis.top macron.top
Ograve.sc: O.sc grave.top
Ohungarumlaut.sc: O.sc hungarumlaut.top
Omacron.sc: O.sc macron.top
Omacronacute.sc: O.sc macron.top acute.top
Omacrongrave.sc: O.sc macron.top grave.top
Oogonek.sc: O.sc ogonek.bottom
Oogonekmacron.sc: O.sc ogonek.bottom macron.top
Oslashacute.sc: Oslash.sc acute.top
Otilde.sc: O.sc tilde.top
Otildeacute.sc: O.sc tilde.top acute.top
Otildedieresis.sc: O.sc tilde.top dieresis.top
Otildemacron.sc: O.sc tilde.top macron.top
Pacute.sc: P.sc acute.top
Pdotaccent.sc: P.sc dotaccent.top
Racute.sc: R.sc acute.top
Rcaron.sc: R.sc caron.top
Rcedilla.sc: R.sc cedilla.bottom
Rcommaaccent.sc: R.sc commaaccent.bottom
Rdblgrave.sc: R.sc dblgrave.top
Rdotaccent.sc: R.sc dotaccent.top
Rdotaccentmacron.sc: R.sc dotaccent.top macron.top
Sacute.sc: S.sc acute.top
Sacutedotaccent.sc: S.sc acute.top dotaccent.top
Scaron.sc: S.sc caron.top
Scarondotaccent.sc: S.sc caron.top dotaccent.top
Scedilla.sc: S.sc cedilla.bottom
Scircumflex.sc: S.sc circumflex.top
Scommaaccent.sc: S.sc commaaccent.bottom
Sdotaccent.sc: S.sc dotaccent.top
Tcaron.sc: T.sc caron.top
Tcedilla.sc: T.sc cedilla.bottom
Tcommaaccent.sc: T.sc commaaccent.bottom
Tdotaccent.sc: T.sc dotaccent.top
Uacute.sc: U.sc acute.top
Ubreve.sc: U.sc breve.top
Ucaron.sc: U.sc caron.top
Ucircumflex.sc: U.sc circumflex.top
Udblgrave.sc: U.sc dblgrave.top
Udieresis.sc: U.sc dieresis.top
Udieresisacute.sc: U.sc dieresis.top acute.top
Udieresiscaron.sc: U.sc dieresis.top caron.top
Udieresisgrave.sc: U.sc dieresis.top grave.top
Udieresismacron.sc: U.sc dieresis.top macron.top
Ugrave.sc: U.sc grave.top
Uhungarumlaut.sc: U.sc hungarumlaut.top
Umacron.sc: U.sc macron.top
Umacrondieresis.sc: U.sc macron.top dieresis.top
Uogonek.sc: U.sc ogonek.bottom
Uring.sc: U.sc ring.top
Utilde.sc: U.sc tilde.top
Utildeacute.sc: U.sc tilde.top acute.top
Vtilde.sc: V.sc tilde.top
Wacute.sc: W.sc acute.top
Wcircumflex.sc: W.sc circumflex.top
Wdieresis.sc: W.sc dieresis.top
Wdotaccent.sc: W.sc dotaccent.top
Wgrave.sc: W.sc grave.top
Xdieresis.sc: X.sc dieresis.top
Xdotaccent.sc: X.sc dotaccent.top
Yacute.sc: Y.sc acute.top
Ycircumflex.sc: Y.sc circumflex.top
Ydieresis.sc: Y.sc dieresis.top
Ydotaccent.sc: Y.sc dotaccent.top
Ygrave.sc: Y.sc grave.top
Ytilde.sc: Y.sc tilde.top
Zacute.sc: Z.sc acute.top
Zcaron.sc: Z.sc caron.top
Zcircumflex.sc: Z.sc circumflex.top
Zdotaccent.sc: Z.sc dotaccent.top
"""