Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. German Umlauts are not recognized by qt Text Item.
Forum Updated to NodeBB v4.3 + New Features

German Umlauts are not recognized by qt Text Item.

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 652 Views 2 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.
  • A Offline
    A Offline
    AYYAPPA
    wrote on last edited by
    #1

    Hi all,

    i have a Rectangle Parent item and Text child Item inside it.
    the rectangle box has fixed width . The text is assigned with a fixed font size. the text of Text item varies. in order to fit long strings inside the Parent rectangle , i used property fontSizeMode: Text.Fit for Text item. so that font size will be adjusted to fit inside the rectangle.

    it is working fine with all the characters except German umlauts.
    for example ,if my text is "Over" in english , it is translated to "Über".
    In English in my code over text can't be fit inside rectangle with given font, hence qt reduces the font size using the Text.Fit property.
    In German in my code Über text can't be fit inside rectangle with given font, hence qt reduces the font size using the Text.Fit property.
    here qt is treating character Ü as english U and doing the font size adjustment without considering two dots above.
    so when i execute the code, the two dots in Umlaut character are coming above rectangle.

    0_1550149863341_dab3cfce-decf-414f-85ff-11930a7a1419-image.png

    regards,
    ayyappa.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AYYAPPA
      wrote on last edited by
      #2

      anyone know how to resolve this, is there way to recognize if the character having added glyphs on the top using TextMetrics or any other Qt library item?

      raven-worxR 1 Reply Last reply
      0
      • A AYYAPPA

        anyone know how to resolve this, is there way to recognize if the character having added glyphs on the top using TextMetrics or any other Qt library item?

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #3

        @AYYAPPA
        Maybe the font itself already has incorrect metrics? have you tried another font?

        Also the docs for fontSizeMode property say:

        The font size of fitted text has a minimum bound specified by the minimumPointSize or minimumPixelSize property and maximum bound specified by either the font.pointSize or font.pixelSize properties.

        did you check those minimum properties?

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        3
        • A Offline
          A Offline
          AYYAPPA
          wrote on last edited by
          #4

          @raven-worx thanks for the response.
          i am extremely sorry to inform you that , this is not mistake from Qt, it's a mistake from my end , bad code.

          i anchor text items using baseline hence i usually don't use height property.
          so when i said fontSizeMode: Text.Fit ,Qt doesn't know height of Text Item to fit the text inside and assigning some height base don font size and font family.

          now i have externally set height for TextItem same as the boundary rectangle height and its working perfect and glyphs are displayed inside boundary.

          i am closing this issue as it is resolved. thanks for your help again.

          1 Reply Last reply
          1

          • Login

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