Skip to content

change text-halo-width unit to pixels - #514

Merged
lbud merged 3 commits into
masterfrom
text-halo-pixels
Jul 7, 2014
Merged

lbud merged 3 commits into
masterfrom
text-halo-pixels

Conversation

@lbud

@lbud lbud commented Jul 2, 2014

Copy link
Copy Markdown
Contributor

@ansis

ansis commented Jul 3, 2014

Copy link
Copy Markdown
Contributor

It would be great if as part of this the sdf properties (24, 8, the offset) could be moved into separate variables. It should help make things a bit less confusing, and would let us read the properties from the glyph source instead of hardcoding it mapbox/node-fontnik#51

@lbud

lbud commented Jul 7, 2014

Copy link
Copy Markdown
Contributor Author

Math-ed on this for a while and arrived at this.
Also extracted sdf properties into vars here -- is that what you meant @ansis, so that later those can just be changed to read from node-fontnik?

@ansis

ansis commented Jul 7, 2014

Copy link
Copy Markdown
Contributor

Yep, that looks great. Where does blurOffset come from?

@lbud

lbud commented Jul 7, 2014

Copy link
Copy Markdown
Contributor Author

Basically, at no blur, according to previous calculations (where 1 was default) (and assume window.devicePixelRatio=1 for now) you'd have
1 * 2.5 / 24 / 1 = .104
so that should be the default calculated offset, on an sdf scale of 0 to 1;
Max pixel blur, at 24px font size, should be 6px, so
6 * blurOffset / 8 / (24 / 24) + (2.5/24) = 1
blurOffset = 1.19
.....although the more I type this the less confident I am in it...does this make sense?

@lbud
lbud merged commit 7676596 into master Jul 7, 2014
@mourner
mourner deleted the text-halo-pixels branch July 7, 2014 23:21
@kkaefer kkaefer changed the title [not ready] change text-halo-width unit to pixels change text-halo-width unit to pixels Jul 10, 2014
stepankuzmin pushed a commit that referenced this pull request Jun 21, 2023
…ec (#514)

* [MAPS3D-824] add zoom/measure-light to text/icon-emissive strength spec
* Increase timeout for Map.#setLayoutProperty test
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