Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Internationalization / October 2005

Tip: Looking for answers? Try searching our database.

fonts

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AndrewEames - 23 Sep 2005 16:54 GMT
I'm writing an app that will be localized into various cultures and I'm a
little confused as to the best way to specify what fonts I should use.

The application is trying to follow the XP look and feel style guidelines
which specify some particular fonts - Tahoma / Franklin Gothic etc. but the
guidelines make no reference to whether these are for English only or for all
cultures.

It sees like the default "System" font is different for different OS'es - in
particular for Japanese,Korean,Simplified Chinese,Traditional
Chinese,Arabic,Hebrew it is
MS UI Gothic,Gulim,Simsun,PMinglu, Microsoft Sans Serif respectively.

When I localize my app, should my fonts match these system fonts and how do
the XP style guidelines mutate according to culture?

 Andrew
Mihai N. - 25 Sep 2005 05:12 GMT
> It sees like the default "System" font is different for different OS'es - in
> particular for Japanese,Korean,Simplified Chinese,Traditional
> Chinese,Arabic,Hebrew it is
> MS UI Gothic,Gulim,Simsun,PMinglu, Microsoft Sans Serif respectively.
In dialogs use the generic "MS Shell Dlg" (if OS < XP) or "MS Shell Dlg 2"
(XP or newer). For non-dialogs, use GetStockObject(DEFAULT_GUI_FONT)
In general, search MSDN for "MS Shell Dlg", "MS Shell Dlg 2" &
DEFAULT_GUI_FONT, and you will find a lot of good articles, with explanation
on how, when and why :-)

> When I localize my app, should my fonts match these system fonts and how do
> the XP style guidelines mutate according to culture?
Match system font. You shold use the generic fonts/API above.

Signature

Mihai Nita [Microsoft MVP, Windows - SDK]
------------------------------------------
Replace _year_ with _ to get the real email

AndrewEames - 26 Sep 2005 14:37 GMT
I'm pretty sure that this is not what I want - why should I want different
fonts in my dialgs and non-dialogs?

On my English XP machine, DEFAULT_GUI_FONT is Microsoft Sans Serif and MS
Shell Dlg 2 is Tahoma. To follow the XP style Guildelines my non-dialogs
should use Tahoma font too I believe

Under Korean XP, DEFAULT_GUI_FONT is Gulim and MS Shell Dlg 2 is Tahoma. In
each case I believe I should be using Gulim (although the XP style guidelines
are silent on this matter)

I haven't found a really good article on font selection - most of them are
somewhat incomplete and some even contradict each other.
 Andrew

> > It sees like the default "System" font is different for different OS'es -
> in
[quoted text clipped - 10 lines]
> > the XP style guidelines mutate according to culture?
> Match system font. You shold use the generic fonts/API above.
Garrett McGowan[MSFT] - 27 Sep 2005 02:01 GMT
Globalized font selection is a tough problem space, especially if you need
to support down-level platforms (i.e., Win9x). If you can, I recommend
finding a copy of 'Developing International Software, 2nd Edition'
(Microsoft Press). It includes a thorough discussion of international fonts
in Windows and runtime font selection.

Related online articles and resources:

Windows XP/2000 default system font
http://www.microsoft.com/globaldev/DrIntl/columns/017/default.mspx#EHAA

MLang and Font Linking
http://www.microsoft.com/globaldev/DrIntl/columns/005/default.mspx#EEAA

World-Ready Software example
http://www.microsoft.com/globaldev/tools/wrapp.mspx

Garrett McGowan [MSFT Developer International]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------

>From: <AndrewEames@discussions.microsoft.com>

>Subject: Re: fonts
>Date: Mon, 26 Sep 2005 06:37:11 -0700
[quoted text clipped - 29 lines]
>> > the XP style guidelines mutate according to culture?
>> Match system font. You shold use the generic fonts/API above.
AndrewEames - 28 Sep 2005 03:29 GMT
I've read these articles and they have some interesting information but
neither these articles nor others I have read seem to answer what seems like
a very basic question - namely what fonts should I use in my .NET application
which is localized and trying to follow the XP style guidelines. (Fortunately
I dont care about Win9x)

My best *guess* so far is that I should build a base class form that is
localized with the fonts below (which I extracted from the Dr. International
article) and derive all my forms from this base class form - does this seem
reasonable? That would seem to address the "default font" issue but I have no
idea how (if at all) the other elements of the XP style guidelines get
localized.

Another related issue is theming - some localized OSes use the classic theme
by default - should my app switch to the classic theme when run in those
languages under English XP?

