Changelog
What changed in the public surface of each release: a name added, removed or moved, and a type that widened. Every change to surface.toml has a line here. The reasons are in the decisions.
0.16.0
- Added:
[font]withfilestakesheights, the capital heights in mm by name;FontMetrics.heightscarries them (D93).familybesidefilesstays refused. - Added:
LibraryConfig.font_heights, theheightsof the files form, besidefont_filesandfont_name;fontstays None until the files are read (D93). - Changed: the load error for a literal key beside
filesnames the key and the fix.
0.15.0
- Added:
FontMetrics.family, the family name a renderer resolves the font by.measure_fontreads it from the regular face's typographic family (name ID 16), else its family (ID 1);FontMetrics.namestays ID 1. The literal[font]form takes an optionalfamily, defaultname;familybesidefilesis a load error, since the file gives it. The bundle'sfontobject carriesfamily(D92).
0.14.0
- Added:
measure(..., attach={slot_id: Symbol}). The attached symbol's keep-out box is placed at the turned slot's point and side, as a slot's reserved box is (never rotated), and united with that slot's box; it is inMeasure.slots[slot_id]andMeasure.keepout. A key that is not a slot id raisesUnknownNameError. Withoutattachthe result is unchanged (D91).
0.13.0
- Added:
measure_font(regular, bold)returningFontMetrics: it measures a regular and a bold TTF, given as bytes, into one advance table perWeight, the cap height, ascent and descent.fonttoolsis now a runtime dependency (D87). - Added:
[font]inlibrary.tomlmay givenameandfiles(regular,bold) instead of the metrics;symdef buildmeasures the files, relative tolibrary.toml, into the bundle. The literal form is unchanged (D87). - Added:
Library.with_settings(module_mm=None, font=None, heights=None, lines=None), a validated replace.fontis the two TTFs as bytes;GridandFontMetricsrun their own checks, then the checktext-outside-bodyruns over every symbol and a hit raisesInvalidValueError(D88, D90). - Added: the check
text-outside-body(D90), which measures a fixed text inside its symbol's body with the library font and is run byload_library(with the library's font, raisingLibraryError) and byLibrary.with_settingsin place oftext-too-large. - Added:
[lines]inlibrary.toml(normal,thick: millimetres) andLibrary.lines, a read-only map fromWeightto millimetres; the bundle carries it when not empty. A wire weight with no width is a load error (D89).
0.12.0
- Removed from
symdef, now onsymdef.authoring:build,check,init,lint,write_build,stale_build,RULES,finding_key,LibraryConfig(D84). - Added:
SymdefError, the base of every error symdef raises, withInvalidValueError,UnknownNameError,UnknownSymbolErrorandLibraryErrorunder it. None subclassesValueError,KeyErrororOSError, so anexcepton a builtin no longer catches them (D80). - Renamed:
GraphicalSymbolsErroris nowSymdefError; the old name is removed, with no alias (D80). - Added:
GridPoint,GridBox(withGridBox.union) andGridPort, whose coordinates are whole grid divisions (D81). - Added:
measure(symbol, orientation, library, texts=None, text_height=None)returningMeasure: body, keepout, slots and ports in whole divisions, already turned (D82). - Changed:
FontMetrics.advancesis one table perWeight([font.advances.normal]and[font.advances.thick]inlibrary.toml);thick_factoris removed, and the bundle'sfont.advanceshas anormaland athicktable (D82). - Added:
to_placed_fragment(symbol, orientation, at, library, ...), a fragment inside onetranslateread from aGridPoint(D83). - Added:
Grid.wire_pitch(8) andGrid.wire_pitch_fine(4), in divisions, and[grid]keys of the same names; the loader refuses a third pitch, a fine pitch that does not divide the standard one, and a port off the standard pitch (D86). - Added:
FontMetrics.heights, a read-only map of names to capital heights in millimetres, from[font.heights](D86). - Deprecated:
to_fragment_mmis listed for removal in 0.13, once its callers useto_placed_fragment.
0.11.0
- Added:
Library.fontandLibrary.grid, read from[font]and[grid]inlibrary.tomland carried by the bundle;FontMetrics,Grid,text_width. - Added:
slot_text,TextPlacement,to_divisions,from_divisions,ceil_divisions,Box.union,slots_box. - Widened:
body_box,keepout_boxandslot_boxtakefont=None(slot_boxalsotextandheight), andlinttakesgrid; with none, output is as before. - Made public:
orient_box,orient_point,orient_direction,pole_pitch,pole_port,nodes_of. - Changed:
load_libraryandload_bundlereturn aLibrarywhosesymbolsis read-only (D73 to D78).
0.10.0
- Widened:
Slot.sideisDirection | Centre; the centred sideCputs the box and the text onat(retroactive; the type widened in this release, D67 to D71). - Added: several
[[stretch]]cuts per axis, each with aweight; a line or polyline may saybetween = true.