分类:
2010-10-14 22:00:41
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.
Rectangle { width: 400; height: 200 FontLoader { id: webFont; source: "" } 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" } } }