Writing a String over existing image RRS feed

  • Question

  • User-653024912 posted
    Hi there, My problem is that I am unable to use a particular font on my image. Does anyone know the correct name for the OPTIMA font when creating a new font for the string to be written over an image? The font always reverts back to the default Arial font. *********************************************** Dim sf As New StringFormat sf.Alignment = StringAlignment.Center Dim oFont As New Font("OPTIMA???", 14, FontStyle.Regular) Dim size As SizeF = g.MeasureString(strCity, oFont) *********************************************** If anyone has an idea, it would be appreciated - my alternative is to create individual images with the strings written manually on each image - about 60 or so. The font has been installed on my server. Thanks, Mick
    Wednesday, October 13, 2004 8:04 PM

All replies

  • User-1413657921 posted
    Hi Can't you just run a simple test to see what the system thinks the name isusing System; using System.Drawing; using System.Drawing.Text; namespace InstalledFonts { class Class1 { [STAThread] static void Main(string[] args) { InstalledFontCollection fc = new InstalledFontCollection(); foreach (FontFamily f in fc.Families) { Console.WriteLine(f.Name); } Console.ReadLine(); } } } HTH -Christian
    Tuesday, October 19, 2004 8:38 PM
  • User-653024912 posted
    Thanks Christian - did the trick. Michael
    Wednesday, October 20, 2004 1:39 AM