Repository navigation
2.0
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,
%%wordsfontand%%setfont-1…4take 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…$4switch to the%%setfont-nface,$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, aFontLibrary), 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).
OpenTypeFontreadsglyfoutlines (simple and
composite) and.ttccollections, and checksOS/2.fsTypebefore embedding a face. - Probing fonts (#191).
CeolKitFonts.availableFaces(config:)lists the faces text could
be set in, andRenderedDocument.fontsreports what each kind of text asked for and got.
%%ceolkit:fontlist [resolved|available]reports both as diagnostics.ckprobegains
--fonts,--system-fontsand--font-file.
Layout, as abcm2ps does it
%%scaleand%%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:scaleis deprecated.%%stretchlastand%%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:justifylastis 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
newChordSymbol.segments."C7(b9)"is now read as type7(b9). W:words (#187) are kept inTune.wordsand 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:orZ:lines keeps every value, in source order. EachC:prints on a
row of its own.
What's Changed
- Fix #192 — layout keeps music out of the footer band by @sbeitzel in #193
- Fix #188 — repeated string fields keep every value by @sbeitzel in #194
- Fix #184 — chord symbols draw ♭ and ♯ signs by @sbeitzel in #195
- Fix #185 — note spacing makes room for chord symbols and annotations by @sbeitzel in #196
- Fix #187 — W: words reach the model and print below the tune by @sbeitzel in #199
- Fix #189 — OpenTypeFont reads TrueType outlines and font collections by @sbeitzel in #200
- Fix #190 — font lookup: registered, system and bundled faces by @sbeitzel in #201
- Fix #186 — honour the §11.4.2 font directives by @sbeitzel in #202
- Fix #191 — probe available and resolved fonts by @sbeitzel in #205
- Fix #206 — system font lookup on Linux through fontconfig by @sbeitzel in #207
- Fix #197 — split a repeat sign that falls on a system break by @sbeitzel in #209
- Fix #203 — %%scale and %%pagescale, as abcm2ps implements them by @sbeitzel in #210
- Fix #198 — %%stretchlast and %%stretchstaff, as abcm2ps implements them by @sbeitzel in #211
- Fix #208 — draw |: and :: as abcm2ps does by @sbeitzel in #213
- Fix #204 — $1…$4 in-string font switches (%%setfont-n) by @sbeitzel in #214
- Fix #212 — draw back-to-back bars as written by @sbeitzel in #215
- Release 2.0.0 by @sbeitzel in #216
Full Changelog: v1.9.1...v2.0.0
Upgrading
Source-breaking changes
- Ten
TuneMetadataproperties change from optional to array:composer,area,book,
discography,fileURL,group,notes,source,rhythmandtranscription. Where
you readmetadata.composer?.value, readmetadata.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), andCeolKitDirectivealso gains.fontand.fontList.SVGRenderConfig.justifyLastSystemis gone. It is replaced bystretchLast(0…1;
1stretches every last line,0none) andstretchStaff.- Exhaustive
switches with nodefaultneed new arms forDiagnosticCode,
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.