yongjie |
2015-01-14 15:31 |
在Windows 上,Qt可以打印出八卦符号吗?
哪位成功打印过八卦符号? Unicode值 在 0x4dc0 - 0x4dff。 在Linux下可以看到。但Windows下是空的。 IE8可以显示,因此,系统里应该有字体的。但用QFontDialog换了几个字体也不出来。怪不怪? 我的代码是:
QString UnicodeViewer::getChar(unsigned int code) { if(code < 0x10000) return QString(QChar(code)); QChar high = QChar::highSurrogate(code); QChar low = QChar::lowSurrogate(code); return QString() + high + low; }
QString cc = getChar(charCode); if (cc.at(0).isPrint()) { if (activeCode == unicodeBegin + l*CharPerLine + col) { QRectF r(left+1, top+1, horizontalGap-1, verticalGap-1); painter.fillRect(r, Qt::gray); } painter.drawText(r, cc, alignCenter); } else { QRectF r(left+1, top+1, horizontalGap-1, verticalGap-1); painter.fillRect(r, Qt::cyan); } |
|