1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

OP-1648 Embed PT-Sans fonts as Arial font replacement, should give same rendering in all systems

This commit is contained in:
Laurent Lalanne 2014-12-14 17:21:17 +01:00
parent 5dc739ec66
commit eeddcc902d
14 changed files with 91 additions and 45 deletions

View File

@ -45,7 +45,7 @@ Item {
text: altitude_scale.topNumber - index text: altitude_scale.topNumber - index
color: "white" color: "white"
font.pixelSize: parent.height / 3 font.pixelSize: parent.height / 3
font.family: "Arial" font.family: pt_bold.name
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.top anchors.verticalCenter: parent.top
@ -100,7 +100,7 @@ Item {
text: " " +altitude.toFixed(1) text: " " +altitude.toFixed(1)
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: parent.height * 0.35 pixelSize: parent.height * 0.35
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -125,7 +125,7 @@ Item {
text: qmlWidget.altitudeUnit text: qmlWidget.altitudeUnit
color: "cyan" color: "cyan"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: parent.height * 0.6 pixelSize: parent.height * 0.6
weight: Font.DemiBold weight: Font.DemiBold
} }

View File

@ -88,7 +88,7 @@ Item {
text: Math.floor(AttitudeState.Yaw).toFixed() text: Math.floor(AttitudeState.Yaw).toFixed()
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: parent.height * 1.2 pixelSize: parent.height * 1.2
} }
anchors.centerIn: parent anchors.centerIn: parent

View File

@ -105,7 +105,7 @@ Item {
text: ["NO GPS", "NO FIX", "FIX 2D", "FIX 3D"][GPSPositionSensor.Status] text: ["NO GPS", "NO FIX", "FIX 2D", "FIX 3D"][GPSPositionSensor.Status]
anchors.centerIn: parent anchors.centerIn: parent
font.pixelSize: Math.floor(parent.height*1.3) font.pixelSize: Math.floor(parent.height*1.3)
font.family: "Arial" font.family: pt_bold.name
font.weight: Font.DemiBold font.weight: Font.DemiBold
color: "white" color: "white"
} }
@ -138,7 +138,7 @@ Item {
color: "cyan" color: "cyan"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 1.5) pixelSize: Math.floor(parent.height * 1.5)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -159,7 +159,7 @@ Item {
color: "cyan" color: "cyan"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 1.5) pixelSize: Math.floor(parent.height * 1.5)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -182,7 +182,7 @@ Item {
color: "cyan" color: "cyan"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 1.5) pixelSize: Math.floor(parent.height * 1.5)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -208,7 +208,7 @@ Item {
color: "cyan" color: "cyan"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 1.5) pixelSize: Math.floor(parent.height * 1.5)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -229,7 +229,7 @@ Item {
color: "cyan" color: "cyan"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 1.5) pixelSize: Math.floor(parent.height * 1.5)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -251,7 +251,7 @@ Item {
color: "cyan" color: "cyan"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 1.5) pixelSize: Math.floor(parent.height * 1.5)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -307,7 +307,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 0.6) pixelSize: Math.floor(parent.height * 0.6)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -334,7 +334,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 0.6) pixelSize: Math.floor(parent.height * 0.6)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -368,7 +368,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 0.6) pixelSize: Math.floor(parent.height * 0.6)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -405,7 +405,7 @@ Item {
color: "cyan" color: "cyan"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 1) pixelSize: Math.floor(parent.height * 1)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -471,7 +471,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
color: "cyan" color: "cyan"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: parent.height * 1.2 pixelSize: parent.height * 1.2
} }
} }
@ -502,7 +502,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
color: "cyan" color: "cyan"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: parent.height * 1.2 pixelSize: parent.height * 1.2
} }
} }
@ -533,7 +533,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
color: "cyan" color: "cyan"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: parent.height * 1.2 pixelSize: parent.height * 1.2
} }
} }

View File

