RPIC

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
.PE
regular bold italic mono fontsize 18

Per-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
.PE
Heading a quieter subtitle

The 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