Private void button1_Click (object sender, EventArgs e)
{
String path1=@ 456. The vera.ttf ";
String path2=@ "D: \ SourceHanSansCN \ SourceHanSansCN \ SourceHanSansCN - Light otf";
PrivateFontCollection PFC=new PrivateFontCollection ();
PFC. AddFontFile (path1);
PFC. AddFontFile (path2);
The Font f=new Font (PFC) Families [0], 16);
RichTextBox1. The Font=f;
}
Tried a relative path and absolute paths are no,
An error as below
Thank god!!!!!
CodePudding user response:
Are you sure 456. The vera.ttf the relative path can be? I can't under win10. Only the absolute pathCodePudding user response:
If the relative path can be, that is, under the relative path without this fileCodePudding user response:
https://bbs.csdn.net/topics/390279248CodePudding user response:
All said can't find the file, there is nothing to discussCodePudding user response: