1、 Halcon字体大小设置在Qt上的实现
在之前介绍过Halcon窗口显示文字字体的尺寸和样式,具体详细介绍可回看
(一)Halcon窗口界面上显示文字的字体尺寸、样式修改
当时介绍的设定方法
//Win下
QString Font_win = "-Arial-10-*-1-*-*-1-";
//这里也可以Font_win = "-Arial-10";
QByteArray ba = Font_win.toLocal8Bit();
const char *string = ba.data();
SetFont(hv_WindowHandleCurrent,string);
//Linux下
HTuple hv_Font,hv_FontWithSize;
QueryFont(hv_WindowHandleCurrent,&hv_Font);
hv_FontWithSize = HTuple(hv_Font[0]) + "-40";
SetFont(hv_WindowHandleCurrent,hv_FontWithSize);
最近在使用过程中发现一个问题,在不同模式下设置的不同;
在Debug下
Font_win = "-Arial-10";
//在Release下
Font_win = "-Arial-10-";
如果要设置斜体,加粗等效果,Release下要严格按照SetFo