Skip to content

Instantly share code, notes, and snippets.

@ultramcu
Created July 17, 2013 06:42
Show Gist options
  • Save ultramcu/6018152 to your computer and use it in GitHub Desktop.
Save ultramcu/6018152 to your computer and use it in GitHub Desktop.
QML FontLoader
/*
QML FontLoader
Author : MaIII Themd
Website : http://miiniq.blogspot.com
FB : http://www.facebook.com/PiShared
Env : Qt 5.0.2 clang 64 bit OSX 10.8.4
*/
import QtQuick 2.0
Rectangle {
width: 700
height: 300
color : "black";
FontLoader
{
id : my_font_1;
source: "./fonts/EHSMB.TTF"
}
FontLoader
{
id : my_font_2;
source: "./fonts/DS-DIGIT.TTF"
}
Text
{
id : txt_show_1
text : "http://miiniq.blogspot.com"
font.family: my_font_1.name;
font.pixelSize: 40;
anchors.horizontalCenter: parent.horizontalCenter;
anchors.top: parent.top;
anchors.topMargin: 80;
color : "#00FF00"
}
Text
{
id : txt_show_2
text : "http://miiniq.blogspot.com"
font.family: my_font_2.name;
font.pixelSize: 55;
anchors.horizontalCenter: parent.horizontalCenter;
anchors.top: txt_show_1.top;
anchors.topMargin: 80;
color : "#FF0000"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment