Skip to content

2.0

Choose a tag to compare

@sbeitzel sbeitzel released this 04 Oct 01:08
· 14 commits to main since this release
dc1e37d

Fonts, scale and the last line, as abcm2ps does them.

A major release. Text can now be set in any font the host or the system supplies, the
§11.4.2 font directives take effect, and %%scale, %%stretchlast and %%stretchstaff
behave as they do in abcm2ps. Repeated header fields keep every value, and W: words print.
Because the default scale is now abcm2ps's 0.75, every document engraves differently, and
some public API changed shape. See Upgrading.

Fonts

  • Font directives (#186). %%titlefont, %%subtitlefont, %%composerfont,
    %%tempofont, %%gchordfont, %%annotationfont, %%infofont, %%vocalfont,
    %%wordsfont and %%setfont-1…4 take effect. They are parsed into
    CeolKitDirective.font(TextFontRole, FontSpec), and layout grows to fit the text they
    set. Libertinus Serif Bold and Bold Italic are now bundled.
  • In-string font switches (#204). $1…$4 switch to the %%setfont-n face, $0
    switches back, and $$ prints $. Measurement and drawing both follow the switches.
  • Font lookup (#190, #206). A text font is looked up in faces the host registers
    (SVGRenderConfig.fontLibrary, a FontLibrary), then in installed fonts
    (SVGRenderConfig.systemFonts: CoreText on Apple platforms, fontconfig on Linux), then
    in the bundled faces. The base-14 and generic families fall back to stand-ins.
    Substitutions and faces that forbid embedding are reported as diagnostics at the
    directive that named the font.
  • TrueType and collections (#189). OpenTypeFont reads glyf outlines (simple and
    composite) and .ttc collections, and checks OS/2.fsType before embedding a face.
  • Probing fonts (#191). CeolKitFonts.availableFaces(config:) lists the faces text could
    be set in, and RenderedDocument.fonts reports what each kind of text asked for and got.
    %%ceolkit:fontlist [resolved|available] reports both as diagnostics. ckprobe gains
    --fonts, --system-fonts and --font-file.

Layout, as abcm2ps does it

  • %%scale and %%pagescale (#203) are parsed in the file header, tune header and tune
    body, with abcm2ps's scoping rules. With no directive a document renders at abcm2ps's
    default %%scale 0.75. Music and tune text scale; the page, its margins and the footer
    do not. %%ceolkit:scale is deprecated.
  • %%stretchlast and %%stretchstaff (#198). The last system is stretched to the line
    once it fills 1 − F of it (default F is 0.25). A last system that is not stretched is
    spaced like the line above it, so its eighths no longer sit almost head to head.
    %%ceolkit:justifylast is deprecated.
  • Repeat signs (#197, #208, #212). A repeat sign that falls on a system break is split
    across the break. |: draws as thick–thin–dots and :: as :][:. A bar written
    straight after another (:| ::, | |), or at the head of a tune, is drawn as written.
  • Footers (#192). A page's last system no longer prints over its %%footer.
  • Text spacing (#185). Note spacing opens to make room for chord symbols and
    annotations, so they no longer print over each other.

Text

  • Chord symbols draw ♭ and ♯ (#184) using Bravura's chord-symbol accidentals, from the
    new ChordSymbol.segments. "C7(b9)" is now read as type 7(b9).
  • W: words (#187) are kept in Tune.words and printed below the tune, with the
    writer's spacing intact.
  • Repeated header fields (#188). A tune with several C:, A:, B:, D:, F:, G:,
    N:, S:, R: or Z: lines keeps every value, in source order. Each C: prints on a
    row of its own.

What's Changed

Full Changelog: v1.9.1...v2.0.0

Upgrading

Source-breaking changes

  • Ten TuneMetadata properties change from optional to array: composer, area, book,
    discography, fileURL, group, notes, source, rhythm and transcription. Where
    you read metadata.composer?.value, read metadata.composer.first?.value, or use every
    element. The initializer defaults each field to [].
  • CeolKitDirective.justifyLast(Bool) is gone. It is replaced by .stretchLast(Double) and
    .stretchStaff(Bool), and CeolKitDirective also gains .font and .fontList.
  • SVGRenderConfig.justifyLastSystem is gone. It is replaced by stretchLast (0…1;
    1 stretches every last line, 0 none) and stretchStaff.
  • Exhaustive switches with no default need new arms for DiagnosticCode,
    CeolKitFonts.Face (libertinusSerifBold, libertinusSerifBoldItalic) and
    SMuFLGlyph (csymAccidental*).

Additive and source-compatible: ChordSymbol.init gains a defaulted segments:,
RenderedDocument.init a defaulted fonts:, and SVGRenderConfig gains scale,
fontLibrary, systemFonts and textFonts.

Deprecated directives. %%ceolkit:scale F is read as %%pagescale F, and
%%ceolkit:justifylast true|false as %%stretchlast 1|0. Both still work, with a
deprecatedDirective warning.

Engraved output changes for every document. The default %%scale 0.75 (a 4.5 pt staff
space) and abcm2ps's default font sizes change the size of everything, so pagination
changes. The last line of most tunes is now stretched or spaced like the line above it.
Repeat signs, chord symbols and spacing around text change as described above. Any
snapshot test that pins pages needs re-recording. To get back 1.9's 6 pt staff space, set
SVGRenderConfig.scale = 1.0 or write %%scale 1 in the file header. Text sizes still
follow abcm2ps's defaults, not 1.9's.