Home > other >  QFont font stretch problem
QFont font stretch problem

Time:09-22

QPixmap textImage (700200); ,0,700,200 QRect the rect (0); QPainter textPainter (& amp; TextImage); QFont font=textPainter. The font (); The font. SetFamily (" end "); The font. SetPixelSize (86); The font. SetStretch (40); QPen pen; TextPainter. SetPen (pen); TextPainter. SetFont (font); TextPainter. DrawText (the rect, Qt: : AlignVCenter | Qt: : AlignHCenter, "in Chinese"); TextImage. Save (" test111. PNG "); TextPainter. End ();//////the purpose of the code above is to realize the font stretch, so that the entire string to fill a given rectangle, but when the pixel size & gt; 86 is not normal, no stretching, the font. SetStretch (40); Instead affects spacing, & lt; There is no question of 86 which ace to know what is going on, I thank you very much

CodePudding user response:

It should be a bug, the latest version has been repaired
  • Related