From a50a1e8897b5687781477b86be67be5a0bd8e5e1 Mon Sep 17 00:00:00 2001 From: cormullion Date: Sat, 13 Jan 2024 16:34:57 +0000 Subject: [PATCH] font lists 3 --- docs/src/explanation/fonts.md | 61 ++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 11 deletions(-) diff --git a/docs/src/explanation/fonts.md b/docs/src/explanation/fonts.md index 82e97737..dfd28dcc 100644 --- a/docs/src/explanation/fonts.md +++ b/docs/src/explanation/fonts.md @@ -130,19 +130,58 @@ fonts = [ function drawfonts() d = @drawsvg begin background("black") - fontsize(20) - sethue("white") - table = Table(length(fonts), 2, 50, 30) - n = 1 - for font in fonts - text(font, table[n], halign=:right) - @layer begin - fontface(font) - text(font, table[n+1]) + @layer begin + translate(-150, 0) + sethue("white") + tableheader = Table([5], [400, 400, 400], boxtopcenter() + (0, 50)) + fontsize(30) + text("fontname", tableheader[1]) + text("Toy API", tableheader[2]) + text("Pro APi", tableheader[3]) + table = Table(fill(30, length(fonts)), [400, 400, 400]) + fsize = 20 + fontsize(fsize) + n = 1 + for font in fonts + text(font, table[n], halign=:left) + @layer begin + fontface(font) + text(font, table[n+1]) + end + @layer begin + fface = replace(font, "Serif" => " Serif", + "Bold" => " Bold", + "Semibold" => " Semibold", + "Black" => " Black", + "Heavy" => " Heavy", + "Medium" => " Medium", + "Light" => " Light", + "Thin" => " Thin", + "Hairline" => " Hairline", + "Narrow" => " Narrow", + "Regular" => " Regular", + "Sans" => " Sans", + "Mono" => " Mono", + "Italic" => " Italic", + "Oblique" => " Oblique", + "Condensed" => " Condensed", + "Extra" => " Extra", + "-" => " ", + ) + setfont(fface, fsize) + settext(fface, table[n+2]) + end + @layer begin + setopacity(0.5) + line(table[n] + (0, 8), table[n+2] + (table.colwidths[3], 8), :stroke) + end + n += 3 end - n += 2 end - end 900 3500 + sethue("white") + fontsize(40) + text("--------:--------", boxbottomcenter() + (0, -30), halign=:center) + end 1200 3400 return d end ```