473,320 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

PrivateFontCollection??

Does anyone know how use fonts that are NOT installed on the system?
Alex
Nov 15 '05 #1
3 7565
Alex,

You can add the file that the font is in through the AddFontFile method
on the PrivateFontCollection class. Once you have that, you can create a
new font class using the FontFamily that is exposed through the Families
property on the PrivateFontCollection instance.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Alex Davis" <al*******@bellsouth.net> wrote in message
news:es**************@TK2MSFTNGP11.phx.gbl...
Does anyone know how use fonts that are NOT installed on the system?
Alex

Nov 15 '05 #2
I use this... following is my code:
string fontFamily = "";FontFamily[] fontFamilies;PrivateFontCollection pvtFontCollection = new PrivateFontCollection();pvtFontCollection.AddFontF ile(Server.MapPath(Request.ApplicationPath) + "\\fonts\\OLDENGL.TTF");fontFamilies = pvtFontCollection.Families;fontFamily = fontFamilies[0].Name;lblMessage.Text += fontFamily; //Old English Text MTFont fancyFont = new Font(fontFamily, 50, FontStyle.Regular, GraphicsUnit.Pixel);lblMessage.Text += fancyFont.Name; //Microsoft Sans Seriftext = "Certificate of Completion";start = GetPrintStartPosition(text, fancyFont, objGraphic, objBitmap);objGraphic.DrawString(text, fancyFont, blackBrush, start + 2, _base); // This is still printing Ariel_base += 150;Am I missing something?
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:%2***************@TK2MSFTNGP10.phx.gbl...
Alex,

You can add the file that the font is in through the AddFontFile method
on the PrivateFontCollection class. Once you have that, you can create a
new font class using the FontFamily that is exposed through the Families
property on the PrivateFontCollection instance.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Alex Davis" <al*******@bellsouth.net> wrote in message
news:es**************@TK2MSFTNGP11.phx.gbl...
Does anyone know how use fonts that are NOT installed on the system?
Alex


Nov 15 '05 #3
Ok... I have the solution... instead of using the string fontName, I used
the fontFamily[] instead when building the new font.

"Alex Davis" <al*******@bellsouth.net> wrote in message
news:es**************@TK2MSFTNGP11.phx.gbl...
Does anyone know how use fonts that are NOT installed on the system?
Alex

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Claus | last post by:
Hi all. I'm messing a bit with PrivateFontCollection. Embedding a ttf-font and streaming it into PrivateFontCollection using AddMemoryFont works like a charm. Changing the Font property on...
3
by: Jonah Olsson | last post by:
Hi guys! I'm trying to use Swedish characters with DrawString but no luck. Do I need to set the Charset somewhere?? I've been searching Google Groups for hours now, but I can't find any help or...
2
by: Alex Davis | last post by:
Does anyone know how use fonts that are NOT installed on the system? Alex
5
by: marko | last post by:
I have created a small script in ASP.NET using VB.NET for creating pictures with text inside. Now I have a problem how to use my own font directory, and not Windows system fonts directory. How...
3
by: al jones | last post by:
Okay, last go 'round for today. I'm looking at the msdn for private font collections. If I add a font to work with - let's presume I'm printing a single line in a particular font and won't use it...
7
by: al jones | last post by:
Okay, I don't have headaches enough from my toy ... If I were to ty to load several fontfiles into a PrivateFontCollection, how would I then select one to use. Let's say that I have a couple of...
0
by: al jones | last post by:
I've gotten back to this piece of code in my 'little' (disgusting) project. I've spent the weekend looking and cannot find a working example of using PrivateFontCollection and can't seem to get...
0
by: Davy | last post by:
Hi, i'm writing a .Net application for printing barcodes to my climbing club. For simplicity reasons, i've embedded my barcode font as a ressource file. When loading my font as a private font...
2
by: mercenary | last post by:
i have a textbox in which i write in bangla(Bengali). but when i try to convert the bangla text into a GIF file the image shows ????? or something like a box. By the way i used AVRO Bangla typing...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.