I have 156 TTF files under my /usr/share/fonts directory tree. Why aren't these being registered?

I have a program using iTextSharp that includes the code

foreach (string fontname in FontFactory.RegisteredFonts) {
   Log.Info("**** Found registered font: " + fontname);
When I run it (using Mono on a CentOS box), the log shows only the core PostScript fonts:
  • zapfdingbats
  • times-roman
  • times-italic
  • helvetica-boldoblique
  • courier-boldoblique
  • helvetica-bold
  • helvetica
  • courier-oblique
  • helvetica-oblique
  • courier-bold
  • times-bolditalic
  • courier
  • times-bold
  • symbol

But I have 156 TTF files under my /usr/share/fonts directory tree (which is one of the directories mentioned in the code for the RegisterDirectories function). Why aren't these being registered?

Posted on StackOverflow on Nov 29, 2013 by dan04

There are subtle differences between iText and iText for C#. Java is platform independent, so we have to look for the 'usual suspects'. C# is Windows specific, so we can depend on the environment to tell us where to find fonts.

Your question tells us that Mono doesn't support this, so you'll have to use PdfFontFactory.RegisterDirectory("/usr/share/fonts");

Click Why aren't my fonts getting registered? if you want to see how to answer this question in iText 5.