My local bookstore didnt have the book you recommended but I guess I'll try
and find a copy.

 Andrew

> Globalized font selection is a tough problem space, especially if you need
> to support down-level platforms (i.e., Win9x). If you can, I recommend
[quoted text clipped - 61 lines]
> >> > the XP style guidelines mutate according to culture?
> >> Match system font. You shold use the generic fonts/API above.
Mihai N. - 27 Sep 2005 09:17 GMT
> I'm pretty sure that this is not what I want - why should I want different
> fonts in my dialgs and non-dialogs?
See Garrett's post.

> On my English XP machine, DEFAULT_GUI_FONT is Microsoft Sans Serif and MS
> Shell Dlg 2 is Tahoma. To follow the XP style Guildelines my non-dialogs
> should use Tahoma font too I believe
You are right. It seems I am a bit behind :-)

So, correction: see SYSTEM_FONT.
From the doc for GetStockObject:

DEFAULT_GUI_FONT = Default font for user interface objects such as menus and
dialog boxes. This is MS Sans Serif. Compare this with SYSTEM_FONT.

SYSTEM_FONT = System font. By default, the system uses the system font to
draw menus, dialog box controls, and text.
 Windows 95/98 and Windows NT: The system font is MS Sans Serif.
 Windows 2000/XP: The system font is Tahoma

("some even contradict each other" you where saying :-)

> Under Korean XP, DEFAULT_GUI_FONT is Gulim and MS Shell Dlg 2 is Tahoma. In
> each case I believe I should be using Gulim (although the XP style guidelines
> are silent on this matter)
For Korean, Tahoma becomes in fact Gulim because of font linking:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\FontLink\SystemLink

> I haven't found a really good article on font selection - most of them are
> somewhat incomplete and some even contradict each other.
As Garrett sais, is a tough problem. All his links will take you to
interesting places.
And not only is it tough, is is also a moving one.
When you think you got it, something new comes out :-)

Signature

Mihai Nita [Microsoft MVP, Windows - SDK]
------------------------------------------
Replace _year_ with _ to get the real email

AndrewEames - 28 Sep 2005 14:40 GMT
SYSTEM_FONT is not right either - You can't use SYSTEM_FONT from a .NET
application - it claims not to be a truetype font
 Andrew

> > I'm pretty sure that this is not what I want - why should I want different
> > fonts in my dialgs and non-dialogs?
[quoted text clipped - 32 lines]
> And not only is it tough, is is also a moving one.
> When you think you got it, something new comes out :-)
Garrett McGowan[MSFT] - 28 Sep 2005 18:07 GMT
If this is a Windows Form application, then the default font setting should
cover all .NET-supported languages. Windows Forms use 'Microsoft Sans
Sarif' by default, which is a logical font that maps to the appropriate
system font at runtime.

Is there a particular reason you are trying to set this programmatically?

Garrett McGowan [MSFT Developer International]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------

>From: AndrewEames@discussions.microsoft.com
>Subject: Re: fonts
[quoted text clipped - 41 lines]
>> And not only is it tough, is is also a moving one.
>> When you think you got it, something new comes out :-)
AndrewEames - 28 Sep 2005 18:27 GMT
Microsoft Sans Serif != Tahoma and the XP style guidelines call for the use
of Tahoma under Windows XP
 Andrew

> If this is a Windows Form application, then the default font setting should
> cover all .NET-supported languages. Windows Forms use 'Microsoft Sans
[quoted text clipped - 62 lines]
> >> And not only is it tough, is is also a moving one.
> >> When you think you got it, something new comes out :-)
Garrett McGowan[MSFT] - 28 Sep 2005 19:52 GMT
If you leave the default font property value set to Microsoft Sans Serif,
the Windows Form will automatically map to the correct system font based on
the Windows language version. This means that an English language Windows
Forms application automatically uses Tahoma on Windows XP.

Garrett McGowan [MSFT Developer International]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------

>From: AndrewEames@discussions.microsoft.com
>Subject: Re: fonts
[quoted text clipped - 71 lines]
>> >> And not only is it tough, is is also a moving one.
>> >> When you think you got it, something new comes out :-)
AndrewEames - 28 Sep 2005 20:08 GMT
I dont believe this is the case - Make a form with 2 labels , one with the
default font and with Tahoma and you can see they are different

See also
http://weblogs.asp.net/kdente/archive/2005/03/13/394499.aspx
 for a discussion on why this so
   Andrew

