Questions tagged [privatefontcollection]

33 questions
11
votes
1 answer

Workaround for the Mono PrivateFontCollection.AddFontFile bug

When I call the PrivateFontCollection.AddFontFile method in Mono.net It always returns a standard font-family. This bug has already been reported on several websites, but as far as I know without a way to solve it. The bug itself isn't fixed in the…
Willem Van Onsem
  • 443,496
  • 30
  • 428
  • 555
8
votes
1 answer

How to delete the file of a PrivateFontCollection.AddFontFile?

We create a large count of fonts for a short use. The fonts are embedded in documents. I want delete the font files if not use anymore. How can we do this? The follow simplified code does not work: PrivateFontCollection pfc = new…
Horcrux7
  • 23,758
  • 21
  • 98
  • 156
8
votes
1 answer

PrivateFontCollection.AddMemoryFont producing random errors on Windows Server 2012 R2

I have a .NET 3.5 application that loads fonts into memory using PrivateFontCollection.AddMemoryFont and uses these to produce images. I have recently installed this on Windows Server 2012 R2 and it is producing intermittent errors. The problem is…
6
votes
1 answer

.NET PrivateFontCollection - how to release file locks when finished

I have a function which returns a PrivateFontCollection: Public Shared Function GetCustomFonts() As PrivateFontCollection Dim result = New PrivateFontCollection Dim customFontFiles = {"Garamond.TTF", "Garamond-Bold.TTF",…
extremeandy
  • 503
  • 3
  • 13
5
votes
1 answer

How to render a font from privatefontcollection memory to editable controls

This is a continuation of Loading a font from resources into PrivateFontCollection results in corruption The answer supplied here is sufficient for controls that have the UseCompatibleTextRendering method available, however it does not appear to be…
Kraang Prime
  • 9,981
  • 10
  • 58
  • 124
4
votes
1 answer

PrivateFontCollection Families are not reliable with more iterations

I've load the MemoryStream to a PrivateFontCollection and print the Font-Family count. I've done these process for 10 times and I want the same output for every iteration. I want correct output for two iterations and sometimes the first iteration…
Madhan
  • 41
  • 6
2
votes
1 answer

System::Drawing::Text::PrivateFontCollection not working when the font is not installed

I tried to add font from memory (embedded resource) and use it for my windows form (c++/cli) application... The code is working, but when the specified font is not installed on the computer the textbox is using the default font instead of my custom…
SylenZ
  • 23
  • 2
2
votes
1 answer

PrivateFontCollection with gdi+ sometimes uses the wrong FontStyle in WIndows 8 or newer

If you have a Font which you've created from a PrivateFontCollection and try to draw strings with it using GDI+ it will sometimes use the wrong FontStyle. I've observed this both with Fonts loaded into a PrivateFontCollection from memory and fonts…
2
votes
1 answer

Access Violation Error when calling Gdiplus::PrivateFontCollection.AddMemoryFont

Following this walkthrough, showing how to use a font without having to install it in C++: http://www.codeproject.com/Articles/42041/How-to-Use-a-Font-Without-Installing-it I get an Adress Violation Error (0xc0000005) in ntdll.dll The calling code…
Vinz
  • 3,030
  • 4
  • 31
  • 52
1
vote
0 answers

AddFontResource / PrivateFontCollection doesn't make the font immediately available for use in my application

I'm trying to use a PrivateFontCollection for my application, so it can print a document with a specific font. note that i can not "install" the font as the Windows directory is admin protected. The code I have works, in the sense that provided I…
1
vote
0 answers

How to use PrivateFontCollection in VB.net Application for use in PrintDocument VB.NET

Im trying to get the privatefontcollection to work. But so far its not working, not in the sense of an error, just the font seen on screen is MS Sans Serif and not the Font im trying to load. so far i have tried two diffrent methods and neither seem…
1
vote
0 answers

PrivateFontCollection is failed to add memory font under .Net Core

I need to add a set of fonts to PrivateFontCollection. For some reason this task should be accomplished by using AddMemoryFont function. var fontCollectionFromMemory = new PrivateFontCollection(); var fontCollectionFromFile = new…
1
vote
3 answers

Load and use barcode font in TextBlock

Hey, I am trying to create a BarCode input box. On it a textblock is showing a preview of what the text input will look like in the specified Barcode type. I have a bunch of .TTF files that are the barcode fonts, they have been used in a WinForms…
SoManyGoblins
  • 5,605
  • 8
  • 45
  • 65
1
vote
1 answer

Loading font-family from disk to PrivateFontCollection

I'm using the following code to load a font into memory for generating an image with GDI+: var fontCollection = new PrivateFontCollection(); fontCollection.AddFontFile(Server.MapPath("~/fonts/abraham-webfont.ttf")); fontCollection.Families.Count();…
Martin
  • 2,302
  • 2
  • 30
  • 42
1
vote
1 answer

Issue Creating PrivateFontCollection from Resources

I've been running this same code for months and it's worked like a charm. Recently, I've had this code added to source control in TFS and it's no longer working properly. The only changes were to modify some namespaces to meet our product…
Jesse Williams
  • 653
  • 7
  • 21
1
2 3