Skip to content

Fix Font Style on Windows and macOS#1799

Merged
ddennedy merged 4 commits intomasterfrom
fix-font-style
Mar 17, 2026
Merged

Fix Font Style on Windows and macOS#1799
ddennedy merged 4 commits intomasterfrom
fix-font-style

Conversation

@ddennedy
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to improve font style fidelity (especially on Windows and macOS) by explicitly tracking and applying a font’s styleName alongside the family, ensuring the UI dialogs and underlying rich text state stay consistent.

Changes:

  • Added fontStyleName as a QML-exposed property on QmlRichText and implemented getter/setter behavior.
  • Updated the rich text filter UI to round-trip styleName through the font dialog.
  • Updated TextFilterUi.qml to persist a separate shotcut:fontStyle property and normalize the font family passed into Qt.font().

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/qmltypes/qmlrichtext.h Exposes fontStyleName as a Q_PROPERTY for QML consumption.
src/qmltypes/qmlrichtext.cpp Implements reading/applying QFont::styleName() through cursor char formats.
src/qml/modules/Shotcut/Controls/TextFilterUi.qml Stores style name separately and adjusts family/style mapping when initializing the font dialog.
src/qml/filters/richtext/vui.qml Ensures rich text font dialogs set/apply styleName alongside family and size.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for preserving/setting a font’s Qt styleName across the rich text editor and text filter UIs to correct font style behavior on Windows and macOS.

Changes:

  • Expose fontStyleName as a new QML property on QmlRichText and implement getter/setter in C++.
  • Persist a new filter parameter shotcut:fontStyle and map it into/out of Qt.font() in TextFilterUi.qml.
  • Update the rich text font dialog wiring to round-trip styleName (and fix a seelctedFont typo).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/qmltypes/qmlrichtext.h Adds fontStyleName Q_PROPERTY, accessor, mutator, and notify signal.
src/qmltypes/qmlrichtext.cpp Implements fontStyleName() / setFontStyleName() and emits change notifications on reset.
src/qml/modules/Shotcut/Controls/TextFilterUi.qml Persists shotcut:fontStyle and uses it when initializing/updating the font dialog selection.
src/qml/filters/richtext/vui.qml Ensures font dialog round-trips styleName and fixes a typo accessing selectedFont.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ddennedy and others added 2 commits March 16, 2026 09:40
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves font style handling in Shotcut’s QML-based text UIs to better preserve/select platform-specific font variants (notably on Windows and macOS) by introducing and propagating a styleName concept.

Changes:

  • Added a fontStyleName Q_PROPERTY to QmlRichText and implemented getter/setter using QFont::styleName.
  • Updated TextFilterUi.qml to interpret the MLT style property as either normal/italic or a non-standard font style name, and to pass that into Qt.font({ styleName }).
  • Updated rich text UI to round-trip selectedFont.styleName and fixed a typo that prevented selectedFont.pointSize from being set.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/qmltypes/qmlrichtext.h Exposes fontStyleName to QML via a new property + signal/slot.
src/qmltypes/qmlrichtext.cpp Implements reading/applying font styleName on the current text cursor format.
src/qml/modules/Shotcut/Controls/TextFilterUi.qml Updates text filter font selection to preserve non-standard style names via the existing style property.
src/qml/filters/richtext/vui.qml Propagates styleName into/out of the font dialog and fixes a misspelled selectedFont reference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ddennedy ddennedy added this to the Next Release milestone Mar 16, 2026
@ddennedy ddennedy merged commit 578ec08 into master Mar 17, 2026
6 checks passed
@ddennedy ddennedy deleted the fix-font-style branch March 17, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants