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

outlineCompiler: improve VORG table generation #418

Merged
merged 1 commit into from
Nov 17, 2020

Conversation

m4rc1e
Copy link
Contributor

@m4rc1e m4rc1e commented Nov 4, 2020

Whilst working on glyphsLib, I noticed that the VORG table generation is too greedy. If a glyph's vertical origin is the same as the table's default vertical origin, we don't need to add it.

Here's a quick before and after on a test font.

Current implementation

  <VORG>
    <majorVersion value="1"/>
    <minorVersion value="0"/>
    <defaultVertOriginY value="850"/>
    <numVertOriginYMetrics value="6"/>
    <VOriginRecord>
      <glyphName value=".notdef"/>
      <vOrigin value="850"/>
    </VOriginRecord>
    <VOriginRecord>
      <glyphName value="A"/>
      <vOrigin value="850"/>
    </VOriginRecord>
    <VOriginRecord>
      <glyphName value="B"/>
      <vOrigin value="850"/>
    </VOriginRecord>
    <VOriginRecord>
      <glyphName value="A.rotat"/>
      <vOrigin value="850"/>
    </VOriginRecord>
    <VOriginRecord>
      <glyphName value="A.half.rotat"/>
      <vOrigin value="850"/>
    </VOriginRecord>
    <VOriginRecord>
      <glyphName value="B.half.rotat"/>
      <vOrigin value="550"/>
    </VOriginRecord>
  </VORG>

This pr

  <VORG>
    <majorVersion value="1"/>
    <minorVersion value="0"/>
    <defaultVertOriginY value="850"/>
    <numVertOriginYMetrics value="1"/>
    <VOriginRecord>
      <glyphName value="B.half.rotat"/>
      <vOrigin value="550"/>
    </VOriginRecord>
  </VORG>

Do not add glyphs to the VORG table if their vertical origins are the same value as the default vertical origin.
@m4rc1e m4rc1e requested a review from anthrotype November 10, 2020 10:47
@m4rc1e
Copy link
Contributor Author

m4rc1e commented Nov 17, 2020

@anthrotype friendly ping.

@anthrotype anthrotype merged commit 03eadba into googlefonts:master Nov 17, 2020
@anthrotype
Copy link
Member

Thanks!

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.

2 participants