![Avatar](https://secure.gravatar.com/avatar/3e77364ee2b00c1442363a91a0d05860.jpg?s=64&d=identicon&r=g)
I am trying to load a TTF font from a PrivateFontCollection. The font is not installed on the system but loaded from a file using the AddFontFile method.
The font is not being used by SyntaxEditor (latest version) unless it is installed as a system font. I can't find any way to get it to work. I have no problem using the Font instance in a label.
var filename = Path.GetTempFileName();
File.WriteAllBytes(filename, Resources.LibreBarcode128Text_Regular);
var pfc = new PrivateFontCollection();
pfc.AddFontFile(filename);
var fontFamily = pfc.Families[0];
var font = new Font(fontFamily, 32, FontStyle.Regular);
label1.Font = font;
syntaxEditor1.Font = font;
[Modified 6 years ago]