mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-19 06:38:44 +00:00
type.retype turns selected outlined text back into live point text when each glyph shape is exactly a glyph of a loaded font, a font the document uses or a family named in fonts: the same up to uniform scale, rotation and translation. Matched glyphs map back to characters through the cmap and become point text in that font and size at the same baseline and turn, one object per line, with the first glyph's fill and stroke, in one undo step. Shapes that match no font stay and are reported. Matching (vectorcraft_text::retype) samples each contour at equal steps of arc length and fits a similarity transform; it is bounded (faces, glyphs, path elements, contours) and panic-free. Near matches, the ranked font list, installed fonts not yet loaded and images are phase 2.