1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2026-02-08 08:42:22 +00:00

39 Commits

Author SHA1 Message Date
Filippo Scognamiglio
77434e463e Fix github workflows. 2026-01-19 01:12:56 +01:00
Filippo Scognamiglio
6bcb54114d Update the readme to mention Qt6 instead of Qt5. 2026-01-19 00:50:13 +01:00
Filippo Scognamiglio
09f813a7e0 Fix terminal size not displayed when resizing. 2026-01-19 00:13:45 +01:00
Filippo Scognamiglio
a6a7768e42 Add version to build packages. 2026-01-19 00:13:15 +01:00
Filippo Scognamiglio
33878dae24 Bump QMLTermWidget version to 2.0. 2026-01-17 22:15:18 +01:00
Filippo Scognamiglio
0313a00b4f Move showMenuBar toggle inside advanced settings. 2026-01-17 22:09:29 +01:00
Filippo Scognamiglio
be4b1f366c Make version number dynamic. 2026-01-17 21:44:40 +01:00
Filippo Scognamiglio
c54dcb1c1c Add build script for macos dmgs. 2026-01-17 18:53:38 +01:00
Filippo Scognamiglio
5795aeb6b7 Fix fullscreen not tied to multiple windows. 2026-01-17 18:35:05 +01:00
Filippo Scognamiglio
e70268bb73 Make actions between the different menus global. 2026-01-17 17:20:37 +01:00
Filippo Scognamiglio
e72faa1d2c Set up appimage build. 2026-01-17 13:53:12 +01:00
Filippo Scognamiglio
e1fc767431 Some improvements to default themes and small cleanups. 2026-01-17 13:51:27 +01:00
Filippo Scognamiglio
737d289a19 Allow enabling and disabling italic. 2026-01-15 23:57:10 +01:00
Filippo Scognamiglio
a0a16fc300 Fix focus issue with multiple windows. Fix build issues with previous Qt versions. 2026-01-15 00:12:18 +01:00
Filippo Scognamiglio
f99ccf97dc Migrate all modern fonts to NerdFonts. Small UI improvements around. 2026-01-13 22:37:33 +01:00
Filippo Scognamiglio
2d2749cb20 Add a couple new fonts and smaller improvements all around. 2026-01-12 23:53:34 +01:00
Filippo Scognamiglio
471ec29f5d Get rid of unused wintitle feature. 2026-01-11 23:34:29 +01:00
Filippo Scognamiglio
56144f757d Allow creating a new tab from the top bar. Fix application title. 2026-01-11 21:19:35 +01:00
Filippo Scognamiglio
1c49b02763 Make sure settings are stored when the app is closed. 2026-01-11 19:44:57 +01:00
Filippo Scognamiglio
60784c47d9 Tentative implementation of font handling on cpp side. 2026-01-11 19:28:31 +01:00
Filippo Scognamiglio
bd89df3564 Fix empty font in certain conditions. 2026-01-10 19:15:35 +01:00
Filippo Scognamiglio
b4e1077cb1 Update default profiles and fix a bunch of smaller issues. 2026-01-10 18:44:06 +01:00
Filippo Scognamiglio
f518345430 Fix system fonts not working on macos. 2026-01-08 23:23:27 +01:00
Filippo Scognamiglio
f02c93c8c8 Add macos new window menu. 2026-01-08 22:54:28 +01:00
Filippo Scognamiglio
d10fe84c3a Fix many smaller issues. 2026-01-08 22:37:36 +01:00
Filippo Scognamiglio
e9c818242e Make sure focus is always taken when the current tab changes. 2026-01-08 10:29:33 +01:00
Filippo Scognamiglio
0bec01bfb4 Handle closing tabs and windows when shell process is terminated. 2026-01-07 23:19:49 +01:00
Filippo Scognamiglio
9abe78ce5f Move the kdsingleapplication file to the app.pro qmake file. 2026-01-06 18:52:21 +01:00
Filippo Scognamiglio
f809041f85 Change the single application library with a better one. 2026-01-06 18:43:28 +01:00
Filippo Scognamiglio
f58710c76f Use single instance application to handle multiple windows. 2026-01-05 09:38:51 +01:00
Filippo Scognamiglio
267b39bc9d Add multiple windows handling. 2026-01-04 23:03:20 +01:00
Filippo Scognamiglio
11ad932965 First implementation of tabs. 2026-01-04 19:24:43 +01:00
Filippo Scognamiglio
048cfcce81 Add configurable screen radius and make frame look a little bit better. 2026-01-04 16:54:43 +01:00
Filippo Scognamiglio
33adf4106f Fix missing application icon in linux. 2025-12-24 19:20:49 +01:00
Filippo Scognamiglio
a8ec5d6f16 Fix some bloom behaviour issues and simplify effects colorization. 2025-12-24 19:17:32 +01:00
Filippo Scognamiglio
384fb1da7c Use custom shader variant also for frame shininess. 2025-12-24 11:29:09 +01:00
Filippo Scognamiglio
8e44e0f41a Improve reflections rendering. 2025-12-23 23:00:33 +01:00
Filippo Scognamiglio
f851dd0a72 Create multiple shader variants for the various configurations. 2025-12-23 21:37:31 +01:00
Filippo Scognamiglio
7038c02173 Improved terminal frame. Improve size and shininess customization. 2025-12-23 12:16:18 +01:00
193 changed files with 3294 additions and 1713 deletions

View File

@@ -1,98 +0,0 @@
name: "ci"
on:
push:
tags: "**"
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
appimage:
runs-on: ubuntu-18.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
- name: Install dependencies
run: |
sudo add-apt-repository -y ppa:beineri/opt-qt-5.15.2-bionic
sudo apt-get update -qq
sudo apt-get install -y \
build-essential make wget libgl1-mesa-dev \
qt515declarative qt515graphicaleffects \
qt515quickcontrols qt515quickcontrols2
- name: Download QT appimage builder
run: |
wget -c -O linuxdeployqt.AppImage \
https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod a+x linuxdeployqt.AppImage
- name: Build project
run: |
source /opt/qt*/bin/qt*-env.sh && \
qmake -v && \
qmake CONFIG+=release PREFIX=/usr && \
make -j$(nproc)
- name: Install to appdir
run: |
source /opt/qt*/bin/qt*-env.sh && \
make INSTALL_ROOT=appdir -j$(nproc) install
- name: Extract version number
run: |
# Extract version for linuxdeployqt to name the file. Use the tag as
# release name but remove prefix.
echo "VERSION=$(echo '${{ github.ref }}' | sed 's;.*/;;')" >> $GITHUB_ENV
- name: Build appimage directory
run: |
mkdir -p \
appdir/usr/bin \
appdir/usr/lib \
appdir/usr/share/applications \
appdir/usr/share/metainfo \
appdir/usr/share/icons/hicolor/128x128/apps
cp cool-retro-term appdir/usr/bin/
cp cool-retro-term.desktop appdir/usr/share/applications/
cp packaging/appdata/cool-retro-term.appdata.xml appdir/usr/share/metainfo/
cp app/icons/128x128/cool-retro-term.png appdir/usr/share/icons/hicolor/128x128/apps/
cp -r ./app/qml appdir/usr/
# Workaround for https://github.com/probonopd/linuxdeployqt/issues/78
cp -r ./qmltermwidget/QMLTermWidget appdir/usr/qml/
find appdir | sort
- name: Build appimage
run: |
source /opt/qt*/bin/qt*-env.sh && \
./linuxdeployqt.AppImage appdir/usr/share/applications/cool-retro-term.desktop \
-verbose=1 -appimage \
-qmldir=./app/qml/ \
-qmldir=./qmltermwidget/
env:
# Unset environment variables
QTDIR:
QT_PLUGIN_PATH:
LD_LIBRARY_PATH:
- name: Upload release
uses: softprops/action-gh-release@v1
with:
body: appimage release
files: ./**/Cool_Retro_Term-*-x86_64.AppImage
- name: Clean up
if: always()
run: |
find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
make clean
rm -rf appdir

54
.github/workflows/build-appimage.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
name: Build AppImage
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
build-appimage:
name: Build (Linux, AppImage)
runs-on: ubuntu-22.04
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install build deps
run: |
sudo apt update
sudo apt install -y build-essential rsync wget
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.10.0
dir: ..
modules: qtshadertools
setup-python: false
cache: true
- name: Build AppImage
run: |
./scripts/build-appimage.sh
- name: Collect artifact
run: |
mkdir -p release
mv ./*.AppImage release/
- name: Attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: ./release/*
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cool-retro-term-appimage
path: ./release/*

50
.github/workflows/build-dmg.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: Build DMG
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
build-dmg:
name: Build (macOS, DMG)
runs-on: macos-14
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.10.*
modules: qtshadertools
setup-python: true
python-version: '3.11'
cache: true
- name: Build DMG
run: |
JOBS="$(sysctl -n hw.ncpu)"
./scripts/build-dmg.sh
- name: Collect artifact
run: |
mkdir -p release
mv ./*.dmg release/
- name: Attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: ./release/*
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cool-retro-term-dmg
path: ./release/*

6
.gitignore vendored
View File

@@ -41,11 +41,17 @@ Makefile*
*.json
# Excludes compiled files
imports
cool-retro-term
build
# Linux
*.AppImage
# Mac OSX
.DS_Store
*.app
*.dmg

3
.gitmodules vendored
View File

@@ -2,3 +2,6 @@
path = qmltermwidget
url = https://github.com/Swordfish90/qmltermwidget
branch = unstable
[submodule "KDSingleApplication"]
path = KDSingleApplication
url = https://github.com/KDAB/KDSingleApplication.git

View File

@@ -1,37 +0,0 @@
sudo: required
dist: trusty
language: c++
install:
- sudo add-apt-repository -y ppa:beineri/opt-qt58-trusty
- sudo apt-get update -qq
- sudo apt-get -y install build-essential qt58declarative qt58graphicaleffects qt58quickcontrols libgl1-mesa-dev
- source /opt/qt*/bin/qt*-env.sh
script:
- qmake CONFIG+=release PREFIX=/usr
- make -j$(nproc)
- mkdir -p appdir/usr/share/metainfo appdir/usr/bin
- cp packaging/appdata/cool-retro-term.appdata.xml appdir/usr/share/metainfo/
- cp cool-retro-term appdir/usr/bin/
- cp ./cool-retro-term.desktop appdir/
- cp ./app/icons/128x128/cool-retro-term.png appdir/
- cp -r ./app/qml appdir/usr/
- cp -r ./qmltermwidget/QMLTermWidget appdir/usr/qml/ # Workaround for https://github.com/probonopd/linuxdeployqt/issues/78
- wget -c https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
- chmod a+x linuxdeployqt-*.AppImage
- unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
- export VERSION=$(git rev-parse --short HEAD) # linuxdeployqt uses this for naming the file
- ./linuxdeployqt-*.AppImage appdir/usr/bin/cool-retro-term -qmldir=./app/qml/ -qmldir=./qmltermwidget/ # -verbose=3 2>&1 | grep "path:" -C 3
- ./linuxdeployqt-*.AppImage appdir/usr/bin/cool-retro-term -qmldir=./app/qml/ -qmldir=./qmltermwidget/ -verbose=2 -appimage
after_success:
- find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
- # curl --upload-file Cool*.AppImage https://transfer.sh/Cool_Retro_Term-git.$(git rev-parse --short HEAD)-x86_64.AppImage
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- bash upload.sh Cool*.AppImage*
branches:
except:
- # Do not build tags that we create when we upload to GitHub Releases
- /^(?i:continuous)/

1
KDSingleApplication Submodule

Submodule KDSingleApplication added at 1848dd64e8

View File

@@ -10,7 +10,7 @@ It has been designed to be eye-candy, customizable, and reasonably lightweight.
It uses the QML port of qtermwidget (Konsole): https://github.com/Swordfish90/qmltermwidget.
This terminal emulator works under Linux and macOS and requires Qt5. It's suggested that you stick to the latest LTS version.
This terminal emulator works under Linux and macOS and requires Qt6.
Settings such as colors, fonts, and effects can be accessed via context menu.

View File

