![]() |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jul 2009
Age: 27
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
![]() OS:
|
c#:how to install new font?
first:i use two functions to install a new font int the following.
AddFontResource("d:\\tmp\\Ni7seg.ttf"); //FilePath为字体WindowsMessages.WM_FONTCHANGE, IntPtr.Zero, IntPtr.Zero); second:i don't konw how to use the new font.how to set the label's text with the new font?who can give me a example?very thanks |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Jul 2009
Age: 27
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
![]() OS:
|
Re: c#:how to install new font?
first:i use two functions to install a new font int the following.
AddFontResource("d:\\tmp\\Ni7seg.ttf"); //FilePath为字体 SendMessage((IntPtr)0xFFFF, WindowsMessages.WM_FONTCHANGE, IntPtr.Zero, IntPtr.Zero); second:i don't konw how to use the new font.how to set the label's text with the new font?who can give me a example?very thanks |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jul 2009
Location: US
Age: 25
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
![]() OS:
|
Re: c#:how to install new font?
Try this code see if it works. System.Drawing.Text.PrivateFontCollection pfc = new System.Drawing.Text.PrivateFontCollection();
pfc.AddFontFile("d:\\tmp\\Ni7seg.ttf"); Font myFont = new Font(pfc.Families[0], 80f, FontStyle.Regular, GraphicsUnit.Point, 0); All the best!!! ![]() |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
< Windows Help - MS Office Help - Hardware Support >
| New To Site? | Need Help? |