#249 Bold characters don't render monospaced.

Scintilla (796)

(WindowsXP, Win2k)

When using a monospaced font with no inherent defined
bold face, bold regions of text render wider than the
same text in the normal face.

I believe this is down to the windows API returning
font glyphs which are wider, automatically scaled from
the chosen font.

This upsets alignment in sourcecode, the primary reason
for using a monospaced font.

Attached is an example ; the font is ProggyCleanTT
(www.proggyfonts.com) drawn at 12 points. The upper
text is from NotePad2, the lower text is from PSPad.

On close examination, both render the bold and normal
glyphs identically, but PSPad spaces the bold exactly
the same way as it spaces normal text.

Visual Studio and SharpDevelop also exhibit this
behaviour ; although SharpDevelop has the extra wrinkle
that the onscreen cursor position is spaced as though
it was normal text, so it doesn't represent the actual
position of the cursor in the buffer.


  • Adrian Wilkins

    Adrian Wilkins - 2004-12-16

    Example of correct and incorrect rendering of monospaced bold font

  • Neil Hodgson

    Neil Hodgson - 2004-12-17
    • priority: 5 --> 4
    • assigned_to: nobody --> nyamatongwe
    • status: open --> open-wont-fix
  • Neil Hodgson

    Neil Hodgson - 2004-12-17

    Logged In: YES

    It is probable that the bold characters are monospced
    themselves and that you could achieve the desired effect by
    choosing a smaller or different monospaced font for the bold

  • Nathan Sweet

    Nathan Sweet - 2004-12-17

    Logged In: YES

    I think Adrian is saying that the PSPad program does it
    correctly -- uses bold characters for a monospaced font that
    doesn't have bold without adding extra space between glyphs.

    Whatever Windows is doing to make the characters bold is
    also adding to the character width. In the ProggyCleanTT
    example, the Windows-bolded glyphs still fit within the
    bounds of the non-bolded glyphs. I'm not sure this will
    always be the case for other fonts. As you can see in the
    screenshot, the character spacing is quite squished in
    PSPad's rendering. Look between the "D" and "a" in the word

    I assume what PSPad is doing for monospaced fonts is forcing
    the width of all the bolded characters to the width of the
    non-bolded characters *IF* the font does not have an
    explicit bold version.

    I think this would be a useful addition to SciTE. It would
    have to be toggled on and off for fonts that don't render
    properly with it.

    The solution for now is to simply use a font that has an
    explicit bold. Bitstream Vera Mono has regular and explicit
    bold, italic, and bold italic. It can be had here...


    I have rasterized Bitstream Vera Mono at 9pt and then hand
    tweaked it to optimize it for programming. My new font is
    called Lava Mono and can be had here...


    The tool I used to rasterize and tweak the font is called
    Softy and can be had here...


    Unfortunately Dave Emmett has passed away so his utility
    cannot be registered.

  • Neil Hodgson

    Neil Hodgson - 2004-12-18

    Logged In: YES

    Can't see how this fits in with Scintilla's font description
    attributes without adding an explicit monospace flag and then
    defining some set of semantics for the flag. There may be a
    considerable speed degradation if this requires drawing text
    character by character. I am not personally interested in
    working on this feature.

  • Neil Hodgson

    Neil Hodgson - 2005-02-03
    • status: open-wont-fix --> closed-wont-fix

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks