1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2025-01-31 02:01:19 +00:00

Font width is customizable. Introducing non squared pixels resolutions.

This commit is contained in:
Filippo Scognamiglio 2014-09-28 18:23:14 +02:00
parent 14ab8942af
commit a08c738a65
6 changed files with 22 additions and 16 deletions

View File

@ -120,6 +120,9 @@ Item{
property var fontScalingList: [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5]
property int fontScalingIndex: 5
property real fontWidth: 1.0
onFontWidthChanged: handleFontChanged();
function setScalingIndex(newScaling){
fontScalingIndex = newScaling;
fontScalingChanged();

View File

@ -32,13 +32,6 @@ Item{
ListModel{
id: fontlist
ListElement{
text: "Commodore PET 2Y (1977)"
source: "fonts/1977-commodore-pet/COMMODORE_PET_2y.ttf"
lineSpacing: 2
pixelSize: 16
baseScaling: 3.0
}
ListElement{
text: "Commodore PET (1977)"
source: "fonts/1977-commodore-pet/COMMODORE_PET.ttf"

View File

@ -32,13 +32,6 @@ Item{
ListModel{
id: fontlist
ListElement{
text: "Commodore PET 2Y (1977)"
source: "fonts/1977-commodore-pet/COMMODORE_PET_2y.ttf"
lineSpacing: 2
pixelSize: 16
baseScaling: 3.0
}
ListElement{
text: "Commodore PET (1977)"
source: "fonts/1977-commodore-pet/COMMODORE_PET.ttf"

View File

@ -104,7 +104,9 @@ Item{
font.pixelSize = pixelSize;
font.family = fontLoader.name;
width = Qt.binding(function() {return Math.floor(terminalContainer.width / screenScaling);});
var fontWidth = 1.0 / shadersettings.fontWidth;
width = Qt.binding(function() {return Math.floor(fontWidth * terminalContainer.width / screenScaling);});
height = Qt.binding(function() {return Math.floor(terminalContainer.height / screenScaling);});
setLineSpacing(lineSpacing);

View File

@ -87,6 +87,21 @@ Tab{
text: shadersettings.fontScalingList[scalingChanger.value].toFixed(2)
}
}
Text{ text: qsTr("Font Width") }
RowLayout{
Layout.fillWidth: true
Slider{
Layout.fillWidth: true
id: widthChanger
onValueChanged: shadersettings.fontWidth = value;
value: shadersettings.fontWidth
stepSize: 0.05
Component.onCompleted: minimumValue = 0.5 //Without this value gets set to 0.5
}
Text{
text: Math.round(widthChanger.value * 100) + "%"
}
}
}
}
GroupBox{

View File

@ -28,7 +28,7 @@ Window {
id: settings_window
title: qsTr("Settings")
width: 640
height: 450
height: 480
property int tabmargins: 15