1. 4
    1. 3

      I have no clue what the author is looking for. Querying fonts with GTK (and all other GUI toolkits that use Pango, which is extremely widespread) is simple: https://docs.gtk.org/Pango/class.FontMap.html

      Here is a real life Rust application that chooses a monospace font dynamically at runtime by intersecting a preference list with what’s available on the system: https://github.com/BenjaminRi/Sherlog/blob/0bd8ac46b1ec3c2628664cbdba3758bd5ecc2906/src/main.rs#L716

      1. 1

        I don’t want to use pango.

    2. 2

      If you want to find a font that contains a particular character, you can just ask. For example, if you want to find a font that can render U+1F511 🔑 KEY:

      $ fc-list ":charset=1F511"
      /usr/share/fonts/truetype/noto/NotoColorEmoji.ttf: Noto Color Emoji:style=Regular
      1. 1

        fc-list “:charset=1F511”

        thanks! adding it to my article