Skip to content

Use font-provided metadata to determine glyph baseline position #191

Open

Description

@ansis

@kkaefer, is this something harfbuzz can produce?

Otherwise, the median bottom edge would probably be a good approximation.

Activity

  1. kkaefer commented on Nov 15, 2013

    @kkaefer
    Member

    Why did you close this?

  2. ansis commented on Nov 16, 2013

    @ansis
    ContributorAuthor

    Not sure, reopening

  3. reopened this on Nov 16, 2013
  4. mourner commented on Jun 24, 2014

    @mourner
    Member

    Should this move to fontserver?

  5. mikemorris commented on Jul 28, 2014

    @mikemorris
    Contributor

    @ansis Not sure if this ticket is still relevant, but Harfbuzz is not necessary (FreeType is sufficient) for getting ascender (distance from top to baseline) for a font face. I have an open PR at mapbox/node-fontnik#50 for #154 that implements this and adds it to the glyph PBF (note that all glyphs in a face have the same ascender, so the PBF structure could be optimized a bit here)

  6. ansis commented on Jan 22, 2016

    @ansis
    ContributorAuthor

    re-opening because this is still hardcoded in -js:

    var yOffset = -17;

  7. reopened this on Jan 22, 2016
  8. self-assigned this
    on Jan 22, 2016
  9. ansis commented on Jan 22, 2016

    @ansis
    ContributorAuthor
  10. mikemorris commented on Jan 25, 2016

    @mikemorris
    Contributor
  11. 11 remaining items

  12. lucaswoj commented on Feb 21, 2017

    @lucaswoj
    Contributor

    Closing as stale. I haven't seen this become a practical concern yet.

  13. kkaefer commented on Feb 21, 2017

    @kkaefer
    Member

    Assuming that this will be subsumed by @ChrisLoer's push on fonts + harfbuzz.

  14. lucaswoj commented on Feb 21, 2017

    @lucaswoj
    Contributor

    Ah! Good point. We can keep this open to track this aspect of our text shaping work.

  15. self-assigned this
    on Feb 27, 2017
  16. nickidlugash commented on Sep 28, 2017

    @nickidlugash

    @ChrisLoer @ansis @kkaefer Is this something we can move on before switching to Harfbuzz? What would it require to accomplish this? It continues to be a visible issue:

    • Text along lines are often not vertically centered (quite noticeable if the line geometry is also visible, like with road labels along roads).
    • Labels using multiple fonts (due to font fallbacks for different unicode ranges) can have vertically misaligned glyphs.
    • Vertically-oriented text along lines using multiple fonts can have awkward spacing or even overlap between glyphs.

    Please let me know if there's anything I can do to help resolve this 🙏

  17. ChrisLoer commented on Sep 28, 2017

    @ChrisLoer
    Contributor

    @nickidlugash I think this is something we can work on without Harfbuzz. It does unfortunately require server-side changes -- i.e. we need to get node-fontnik to send the metadata down to the client. Hopefully we can add that to the glyph PBF is a backward compatible way, and just use the baseline if it's there, otherwise fall back to our hardwired value.

  18. tristen commented on Jul 10, 2019

    @tristen
    Member

    Unearthing this issue as deriving this from a fonts metadata instead of using a fixed value would greatly improve labels using mixed font families.

    Screen Shot 2019-07-10 at 9 44 44 AM

    we need to get node-fontnik to send the metadata down to the client.

    @springmeyer wanted to put this on your radar. The only related issue I saw in that project was mapbox/node-fontnik#51

  19. mikemorris commented on Jul 11, 2019

    @mikemorris
    Contributor

    @tristen There's an abandoned PR in which I started most of the work for this at mapbox/node-fontnik#97

  20. springmeyer commented on Jul 11, 2019

    @springmeyer
    Contributor

    👋 @tristen - If someone from @mapbox/map-design-team wants to tackle this I'd be happy to help get them up to speed on node-fontnik development. /cc @jseppi @agentpu1011 @ian29 @brsbl @philogb

  21. tristen commented on Aug 6, 2019

    @tristen
    Member

    Re-earthing @mikemorris's initial work in a new pr mapbox/node-fontnik#160. That should address the downstream work to enable this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions