I'm getting an unhandled exception in GdiPlusGlyphRasterizer.cs on line 342:
status = GdiPlus.MeasureCharacterRanges(native_graphics, text, text.Length,
native_font, ref layoutRect, native_string_format, num_characters, regions);
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
The problem only occurs when loading an external font, which I do as follows:
PrivateFontCollection pfc = new PrivateFontCollection(); pfc.AddFontFile("Data/Boneca_De_Panoo.ttf"); FontFamily fontFamilies = pfc.Families; my_font = new Font(fontFamilies, 18, FontStyle.Bold);
The odd thing is that it'll print a string to the screen fine in the externally loaded font, however, as soon as I change the string being printed, the exception is raised.
Has anyone else managed to get externally loaded fonts to work consistently?