steno
27th August 2010, 21:47
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");
QFont dejavu("DejaVu Sans");
dejavu.setKerning(false);
dejavu.setFixedPitch(true);
QFontMetrics fm(dejaVu);
QRect r1 = fm.boundingRect("Test ");
QRect r2 = fm.boundingRect("Test0");