Skip to content

Instantly share code, notes, and snippets.

@akostadinov
Created May 19, 2021 21:10
Show Gist options
  • Save akostadinov/202550a1e2fd4ea8cf523d91b437fa09 to your computer and use it in GitHub Desktop.
Save akostadinov/202550a1e2fd4ea8cf523d91b437fa09 to your computer and use it in GitHub Desktop.
shows fonts containing character
#!/usr/bin/env bash
# example: ./font_find.sh 🎩︎
# credits: David Baynard, https://unix.stackexchange.com/a/393740/14907
param="$1"
char=${param:0:1}
printf '%x' \'"$char" | xargs -I{} fc-list ":charset={}"
@scruss
Copy link

scruss commented Oct 23, 2021

If you want slightly more human-friendly output from this, pipe the output through

 sed 's/^.*: //;s/,.*$//;s/:style=/ /;s/ Regular$//' | sort -u

which removes duplicates, file names and simplifies the style a little, giving a list like

Noto Color Emoji
Segoe UI Emoji
Segoe UI Symbol
Symbola
Unifont Upper

instead of

~/.fonts/win10fonts/seguisym.ttf: Segoe UI Symbol:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
~/.fonts/NotoColorEmoji.ttf: Noto Color Emoji:style=Regular
~/.fonts/win10fonts/seguiemj.ttf: Segoe UI Emoji:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
/usr/share/fonts/truetype/ancient-scripts/Symbola_hint.ttf: Symbola:style=Regular
/usr/share/fonts/truetype/unifont/unifont_upper.ttf: Unifont Upper:style=Regular
/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf: Noto Color Emoji:style=Regular

@akostadinov
Copy link
Author

Thanks, can be useful to some people. For my use case I wanted to know all details, file paths, styles, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment