Questions tagged [privatefontcollection]
33 questions
1
vote
1 answer
Loading a font from resources into PrivateFontCollection results in corruption repost
I am having some difficulty in loading a font from a resource into PrivateFontCollection.
When I started this, I was successful in loading the font from a file, however I wish to embed the font into my project (so there is less file mess on the user…

Kraang Prime
- 9,981
- 10
- 58
- 124
1
vote
1 answer
C# Get font family when know font's name
I have PrivateFont is declare like this
PrivateFont = new PrivateFontCollection();
string[] fontFiles = this.GetFontFiles();
foreach (string fontFile in fontFiles)
{
PrivateFont.AddFontFile(fontFile);
…

Do Thanh Tung
- 1,223
- 2
- 19
- 30
1
vote
0 answers
PrivateFontCollection hangs on initilizing
i have a client server application. i want to load a font from file in my server part.
here is my code to do that. but unfortunately it will hangs on new PrivateFontCollection(); line!!!!
note that this part is running in another thread.
string…

Mohy66
- 390
- 2
- 12
1
vote
1 answer
Use different weights of a custom font?
I have an asp.net application, and I am using a custom font, however I need to use both the bold version and the light version of the font. They are both from the same font family. I am adding them like this:
protected PrivateFontCollection pfc =…

KateMak
- 1,619
- 6
- 26
- 42
1
vote
1 answer
Using custom font with AntiAlias
Hey all i am trying to load my custom ttf font and also have it AntiAlias so it doesnt look all jagged and all.
The code in order to load the custom font is this (found here):
Dim pfc As New PrivateFontCollection()
pfc.AddFontFile("C:\Path…

StealthRT
- 10,108
- 40
- 183
- 342
1
vote
2 answers
Add PrivateFontCollection to RichTextBox
I´m trying to change to embedded resource font to my RichTextBox.
But it is'nt working. It works fine on a label, but not on my richtextbox.
After changing font to richtextbox I write out the font name of my richtextbox in the console, and it spells…

Jonas Löfkvist
- 99
- 6
1
vote
0 answers
How Dispose font from memory?
I'm using the PrivateFontCollection class to add some font into memory dynamically.
_PrivateFontCollection.AddFontFile(string.Format("FontAddress{0}.ttf,_FontName);
I have a web browser in my win form application,for each page i use an unique font…

KF2
- 9,887
- 8
- 44
- 77
0
votes
1 answer
(VB.net) How do I use a .ttf (font) file for a private font Collection
Okay, so I am trying to use a privatefontcollection for my program to add a little bit of uniqueness to it. The font that I am using is not installed on computers by default. The font's name is youmurdererbb_reg. I have the font file in the…

Richard Paulicelli
- 129
- 3
- 6
- 23
0
votes
0 answers
What are the benefits to using PrivateFontCollection's AddMemoryFont() over AddFontFile()
After much trial and error I have finally got my application to work with custom fonts on machines other than the development machine, however, I'm not sure which of the two methods I have gotten to work is the preferred way of doing things.
Either…

MILO
- 195
- 1
- 2
- 11
0
votes
1 answer
C# PrivateFontCollection AddFontFile from relative path
I have OpenSans-Light.ttf in the this folder from root: ~/fonts/open-sans/OpenSans-Light.ttf
PrivateFontCollection privateFontCollection = new PrivateFontCollection();
privateFontCollection.AddFontFile("~/fonts/open-sans/OpenSans-Light.ttf");
but I…

Alen Šimunic
- 555
- 1
- 7
- 19
0
votes
1 answer
Windows Forms: Can't get font resource to show properly
have added a TrueType font to my project resources ("MyFontResource"), and I've set the build action to "Resource." My intention is to replace the font on a Label object with this resource.
Here's my code:
PrivateFontCollection myFonts = new…

MiloDC
- 2,373
- 1
- 16
- 25
0
votes
1 answer
How to always get English font name via PrivateFontCollection in C#?
Now I am getting the font name by the following code:
PrivateFontCollection fontCollection = new PrivateFontCollection();
fontCollection.AddFontFile("path_to_my_Thai_font");
return fontCollection.Families[0].Name;
On a English Win7 system, I get…

user318245
- 13
- 6
0
votes
1 answer
PrivateFontCollection.AddFontFile() throws generic GDI+ error exception
Adding a private Font works fine on my local dev machine with Windows 10 Pro. However on Windows Server 2012 R2 the very same code results in the following error:
System.Runtime.InteropServices.ExternalException: A generic error
occurred in…

Peter Chalupar
- 21
- 2
0
votes
0 answers
Loading a font from resources into PrivateFontCollection results in corruption
I am having some difficulty in loading a font from a resource into PrivateFontCollection.
When I started this, I was successful in loading the font from a file, however I wish to embed the font into my project (so there is less file mess on the user…

Kraang Prime
- 9,981
- 10
- 58
- 124
0
votes
1 answer
Why application crash when i use PrivateFontCollection.Dispose() in mono3.2.3 c#?
I'm writing a library in C# that allows me to convert HTML to PDF. Obviously the idea is that it is cross-platform and why I'm doing with mono. To do this I have to load Seller fonts with System.Drawing.Text.PrivateFontCollection class.
When the…

user3446605
- 39
- 5