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

list of installed fonts?

How to get the list of installed fonts corresponding to any perticular charactor set? eg. if I want to get Japanese supporting font list (corresponding to char set Shift_JIS), how to do it?
please guide
--
sachin
Nov 16 '05 #1
1 6667
Here is some C# OnPaint code that will show you how to use FontFamily to
get a list of fonts:

protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
int i, nCount;
SolidBrush b = new SolidBrush( Color.Black );
int x = 0, y = 0;

nCount = FontFamily.Families.Length;

for(i=0;i<nCount;i++)
{
FontStyle fs = FontStyle.Regular;
Font f;
String StylesDesc = "";
if (FontFamily.Families[i].IsStyleAvailable(FontStyle.Regular))
StylesDesc += "Regular ";
else fs = FontStyle.Italic;

if (FontFamily.Families[i].IsStyleAvailable(FontStyle.Italic))
StylesDesc += "Italic ";
else fs = FontStyle.Bold;

if (FontFamily.Families[i].IsStyleAvailable(FontStyle.Bold))
StylesDesc += "Bold ";

if (FontFamily.Families[i].IsStyleAvailable(FontStyle.Underline))
StylesDesc += "Underline ";

if (FontFamily.Families[i].IsStyleAvailable(FontStyle.Strikeout))
StylesDesc += "Strikeout ";

if (StylesDesc.Length > 0)
StylesDesc = StylesDesc.Substring(0,StylesDesc.Length-1);

f = new Font( FontFamily.Families[i].Name, 12, fs);

String s = FontFamily.Families[i].Name + " " + StylesDesc;
e.Graphics.DrawString( s, f, b, x, y );
y += f.Height;

}
}
--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "
"Sachin" <sa*****@softbridge-s.com> wrote in message
news:9B**********************************@microsof t.com...
How to get the list of installed fonts corresponding to any perticular charactor set? eg. if I want to get Japanese supporting font list
(corresponding to char set Shift_JIS), how to do it? please guide
--
sachin

Nov 16 '05 #2

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

Similar topics

1
by: jusovsky | last post by:
Our font management tool, Suitcase, activates fonts dynamically by creating shortcuts in the Windows font folder. Using System.Drawing.Text.InstalledFontCollection to get the list of font families...
4
by: Norman Swartz | last post by:
If Microsoft Sans Serif is installed, I want to use symbol ḳ but if that font is not installed then I want to use sans-serif k How do I test whether Microsoft Sans Serif is installed and then...
2
by: Lasse Edsvik | last post by:
Hello I was wondering if you guys could show me how to list all fonts using C#? those that is supported by gdi+ that is, im using gdi+ to apply text on a pic. TIA /Lasse
6
by: ryan.mclean | last post by:
Hi all! I was hoping someone could help me out. What I would like to do is use a font that is not installed on the server, but does reside in my local web. Does that make sense? I would like to...
1
by: Atul | last post by:
Hi, I have installed a truetype font (.ttf) on a linux machne (SUSE linux 10, KDE) by copying it to my .fonts folder. I can use the font in all applications like open-office and firefox browser....
2
by: Nathan Sokalski | last post by:
I need to get a list of the available fonts as some type of collection or array. How can I do this? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
8
by: a8736d53 | last post by:
Is there any way to get a list of the available fonts using Firefox?
2
by: Gary | last post by:
1. I've installed a bunch of fonts in main application, which is in native C++ code using AddFontResourceEx 2. A C# application is launched from this main application, but failed to enumerate...
16
Ciary
by: Ciary | last post by:
hi all, is there a firefox equivallent for classid? i need it to get a list of installed fonts using javascript. and it works fine in IE but it fails in FF because FF doesnt support classid.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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.