ktx-font-0.3.0.0: CHANGELOG.md
# Changelog for `ktx-font`
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to the
[Haskell Package Versioning Policy](https://pvp.haskell.org/).
## 0.3.0.0 - 2026-11-17
- Migrated to `kb-text-shape >= 0.3` and `kb-text-layout >= 0.2`.
The bundled kbts blobs changed format again. Rebuild the `.ktxf` assets.
- Shaping failures throw the `ShapeException` from `kb-text-shape` instead of calling `error`.
- `Layout.shapeText` and the break hyphen shape the text as a single run in the style's font.
A style whose font sat under another one in the stack used to get the tail of its text from the font above.
Even with the font on top, the text could split into two runs and lose a ligature.
`kb-text-layout` measures text the same way. The line breaks now agree with the placed glyphs.
- `Shaping.withFont_` carries the caveats of its `kb-text-shape` counterpart.
A section reaching the end of the input shapes its tail in the font below it.
## 0.2.0.1 - 2026-09-06
- Bring back foldl' import for older base.
## 0.2.0.0 - 2026-09-02
- Requires `kb-text-layout >= 0.1.2.0`, whose emergency breaks stop inside
shaping clusters, so a ligature is never split across lines by `placeText`.
- Migrated to `kb-text-shape >= 0.2.1.0`. The bundled kbts blobs changed
format, so the `.ktxf` assets have to be rebuilt.
- Added the `Codec.Ktx2.Font.Layout` module: multiline layout on top of
`kb-text-layout` with wrapping (greedy or optimal), alignment, and
measurement helpers, all in the same cap-height units as the glyph planes.
* `shapeText` does all the font work once, and the pure `placeText` breaks
and places the result for any width, so resizes don't touch the fonts.
* `layoutTextWith` is the two chained together.
- Added `Shaping.shapeClusters`: shaping along a single pen that keeps the
codepoint index and advance of every glyph. `unsafeShapeClusters` is the same
for callers already holding the locked context.
- `StackContext` gained a `layout` field with the measurement caches.
- The demo now lays out with wrapping: Left/Right adjust the wrap width,
F1 toggles the break strategy.
- Fixed `Cursor.ySign` being applied to the glyph positioning offsets as well as
to the line advance. The glyph planes and the offsets are both Y-up, so only
the line advance follows the sign. `initialCursorDown` now really does advance
the lines downwards, and stacked marks land on the correct side of the glyph.
- Fixed the swapped `PlacedGlyph.glyph` / `PlacedGlyph.plane` haddocks. `glyph`
is the atlas box, `plane` is the screen box.
- `shape` now reads the font metrics while the fonts are known to be alive
instead of leaving the lookup to the caller's laziness.
- `bundleFont` now fails on em-sized layouts from fonts without a cap height
instead of writing infinities into the atlas planes.
- Added the `ktx-font-demo` executable (behind the `executables` flag), an
interactive Brillo viewer for the bundles built from `assets.yaml`.
## 0.1.0.1 - 2026-03-18
- Make plane rescaling depend on `layout.atlas.sizeUnit`.
* 1.0 if already caps-sized, unitsPerEm/capHeight otherwise.
## 0.1.0.0 - 2025-12-30
Initial release.