Releases: mapbox/tiny-sdf
Releases · mapbox/tiny-sdf
v2.2.0
- Fixed hard cutoffs at glyph edges where ink touches the bounding box (common in dense scripts like CJK). The inner distance transform now correctly sees outside-ink pixels in the surrounding buffer region (#63).
- Fixed glyph placement within the SDF texture for fonts where
actualBoundingBoxLeftis non-zero. Glyphs are now correctly centered without phantom padding, producing slightly smaller textures. Downstream consumers that position quads viaglyphLeft(e.g. mapbox-gl-js) render identically (#65).
v2.1.0
- Apply gamma correction to anti-aliased pixels. This makes the SDF-rendered text very slightly thicker and matches how browsers render the same text/font with HTML closer (by @xavierjs #61)
- Improve performance by ~10%.
- Fix glyph x alignment to use actual bounding box metrics, matching height behavior. #34
- Reintroduce using
OffscreenCanvasby default where available, making TinySDF work in worker contexts. #35 - Better code comments to clarify logic. #10
v2.0.7
v2.0.6
v2.0.5
v2.0.4
v2.0.3
v2.0.2
v2.0.1
v2.0.0
⚠️ Breaking changes
- Change the API to accept an options object instead of arguments:
const tinySdf = new TinySDF({
fontSize: 24,
fontFamily: 'Arial'
});- Simplify the API down to just a single
drawmethod (that calculates glyph metrics by default). - Change the shape of the return value for readability and consistency (see the docs).
- Drop support for Internet Explorer.
- Switch the package to ES Modules syntax.
✨ Other improvements
- Improve performance by up to 20%.
- Add
fontStylesupport. - Fix major performance issues on certain Chrome/GPU combinations.
- Fix an issue where some glyphs where clipped by 1 pixel at the bottom. #33