> If you leave the default font property value set to Microsoft Sans Serif,
> the Windows Form will automatically map to the correct system font based on
[quoted text clipped - 90 lines]
> >> >> And not only is it tough, is is also a moving one.
> >> >> When you think you got it, something new comes out :-)
Garrett McGowan[MSFT] - 29 Sep 2005 02:41 GMT
Andrew: You were right, I was wrong. It *should* render using Tahoma on
most Windows language versions, but it does not. Add me to the list of
people who would love to see this bug fixed.

As to your original question of supporting East Asian languages, Microsoft
Sans Serif should link appropriately to the related system fonts, without
extra work on your side.

Garrett McGowan [MSFT Developer International]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------

>From: AndrewEames@discussions.microsoft.com
>Subject: Re: fonts
[quoted text clipped - 53 lines]
>> >> >
>> >> >SYSTEM_FONT is not right either - You can't use SYSTEM_FONT from a
NET
>> >> >application - it claims not to be a truetype font
>> >> >  Andrew
[quoted text clipped - 46 lines]
>> >> >> And not only is it tough, is is also a moving one.
>> >> >> When you think you got it, something new comes out :-)
AndrewEames - 29 Sep 2005 22:04 GMT
Microsoft Sans Serif may be linked to something useful under a localised OS
(I haven't checked) but its not when running under English XP. If I am
running my application in Japanese under English XP (with the MUI installed)
, I presumably want the font to be MS UI Gothic which is not the same as
Microsoft Sans Serif
 Andrew

> Andrew: You were right, I was wrong. It *should* render using Tahoma on
> most Windows language versions, but it does not. Add me to the list of
[quoted text clipped - 129 lines]
> >> >> >> And not only is it tough, is is also a moving one.
> >> >> >> When you think you got it, something new comes out :-)
Garrett McGowan[MSFT] - 30 Sep 2005 02:42 GMT
Yes, I think I see what you're referring to. If any UI strings are left in
English on an East Asian language version of a Windows Form, the
font-selection bug causes those strings to render in Microsoft Sans Serif.
An English Windows XP user would expect to see those English strings
rendered in Tahoma, while a Japanese Windows XP user expects to see the
English strings rendered in MS UI Gothic. Instead, what you end up with is
Japanese strings in MS UI Gothic and English strings in Microsoft Sans
Serif.

Garrett McGowan [MSFT Developer International]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------

>From: AndrewEames@discussions.microsoft.com
>Subject: Re: fonts
[quoted text clipped - 141 lines]
>> >> >> >> And not only is it tough, is is also a moving one.
>> >> >> >> When you think you got it, something new comes out :-)
AndrewEames - 30 Sep 2005 14:37 GMT
No that wasn't what I meant.

If my application is running in Japanese under English XP, I presumably want
the font to be MS UI Gothic. If I just leave the font to be the default
Microsoft Sans Serif, I will not get MS UI Gothic - instead my application
needs to explicitly set the font to be MS UI Gothic
 Andrew

> Yes, I think I see what you're referring to. If any UI strings are left in
> English on an East Asian language version of a Windows Form, the
[quoted text clipped - 179 lines]
> >> >> >> >> And not only is it tough, is is also a moving one.
> >> >> >> >> When you think you got it, something new comes out :-)
Michael (michka) Kaplan [MS] - 30 Sep 2005 15:31 GMT
On an XP/Server 2003 machine, the font linking chasin when you select
Japanese as your default system locale and use Microsoft Sans Serif is:

MSGOTHIC.TTC,MS UI Gothic
gulim.ttc,gulim
SimSun.TTC,SimSun
mingliu.ttc,PMingLiU

So clearly it will link.

Michael

> No that wasn't what I meant.
>
[quoted text clipped - 203 lines]
>> >> >> >> >> And not only is it tough, is is also a moving one.
>> >> >> >> >> When you think you got it, something new comes out :-)
AndrewEames - 30 Sep 2005 15:41 GMT
But you're assuming the system locale has been changed to Japanese. My
application supports "on-the-fly" language switching so it needs to run in
Japanese, independent of the current system or user locale.
 Andrew

> On an XP/Server 2003 machine, the font linking chasin when you select
> Japanese as your default system locale and use Microsoft Sans Serif is:
[quoted text clipped - 215 lines]
> >> >> >> >> >> And not only is it tough, is is also a moving one.
> >> >> >> >> >> When you think you got it, something new comes out :-)
Garrett McGowan[MSFT] - 30 Sep 2005 19:21 GMT
The linking will still work, but any Roman characters in your Japanese UI
will be rendered using Microsoft Sans Serif. The Japanese characters will
be rendered using MS UI Gothic (via font linking).

