Skip to content

Commit

Permalink
Add Muli Font
Browse files Browse the repository at this point in the history
  • Loading branch information
Iktwo committed Sep 24, 2014
1 parent 8a98749 commit 086fafa
Show file tree
Hide file tree
Showing 15 changed files with 240 additions and 17 deletions.
46 changes: 46 additions & 0 deletions qml/AboutPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ Page {
color: Theme.mainTextColor
linkColor: color

font {
pixelSize: 16 * ScreenValues.dp
family: Theme.fontFamily
}

onLinkActivated: Qt.openUrlExternally(link)
}

Expand All @@ -71,6 +76,11 @@ Page {
color: Theme.mainTextColor
linkColor: color

font {
pixelSize: 16 * ScreenValues.dp
family: Theme.fontFamily
}

onLinkActivated: Qt.openUrlExternally(link)
}

Expand All @@ -82,6 +92,11 @@ Page {
color: Theme.mainTextColor
linkColor: color

font {
pixelSize: 16 * ScreenValues.dp
family: Theme.fontFamily
}

onLinkActivated: Qt.openUrlExternally(link)
}

Expand All @@ -93,6 +108,11 @@ Page {
color: Theme.mainTextColor
linkColor: color

font {
pixelSize: 16 * ScreenValues.dp
family: Theme.fontFamily
}

onLinkActivated: Qt.openUrlExternally(link)
}

Expand All @@ -109,6 +129,32 @@ Page {
color: Theme.mainTextColor
linkColor: color

font {
pixelSize: 16 * ScreenValues.dp
family: Theme.fontFamily
}

onLinkActivated: Qt.openUrlExternally(link)
}

Item {
height: ScreenValues.dp * 8
width: 1
}

Label {
width: parent.width
horizontalAlignment: "AlignHCenter"
wrapMode: "Wrap"
text: qsTr("Muli font by Vernon Adams <a href=\"http://scripts.sil.org/OFL\">SIL Open Font License, 1.1</a>")
color: Theme.mainTextColor
linkColor: color

font {
pixelSize: 16 * ScreenValues.dp
family: Theme.fontFamily
}

onLinkActivated: Qt.openUrlExternally(link)
}
}
Expand Down
12 changes: 10 additions & 2 deletions qml/FakeMainPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
Layout.fillWidth: true

font.pixelSize: ScreenValues.dp * 18
font {
pixelSize: 18 * ScreenValues.dp
family: Theme.fontFamily
}

color: Theme.mainTextColor
text: qsTr("This is your playlist. The music that you add will appear here. Also when you play music the media controls will appear at the bottom.")
renderType: Text.NativeRendering
Expand Down Expand Up @@ -209,7 +213,11 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
Layout.fillWidth: true

font.pixelSize: ScreenValues.dp * 18
font {
pixelSize: 18 * ScreenValues.dp
family: Theme.fontFamily
}

color: Theme.mainTextColor
text: qsTr("This is your playlist. The music that you add will appear here. Also when you play music the media controls will appear at the bottom.")
renderType: Text.NativeRendering
Expand Down
18 changes: 15 additions & 3 deletions qml/FakePlaybackControls.qml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ Rectangle {
verticalAlignment: "AlignVCenter"
text: "02:10"
renderType: Text.NativeRendering
font.pixelSize: 12 * ScreenValues.dp

font {
pixelSize: 12 * ScreenValues.dp
family: Theme.fontFamily
}
}

