Skip to content

sdf metadata #51

Closed
Closed

Description

@ansis

It would be nice to include metadata about how the sdfs are rendered.

Not urgent, but it would be nice to not hardcode these in the renderers.

Explanation of how this metadata is used at mapbox/mapbox-gl-style-spec#66 (comment)

Activity

  1. mikemorris commented on Jun 26, 2014

    @mikemorris
    Contributor

    👍

    Should buffer size (currently hardcoded to 3) be configurable too?

  2. yhahn commented on Jun 26, 2014

    @yhahn
    Contributor

    Hrm, let's not worry about this until we have a reason to change these things. Picking good defaults and not changing them beats making anything possible and giving the impression that they will be handled by implementers.

  3. mikemorris commented on Jul 1, 2014

    @mikemorris
    Contributor

    In testing SDF granularity, it appears that our current defaults, while sensible for most serif and sans-serif fonts, are quite inadequate for curvy, swooping fonts.

  4. mikemorris commented on Jul 2, 2014

    @mikemorris
    Contributor

    @ansis Can you link to the lines in the code where distance units per pixel and shift are implemented?

  5. ansis commented on Jul 3, 2014

    @ansis
    ContributorAuthor

    They aren't separate variables yet, but the values are part of the equations for u_buffer and u_gamma here https://github.com/mapbox/mapbox-gl-js/blob/1e8bb1120da09db7eaa804581204acfa36fe4d97/js/render/drawtext.js#L93-L106

    @lbud is currently working on updating this part for v4 styles mapbox/mapbox-gl-js#514

  6. mattdesl commented on May 6, 2015

    @mattdesl
    Contributor

    👍

    Even if things like buffer aren't (yet) adjustable it would be great to export meta data so there is less magic going on in tools that use fontnik. For example:
    https://github.com/Jam3/sdf-bitmap-glyphs/blob/master/index.js#L6

    A few other metrics like lineHeight, baseline, etc would also be great to add to the load() data. Not sure how MapboxGL is currently handling those?

  7. mikemorris commented on May 7, 2015

    @mikemorris
    Contributor
  8. jcary741 commented on Oct 13, 2026

    @jcary741

    Closing as stale.

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