Not sure if this is better here or as a "help requset, so i apologize for the double post
Im using zedgraph in a csharp page to generate a graph. I'd like to try to make it load a custom font (a .ttf file) to use as the font.
This is running in an environment in which I do not have access to the standard windows fonts directory. In fact, the only font installed on this machine is courier (yuck).
How do I make zedgraph use a font that is not in my c:\windows directory
// i've tried the below in a using statement, too but no lovePrivateFontCollectionprivateFontCollection=newPrivateFontCollection();stringfontsDir=LocateDirectory("fonts")+@"\";privateFontCollection.AddFontFile(fontsDir+"PLAYBILL.ttf");// playbill not installed on local machineusing(ZedGraphControlzedGraph=newZedGraphControl()){zedGraph.GraphPane=newGraphPane();zedGraph.GraphPane.Title.Text=title;zedGraph.GraphPane.Title.FontSpec=newFontSpec("Playbill",16,Color.Black,true,false,false);// the font is always the default, not the one i want.zedGraph.GraphPane.Title.FontSpec.Border=newBorder(false,Color.White,0);// other zedgraph stuff goes here, but the last line renders it to a file.}
So? how do you load a new font so ZedGraph can see it
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Not sure if this is better here or as a "help requset, so i apologize for the double post
Im using zedgraph in a csharp page to generate a graph. I'd like to try to make it load a custom font (a .ttf file) to use as the font.
This is running in an environment in which I do not have access to the standard windows fonts directory. In fact, the only font installed on this machine is courier (yuck).
How do I make zedgraph use a font that is not in my c:\windows directory
I've looked at microsoft's PrivateFont Collection https://learn.microsoft.com/en-us/dotnet/desktop/winforms/advanced/how-to-create-a-private-font-collection?view=netframeworkdesktop-4.8&redirectedfrom=MSDN and thats close to what I want. but I don't know what do after I create a privateFontCollection. all I did was :
So? how do you load a new font so ZedGraph can see it