Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want something that runs on my computer that somehow interrogates X and tells me exactly the font, not a guess.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

I don't think there is a general solution. Once the text has been rendered, there's no reason why any component of the system would have kept the information of what font it was rendered from around. So you'll have to somehow watch when the program renders the text. In any case, how to get at the information depends on the rendering engine.

Most programs render through the fontconfig library. If you start a fontconfig-using program with the FC_DEBUG environment variable set to a suitable value, it will show some information about fonts being loaded, though not what font is being used for rendering which text. Still, try running FC_DEBUG=2053 myprogram. See /usr/share/doc/fontconfig/fontconfig-user.txt.gz for the meaning of $FC_DEBUG.

Traditional unix programs render text using bitmap fonts managed by the X server. Then you could see what font was used to render what text by spying on the X protocol conversation and watching for OpenFont, ImageText and a few other messages. I don't have ready-for-use tools to suggest.

If you're only interested in a particular application, there may be a better way that's specific to that application.

share|improve this answer

A great resource for identifying fonts is here:

http://new.myfonts.com/WhatTheFont/

share|improve this answer
1  
I've used WhatTheFont previously but I want something that runs on my computer that somehow interrogates X and tells me exactly the font, not a guess. I'm hoping something like this exists. I'll update the question to be more specific. –  Li Lo Sep 21 '10 at 20:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.