You may already know this work-around, but you could set your forms to use
the system Icon font. This  defaults to the true system font, so is Tahoma
on non-EA, non-CS language versions of Windows.

 this.Font = SystemFonts.IconTitleFont;

Garrett McGowan [MSFT Developer International]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------

>From: AndrewEames@discussions.microsoft.com
>Subject: Re: fonts
[quoted text clipped - 225 lines]
>> >> >> >> >> >> And not only is it tough, is is also a moving one.
>> >> >> >> >> >> When you think you got it, something new comes out :-)
AndrewEames - 30 Sep 2005 20:47 GMT
I must be missing something - there is no linking from Microsoft Sans Serif
to MS UI Gothic under Windows XP English (system locale English)
 Andrew

> The linking will still work, but any Roman characters in your Japanese UI
> will be rendered using Microsoft Sans Serif. The Japanese characters will
[quoted text clipped - 272 lines]
> >> >> >> >> >> >> And not only is it tough, is is also a moving one.
> >> >> >> >> >> >> When you think you got it, something new comes out :-)
Garrett McGowan[MSFT] - 01 Oct 2005 00:01 GMT
From your description, it sounds like East Asian language support may not
be installed on that system.

When you load Regional and Language Options from Control Panel, is the
checkbox labeled 'Install files for East Asian languages' on the Languages
tab checked? This should cause the SystemLink registry key to be updated
with the East Asian fonts.

Garrett McGowan [MSFT Developer International]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------

>From: AndrewEames@discussions.microsoft.com
>Subject: Re: fonts
[quoted text clipped - 281 lines]
>> >> >> >> >> >> >> And not only is it tough, is is also a moving one.
>> >> >> >> >> >> >> When you think you got it, something new comes out :-)
AndrewEames - 01 Oct 2005 01:31 GMT
I'm not sitting at such a machine right now but how could such a link
possibly work. My font is Sans Serif, I'm running in English locale under
Windows XP but my app could be running in any language - if MS Sans Serif is
linked to MS UI Gothic then its going to be wrong for Korean - if its linked
to to Gulim, its going to be wrong for Japanese - I think my app needs to
explicitly call out the font
 Andrew

> From your description, it sounds like East Asian language support may not
> be installed on that system.
[quoted text clipped - 281 lines]
> >> >> >> >> >> menus
> >> >> >> >> >> >> and
Michael (michka) Kaplan [MS] - 01 Oct 2005 14:22 GMT
That is how font linkiing works, Andrew -- your system locale decides the
priority order by which ideographs would be selected.

If you want to explicitly have a particular language then you must
explicitly choose the font you want for the language.

But remember that we are talking about Microsoft Sans Serif hre, NOT MS Sans
Serif. They are different!

Signature

MichKa [Microsoft]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Blog: http://blogs.msdn.com/michkap

This posting is provided "AS IS" with
no warranties, and confers no rights.

> I'm not sitting at such a machine right now but how could such a link
> possibly work. My font is Sans Serif, I'm running in English locale under
[quoted text clipped - 310 lines]
>> >> >> >> >> >> menus
>> >> >> >> >> >> >> and
AndrewEames - 02 Oct 2005 01:33 GMT
Well yes - which is *exactly* why font linking is not the solution for
localized applications that run in a locale that *isnt* the systen locale.

This is why a localized application needs to explicitly call out its font on
a per language basis. The Dr International article referenced is a starter on
how to do this. However, my original question was how the XP look and feel
gets localised - i.e. take the XP style guidelines document and for each font
in there, what should the font be for every language. The Dr International
article essentially describes what Tahoma should map to but what about the
other fonts?

 Andrew

> That is how font linkiing works, Andrew -- your system locale decides the
> priority order by which ideographs would be selected.
[quoted text clipped - 268 lines]
> >> >> >> >> >> >> >> Use of included script samples are subject to the terms
> >> >> >> >> >> >> >> specified
Michael (michka) Kaplan [MS] - 02 Oct 2005 17:13 GMT
This is a rather large list, can you give the languages you are looking for?

Signature

MichKa [Microsoft]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Blog: http://blogs.msdn.com/michkap

This posting is provided "AS IS" with
no warranties, and confers no rights.

> Well yes - which is *exactly* why font linking is not the solution for
> localized applications that run in a locale that *isnt* the systen locale.
[quoted text clipped - 318 lines]
>> >> >> >> >> >> >> >> terms
>> >> >> >> >> >> >> >> specified

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.