Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QML can't see font ascender on Embedded device

QML can't see font ascender on Embedded device

Scheduled Pinned Locked Moved Solved Mobile and Embedded
8 Posts 3 Posters 926 Views
  • 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.
  • carolsC Offline
    carolsC Offline
    carols
    wrote on last edited by
    #1

    Hi All,

    I have some problems to correctly visualize the font Helvetica Neue LT Std Font on an embedded device. The problem is that i 'cant see the part of the characters that are in the ascender area of the font, for example i can't see the accent of the char "À". But also for example the symbol ^ above the char "ê" is cutten. Checking the font with fontdrop.info i can confirm that the part of the characters that are cutten is the part in the ascender area.0_1568723941225_font_ascender.PNG

    If i run the application on PC, it works fine.
    My embedded device is based on a iMx6 ULL processor. The screen resolution is 800x480.

    Below the test code I am using. I'm using Qt5.8.0 both for embedded and PC.

    main.cpp

    {
        QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
        QGuiApplication app(argc, argv);
    
        QtQuick2ApplicationViewer viewer;
        viewer.setSurfaceType(QSurface::OpenGLSurface);
        // Force orientation to see Maliit in landscape orientation
        QFont font("HelveticaNeueLTStd");
        font.setStretch(QFont::Condensed);
        app.setFont(font);
        viewer.setMainQmlFile(QStringLiteral("main.qml"));
    
        QObject::connect((QObject*)viewer.engine(), SIGNAL(quit()), &app, SLOT(quit()));
        viewer.showExpanded();
        return app.exec();
    }
    
    

    main.qml

    import QtQuick 2.6
    import QtQuick.Window 2.2
    
    Window {
        visible: true
        width: 800
        height: 480
    
    
        Text {
            id: textEdit
            text: qsTr("ÀÀÀ")
            font.pointSize: 24
            verticalAlignment: Text.AlignVCenter
            anchors.top: parent.top
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.topMargin: 20
        }
    }
    
    

    0_1568724216667_IMG_0089.JPG
    0_1568724228025_font_pc.PNG

    Thanks!
    Caro

    Pablo J. RoginaP 1 Reply Last reply
    0
    • carolsC carols

      Hi All,

      I have some problems to correctly visualize the font Helvetica Neue LT Std Font on an embedded device. The problem is that i 'cant see the part of the characters that are in the ascender area of the font, for example i can't see the accent of the char "À". But also for example the symbol ^ above the char "ê" is cutten. Checking the font with fontdrop.info i can confirm that the part of the characters that are cutten is the part in the ascender area.0_1568723941225_font_ascender.PNG

      If i run the application on PC, it works fine.
      My embedded device is based on a iMx6 ULL processor. The screen resolution is 800x480.

      Below the test code I am using. I'm using Qt5.8.0 both for embedded and PC.

      main.cpp

      {
          QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
          QGuiApplication app(argc, argv);
      
          QtQuick2ApplicationViewer viewer;
          viewer.setSurfaceType(QSurface::OpenGLSurface);
          // Force orientation to see Maliit in landscape orientation
          QFont font("HelveticaNeueLTStd");
          font.setStretch(QFont::Condensed);
          app.setFont(font);
          viewer.setMainQmlFile(QStringLiteral("main.qml"));
      
          QObject::connect((QObject*)viewer.engine(), SIGNAL(quit()), &app, SLOT(quit()));
          viewer.showExpanded();
          return app.exec();
      }
      
      

      main.qml

      import QtQuick 2.6
      import QtQuick.Window 2.2
      
      Window {
          visible: true
          width: 800
          height: 480
      
      
          Text {
              id: textEdit
              text: qsTr("ÀÀÀ")
              font.pointSize: 24
              verticalAlignment: Text.AlignVCenter
              anchors.top: parent.top
              anchors.horizontalCenter: parent.horizontalCenter
              anchors.topMargin: 20
          }
      }
      
      

      0_1568724216667_IMG_0089.JPG
      0_1568724228025_font_pc.PNG

      Thanks!
      Caro

      Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      @carols is it possible that you run any other non-Qt application in that device to see what happens with the font in that case?

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • carolsC Offline
        carolsC Offline
        carols
        wrote on last edited by
        #3

        @Pablo J. Rogina thanks for your reply! Unfortunately is not easy for me in this moment to try with a no Qt Application. Do you think it could be related to the configuration of fonts on my embedded platform?

        Pablo J. RoginaP 1 Reply Last reply
        0
        • carolsC carols

          @Pablo J. Rogina thanks for your reply! Unfortunately is not easy for me in this moment to try with a no Qt Application. Do you think it could be related to the configuration of fonts on my embedded platform?

          Pablo J. RoginaP Offline
          Pablo J. RoginaP Offline
          Pablo J. Rogina
          wrote on last edited by
          #4

          @carols said in QML can't see font ascender on Embedded device:

          Do you think it could be related to the configuration of fonts on my embedded platform?

          I cannot tell for sure, but I do remember some issues in the forum due to the actual font file in the device not the exact same file in the PC although having the same name...

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          1
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            Did you check that you are actually getting the font you are requesting on your device ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • carolsC Offline
              carolsC Offline
              carols
              wrote on last edited by
              #6

              @SGaist thanks for the reply! Yes the font is the one that i'm requesting. I made this test: i changed the font with a font editor, i moved the letter "À" in way that the symbol above the A is under the line "ascender". In this way i can see the letter correctly. So it is a confirm that the font that i'm using is the correct one and that the problem is in the visualization of the symbol or of the part of a character that are above the "ascender" line. Please help!

              1 Reply Last reply
              0
              • carolsC Offline
                carolsC Offline
                carols
                wrote on last edited by
                #7

                After other tests i verified that this issue is related to some problem in the rendering of the font.
                So in the end i chose a simpler solution: i edited the font moving the "ascender" line upper in a way that now all the symbols are under this line. And now i can see alle the symbols correctly!

                1 Reply Last reply
                1
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Glad you found a solution and thanks for sharing !

                  That's a nice trick !

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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