none
Windows Ribbon Framework: How to change font face and size?

    Question

  • How do you change the font face and font size used by the Windows Ribbon Framwork's UIRibbon?

    The font used by the ribbon does not match the font the user has chosen as their Windows preferences (which is the preference my application uses). This means that as the font in Windows gets bigger, the ribbon gets smaller.

    Notice how the ribbon gets smaller in each screenshot:

    Segoe UI 9pt (Windowd default):

    screenshot1

    Segoe UI 12pt (what i use):

    screenshot2

    Segoe UI 16pt (what customers use):

    screenshot3

    Background

    The user can configure Windows to use their preferred font size, e.g.:
    • 8pt
    • 9pt
    • 12pt
    and their preferred font face, e.g.:
    • MS Sans Serif
    • Microsoft Sans Serif
    • Tahoma
    • Segoe UI
    • Calibri but the Windows Ribbon Framework by default uses a font that is not the user's preference.
    You can read the real question here, along with screenshots (i see Forums now strips out helpful screenshots from posts.)

    It's also important to note that Outlook 2010's Ribbon does honor the user's Menu Font preference, while mspaint for Windows 7 honors no font preferences.

    i want to be more a good developer, and act like the Office team, and not like the MSPaint team.

    Note:

    You can honor the user's preferences, and respect their color settings:

     

        IUIFramework framework;
       
    ...

       
    TColor glass = Dwm.GetColorizationColor();
       
    VarCast(v, ColorToUIHSB(glass), UI_PKEY_GlobalBackgroundColor.pid);

       
    IPropertyStore ps = framework as IPropertyStore;
        ps
    .SetValue(UI_PKEY_GlobalBackgroundColor, PROPVARIANT(v));
        ps
    .Commit;

     

    Thursday, December 02, 2010 3:03 PM

Answers

  • Since the Windows Ribbon Framework is what the MSPaint team uses, I'm afraid you're stuck with the same problem as they are.

    Anyway, If your customer has high resolution and have trouble seeing the fonts, the correct way to fix that is to change the DPI settings of windows from 100% to 125% or 150%. This will scale all the fonts, including the ones in the ribbon.

     

     


    Arik Poznanski
    blogs.microsoft.co.il/blogs/arik

    • Proposed as answer by Arik Poznanski Saturday, December 04, 2010 10:06 PM
    • Marked as answer by Jack Tripper Sunday, December 05, 2010 5:36 AM
    Saturday, December 04, 2010 10:06 PM