fontwhich: Determine fonts used to render text

[ gpl, program, utility ] [ Propose Tags ] [ Report a vulnerability ]

Fontwhich is a commandline tool that used pango to determine which default fonts would be used to render some text, or which font would be used for a particular language script.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0, 0.2, 0.2.1, 0.3
Change log ChangeLog.md
Dependencies base (<5), bytestring, extra, gi-pango, gi-pangocairo, simple-cmd, simple-cmd-args, text, unicode-data-names, unicode-data-scripts [details]
Tested with ghc ==9.2.8 || ==9.4.8 || ==9.6.7 || ==9.8.4 || ==9.10.3 || ==9.12.3
License GPL-3.0-or-later
Copyright 2026 Jens Petersen <juhpetersen@gmail.com>
Author Jens Petersen <juhpetersen@gmail.com>
Maintainer Jens Petersen <juhpetersen@gmail.com>
Uploaded by JensPetersen at 2026-03-27T17:19:52Z
Category Utility
Home page https://github.com/juhp/fontwhich
Bug tracker https://github.com/juhp/fontwhich/issues
Source repo head: git clone https://github.com/juhp/fontwhich.git
Executables fontwhich
Downloads 21 total (20 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2026-03-27 [all 2 reports]

Readme for fontwhich-0.3

[back to package description]

Fontwhich

Fontwhich is a small CLI tool that uses pango to show which default fonts are used to render some text.

It should work on any Linux distro with the Cairo and Pango libraries: it requires the fonts to be available but not a graphical session.

Usage

$ fontwhich --version

0.3

$ fontwhich --help

fontwhich

Usage: fontwhich [--version] [-f|--font FONT] [-b|--utf8] [-u|--unicode]
                 [-s|--sample-text]
                 (--list-langs | (-l|--lang LANG) | --all-langs | TEXT)

  Describes the fonts used to render text with pango
  https://github.com/juhp/fontwhich#readme

Available options:
  -h,--help                Show this help text
  --version                Show version
  -f,--font FONT           Base font [default: Sans]
  -b,--utf8                Output UTF-8 hex codes
  -u,--unicode             Output Unicode data
  -s,--sample-text         Use Pango sample text for language
  --list-langs             List language orthography
  -l,--lang LANG           Language code
  --all-langs              Output all orth languages

$ fontwhich Hello 🌍 World δΈ–η•Œ

'Hello ' : Noto Sans
'🌍' : Noto Color Emoji
' World ' : Noto Sans
'δΈ–η•Œ' : Noto Sans CJK JP

$ fontwhich -f Serif "δΈ–η•Œγ“γ‚“γ«γ‘γ―πŸ˜€"

'δΈ–η•Œ' : Noto Serif CJK JP
'こんにけは' : Noto Serif CJK JP
'πŸ˜€' : Noto Color Emoji

$ fontwhich -l ja

Primary Sans font for 'ja': "Noto Sans CJK JP"

$ fontwhich --utf8 🌳

4 bytes;
'🌳' [f0 9f 8c b3] : Noto Color Emoji

$ fontwhich --unicode Ξ±Ξ²ΰ₯§ΰ₯¨

10 bytes; 2 pango items
'Ξ±Ξ²' : Noto Sans
Ξ± <U+03B1>: GREEK SMALL LETTER ALPHA [Greek]
Ξ² <U+03B2>: GREEK SMALL LETTER BETA [Greek]
'ΰ₯§ΰ₯¨' : Noto Sans Devanagari
ΰ₯§ <U+0967>: DEVANAGARI DIGIT ONE [Devanagari]
ΰ₯¨ <U+0968>: DEVANAGARI DIGIT TWO [Devanagari]

One can use both options together:

$ fontwhich --utf8 🌸 --unicode

4 bytes;
'🌸' [f0 9f 8c b8] : Noto Color Emoji
🌸 <U+1F338>: CHERRY BLOSSOM [Common]

Building and installation

On Fedora, install system deps with cabal-rpm builddep.

C library dependencies:

  • Fedora: cairo-gobject-devel gobject-introspection-devel pango-devel
  • Ubuntu: libcairo2-dev libgirepository1.0-dev libpango1.0-dev

Then:

$ cabal install

or

$ stack install

There is a copr repo: https://copr.fedorainfracloud.org/coprs/petersen/fontwhich/

Misc

Initial code assisted with Gemini 3.1.

The tool is related conceptually to the C project https://github.com/sudipshil9862/whichfont.

"fontwhich" as in "sandwich" but with fonts.

Collaborate

The code is distributed under GPLv3+.

Repository: https://github.com/juhp/fontwhich