aboutsummaryrefslogtreecommitdiffstats
path: root/lib/card.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lib/card.lua')
-rw-r--r--lib/card.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/card.lua b/lib/card.lua
index 4d94465..3352c4b 100644
--- a/lib/card.lua
+++ b/lib/card.lua
@@ -13,6 +13,18 @@ M.FONT_MONO = 'Inconsolata Nerd Font'
M.FONT_UI = 'Noto Sans'
M.FONT_HEAVY = 'Noto Sans Black'
+-- Shared defaults, not a restriction: card.font() takes any family string, so
+-- a widget wanting its own face just passes one. The clock does, for squared
+-- numerals (Oswald, OFL-1.1, installed under ~/.fonts/o/Oswald).
+--
+-- Cairo can only ask for Regular or Bold by weight, so a heavier cut is
+-- selected by the family name fontconfig registers for it, exactly as
+-- FONT_HEAVY does above: 'Oswald SemiBold' at NORMAL weight, not 'Oswald' at
+-- bold. Fontconfig silently substitutes a default for a family it does not
+-- know, which looks identical to the font "not applying", so check a new name
+-- with `fc-match` before trusting it.
+M.FONT_CLOCK = 'Oswald'
+
function M.font(cr, family, size, bold)
cairo_select_font_face(cr, family, CAIRO_FONT_SLANT_NORMAL,
bold and CAIRO_FONT_WEIGHT_BOLD or CAIRO_FONT_WEIGHT_NORMAL)