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

sdf metadata #51

Open
ansis opened this issue Jun 26, 2014 · 8 comments
Open

sdf metadata #51

ansis opened this issue Jun 26, 2014 · 8 comments

Comments

@ansis
Copy link
Contributor

ansis commented Jun 26, 2014

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)

@mikemorris
Copy link
Contributor

👍

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

@yhahn
Copy link
Member

yhahn commented Jun 26, 2014

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.

@mikemorris
Copy link
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.

@mikemorris
Copy link
Contributor

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

@ansis
Copy link
Contributor Author

ansis commented Jul 3, 2014

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

@lbud lbud mentioned this issue Mar 20, 2015
3 tasks
@mattdesl
Copy link
Contributor

mattdesl commented May 6, 2015

👍

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?

@mikemorris
Copy link
Contributor

offset and radius, more hardcoded defaults that should be exposed/adjustable https://github.com/mapbox/node-fontnik/blob/master/src/glyphs.cpp#L614-L615

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

No branches or pull requests

5 participants