Skip to content

Handling vertical advance; ascender / descender doesn't look correct for some fonts #726

@opengraphica

Description

@opengraphica

Expected Behavior

I'm looking for the correct way to draw a font vertically.

Current Behavior

If I use font.ascender and font.descender to determine vertical placement (unitsPerEm taken into account), I get unnaturally large gaps between characters with vertical spacing.
image

This is odd, since opening the font in FontForge doesn't show such abnormally large ascender/descenders as I'm getting from opentype.js.

image

Maybe it has something to do with you reading the glyph data instead of the actual font metrics?

image

Possible Solution

I noticed FontForge has a concept of a vertical advance, which I don't see in opentype.js.

image

Steps to Reproduce (for bugs)

  1. Draw glyphs manually, using font.ascender and font.descender as metrics for spacing the glyphs vertically.

Your Environment

  • Version used: 1.3.4
  • Font used: Noto Sans JP

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions