qml 字体

Fonts

Fonts can be referenced via a font name (eg. "Courier"), loaded from a file, or a network url. The following snippet loads a font from the net and displays some text using it. The font loader also provides status information of the loading process. More info


Rectangle {
    width: 400; height: 200
    FontLoader { id: webFont; source: "http://www.princexml.com/fonts/steffmann/Starburst.ttf" }
    Text {
        width: parent.width; font.family: webFont.name; font.pointSize: 30
        text: {
            if (webFont.status == 1) "Font loaded"
            else if (webFont.status == 2) "Loading"
            else if (webFont.status == 3) "Error"
        }
    }
}


转载:http://blog.chinaunix.net/uid-12664992-id-129935.html

阅读更多
个人分类: Qt
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