QT/QML hindi font support

自作多情 提交于 2019-12-11 08:43:27

问题


I am trying to create an application with hindi font support. Text written in english is not displayed in hindi. But If i write it in hindi it is displaying in hindi.

    FontLoader { id: hindi
    source: "/home/sakshi/development/adt-bundle-linux-x86/sdk/platforms/android-17/data/fonts/DroidSansDevanagari-Regular.ttf";
}

Text{
 x: 149
 y: 348
 width: 428
 height: 44
 text: "\nजोड़े आपको दुनिया से"
 font.family: hindi.name
 }

with this text will be displayed as जोड़े आपको दुनिया से

FontLoader { id: hindi;
source: "/home/sakshi/development/adt-bundle-linux-x86/sdk/platforms/android-17/data/fonts/DroidSansDevanagari-Regular.ttf";
}

Text{
 x: 149
 y: 348
 width: 428
 height: 44
 text: "\nWelcome"
 //text: hindi.status == FontLoader.Ready ? 'Loaded' : 'Not loaded'
 font.family: hindi.name
}

in this case output is "welcome". Can any one tell me how to change the font to hindi? Is there any way to translate from english to hindi?


回答1:


Qt would not know the equivalent of "Welcome" in Hindi, or any other language for that matter. The proper way to add Hindi support to your application would be localization. You could start from QtQuick Internationalization and Internationalization with Qt



来源:https://stackoverflow.com/questions/20758906/qt-qml-hindi-font-support

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!