HighTechTalks DotNet Forums  

Using raster font file

Dotnet Framework (Drawing) microsoft.public.dotnet.framework.drawing


Discuss Using raster font file in the Dotnet Framework (Drawing) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Henrik
 
Posts: n/a

Default Using raster font file - 09-04-2009 , 11:15 AM






Hi,

Can I draw on a bitmap using a Windows 3.0 fnt file (raster font
file) ?.

I would like to use the 'old' fnt file like af TTF doing this:

Bitmap Picture1 = new Bitmap(100, 20);
Graphics g = Graphics.FromImage(Picture1);
g.DrawString("Hello World", new Font("Tahoma"),
Brushes.White, new RectangleF(0, 0, 0, 0));

Note: I must run on CF 2.0.

Thanks,

Henrik.

Reply With Quote
  #2  
Old   
Bob Powell [MVP]
 
Posts: n/a

Default Re: Using raster font file - 09-13-2009 , 11:17 AM






GDI+ is only compatible with OpenType fonts.

You can draw on the same graphics surface but you'll have to use the GDI
handle and Win32 API.

--


--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


"Henrik" <henrik.lausen (AT) gmail (DOT) com> wrote

Quote:
Hi,

Can I draw on a bitmap using a Windows 3.0 fnt file (raster font
file) ?.

I would like to use the 'old' fnt file like af TTF doing this:

Bitmap Picture1 = new Bitmap(100, 20);
Graphics g = Graphics.FromImage(Picture1);
g.DrawString("Hello World", new Font("Tahoma"),
Brushes.White, new RectangleF(0, 0, 0, 0));

Note: I must run on CF 2.0.

Thanks,

Henrik.

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.