RowLayout {
Expand Down Expand Up @@ -104,7 +108,11 @@ Rectangle {
text: "04:14"
horizontalAlignment: "AlignRight"
renderType: Text.NativeRendering
font.pixelSize: 12 * ScreenValues.dp

font {
pixelSize: 12 * ScreenValues.dp
family: Theme.fontFamily
}
}
}
}
Expand All @@ -120,7 +128,11 @@ Rectangle {

color: Style.TEXT_COLOR_DARK
renderType: Text.NativeRendering
font.pixelSize: 14 * ScreenValues.dp

font {
pixelSize: 14 * ScreenValues.dp
family: Theme.fontFamily
}
}
}
}
5 changes: 4 additions & 1 deletion qml/FakeSearchPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ Page {

inputMethodHints: Qt.ImhNoPredictiveText
placeholderText: qsTr("Search songs and artists")
font.pointSize: 14
font {
pointSize: 14
family: Theme.fontFamily
}

onAccepted: root.search()

Expand Down
18 changes: 15 additions & 3 deletions qml/PlaybackControls.qml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ Rectangle {
verticalAlignment: "AlignVCenter"
text: formatMilliseconds(audioElement.position)
renderType: Text.NativeRendering
font.pixelSize: 12 * ScreenValues.dp

font {
pixelSize: 12 * ScreenValues.dp
family: Theme.fontFamily
}
}

RowLayout {
Expand Down Expand Up @@ -160,7 +164,11 @@ Rectangle {
text: formatMilliseconds(audioElement.duration)
horizontalAlignment: "AlignRight"
renderType: Text.NativeRendering
font.pixelSize: 12 * ScreenValues.dp

font {
pixelSize: 12 * ScreenValues.dp
family: Theme.fontFamily
}
}

Item {
Expand All @@ -179,7 +187,11 @@ Rectangle {
Layout.preferredWidth: parent.width - (16 * ScreenValues.dp)
color: Style.TEXT_COLOR_DARK
renderType: Text.NativeRendering
font.pixelSize: 14 * ScreenValues.dp

font {
pixelSize: 12 * ScreenValues.dp
family: Theme.fontFamily
}
}
}
}
12 changes: 10 additions & 2 deletions qml/SearchPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ Page {

inputMethodHints: Qt.ImhNoPredictiveText
placeholderText: qsTr("Search songs and artists")
font.pixelSize: 14 * ScreenValues.dp

font {
pixelSize: 14 * ScreenValues.dp
family: Theme.fontFamily
}

onAccepted: root.search()

Expand Down Expand Up @@ -277,8 +281,12 @@ Page {
property string name: ""

text: qsTr("Downloading") + "\n" + (name.length > 20 ? name.substring(0, 20) + "..." : name) + "\n" + Math.floor(progress * 100) + "%"
color: "white"

font.pointSize: 22
font {
pixelSize: 22 * ScreenValues.dp
family: Theme.fontFamily
}

wrapMode: Text.Wrap
horizontalAlignment: Text.AlignHCenter
Expand Down
21 changes: 17 additions & 4 deletions qml/SongDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ Item {
Label {
id: songName

font.pixelSize: 14 * ScreenValues.dp
font {
pixelSize: 14 * ScreenValues.dp
family: Theme.fontFamily
}

Layout.fillWidth: true
color: Style.TEXT_COLOR_DARK
Expand All @@ -81,7 +84,11 @@ Item {

Label {
Layout.fillWidth: true
font.pixelSize: 12 * ScreenValues.dp

font {
pixelSize: 12 * ScreenValues.dp
family: Theme.fontFamily
}

elide: Text.ElideRight
color: Style.TEXT_SECONDARY_COLOR_DARK
Expand All @@ -104,7 +111,10 @@ Item {

anchors.centerIn: parent

font.pixelSize: 12 * ScreenValues.dp
font {
pixelSize: 12 * ScreenValues.dp
family: Theme.fontFamily
}

color: Style.TEXT_COLOR_LIGHT
elide: Text.ElideRight
Expand All @@ -117,7 +127,10 @@ Item {

Label {
Layout.fillWidth: true
font.pixelSize: 12 * ScreenValues.dp
font {
pixelSize: 12 * ScreenValues.dp
family: Theme.fontFamily
}

elide: Text.ElideRight
color: Style.TEXT_SECONDARY_COLOR_DARK
Expand Down
10 changes: 8 additions & 2 deletions qml/TutorialPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ Page {
width: 0.8 * (isScreenPortrait ? parent.width : parent.height)

color: "#808080"
font.pixelSize: ScreenValues.dp * 24
font {
pixelSize: 24 * ScreenValues.dp
family: Theme.fontFamily
}
text: "Welcome to Musicgear"
wrapMode: Text.Wrap
horizontalAlignment: "AlignHCenter"
Expand Down Expand Up @@ -195,7 +198,10 @@ Page {
width: 0.8 * (isScreenPortrait ? parent.width : parent.height)

color: "#808080"
font.pixelSize: ScreenValues.dp * 12
font {
pixelSize: 12 * ScreenValues.dp
family: Theme.fontFamily
}
text: "Swipe up to begin"
wrapMode: Text.Wrap
horizontalAlignment: "AlignHCenter"
Expand Down
16 changes: 16 additions & 0 deletions qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@ ApplicationWindow {
width: resolutions[currentResolution]["width"]
height: resolutions[currentResolution]["height"]

FontLoader { source: "qrc:/fonts/Muli-Italic" }
FontLoader { source: "qrc:/fonts/Muli-Light" }
FontLoader { source: "qrc:/fonts/Muli-Light" }
FontLoader {
id: font

source: "qrc:/fonts/Muli-Regular"
onStatusChanged: {
if (status === FontLoader.Ready)
Theme.fontFamily = font.name
}
}

Rectangle {
id: background

Expand Down Expand Up @@ -205,6 +218,9 @@ ApplicationWindow {
if (ApplicationInfo.timesLaunched > 15 && Math.floor((now.getTime() - ApplicationInfo.firstTimeLaunched.getTime()) / 86400000) >= 5 && Qt.platform.os === "android") {
/// TODO: ANDROID - Show dialog and ask to review
}

if (font.status === FontLoader.Ready)
Theme.fontFamily = font.name
updateChecker.checkForUpdateOnGooglePlay()
}
}
6 changes: 6 additions & 0 deletions resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,10 @@
<file alias="settings">resources/images/drawable-xxxhdpi/settings.png</file>
<file alias="add_to_playlist">resources/images/drawable-xxxhdpi/add_to_playlist.png</file>
</qresource>
<qresource prefix="/fonts">
<file alias="Muli-Italic">resources/images/fonts/Muli-Italic.ttf</file>
<file alias="Muli-Light">resources/images/fonts/Muli-Light.ttf</file>
<file alias="Muli-LightItalic">resources/images/fonts/Muli-LightItalic.ttf</file>
<file alias="Muli-Regular">resources/images/fonts/Muli-Regular.ttf</file>
</qresource>
</RCC>
Binary file added resources/images/fonts/Muli-Italic.ttf
Binary file not shown.
Binary file added resources/images/fonts/Muli-Light.ttf
Binary file not shown.
Binary file added resources/images/fonts/Muli-LightItalic.ttf
Binary file not shown.
Binary file added resources/images/fonts/Muli-Regular.ttf
Binary file not shown.
Loading

0 comments on commit 086fafa

Please sign in to comment.