Qt5 Font arm linux
1. ubuntu 下查看當前字體庫命令: fc-list
/usr/share/fonts/chinese/msyhbd.ttf: Microsoft YaHei UI:style=Bold,Negreta,tu?né,fed,Fett,?ντονα,Negrita,Lihavoitu,Gras,Félk?vér,Grassetto,Vet,Halvfet,Pogrubiony,Negrito,Полужирный,Fet,Kal?n,Krepko,Lodia
/usr/share/fonts/ttf/LiberationSans-Italic.ttf: Liberation Sans:style=Italic
/usr/share/fonts/ttf/LiberationMono-Regular.ttf: Liberation Mono:style=Regular
/usr/share/fonts/chinese/simsun.ttf: SimSun,宋體:style=Regular,常規
/usr/share/fonts/ttf/LiberationSans-Bold.ttf: Liberation Sans:style=Bold
/usr/share/fonts/chinese/msyh.ttf: Microsoft YaHei,微軟雅黑:style=Regular,Normal,oby?ejné,Standard,Κανονικ?,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
/usr/share/fonts/ttf/LiberationMono-BoldItalic.ttf: Liberation Mono:style=Bold Italic
或只查看中文字庫: fc-list :lang=zh
/usr/share/fonts/chinese/msyhbd.ttf: Microsoft YaHei UI:style=Bold,Negreta,tu?né,fed,Fett,?ντονα,Negrita,Lihavoitu,Gras,Félk?vér,Grassetto,Vet,Halvfet,Pogrubiony,Negrito,Полужирный,Fet,Kal?n,Krepko,Lodia
/usr/share/fonts/chinese/simsun.ttf: SimSun,宋體:style=Regular,常規
/usr/share/fonts/chinese/msyh.ttf: Microsoft YaHei,微軟雅黑:style=Regular,Normal,oby?ejné,Standard,Κανονικ?,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
/usr/share/fonts/chinese/msyh.ttf: Microsoft YaHei UI:style=Regular,Normal,oby?ejné,Standard,Κανονικ?,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
/usr/share/fonts/chinese/msyhl.ttf: Microsoft YaHei,微軟雅黑,Microsoft YaHei Light,微軟雅黑 Light:style=Light,Regular
/usr/share/fonts/chinese/msyhbd.ttf: Microsoft YaHei,微軟雅黑:style=Bold,Negreta,tu?né,fed,Fett,?ντονα,Negrita,Lihavoitu,Gras,Félk?vér,Grassetto,Vet,Halvfet,Pogrubiony,Negrito,Полужирный,Fet,Kal?n,Krepko,Lodia
/usr/share/fonts/chinese/simsun.ttf: NSimSun,新宋體:style=Regular,常規
系統中添加字庫,以中文為例:
a. 在/usr/share/fonts/下新建fold, 比如chinese
b. 將Windows下 c:\Windows\Fonts中文字體拷貝到上述文件夾, 如simsumb.ttf, simsum.ttf, msyh.ttf, msyhbd.ttf
如果是ttc為后綴的,改成.ttf
c. cd /usr/share/fonts/chinese
d. 執行以下2條命令
mkfontscale
mkfontdir
3. 再次查看字體文件
fc-list :lang=zh
就會看到剛剛看到的字體
Qt5 linux arm FONTS:
1. 關鍵點是QT_QPA_FONTDIR
確認QT安裝路徑,如/opt/Qt-arm-5.9.7, 則字體文件路徑為/opt/Qt-arm-5.9.7/lib/fonts
也可以通過宏設置:
export QTDIR=/opt/Qt-arm-5.6.3
export QTEDIR=$QTDIR
export QT_QPA_FONTDIR=$QTDIR/lib/fonts
2. 把字體文件拷貝到Qt字體路徑下就OK了
浙公網安備 33010602011771號