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

Qt在Linux上经过矩阵变化绘制点阵字体显示效果有问题

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Incomplete
    • Affects Version/s: 5.11.3
    • Fix Version/s: None
    • Component/s: Extras: X11
    • Labels:
      None
    • Environment:
      ubuntu16.04

      Description

      Qt在绘制一些点阵字体的时候。如果Qt的坐标系经过了矩阵变化,绘制点阵字体的规则就会变化。并不符合freetype的绘制规则。

       

      下面代码片段 A

      QPainter painter(this);
      painter.setWindow(0, 0, 1440, 1440);
      painter.setViewport(0, 0, 96, 96);

      QString strText = QString::fromUtf8("永");

      QFont font1;
      font1.setFamily(QString::fromUtf8("simsun"));
      font1.setPixelSize(210);
      painter.setFont(font1);
      painter.drawText(QPointF(300, 400), strText);

       

      代码片段B

      QPainter painter(this);

      QString strText = QString::fromUtf8("永");

      QFont font1;
      font1.setFamily(QString::fromUtf8("simsun"));
      font1.setPixelSize(14);
      painter.setFont(font1);
      painter.drawText(QPointF(300, 400), strText);

       

      A这段代码的效果在Linux上会绘制出抗锯齿的效果,但是在Windows上会绘制出点阵字体的效果。B段代码与A段代码绘制的字体大小一致,但是A发生了抗锯齿,B还是显示点阵字体。发现Qt在从freetype获取字体时Ft_Set_Char_Size的时候将矩阵转化完之后的字体大小传递过去了。我觉得这种方式不太合理。至少要A段代码 WIndows,Linux的绘制效果保持一致。都变成点阵字体绘制。Freetype的规则在Linux下应该适应下,应该多大的显示字号是否该抗锯齿。

       

        Attachments

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

          Activity

            People

            Assignee:
            cryfeifei pengfei zhang
            Reporter:
            cryfeifei pengfei zhang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes