From bb65181e614899c5659da4752fa6f1086e78eb88 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Tue, 26 Oct 2021 14:27:19 -0700 Subject: [PATCH] doc: Document the textbox font. --- lib/wibox/widget/textbox.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lib/wibox/widget/textbox.lua b/lib/wibox/widget/textbox.lua index b48bf684..b733f434 100644 --- a/lib/wibox/widget/textbox.lua +++ b/lib/wibox/widget/textbox.lua @@ -332,6 +332,37 @@ end --- Set a textbox font. -- +-- There is multiple valid font string representation. The most precise is +-- [XFT](https://wiki.archlinux.org/title/X_Logical_Font_Description). It +-- is also possible to use the family name, followed by the face and size +-- such as `Monospace Bold 10`. This script lists the fonts present +-- on your system: +-- +-- #!/usr/bin/env lua +-- +-- local lgi = require("lgi") +-- local pangocairo = lgi.PangoCairo +-- +-- local font_map = pangocairo.font_map_get_default() +-- +-- for k, v in pairs(font_map:list_families()) do +-- print(v:get_name(), "monospace?: "..tostring(v:is_monospace())) +-- for k2, v2 in ipairs(v:list_faces()) do +-- print(" ".. v2:get_face_name()) +-- end +-- end +-- +-- Save this script somewhere on your system, `chmod +x` it and run it. It +-- will list something like: +-- +-- Sans monospace?: false +-- Regular +-- Bold +-- Italic +-- Bold Italic +-- +-- In this case, the font could be `Sans 10` or `Sans Bold Italic 10`. +-- -- @property font -- @tparam string font The font description as string. -- @propemits true false