I wanted to use Monaco.ttf with IntelliJ. Unfortunately it doesn't show up.

I also noticed that the Monaco font doesn't appear in the list of fonts got from awt:


I installed Monaco.ttf in /usr/share/fonts/truetype/osx

I also tried to copy it in /usr/lib/jvm/java-6-sun/jre/lib/fonts and even tried to manually update the /usr/lib/jvm/java-6-sun/jre/lib/fonts/fonts.dir file

I restarted the jvm at each try, but the fonts is not visible from the sun jdk.

All other applications see that font (even eclipse, which is in java but uses the SWT library)

Does anybody know how to make jdk see additional fonts?


The problem is with the Monaco font itself, it doesn't seem to have appropriate metadata and is a hacky port, so Java doesn't recognize it. Probably you can find some other version of this TTF file which will work better or try to fix it yourself using FontForge.

See also my comment in the IntelliJ IDEA issue tracker.

|improve this answer|||||

You need to run the mkfontscale and mkfontdir utilities in this order, in order to update the fonts.dir file.

Enter the /usr/lib/jvm/java-6-sun/jre/lib/fonts directory from your terminal and run

sudo mkfontscale
sudo mkfontdir

mkfontscale creates the fonts.scale file which mkfontdir can use to create fonts.dir.

|improve this answer|||||
  • mkfontdir created file containing only "0". I guess it doesn't work for ttf fonts. Anyway I manually edited the fonts.dir file with "Monaco.ttf -b&h-monaco-medium-r-normal--0-0-0-0-p-0-iso8859-1" and updated the count, but the font didn't appear. – ithkuil Jan 20 '11 at 19:30
  • See my update that helps create fonts.dir for Truetype fonts. – user4124 Jan 26 '11 at 13:57

Update your font cache

sudo fc-cache -f -v
|improve this answer|||||
  • Unfortunately it doesn't help. I didn't add the Monaco font right now. The font cache is updated and native applications can see the fonts without problems; it's just java (AWT) that cannot see it, and I'm wondering how to add it. – ithkuil Jan 20 '11 at 19:28

Have you tried calling:


It seems that the Java font system is kinda messed up:


You may have to work around issues with finding the fonts. But if eclipse can see the font, then there is no reason why your application can not. You can even choose to look at the eclipse code to see how they've done it.


|improve this answer|||||
  • I tried getAllFonts() as well, "Monaco" is not there. Actually I don't know which method is invoked by intellij, but nevertheless there are some (a lot of) fonts visible in awt apps but not all of them. Thanks for the references – ithkuil Jan 20 '11 at 19:24
  • FYI - your second link is now broken. – Duncan Jones Mar 27 '14 at 8:25

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.