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. Fonts always bold in Devanagari under Android
Forum Update on Monday, May 27th 2025

Fonts always bold in Devanagari under Android

Scheduled Pinned Locked Moved Solved Mobile and Embedded
androiddevanagarinotofontbold
4 Posts 2 Posters 1.5k 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.
  • _ Offline
    _ Offline
    _.-rFLo_.-
    wrote on last edited by
    #1

    Hi,
    I am programming an bilingual English / Devanagari app for Android using Noto Font from Google under QT 5.8. Noto has a normal and bold styles for Devanagari symbols.

    Font loading and use in QML are working fine for latin characters. But Devanagari on Android is always rendered bold. Whatever I try, there is no difference. Also loading another font with Devanagari symbols is no solution.

    Devanagari symbols are rendered flawless (thick and thin) if compiled for macOS Desktop QT 5.8 clang_64 bit.

    Is anyone experiencing the same? Or is this a bug?
    Thank you very much

    QML
    FontLoader { id: appFontRegularHindi;   name: "NotoSansDevanagariRegular";  source: "fontsHi/NotoSansDevanagari-Regular.ttf" }
    FontLoader { id: appFontBoldHindi;      name: "NotoSansDevanagariBold";     source: "fontsHi/NotoSansDevanagari-Bold.ttf" }
    
                   TextArea {
                        textFormat: Text.RichText
                        onLinkActivated: Qt.openUrlExternally(link)
                        font.pointSize: 16
                        font.family:    appFontRegularHindi.name
                        font.weight:    Font.Thin
                        font.bold:      false
                        text:           "मेरा नाम रवि है"
                    }
    
    M 1 Reply Last reply
    0
    • _ _.-rFLo_.-

      Hi,
      I am programming an bilingual English / Devanagari app for Android using Noto Font from Google under QT 5.8. Noto has a normal and bold styles for Devanagari symbols.

      Font loading and use in QML are working fine for latin characters. But Devanagari on Android is always rendered bold. Whatever I try, there is no difference. Also loading another font with Devanagari symbols is no solution.

      Devanagari symbols are rendered flawless (thick and thin) if compiled for macOS Desktop QT 5.8 clang_64 bit.

      Is anyone experiencing the same? Or is this a bug?
      Thank you very much

      QML
      FontLoader { id: appFontRegularHindi;   name: "NotoSansDevanagariRegular";  source: "fontsHi/NotoSansDevanagari-Regular.ttf" }
      FontLoader { id: appFontBoldHindi;      name: "NotoSansDevanagariBold";     source: "fontsHi/NotoSansDevanagari-Bold.ttf" }
      
                     TextArea {
                          textFormat: Text.RichText
                          onLinkActivated: Qt.openUrlExternally(link)
                          font.pointSize: 16
                          font.family:    appFontRegularHindi.name
                          font.weight:    Font.Thin
                          font.bold:      false
                          text:           "मेरा नाम रवि है"
                      }
      
      M Offline
      M Offline
      mvuori
      wrote on last edited by
      #2

      Just 2 ideas, even though you have tried "everything"

      • font.weight is Thin, which sounds wrong for a "regular" font.
      • when something funny is going on, I accept that the fix can be irrational too, just changing random things to shuffle the bytes around. For that end, I'd change the order the fonts are loaded (there could also be a bug that uses under some conditions the last font loaded)
      1 Reply Last reply
      0
      • _ Offline
        _ Offline
        _.-rFLo_.-
        wrote on last edited by
        #3

        Thank you for your ideas mvuori

        • font.weight: Font.Normal unfortunately doesn't do anything
        • changing the order didn't do it either
        • while playing with the order, I commented out all font loading. Which should mean that, Android falls back to the default system font. And you won't believe it, that's also rendered bold all the time, wherever I have Devanagari symbols. Wherever there are latin ciphers as in a date or numbers, they are rendered normal and slim.
        _ 1 Reply Last reply
        0
        • _ _.-rFLo_.-

          Thank you for your ideas mvuori

          • font.weight: Font.Normal unfortunately doesn't do anything
          • changing the order didn't do it either
          • while playing with the order, I commented out all font loading. Which should mean that, Android falls back to the default system font. And you won't believe it, that's also rendered bold all the time, wherever I have Devanagari symbols. Wherever there are latin ciphers as in a date or numbers, they are rendered normal and slim.
          _ Offline
          _ Offline
          _.-rFLo_.-
          wrote on last edited by
          #4

          Alright, problem solved. As so many times, the bug was sitting between chair and keyboard.

          In the FontLoader, I had the name property set. Which is set automatically if a font is loaded by source. https://doc.qt.io/qt-5/qml-qtquick-fontloader.html

          Having the name property set while loading a font by source is no problem under macOS but under Android, one Devanagari font started to dominate all instances, where Devanagari symbols appeared and all logic, how fonts are applied falls apart.

          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