You don't have to trust Microsoft's choices about fonts

by Michael S. Kaplan, published on 2007/06/16 17:25 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2007/06/16/3345079.aspx


You probably don't always trust Microsoft.

And that's OK, as far as I am concerned. Most days I don't trust it either (using the metaphor a PM I used to work with, you could fit all of the people I trust across the whole industry in a minivan and still have room for the cooler full of beer!).

But the thing is, if there is as given time when, as a developer, you decide to trust a result that Microsoft returns in a function, you can't really complain later if you decide you don't like the results.

Case in point -- a thread from the microsoft.public.win32.programmer.international newsgroup the other day from Neels:

Hi,

I am running my app on Japanese system and want windows to use "MS Shell Dlg 2" in my property sheet. Following is the rc file text for one of my property pages -

IDD_PAGE_MY_PAGE DIALOGEX 0, 0, 348, 172
STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "My Page"
FONT 9, "MS Shell Dlg 2", 400, 0, 0x1
BEGIN
    LTEXT          "This is where TAHOMA should be used..",
IDC_MY_CTRL,123,65,216,48
END

Oberservations:
1) On the japanese system where I am running this property sheet, OS is Windows XP Pro SP2
2) Registry key "FontSubstitutes" translates MS Shell Dlg to "MS UI Gothic" and MS Shell Dlg to "Tahoma"
3) I have tried all the permutations/combinations with the resource script -
   a) specified "MS Shell Dlg" instead of "MS Shell Dlg 2" (according to MS, it should automatically get translated to "Tahoma")
   b) Used DS_SHELLFONT (although DS_SHELLFONT = DS_SETFONT | DS_FIXEDSYS)
   c) specified "Tahoma" after removing DS_SETFONT and DS_FIXEDSYS

In ALL the cases I get "MS UI Gothic" as font when I get the face name using following code in CMyPage::OnInitDialog -

      CString cs;
      LOGFONT logfont;
      GetDlgItem(IDC_MY_CTRL)->GetFont()->GetLogFont(&logfont);
      cs.Format(_T("Face Name = %s Height = %d"),logfont.lfFaceName, logfont.lfHeight);
      MessageBox(cs);

I can set the "MS Shell Dlg 2" programmatically but then I will have to do that for EVERY page.

Any idea how I can make windows use MS Shell Dlg 2 (Tahoma)? Any help will be appreciated.

Thanks in advance,
Neel.

Now Microsoft decided a long time ago to use the default system locale and the default UI language of the LocalSystem account that is not used for UI in order to help make specific decisions about how text would display in Windows. This was done with the help of various experts and contacts within the subsidiaries and affects everything from font fallback in Uniscribe to font linking in GDI and ll of the rest.

You may not like the results.

There are times, for example, that I don't -- and this is only partially because of the fact that I am the sort of person who has to change their settings an awful lot as a part of both my job and the general things I am curious about that are probably the main reason I have the job I do.

But if you don't like them, then you have an obligation to not either (a) live with them or (b) stop using constructs like "MS Shell Dlg" or "MS Shell Dlg 2" or DS_SHELLFONT or any of the others, since they are built-in conveniences to make it easier for the system to work the way that Microsoft determined this aspect of the system should run.

They make it more convenient for the OS to do a whole bunch of things. But only if you like the final product -- if you don't, then they aren't more convenient at all.

If you want Tahoma then you should choose Tahoma (I don't care for it much myself because of what it does to Arabic but that's just me). You should never feel like you have to buy into a "best practices" font choice that leads to a font usage that you won't be happy with....

 

This  post brought to you by (U+2026, a.k.a. HORIZONTAL ELLIPSIS)


Neel. on 25 Jul 2007 8:02 AM:

Hey,

I updated the thread that you have referred to in this article: http://groups.google.com/group/microsoft.public.win32.programmer.international/browse_thread/thread/65f764504ac64bc8

Take a look.

Thanks,

Vishvesh

Michael S. Kaplan on 25 Jul 2007 10:48 AM:

Not sure what else to say -- the answer has already been given. DON'T USE constructs like MS Shell Dlg if you don't like their choices. If you like Tahoma, use Tahoma!


referenced by

2012/01/26 If font linking doesn't fit the text to a T (or ț!), a Romanian letter may be right but not quite look it

go to newer or older post, or back to index or month or day