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

Context2D's font property does not accept a family name including white spaces.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.2.0
    • 5.0.2, 5.1.0
    • Quick: Other
    • 0cca56f30d6a0290841859a58f517cece13d8d81

    Description

      It's not possible to use fontname with space in QML canvas element. Quote doesn't help:

      • single quote
        ctx.font = "bold 36px \'Bitstream Vera Sans\'";
      • double quote
        ctx.font = "bold 36px \"Bitstream Vera Sans\"";

      According the docs it should work:
      http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-context2d.html#font-prop
      The default font value is "10px sans-serif". See w3C 2d context standard for font http://www.w3.org/TR/CSS21/fonts.html#propdef-font-family
      To avoid mistakes in escaping, it is recommended to quote font family
      names that contain white space, digits, or punctuation characters other than hyphens.

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            qtcomsupport Qt Support
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes