473,386 Members | 1,958 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,386 software developers and data experts.

Font class, external font files question


Is there a way to use truetype fonts not installed on the system, but
existing as a file on the server? For example, if I have a true type file in
the same directory as my aspx file, can I use that to replace this
constructor somehow:
Font fontBanner = new Font("verdana", 35, FontStyle.Regular);

Im using gdi+ with asp.net (c#) to generate some simple images

Thanks in advace
Nov 18 '05 #1
1 1568
Answered my own question:

String fontStr = Server.MapPath("KROE0553.TTF");
PrivateFontCollection pfc = new PrivateFontCollection();
pfc.AddFontFile(fontStr);

FontFamily fontFam = new FontFamily("kroeger 05_53", pfc);
Font fontBanner = new Font(fontFam, 35, FontStyle.Regular);

Is there a way to use truetype fonts not installed on the system, but
existing as a file on the server? For example, if I have a true type file in the same directory as my aspx file, can I use that to replace this
constructor somehow:
Font fontBanner = new Font("verdana", 35, FontStyle.Regular);

Im using gdi+ with asp.net (c#) to generate some simple images

Thanks in advace

Nov 18 '05 #2

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

Similar topics

3
by: PorkyJr | last post by:
Running an asp page that has the following code: <% response.Write MonthName(Month(date)) %> &nbsp; <% response.Write Day(date) %> ,
21
by: Arthur Connor | last post by:
I want to embed some source code lines in an article on a web page. As usual I want to use a fixed sized font for this souce code lines (read: the letters should have all the same width). The...
4
by: Csaba Gabor | last post by:
What I'd like to do is to be able to set the font of a textarea element to the same font that another element is using (say, for example, an <INPUT type=text ...> element, but if that's a no go,...
2
by: Fred Herring | last post by:
I work in vb.net and utilize some functionality which is based upon some external classes which I currently reference in my application. These external classes all contribute to a single area of...
7
by: A_StClaire_ | last post by:
hi, I'm working on a project spanning five .cpp files. each file was used to define a class. the first has my Main and an #include for each of the other files. problem is my third file...
1
by: Laszlo | last post by:
Hi all, As a novice I installed PostgreSQL 7.2.1 on Win32 and works, Borland C++Builder Enterprise Suite 5.0 (build 12.34) what works too. I decided to combine these two programs and develop a...
4
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
6
by: tekmicha | last post by:
Hallo, I am a newbie in C and I have a question regarding C libraries. I got an application in C and I am trying to add some new features on it for my work. The problem is this application...
0
by: flaviosemeao | last post by:
Hi guys, I am gonna ask the same question again regarding tweening in text fields. I already read some Adobe documentation and I understood that text field has its property _alpha available just...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.