@@ -1,15 +1,31 @@
QT += qml quick widgets sql quickcontrols2
TARGET = cool-retro-term
TARGET = cool-retro-term
APP_VERSION = $$system(git -C $$PWD/.. describe --tags --always --dirty=-dirty)
isEmpty(APP_VERSION): APP_VERSION = "unknown"
DEFINES += APP_VERSION=\\\"$$APP_VERSION\\\"
# TODO: When migrating to CMake, use KDSingleApplication's CMakeLists.txt instead of these manual sources.
INCLUDEPATH += $$PWD/../KDSingleApplication/src
HEADERS += \
$$PWD/../KDSingleApplication/src/kdsingleapplication.h \
$$PWD/../KDSingleApplication/src/kdsingleapplication_lib.h \
$$PWD/../KDSingleApplication/src/kdsingleapplication_localsocket_p.h
SOURCES += \
$$PWD/../KDSingleApplication/src/kdsingleapplication.cpp \
$$PWD/../KDSingleApplication/src/kdsingleapplication_localsocket.cpp
DEFINES += KDSINGLEAPPLICATION_STATIC_BUILD
DESTDIR = $$OUT_PWD/../
HEADERS += \
fileio.h \
monospacefontmanager.h
fontmanager.h \
fontlistmodel.h
SOURCES = main.cpp \
SOURCES += main.cpp \
fileio.cpp \
monospacefontmanager.cpp
fontmanager.cpp \
fontlistmodel.cpp
macx:ICON = icons/crt.icns
@@ -21,6 +37,9 @@ isEmpty(QSB_BIN): QSB_BIN = $$[QT_INSTALL_BINS]/qsb
SHADERS_DIR = $${_PRO_FILE_PWD_}/shaders
SHADERS += $$files($$SHADERS_DIR/*.frag) $$files($$SHADERS_DIR/*.vert)
SHADERS -= $$SHADERS_DIR/terminal_dynamic.frag
SHADERS -= $$SHADERS_DIR/terminal_static.frag
SHADERS -= $$SHADERS_DIR/passthrough.vert
qsb.input = SHADERS
qsb.output = ../../app/shaders/${QMAKE_FILE_NAME}.qsb
@@ -32,6 +51,49 @@ QMAKE_EXTRA_COMPILERS += qsb
PRE_TARGETDEPS += $$QSB_FILES
OTHER_FILES += $$SHADERS $$QSB_FILES
DYNAMIC_SHADER = $$SHADERS_DIR/terminal_dynamic.frag
STATIC_SHADER = $$SHADERS_DIR/terminal_static.frag
RASTER_MODES = 0 1 2 3 4
BINARY_FLAGS = 0 1
VARIANT_SHADER_DIR = $$relative_path($$PWD/shaders, $$OUT_PWD)
VARIANT_OUTPUTS =
for(raster_mode, RASTER_MODES) {
for(burn_in, BINARY_FLAGS) {
for(display_frame, BINARY_FLAGS) {
for(chroma_on, BINARY_FLAGS) {
dynamic_variant = terminal_dynamic_raster$${raster_mode}_burn$${burn_in}_frame$${display_frame}_chroma$${chroma_on}
dynamic_output = $${VARIANT_SHADER_DIR}/$${dynamic_variant}.frag.qsb
dynamic_target = shader_variant_$${dynamic_variant}
$${dynamic_target}.target = $${dynamic_output}
$${dynamic_target}.depends = $$DYNAMIC_SHADER
$${dynamic_target}.commands = $$QSB_BIN --glsl \"100 es,120,150\" --hlsl 50 --msl 12 --qt6 -DCRT_RASTER_MODE=$${raster_mode} -DCRT_BURN_IN=$${burn_in} -DCRT_DISPLAY_FRAME=$${display_frame} -DCRT_CHROMA=$${chroma_on} -o $${dynamic_output} $$DYNAMIC_SHADER
QMAKE_EXTRA_TARGETS += $${dynamic_target}
VARIANT_OUTPUTS += $${dynamic_output}
}
}
}
}
for(rgb_shift, BINARY_FLAGS) {
for(bloom_on, BINARY_FLAGS) {
for(curve_on, BINARY_FLAGS) {
for(shine_on, BINARY_FLAGS) {
static_variant = terminal_static_rgb$${rgb_shift}_bloom$${bloom_on}_curve$${curve_on}_shine$${shine_on}
static_output = $${VARIANT_SHADER_DIR}/$${static_variant}.frag.qsb
static_target = shader_variant_$${static_variant}
$${static_target}.target = $${static_output}
$${static_target}.depends = $$STATIC_SHADER
$${static_target}.commands = $$QSB_BIN --glsl \"100 es,120,150\" --hlsl 50 --msl 12 --qt6 -DCRT_RGB_SHIFT=$${rgb_shift} -DCRT_BLOOM=$${bloom_on} -DCRT_CURVATURE=$${curve_on} -DCRT_FRAME_SHININESS=$${shine_on} -o $${static_output} $$STATIC_SHADER
QMAKE_EXTRA_TARGETS += $${static_target}
VARIANT_OUTPUTS += $${static_output}
}
}
}
}
PRE_TARGETDEPS += $${VARIANT_OUTPUTS}
#########################################
## INTALLS
#########################################

94
app/fontlistmodel.cpp Normal file
View File

@@ -0,0 +1,94 @@
#include "fontlistmodel.h"
FontListModel::FontListModel(QObject *parent)
: QAbstractListModel(parent)
{
}
int FontListModel::rowCount(const QModelIndex &parent) const
{
if (parent.isValid()) {
return 0;
}
return m_fonts.size();
}
QVariant FontListModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid() || index.row() < 0 || index.row() >= m_fonts.size()) {
return QVariant();
}
const FontEntry &font = m_fonts.at(index.row());
switch (role) {
case NameRole:
return font.name;
case TextRole:
return font.text;
case SourceRole:
return font.source;
case BaseWidthRole:
return font.baseWidth;
case PixelSizeRole:
return font.pixelSize;
case LowResolutionRole:
return font.lowResolutionFont;
case IsSystemRole:
return font.isSystemFont;
case FamilyRole:
return font.family;
case FallbackNameRole:
return font.fallbackName;
default:
return QVariant();
}
}
QHash<int, QByteArray> FontListModel::roleNames() const
{
QHash<int, QByteArray> roles;
roles[NameRole] = "name";
roles[TextRole] = "text";
roles[SourceRole] = "source";
roles[BaseWidthRole] = "baseWidth";
roles[PixelSizeRole] = "pixelSize";
roles[LowResolutionRole] = "lowResolutionFont";
roles[IsSystemRole] = "isSystemFont";
roles[FamilyRole] = "family";
roles[FallbackNameRole] = "fallbackName";
return roles;
}
void FontListModel::setFonts(const QVector<FontEntry> &fonts)
{
beginResetModel();
m_fonts = fonts;
endResetModel();
emit countChanged();
}
const QVector<FontEntry> &FontListModel::fonts() const
{
return m_fonts;
}
QVariantMap FontListModel::get(int index) const
{
QVariantMap map;
if (index < 0 || index >= m_fonts.size()) {
return map;
}
const FontEntry &font = m_fonts.at(index);
map.insert("name", font.name);
map.insert("text", font.text);
map.insert("source", font.source);
map.insert("baseWidth", font.baseWidth);
map.insert("pixelSize", font.pixelSize);
map.insert("lowResolutionFont", font.lowResolutionFont);
map.insert("isSystemFont", font.isSystemFont);
map.insert("family", font.family);
map.insert("fallbackName", font.fallbackName);
return map;
}

59
app/fontlistmodel.h Normal file
View File

@@ -0,0 +1,59 @@
#ifndef FONTLISTMODEL_H
#define FONTLISTMODEL_H
#include <QAbstractListModel>
#include <QVector>
#include <QVariant>
#include <QVariantMap>
#include <QString>
struct FontEntry
{
QString name;
QString text;
QString source;
qreal baseWidth = 1.0;
int pixelSize = 0;
bool lowResolutionFont = false;
bool isSystemFont = false;
QString family;
QString fallbackName;
};
class FontListModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
public:
explicit FontListModel(QObject *parent = nullptr);
enum Roles {
NameRole = Qt::UserRole + 1,
TextRole,
SourceRole,
BaseWidthRole,
PixelSizeRole,
LowResolutionRole,
IsSystemRole,
FamilyRole,
FallbackNameRole
};
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role) const override;
QHash<int, QByteArray> roleNames() const override;
void setFonts(const QVector<FontEntry> &fonts);
const QVector<FontEntry> &fonts() const;
Q_INVOKABLE QVariantMap get(int index) const;
signals:
void countChanged();
private:
QVector<FontEntry> m_fonts;
};
#endif // FONTLISTMODEL_H

584
app/fontmanager.cpp Normal file
View File

@@ -0,0 +1,584 @@
#include "fontmanager.h"
#include <QFont>
#include <QFontDatabase>
#include <QFontMetricsF>
#include <QtGlobal>
#include <QtMath>
namespace {
constexpr int kModernRasterization = 4;
constexpr int kBaseFontPixelHeight = 32;
constexpr int kSystemFontPixelSize = 32;
}
FontManager::FontManager(QObject *parent)
: QObject(parent)
, m_fontListModel(this)
, m_filteredFontListModel(this)
{
populateBundledFonts();
populateSystemFonts();
m_fontListModel.setFonts(m_allFonts);
updateFilteredFonts();
updateComputedFont();
}
QStringList FontManager::retrieveMonospaceFonts()
{
QStringList result;
QFontDatabase fontDatabase;
const QStringList fontFamilies = fontDatabase.families();
for (const QString &fontFamily : fontFamilies) {
QFont font(fontFamily);
if (fontDatabase.isFixedPitch(font.family())) {
result.append(fontFamily);
}
}
return result;
}
void FontManager::refresh()
{
updateFilteredFonts();
updateComputedFont();
}
FontListModel *FontManager::fontList()
{
return &m_fontListModel;
}
FontListModel *FontManager::filteredFontList()
{
return &m_filteredFontListModel;
}
int FontManager::fontSource() const
{
return m_fontSource;
}
void FontManager::setFontSource(int fontSource)
{
if (m_fontSource == fontSource) {
return;
}
m_fontSource = fontSource;
emit fontSourceChanged();
updateFilteredFonts();
updateComputedFont();
}
int FontManager::rasterization() const
{
return m_rasterization;
}
void FontManager::setRasterization(int rasterization)
{
if (m_rasterization == rasterization) {
return;
}
m_rasterization = rasterization;
emit rasterizationChanged();
updateFilteredFonts();
updateComputedFont();
}
QString FontManager::fontName() const
{
return m_fontName;
}
void FontManager::setFontName(const QString &fontName)
{
if (m_fontName == fontName) {
return;
}
m_fontName = fontName;
emit fontNameChanged();
updateFilteredFonts();
updateComputedFont();
}
qreal FontManager::fontScaling() const
{
return m_fontScaling;
}
void FontManager::setFontScaling(qreal fontScaling)
{
if (qFuzzyCompare(m_fontScaling, fontScaling)) {
return;
}
m_fontScaling = fontScaling;
emit fontScalingChanged();
updateComputedFont();
}
qreal FontManager::fontWidth() const
{
return m_fontWidth;
}
void FontManager::setFontWidth(qreal fontWidth)
{
if (qFuzzyCompare(m_fontWidth, fontWidth)) {
return;
}
m_fontWidth = fontWidth;
emit fontWidthChanged();
updateComputedFont();
}
qreal FontManager::lineSpacing() const
{
return m_lineSpacing;
}
void FontManager::setLineSpacing(qreal lineSpacing)
{
if (qFuzzyCompare(m_lineSpacing, lineSpacing)) {
return;
}
m_lineSpacing = lineSpacing;
emit lineSpacingChanged();
updateComputedFont();
}
qreal FontManager::baseFontScaling() const
{
return m_baseFontScaling;
}
void FontManager::setBaseFontScaling(qreal baseFontScaling)
{
if (qFuzzyCompare(m_baseFontScaling, baseFontScaling)) {
return;
}
m_baseFontScaling = baseFontScaling;
emit baseFontScalingChanged();
updateComputedFont();
}
bool FontManager::lowResolutionFont() const
{
return m_lowResolutionFont;
}
void FontManager::setFontSubstitutions(const QString &family, const QStringList &substitutes)
{
if (family.isEmpty()) {
return;
}
QFont::removeSubstitutions(family);
if (substitutes.isEmpty()) {
return;
}
QFont::insertSubstitutions(family, substitutes);
}
void FontManager::removeFontSubstitution(const QString &family)
{
if (family.isEmpty()) {
return;
}
QFont::removeSubstitutions(family);
}
void FontManager::populateBundledFonts()
{
m_allFonts.clear();
addBundledFont(
"TERMINESS_SCALED",
"Terminess",
":/fonts/terminus/TerminessNerdFontMono-Regular.ttf",
1.0,
12,
true);
addBundledFont(
"BIGBLUE_TERMINAL_SCALED",
"BigBlue Terminal",
":/fonts/bigblue-terminal/BigBlueTerm437NerdFontMono-Regular.ttf",
1.0,
12,
true);
addBundledFont(
"EXCELSIOR_SCALED",
"Fixedsys Excelsior",
":/fonts/fixedsys-excelsior/FSEX301-L2.ttf",
1.0,
16,
true,
"UNSCII_16_SCALED");
addBundledFont(
"GREYBEARD_SCALED",
"Greybeard",
":/fonts/greybeard/Greybeard-16px.ttf",
1.0,
16,
true,
"UNSCII_16_SCALED");
addBundledFont(
"COMMODORE_PET_SCALED",
"Commodore PET",
":/fonts/pet-me/PetMe.ttf",
0.5,
8,
true,
"UNSCII_8_SCALED");
addBundledFont(
"GOHU_11_SCALED",
"Gohu 11",
":/fonts/gohu/GohuFont11NerdFontMono-Regular.ttf",
1.0,
11,
true);
addBundledFont(
"COZETTE_SCALED",
"Cozette",
":/fonts/cozette/CozetteVector.ttf",
1.0,
13,
true);
addBundledFont(
"UNSCII_8_SCALED",
"Unscii 8",
":/fonts/unscii/unscii-8.ttf",
0.5,
8,
true,
"UNSCII_8_SCALED");
addBundledFont(
"UNSCII_8_THIN_SCALED",
"Unscii 8 Thin",
":/fonts/unscii/unscii-8-thin.ttf",
0.5,
8,
true,
"UNSCII_8_SCALED");
addBundledFont(
"UNSCII_16_SCALED",
"Unscii 16",
":/fonts/unscii/unscii-16-full.ttf",
1.0,
16,
true,
"UNSCII_16_SCALED");
addBundledFont(
"APPLE_II_SCALED",
"Apple ][",
":/fonts/apple2/PrintChar21.ttf",
0.5,
8,
true,
"UNSCII_8_SCALED");
addBundledFont(
"ATARI_400_SCALED",
"Atari 400-800",
":/fonts/atari-400-800/AtariClassic-Regular.ttf",
0.5,
8,
true,
"UNSCII_8_SCALED");
addBundledFont(
"COMMODORE_64_SCALED",
"Commodore 64",
":/fonts/pet-me/PetMe64.ttf",
0.5,
8,
true,
"UNSCII_8_SCALED");
addBundledFont(
"IBM_EGA_8x8",
"IBM EGA 8x8",
":/fonts/oldschool-pc-fonts/PxPlus_IBM_EGA_8x8.ttf",
0.5,
8,
true,
"UNSCII_8_SCALED");
addBundledFont(
"IBM_VGA_8x16",
"IBM VGA 8x16",
":/fonts/oldschool-pc-fonts/PxPlus_IBM_VGA_8x16.ttf",
1.0,
16,
true,
"UNSCII_16_SCALED");
addBundledFont(
"TERMINESS",
"Terminess",
":/fonts/terminus/TerminessNerdFontMono-Regular.ttf",
1.0,
32,
false);
addBundledFont(
"HACK",
"Hack",
":/fonts/hack/HackNerdFontMono-Regular.ttf",
1.0,
32,
false);
addBundledFont(
"FIRA_CODE",
"Fira Code",
":/fonts/fira-code/FiraCodeNerdFontMono-Regular.ttf",
1.0,
32,
false);
addBundledFont(
"IOSEVKA",
"Iosevka",
":/fonts/iosevka/IosevkaTermNerdFontMono-Regular.ttf",
1.0,
32,
false);
addBundledFont(
"JETBRAINS_MONO",
"JetBrains Mono",
":/fonts/jetbrains-mono/JetBrainsMonoNerdFontMono-Regular.ttf",
1.0,
32,
false);
addBundledFont(
"IBM_3278",
"IBM 3278",
":/fonts/ibm-3278/3270NerdFontMono-Regular.ttf",
1.0,
32,
false);
addBundledFont(
"SOURCE_CODE_PRO",
"Source Code Pro",
":/fonts/source-code-pro/SauceCodeProNerdFontMono-Regular.ttf",
1.0,
32,
false);
addBundledFont(
"DEPARTURE_MONO_SCALED",
"Departure Mono",
":/fonts/departure-mono/DepartureMonoNerdFontMono-Regular.otf",
1.0,
11,
true);
addBundledFont(
"OPENDYSLEXIC",
"OpenDyslexic",
":/fonts/opendyslexic/OpenDyslexicMNerdFontMono-Regular.otf",
1.0,
32,
false);
}
void FontManager::addBundledFont(const QString &name,
const QString &text,
const QString &source,
qreal baseWidth,
int pixelSize,
bool lowResolutionFont,
const QString &fallbackName)
{
FontEntry entry;
entry.name = name;
entry.text = text;
entry.source = source;
entry.pixelSize = pixelSize;
entry.lowResolutionFont = lowResolutionFont;
entry.isSystemFont = false;
entry.fallbackName = fallbackName;
entry.family = resolveFontFamily(source);
entry.baseWidth = lowResolutionFont
? computeBaseWidth(entry.family, pixelSize, baseWidth)
: baseWidth;
m_allFonts.append(entry);
}
void FontManager::populateSystemFonts()
{
const QStringList families = retrieveMonospaceFonts();
for (const QString &family : families) {
if (m_bundledFamilies.contains(family)) {
continue;
}
FontEntry entry;
entry.name = family;
entry.text = family;
entry.source = QString();
entry.baseWidth = 1.0;
entry.pixelSize = kSystemFontPixelSize;
entry.lowResolutionFont = false;
entry.isSystemFont = true;
entry.family = family;
m_allFonts.append(entry);
}
}
void FontManager::updateFilteredFonts()
{
QVector<FontEntry> filtered;
bool fontNameFound = false;
const bool modernMode = (m_rasterization == kModernRasterization);
for (const FontEntry &font : m_allFonts) {
const bool isBundled = !font.isSystemFont;
const bool matchesSource = (m_fontSource == 0 && isBundled)
|| (m_fontSource == 1 && font.isSystemFont);
if (!matchesSource) {
continue;
}
const bool matchesRasterization = font.isSystemFont
|| (modernMode == !font.lowResolutionFont);
if (!matchesRasterization) {
continue;
}
filtered.append(font);
if (font.name == m_fontName) {
fontNameFound = true;
}
}
if (!fontNameFound && !filtered.isEmpty()) {
if (m_fontName != filtered.first().name) {
m_fontName = filtered.first().name;
emit fontNameChanged();
}
}
m_filteredFontListModel.setFonts(filtered);
emit filteredFontListChanged();
}
void FontManager::updateComputedFont()
{
const FontEntry *font = findFontByName(m_fontName);
if (!font) {
const QVector<FontEntry> &filteredFonts = m_filteredFontListModel.fonts();
if (!filteredFonts.isEmpty()) {
font = &filteredFonts.first();
}
}
if (!font) {
return;
}
const qreal totalFontScaling = m_baseFontScaling * m_fontScaling;
const qreal targetPixelHeight = kBaseFontPixelHeight * totalFontScaling;
const qreal lineSpacingFactor = m_lineSpacing;
const int lineSpacing = qRound(targetPixelHeight * lineSpacingFactor);
const int pixelSize = font->lowResolutionFont
? font->pixelSize
: static_cast<int>(targetPixelHeight);
const qreal nativeLineHeight = font->pixelSize + qRound(font->pixelSize * lineSpacingFactor);
const qreal targetLineHeight = targetPixelHeight + lineSpacing;
const qreal screenScaling = font->lowResolutionFont
? (nativeLineHeight > 0 ? targetLineHeight / nativeLineHeight : 1.0)
: 1.0;
const qreal fontWidth = font->baseWidth * m_fontWidth;
QString fontFamily = font->family.isEmpty() ? font->name : font->family;
QString fallbackFontFamily;
if (!font->fallbackName.isEmpty() && font->fallbackName != font->name) {
const FontEntry *fallback = findFontByName(font->fallbackName);
if (fallback) {
fallbackFontFamily = fallback->family.isEmpty() ? fallback->name : fallback->family;
}
}
QStringList fallbackChain;
if (!fallbackFontFamily.isEmpty()) {
fallbackChain.append(fallbackFontFamily);
}
#if defined(Q_OS_MAC)
fallbackChain.append(QStringLiteral("Menlo"));
#else
fallbackChain.append(QStringLiteral("Monospace"));
#endif
setFontSubstitutions(fontFamily, fallbackChain);
if (m_lowResolutionFont != font->lowResolutionFont) {
m_lowResolutionFont = font->lowResolutionFont;
emit lowResolutionFontChanged();
}
emit terminalFontChanged(fontFamily,
pixelSize,
lineSpacing,
screenScaling,
fontWidth,
fallbackFontFamily,
font->lowResolutionFont);
}
const FontEntry *FontManager::findFontByName(const QString &name) const
{
for (const FontEntry &font : m_allFonts) {
if (font.name == name) {
return &font;
}
}
return nullptr;
}
QString FontManager::resolveFontFamily(const QString &sourcePath)
{
const auto cached = m_loadedFamilies.constFind(sourcePath);
if (cached != m_loadedFamilies.constEnd()) {
return cached.value();
}
const int fontId = QFontDatabase::addApplicationFont(sourcePath);
QString family;
if (fontId != -1) {
const QStringList families = QFontDatabase::applicationFontFamilies(fontId);
if (!families.isEmpty()) {
family = families.first();
}
}
if (!family.isEmpty()) {
m_bundledFamilies.insert(family);
}
m_loadedFamilies.insert(sourcePath, family);
return family;
}
qreal FontManager::computeBaseWidth(const QString &family, int pixelSize, qreal fallbackWidth) const
{
if (family.isEmpty()) {
return fallbackWidth;
}
QFont font(family);
font.setPixelSize(pixelSize);
QFontMetricsF metrics(font);
const qreal glyphWidth = metrics.horizontalAdvance(QLatin1String("M"));
const qreal glyphHeight = metrics.height();
if (glyphWidth <= 0.0 || glyphHeight <= 0.0) {
return fallbackWidth;
}
const qreal targetRatio = 0.5;
qreal computedWidth = (targetRatio * glyphHeight) / glyphWidth;
return qBound(0.25, computedWidth, 2.0);
}

111
app/fontmanager.h Normal file
View File

@@ -0,0 +1,111 @@
#ifndef FONTMANAGER_H
#define FONTMANAGER_H
#include <QObject>
#include <QStringList>
#include <QHash>
#include <QSet>
#include "fontlistmodel.h"
class FontManager : public QObject
{
Q_OBJECT
Q_PROPERTY(FontListModel *fontList READ fontList CONSTANT)
Q_PROPERTY(FontListModel *filteredFontList READ filteredFontList NOTIFY filteredFontListChanged)
Q_PROPERTY(int fontSource READ fontSource WRITE setFontSource NOTIFY fontSourceChanged)
Q_PROPERTY(int rasterization READ rasterization WRITE setRasterization NOTIFY rasterizationChanged)
Q_PROPERTY(QString fontName READ fontName WRITE setFontName NOTIFY fontNameChanged)
Q_PROPERTY(qreal fontScaling READ fontScaling WRITE setFontScaling NOTIFY fontScalingChanged)
Q_PROPERTY(qreal fontWidth READ fontWidth WRITE setFontWidth NOTIFY fontWidthChanged)
Q_PROPERTY(qreal lineSpacing READ lineSpacing WRITE setLineSpacing NOTIFY lineSpacingChanged)
Q_PROPERTY(qreal baseFontScaling READ baseFontScaling WRITE setBaseFontScaling NOTIFY baseFontScalingChanged)
Q_PROPERTY(bool lowResolutionFont READ lowResolutionFont NOTIFY lowResolutionFontChanged)
public:
explicit FontManager(QObject *parent = nullptr);
Q_INVOKABLE void refresh();
FontListModel *fontList();
FontListModel *filteredFontList();
int fontSource() const;
void setFontSource(int fontSource);
int rasterization() const;
void setRasterization(int rasterization);
QString fontName() const;
void setFontName(const QString &fontName);
qreal fontScaling() const;
void setFontScaling(qreal fontScaling);
qreal fontWidth() const;
void setFontWidth(qreal fontWidth);
qreal lineSpacing() const;
void setLineSpacing(qreal lineSpacing);
qreal baseFontScaling() const;
void setBaseFontScaling(qreal baseFontScaling);
bool lowResolutionFont() const;
signals:
void fontSourceChanged();
void rasterizationChanged();
void fontNameChanged();
void fontScalingChanged();
void fontWidthChanged();
void lineSpacingChanged();
void baseFontScalingChanged();
void lowResolutionFontChanged();
void filteredFontListChanged();
void terminalFontChanged(QString fontFamily,
int pixelSize,
int lineSpacing,
qreal screenScaling,
qreal fontWidth,
QString fallbackFontFamily,
bool lowResolutionFont);
private:
QStringList retrieveMonospaceFonts();
void populateBundledFonts();
void populateSystemFonts();
void addBundledFont(const QString &name,
const QString &text,
const QString &source,
qreal baseWidth,
int pixelSize,
bool lowResolutionFont,
const QString &fallbackName = QString());
void setFontSubstitutions(const QString &family, const QStringList &substitutes);
void removeFontSubstitution(const QString &family);
void updateFilteredFonts();
void updateComputedFont();
const FontEntry *findFontByName(const QString &name) const;
QString resolveFontFamily(const QString &sourcePath);
qreal computeBaseWidth(const QString &family, int pixelSize, qreal fallbackWidth) const;
FontListModel m_fontListModel;
FontListModel m_filteredFontListModel;
QVector<FontEntry> m_allFonts;
int m_fontSource = 0;
int m_rasterization = 0;
QString m_fontName = QStringLiteral("TERMINESS_SCALED");
qreal m_fontScaling = 1.0;
qreal m_fontWidth = 1.0;
qreal m_lineSpacing = 0.1;
qreal m_baseFontScaling = 0.75;
bool m_lowResolutionFont = false;
QHash<QString, QString> m_loadedFamilies;
QSet<QString> m_bundledFamilies;
};
#endif // FONTMANAGER_H

View File

@@ -7,19 +7,23 @@
#include <QtWidgets/QApplication>
#include <QIcon>
#include <QQuickStyle>
#include <QtQml/qqml.h>
#include <kdsingleapplication.h>
#include <QDebug>
#include <stdlib.h>
#include <QFontDatabase>
#include <QLoggingCategory>
#include <fileio.h>
#include <monospacefontmanager.h>
#include <fontlistmodel.h>
#include <fontmanager.h>
#if defined(Q_OS_MAC)
#include <CoreFoundation/CoreFoundation.h>
#include <QStyleFactory>
#include <QMenu>
#endif
QString getNamedArgument(QStringList args, QString name, QString defaultName)
@@ -62,7 +66,6 @@ int main(int argc, char *argv[])
cout << " --default-settings Run cool-retro-term with the default settings" << Qt::endl;
cout << " --workdir <dir> Change working directory to 'dir'" << Qt::endl;
cout << " -e <cmd> Command to execute. This option will catch all following arguments, so use it as the last option." << Qt::endl;
cout << " -T <title> Set window title to 'title'." << Qt::endl;
cout << " --fullscreen Run cool-retro-term in fullscreen." << Qt::endl;
cout << " -p|--profile <prof> Run cool-retro-term with the given profile." << Qt::endl;
cout << " -h|--help Print this help." << Qt::endl;
@@ -70,7 +73,7 @@ int main(int argc, char *argv[])
return 0;
}
QString appVersion("1.2.0");
QString appVersion(QStringLiteral(APP_VERSION));
if (argc>1 && (!strcmp(argv[1],"-v") || !strcmp(argv[1],"--version"))) {
QTextStream cout(stdout, QIODevice::WriteOnly);
@@ -80,20 +83,34 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
app.setAttribute(Qt::AA_MacDontSwapCtrlAndMeta, true);
app.setApplicationName(QStringLiteral("cool-retro-term"));
app.setOrganizationName(QStringLiteral("cool-retro-term"));
app.setOrganizationDomain(QStringLiteral("cool-retro-term"));
app.setApplicationVersion(appVersion);
KDSingleApplication singleApp(QStringLiteral("cool-retro-term"));
if (!singleApp.isPrimaryInstance()) {
if (singleApp.sendMessage("new-window"))
return 0;
qWarning() << "KDSingleApplication: primary not reachable, continuing as independent instance.";
}
QQmlApplicationEngine engine;
FileIO fileIO;
MonospaceFontManager monospaceFontManager;
qmlRegisterType<FontManager>("CoolRetroTerm", 1, 0, "FontManager");
qmlRegisterUncreatableType<FontListModel>("CoolRetroTerm", 1, 0, "FontListModel", "FontListModel is created by FontManager");
#if !defined(Q_OS_MAC)
app.setWindowIcon(QIcon::fromTheme("cool-retro-term", QIcon(":../icons/32x32/cool-retro-term.png")));
#if defined(Q_OS_LINUX)
QGuiApplication::setDesktopFileName(QStringLiteral("cool-retro-term"));
#endif
#else
app.setWindowIcon(QIcon(":../icons/32x32/cool-retro-term.png"));
#endif
app.setOrganizationName("cool-retro-term");
app.setOrganizationDomain("cool-retro-term");
// Manage command line arguments from the cpp side
QStringList args = app.arguments();
@@ -110,16 +127,12 @@ int main(int argc, char *argv[])
engine.rootContext()->setContextProperty("workdir", getNamedArgument(args, "--workdir", "$HOME"));
engine.rootContext()->setContextProperty("fileIO", &fileIO);
engine.rootContext()->setContextProperty("monospaceFontManager", &monospaceFontManager);
engine.rootContext()->setContextProperty("monospaceSystemFonts", monospaceFontManager.retrieveMonospaceFonts());
engine.rootContext()->setContextProperty("devicePixelRatio", app.devicePixelRatio());
// Manage import paths for Linux and OSX.
QStringList importPathList = engine.importPathList();
importPathList.prepend(QCoreApplication::applicationDirPath() + "/qmltermwidget");
importPathList.prepend(QCoreApplication::applicationDirPath() + "/../PlugIns");
importPathList.prepend(QCoreApplication::applicationDirPath() + "/../../../qmltermwidget");
importPathList.append(QCoreApplication::applicationDirPath() + "/qmltermwidget");
importPathList.append(QCoreApplication::applicationDirPath() + "/../PlugIns");
importPathList.append(QCoreApplication::applicationDirPath() + "/../../../qmltermwidget");
engine.setImportPathList(importPathList);
engine.load(QUrl(QStringLiteral ("qrc:/main.qml")));
@@ -132,5 +145,25 @@ int main(int argc, char *argv[])
// Quit the application when the engine closes.
QObject::connect((QObject*) &engine, SIGNAL(quit()), (QObject*) &app, SLOT(quit()));
auto requestNewWindow = [&engine]() {
if (engine.rootObjects().isEmpty())
return;
QObject *rootObject = engine.rootObjects().constFirst();
QMetaObject::invokeMethod(rootObject, "createWindow", Qt::QueuedConnection);
};
QObject::connect(&singleApp, &KDSingleApplication::messageReceived, &app,
[&requestNewWindow](const QByteArray &message) {
if (message.isEmpty() || message == QByteArray("new-window"))
requestNewWindow();
});
#if defined(Q_OS_MAC)
QMenu *dockMenu = new QMenu(nullptr);
dockMenu->addAction(QObject::tr("New Window"), [&requestNewWindow]() { requestNewWindow(); });
dockMenu->setAsDockMenu();
#endif
return app.exec();
}

View File

@@ -1,50 +0,0 @@
#include "monospacefontmanager.h"
#include <QDebug>
#include <QFont>
MonospaceFontManager::MonospaceFontManager(QObject *parent) : QObject(parent)
{
}
QStringList MonospaceFontManager::retrieveMonospaceFonts() {
QStringList result;
QFontDatabase fontDatabase;
QStringList fontFamilies = fontDatabase.families();
for (int i = 0; i < fontFamilies.size(); i++) {
QString fontFamily = fontFamilies[i];
QFont font(fontFamily);
if (fontDatabase.isFixedPitch(font.family())) {
result.append(fontFamily);
}
}
return result;
}
void MonospaceFontManager::setFontSubstitutions(const QString &family, const QStringList &substitutes)
{
if (family.isEmpty()) {
return;
}
QFont::removeSubstitutions(family);
if (substitutes.isEmpty()) {
return;
}
QFont::insertSubstitutions(family, substitutes);
}
void MonospaceFontManager::removeFontSubstitution(const QString &family)
{
if (family.isEmpty()) {
return;
}
QFont::removeSubstitutions(family);
}

View File

@@ -1,20 +0,0 @@
#ifndef MONOSPACEFONTMANAGER_H
#define MONOSPACEFONTMANAGER_H
#include <QObject>
#include <QFontDatabase>
#include <QStringList>
class MonospaceFontManager : public QObject
{
Q_OBJECT
public:
explicit MonospaceFontManager(QObject *parent = nullptr);
Q_INVOKABLE QStringList retrieveMonospaceFonts();
public slots:
Q_INVOKABLE void setFontSubstitutions(const QString &family, const QStringList &substitutes);
void removeFontSubstitution(const QString &family);
};
#endif // MONOSPACEFONTMANAGER_H

View File

@@ -28,8 +28,6 @@ ApplicationWindow {
width: 600
height: 400
modality: Qt.ApplicationModal
ColumnLayout {
anchors.fill: parent
anchors.margins: 15

View File

@@ -19,6 +19,7 @@
*******************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 2.0
import CoolRetroTerm 1.0
import "utils.js" as Utils
@@ -27,7 +28,7 @@ QtObject {
readonly property int profileVersion: 2
// STATIC CONSTANTS ////////////////////////////////////////////////////////
readonly property real screenCurvatureSize: 0.4
readonly property real screenCurvatureSize: 0.6
readonly property real minimumFontScaling: 0.25
readonly property real maximumFontScaling: 2.50
@@ -39,20 +40,12 @@ QtObject {
property bool isMacOS: Qt.platform.os === "osx"
// GENERAL SETTINGS ///////////////////////////////////////////////////////
property int x: 100
property int y: 100
property int width: 1024
property int height: 768
property bool fullscreen: false
property bool showMenubar: false
property string wintitle: "cool-retro-term"
property bool showTerminalSize: true
property real windowScaling: 1.0
property int effectsFrameSkip: 2
property int effectsFrameSkip: 3
property bool verbose: false
property real bloomQuality: 0.5
@@ -60,7 +53,6 @@ QtObject {
property bool blinkingCursor: false
onWindowScalingChanged: updateFont()
// PROFILE SETTINGS ///////////////////////////////////////////////////////
property real windowOpacity: 1.0
@@ -73,16 +65,11 @@ QtObject {
property string _backgroundColor: "#000000"
property string _fontColor: "#ff8100"
property string saturatedColor: Utils.mix(Utils.strToColor("#FFFFFF"),
Utils.strToColor(_fontColor),
saturationColor * 0.5)
property color fontColor: Utils.mix(Utils.strToColor(saturatedColor),
Utils.strToColor(_backgroundColor),
0.7 + (contrast * 0.3))
property color backgroundColor: Utils.mix(Utils.strToColor(
_backgroundColor),
Utils.strToColor(saturatedColor),
0.7 + (contrast * 0.3))
property string _frameColor: "#ffffff"
property string saturatedColor: Utils.mix(Utils.strToColor(_fontColor), Utils.strToColor("#FFFFFF"), (saturationColor * 0.5))
property color fontColor: Utils.mix(Utils.strToColor(_backgroundColor), Utils.strToColor(saturatedColor), (0.7 + (contrast * 0.3)))
property color backgroundColor: Utils.mix(Utils.strToColor(saturatedColor), Utils.strToColor(_backgroundColor), (0.7 + (contrast * 0.3)))
property color frameColor: Utils.strToColor(_frameColor)
property real staticNoise: 0.12
property real screenCurvature: 0.3
@@ -98,15 +85,21 @@ QtObject {
property real horizontalSync: 0.08
property real flickering: 0.1
property real rbgShift: 0.0
property real rgbShift: 0.0
property real _frameShininess: 0.2
property real frameShininess: _frameShininess * 0.5
property real _frameSize: 0.2
property real frameSize: _frameSize * 0.05
property real _screenRadius: 0.2
property real screenRadius: Utils.lint(4.0, 120.0, _screenRadius)
property real _margin: 0.5
property real _frameMargin: 0.5
property real margin: Utils.lint(1.0, 40.0, _margin) + (1.0 - Math.SQRT1_2) * screenRadius
property real margin: Utils.lint(1.0, 20.0, _margin)
property real frameMargin: Utils.lint(1.0, 50.0, _frameMargin)
property real totalMargin: frameMargin + margin
readonly property bool frameEnabled: ambientLight > 0 || _frameSize > 0 || screenCurvature > 0
readonly property int no_rasterization: 0
readonly property int scanline_rasterization: 1
@@ -114,132 +107,33 @@ QtObject {
readonly property int subpixel_rasterization: 3
readonly property int modern_rasterization: 4
property int rasterization: no_rasterization
property alias rasterization: fontManager.rasterization
readonly property int bundled_fonts: 0
readonly property int system_fonts: 1
property int fontSource: bundled_fonts
property alias fontSource: fontManager.fontSource
// FONTS //////////////////////////////////////////////////////////////////
readonly property real baseFontScaling: 0.75
property real fontScaling: 1.0
property alias fontScaling: fontManager.fontScaling
property real totalFontScaling: baseFontScaling * fontScaling
property real fontWidth: 1.0
property real lineSpacing: 0.1
property alias fontWidth: fontManager.fontWidth
property alias lineSpacing: fontManager.lineSpacing
property bool lowResolutionFont: false
property alias lowResolutionFont: fontManager.lowResolutionFont
property string fontName: "TERMINUS_SCALED"
property var fontlist: fontManager.item ? fontManager.item.fontlist : null
property alias fontName: fontManager.fontName
property alias filteredFontList: fontManager.filteredFontList
property var filteredFontList: ListModel {}
function updateFont() {
if (!fontManager.item || !fontlist) return
filteredFontList.clear()
var currentFontInList = false
for (var i = 0; i < fontlist.count; i++) {
var font = fontlist.get(i)
var isBundled = !font.isSystemFont
var isSystem = font.isSystemFont
var matchesSource = (fontSource === bundled_fonts && isBundled) || (fontSource === system_fonts && isSystem)
if (!matchesSource) continue
var modernMode = rasterization === modern_rasterization
var matchesRasterization = font.isSystemFont || (modernMode == !font.lowResolutionFont)
if (matchesRasterization) {
filteredFontList.append(font)
if (font.name === fontName) {
currentFontInList = true
}
}
}
if (!currentFontInList && filteredFontList.count > 0) {
fontName = filteredFontList.get(0).name
}
var index = getIndexByName(fontName)
if (index === undefined) return
fontManager.item.selectedFontIndex = index
fontManager.item.scaling = totalFontScaling
var fontSourcePath = fontManager.item.source
var pixelSize = fontManager.item.pixelSize
var lineSpacing = fontManager.item.lineSpacing
var screenScaling = fontManager.item.screenScaling
var fontWidth = fontManager.item.defaultFontWidth * appSettings.fontWidth
var fontFamily = fontManager.item.family
var isSystemFont = fontManager.item.isSystemFont
var fallbackFontFamily = ""
lowResolutionFont = fontManager.item.lowResolutionFont
if (!isSystemFont) {
fontLoader.source = fontSourcePath
fontFamily = fontLoader.name
}
fallbackFontLoader.source = ""
var fallbackName = fontManager.item.fallbackName
if (fallbackName && fallbackName !== fontName) {
var fallbackFont = getFontByName(fallbackName)
if (fallbackFont) {
fallbackFontLoader.source = fallbackFont.source
fallbackFontFamily = fallbackFontLoader.name
}
}
terminalFontChanged(fontFamily, pixelSize, lineSpacing, screenScaling, fontWidth, fallbackFontFamily)
property FontManager fontManager: FontManager {
id: fontManager
baseFontScaling: baseFontScaling
}
onFontSourceChanged: updateFont()
onRasterizationChanged: updateFont()
onFontNameChanged: updateFont()
signal terminalFontChanged(string fontFamily, int pixelSize, int lineSpacing, real screenScaling, real fontWidth, string fallbackFontFamily)
signal initializedSettings
property Loader fontManager: Loader {
source: "Fonts.qml"
onLoaded: updateFont()
}
property FontLoader fontLoader: FontLoader {}
property FontLoader fallbackFontLoader: FontLoader {}
onTotalFontScalingChanged: updateFont()
onFontWidthChanged: updateFont()
onLineSpacingChanged: updateFont()
function getIndexByName(name) {
for (var i = 0; i < fontlist.count; i++) {
var requestedName = fontlist.get(i).name
if (name === requestedName)
return i
}
return 0 // If the font is not available default to 0.
}
function getFontByName(name) {
for (var i = 0; i < fontlist.count; i++) {
var font = fontlist.get(i)
if (name === font.name) {
return font
}
}
return null
}
function incrementScaling() {
fontScaling = Math.min(fontScaling + 0.05, maximumFontScaling)
}
@@ -248,6 +142,12 @@ QtObject {
fontScaling = Math.max(fontScaling - 0.05, minimumFontScaling)
}
function close() {
storeSettings()
storeCustomProfiles()
Qt.quit()
}
property Storage storage: Storage {}
function stringify(obj) {
@@ -260,27 +160,20 @@ QtObject {
function composeSettingsString() {
var settings = {
"effectsFrameSkip": effectsFrameSkip,
"x": x,
"y": y,
"width": width,
"height": height,
"windowScaling": windowScaling,
"showTerminalSize": showTerminalSize,
"fontScaling": fontScaling,
"fontName": fontName,
"fontSource": fontSource,
"showMenubar": showMenubar,
"bloomQuality": bloomQuality,
"burnInQuality": burnInQuality,
"useCustomCommand": useCustomCommand,
"customCommand": customCommand,
"lineSpacing": lineSpacing
"customCommand": customCommand
}
return stringify(settings)
}
function composeProfileObject() {
var settings = {
var profile = {
"backgroundColor": _backgroundColor,
"fontColor": _fontColor,
"flickering": flickering,
@@ -294,7 +187,7 @@ QtObject {
"bloom": bloom,
"rasterization": rasterization,
"jitter": jitter,
"rbgShift": rbgShift,
"rgbShift": rgbShift,
"brightness": brightness,
"contrast": contrast,
"ambientLight": ambientLight,
@@ -304,9 +197,12 @@ QtObject {
"fontWidth": fontWidth,
"margin": _margin,
"blinkingCursor": blinkingCursor,
"frameMargin": _frameMargin,
"frameSize": _frameSize,
"screenRadius": _screenRadius,
"frameColor": _frameColor,
"frameShininess": _frameShininess
}
return settings
return profile
}
function composeProfileString() {
@@ -352,14 +248,7 @@ QtObject {
windowScaling = settings.windowScaling
!== undefined ? settings.windowScaling : windowScaling
x = settings.x !== undefined ? settings.x : x
y = settings.y !== undefined ? settings.y : y
width = settings.width !== undefined ? settings.width : width
height = settings.height !== undefined ? settings.height : height
fontName = settings.fontName !== undefined ? settings.fontName : fontName
fontScaling = settings.fontScaling !== undefined ? settings.fontScaling : fontScaling
fontSource = settings.fontSource !== undefined ? settings.fontSource : fontSource
showMenubar = settings.showMenubar !== undefined ? settings.showMenubar : showMenubar
@@ -399,7 +288,7 @@ QtObject {
jitter = settings.jitter !== undefined ? settings.jitter : jitter
rbgShift = settings.rbgShift !== undefined ? settings.rbgShift : rbgShift
rgbShift = settings.rgbShift !== undefined ? settings.rgbShift : rgbShift
ambientLight = settings.ambientLight !== undefined ? settings.ambientLight : ambientLight
contrast = settings.contrast !== undefined ? settings.contrast : contrast
@@ -413,7 +302,10 @@ QtObject {
lineSpacing = settings.lineSpacing !== undefined ? settings.lineSpacing : lineSpacing
_margin = settings.margin !== undefined ? settings.margin : _margin
_frameMargin = settings.frameMargin !== undefined ? settings.frameMargin : _frameMargin
_frameSize = settings.frameSize !== undefined ? settings.frameSize : _frameSize
_screenRadius = settings.screenRadius !== undefined ? settings.screenRadius : _screenRadius
_frameColor = settings.frameColor !== undefined ? settings.frameColor : _frameColor
_frameShininess = settings.frameShininess !== undefined ? settings.frameShininess : _frameShininess
blinkingCursor = settings.blinkingCursor !== undefined ? settings.blinkingCursor : blinkingCursor
}
@@ -474,278 +366,476 @@ QtObject {
ListElement {
text: "Default Amber"
obj_string: '{
"ambientLight": 0.2,
"ambientLight": 0.3,
"backgroundColor": "#000000",
"bloom": 0.5538,
"bloom": 0.6,
"brightness": 0.5,
"burnIn": 0.2517,
"chromaColor": 0.2483,
"contrast": 0.7959,
"burnIn": 0.3,
"chromaColor": 0.2,
"contrast": 0.8,
"flickering": 0.1,
"fontColor": "#ff8100",
"fontName": "TERMINUS_SCALED",
"fontName": "TERMINESS_SCALED",
"fontSource": 0,
"fontWidth": 1,
"lineSpacing": 0.1,
"glowingLine": 0.2,
"horizontalSync": 0.08,
"jitter": 0.1997,
"horizontalSync": 0.1,
"jitter": 0.2,
"rasterization": 0,
"rbgShift": 0,
"saturationColor": 0.2483,
"screenCurvature": 0.3,
"staticNoise": 0.1198,
"rgbShift": 0,
"saturationColor": 0.2,
"screenCurvature": 0.2,
"screenRadius": 0.1,
"staticNoise": 0.1,
"windowOpacity": 1,
"margin": 0.5,
"margin": 0.3,
"blinkingCursor": false,
"frameMargin": 0.1
"frameSize": 0.1,
"frameColor": "#cfcfcf",
"frameShininess": 0.3
}'
builtin: true
}
ListElement {
text: "Monochrome Green"
obj_string: '{
"ambientLight": 0.2,
"ambientLight": 0.3,
"backgroundColor": "#000000",
"bloom": 0.5538,
"bloom": 0.5,
"brightness": 0.5,
"burnIn": 0.2517,
"burnIn": 0.3,
"chromaColor": 0.0,
"contrast": 0.7959,
"contrast": 0.8,
"flickering": 0.1,
"fontColor": "#0ccc68",
"fontName": "TERMINUS_SCALED",
"fontName": "DEPARTURE_MONO_SCALED",
"fontSource": 0,
"fontWidth": 1,
"lineSpacing": 0.1,
"glowingLine": 0.2,
"horizontalSync": 0.08,
"jitter": 0.1997,
"horizontalSync": 0.1,
"jitter": 0.2,
"rasterization": 0,
"rbgShift": 0,
"rgbShift": 0,
"saturationColor": 0.0,
"screenCurvature": 0.3,
"staticNoise": 0.1198,
"screenRadius": 0.2,
"staticNoise": 0.1,
"windowOpacity": 1,
"margin": 0.5,
"margin": 0.3,
"blinkingCursor": false,
"frameMargin": 0.1
"frameSize": 0.1,
"frameColor": "#d4d4d4",
"frameShininess": 0.1
}'
builtin: true
}
ListElement {
text: "Green Scanlines"
text: "Deep Blue"
obj_string: '{
"ambientLight": 0,
"ambientLight": 0.0,
"backgroundColor": "#000000",
"bloom": 0.6,
"brightness": 0.5,
"burnIn": 0.3,
"chromaColor": 0.5,
"contrast": 0.6,
"chromaColor": 1.0,
"contrast": 0.8,
"flickering": 0.1,
"fontColor": "#7cff4f",
"fontName": "PRO_FONT_SCALED",
"fontColor": "#7fb4ff",
"fontName": "BIGBLUE_TERMINAL_SCALED",
"fontSource": 0,
"fontWidth": 1,
"lineSpacing": 0.1,
"glowingLine": 0.2,
"horizontalSync": 0.151,
"jitter": 0.11,
"rasterization": 1,
"rbgShift": 0,
"saturationColor": 0.5,
"screenCurvature": 0.3,
"staticNoise": 0.15,
"horizontalSync": 0.1,
"jitter": 0.2,
"rasterization": 0,
"rgbShift": 0,
"saturationColor": 0.2,
"screenCurvature": 0.4,
"screenRadius": 0.1,
"staticNoise": 0.1,
"windowOpacity": 1,
"margin": 0.5,
"margin": 0.3,
"blinkingCursor": false,
"frameMargin": 0.1
"frameSize": 0.1,
"frameColor": "#ffffff",
"frameShininess": 0.9
}'
builtin: true
}
ListElement {
text: "Default Pixelated"
text: "Commodore 64"
obj_string: '{
"ambientLight": 0,
"backgroundColor": "#000000",
"bloom": 0.4045,
"brightness": 0.6041,
"burnIn": 0.1024,
"chromaColor": 0.7517,
"contrast": 0.7473,
"flickering": 0.1962,
"fontColor": "#ffffff",
"fontName": "COMMODORE_PET",
"ambientLight": 0.4,
"backgroundColor": "#3b3b8f",
"bloom": 0.4,
"brightness": 0.6,
"burnIn": 0.1,
"chromaColor": 0.0,
"contrast": 0.7,
"flickering": 0.1,
"fontColor": "#a9a7ff",
"fontName": "COMMODORE_64_SCALED",
"fontSource": 0,
"fontWidth": 1,
"lineSpacing": 0.1,
"glowingLine": 0.2,
"horizontalSync": 0.151,
"jitter": 0,
"rasterization": 2,
"rbgShift": 0,
"glowingLine": 0.1,
"horizontalSync": 0.0,
"jitter": 0.0,
"rasterization": 1,
"rgbShift": 0,
"saturationColor": 0,
"screenCurvature": 0,
"staticNoise": 0.15,
"screenCurvature": 0.5,
"screenRadius": 0.1,
"staticNoise": 0.1,
"windowOpacity": 1,
"margin": 0.5,
"margin": 0.3,
"blinkingCursor": false,
"frameMargin": 0.1
"frameSize": 0.5,
"frameColor": "#999999",
"frameShininess": 0.0
}'
builtin: true
}
ListElement {
text: "Commodore PET"
obj_string: '{
"ambientLight": 0.0,
"backgroundColor": "#000000",
"bloom": 0.4,
"brightness": 0.5,
"burnIn": 0.4,
"chromaColor": 0,
"contrast": 0.8,
"flickering": 0.2,
"fontColor": "#ffffff",
"fontName": "COMMODORE_PET_SCALED",
"fontSource": 0,
"fontWidth": 1.25,
"lineSpacing": 0.1,
"glowingLine": 0.3,
"horizontalSync": 0.2,
"jitter": 0.15,
"rasterization": 1,
"rgbShift": 0.0,
"saturationColor": 0,
"screenCurvature": 0.7,
"screenRadius": 0.3,
"staticNoise": 0.2,
"windowOpacity": 1,
"margin": 0.2,
"blinkingCursor": false,
"frameSize": 0.5,
"frameColor": "#000000",
"frameShininess": 0.6
}'
builtin: true
}
ListElement {
text: "Apple ]["
obj_string: '{
"ambientLight": 0.3038,
"backgroundColor": "#000000",
"bloom": 0.5,
"ambientLight": 1.0,
"backgroundColor": "#001100",
"bloom": 0.3,
"brightness": 0.5,
"burnIn": 0.5017,
"burnIn": 0.3,
"chromaColor": 0,
"contrast": 0.85,
"contrast": 0.8,
"flickering": 0.2,
"fontColor": "#00d56d",
"fontName": "APPLE_II",
"fontColor": "#4dff6b",
"fontName": "APPLE_II_SCALED",
"fontSource": 0,
"fontWidth": 1,
"lineSpacing": 0.1,
"glowingLine": 0.22,
"horizontalSync": 0.16,
"jitter": 0.1,
"rasterization": 1,
"rbgShift": 0,
"saturationColor": 0,
"screenCurvature": 0.5,
"staticNoise": 0.099,
"windowOpacity": 1,
"margin": 0.5,
"blinkingCursor": false,
"frameMargin": 0.2
}'
builtin: true
}
ListElement {
text: "Vintage"
obj_string: '{
"ambientLight": 0.5,
"backgroundColor": "#000000",
"bloom": 0.4983,
"brightness": 0.5014,
"burnIn": 0.4983,
"chromaColor": 0,
"contrast": 0.7473,
"flickering": 0.9,
"fontColor": "#00ff3e",
"fontName": "COMMODORE_PET",
"fontSource": 0,
"fontWidth": 1,
"fontWidth": 1.25,
"lineSpacing": 0.1,
"glowingLine": 0.3,
"horizontalSync": 0.42,
"jitter": 0.4,
"horizontalSync": 0.2,
"jitter": 0.2,
"rasterization": 1,
"rbgShift": 0.2969,
"rgbShift": 0.0,
"saturationColor": 0,
"screenCurvature": 0.5,
"staticNoise": 0.2969,
"screenRadius": 0.3,
"staticNoise": 0.2,
"windowOpacity": 1,
"margin": 0.5,
"margin": 0.0,
"blinkingCursor": false,
"frameMargin": 0.5
"frameSize": 0.2,
"frameColor": "#ffffff",
"frameShininess": 0.8
}'
builtin: true
}
ListElement {
text: "IBM Dos"
text: "Atari 400"
obj_string: '{
"ambientLight": 0.151,
"ambientLight": 0.1,
"backgroundColor": "#0f1f5a",
"bloom": 0.1,
"brightness": 0.6,
"burnIn": 0.2,
"chromaColor": 0,
"contrast": 0.9,
"flickering": 0.1,
"fontColor": "#8ed6ff",
"fontName": "ATARI_400_SCALED",
"fontSource": 0,
"fontWidth": 1,
"lineSpacing": 0.1,
"glowingLine": 0.1,
"horizontalSync": 0.0,
"jitter": 0.0,
"rasterization": 1,
"rgbShift": 0.0,
"saturationColor": 0,
"screenCurvature": 0.4,
"screenRadius": 0.2,
"staticNoise": 0.1,
"windowOpacity": 1,
"margin": 0.2,
"blinkingCursor": false,
"frameSize": 0.4,
"frameColor": "#cccccc",
"frameShininess": 0.3
}'
builtin: true
}
ListElement {
text: "IBM VGA 8x16"
obj_string: '{
"ambientLight": 0.2,
"backgroundColor": "#000000",
"bloom": 0.2969,
"brightness": 0.5,
"burnIn": 0.0469,
"chromaColor": 1,
"contrast": 0.85,
"flickering": 0.0955,
"fontColor": "#ffffff",
"bloom": 0.2,
"brightness": 0.6,
"burnIn": 0.1,
"chromaColor": 0.5,
"contrast": 1.0,
"flickering": 0.1,
"fontColor": "#c0c0c0",
"fontName": "IBM_VGA_8x16",
"fontSource": 0,
"fontWidth": 1,
"lineSpacing": 0.1,
"glowingLine": 0.1545,
"horizontalSync": 0,
"jitter": 0.1545,
"rasterization": 0,
"rbgShift": 0.3524,
"glowingLine": 0.1,
"horizontalSync": 0.0,
"jitter": 0.0,
"rasterization": 1,
"rgbShift": 0.1,
"saturationColor": 0,
"screenCurvature": 0.4,
"staticNoise": 0.0503,
"screenCurvature": 0.3,
"screenRadius": 0.1,
"staticNoise": 0.0,
"windowOpacity": 1,
"margin": 0.5,
"margin": 0.2,
"blinkingCursor": false,
"frameMargin": 0.2
"frameSize": 0.1,
"frameColor": "#ffffff",
"frameShininess": 0.3
}'
builtin: true
}
ListElement {
text: "IBM 3278"
text: "IBM 3278 Reborn"
obj_string: '{
"ambientLight": 0.1,
"ambientLight": 0.2,
"backgroundColor": "#000000",
"bloom": 0.2969,
"bloom": 0.2,
"brightness": 0.5,
"burnIn": 0.6,
"burnIn": 0.5,
"chromaColor": 0,
"contrast": 0.85,
"contrast": 0.8,
"flickering": 0,
"fontColor": "#0ccc68",
"fontColor": "#3cff7a",
"fontName": "IBM_3278",
"fontSource": 0,
"fontWidth": 1,
"lineSpacing": 0.1,
"glowingLine": 0,
"glowingLine": 0.0,
"horizontalSync": 0,
"jitter": 0,
"rasterization": 0,
"rbgShift": 0,
"rasterization": 4,
"rgbShift": 0,
"saturationColor": 0,
"screenCurvature": 0.2,
"staticNoise": 0,
"screenCurvature": 0,
"screenRadius": 0.0,
"staticNoise": 0.0,
"windowOpacity": 1,
"margin": 0.5,
"margin": 0.1,
"blinkingCursor": false,
"frameMargin": 0.1
"frameSize": 0,
"frameColor": "#ffffff",
"frameShininess": 0.2
}'
builtin: true
}
ListElement {
text: "Futuristic"
text: "Neon Cyan"
obj_string: '{
"ambientLight": 0,
"backgroundColor": "#000000",
"bloom": 0.5017,
"brightness": 0.5014,
"burnIn": 0.0955,
"ambientLight": 0.1,
"backgroundColor": "#001018",
"bloom": 0.6,
"brightness": 0.6,
"burnIn": 0.1,
"chromaColor": 1,
"contrast": 0.85,
"flickering": 0.2,
"fontColor": "#729fcf",
"fontName": "TERMINUS",
"contrast": 0.9,
"flickering": 0.1,
"fontColor": "#52f7ff",
"fontName": "IOSEVKA",
"fontSource": 0,
"fontWidth": 1,
"lineSpacing": 0.1,
"glowingLine": 0.1476,
"horizontalSync": 0,
"jitter": 0.099,
"rasterization": 0,
"rbgShift": 0,
"saturationColor": 0.4983,
"glowingLine": 0.2,
"horizontalSync": 0.0,
"jitter": 0.1,
"rasterization": 4,
"rgbShift": 0.0,
"saturationColor": 0.6,
"screenCurvature": 0,
"staticNoise": 0.0955,
"screenRadius": 0.0,
"staticNoise": 0.1,
"windowOpacity": 0.8,
"margin": 0.1,
"blinkingCursor": false,
"frameSize": 0,
"frameColor": "#c3c3c3",
"frameShininess": 0.2
}'
builtin: true
}
ListElement {
text: "Ghost Terminal"
obj_string: '{
"ambientLight": 0.3,
"backgroundColor": "#0b1014",
"bloom": 0.3,
"brightness": 0.6,
"burnIn": 0.2,
"chromaColor": 0,
"contrast": 0.5,
"flickering": 0.0,
"fontColor": "#a6b3c0",
"fontName": "JETBRAINS_MONO",
"fontSource": 0,
"fontWidth": 1,
"lineSpacing": 0.1,
"glowingLine": 0.1,
"horizontalSync": 0.0,
"jitter": 0.0,
"rasterization": 4,
"rgbShift": 0.0,
"saturationColor": 0.0,
"screenCurvature": 0,
"screenRadius": 0.0,
"staticNoise": 0.1,
"windowOpacity": 0.7,
"margin": 0.1,
"blinkingCursor": false,
"frameMargin": 0
"frameSize": 0,
"frameColor": "#a7a7a7",
"frameShininess": 0.2
}'
builtin: true
}
ListElement {
text: "Plasma"
obj_string: '{
"ambientLight": 0.1,
"backgroundColor": "#070014",
"bloom": 0.7,
"brightness": 0.6,
"burnIn": 0.1,
"chromaColor": 1,
"contrast": 0.8,
"flickering": 0.1,
"fontColor": "#ff9bd6",
"fontName": "FIRA_CODE",
"fontSource": 0,
"fontWidth": 1,
"lineSpacing": 0.1,
"glowingLine": 0.2,
"horizontalSync": 0.0,
"jitter": 0.1,
"rasterization": 4,
"rgbShift": 0.1,
"saturationColor": 0.8,
"screenCurvature": 0,
"screenRadius": 0.0,
"staticNoise": 0.1,
"windowOpacity": 1.0,
"margin": 0.1,
"blinkingCursor": false,
"frameSize": 0,
"frameColor": "#d0d0d0",
"frameShininess": 0.2
}'
builtin: true
}
ListElement {
text: "Boring"
obj_string: '{
"ambientLight": 0.1,
"backgroundColor": "#000000",
"bloom": 0.5,
"brightness": 0.5,
"burnIn": 0.05,
"chromaColor": 1,
"contrast": 0.8,
"flickering": 0.0,
"fontColor": "#ffffff",
"fontName": "JETBRAINS_MONO",
"fontSource": 0,
"fontWidth": 1,
"lineSpacing": 0.1,
"glowingLine": 0.1,
"horizontalSync": 0,
"jitter": 0.0,
"rasterization": 4,
"rgbShift": 0,
"saturationColor": 0.0,
"screenCurvature": 0,
"screenRadius": 0.0,
"staticNoise": 0.0,
"windowOpacity": 1.0,
"margin": 0.0,
"blinkingCursor": false,
"frameSize": 0,
"frameColor": "#c0c0c0",
"frameShininess": 0.2
}'
builtin: true
}
ListElement {
text: "E-Ink"
obj_string: '{
"ambientLight": 0.6,
"backgroundColor": "#f2f2ec",
"bloom": 0.0,
"brightness": 1.0,
"burnIn": 0.6,
"chromaColor": 0,
"contrast": 0.5,
"flickering": 0.0,
"fontColor": "#101010",
"fontName": "HACK",
"fontSource": 0,
"fontWidth": 1,
"lineSpacing": 0.1,
"glowingLine": 0.0,
"horizontalSync": 0.0,
"jitter": 0.0,
"rasterization": 4,
"rgbShift": 0,
"saturationColor": 0,
"screenCurvature": 0,
"screenRadius": 0.0,
"staticNoise": 0.0,
"windowOpacity": 1,
"margin": 0.1,
"blinkingCursor": false,
"frameSize": 0,
"frameColor": "#cdcdcd",
"frameShininess": 0.2
}'
builtin: true
}
@@ -773,30 +863,16 @@ QtObject {
var profileArgPosition = args.indexOf("--profile")
if (profileArgPosition !== -1) {
var profileIndex = getProfileIndexByName(
args[profileArgPosition + 1])
if (profileIndex !== -1)
var profileIndex = getProfileIndexByName(args[profileArgPosition + 1])
if (profileIndex !== -1) {
loadProfile(profileIndex)
else
} else {
console.log("Warning: selected profile is not valid; ignoring it")
}
if (args.indexOf("--fullscreen") !== -1) {
fullscreen = true
showMenubar = false
}
if (args.indexOf("-T") !== -1) {
wintitle = args[args.indexOf("-T") + 1]
}
}
initializedSettings()
}
Component.onDestruction: {
storeSettings()
storeCustomProfiles()
// storage.dropSettings(); //DROPS THE SETTINGS!.. REMEMBER TO DISABLE ONCE ENABLED!!
}
// VARS ///////////////////////////////////////////////////////////////////
property Label _sampleLabel: Label {

View File

@@ -24,7 +24,7 @@ import "utils.js" as Utils
Loader {
id: burnInEffect
property ShaderEffectSource source: item ? item.source : null
property ShaderEffectSource effectSource: item ? item.source : null
property real lastUpdate: 0
property real prevLastUpdate: 0
@@ -81,6 +81,14 @@ Loader {
}
}
// Restart blurred source settings change.
Connections {
target: appSettings.fontManager
onTerminalFontChanged: {
burnInEffect.restartBlurSource()
}
}
Connections {
target: appSettings
@@ -88,10 +96,6 @@ Loader {
burnInEffect.restartBlurSource()
}
onTerminalFontChanged: {
burnInEffect.restartBlurSource()
}
onRasterizationChanged: {
burnInEffect.restartBlurSource()
}
@@ -105,6 +109,8 @@ Loader {
ShaderEffect {
id: burnInShaderEffect
property real time: timeManager.time
property variant txt_source: kterminalSource
property variant burnInSource: burnInEffectSource
property real burnInTime: burnInFadeTime
@@ -114,38 +120,8 @@ Loader {
anchors.fill: parent
blending: false
// Extra uniforms required by shared block
property real qt_Opacity: 1.0
property real time: timeManager.time
property color fontColor: appSettings.fontColor
property color backgroundColor: appSettings.backgroundColor
property real shadowLength: 0
property size virtualResolution: Qt.size(width, height)
property real rasterizationIntensity: 0
property int rasterizationMode: 0
property real burnIn: appSettings.burnIn
property real staticNoise: 0
property real screenCurvature: 0
property real glowingLine: 0
property real chromaColor: 0
property size jitterDisplacement: Qt.size(0, 0)
property real ambientLight: 0
property real jitter: 0
property real horizontalSync: 0
property real horizontalSyncStrength: 0
property real flickering: 0
property real displayTerminalFrame: 0
property size scaleNoiseSize: Qt.size(0, 0)
property real screen_brightness: 1.0
property real bloom: 0
property real rbgShift: 0
property real screenShadowCoeff: 0
property real frameShadowCoeff: 0
property color frameColor: backgroundColor
property size margin: Qt.size(0, 0)
fragmentShader: "qrc:/shaders/burn_in.frag.qsb"
vertexShader: "qrc:/shaders/passthrough.vert.qsb"
vertexShader: "qrc:/shaders/burn_in.vert.qsb"
onStatusChanged: if (log) console.log(log) //Print warning messages
}

View File

@@ -1,257 +0,0 @@
/*******************************************************************************
* Copyright (c) 2013-2021 "Filippo Scognamiglio"
* https://github.com/Swordfish90/cool-retro-term
*
* This file is part of cool-retro-term.
*
* cool-retro-term is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
import QtQuick 2.2
QtObject {
property int selectedFontIndex
property real scaling
property var source: fontlist.get(selectedFontIndex).source
property var _font: fontlist.get(selectedFontIndex)
property bool lowResolutionFont: _font.lowResolutionFont
// Reference height (in pixels) that represents the "normal" on-screen size at scaling=1.0.
// Adjust this single value to tune how large fonts appear by default.
property int baseFontPixelHeight: 32
// Target pixel height we want on screen for the current zoom level. Low-res fonts will be scaled
// up to this height, high-res fonts render directly at this size.
property real targetPixelHeight: baseFontPixelHeight * scaling
property int pixelSize: lowResolutionFont ? _font.pixelSize : targetPixelHeight
// Line spacing expressed as a relative factor for all fonts.
property real lineSpacingFactor: appSettings.lineSpacing
property int lineSpacing: Math.round(targetPixelHeight * lineSpacingFactor)
// Use total line height (glyph + spacing) for scaling computations on low-res fonts.
property real nativeLineHeight: _font.pixelSize + Math.round(
_font.pixelSize * lineSpacingFactor)
property real targetLineHeight: targetPixelHeight + lineSpacing
// Scale low-res font textures to hit the target line height; high-res fonts don't need scaling.
property real screenScaling: lowResolutionFont ? targetLineHeight / nativeLineHeight : 1.0
// Uniform default font width (user width scaling still applies).
property real defaultFontWidth: 1.0
property bool isSystemFont: fontlist.get(selectedFontIndex).isSystemFont
property string family: fontlist.get(selectedFontIndex).family
// There are two kind of fonts: low resolution and high resolution.
// Low resolution font sets the lowResolutionFont property to true.
// They are rendered at a fixed pixel size and the texture is upscaled
// to fill the screen (they are much faster to render).
// High resolution fonts are instead drawn on a texture which has the
// size of the screen, and the scaling directly controls their pixels size.
// Those are slower to render but are not pixelated.
property ListModel fontlist: ListModel {
ListElement {
name: "TERMINUS_SCALED"
text: "Terminus"
source: "fonts/terminus/TerminusTTF-4.49.3.ttf"
pixelSize: 12
lowResolutionFont: true
isSystemFont: false
}
ListElement {
name: "EXCELSIOR_SCALED"
text: "Fixedsys Excelsior"
source: "fonts/fixedsys-excelsior/FSEX301-L2.ttf"
pixelSize: 16
lowResolutionFont: true
isSystemFont: false
fallbackName: "UNSCII_16_SCALED"
}
ListElement {
name: "GREYBEARD_SCALED"
text: "Greybeard"
source: "fonts/greybeard/Greybeard-16px.ttf"
pixelSize: 16
lowResolutionFont: true
isSystemFont: false
fallbackName: "UNSCII_16_SCALED"
}
ListElement {
name: "COMMODORE_PET_SCALED"
text: "Commodore PET"
source: "fonts/pet-me/PetMe.ttf"
pixelSize: 8
lowResolutionFont: true
isSystemFont: false
fallbackName: "UNSCII_8_SCALED"
}
ListElement {
name: "COZETTE_SCALED"
text: "Cozette"
source: "fonts/cozette/CozetteVector.ttf"
pixelSize: 13
lowResolutionFont: true
isSystemFont: false
}
ListElement {
name: "UNSCII_8_SCALED"
text: "Unscii 8"
source: "fonts/unscii/unscii-8.ttf"
pixelSize: 8
lowResolutionFont: true
isSystemFont: false
fallbackName: "UNSCII_8_SCALED"
}
ListElement {
name: "UNSCII_8_THIN_SCALED"
text: "Unscii 8 Thin"
source: "fonts/unscii/unscii-8-thin.ttf"
pixelSize: 8
lowResolutionFont: true
isSystemFont: false
fallbackName: "UNSCII_8_SCALED"
}
ListElement {
name: "UNSCII_16_SCALED"
text: "Unscii 16"
source: "fonts/unscii/unscii-16-full.ttf"
pixelSize: 16
lowResolutionFont: true
isSystemFont: false
fallbackName: "UNSCII_16_SCALED"
}
ListElement {
name: "APPLE_II_SCALED"
text: "Apple ]["
source: "fonts/apple2/PrintChar21.ttf"
pixelSize: 8
lowResolutionFont: true
isSystemFont: false
fallbackName: "UNSCII_8_SCALED"
}
ListElement {
name: "ATARI_400_SCALED"
text: "Atari 400-800"
source: "fonts/atari-400-800/AtariClassic-Regular.ttf"
pixelSize: 8
lowResolutionFont: true
isSystemFont: false
fallbackName: "UNSCII_8_SCALED"
}
ListElement {
name: "COMMODORE_64_SCALED"
text: "Commodore 64"
source: "fonts/pet-me/PetMe64.ttf"
pixelSize: 8
lowResolutionFont: true
isSystemFont: false
fallbackName: "UNSCII_8_SCALED"
}
ListElement {
name: "IBM_EGA_8x8"
text: "IBM EGA 8x8"
source: "fonts/oldschool-pc-fonts/PxPlus_IBM_EGA_8x8.ttf"
pixelSize: 8
lowResolutionFont: true
isSystemFont: false
fallbackName: "UNSCII_8_SCALED"
}
ListElement {
name: "IBM_VGA_8x16"
text: "IBM VGA 8x16"
source: "fonts/oldschool-pc-fonts/PxPlus_IBM_VGA_8x16.ttf"
pixelSize: 16
lowResolutionFont: true
isSystemFont: false
fallbackName: "UNSCII_16_SCALED"
}
ListElement {
name: "TERMINUS"
text: "Terminus"
source: "fonts/terminus/TerminusTTF-4.49.3.ttf"
pixelSize: 35
lowResolutionFont: false
isSystemFont: false
}
ListElement {
name: "HACK"
text: "Hack"
source: "fonts/hack/Hack-Regular.ttf"
pixelSize: 35
lowResolutionFont: false
isSystemFont: false
}
ListElement {
name: "FIRA_CODE"
text: "Fira Code"
source: "fonts/fira-code/FiraCode-Medium.ttf"
pixelSize: 35
lowResolutionFont: false
isSystemFont: false
}
ListElement {
name: "IOSEVKA"
text: "Iosevka"
source: "fonts/iosevka/IosevkaTerm-ExtendedMedium.ttf"
pixelSize: 35
lowResolutionFont: false
isSystemFont: false
}
ListElement {
name: "JETBRAINS_MONO"
text: "JetBrains Mono"
source: "fonts/jetbrains-mono/JetBrainsMono-Medium.ttf"
pixelSize: 35
lowResolutionFont: false
isSystemFont: false
}
ListElement {
name: "IBM_3278"
text: "IBM 3278"
source: "fonts/ibm-3278/3270-Regular.ttf"
pixelSize: 32
lowResolutionFont: false
isSystemFont: false
}
}
Component.onCompleted: addSystemFonts()
function addSystemFonts() {
var families = monospaceSystemFonts
for (var i = 0; i < families.length; i++) {
if (verbose) {
console.log("Adding system font: ", families[i])
}
fontlist.append(convertToListElement(families[i]))
}
appSettings.updateFont()
}
function convertToListElement(family) {
return {
"name": family,
"text": family,
"source": "",
"pixelSize": 30,
"baseScaling": 1.0,
"lowResolutionFont": false,
"isSystemFont": true,
"family": family
}
}
}

View File

@@ -20,14 +20,16 @@
import QtQuick 2.2
import QtQuick.Controls 2.0
import QtQml
import QMLTermWidget 1.0
import QMLTermWidget 2.0
import "menus"
import "utils.js" as Utils
Item{
id: terminalContainer
Item {
id: preprocessedTerminal
signal sessionFinished()
property size virtualResolution: Qt.size(kterminal.totalWidth, kterminal.totalHeight)
property alias mainTerminal: kterminal
@@ -46,14 +48,14 @@ Item{
// Manage copy and paste
Connections {
target: copyAction
enabled: terminalContainer.hasFocus
onTriggered: {
kterminal.copyClipboard()
}
}
Connections {
target: pasteAction
enabled: terminalContainer.hasFocus
onTriggered: {
kterminal.pasteClipboard()
}
@@ -64,29 +66,22 @@ Item{
target: appSettings
onFontScalingChanged: {
terminalContainer.updateSources()
preprocessedTerminal.updateSources()
}
onFontWidthChanged: {
terminalContainer.updateSources()
preprocessedTerminal.updateSources()
}
}
Connections {
target: terminalContainer
target: preprocessedTerminal
onWidthChanged: {
terminalContainer.updateSources()
preprocessedTerminal.updateSources()
}
onHeightChanged: {
terminalContainer.updateSources()
}
}
Connections {
target: terminalWindow
onActiveChanged: {
kterminal.forceActiveFocus()
preprocessedTerminal.updateSources()
}
}
@@ -97,8 +92,8 @@ Item{
QMLTermWidget {
id: kterminal
property int textureResolutionScale: appSettings.lowResolutionFont ? devicePixelRatio : 1
property int margin: appSettings.totalMargin / screenScaling
property int textureResolutionScale: appSettings.lowResolutionFont ? Screen.devicePixelRatio : 1
property int margin: appSettings.margin / screenScaling
property int totalWidth: Math.floor(parent.width / (screenScaling * fontWidth))
property int totalHeight: Math.floor(parent.height / screenScaling)
@@ -107,26 +102,24 @@ Item{
textureSize: Qt.size(width / textureResolutionScale, height / textureResolutionScale)
width: ensureMultiple(rawWidth, devicePixelRatio)
height: ensureMultiple(rawHeight, devicePixelRatio)
width: ensureMultiple(rawWidth, Screen.devicePixelRatio)
height: ensureMultiple(rawHeight, Screen.devicePixelRatio)
/** Ensure size is a multiple of factor. This is needed for pixel perfect scaling on highdpi screens. */
function ensureMultiple(size, factor) {
return Math.round(size / factor) * factor;
}
colorScheme: "cool-retro-term"
smooth: !appSettings.lowResolutionFont
enableBold: false
fullCursorHeight: true
blinkingCursor: appSettings.blinkingCursor
colorScheme: "cool-retro-term"
session: QMLTermSession {
id: ksession
onFinished: {
Qt.quit()
preprocessedTerminal.sessionFinished()
}
}
@@ -140,36 +133,36 @@ Item{
anchors.topMargin: 1
anchors.bottomMargin: 1
color: "white"
radius: width * 0.25
opacity: 0.7
}
}
function handleFontChanged(fontFamily, pixelSize, lineSpacing, screenScaling, fontWidth, fallbackFontFamily) {
kterminal.antialiasText = !appSettings.lowResolutionFont;
var updatedFont = Qt.font({
function handleFontChanged(fontFamily, pixelSize, lineSpacing, screenScaling, fontWidth, fallbackFontFamily, lowResolutionFont) {
kterminal.lineSpacing = lineSpacing;
kterminal.antialiasText = !lowResolutionFont;
kterminal.smooth = !lowResolutionFont;
kterminal.enableBold = !lowResolutionFont;
kterminal.enableItalic = !lowResolutionFont;
kterminal.font = Qt.font({
family: fontFamily,
pixelSize: pixelSize
});
kterminal.font = updatedFont;
terminalContainer.fontWidth = fontWidth;
terminalContainer.screenScaling = screenScaling;
preprocessedTerminal.fontWidth = fontWidth;
preprocessedTerminal.screenScaling = screenScaling;
scaleTexture = Math.max(1.0, Math.floor(screenScaling * appSettings.windowScaling));
}
kterminal.lineSpacing = lineSpacing;
Connections {
target: appSettings
var fallbackChain = [];
if (fallbackFontFamily && fallbackFontFamily.length > 0) {
fallbackChain.push(fallbackFontFamily);
onWindowScalingChanged: {
scaleTexture = Math.max(1.0, Math.floor(preprocessedTerminal.screenScaling * appSettings.windowScaling));
}
fallbackChain.push(appSettings.isMacOS ? "Menlo" : "Monospace");
monospaceFontManager.setFontSubstitutions(fontFamily, fallbackChain);
}
function startSession() {
appSettings.initializedSettings.disconnect(startSession);
// Retrieve the variable set in main.cpp if arguments are passed.
if (defaultCmd) {
ksession.setShellProgram(defaultCmd);
@@ -190,9 +183,9 @@ Item{
forceActiveFocus();
}
Component.onCompleted: {
appSettings.terminalFontChanged.connect(handleFontChanged);
appSettings.initializedSettings.connect(startSession);
appSettings.updateFont()
appSettings.fontManager.terminalFontChanged.connect(handleFontChanged);
appSettings.fontManager.refresh()
startSession();
}
}
@@ -208,19 +201,20 @@ Item{
Loader {
id: menuLoader
sourceComponent: (appSettings.isMacOS || appSettings.showMenubar ? shortContextMenu : fullContextMenu)
sourceComponent: (appSettings.isMacOS || (appSettings.showMenubar && !terminalWindow.fullscreen) ? shortContextMenu : fullContextMenu)
}
property alias contextmenu: menuLoader.item
MouseArea {
property real margin: appSettings.totalMargin
property real margin: appSettings.margin
property real frameSize: appSettings.frameSize * terminalWindow.normalizedWindowScale
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
anchors.fill: parent
cursorShape: kterminal.terminalUsesMouse ? Qt.ArrowCursor : Qt.IBeamCursor
onWheel: function(wheel) {
if (wheel.modifiers & Qt.ControlModifier) {
wheel.angleDelta.y > 0 ? zoomIn.trigger() : zoomOut.trigger();
wheel.angleDelta.y > 0 ? zoomInAction.trigger() : zoomOutAction.trigger();
} else {
var coord = correctDistortion(wheel.x, wheel.y);
kterminal.simulateWheel(coord.x, coord.y, wheel.buttons, wheel.modifiers, wheel.angleDelta);
@@ -231,6 +225,7 @@ Item{
kterminal.simulateMouseDoubleClick(coord.x, coord.y, mouse.button, mouse.buttons, mouse.modifiers);
}
onPressed: function(mouse) {
kterminal.forceActiveFocus()
if ((!kterminal.terminalUsesMouse || mouse.modifiers & Qt.ShiftModifier) && mouse.button == Qt.RightButton) {
contextmenu.popup();
} else {
@@ -247,12 +242,17 @@ Item{
kterminal.simulateMouseMove(coord.x, coord.y, mouse.button, mouse.buttons, mouse.modifiers);
}
function correctDistortion(x, y){
function correctDistortion(x, y) {
x = (x - margin) / width;
y = (y - margin) / height;
x = x * (1 + frameSize * 2) - frameSize;
y = y * (1 + frameSize * 2) - frameSize;
var cc = Qt.size(0.5 - x, 0.5 - y);
var distortion = (cc.height * cc.height + cc.width * cc.width) * appSettings.screenCurvature * appSettings.screenCurvatureSize;
var distortion = (cc.height * cc.height + cc.width * cc.width)
* appSettings.screenCurvature * appSettings.screenCurvatureSize
* terminalWindow.normalizedWindowScale;
return Qt.point((x - cc.width * (1+distortion) * distortion) * (kterminal.totalWidth),
(y - cc.height * (1+distortion) * distortion) * (kterminal.totalHeight))

View File

@@ -28,7 +28,7 @@ ColumnLayout {
GroupBox {
Layout.fillWidth: true
Layout.fillHeight: true
title: qsTr("Command")
title: qsTr("Miscellaneous")
padding: appSettings.defaultMargin
ColumnLayout {
@@ -39,12 +39,6 @@ ColumnLayout {
checked: appSettings.useCustomCommand
onCheckedChanged: appSettings.useCustomCommand = checked
}
// Workaround for QTBUG-31627 for pre 5.3.0
Binding {
target: useCustomCommand
property: "checked"
value: appSettings.useCustomCommand
}
TextField {
id: customCommand
Layout.fillWidth: true
@@ -59,26 +53,18 @@ ColumnLayout {
Component.onCompleted: settings_window.closing.connect(
saveSetting)
}
}
}
GroupBox {
title: qsTr("Cursor")
Layout.fillWidth: true
Layout.fillHeight: true
padding: appSettings.defaultMargin
ColumnLayout {
anchors.fill: parent
CheckBox {
id: blinkingCursor
text: qsTr("Blinking Cursor")
checked: appSettings.blinkingCursor
onCheckedChanged: appSettings.blinkingCursor = checked
}
Binding {
target: blinkingCursor
property: "checked"
value: appSettings.blinkingCursor
CheckBox {
id: showMenubar
text: qsTr("Show Menubar")
enabled: !appSettings.isMacOS
checked: appSettings.showMenubar
onCheckedChanged: appSettings.showMenubar = checked
}
}
}

View File

@@ -83,8 +83,13 @@ ColumnLayout {
}
CheckableSlider {
name: qsTr("RGB Shift")
onNewValue: function(newValue) { appSettings.rbgShift = newValue }
value: appSettings.rbgShift
onNewValue: function(newValue) { appSettings.rgbShift = newValue }
value: appSettings.rgbShift
}
CheckableSlider {
name: qsTr("Frame Shininess")
onNewValue: function(newValue) { appSettings._frameShininess = newValue }
value: appSettings._frameShininess
}
}
}

View File

@@ -211,12 +211,19 @@ ColumnLayout {
onValueChanged: appSettings._margin = value
value: appSettings._margin
}
Label {
text: qsTr("Radius")
}
SimpleSlider {
onValueChanged: appSettings._screenRadius = value
value: appSettings._screenRadius
}
Label {
text: qsTr("Frame size")
}
SimpleSlider {
onValueChanged: appSettings._frameMargin = value
value: appSettings._frameMargin
onValueChanged: appSettings._frameSize = value
value: appSettings._frameSize
}
Label {
text: qsTr("Opacity")

View File

@@ -79,7 +79,7 @@ ColumnLayout {
model: appSettings.filteredFontList
textRole: "text"
onActivated: {
var font = appSettings.filteredFontList.get(index)
var font = appSettings.filteredFontList.get(currentIndex)
// If selecting a high-res font while not in Modern mode,
// switch to Modern to render at full resolution.
@@ -104,7 +104,7 @@ ColumnLayout {
currentIndex = 0
}
Connections {
target: appSettings
target: appSettings.fontManager
onTerminalFontChanged: {
fontChanger.updateIndex()
@@ -209,6 +209,13 @@ ColumnLayout {
onColorSelected: appSettings._backgroundColor = color
color: appSettings._backgroundColor
}
ColorButton {
name: qsTr("Frame")
height: 50
Layout.fillWidth: true
onColorSelected: appSettings._frameColor = color
color: appSettings._frameColor
}
}
}
}

View File

@@ -25,10 +25,12 @@ import QtQuick.Layouts 1.3
import QtQuick.Dialogs
ApplicationWindow {
readonly property real tabButtonPadding: 10
id: settings_window
title: qsTr("Settings")
width: 640
height: 480
height: 520
Item {
anchors { fill: parent; }
@@ -37,15 +39,19 @@ ApplicationWindow {
id: bar
anchors { left: parent.left; right: parent.right; top: parent.top; }
TabButton {
padding: tabButtonPadding
text: qsTr("General")
}
TabButton {
padding: tabButtonPadding
text: qsTr("Terminal")
}
TabButton {
padding: tabButtonPadding
text: qsTr("Effects")
}
TabButton {
padding: tabButtonPadding
text: qsTr("Advanced")
}
}

View File

@@ -1,92 +0,0 @@
import QtQuick 2.0
QtObject {
property string rasterizationShader:
((appSettings.rasterization === appSettings.no_rasterization) ||
(appSettings.rasterization === appSettings.modern_rasterization) ? "
lowp vec3 applyRasterization(vec2 screenCoords, lowp vec3 texel, vec2 virtualResolution, float intensity) {
return texel;
}" : "") +
(appSettings.rasterization === appSettings.scanline_rasterization ? "
#define INTENSITY 0.30
#define BRIGHTBOOST 0.30
lowp vec3 applyRasterization(vec2 screenCoords, lowp vec3 texel, vec2 virtualResolution, float intensity) {
lowp vec3 pixelHigh = ((1.0 + BRIGHTBOOST) - (0.2 * texel)) * texel;
lowp vec3 pixelLow = ((1.0 - INTENSITY) + (0.1 * texel)) * texel;
vec2 coords = fract(screenCoords * virtualResolution) * 2.0 - vec2(1.0);
lowp float mask = 1.0 - abs(coords.y);
lowp vec3 rasterizationColor = mix(pixelLow, pixelHigh, mask);
return mix(texel, rasterizationColor, intensity);
}" : "") +
(appSettings.rasterization === appSettings.pixel_rasterization ? "
#define INTENSITY 0.30
#define BRIGHTBOOST 0.30
lowp vec3 applyRasterization(vec2 screenCoords, lowp vec3 texel, vec2 virtualResolution, float intensity) {
lowp vec3 result = texel;
lowp vec3 pixelHigh = ((1.0 + BRIGHTBOOST) - (0.2 * texel)) * texel;
lowp vec3 pixelLow = ((1.0 - INTENSITY) + (0.1 * texel)) * texel;
vec2 coords = fract(screenCoords * virtualResolution) * 2.0 - vec2(1.0);
coords = coords * coords;
lowp float mask = 1.0 - coords.x - coords.y;
lowp vec3 rasterizationColor = mix(pixelLow, pixelHigh, mask);
return mix(texel, rasterizationColor, intensity);
}" : "") +
(appSettings.rasterization === appSettings.subpixel_rasterization ? "
#define INTENSITY 0.30
#define BRIGHTBOOST 0.30
#define SUBPIXELS 3.0
const vec3 offsets = vec3(3.141592654) * vec3(1.0/2.0,1.0/2.0 - 2.0/3.0,1.0/2.0-4.0/3.0);
lowp vec3 applyRasterization(vec2 screenCoords, lowp vec3 texel, vec2 virtualResolution, float intensity) {
vec2 omega = vec2(3.141592654) * vec2(2.0) * virtualResolution;
vec2 angle = screenCoords * omega;
vec3 xfactors = (SUBPIXELS + sin(angle.x + offsets)) / (SUBPIXELS + 1.0);
lowp vec3 result = texel * xfactors;
lowp vec3 pixelHigh = ((1.0 + BRIGHTBOOST) - (0.2 * result)) * result;
lowp vec3 pixelLow = ((1.0 - INTENSITY) + (0.1 * result)) * result;
vec2 coords = fract(screenCoords * virtualResolution) * 2.0 - vec2(1.0);
lowp float mask = 1.0 - abs(coords.y);
lowp vec3 rasterizationColor = mix(pixelLow, pixelHigh, mask);
return mix(texel, rasterizationColor, intensity);
}" : "") +
"\n\n"
property string min2: "
float min2(vec2 v) {
return min(v.x, v.y);
}\n\n"
property string rgb2grey: "
float rgb2grey(vec3 v) {
return dot(v, vec3(0.21, 0.72, 0.04));
}\n\n"
property string max2: "
float max2(vec2 v) {
return max(v.x, v.y);
}\n\n"
property string prod2: "
float prod2(vec2 v) {
return v.x * v.y;
}\n\n"
property string sum2: "
float sum2(vec2 v) {
return v.x + v.y;
}\n\n"
}

View File

@@ -23,6 +23,30 @@ import QtQuick 2.2
import "utils.js" as Utils
Item {
function dynamicFragmentPath() {
var rasterMode = appSettings.rasterization;
var burnInOn = appSettings.burnIn > 0 ? 1 : 0;
var frameOn = appSettings.frameEnabled ? 1 : 0;
var chromaOn = appSettings.chromaColor > 0 ? 1 : 0;
return "qrc:/shaders/terminal_dynamic_raster" + rasterMode +
"_burn" + burnInOn +
"_frame" + frameOn +
"_chroma" + chromaOn +
".frag.qsb";
}
function staticFragmentPath() {
var rgbShiftOn = appSettings.rgbShift > 0 ? 1 : 0;
var bloomOn = appSettings.bloom > 0 ? 1 : 0;
var curvatureOn = (appSettings.screenCurvature > 0 || appSettings.frameSize > 0) ? 1 : 0;
var shineOn = appSettings.frameShininess > 0 ? 1 : 0;
return "qrc:/shaders/terminal_static_rgb" + rgbShiftOn +
"_bloom" + bloomOn +
"_curve" + curvatureOn +
"_shine" + shineOn +
".frag.qsb";
}
property ShaderEffectSource source
property BurnInEffect burnInEffect
property ShaderEffectSource bloomSource
@@ -30,7 +54,8 @@ Item {
property color fontColor: appSettings.fontColor
property color backgroundColor: appSettings.backgroundColor
property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize
property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize * terminalWindow.normalizedWindowScale
property real frameSize: appSettings.frameSize * terminalWindow.normalizedWindowScale
property real chromaColor: appSettings.chromaColor
@@ -48,7 +73,7 @@ Item {
id: dynamicShader
property ShaderEffectSource screenBuffer: frameBuffer
property ShaderEffectSource burnInSource: burnInEffect.source
property ShaderEffectSource burnInSource: burnInEffect.effectSource
property ShaderEffectSource frameSource: terminalFrameLoader.item
property color fontColor: parent.fontColor
@@ -69,7 +94,6 @@ Item {
property real jitter: appSettings.jitter
property size jitterDisplacement: Qt.size(0.007 * jitter, 0.002 * jitter)
property real shadowLength: 0.25 * screenCurvature * Utils.lint(0.50, 1.5, ambientLight)
property real staticNoise: appSettings.staticNoise
property size scaleNoiseSize: Qt.size((width * 0.75) / (noiseTexture.width * appSettings.windowScaling * appSettings.totalFontScaling),
(height * 0.75) / (noiseTexture.height * appSettings.windowScaling * appSettings.totalFontScaling))
@@ -79,22 +103,13 @@ Item {
// Rasterization might display oversamping issues if virtual resolution is close to physical display resolution.
// We progressively disable rasterization from 4x up to 2x resolution.
property real rasterizationIntensity: Utils.smoothstep(2.0, 4.0, _screenDensity)
property int rasterizationMode: appSettings.rasterization
property real displayTerminalFrame: appSettings._frameMargin > 0 || appSettings.screenCurvature > 0
property real time: timeManager.time
property real time: timeManager ? timeManager.time : 0
property ShaderEffectSource noiseSource: noiseShaderSource
// Extra uniforms expected by the shared uniform block
property real screenShadowCoeff: 0
property real frameShadowCoeff: 0
property color frameColor: backgroundColor
property size margin: Qt.size(0, 0)
property real prevLastUpdate: burnInEffect.prevLastUpdate
property real screen_brightness: Utils.lint(0.5, 1.5, appSettings.brightness)
property real bloom: appSettings.bloom
property real rbgShift: (appSettings.rbgShift / Math.max(width, 1)) * appSettings.totalFontScaling
property real frameSize: parent.frameSize
property real frameShininess: appSettings.frameShininess
property real bloom: parent.bloomSource ? appSettings.bloom * 2.5 : 0
anchors.fill: parent
blending: false
@@ -116,7 +131,7 @@ Item {
}
vertexShader: "qrc:/shaders/terminal_dynamic.vert.qsb"
fragmentShader: "qrc:/shaders/terminal_dynamic.frag.qsb"
fragmentShader: dynamicFragmentPath()
onStatusChanged: if (log) console.log(log)
}
@@ -124,7 +139,7 @@ Item {
Loader {
id: terminalFrameLoader
active: dynamicShader.displayTerminalFrame
active: appSettings.frameEnabled
width: staticShader.width
height: staticShader.height
@@ -144,10 +159,6 @@ Item {
}
}
ShaderLibrary {
id: shaderLibrary
}
ShaderEffect {
id: staticShader
@@ -165,45 +176,17 @@ Item {
property real chromaColor: appSettings.chromaColor;
property real rbgShift: (appSettings.rbgShift / width) * appSettings.totalFontScaling
property int rasterization: appSettings.rasterization
property real rgbShift: appSettings.rgbShift * (4.0 / width) * appSettings.totalFontScaling
property real screen_brightness: Utils.lint(0.5, 1.5, appSettings.brightness)
property real ambientLight: parent.ambientLight
property size virtualResolution: parent.virtualResolution
// Extra uniforms to match shared uniform block
property real time: timeManager.time
property real shadowLength: 0
property real rasterizationIntensity: Utils.smoothstep(2.0, 4.0, _screenDensity)
property int rasterizationMode: appSettings.rasterization
property real burnInLastUpdate: burnInEffect.lastUpdate
property real burnInTime: burnInEffect.burnInFadeTime
property real burnIn: appSettings.burnIn
property real staticNoise: appSettings.staticNoise
property real glowingLine: appSettings.glowingLine * 0.2
property size jitterDisplacement: Qt.size(0, 0)
property real jitter: appSettings.jitter
property real horizontalSync: appSettings.horizontalSync
property real horizontalSyncStrength: Utils.lint(0.05, 0.35, horizontalSync)
property real flickering: appSettings.flickering
property real displayTerminalFrame: dynamicShader.displayTerminalFrame
property size scaleNoiseSize: Qt.size((width * 0.75) / (512 * appSettings.windowScaling * appSettings.totalFontScaling),
(height * 0.75) / (512 * appSettings.windowScaling * appSettings.totalFontScaling))
property real screenShadowCoeff: 0
property real frameShadowCoeff: 0
property color frameColor: backgroundColor
property size margin: Qt.size(0, 0)
property real prevLastUpdate: burnInEffect.prevLastUpdate
property real frameShininess: appSettings.frameShininess
property real frameSize: parent.frameSize
blending: false
visible: false
vertexShader: "qrc:/shaders/passthrough.vert.qsb"
fragmentShader: "qrc:/shaders/terminal_static.frag.qsb"
vertexShader: "qrc:/shaders/terminal_static.vert.qsb"
fragmentShader: staticFragmentPath()
onStatusChanged: if (log) console.log(log)
}

View File

@@ -21,15 +21,13 @@ import QtQuick 2.2
Rectangle {
property size terminalSize
property real topOpacity: 0.6
property real topOpacity: 0.5
width: textSize.width * 2
height: textSize.height * 2
radius: 5
border.width: 2
border.color: "white"
color: "black"
opacity: sizetimer.running ? 0.6 : 0.0
opacity: sizetimer.running ? 0.5 : 0.0
Behavior on opacity {
NumberAnimation {

View File

@@ -22,7 +22,7 @@ import QtQuick 2.2
import QtQuick.LocalStorage 2.0
QtObject {
readonly property string dbMajorVersion: "1"
readonly property string dbMajorVersion: "2"
readonly property string dbMinorVersion: "1.0"
property bool initialized: false

View File

@@ -25,8 +25,16 @@ import "utils.js" as Utils
ShaderTerminal {
property alias title: terminal.title
property alias terminalSize: terminal.terminalSize
signal sessionFinished()
property real devicePixelRatio: terminalWindow.screen.devicePixelRatio
property bool loadBloomEffect: appSettings.bloom > 0 || appSettings._frameShininess > 0
property bool hasFocus
onHasFocusChanged: {
if (hasFocus) {
activate()
}
}
id: mainShader
opacity: appSettings.windowOpacity * 0.3 + 0.7
@@ -35,25 +43,25 @@ ShaderTerminal {
burnInEffect: terminal.burnInEffect
virtualResolution: terminal.virtualResolution
screenResolution: Qt.size(
terminalWindow.width * devicePixelRatio * appSettings.windowScaling,
terminalWindow.height * devicePixelRatio * appSettings.windowScaling
terminalWindow.width * Screen.devicePixelRatio * appSettings.windowScaling,
terminalWindow.height * Screen.devicePixelRatio * appSettings.windowScaling
)
bloomSource: bloomSourceLoader.item
TimeManager {
id: timeManager
enableTimer: terminalWindow.visible
}
PreprocessedTerminal {
id: terminal
anchors.fill: parent
onSessionFinished: mainShader.sessionFinished()
}
function activate() {
terminal.mainTerminal.forceActiveFocus()
}
// EFFECTS ////////////////////////////////////////////////////////////////
Loader {
id: bloomEffectLoader
active: appSettings.bloom
active: loadBloomEffect
asynchronous: true
width: parent.width * appSettings.bloomQuality
height: parent.height * appSettings.bloomQuality
@@ -66,11 +74,12 @@ ShaderTerminal {
}
Loader {
id: bloomSourceLoader
active: appSettings.bloom !== 0
active: loadBloomEffect
asynchronous: true
sourceComponent: ShaderEffectSource {
id: _bloomEffectSource
sourceItem: bloomEffectLoader.item
wrapMode: ShaderEffectSource.Repeat
hideSource: true
smooth: true
visible: false

View File

@@ -22,53 +22,30 @@ import QtQuick 2.0
import "utils.js" as Utils
ShaderEffect {
property color _staticFrameColor: "#fff"
property color _staticFrameColor: Utils.sum(appSettings.frameColor, Qt.rgba(0.1, 0.1, 0.1, 1.0))
property color _backgroundColor: appSettings.backgroundColor
property color _fontColor: appSettings.fontColor
property color _lightColor: Utils.mix(_fontColor, _backgroundColor, 0.2)
property real _ambientLight: Utils.lint(0.2, 0.8, appSettings.ambientLight)
property color frameColor: Utils.mix(_staticFrameColor, _lightColor, _ambientLight)
property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize
// Coefficient of the log curve used to approximate shadowing
property real screenShadowCoeff: Utils.lint(20.0, 10.0, _ambientLight)
property real frameShadowCoeff: Utils.lint(20.0, 10.0, _ambientLight)
property size margin: Qt.size(
appSettings.frameMargin / width * appSettings.windowScaling,
appSettings.frameMargin / height * appSettings.windowScaling
property color frameColor: Utils.mix(
Utils.scaleColor(_lightColor, 0.2),
_staticFrameColor,
0.125 + 0.750 * ambientLight
)
// Uniforms required by the shared block
property real qt_Opacity: 1.0
property real time: timeManager.time
property color fontColor: appSettings.fontColor
property color backgroundColor: appSettings.backgroundColor
property real shadowLength: 0
property size virtualResolution: Qt.size(width, height)
property real rasterizationIntensity: 0
property int rasterizationMode: 0
property real burnInLastUpdate: 0
property real burnInTime: 0
property real burnIn: 0
property real staticNoise: 0
property real glowingLine: 0
property real chromaColor: 0
property size jitterDisplacement: Qt.size(0, 0)
property real ambientLight: _ambientLight
property real jitter: 0
property real horizontalSync: 0
property real horizontalSyncStrength: 0
property real flickering: 0
property real displayTerminalFrame: 0
property size scaleNoiseSize: Qt.size(0, 0)
property real screen_brightness: 1.0
property real bloom: 0
property real rbgShift: 0
property real prevLastUpdate: 0
property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize * terminalWindow.normalizedWindowScale
vertexShader: "qrc:/shaders/passthrough.vert.qsb"
property real frameShininess: appSettings.frameShininess
property real frameSize: appSettings.frameSize * terminalWindow.normalizedWindowScale
property real screenRadius: appSettings.screenRadius
property size viewportSize: Qt.size(width / appSettings.windowScaling, height / appSettings.windowScaling)
property real ambientLight: appSettings.ambientLight
vertexShader: "qrc:/shaders/terminal_frame.vert.qsb"
fragmentShader: "qrc:/shaders/terminal_frame.frag.qsb"
onStatusChanged: if (log) console.log(log) //Print warning messages

153
app/qml/TerminalTabs.qml Normal file
View File

@@ -0,0 +1,153 @@
/*******************************************************************************
* Copyright (c) 2013-2021 "Filippo Scognamiglio"
* https://github.com/Swordfish90/cool-retro-term
*
* This file is part of cool-retro-term.
*
* cool-retro-term is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQml.Models
Item {
id: tabsRoot
readonly property int innerPadding: 6
readonly property string currentTitle: tabsModel.get(currentIndex).title ?? "cool-retro-term"
property alias currentIndex: tabBar.currentIndex
readonly property int count: tabsModel.count
property size terminalSize: Qt.size(0, 0)
function normalizeTitle(rawTitle) {
if (rawTitle === undefined || rawTitle === null) {
return ""
}
return String(rawTitle).trim()
}
function addTab() {
tabsModel.append({ title: "" })
tabBar.currentIndex = tabsModel.count - 1
}
function closeTab(index) {
if (tabsModel.count <= 1) {
terminalWindow.close()
return
}
tabsModel.remove(index)
tabBar.currentIndex = Math.min(tabBar.currentIndex, tabsModel.count - 1)
}
ListModel {
id: tabsModel
}
Component.onCompleted: addTab()
ColumnLayout {
anchors.fill: parent
spacing: 0
Rectangle {
id: tabRow
Layout.fillWidth: true
height: rowLayout.implicitHeight
color: palette.window
visible: tabsModel.count > 1
RowLayout {
id: rowLayout
anchors.fill: parent
spacing: 0
TabBar {
id: tabBar
Layout.fillWidth: true
Layout.fillHeight: true
focusPolicy: Qt.NoFocus
Repeater {
model: tabsModel
TabButton {
id: tabButton
contentItem: RowLayout {
anchors.fill: parent
anchors { leftMargin: innerPadding; rightMargin: innerPadding }
spacing: innerPadding
Label {
text: model.title
elide: Text.ElideRight
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
}
ToolButton {
text: "\u00d7"
focusPolicy: Qt.NoFocus
padding: innerPadding
Layout.alignment: Qt.AlignVCenter
onClicked: tabsRoot.closeTab(index)
}
}
}
}
}
ToolButton {
id: addTabButton
text: "+"
focusPolicy: Qt.NoFocus
Layout.fillHeight: true
padding: innerPadding
Layout.alignment: Qt.AlignVCenter
onClicked: tabsRoot.addTab()
}
}
}
StackLayout {
id: stack
Layout.fillWidth: true
Layout.fillHeight: true
currentIndex: tabBar.currentIndex
Repeater {
model: tabsModel
TerminalContainer {
id: terminalContainer
hasFocus: terminalWindow.active && StackLayout.isCurrentItem
onTerminalSizeChanged: updateTerminalSize()
onTitleChanged: tabsModel.setProperty(index, "title", normalizeTitle(title))
Layout.fillWidth: true
Layout.fillHeight: true
onSessionFinished: tabsRoot.closeTab(index)
function updateTerminalSize() {
// Every tab will have the same size so we can simply take the first one.
if (index == 0) {
tabsRoot.terminalSize = terminalSize
}
}
}
}
}
}
}

View File

@@ -0,0 +1,88 @@
/*******************************************************************************
* Copyright (c) 2013-2021 "Filippo Scognamiglio"
* https://github.com/Swordfish90/cool-retro-term
*
* This file is part of cool-retro-term.
*
* cool-retro-term is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
import QtQuick 2.2
import QtQuick.Window 2.1
import QtQuick.Controls 2.3
import QtQml
import "menus"
ApplicationWindow {
id: terminalWindow
width: 1024
height: 768
// Show the window once it is ready.
Component.onCompleted: {
visible = true
}
minimumWidth: 320
minimumHeight: 240
visible: false
property bool fullscreen: false
onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed)
menuBar: qtquickMenuLoader.item
Loader {
id: qtquickMenuLoader
active: !appSettings.isMacOS && (appSettings.showMenubar && !fullscreen)
sourceComponent: WindowMenu { }
}
Connections {
target: newTabAction
enabled: terminalWindow.active
onTriggered: terminalTabs.addTab()
}
Connections {
target: fullscreenAction
enabled: terminalWindow.active
onTriggered: terminalWindow.fullscreen = !terminalWindow.fullscreen
}
property real normalizedWindowScale: 1024 / ((0.5 * width + 0.5 * height))
color: "#00000000"
title: terminalTabs.currentTitle
TerminalTabs {
id: terminalTabs
width: parent.width
height: (parent.height + Math.abs(y))
}
Loader {
anchors.centerIn: parent
active: appSettings.showTerminalSize
sourceComponent: SizeOverlay {
z: 3
terminalSize: terminalTabs.terminalSize
}
}
onClosing: {
appRoot.closeWindow(terminalWindow)
}
}

View File

@@ -0,0 +1,428 @@
Attribution-ShareAlike 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More_considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution-ShareAlike 4.0 International Public
License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-ShareAlike 4.0 International Public License ("Public
License"). To the extent this Public License may be interpreted as a
contract, You are granted the Licensed Rights in consideration of Your
acceptance of these terms and conditions, and the Licensor grants You
such rights in consideration of benefits the Licensor receives from
making the Licensed Material available under these terms and
conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. BY-SA Compatible License means a license listed at
creativecommons.org/compatiblelicenses, approved by Creative
Commons as essentially the equivalent of this Public License.
d. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
e. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
f. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
g. License Elements means the license attributes listed in the name
of a Creative Commons Public License. The License Elements of this
Public License are Attribution and ShareAlike.
h. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
i. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
j. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
k. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
l. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
m. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. Additional offer from the Licensor -- Adapted Material.
Every recipient of Adapted Material from You
automatically receives an offer from the Licensor to
exercise the Licensed Rights in the Adapted Material
under the conditions of the Adapter's License You apply.
c. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
b. ShareAlike.
In addition to the conditions in Section 3(a), if You Share
Adapted Material You produce, the following conditions also apply.
1. The Adapter's License You apply must be a Creative Commons
license with the same License Elements, this version or
later, or a BY-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the
Adapter's License You apply. You may satisfy this condition
in any reasonable manner based on the medium, means, and
context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms
or conditions on, or apply any Effective Technological
Measures to, Adapted Material that restrict exercise of the
rights granted under the Adapter's License You apply.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material,
including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.

View File

@@ -0,0 +1,93 @@
Copyright 20222024 Helena Zhang (helenazhang.com).
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & 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 Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) 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 the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
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
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", 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 THE
COPYRIGHT HOLDER 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.

View File

@@ -91,68 +91,3 @@ 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.
About
Free monospaced font with programming ligatures
Topics
font ligatures programming-ligatures
Resources
Readme
License
OFL-1.1 license
Activity
Stars
80.8k stars
Watchers
704 watching
Forks
3.2k forks
Report repository
Releases 29
6.2 Latest
on Dec 6, 2021
+ 28 releases
Used by 457
@bolabaden
@utkarshkrsingh
@elkozmon
@DVSB
@virtualtam
@techplayz32
@mecattaf
@MrTato
+ 449
Contributors 124
@tonsky
@thundernixon
@jsoref
@joshka
@davelab6
@thaliaarchi
@drify
@eltociear
@j-f1
@ollicle
@vorburger
@gjvnq
@Dominionized
@ShalokShalom
+ 110 contributors
Languages
Clojure 47.3%
Shell 22.4%
Python 18.5%
HTML 7.4%
CSS 2.5%
PureBasic 1.1%
Other 0.8%
Footer

Binary file not shown.

View File

@@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar
14 rue de Plaisance, 75014 Paris, France
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

Binary file not shown.

Binary file not shown.

View File

@@ -3,16 +3,30 @@ The work in the Hack project is Copyright 2018 Source Foundry Authors and licens
The work in the DejaVu project was committed to the public domain.
Bitstream Vera Sans Mono Copyright 2003 Bitstream Inc. and licensed under the Bitstream Vera License with Reserved Font Names "Bitstream" and "Vera"
MIT License
### MIT License
Copyright (c) 2018 Source Foundry Authors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
BITSTREAM VERA LICENSE
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
### BITSTREAM VERA LICENSE
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.

Binary file not shown.

View File

@@ -1,4 +1,6 @@
Copyright (c) 2011-2017, Ricardo Banffy.
Copyright 2022 The 3270font Authors (https://github.com/rbanffy/3270font)
Copyright (c) 2011-2022, Ricardo Banffy.
Copyright (c) 1993-2011, Paul Mattes.
Copyright (c) 2004-2005, Don Russell.
Copyright (c) 2004, Dick Altenbern.
@@ -10,27 +12,27 @@ Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Ricardo Banffy, Paul Mattes, Don Russell,
Dick Altenbern, Jeff Sparkes, GTRC nor the names of their contributors
may be used to endorse or promote products derived from this software
* Neither the name of Ricardo Banffy, Paul Mattes, Don Russell,
Dick Altenbern, Jeff Sparkes, GTRC nor the names of their contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL RICARDO BANFFY, PAUL MATTES, DON RUSSELL, DICK ALTENBERN, JEFF
SPARKES OR GTRC BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL RICARDO BANFFY, PAUL MATTES, DON RUSSELL, DICK ALTENBERN, JEFF
SPARKES OR GTRC BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The Debian Logo glyph is based on the Debian Open Use Logo and is

View File

@@ -1,4 +1,4 @@
Copyright (c) 2015-2025, Renzhi Li (aka. Belleve Invis, belleve@typeof.net)
Copyright (c) 2015-2023, Renzhi Li (aka. Belleve Invis, belleve@typeof.net)
This Font Software is licensed under the SIL Open Font License, Version 1.1.

View File

@@ -0,0 +1,22 @@
License
-------
The license for this font is:
♡ Copying is an act of love. Please copy.
Bitstream License:
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license (“Fonts”) and associated documentation files (the “Font Software”), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:
The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces.
The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words “Bitstream” or the word “Vera”.
This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the “Bitstream Vera” names.
The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", 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 BITSTREAM OR THE GNOME FOUNDATION 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.
Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org.

View File

@@ -0,0 +1,93 @@
Copyright 2010-2020 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & 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 Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) 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 the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
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
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", 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 THE
COPYRIGHT HOLDER 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.

View File

@@ -1,127 +1,97 @@
This package was debianized by Anton Zinoviev <zinoviev@debian.ort>.
It was downloaded from http://terminus-font.sourceforge.net/
Terminus Font is licensed under the SIL Open Font License, Version 1.1.
Copyright (c) 2010-2014 Dimitar Toshkov Zhekov,
with Reserved Font Name "Terminus Font".
To avoid name conflicts with other products named "Terminus", the
archive should be distributed as "Terminus Font", not "Terminus".
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & 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 Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) 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 the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
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
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", 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 THE
COPYRIGHT HOLDER 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.
=================================================================
The fonts from the package xfonts-terminus-oblique are automatically
generated from the fonts in xfonts-terminus using the script
bdfslant.pl. This script has the following copyright:
Copyright (C) 1994-95 Cronyx Ltd, author: Serge Vakulenko, <vak@cronyx.ru>
Changes Copyright (C) 1995-1997 by Andrey A. Chernov, Moscow, Russia.
Changes (C) 2000 by Serge Winitzki
This software may be used, modified, copied, distributed, and sold,
in both source and binary form provided that the above copyright
and these terms are retained. Under no circumstances is the author
responsible for the proper functioning of this software, nor does
the author assume any responsibility for damages incurred with its use.
=================================================================
The source package includes the bdftopsf.pl and ucstoany.pl utilities.
These are not used in order to build the binary Debian packages. They
are distributed under the GNU General Public License version 2.0 or
(at your choice) any later version. You should have received a copy
of the GNU General Public License with your Debian GNU/Linux system,
in /usr/share/common-licenses/GPL. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
Copyright (c) 2010 Dimitar Toshkov Zhekov,
with Reserved Font Name "Terminus Font".
Copyright (c) 2011-2021 Tilman Blumenbach,
with Reserved Font Name "Terminus (TTF)".
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & 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 Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) 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 the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
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
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", 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 THE
COPYRIGHT HOLDER 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.

View File

@@ -18,118 +18,92 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
import QtQuick 2.2
import QtQuick.Window 2.1
import QtQuick.Controls 2.3
import "menus"
ApplicationWindow {
id: terminalWindow
QtObject {
id: appRoot
width: 1024
height: 768
// Save window properties automatically
onXChanged: appSettings.x = x
onYChanged: appSettings.y = y
onWidthChanged: appSettings.width = width
onHeightChanged: appSettings.height = height
// Load saved window geometry and show the window
Component.onCompleted: {
x = appSettings.x
y = appSettings.y
width = appSettings.width
height = appSettings.height
visible = true
property ApplicationSettings appSettings: ApplicationSettings {
onInitializedSettings: appRoot.createWindow()
}
minimumWidth: 320
minimumHeight: 240
visible: false
property bool fullscreen: appSettings.fullscreen
onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed)
menuBar: qtquickMenuLoader.item
Loader {
id: qtquickMenuLoader
active: !appSettings.isMacOS && appSettings.showMenubar
sourceComponent: WindowMenu { }
property TimeManager timeManager: TimeManager {
enableTimer: windowsModel.count > 0
}
Loader {
id: globalMenuLoader
property SettingsWindow settingsWindow: SettingsWindow {
visible: false
}
property AboutDialog aboutDialog: AboutDialog {
visible: false
}
property Component windowComponent: Component {
TerminalWindow { }
}
property ListModel windowsModel: ListModel { }
property Loader globalMenuLoader: Loader {
active: appSettings.isMacOS
sourceComponent: OSXMenu { }
}
property string wintitle: appSettings.wintitle
color: "#00000000"
title: terminalContainer.title || qsTr(appSettings.wintitle)
Action {
id: showMenubarAction
text: qsTr("Show Menubar")
enabled: !appSettings.isMacOS
shortcut: "Ctrl+Shift+M"
checkable: true
checked: appSettings.showMenubar
onTriggered: appSettings.showMenubar = !appSettings.showMenubar
}
Action {
id: fullscreenAction
property Action fullscreenAction: Action {
text: qsTr("Fullscreen")
enabled: !appSettings.isMacOS
shortcut: "Alt+F11"
onTriggered: appSettings.fullscreen = !appSettings.fullscreen
checkable: true
checked: appSettings.fullscreen
}
Action {
id: quitAction
property bool initialFullscreenRequested: Qt.application.arguments.indexOf("--fullscreen") !== -1
property Action newWindowAction: Action {
text: qsTr("New Window")
shortcut: "Ctrl+Shift+N"
onTriggered: appRoot.createWindow()
}
property Action quitAction: Action {
text: qsTr("Quit")
shortcut: "Ctrl+Shift+Q"
onTriggered: Qt.quit()
onTriggered: appSettings.close()
}
Action {
id: showsettingsAction
property Action showsettingsAction: Action {
text: qsTr("Settings")
onTriggered: {
settingswindow.show()
settingswindow.requestActivate()
settingswindow.raise()
settingsWindow.show()
settingsWindow.requestActivate()
settingsWindow.raise()
}
}
Action {
id: copyAction
property Action copyAction: Action {
text: qsTr("Copy")
shortcut: "Ctrl+Shift+C"
}
Action {
id: pasteAction
property Action pasteAction: Action {
text: qsTr("Paste")
shortcut: "Ctrl+Shift+V"
}
Action {
id: zoomIn
property Action zoomInAction: Action {
text: qsTr("Zoom In")
shortcut: "Ctrl++"
onTriggered: appSettings.incrementScaling()
}
Action {
id: zoomOut
property Action zoomOutAction: Action {
text: qsTr("Zoom Out")
shortcut: "Ctrl+-"
onTriggered: appSettings.decrementScaling()
}
Action {
id: showAboutAction
property Action showAboutAction: Action {
text: qsTr("About")
onTriggered: {
aboutDialog.show()
@@ -137,34 +111,35 @@ ApplicationWindow {
aboutDialog.raise()
}
}
ApplicationSettings {
id: appSettings
property Action newTabAction: Action {
text: qsTr("New Tab")
}
TerminalContainer {
id: terminalContainer
width: parent.width
height: (parent.height + Math.abs(y))
function createWindow() {
var useFullscreen = initialFullscreenRequested
var window = windowComponent.createObject(null, { fullscreen: useFullscreen })
if (!window)
return
windowsModel.append({ window: window })
initialFullscreenRequested = false
window.show()
window.requestActivate()
}
SettingsWindow {
id: settingswindow
visible: false
}
AboutDialog {
id: aboutDialog
visible: false
}
Loader {
anchors.centerIn: parent
active: appSettings.showTerminalSize
sourceComponent: SizeOverlay {
z: 3
terminalSize: terminalContainer.terminalSize
function closeWindow(window) {
for (var i = 0; i < windowsModel.count; i++) {
if (windowsModel.get(i).window === window) {
windowsModel.remove(i)
break
}
}
window.destroy()
if (windowsModel.count === 0) {
appSettings.close()
}
}
onClosing: {
// OSX Since we are currently supporting only one window
// quit the application when it is closed.
if (appSettings.isMacOS)
Qt.quit()
}
}

View File

@@ -32,10 +32,15 @@ Menu {
action: showsettingsAction
}
MenuSeparator {}
Menu {
title: qsTr("File")
MenuItem {
action: newWindowAction
}
MenuItem {
action: newTabAction
}
MenuSeparator {}
MenuItem {
action: quitAction
}
@@ -60,14 +65,10 @@ Menu {
visible: fullscreenAction.enabled
}
MenuItem {
action: showMenubarAction
visible: showMenubarAction.enabled
action: zoomInAction
}
MenuItem {
action: zoomIn
}
MenuItem {
action: zoomOut
action: zoomOutAction
}
}
Menu {

View File

@@ -26,6 +26,17 @@ MenuBar {
Menu {
title: qsTr("File")
MenuItem {
text: newWindowAction.text
shortcut: newWindowAction.shortcut
onTriggered: newWindowAction.trigger()
}
MenuItem {
text: newTabAction.text
shortcut: newTabAction.shortcut
onTriggered: newTabAction.trigger()
}
MenuSeparator {}
MenuItem {
text: quitAction.text
onTriggered: quitAction.trigger()
@@ -53,14 +64,14 @@ MenuBar {
Menu {
title: qsTr("View")
MenuItem {
text: zoomIn.text
text: zoomInAction.text
shortcut: "Meta++"
onTriggered: zoomIn.trigger()
onTriggered: zoomInAction.trigger()
}
MenuItem {
text: zoomOut.text
text: zoomOutAction.text
shortcut: "Meta+-"
onTriggered: zoomOut.trigger()
onTriggered: zoomOutAction.trigger()
}
}
Menu {

View File

@@ -26,6 +26,13 @@ MenuBar {
Menu {
title: qsTr("File")
MenuItem {
action: newWindowAction
}
MenuItem {
action: newTabAction
}
MenuSeparator {}
MenuItem {
action: quitAction
}
@@ -50,14 +57,10 @@ MenuBar {
visible: fullscreenAction.enabled
}
MenuItem {
action: showMenubarAction
visible: showMenubarAction.enabled
action: zoomInAction
}
MenuItem {
action: zoomIn
}
MenuItem {
action: zoomOut
action: zoomOutAction
}
}
Menu {

View File

@@ -5,7 +5,7 @@
<file>CheckableSlider.qml</file>
<file>ApplicationSettings.qml</file>
<file>SettingsWindow.qml</file>
<file>Fonts.qml</file>
<file>TerminalWindow.qml</file>
<file>SettingsGeneralTab.qml</file>
<file>PreprocessedTerminal.qml</file>
<file>TimeManager.qml</file>
@@ -17,37 +17,98 @@
<file>main.qml</file>
<file>SettingsTerminalTab.qml</file>
<file>fonts/apple2/PrintChar21.ttf</file>
<file>fonts/ibm-3278/3270-Regular.ttf</file>
<file>fonts/ibm-3278/3270NerdFontMono-Regular.ttf</file>
<file>Storage.qml</file>
<file>SettingsAdvancedTab.qml</file>
<file>TerminalContainer.qml</file>
<file>TerminalTabs.qml</file>
<file>images/crt256.png</file>
<file>utils.js</file>
<file>images/allNoise512.png</file>
<file>fonts/fixedsys-excelsior/FSEX301-L2.ttf</file>
<file>fonts/cozette/CozetteVector.ttf</file>
<file>fonts/greybeard/Greybeard-16px.ttf</file>
<file>fonts/hack/Hack-Regular.ttf</file>
<file>fonts/fira-code/FiraCode-Medium.ttf</file>
<file>fonts/iosevka/IosevkaTerm-ExtendedMedium.ttf</file>
<file>fonts/jetbrains-mono/JetBrainsMono-Medium.ttf</file>
<file>fonts/gohu/GohuFont11NerdFontMono-Regular.ttf</file>
<file>fonts/hack/HackNerdFontMono-Regular.ttf</file>
<file>fonts/fira-code/FiraCodeNerdFontMono-Regular.ttf</file>
<file>fonts/bigblue-terminal/BigBlueTerm437NerdFontMono-Regular.ttf</file>
<file>fonts/iosevka/IosevkaTermNerdFontMono-Regular.ttf</file>
<file>fonts/jetbrains-mono/JetBrainsMonoNerdFontMono-Regular.ttf</file>
<file>../icons/32x32/cool-retro-term.png</file>
<file>Components/SizedLabel.qml</file>
<file>fonts/atari-400-800/AtariClassic-Regular.ttf</file>
<file>fonts/pet-me/PetMe64.ttf</file>
<file>fonts/pet-me/PetMe.ttf</file>
<file>BurnInEffect.qml</file>
<file>fonts/terminus/TerminusTTF-4.49.3.ttf</file>
<file>fonts/terminus/TerminessNerdFontMono-Regular.ttf</file>
<file>fonts/departure-mono/DepartureMonoNerdFontMono-Regular.otf</file>
<file>fonts/opendyslexic/OpenDyslexicMNerdFontMono-Regular.otf</file>
<file>fonts/source-code-pro/SauceCodeProNerdFontMono-Regular.ttf</file>
<file>TerminalFrame.qml</file>
<file>menus/WindowMenu.qml</file>
<file>menus/FullContextMenu.qml</file>
<file>menus/ShortContextMenu.qml</file>
<file>ShaderLibrary.qml</file>
<file>menus/OSXMenu.qml</file>
<file>../shaders/terminal_dynamic.vert.qsb</file>
<file>../shaders/terminal_dynamic.frag.qsb</file>
<file>../shaders/passthrough.vert.qsb</file>
<file>../shaders/terminal_static.frag.qsb</file>
<file>../shaders/terminal_static.vert.qsb</file>
<file>../shaders/terminal_frame.vert.qsb</file>
<file>../shaders/burn_in.vert.qsb</file>
<file>../shaders/terminal_dynamic_raster0_burn0_frame0_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster0_burn0_frame0_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster0_burn0_frame1_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster0_burn0_frame1_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster0_burn1_frame0_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster0_burn1_frame0_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster0_burn1_frame1_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster0_burn1_frame1_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster1_burn0_frame0_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster1_burn0_frame0_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster1_burn0_frame1_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster1_burn0_frame1_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster1_burn1_frame0_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster1_burn1_frame0_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster1_burn1_frame1_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster1_burn1_frame1_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster2_burn0_frame0_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster2_burn0_frame0_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster2_burn0_frame1_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster2_burn0_frame1_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster2_burn1_frame0_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster2_burn1_frame0_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster2_burn1_frame1_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster2_burn1_frame1_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster3_burn0_frame0_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster3_burn0_frame0_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster3_burn0_frame1_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster3_burn0_frame1_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster3_burn1_frame0_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster3_burn1_frame0_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster3_burn1_frame1_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster3_burn1_frame1_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster4_burn0_frame0_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster4_burn0_frame0_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster4_burn0_frame1_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster4_burn0_frame1_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster4_burn1_frame0_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster4_burn1_frame0_chroma1.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster4_burn1_frame1_chroma0.frag.qsb</file>
<file>../shaders/terminal_dynamic_raster4_burn1_frame1_chroma1.frag.qsb</file>
<file>../shaders/terminal_static_rgb0_bloom0_curve0_shine0.frag.qsb</file>
<file>../shaders/terminal_static_rgb0_bloom0_curve0_shine1.frag.qsb</file>
<file>../shaders/terminal_static_rgb0_bloom0_curve1_shine0.frag.qsb</file>
<file>../shaders/terminal_static_rgb0_bloom0_curve1_shine1.frag.qsb</file>
<file>../shaders/terminal_static_rgb0_bloom1_curve0_shine0.frag.qsb</file>
<file>../shaders/terminal_static_rgb0_bloom1_curve0_shine1.frag.qsb</file>
<file>../shaders/terminal_static_rgb0_bloom1_curve1_shine0.frag.qsb</file>
<file>../shaders/terminal_static_rgb0_bloom1_curve1_shine1.frag.qsb</file>
<file>../shaders/terminal_static_rgb1_bloom0_curve0_shine0.frag.qsb</file>
<file>../shaders/terminal_static_rgb1_bloom0_curve0_shine1.frag.qsb</file>
<file>../shaders/terminal_static_rgb1_bloom0_curve1_shine0.frag.qsb</file>
<file>../shaders/terminal_static_rgb1_bloom0_curve1_shine1.frag.qsb</file>
<file>../shaders/terminal_static_rgb1_bloom1_curve0_shine0.frag.qsb</file>
<file>../shaders/terminal_static_rgb1_bloom1_curve0_shine1.frag.qsb</file>
<file>../shaders/terminal_static_rgb1_bloom1_curve1_shine0.frag.qsb</file>
<file>../shaders/terminal_static_rgb1_bloom1_curve1_shine1.frag.qsb</file>
<file>../shaders/terminal_frame.frag.qsb</file>
<file>../shaders/burn_in.frag.qsb</file>
<file>fonts/unscii/unscii-8-thin.ttf</file>

View File

@@ -32,10 +32,29 @@ function lint(a, b, t) {
}
function mix(c1, c2, alpha) {
return Qt.rgba(c1.r * alpha + c2.r * (1-alpha),
c1.g * alpha + c2.g * (1-alpha),
c1.b * alpha + c2.b * (1-alpha),
c1.a * alpha + c2.a * (1-alpha))
return Qt.rgba(c1.r * (1 - alpha) + c2.r * alpha,
c1.g * (1 - alpha) + c2.g * alpha,
c1.b * (1 - alpha) + c2.b * alpha,
c1.a * (1 - alpha) + c2.a * alpha)
}
function sum(c1, c2) {
let result = Qt.rgba(
clamp(c1.r + c2.r, 0, 1),
clamp(c1.g + c2.g, 0, 1),
clamp(c1.b + c2.b, 0, 1),
clamp(c1.a + c2.a, 0, 1)
);
return result
}
function scaleColor(c1, value) {
return Qt.rgba(
clamp(c1.r * value, 0, 1),
clamp(c1.g * value, 0, 1),
clamp(c1.b * value, 0, 1),
clamp(c1.a, 0, 1)
);
}
function smoothstep(min, max, value) {

View File

@@ -6,35 +6,8 @@ layout(location = 0) out vec4 fragColor;
layout(std140, binding = 0) uniform ubuf {
mat4 qt_Matrix;
float qt_Opacity;
float time;
vec4 fontColor;
vec4 backgroundColor;
float shadowLength;
vec2 virtualResolution;
float rasterizationIntensity;
int rasterizationMode;
float burnInLastUpdate;
float burnInTime;
float burnIn;
float staticNoise;
float screenCurvature;
float glowingLine;
float chromaColor;
vec2 jitterDisplacement;
float ambientLight;
float jitter;
float horizontalSync;
float horizontalSyncStrength;
float flickering;
float displayTerminalFrame;
vec2 scaleNoiseSize;
float screen_brightness;
float bloom;
float rbgShift;
float screenShadowCoeff;
float frameShadowCoeff;
vec4 frameColor;
vec2 margin;
float prevLastUpdate;
};
@@ -52,12 +25,12 @@ void main() {
vec4 accColor = texture(burnInSource, coords);
float prevMask = accColor.a;
float currMask = rgb2grey(txtColor);
float blurDecay = clamp((burnInLastUpdate - prevLastUpdate) * burnInTime, 0.0, 1.0);
blurDecay = max(0.0, blurDecay - prevMask);
vec3 blurColor = accColor.rgb - vec3(blurDecay);
vec3 color = max(blurColor, txtColor);
vec3 color = max(accColor.rgb - vec3(blurDecay), txtColor);
float currMask = step(rgb2grey(color), rgb2grey(txtColor));
fragColor = vec4(color, currMask) * qt_Opacity;
}

Binary file not shown.

19
app/shaders/burn_in.vert Normal file
View File

@@ -0,0 +1,19 @@
#version 440
layout(location = 0) in vec4 qt_Vertex;
layout(location = 1) in vec2 qt_MultiTexCoord0;
layout(std140, binding = 0) uniform ubuf {
mat4 qt_Matrix;
float qt_Opacity;
float burnInLastUpdate;
float burnInTime;
float prevLastUpdate;
};
layout(location = 0) out vec2 qt_TexCoord0;
void main() {
qt_TexCoord0 = qt_MultiTexCoord0;
gl_Position = qt_Matrix * qt_Vertex;
}

Binary file not shown.

View File

@@ -26,15 +26,14 @@ layout(std140, binding = 0) uniform ubuf {
float horizontalSync;
float horizontalSyncStrength;
float flickering;
float displayTerminalFrame;
vec2 scaleNoiseSize;
float screen_brightness;
float bloom;
float rbgShift;
float screenShadowCoeff;
float rgbShift;
float frameShadowCoeff;
float frameShininess;
vec4 frameColor;
vec2 margin;
float frameSize;
float prevLastUpdate;
};

Binary file not shown.

View File

@@ -1,5 +1,18 @@
#version 440
#ifndef CRT_RASTER_MODE
#define CRT_RASTER_MODE 0
#endif
#ifndef CRT_BURN_IN
#define CRT_BURN_IN 1
#endif
#ifndef CRT_DISPLAY_FRAME
#define CRT_DISPLAY_FRAME 1
#endif
#ifndef CRT_CHROMA
#define CRT_CHROMA 1
#endif
layout(location = 0) in vec2 qt_TexCoord0;
layout(location = 1) in float vBrightness;
layout(location = 2) in float vDistortionScale;
@@ -13,10 +26,8 @@ layout(std140, binding = 0) uniform ubuf {
float time;
vec4 fontColor;
vec4 backgroundColor;
float shadowLength;
vec2 virtualResolution;
float rasterizationIntensity;
int rasterizationMode;
float burnInLastUpdate;
float burnInTime;
float burnIn;
@@ -25,21 +36,14 @@ layout(std140, binding = 0) uniform ubuf {
float glowingLine;
float chromaColor;
vec2 jitterDisplacement;
float ambientLight;
float jitter;
float horizontalSync;
float horizontalSyncStrength;
float flickering;
float displayTerminalFrame;
vec2 scaleNoiseSize;
float screen_brightness;
float frameShininess;
float frameSize;
float bloom;
float rbgShift;
float screenShadowCoeff;
float frameShadowCoeff;
vec4 frameColor;
vec2 margin;
float prevLastUpdate;
};
layout(binding = 0) uniform sampler2D noiseSource;
@@ -52,77 +56,86 @@ float prod2(vec2 v) { return v.x * v.y; }
float sum2(vec2 v) { return v.x + v.y; }
float rgb2grey(vec3 v) { return dot(v, vec3(0.21, 0.72, 0.04)); }
vec3 applyRasterization(vec2 screenCoords, vec3 texel, vec2 virtualRes, float intensity, int mode) {
if (intensity <= 0.0 || mode == 0) {
vec2 distortCoordinates(vec2 coords){
vec2 paddedCoords = coords * (vec2(1.0) + frameSize * 2.0) - frameSize;
vec2 cc = (paddedCoords - vec2(0.5));
float dist = dot(cc, cc) * screenCurvature;
return (paddedCoords + cc * (1.0 + dist) * dist);
}
vec3 applyRasterization(vec2 screenCoords, vec3 texel, vec2 virtualRes, float intensity) {
#if CRT_RASTER_MODE == 0 || CRT_RASTER_MODE == 4
return texel;
#else
if (intensity <= 0.0) {
return texel;
}
const float INTENSITY = 0.30;
const float BRIGHTBOOST = 0.30;
if (mode == 1) { // scanline
vec3 pixelHigh = ((1.0 + BRIGHTBOOST) - (0.2 * texel)) * texel;
vec3 pixelLow = ((1.0 - INTENSITY) + (0.1 * texel)) * texel;
#if CRT_RASTER_MODE == 1
vec3 pixelHigh = ((1.0 + BRIGHTBOOST) - (0.2 * texel)) * texel;
vec3 pixelLow = ((1.0 - INTENSITY) + (0.1 * texel)) * texel;
vec2 coords = fract(screenCoords * virtualRes) * 2.0 - vec2(1.0);
float mask = 1.0 - abs(coords.y);
vec2 coords = fract(screenCoords * virtualRes) * 2.0 - vec2(1.0);
float mask = 1.0 - abs(coords.y);
vec3 rasterizationColor = mix(pixelLow, pixelHigh, mask);
return mix(texel, rasterizationColor, intensity);
} else if (mode == 2) { // pixel
vec3 pixelHigh = ((1.0 + BRIGHTBOOST) - (0.2 * texel)) * texel;
vec3 pixelLow = ((1.0 - INTENSITY) + (0.1 * texel)) * texel;
vec3 rasterizationColor = mix(pixelLow, pixelHigh, mask);
return mix(texel, rasterizationColor, intensity);
#elif CRT_RASTER_MODE == 2
vec3 pixelHigh = ((1.0 + BRIGHTBOOST) - (0.2 * texel)) * texel;
vec3 pixelLow = ((1.0 - INTENSITY) + (0.1 * texel)) * texel;
vec2 coords = fract(screenCoords * virtualRes) * 2.0 - vec2(1.0);
coords = coords * coords;
float mask = 1.0 - coords.x - coords.y;
vec2 coords = fract(screenCoords * virtualRes) * 2.0 - vec2(1.0);
coords = coords * coords;
float mask = 1.0 - coords.x - coords.y;
vec3 rasterizationColor = mix(pixelLow, pixelHigh, mask);
return mix(texel, rasterizationColor, intensity);
} else if (mode == 3) { // subpixel
const float SUBPIXELS = 3.0;
vec3 offsets = vec3(3.141592654) * vec3(0.5, 0.5 - 2.0 / 3.0, 0.5 - 4.0 / 3.0);
vec3 rasterizationColor = mix(pixelLow, pixelHigh, mask);
return mix(texel, rasterizationColor, intensity);
#elif CRT_RASTER_MODE == 3
const float SUBPIXELS = 3.0;
vec3 offsets = vec3(3.141592654) * vec3(0.5, 0.5 - 2.0 / 3.0, 0.5 - 4.0 / 3.0);
vec2 omega = vec2(3.141592654) * vec2(2.0) * virtualRes;
vec2 angle = screenCoords * omega;
vec3 xfactors = (SUBPIXELS + sin(angle.x + offsets)) / (SUBPIXELS + 1.0);
vec2 omega = vec2(3.141592654) * vec2(2.0) * virtualRes;
vec2 angle = screenCoords * omega;
vec3 xfactors = (SUBPIXELS + sin(angle.x + offsets)) / (SUBPIXELS + 1.0);
vec3 result = texel * xfactors;
vec3 pixelHigh = ((1.0 + BRIGHTBOOST) - (0.2 * result)) * result;
vec3 pixelLow = ((1.0 - INTENSITY) + (0.1 * result)) * result;
vec3 result = texel * xfactors;
vec3 pixelHigh = ((1.0 + BRIGHTBOOST) - (0.2 * result)) * result;
vec3 pixelLow = ((1.0 - INTENSITY) + (0.1 * result)) * result;
vec2 coords = fract(screenCoords * virtualRes) * 2.0 - vec2(1.0);
float mask = 1.0 - abs(coords.y);
vec3 rasterizationColor = mix(pixelLow, pixelHigh, mask);
return mix(texel, rasterizationColor, intensity);
}
vec2 coords = fract(screenCoords * virtualRes) * 2.0 - vec2(1.0);
float mask = 1.0 - abs(coords.y);
vec3 rasterizationColor = mix(pixelLow, pixelHigh, mask);
return mix(texel, rasterizationColor, intensity);
#else
return texel;
#endif
#endif
}
float randomPass(vec2 coords){
return fract(smoothstep(-120.0, 0.0, coords.y - (virtualResolution.y + 120.0) * fract(time * 0.15)));
}
vec2 barrel(vec2 v, vec2 cc) {
float distortion = dot(cc, cc) * screenCurvature;
return (v - cc * (1.0 + distortion) * distortion);
}
vec3 convertWithChroma(vec3 inColor) {
vec3 outColor = fontColor.rgb * rgb2grey(inColor);
if (chromaColor != 0.0) {
outColor = fontColor.rgb * mix(vec3(rgb2grey(inColor)), inColor, chromaColor);
}
return outColor;
#if CRT_CHROMA == 1
float grey = rgb2grey(inColor);
float denom = max(grey, 0.0001);
vec3 foregroundColor = mix(fontColor.rgb, inColor * fontColor.rgb / denom, chromaColor);
return mix(backgroundColor.rgb, foregroundColor, grey);
#else
return mix(backgroundColor.rgb, fontColor.rgb, rgb2grey(inColor));
#endif
}
void main() {
vec2 cc = vec2(0.5) - qt_TexCoord0;
float distance = length(cc);
vec2 staticCoords = barrel(qt_TexCoord0, cc);
vec2 staticCoords = distortCoordinates(qt_TexCoord0);
vec2 coords = qt_TexCoord0;
float dst = sin((coords.y + time) * vDistortionFreq);
@@ -136,28 +149,32 @@ void main() {
color += noiseTexel.a * staticNoise * (1.0 - distance * 1.3);
color += randomPass(coords * virtualResolution) * glowingLine;
#if CRT_DISPLAY_FRAME == 1
vec4 frameColor = texture(frameSource, qt_TexCoord0);
color *= (1.0 - frameColor.a);
#endif
vec3 txt_color = texture(screenBuffer, txt_coords).rgb;
float bloomScale = 1.0 + max(bloom, 0.0);
txt_color *= bloomScale;
if (burnIn > 0.0) {
vec4 txt_blur = texture(burnInSource, staticCoords);
float blurDecay = clamp((time - burnInLastUpdate) * burnInTime, 0.0, 1.0);
vec3 burnInColor = 0.65 * (txt_blur.rgb - vec3(blurDecay));
txt_color = max(txt_color, convertWithChroma(burnInColor));
}
#if CRT_BURN_IN == 1
vec4 txt_blur = texture(burnInSource, staticCoords);
float blurDecay = clamp((time - burnInLastUpdate) * burnInTime, 0.0, 1.0);
vec3 burnInColor = 0.65 * (txt_blur.rgb - vec3(blurDecay)) * (1.0 - txt_blur.a);
txt_color = max(txt_color, burnInColor);
#endif
txt_color += fontColor.rgb * vec3(color);
txt_color = applyRasterization(staticCoords, txt_color, virtualResolution, rasterizationIntensity, rasterizationMode);
txt_color += vec3(color);
txt_color = applyRasterization(staticCoords, txt_color, virtualResolution, rasterizationIntensity);
vec3 finalColor = txt_color;
vec3 finalColor = convertWithChroma(txt_color);
float brightness = mix(1.0, vBrightness, step(0.0, flickering));
finalColor *= brightness;
finalColor += vec3(ambientLight) * (1.0 - distance) * (1.0 - distance);
if (displayTerminalFrame > 0.0) {
vec4 frameColor = texture(frameSource, qt_TexCoord0);
finalColor = mix(finalColor, frameColor.rgb, frameColor.a);
}
#if CRT_DISPLAY_FRAME == 1
finalColor = mix(finalColor, frameColor.rgb, frameColor.a);
#endif
fragColor = vec4(finalColor, qt_Opacity);
}

View File

@@ -9,10 +9,8 @@ layout(std140, binding = 0) uniform ubuf {
float time;
vec4 fontColor;
vec4 backgroundColor;
float shadowLength;
vec2 virtualResolution;
float rasterizationIntensity;
int rasterizationMode;
float burnInLastUpdate;
float burnInTime;
float burnIn;
@@ -21,21 +19,14 @@ layout(std140, binding = 0) uniform ubuf {
float glowingLine;
float chromaColor;
vec2 jitterDisplacement;
float ambientLight;
float jitter;
float horizontalSync;
float horizontalSyncStrength;
float flickering;
float displayTerminalFrame;
vec2 scaleNoiseSize;
float screen_brightness;
float frameShininess;
float frameSize;
float bloom;
float rbgShift;
float screenShadowCoeff;
float frameShadowCoeff;
vec4 frameColor;
vec2 margin;
float prevLastUpdate;
};
layout(binding = 0) uniform sampler2D noiseSource;

Some files were not shown because too many files have changed in this diff Show More