all groups > dotnet sdk > may 2007 >
You're in the

dotnet sdk

group:

FontFamily - is symbol/special?


FontFamily - is symbol/special? David Thielen
5/12/2007 12:27:00 PM
dotnet sdk:
Hi;

Is there a way to determine if a FontFamily (or Font) will display text as
text? I want to do a combo dropdown showing font choices where each name is
written in that font. But for symbol, wingdings, etc I need to write it in
Arial because they do not have abc...

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm

RE: FontFamily - is symbol/special? wawang NO[at]SPAM online.microsoft.com
5/14/2007 12:00:00 AM
Hi Dave,

What you needed is the character set information of the font:

#LOGFONT
http://msdn2.microsoft.com/en-us/library/ms533931.aspx
lfCharSet
Specifies the character set. The following values are predefined.

ANSI_CHARSET
BALTIC_CHARSET
CHINESEBIG5_CHARSET
DEFAULT_CHARSET
EASTEUROPE_CHARSET
GB2312_CHARSET
GREEK_CHARSET
HANGUL_CHARSET
MAC_CHARSET
OEM_CHARSET
RUSSIAN_CHARSET
SHIFTJIS_CHARSET
SYMBOL_CHARSET
TURKISH_CHARSET
VIETNAMESE_CHARSET

(You can find these CHARSET value in WinGDI.h)

In your case, you need to determine if the charset set to SYMBOL_CHARSET:

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
class LOGFONT
{
public int lfHeight;
public int lfWidth;
public int lfEscapement;
public int lfOrientation;
public int lfWeight;
public byte lfItalic;
public byte lfUnderline;
public byte lfStrikeOut;
public byte lfCharSet;
public byte lfOutPrecision;
public byte lfClipPrecision;
public byte lfQuality;
public byte lfPitchAndFamily;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string lfFaceName;
}



LOGFONT lf = new LOGFONT();
label1.Font.ToLogFont(lf);
if (lf.lfCharSet == 2)
{
MessageBox.Show("This is a symbol font");
}



#Determining the Character Set Used by a Font
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnaraskdr/h
tml/askgui12302003.asp



Hope this helps.


Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
RE: FontFamily - is symbol/special? David Thielen
5/14/2007 12:27:01 PM
2nd link had exactly what I needed - thanks

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




[quoted text, click to view]
AddThis Social Bookmark Button