查看完整版本: [-- 在Windows 上,Qt可以打印出八卦符号吗? --]

QTCN开发网 -> Qt中文处理 -> 在Windows 上,Qt可以打印出八卦符号吗? [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

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);
             }

pxiao_xiao 2015-01-14 15:54
你在论坛找找 我记得以前有一个画太极的例子

yongjie 2015-01-15 08:24
[attachment=13077]

附上了源代码。哪位有兴趣可以看一下,功能就是显示unicode字符的。

yongjie 2015-02-13 10:25
在这个网址下了个字体包:
http://users.teilar.gr/~g1951d/Symbola.zip

安装。程序运行时,选择这个字体,就可以显示了。


查看完整版本: [-- 在Windows 上,Qt可以打印出八卦符号吗? --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled