[cantarell-fonts/ufo-conversion] Do not propagate anchors for compat glyphs
- From: Nikolaus Waxweiler <nwaxweiler src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cantarell-fonts/ufo-conversion] Do not propagate anchors for compat glyphs
- Date: Sat, 16 Feb 2019 00:09:36 +0000 (UTC)
commit 48cb1793f589e9c4a55dc8949243fb487d3696cb
Author: Nikolaus Waxweiler <madigens gmail com>
Date: Sat Feb 16 00:09:13 2019 +0000
Do not propagate anchors for compat glyphs
Provide script to update list.
requirements-dev.in | 4 +
requirements-dev.txt | 25 +++++
scripts/update-anchor-propagation-includes.py | 52 ++++++++++
src/Cantarell-Regular.ufo/lib.plist | 141 +++++++++++---------------
4 files changed, 141 insertions(+), 81 deletions(-)
---
diff --git a/requirements-dev.in b/requirements-dev.in
new file mode 100644
index 00000000..4002ec6f
--- /dev/null
+++ b/requirements-dev.in
@@ -0,0 +1,4 @@
+-r requirements.txt
+
+ufoLib2
+glyphsLib>=2.3.0
diff --git a/requirements-dev.txt b/requirements-dev.txt
new file mode 100644
index 00000000..50a59482
--- /dev/null
+++ b/requirements-dev.txt
@@ -0,0 +1,25 @@
+#
+# This file is autogenerated by pip-compile
+# To update, run:
+#
+# pip-compile --output-file requirements-dev.txt requirements-dev.in
+#
+appdirs==1.4.3
+attrs==18.2.0 # via ufolib2
+booleanoperations==0.8.2
+compreffor==0.4.6.post1
+cu2qu==1.6.5
+defcon[lxml]==0.6.0
+fontmake==1.9.1
+fontmath==0.4.9
+fonttools[lxml,ufo,unicode]==3.37.3
+fs==2.3.0
+glyphslib==3.2.0
+lxml==4.3.1
+mutatormath==2.1.2
+psautohint==1.9.1
+pyclipper==1.1.0.post1
+pytz==2018.9
+six==1.12.0
+ufo2ft==2.7.0
+ufolib2==0.3.0
diff --git a/scripts/update-anchor-propagation-includes.py b/scripts/update-anchor-propagation-includes.py
new file mode 100644
index 00000000..0ba8e385
--- /dev/null
+++ b/scripts/update-anchor-propagation-includes.py
@@ -0,0 +1,52 @@
+"""Update the glyph name list for anchor propagation.
+
+We rely on Glyphs-style anchor propagation to get mark-to-base and mark-
+to-mark anchoring for composites. Contrary to Glyphs behavior, we want
+to keep propagation to non-ligature letters and combining marks.
+Propagation to ligatures like "fi" and compatibility digraphs is
+broken/incomplete in ufo2ft 2.7.0 and probably makes little sense
+anyway.
+
+Propagation only makes sense for composites, but we include outline
+glyphs in the list because it's faster to go through glyphOrder than the
+glyph objects.
+"""
+
+from pathlib import Path
+
+import fontTools.unicodedata
+import glyphsLib.glyphdata
+import ufoLib2
+
+main_source_path = Path(__file__).parent.parent / "src" / "Cantarell-Regular.ufo"
+main_source = ufoLib2.Font.open(main_source_path)
+letters_and_marks = []
+for glyph_name in main_source.glyphOrder:
+ if glyph_name.startswith("_"):
+ continue
+
+ info = glyphsLib.glyphdata.get_glyph(glyph_name)
+
+ if info.category not in ("Letter", "Mark"):
+ continue
+
+ if (info.category, info.subCategory) == ("Letter", "Ligature"):
+ continue
+
+ if info.unicode:
+ decomposition = fontTools.unicodedata.decomposition(
+ chr(int(info.unicode, base=16))
+ )
+ if decomposition.startswith("<compat>"):
+ continue
+
+ letters_and_marks.append(glyph_name)
+
+propagate_anchors_filter = next(
+ f
+ for f in main_source.lib["com.github.googlei18n.ufo2ft.filters"]
+ if f["name"] == "propagateAnchors"
+)
+propagate_anchors_filter["include"] = sorted(letters_and_marks)
+
+main_source.save()
diff --git a/src/Cantarell-Regular.ufo/lib.plist b/src/Cantarell-Regular.ufo/lib.plist
index 708c47ff..bf02f723 100644
--- a/src/Cantarell-Regular.ufo/lib.plist
+++ b/src/Cantarell-Regular.ufo/lib.plist
@@ -15,13 +15,13 @@
<dict>
<key>include</key>
<array>
- <string>A-cy</string>
<string>A</string>
+ <string>A-cy</string>
<string>AE</string>
<string>AEacute</string>
<string>Aacute</string>
- <string>Abreve-cy</string>
<string>Abreve</string>
+ <string>Abreve-cy</string>
<string>Abreveacute</string>
<string>Abrevedotbelow</string>
<string>Abrevegrave</string>
@@ -35,8 +35,8 @@
<string>Acircumflexhookabove</string>
<string>Acircumflextilde</string>
<string>Adblgrave</string>
- <string>Adieresis-cy</string>
<string>Adieresis</string>
+ <string>Adieresis-cy</string>
<string>Adotbelow</string>
<string>Agrave</string>
<string>Ahookabove</string>
@@ -62,18 +62,16 @@
<string>Chekhakassian-cy</string>
<string>Cheverticalstroke-cy</string>
<string>D</string>
- <string>DZcaron</string>
<string>Dcaron</string>
<string>Dcroat</string>
<string>Ddotbelow</string>
<string>De-cy</string>
<string>Dje-cy</string>
<string>Dlinebelow</string>
- <string>Dzcaron</string>
<string>Dze-cy</string>
<string>Dzhe-cy</string>
- <string>E-cy</string>
<string>E</string>
+ <string>E-cy</string>
<string>Eacute</string>
<string>Ebreve</string>
<string>Ecaron</string>
@@ -132,16 +130,16 @@
<string>Hbrevebelow</string>
<string>Hcircumflex</string>
<string>Hdotbelow</string>
- <string>I-cy</string>
<string>I</string>
+ <string>I-cy</string>
<string>Ia-cy</string>
<string>Iacute</string>
<string>Ibreve</string>
<string>Icaron</string>
<string>Icircumflex</string>
<string>Idblgrave</string>
- <string>Idieresis-cy</string>
<string>Idieresis</string>
+ <string>Idieresis-cy</string>
<string>Idieresisacute</string>
<string>Idotaccent</string>
<string>Idotbelow</string>
@@ -154,8 +152,8 @@
<string>Iigrave-cy</string>
<string>Iinvertedbreve</string>
<string>Iishort-cy</string>
- <string>Imacron-cy</string>
<string>Imacron</string>
+ <string>Imacron-cy</string>
<string>Io-cy</string>
<string>Iogonek</string>
<string>Itilde</string>
@@ -174,31 +172,26 @@
<string>Kcommaaccent</string>
<string>Kje-cy</string>
<string>L</string>
- <string>LJ</string>
<string>Lacute</string>
<string>Lcaron</string>
<string>Lcommaaccent</string>
- <string>Ldot</string>
<string>Ldotbelow</string>
- <string>Lj</string>
<string>Lje-cy</string>
<string>Llinebelow</string>
<string>Lslash</string>
<string>M</string>
<string>Mdotbelow</string>
<string>N</string>
- <string>NJ</string>
<string>Nacute</string>
<string>Ncaron</string>
<string>Ncommaaccent</string>
<string>Ndotaccent</string>
<string>Ndotbelow</string>
- <string>Nj</string>
<string>Nje-cy</string>
<string>Nlinebelow</string>
<string>Ntilde</string>
- <string>O-cy</string>
<string>O</string>
+ <string>O-cy</string>
<string>OE</string>
<string>Oacute</string>
<string>Obarred-cy</string>
@@ -211,8 +204,8 @@
<string>Ocircumflexhookabove</string>
<string>Ocircumflextilde</string>
<string>Odblgrave</string>
- <string>Odieresis-cy</string>
<string>Odieresis</string>
+ <string>Odieresis-cy</string>
<string>Odieresismacron</string>
<string>Odotaccentmacron</string>
<string>Odotbelow</string>
@@ -256,8 +249,8 @@
<string>Scaron</string>
<string>Scarondotaccent</string>
<string>Scedilla</string>
- <string>Schwa-cy</string>
<string>Schwa</string>
+ <string>Schwa-cy</string>
<string>Scircumflex</string>
<string>Scommaaccent</string>
<string>Sdotaccent</string>
@@ -278,15 +271,15 @@
<string>Tlinebelow</string>
<string>Tse-cy</string>
<string>Tshe-cy</string>
- <string>U-cy</string>
<string>U</string>
+ <string>U-cy</string>
<string>Uacute</string>
<string>Ubreve</string>
<string>Ucaron</string>
<string>Ucircumflex</string>
<string>Udblgrave</string>
- <string>Udieresis-cy</string>
<string>Udieresis</string>
+ <string>Udieresis-cy</string>
<string>Udieresisacute</string>
<string>Udieresiscaron</string>
<string>Udieresisgrave</string>
@@ -300,11 +293,11 @@
<string>Uhorngrave</string>
<string>Uhornhookabove</string>
<string>Uhorntilde</string>
- <string>Uhungarumlaut-cy</string>
<string>Uhungarumlaut</string>
+ <string>Uhungarumlaut-cy</string>
<string>Uinvertedbreve</string>
- <string>Umacron-cy</string>
<string>Umacron</string>
+ <string>Umacron-cy</string>
<string>Umacrondieresis</string>
<string>Uogonek</string>
<string>Uring</string>
@@ -349,11 +342,11 @@
<string>Zhebreve-cy</string>
<string>Zhedescender-cy</string>
<string>Zhedieresis-cy</string>
- <string>a-cy</string>
<string>a</string>
+ <string>a-cy</string>
<string>aacute</string>
- <string>abreve-cy</string>
<string>abreve</string>
+ <string>abreve-cy</string>
<string>abreveacute</string>
<string>abrevedotbelow</string>
<string>abrevegrave</string>
@@ -366,14 +359,13 @@
<string>acircumflexgrave</string>
<string>acircumflexhookabove</string>
<string>acircumflextilde</string>
- <string>acute</string>
+ <string>acutecomb</string>
<string>acutecomb.case</string>
<string>acutecomb.loclVIET</string>
- <string>acutecomb</string>
<string>acutecomb_dotaccentcomb</string>
<string>adblgrave</string>
- <string>adieresis-cy</string>
<string>adieresis</string>
+ <string>adieresis-cy</string>
<string>adotbelow</string>
<string>ae</string>
<string>aeacute</string>
@@ -389,36 +381,34 @@
<string>atilde</string>
<string>b</string>
<string>be-cy</string>
- <string>breve</string>
<string>brevebelowcomb</string>
- <string>brevecomb-cy.case</string>
+ <string>brevecomb</string>
<string>brevecomb-cy</string>
+ <string>brevecomb-cy.case</string>
<string>brevecomb.case</string>
<string>brevecomb.loclVIET</string>
- <string>brevecomb</string>
- <string>brevecomb_acutecomb.case</string>
<string>brevecomb_acutecomb</string>
- <string>brevecomb_gravecomb.case</string>
+ <string>brevecomb_acutecomb.case</string>
<string>brevecomb_gravecomb</string>
- <string>brevecomb_hookabovecomb.case</string>
+ <string>brevecomb_gravecomb.case</string>
<string>brevecomb_hookabovecomb</string>
- <string>brevecomb_tildecomb.case</string>
+ <string>brevecomb_hookabovecomb.case</string>
<string>brevecomb_tildecomb</string>
- <string>breveinvertedcomb.case</string>
+ <string>brevecomb_tildecomb.case</string>
<string>breveinvertedcomb</string>
+ <string>breveinvertedcomb.case</string>
<string>c</string>
<string>cacute</string>
<string>caron</string>
+ <string>caroncomb</string>
<string>caroncomb.alt</string>
<string>caroncomb.case</string>
<string>caroncomb.loclVIET</string>
- <string>caroncomb</string>
<string>ccaron</string>
<string>ccedilla</string>
<string>ccedillaacute</string>
<string>ccircumflex</string>
<string>cdotaccent</string>
- <string>cedilla</string>
<string>cedillacomb</string>
<string>che-cy</string>
<string>chedescender-cy</string>
@@ -426,50 +416,47 @@
<string>chekhakassian-cy</string>
<string>cheverticalstroke-cy</string>
<string>circumflex</string>
+ <string>circumflexcomb</string>
<string>circumflexcomb.case</string>
<string>circumflexcomb.loclVIET</string>
- <string>circumflexcomb</string>
- <string>circumflexcomb_acutecomb.case</string>
<string>circumflexcomb_acutecomb</string>
- <string>circumflexcomb_gravecomb.case</string>
+ <string>circumflexcomb_acutecomb.case</string>
<string>circumflexcomb_gravecomb</string>
- <string>circumflexcomb_hookabovecomb.case</string>
+ <string>circumflexcomb_gravecomb.case</string>
<string>circumflexcomb_hookabovecomb</string>
- <string>circumflexcomb_tildecomb.case</string>
+ <string>circumflexcomb_hookabovecomb.case</string>
<string>circumflexcomb_tildecomb</string>
+ <string>circumflexcomb_tildecomb.case</string>
<string>commaaccentcomb</string>
<string>commaturnedabovecomb</string>
<string>commaturnedmod</string>
<string>d</string>
- <string>dblgravecomb.case</string>
<string>dblgravecomb</string>
+ <string>dblgravecomb.case</string>
<string>dcaron</string>
<string>dcroat</string>
<string>ddotbelow</string>
<string>de-cy</string>
+ <string>descender-cy</string>
<string>descender-cy.case</string>
<string>descender-cy.strait</string>
- <string>descender-cy</string>
- <string>dieresis</string>
<string>dieresisbelowcomb</string>
+ <string>dieresiscomb</string>
<string>dieresiscomb.case</string>
<string>dieresiscomb.loclVIET</string>
- <string>dieresiscomb</string>
<string>dieresiscomb_acutecomb</string>
<string>dieresiscomb_gravecomb</string>
<string>dje-cy</string>
<string>dlinebelow</string>
- <string>dotaccent</string>
+ <string>dotaccentcomb</string>
<string>dotaccentcomb.case</string>
<string>dotaccentcomb.loclVIET</string>
- <string>dotaccentcomb</string>
<string>dotbelowcomb</string>
<string>doubleprimemod</string>
- <string>dzcaron</string>
<string>dze-cy</string>
<string>dzhe-cy</string>
- <string>e-cy</string>
<string>e</string>
+ <string>e-cy</string>
<string>eacute</string>
<string>ebreve</string>
<string>ecaron</string>
@@ -523,9 +510,9 @@
<string>gje-cy</string>
<string>gmacron</string>
<string>grave</string>
+ <string>gravecomb</string>
<string>gravecomb.case</string>
<string>gravecomb.loclVIET</string>
- <string>gravecomb</string>
<string>h</string>
<string>ha-cy</string>
<string>hadescender-cy</string>
@@ -534,23 +521,22 @@
<string>hbrevebelow</string>
<string>hcircumflex</string>
<string>hdotbelow</string>
+ <string>hookabovecomb</string>
<string>hookabovecomb.case</string>
<string>hookabovecomb.loclVIET</string>
- <string>hookabovecomb</string>
<string>horncomb</string>
- <string>hungarumlaut</string>
- <string>hungarumlautcomb.case</string>
<string>hungarumlautcomb</string>
- <string>i-cy</string>
+ <string>hungarumlautcomb.case</string>
<string>i</string>
+ <string>i-cy</string>
<string>ia-cy</string>
<string>iacute</string>
<string>ibreve</string>
<string>icaron</string>
<string>icircumflex</string>
<string>idblgrave</string>
- <string>idieresis-cy</string>
<string>idieresis</string>
+ <string>idieresis-cy</string>
<string>idieresisacute</string>
<string>idotaccent</string>
<string>idotbelow</string>
@@ -564,8 +550,8 @@
<string>iigrave-cy</string>
<string>iinvertedbreve</string>
<string>iishort-cy</string>
- <string>imacron-cy</string>
<string>imacron</string>
+ <string>imacron-cy</string>
<string>io-cy</string>
<string>iogonek</string>
<string>itilde</string>
@@ -589,21 +575,18 @@
<string>lacute</string>
<string>lcaron</string>
<string>lcommaaccent</string>
- <string>ldot</string>
<string>ldotbelow</string>
- <string>lj</string>
<string>lje-cy</string>
<string>llinebelow</string>
<string>lslash</string>
<string>m</string>
- <string>macron</string>
- <string>macronbelowcomb.narrow</string>
<string>macronbelowcomb</string>
+ <string>macronbelowcomb.narrow</string>
+ <string>macroncomb</string>
<string>macroncomb.case</string>
<string>macroncomb.loclVIET</string>
- <string>macroncomb.narrow.case</string>
<string>macroncomb.narrow</string>
- <string>macroncomb</string>
+ <string>macroncomb.narrow.case</string>
<string>macroncomb_acutecomb</string>
<string>macroncomb_gravecomb</string>
<string>mdotbelow</string>
@@ -613,12 +596,11 @@
<string>ncommaaccent</string>
<string>ndotaccent</string>
<string>ndotbelow</string>
- <string>nj</string>
<string>nje-cy</string>
<string>nlinebelow</string>
<string>ntilde</string>
- <string>o-cy</string>
<string>o</string>
+ <string>o-cy</string>
<string>oacute</string>
<string>obarred-cy</string>
<string>obreve</string>
@@ -630,17 +612,16 @@
<string>ocircumflexhookabove</string>
<string>ocircumflextilde</string>
<string>odblgrave</string>
- <string>odieresis-cy</string>
<string>odieresis</string>
+ <string>odieresis-cy</string>
<string>odieresismacron</string>
<string>odotaccentmacron</string>
<string>odotbelow</string>
<string>oe</string>
- <string>ogonek</string>
+ <string>ogonekcomb</string>
<string>ogonekcomb.narrow</string>
- <string>ogonekcomb.tall.case</string>
<string>ogonekcomb.tall</string>
- <string>ogonekcomb</string>
+ <string>ogonekcomb.tall.case</string>
<string>ograve</string>
<string>ohookabove</string>
<string>ohorn</string>
@@ -676,11 +657,10 @@
<string>rcommaaccent</string>
<string>rdblgrave</string>
<string>rdotbelow</string>
- <string>ring</string>
- <string>ringcomb.case</string>
<string>ringcomb</string>
- <string>ringcomb_acutecomb.case</string>
+ <string>ringcomb.case</string>
<string>ringcomb_acutecomb</string>
+ <string>ringcomb_acutecomb.case</string>
<string>ringhalfleft</string>
<string>ringhalfright</string>
<string>rinvertedbreve</string>
@@ -692,8 +672,8 @@
<string>scaron</string>
<string>scarondotaccent</string>
<string>scedilla</string>
- <string>schwa-cy</string>
<string>schwa</string>
+ <string>schwa-cy</string>
<string>scircumflex</string>
<string>scommaaccent</string>
<string>sdotaccent</string>
@@ -703,14 +683,14 @@
<string>sha-cy</string>
<string>shcha-cy</string>
<string>shha-cy</string>
- <string>slashlongcomb.case</string>
<string>slashlongcomb</string>
- <string>slashshortcomb.case</string>
+ <string>slashlongcomb.case</string>
<string>slashshortcomb</string>
+ <string>slashshortcomb.case</string>
<string>softsign-cy</string>
<string>strokelongcomb</string>
- <string>strokeshortcomb.case</string>
<string>strokeshortcomb</string>
+ <string>strokeshortcomb.case</string>
<string>t</string>
<string>tbar</string>
<string>tcaron</string>
@@ -720,25 +700,24 @@
<string>tdotbelow</string>
<string>te-cy</string>
<string>thorn</string>
- <string>tilde</string>
+ <string>tildecomb</string>
<string>tildecomb.case</string>
<string>tildecomb.loclVIET</string>
- <string>tildecomb</string>
<string>tildecomb_acutecomb</string>
<string>tildecomb_dieresiscomb</string>
<string>tildecomb_macroncomb</string>
<string>tlinebelow</string>
<string>tse-cy</string>
<string>tshe-cy</string>
- <string>u-cy</string>
<string>u</string>
+ <string>u-cy</string>
<string>uacute</string>
<string>ubreve</string>
<string>ucaron</string>
<string>ucircumflex</string>
<string>udblgrave</string>
- <string>udieresis-cy</string>
<string>udieresis</string>
+ <string>udieresis-cy</string>
<string>udieresisacute</string>
<string>udieresiscaron</string>
<string>udieresisgrave</string>
@@ -752,11 +731,11 @@
<string>uhorngrave</string>
<string>uhornhookabove</string>
<string>uhorntilde</string>
- <string>uhungarumlaut-cy</string>
<string>uhungarumlaut</string>
+ <string>uhungarumlaut-cy</string>
<string>uinvertedbreve</string>
- <string>umacron-cy</string>
<string>umacron</string>
+ <string>umacron-cy</string>
<string>umacrondieresis</string>
<string>uogonek</string>
<string>uring</string>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]