Repository navigation
Found porting a project that kept its house style, and several workarounds,
in style modules outside inklet.
Added
inklet.suite(...)/Suite: one immutable house style for a figure set.
It holds the fonts, a type scale in pt by role, line-weight tiers, the marker
style, named palettes and ramps, the panel-letter style, text rules, named
widths, export settings and a lint profile.with house:makes it the
active theme.line(),mark(),marker(),axes(),label(),
end_labels(),mosaic(),letter(),figure()anddocument()draw in
it.text_color()deepens a series colour to the label contrast and keeps
its hue.save()writes the export formats and lints them.build()builds
a set, skips figures whose fingerprint is unchanged, isolatessys.modules
andsys.pathper figure, and reports the house rules each figure breaks.
current_suite()returns the active suite. Guide: docs/house-styles.md;
example: examples/house_style.py.lint(house=HouseRules(...))adds five codes, silent withouthouse=:STROKE_TIER: a stroke in a plot panel that is not one of the house weights.MARKER_OUTLINE: a filled marker with an outline.MUTED_TEXT: grey text, by OKLab chroma and lightness or by listed colours.BOLD_TEXT: bold that is not a panel letter.KEY_IN_PANEL: a key that is part of a plot panel, over the data or beside it.
save(..., write="changed")leaves a set of files untouched, timestamps
included, when no file's bytes would change.save()returns
{path: written}, keyed by each path asstr(Path(path)); it returned
None before, so a barefig.save(...)as the last line of a notebook cell
now displays that mapping.to_svg(ids="document")(andsave(ids=...)) numbers element ids per file,
so a figure's SVG no longer depends on what else was built in the process.inklet.typeset.fonts.public_family()andinklet.layout.mosaic.header_text().panel_mosaic(..., header_bounds="ink")keeps the header placement of
4.9 (see Visible changes).
Visible changes
panel_mosaicsets panel letters and titles on one baseline with one
header height. Existing figures change: measured by their own ink, ab
sat 0.5 mm below anaat 8 pt (aj1.1 mm), and its panel started
0.5 mm lower. Panels lettered with x-height letters (a, c, e, ...) now
move down by about 0.5 mm to match, a panel letteredjmoves up, and
ascender letters (b, d, f, ...) stay where they were. A multi-line title
reserves all of its lines.header_bounds="ink"keeps the 4.9 placement.
Mosaic letters are now panel letters (LETTER_KIND) in either mode, so
lint checks them against letter limits (max_letter_pt) rather than as
body text.
Changed
to_pdf(text="embed")embeds CFF-flavoured OpenType faces (.otfwith
PostScript outlines, such as Nimbus Sans or Source Sans) as live TrueType
text: CIDFontType2 with a/FontFile2subset whose outlines are converted
to quadratics within 1/1000 em. Before, their text was outlined with a
FontEmbeddingWarning. Only CFF2 and bitmap-only faces are still outlined.save()renders every file, then writes each through a temporary file and
an atomic rename. All files from one call share one modification time, so
"newest of pdf/svg/png" no longer picks the PNG, which is drawn last. A
format that fails to render leaves every file as it was. An existing file
keeps its permission bits; a symbolic link is followed and the file it
points to is replaced. Writing needs permission to create a file in the
target directory.to_pdf(text="embed")outlines a CFF face whose outlines do not convert,
with aFontEmbeddingWarning, instead of failing the export.TINY_TEXTandLARGE_TEXTaccept sizes within 0.01 pt of the limit.
Before,8 * 0.3528mm (8.0005 pt) was reported as above an 8 pt maximum.
Fixed
- SVG output never contains a font-file path. A theme that names a face by
path ("/fonts/X.ttf, X, sans-serif") wrote that path into every
font-family. The family name in the file is written instead.