473,407 Members | 2,312 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,407 software developers and data experts.

ASP.NET text in image

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 to read available fonts an put on of them into the objFont? Thanks!

m.
Nov 19 '05 #1
5 1283
This is the part of code that works fine now.

objFont = new Font("Verdana", 8)
objGraphics.DrawString(sTextToGenerate, objFont, Brushes.Black, 1, 1)
How to read available fonts and put one of them into the objFont? Thanks!

Nov 19 '05 #2
Well, if the font is stored on the server..I think it should pick it up.
Never tried it

"marko" <ne**@mejla.hr> wrote in message news:cv**********@bagan.srce.hr...
This is the part of code that works fine now.

objFont = new Font("Verdana", 8)
objGraphics.DrawString(sTextToGenerate, objFont, Brushes.Black, 1, 1)
How to read available fonts and put one of them into the objFont? Thanks!

Nov 19 '05 #3
"Tampa.NET Koder" <an*******@microsoft.com> wrote in message
news:uP*************@TK2MSFTNGP12.phx.gbl...
Well, if the font is stored on the server..I think it should pick it up.
Never tried it


Well, it should, but my ISP has forbidden access to WINDOWS/Fonts directory.
So, I need to have my own /Fonts. I don't know how to read *.ttf into the
..Net framework and "say" to it to use those. I was googling a little bit,
but with no success. If someone knows how to write a few lines of code in
VB.... :o)
Nov 19 '05 #4
// Load font
string fontName = Request.Form.Get("fontname") + ".ttf";
PrivateFontCollection privateFontCollection = new
PrivateFontCollection();
privateFontCollection.AddFontFile(Server.MapPath(" ./") + fontName);

FontFamily fontFamily = privateFontCollection.Families[0];

"marko" <ne**@mejla.hr> wrote in message news:cv**********@bagan.srce.hr...
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 to read available fonts an put on of them into the objFont? Thanks!

m.

Nov 19 '05 #5
"Ersin Gençtürk" <ers[spam]@gencturk.org> wrote in message
news:ug**************@TK2MSFTNGP15.phx.gbl...
// Load font
string fontName = Request.Form.Get("fontname") + ".ttf";
PrivateFontCollection privateFontCollection = new
PrivateFontCollection();
privateFontCollection.AddFontFile(Server.MapPath(" ./") + fontName);

FontFamily fontFamily = privateFontCollection.Families[0];

Thanks! It helped me and the problem is solved :)

m.
Nov 19 '05 #6

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

Similar topics

3
by: Geoff Soper | last post by:
I'm trying to get some text to lie to the right of an image. If the text is deeper than the image I want the text to continue with its left margin following the line projected down from the right...
4
by: Arif Çimen | last post by:
Hi to everybody, I have chnged a button text in design mode. But After compiling and executing the program the text of the button do not change to new value. Any Ideas? Thaks for helps.
5
by: Socrates | last post by:
I am interested in developing an online utility that will enable users to copy and past any image (or upload any image on the internet) to the online utility, which will then convert the image to...
4
by: CG3000 | last post by:
I create a .PNG image ( in Macromedia Fireworks ) which has an gif in it in the top left corner and a lot of empty canvas space to the right. I use about 10 text boxes on a form to populate...
3
by: =?Utf-8?B?SlIx?= | last post by:
I would like to add text to an image. I have tried to use DrawString and it works on some images but on others it is very very small. I am pretty sure it has something to do with the size of the...
1
by: helraizer1 | last post by:
Hi all, I have a dynamic image that picks out data from a dynamically created .line file. showimage.php(5) <?php include("linesfile.php5"); $linesDataFile = new DataFile("data.line");
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
6
by: bradyounie | last post by:
I'm writing a program that displays a user-supplied Bitmap and then writes text fields to it. These "text fields" are things that the user can move around on the image, but to render them...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
2
by: neovantage | last post by:
Hey all, I have created transparent PNG images from text dynamically. But it edges are pixel-ate or we can say edges are distorted. Here is my LINK which shows my generated transparent PNG image....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.