Discussion:
Howto create a font to display multi language text?
(too old to reply)
Chris Becke
2009-10-19 08:32:15 UTC
Permalink
Given a win32 application that needs to display text, in dialog boxes
and user created controls - what is the best way to ensure that the most
capable font is selected?

My first problem is, dialog resources - dialog resources only allow the
typeface of the font to be selected. "MS Shell Dlg" is supposed to be
the 'best' font choice. Other devs on the team argue that we need to
choose 'Arial Unicode' or something otherwise we wont be able to display
chinese text on an english system.

I'm arguing that "MS Shell Dlg" is the only sane choice as we can't know
that 'Arial Unicode' is going to exist on all systems.
Because dialog resources don't even let you choose a charset, we can't
argue about that.

However, the main app itself needs to create fonts capable of displaying
characters from arbitrary languages. And now things get more hairy. How
does one rationally choose a CHARSET_* value for the LOGFONT struct?

What typefaces is it ligitimate to ask for? Should I just ask for
'Arial' or some common-on-english-systems typeface and hope that all
international users get a good experience? Because we do put the
application out in several languages, I can configure a default typeface
name appropriate to the language setting of the app - but, because users
are allowed to chat, I still need the fonts to be capable if displaying
multiple languages.

Im relly hoping font-linking steps in to save the day. But I'd like to
be sure Im doing as much as I can to give the right hints to everything
such that even users on Windows 2000 don't get a crappy ui experience
(and im pretty sure that font linking wasn't so hot in win2k).
Mihai N.
2009-10-20 08:58:48 UTC
Permalink
Post by Chris Becke
I'm arguing that "MS Shell Dlg" is the only sane choice as we can't know
that 'Arial Unicode' is going to exist on all systems.
Because dialog resources don't even let you choose a charset, we can't
argue about that.
"MS Shell Dlg" or "MS Shell Dlg2" are good choices.
These are not real fonts, see this regiustry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\FontSubstitutes
On an English system maps to "Microsoft Sans Serif"
("MS Shell Dlg2" to "Tahoma")

If the UI of the applications is English, you should specify
"Microsoft Sans Serif" or "Tahoma" directly, otherwise on a Japanese
system (for example) the dialog font will be replaced by a Japanese
font and all the control sizes and positions will me messed-up.

Don't worry, because font linking will take care of it and you will be
able to display pretty much anything.
Post by Chris Becke
However, the main app itself needs to create fonts capable of displaying
characters from arbitrary languages. And now things get more hairy. How
does one rationally choose a CHARSET_* value for the LOGFONT struct?
DEFAULT_CHARSET

<quote>
DEFAULT_CHARSET is not a real charset; in reality on Windows 2000 and Windows
XP it does two things:
- It tries to select the named font with the current system character set.
- If the named font exists but does not support the system character set, it
will still select the font with a charset that the font does support.

!!!
DEFAULT_CHARSET should be used when displaying a string of characters encoded
with Unicode.
!!!
</quote>

http://msdn.microsoft.com/en-us/goglobal/bb688134.aspx
Post by Chris Becke
Im relly hoping font-linking steps in to save the day.
Yes, it does. It works great with XP and newer, and except very unusual
scripts is it currently quite difficult to get "squares" (null glyphs)

And don't go with Arial Unicode (which is not present on all systems, since
it is part of Office) or Arial (which is not affected by the "magic"
of the ...\FontLink\SystemLink registry key (see link above))
--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Continue reading on narkive:
Search results for 'Howto create a font to display multi language text?' (Questions and Answers)
6
replies
examples of math trivias?
started 2006-12-04 18:54:22 UTC
mathematics
Loading...