mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 16:02:51 -05:00
font re-work, change default to inter variable + fira code
This commit is contained in:
@@ -1,17 +1,34 @@
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
|
||||
Text {
|
||||
id: root
|
||||
|
||||
property bool isMonospace: false
|
||||
|
||||
color: Theme.surfaceText
|
||||
font.pixelSize: Appearance.fontSize.normal
|
||||
font.family: Prefs.fontFamily
|
||||
font.family: {
|
||||
var requestedFont = isMonospace ? Prefs.monoFontFamily : Prefs.fontFamily
|
||||
var defaultFont = isMonospace ? Prefs.defaultMonoFontFamily : Prefs.defaultFontFamily
|
||||
|
||||
// If user hasn't overridden the font and we're using the default
|
||||
if (requestedFont === defaultFont) {
|
||||
var availableFonts = Qt.fontFamilies()
|
||||
if (!availableFonts.includes(requestedFont)) {
|
||||
// Use system default
|
||||
return isMonospace ? "Monospace" : "DejaVu Sans"
|
||||
}
|
||||
}
|
||||
|
||||
// Either user overrode it, or default font is available
|
||||
return requestedFont
|
||||
}
|
||||
font.weight: Prefs.fontWeight
|
||||
wrapMode: Text.WordWrap
|
||||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
// Font rendering improvements for crisp text
|
||||
renderType: Text.NativeRendering
|
||||
textFormat: Text.PlainText
|
||||
antialiasing: true
|
||||
|
||||
Reference in New Issue
Block a user