Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 5.7 cannot render 'Bengali' font

Qt 5.7 cannot render 'Bengali' font

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 4 Posters 1.2k 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.
  • S Offline
    S Offline
    sigmind
    wrote on last edited by sigmind
    #1

    I am using Qt 5.7 and within my code, there is a qdebug line with Bengali fonts.

    qDebug() << "বাংলাদেশ-BD" << endl;
    

    While running the application, I see this line outputs question marks

    ?????-BD
    

    not the fonts. My locale settings are like this:

    LANG=C.UTF-8
    LANGUAGE=en
    LC_CTYPE="C"
    LC_NUMERIC="C"
    LC_TIME="C"
    LC_COLLATE="C"
    LC_MONETARY="C"
    LC_MESSAGES="C"
    LC_PAPER="C"
    LC_NAME="C"
    LC_ADDRESS="C"
    LC_TELEPHONE="C"
    LC_MEASUREMENT="C"
    LC_IDENTIFICATION="C"
    LC_ALL=C
    
    

    What might possibly go wrong?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      and welcome to the forums.
      If you place same text on a QLabel, does it still show as ????
      QDebug has issue with unicode. ( on windows )

      https://forum.qt.io/topic/20581/qdebug-output-with-unicode-characters-to-windows-console-qtcreator-mission-impossible

      1 Reply Last reply
      1
      • S Offline
        S Offline
        sigmind
        wrote on last edited by
        #3

        Yes, QLabel shows the Bengali font clearly, only qdebug() not rendering properly.

        mrjjM 1 Reply Last reply
        0
        • S sigmind

          Yes, QLabel shows the Bengali font clearly, only qdebug() not rendering properly.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @sigmind
          ok, so it seems qDebug still do not support full unicode on windows.

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

            Hi,

            qDebug doesn't do any rendering, it prints to your console.

            Does using cout get you the result you want ?

            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
            1
            • S Offline
              S Offline
              sigmind
              wrote on last edited by sigmind
              #6

              QLabel is working fine with this language, but none of std::string or QString working here, resulting in ???? (question marks instead of fonts). I am using Ubuntu 16 and Qt Creator 4.0.2 Based on Qt 5.7.0 (GCC 4.9.1 20140922 (Red Hat 4.9.1-10), 64 bit).

              Please help

              jsulmJ 1 Reply Last reply
              0
              • S sigmind

                QLabel is working fine with this language, but none of std::string or QString working here, resulting in ???? (question marks instead of fonts). I am using Ubuntu 16 and Qt Creator 4.0.2 Based on Qt 5.7.0 (GCC 4.9.1 20140922 (Red Hat 4.9.1-10), 64 bit).

                Please help

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @sigmind Did you try with std::cout as @SGaist suggested?

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  sigmind
                  wrote on last edited by sigmind
                  #8

                  @jsulm @SGaist
                  Thanks for the suggestion and yes,

                  std::cout << "বাংলাদেশ-BD!" << std::endl;
                  

                  correctly prints the font like this:

                  বাংলাদেশ-BD!
                  

                  However, using this font in my code crashes the program abruptly. Instead if I use

                  std::cout << "Bangladesh-BD!" << std::endl;
                  

                  The program runs fine.
                  However, I am new in Qt and couldn't find how to pass the string correctly to a std::string variable so that it could render the font properly instead of Question marks.

                  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