@ -404,7 +404,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 0.6) pixelSize: Math.floor(parent.height * 0.6)
} }
} }
@ -445,7 +445,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 0.6) pixelSize: Math.floor(parent.height * 0.6)
} }
} }
@ -490,7 +490,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 0.6) pixelSize: Math.floor(parent.height * 0.6)
} }
} }
@ -536,7 +536,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 0.6) pixelSize: Math.floor(parent.height * 0.6)
} }
} }
@ -809,7 +809,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 1.4) pixelSize: Math.floor(parent.height * 1.4)
weight: Font.DemiBold weight: Font.DemiBold
capitalization: Font.AllUppercase capitalization: Font.AllUppercase
@ -895,7 +895,7 @@ Item {
anchors.right: parent.right anchors.right: parent.right
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 1.4) pixelSize: Math.floor(parent.height * 1.4)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -928,7 +928,7 @@ Item {
anchors.right: parent.right anchors.right: parent.right
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 1.4) pixelSize: Math.floor(parent.height * 1.4)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -959,7 +959,7 @@ Item {
anchors.right: parent.right anchors.right: parent.right
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 1.4) pixelSize: Math.floor(parent.height * 1.4)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -990,7 +990,7 @@ Item {
anchors.right: parent.right anchors.right: parent.right
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 1.2) pixelSize: Math.floor(parent.height * 1.2)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -1021,7 +1021,7 @@ Item {
anchors.right: parent.right anchors.right: parent.right
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 1.4) pixelSize: Math.floor(parent.height * 1.4)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -1052,7 +1052,7 @@ Item {
anchors.right: parent.right anchors.right: parent.right
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 1.4) pixelSize: Math.floor(parent.height * 1.4)
weight: Font.DemiBold weight: Font.DemiBold
} }

View File

