使用windows的ttf字型,發現字型都變得看不到了,找到這篇部落格,還有其朋友做過的都是設定QWS_DISPLAY,變量,
http://stackoverflow.com/questions/15475971/text-size-and-style-differs-in-qt-desktop-and-embedded-applications
抄選關鍵部分:
Rebuilt Qt Embedded with freetype support (-qt-freetype option) and get desired result. Also it was needed to play with QWS_DISPLAY variable (mmWidth and mmHeight options), the value QWS_DISPLAY=LinuxFB:mmWidth=250:mmHeight=150 seems to be the best solution for my 7 inch touchscreen (previous value QWS_DISPLAY=LinuxFB:mmWidth=800:mmHeight=480 results in too small font size with freetype-supported Qt lib).
Building Qt Embedded with freetype support solved the problem。
我設定的參數為
export QWS_DISPLAY=LinuxFB:mmWidth162:mmHeight121:0
export QWS_SIZE=800x600
1,也具體不知道那個mmwidth是什麼意思,就按照螢幕的寬度是162mm,高度是121mm設定上去。看起來效果還可以,字型大小也差不多。
2,我也不知道我的qt是否編譯了freetype,好像預設是使用了系統 的freetype庫,反正現在是可以用了。
關于mmwidth, mmheight的解釋:
http://qt-project.org/doc/qt-4.8/qt-embedded-displaymanagement.html