views:

410

answers:

1

I'm working with ITextSharp for a project and am looking for a reasonable way to get a string list of different fonts it has available for use. I thought maybe I could just use reflection and loop over a class of available fonts, but there does not seem to be an easy way to do this. What I really want to do is provide a drop down of available/supported fonts for my users to select from Does anyone have any thoughts on how I might accomplish this?

+1  A: 

This webpage has a great reference for how to work with the 14 embedded fonts in iTextSharp, as well as how to embed and use any fonts of your choosing.

To get the list of fonts included in iTextSharp:

  Dim myCol As ICollection
  //Returns the list of all font families included in iTextSharp.
  myCol = iTextSharp.text.FontFactory.RegisteredFamilies
  //Returns the list of all fonts included in iTextSharp.
  myCol = iTextSharp.text.FontFactory.RegisteredFonts

An example of a font family is Helvetica. An example of a font is Helvetica-Bold or Helvetica-Italic.

Stewbob
Thanks just what I needed.
aherrick