Date: | Tue, 17 Jan 2023 19:52:07 -0800 |
From: | Bret Victor |
Subject: | fonts and styled text |
Wish font face "Avenir" uses font file (Ref "8e8bdd3a55a1b0ea022e25a54a7795e8.ttf").
Wish (you) is labelled "The worst." with font face "Avenir".
When font face /face/ is available:
Wish font face "Helvetica" uses font file (Ref "2ce7bccbe71ea34eeb77b96f72ac56a9.ttf") with required (true).
Wish font face "Helvetica I" uses font file (Ref "1abbd4cf2d371faa8e43d4e989a7c492.ttf") with required (true).
(etc)
Wish (you) draws "text" "The worst." with
ranges { { start_pos=5, end_pos=9, font_face="Helvetica I", color="yellow" } }.
Wish (you) draws "text" "The <i>worst</i>." with
markup { i = { font_face="Helvetica I", color="yellow" } }.
local text = "I'd <i>like</i> to <big>tell</big> you <mono>about</mono> my <green>problems</green>."
local styles = {
big ={ font_face="Serif", font_size=0.7, color="pink" },
mono ={ font_face="Mono B", font_size=0.5, color="orange" },
green={ color="green", font_face="Helvetica B" }
}
Wish (you) draws "text" (text) with width (2.5) font size (0.3) background "blue" markup (styles).
local text, ranges = text_and_ranges_for_markup(html, styles)