font attributes
rpic extension, inspired by Pikchr. Five text attributes style each
string individually: bold, italic, mono, font "<family>" and
fontsize <points>. They bind like ljust/rjust β to the string they
follow (or, written before any string, to the next one).
.PS
down
box "regular" fit
box "bold" bold fit
box "italic" italic fit
box "mono" mono fit
box "fontsize 18" fontsize 18 fit
.PEPer-string, not per-object
Each string carries its own style, so one object can mix faces:
.PS
box wid 2 "Heading" bold "a quieter subtitle" italic fontsize 9
.PEThe attributes
| Attribute | Effect on the <text> |
|---|---|
bold |
font-weight="bold" |
italic |
font-style="italic" |
mono |
font-family="monospace" |
font "IBM Plex Mono" |
font-family="IBM Plex Mono" (quoted or bareword, like colours) |
fontsize 18 |
font-size="18pt" (points; must be positive) |
big / small |
pikchr size words β sugar for fontsize (1.5Γ / 0.7Γ of 11 pt) |
Rules
- Geometry follows the style.
fit, text bounding boxes and standalone-text default heights all use the styled metrics β"big" fontsize 22takes a proportionally taller line, and aboldlabel gets a slightly widerfitbox. - PNG/PDF ship the faces. The renderer embeds the Go family (regular,
bold, italic, bold-italic, mono, mono-bold), so
bold/italic/monorasterize faithfully on any machine. Afont "β¦"family is resolved by the viewer for SVG; PNG/PDF fall back to the embedded face when the family isnβt bundled. - Math lines are unaffected: a fully
$β¦$label undertexlabelsis typeset by the math renderer, which has its own faces. - Contextual words:
bold = 2stays an assignment andbox wid boldstill reads the variable β only attribute position triggers. Unused, output is byte-for-byte classic (dpic errors on these words, so no valid dpic input changes meaning).