5

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

6

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.

2

A great resource for identifying fonts is here:

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

1
  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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