Repository navigation
forme 0.9.0
Bounded shaping that admits ordinary text and documents, layout under a context and one budget, and bitmap strikes a caller can list and choose from. From #915 to #918 and #923.
Bounded shaping is charged for the work it does (#916, #919)
- A bounded run is charged for each subtable, ligature and rule tried and each glyph a match walks over, rather than each subtable's size at every position.
- A byte of Latin now costs about 47 units, Devanagari about 300 and Noto Nastaliq about 350, against about 460,000 and 8 million before. The 64M default admits
MaxInputBytesof any of them with about fifty times to spare. - A font's runaway rules are still charged in full, and unbounded shaping is as fast as it was.
One budget for a document (#917, #920, #923, #924)
layout.ComposeContext(ctx, in, opts, limits)composes a document with every run it shapes or measures, in any of its faces, charged to oneshape.ShapingBudget. It fails with the context's error or one wrappingErrRunLimitand a zeroComposed, never with a composition that stopped part way.Composed.ShapingWorkis what it charged.Composeis unchanged.shape.ShapingBudget(NewShapingBudget,Bound,Run) shares one budget across any number of faces a caller owns.- A budget's zero fields are a document's defaults, which grow with what it shapes: no bound on a run's length (layout shapes a paragraph as one run), glyphs of 32,768 or 64 per byte of the longest run, and 64M units of work plus 1,024 per byte. A field the caller sets is a fixed bound.
Bitmap strikes (#915, #918, #921, #922)
PaintOptions.Bitmapspaints a glyph of a face with outlines from its EBDT or bdat strike, as a face with none is painted: for a writer of a font licensed for bitmap embedding only.GlyphColourForisGlyphColourfor given paint options. A face with outlines is still measured from them.Face.Strikeslists a face's CBDT, sbix and EBDT or bdat strikes, smallest first.Face.StrikeImageis a glyph's image in exactly one of them.Image.Strikesays which strike a painted image is from.