Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFont setFixedPitch
Forum Updated to NodeBB v4.3 + New Features

QFont setFixedPitch

Scheduled Pinned Locked Moved General and Desktop
4 Posts 1 Posters 5.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    steno
    wrote on last edited by
    #1

    Setting setFixedPitch to true doesn't seem to work with Dejavu sans. Is this allowed? The following code doesn't yeild the same rectangles for the given text. To me if you set fixed pitch to true, those rectangles should be the same. Am I wrong here?

    @QFont dejavu("DejaVu Sans");
    dejavu.setKerning(false);
    dejavu.setFixedPitch(true);
    QFontMetrics fm(dejaVu);
    QRect r1 = fm.boundingRect("Test ");
    QRect r2 = fm.boundingRect("Test0");
    @

    1 Reply Last reply
    0
    • ? This user is from outside of this forum
      ? This user is from outside of this forum
      Guest
      wrote on last edited by
      #2

      DejaVu Sans is a proportional font. Did you try setFixedPitch with any other proportional font and did that work? Your code snip returns the same bounding rectangle for fixed fonts (DejaVu Sans Mono, courier etc)

      Looks like no effect of calling setFixedPitch ... maybe a bug that you should log "here":http://bugreports.qt.nokia.com

      1 Reply Last reply
      0
      • S Offline
        S Offline
        steno
        wrote on last edited by
        #3

        So I tried other proportional fonts and set fixed pitch had no effect on them. I logged a bug report.

        1 Reply Last reply
        0
        • ? This user is from outside of this forum
          ? This user is from outside of this forum
          Guest
          wrote on last edited by
          #4

          thanks :)

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved