#321 Use native Windows fonts for dialogs and tabs

Cosmetic
closed-fixed
nobody
SciTE (622)
5
2005-06-30
2005-06-29
Adam Strzelecki
No

Windows applications should use "MS Shell Dlg" along
with DIALOGEX DS_FIXEDSYS in resources flag to properly
map to current active shell font in Windows system.
Moreover when manually creating the controls it's
better to use "MS Shell Dlg 2" for >= Win2k and for the
old systems to have valid mapping.

In tabs code also we haven't dynamically set the size
depending on currenly chosen font sizes.

To get brief explanation read:
http://support.microsoft.com/Default.aspx?kbid=282187
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_4qcn.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_General_MBCS_Programming_Advice.asp

Please apply attached patch to fix that.

Regards.

Discussion

  • Patch fixing MS Shell Dlg mapping in rc and tabs

     
  • Neil Hodgson
    Neil Hodgson
    2005-06-30

    Logged In: YES
    user_id=12579

    Committed with a change to tab bar font size as the patch
    produced a tiny unusable font for me.

     
  • Neil Hodgson
    Neil Hodgson
    2005-06-30

    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=156523

    Have you really applied patch below (Scite MS Shell
    Dlg.patch) or just changed the font name ?

    If you changed just font name, this is invalid, as old "MS
    Sans Serif" is bitmap font and CreateFont(8, will work
    okay... but not for True Type font where height must be
    counted -MulDiv(8, ::GetDeviceCaps(hDC, LOGPIXELSY), 72) coz
    TT resolution is much much higher.

    Cheers, Adam.

     
  • Neil Hodgson
    Neil Hodgson
    2005-06-30

    Logged In: YES
    user_id=12579

    I didn't originally see that there was a patch so changed
    the code myself, then reread the report and found the patch
    so changed my code but didn't add the '-' in front of MulDiv.

     
  • Logged In: YES
    user_id=156523

    That's what I've thought... it's a pity that web
    notification doesn't show if some files were also added.

    Best wishes, Adam.

     
  • Neil Hodgson
    Neil Hodgson
    2005-07-07

    Logged In: YES
    user_id=12579

    What difference do you see between -..8 and ..10?

     
  • Logged In: YES
    user_id=156523

    You select 10pt is font _cell_ height, and you should select
    8pt _character_ height if you want have System font, 8pt size.

    Of course your solution is fine... but how you can be sure
    that in general 10pt cell height makes exactly 8pt character
    height ? Coz Windows app use 8pt font sizes, correct me if
    I'm wrong.
    It can be false with other than standard size system font
    size settings, so I don't see the point for making empiric
    solutions than following MS documentation.

    Sorry about all this thread... but I can't stand that so
    many apps are using "MS Sans Serif" hardcoded fonts rather
    than following MS tips, coz on developer machine it looks
    good.. it doesn't make look good on any other machine. It's
    most MS fault that made few year ago mess with font naming.
    Moreover usually ppl that not using large fonts with
    ClearType don't see difference if they use MS Sans Serif, MS
    Shell Dlg whatever.

     
  • Neil Hodgson
    Neil Hodgson
    2005-07-07

    Logged In: YES
    user_id=12579

    Is there a documented font for application tab bars?

     
  • Logged In: YES
    user_id=156523

    I don't know of any. Moreover I don't see your point. If you
    use FONT 8 (go look Scite.rc file) why don't you set the
    same font size for the tabs. Since 8pt is standard for
    Windows apps, I just pointing you that instead of setting
    10pt cell font size you should set 8pt character point size
    nothing more. EOT from my side.

     
  • Neil Hodgson
    Neil Hodgson
    2005-07-07

    Logged In: YES
    user_id=12579

    Looks to me like the tab bar in Visual C++ follows the
    system icon font as does other toolbar area text. Therefore
    the correct font is
    ::SystemParametersInfo(SPI_GETICONTITLELOGFONT,sizeof(lfIconTitle),&lfIconTitle,FALSE);
    fontTabs = ::CreateFontIndirect(&lfIconTitle);