Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-49164

Artificial emboldening does not work on monospace fonts (Qt 5)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.5.0
    • GUI: Font handling
    • None
    • Fedora 23 (Final KDE live image).

    Description

      I noticed in Fedora 23, artificial emboldening of monospace fonts does not seem to be working. I checked KWrite and Calligra. KWrite usually uses boldface when doing source highlighting - if you open a Python file, various keywords will be bolded - but if you use a font without its own bold variant, e.g. Droid Sans Mono, all characters appear the same weight. Similarly in Calligra, if you create a document and write the same text on two lines, both in Droid Sans Mono, and set one line to 'bold', both lines appear identical.

      It seems like artificial emboldening of non-monospace fonts does work (I tested by deleting DejaVu's bold variants).

      Interestingly, the reason I looked into this was to see whether Qt incorrectly made monospace characters wider when artificially emboldening them, as Cairo does - see https://bugs.freedesktop.org/show_bug.cgi?id=92756 and my blog post, https://www.happyassassin.net/2015/02/14/monospace-fonts-and-freetype-emboldening-a-follow-up/ . So I guess this could actually be intentional, as a way to avoid that problem. If so, though, I'd argue it's wrong: the correct thing to do would be to embolden the characters, but not change their width.

      Ironically, it seems like this is actually what Qt does when emboldening non-monospaced fonts, where it wouldn't actually be a problem to make the characters wider! When I did my test by deleting DejaVu Sans's bold variant, the artificially emboldened characters seemed to be the same width as the regular ones, compared to the native bold variant where the characters are rather wider than the non-bold ones. So it seems like Qt actually has the ability to embolden without widening, but it's using it on fonts where it doesn't need to, and instead of using it on monospace fonts (where it would make sense), it's not emboldening them at all!

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            adamw Adam Williamson
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes