Skip to content

forme 0.8.0

Choose a tag to compare

@mgilbir mgilbir released this 05 Oct 22:32
· 88 commits to main since this release
07262cb

Three additions for setting Word documents and old bitmap fonts, from #909 to #911: a face's Windows line metrics, a placement for each line's text within its line box, and the monochrome and greyscale bitmap strikes of a face with no outlines.

Descriptor states usWinAscent and usWinDescent (#910, #912)

  • WinAscent and WinDescent are OS/2's usWinAscent and usWinDescent, in font units and both positive, with MetricWinMetrics saying the font states them.
  • Word sets a single-spaced line by them: WinAscent + WinDescent tall, its baseline WinAscent below the top.
  • An instance has them as MVAR's hcla and hcld move them, checked against HarfBuzz at every location.

Per-line placement of a line's text (#911, #913)

  • -forme-line-placement: auto | top | bottom | <number [0,1]> | <percentage>, which is not CSS, moves each line's baseline within a line box whose height CSS decided:

    value baseline Word line rule
    auto CSS half-leading —
    top highest content-area top at the line box's top multiple
    bottom lowest content-area bottom at the line box's bottom at least
    0.8 / 80% 0.8 of the line box's height down exactly
  • It is applied per line, so a paragraph of mixed sizes is placed by each line's own tallest text. It inherits and is read from the block; a line set down the page is left in the middle.

  • paragraph.LinePlacement and Strut.Placement carry it.

A face with no outlines is painted from its bitmap strikes (#909, #914)

  • EBDT and Apple's bdat: EBLC/bloc index formats 1–5, image formats 1, 2, 5, 6 and 7, composites in formats 8 and 9, bit depths 1, 2, 4 and 8. An Apple bitmap-only font (bloc and bdat under a bhed) now loads, where it was refused. A face with outlines is still drawn from them, whatever strikes it carries.
  • ImageMask is such a glyph's image: a byte of coverage a pixel, painted in Image.Color, the foreground. ColourMask is GlyphColour's answer for it.
  • Image.Exact says a bitmap glyph's strike is the size asked for, for EBDT, CBDT and sbix alike, so a caller drawing only exact bitmaps can tell.
  • Every glyph of every strike of two faces built for it matches FreeType 2.14, and reading each glyph is bounded by a work budget.