@ -24,6 +24,16 @@ Rectangle {
Item { Item {
id: sceneItem id: sceneItem
FontLoader {
id: pt_bold_narrow
source: "qrc:/pfdqml/fonts/PTN77F.ttf"
}
FontLoader {
id: pt_bold
source: "qrc:/pfdqml/fonts/PTS75F.ttf"
}
width: Math.floor((parent.paintedHeight * 1.32) - (parent.paintedHeight * 0.013)) width: Math.floor((parent.paintedHeight * 1.32) - (parent.paintedHeight * 0.013))
height: Math.floor(parent.paintedHeight - parent.paintedHeight * 0.02) height: Math.floor(parent.paintedHeight - parent.paintedHeight * 0.02)
property variant viewportSize : Qt.size(width, height) property variant viewportSize : Qt.size(width, height)

View File

@ -22,7 +22,7 @@ Item {
id: telemetry_rate id: telemetry_rate
text: GCSTelemetryStats.TxDataRate.toFixed()+"/"+GCSTelemetryStats.RxDataRate.toFixed() text: GCSTelemetryStats.TxDataRate.toFixed()+"/"+GCSTelemetryStats.RxDataRate.toFixed()
color: "white" color: "white"
font.family: "Arial" font.family: pt_bold.name
font.pixelSize: telemetry_status.height * 0.75 font.pixelSize: telemetry_status.height * 0.75
anchors.top: telemetry_status.bottom anchors.top: telemetry_status.bottom
@ -33,7 +33,7 @@ Item {
id: gps_text id: gps_text
text: "GPS: " + GPSPositionSensor.Satellites + "\nPDP: " + Math.round(GPSPositionSensor.PDOP*10)/10 text: "GPS: " + GPSPositionSensor.Satellites + "\nPDP: " + Math.round(GPSPositionSensor.PDOP*10)/10
color: "white" color: "white"
font.family: "Arial" font.family: pt_bold.name
font.pixelSize: telemetry_status.height * 0.75 font.pixelSize: telemetry_status.height * 0.75
visible: GPSPositionSensor.Satellites > 0 visible: GPSPositionSensor.Satellites > 0
@ -52,7 +52,7 @@ Item {
color: "white" color: "white"
font.family: "Arial" font.family: pt_bold.name
//I think it should be pixel size, //I think it should be pixel size,
//but making it more consistent with C++ version instead //but making it more consistent with C++ version instead

View File

@ -49,7 +49,7 @@ Item {
visible: speed_scale.topNumber - index >= 0 visible: speed_scale.topNumber - index >= 0
font.pixelSize: parent.height / 3 font.pixelSize: parent.height / 3
font.family: "Arial" font.family: pt_bold.name
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.top anchors.verticalCenter: parent.top
@ -90,7 +90,7 @@ Item {
text: sceneItem.groundSpeed.toFixed(1)+" " text: sceneItem.groundSpeed.toFixed(1)+" "
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: parent.height * 0.35 pixelSize: parent.height * 0.35
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -115,7 +115,7 @@ Item {
text: qmlWidget.speedUnit text: qmlWidget.speedUnit
color: "cyan" color: "cyan"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: parent.height * 0.6 pixelSize: parent.height * 0.6
weight: Font.DemiBold weight: Font.DemiBold
} }

View File

@ -86,7 +86,7 @@ Item {
text: qmlWidget.altitudeUnit == "m" ? "m/s" : "ft/s" text: qmlWidget.altitudeUnit == "m" ? "m/s" : "ft/s"
color: "cyan" color: "cyan"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: parent.height * 1.7 pixelSize: parent.height * 1.7
weight: Font.DemiBold weight: Font.DemiBold
} }

View File

@ -2,6 +2,7 @@ import QtQuick 2.0
Item { Item {
id: warnings id: warnings
property variant sceneSize property variant sceneSize
// Uninitialised, OK, Warning, Error, Critical // Uninitialised, OK, Warning, Error, Critical
property variant statusColors : ["gray", "green", "red", "red", "red"] property variant statusColors : ["gray", "green", "red", "red", "red"]
@ -70,7 +71,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
text: formatTime(time_h) + ":" + formatTime(time_m) + ":" + formatTime(time_s) text: formatTime(time_h) + ":" + formatTime(time_m) + ":" + formatTime(time_s)
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 0.8) pixelSize: Math.floor(parent.height * 0.8)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -95,7 +96,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
text: ["DISARMED","ARMING","ARMED"][FlightStatus.Armed] text: ["DISARMED","ARMING","ARMED"][FlightStatus.Armed]
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 0.74) pixelSize: Math.floor(parent.height * 0.74)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -120,7 +121,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
text: "RC INPUT" text: "RC INPUT"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 0.74) pixelSize: Math.floor(parent.height * 0.74)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -152,7 +153,7 @@ Item {
text: "MASTER CAUTION" text: "MASTER CAUTION"
color: "white" color: "white"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 0.74) pixelSize: Math.floor(parent.height * 0.74)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -177,7 +178,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
text: "AUTOPILOT" text: "AUTOPILOT"
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 0.74) pixelSize: Math.floor(parent.height * 0.74)
weight: Font.DemiBold weight: Font.DemiBold
} }
@ -203,9 +204,9 @@ Item {
text: ["MANUAL","STAB 1","STAB 2", "STAB 3", "STAB 4", "STAB 5", "STAB 6", "POS HOLD", "COURSELOCK", text: ["MANUAL","STAB 1","STAB 2", "STAB 3", "STAB 4", "STAB 5", "STAB 6", "POS HOLD", "COURSELOCK",
"POS ROAM", "HOME LEASH", "ABS POS", "RTB", "LAND", "PATHPLAN", "POI", "AUTOCRUISE"][FlightStatus.FlightMode] "POS ROAM", "HOME LEASH", "ABS POS", "RTB", "LAND", "PATHPLAN", "POI", "AUTOCRUISE"][FlightStatus.FlightMode]
font { font {
family: "Arial" family: pt_bold_narrow.name
pixelSize: Math.floor(parent.height * 0.74) pixelSize: Math.floor(parent.height * 0.8)
weight: Font.DemiBold weight: Font.Bold
} }
} }
} }
@ -232,7 +233,7 @@ Item {
text: ["MANUAL"," "," ", " ", " ", " ", " ", " ", text: ["MANUAL"," "," ", " ", " ", " ", " ", " ",
"ALT HOLD", "ALT VARIO", "CRUISECTRL", "AUTO"][thrust_mode.toString()] "ALT HOLD", "ALT VARIO", "CRUISECTRL", "AUTO"][thrust_mode.toString()]
font { font {
family: "Arial" family: pt_bold.name
pixelSize: Math.floor(parent.height * 0.74) pixelSize: Math.floor(parent.height * 0.74)
weight: Font.DemiBold weight: Font.DemiBold
} }

View File

@ -0,0 +1,6 @@
<RCC>
<qresource prefix="/pfdqml">
<file>fonts/PTN77F.ttf</file>
<file>fonts/PTS75F.ttf</file>
</qresource>
</RCC>

View File

@ -0,0 +1,26 @@
Copyright © 2009 ParaType Ltd.
with Reserved Names &amp;quot;PT Sans&amp;quot; and &amp;quot;ParaType&amp;quot;.
FONT LICENSE
PERMISSION &amp;amp; CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining a copy of the font software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the font software, subject to the following conditions:
1) Neither the font software nor any of its individual components, in original or modified versions, may be sold by itself.
2) Original or modified versions of the font software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
3) No modified version of the font software may use the Reserved Name(s) or combinations of Reserved Names with other words unless explicit written permission is granted by the ParaType. This restriction only applies to the primary font name as presented to the users.
4) The name of ParaType or the author(s) of the font software shall not be used to promote, endorse or advertise any modified version, except to acknowledge the contribution(s) of ParaType and the author(s) or with explicit written permission of ParaType.
5) The font software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
TERMINATION &amp;amp; TERRITORY
This license has no limits on time and territory, but it becomes null and void if any of the above conditions are not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL PARATYPE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
ParaType Ltd
http://www.paratype.ru

View File

@ -40,3 +40,6 @@ OTHER_FILES += PfdQml.pluginspec
FORMS += pfdqmlgadgetoptionspage.ui FORMS += pfdqmlgadgetoptionspage.ui
RESOURCES += \
PfdResources.qrc