Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse TrueType glyph contour direction by default to match fontmake #475

Merged
merged 4 commits into from
Oct 5, 2023

Conversation

anthrotype
Copy link
Member

@anthrotype anthrotype commented Sep 29, 2023

Fixes #174

but somewhat blocked on googlefonts/fontations#640 Now using the latest kurbo's BezPath::reverse_subpaths() instead of ReverseContourPen

@anthrotype anthrotype marked this pull request as draft September 29, 2023 16:39
@anthrotype anthrotype marked this pull request as ready for review October 4, 2023 16:16
@anthrotype anthrotype force-pushed the reverse-contours branch 2 times, most recently from b97ec63 to f059122 Compare October 4, 2023 16:24
@anthrotype
Copy link
Member Author

with this PR (without --keep-direction), running ttx_diff.py against Oswald.glyphs gives no diffs in glyf table for the default profile but a few diffs in the gvar. Not sure why:

--- build/default/fontc.gvar.ttx	2023-10-04 17:32:35.827998928 +0100
+++ build/default/fontmake.gvar.ttx	2023-10-04 17:32:35.827998928 +0100
@@ -84,6 +84,7 @@
         <delta pt="13" x="23" y="19"/>
         <delta pt="14" x="-11" y="19"/>
         <delta pt="15" x="-8" y="0"/>
+        <delta pt="16" x="-25" y="-18"/>
         <delta pt="18" x="22" y="122"/>
         <delta pt="20" x="-6" y="0"/>
       </tuple>
@@ -91,16 +92,27 @@
         <coord axis="wght" value="1.0"/>
         <delta pt="0" x="38" y="0"/>
         <delta pt="1" x="50" y="0"/>
+        <delta pt="2" x="84" y="0"/>
         <delta pt="3" x="84" y="-40"/>
+        <delta pt="4" x="119" y="-40"/>
         <delta pt="5" x="119" y="28"/>
+        <delta pt="6" x="92" y="28"/>
         <delta pt="7" x="92" y="-17"/>
+        <delta pt="8" x="119" y="-17"/>
         <delta pt="9" x="119" y="40"/>
+        <delta pt="10" x="84" y="40"/>
         <delta pt="11" x="84" y="0"/>
+        <delta pt="12" x="74" y="0"/>
         <delta pt="13" x="74" y="-32"/>
         <delta pt="14" x="92" y="-32"/>
         <delta pt="15" x="109" y="0"/>
+        <delta pt="16" x="98" y="0"/>
+        <delta pt="17" x="74" y="0"/>
         <delta pt="18" x="74" y="-60"/>
+        <delta pt="19" x="0" y="0"/>
         <delta pt="20" x="73" y="0"/>
+        <delta pt="21" x="0" y="0"/>
+        <delta pt="22" x="0" y="0"/>
       </tuple>
     </glyphVariations>
     <glyphVariations glyph="AEacute">
@@ -20774,6 +20786,7 @@
         <delta pt="6" x="-18" y="-14"/>
         <delta pt="8" x="-15" y="32"/>
         <delta pt="10" x="-18" y="0"/>
+        <delta pt="11" x="-31" y="-14"/>
         <delta pt="13" x="31" y="52"/>
         <delta pt="15" x="10" y="0"/>
       </tuple>
@@ -20785,6 +20798,7 @@
         <delta pt="6" x="53" y="-6"/>
         <delta pt="8" x="37" y="-35"/>
         <delta pt="10" x="53" y="0"/>
+        <delta pt="11" x="9" y="-6"/>
         <delta pt="13" x="-1" y="-37"/>
         <delta pt="15" x="41" y="0"/>
       </tuple>
@@ -20798,6 +20812,7 @@
         <delta pt="4" x="-48" y="0"/>
         <delta pt="6" x="-84" y="0"/>
         <delta pt="9" x="-84" y="21"/>
+        <delta pt="11" x="-81" y="0"/>
         <delta pt="13" x="-48" y="45"/>
         <delta pt="15" x="-106" y="0"/>
       </tuple>

Copy link
Member

@dfrg dfrg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a small suggestion on style.

@anthrotype anthrotype added this pull request to the merge queue Oct 5, 2023
Merged via the queue into main with commit 1ccc237 Oct 5, 2023
@anthrotype anthrotype deleted the reverse-contours branch October 5, 2023 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

should reverse path direction when going cu2qu
2 participants