mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-12 23:32:50 -04:00
fonts: native rendering + add settings to override renderType
fixes #2371
This commit is contained in:
@@ -11,6 +11,7 @@ Item {
|
||||
property real fill: filled ? 1.0 : 0.0
|
||||
property int grade: Theme.isLightMode ? 0 : -25
|
||||
property int weight: filled ? 500 : 400
|
||||
property bool smoothTransform: false
|
||||
|
||||
implicitWidth: Math.round(size)
|
||||
implicitHeight: Math.round(size)
|
||||
@@ -28,12 +29,13 @@ Item {
|
||||
anchors.fill: parent
|
||||
|
||||
font.family: materialSymbolsFont.name
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.pixelSize: Math.round(Theme.fontSizeMedium)
|
||||
font.weight: root.weight
|
||||
font.hintingPreference: Font.PreferNoHinting
|
||||
color: Theme.surfaceText
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
antialiasing: true
|
||||
renderType: root.smoothTransform ? Text.QtRendering : Text.NativeRendering
|
||||
|
||||
Behavior on color {
|
||||
enabled: Theme.currentAnimationSpeed !== SettingsData.AnimationSpeed.None
|
||||
|
||||
@@ -3,7 +3,6 @@ import qs.Common
|
||||
|
||||
Text {
|
||||
property bool isMonospace: false
|
||||
|
||||
FontLoader {
|
||||
id: interFont
|
||||
source: Qt.resolvedUrl("../assets/fonts/inter/InterVariable.ttf")
|
||||
@@ -24,6 +23,32 @@ Text {
|
||||
return requestedFont;
|
||||
}
|
||||
|
||||
readonly property int resolvedRenderType: {
|
||||
switch (SettingsData.textRenderType) {
|
||||
case SettingsData.TextRenderType.Qt:
|
||||
return Text.QtRendering;
|
||||
case SettingsData.TextRenderType.Curve:
|
||||
return Text.CurveRendering;
|
||||
default:
|
||||
return Text.NativeRendering;
|
||||
}
|
||||
}
|
||||
|
||||
readonly property int resolvedRenderQuality: {
|
||||
switch (SettingsData.textRenderQuality) {
|
||||
case SettingsData.TextRenderQuality.Low:
|
||||
return Text.LowRenderTypeQuality;
|
||||
case SettingsData.TextRenderQuality.Normal:
|
||||
return Text.NormalRenderTypeQuality;
|
||||
case SettingsData.TextRenderQuality.High:
|
||||
return Text.HighRenderTypeQuality;
|
||||
case SettingsData.TextRenderQuality.VeryHigh:
|
||||
return Text.VeryHighRenderTypeQuality;
|
||||
default:
|
||||
return Text.DefaultRenderTypeQuality;
|
||||
}
|
||||
}
|
||||
|
||||
readonly property var standardAnimation: {
|
||||
"duration": Appearance.anim.durations.normal,
|
||||
"easing.type": Easing.BezierSpline,
|
||||
@@ -37,7 +62,8 @@ Text {
|
||||
wrapMode: Text.WordWrap
|
||||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
//renderType: Text.NativeRendering
|
||||
renderType: resolvedRenderType
|
||||
renderTypeQuality: resolvedRenderQuality
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
|
||||
Reference in New Issue
Block a user