Files
figcraft/crates/text/Cargo.toml
fede9234 54ba84eddc Text: colour emoji draw from their own colour tables (#268)
Colour emoji came out as the placeholder rectangles their outlines carry
(Apple Color Emoji) or as .notdef when the face has no outline at all:
nothing read sbix, CBDT/EBDT or COLR. A glyph now asks its face for
colour ink before its outline: an embedded bitmap strike decoded to
premultiplied RGBA and placed by the strike's bearings the way Skia (and
CoreText) places it, scaled to the size the run asks for, or a COLR v0
glyph's layers filled from the font's palette.

Faces that carry only colour tables are indexed again: Apple Color Emoji
is no longer skipped for being 190 MB (the scan still reads headers and
name tables only), and "Segoe UI Emoji" and "Noto Color Emoji" join
"Apple Color Emoji" as colour fallbacks, read only for a text that
nothing else covers. The png crate decodes the strikes; skrifa keeps
shaping, metrics and outlines.

Left for later: COLR v1 paint graphs, alpha-only strikes and the SVG and
PDF exports (text is outlines there).

Tests: 8 cases in the text crate (placement, PNG and raw-BGRA decoding,
scaling, COLR layers and bitmaps of the machine's own colour font) and a
render case gated on that font; the font-free ones run everywhere.
Verified on Windows with Segoe UI Emoji (COLR) and with Noto Color Emoji
(CBDT) read from a downloaded file; the sbix path runs through the same
code and needs a macOS run to be seen.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-10-14 16:19:46 +02:00

21 lines
630 B
TOML

[package]
name = "figcraft-text"
version.workspace = true
edition.workspace = true
license.workspace = true
description = "FigCraft text: font database (embedded craft-fonts + system fonts), shaping, line layout, glyph outlines"
[lints]
workspace = true
[dependencies]
figcraft-geom = { workspace = true }
figcraft-doc = { workspace = true }
skrifa = { workspace = true }
harfrust = { workspace = true }
# Colour emoji: sbix/CBDT strikes are PNG images the text layer decodes for the renderer.
png = { workspace = true }
unicode-bidi = { workspace = true }
unicode-segmentation = { workspace = true }
log = { workspace = true }