[Ubuntu] Inspect a font file's family and style with fc-query

Created on November 30, 2026

Fontconfig's fc-query reads the family and style directly from a font file. Use it to identify a font from a .ttf or .otf file, including one you have yet to install.

fc-query --format '%{family}\n%{style}\n' /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf

The DejaVu Sans file in the example produces this output.

DejaVu Sans
Book

--format controls the output. %{family} prints the family, %{style} prints the style, and \n adds a newline. Replace the path to inspect another font file. Reading it directly requires no installation or cache update.

References

Ubuntu Shell command