Fix external font handling in UIFontPickerDialog

Preserve explicitly selected font styles and correctly reconcile external fonts with the asynchronously loaded system font list.

Group same-family external fonts under the Style column when styles are visible, and expose them as distinct family entries when styles are hidden. Include filenames in localized external-font labels to distinguish alternate
font versions.

Ensure system-listed regular faces remain available after asynchronous loading and add regression coverage for collisions, selection, and hidden style behavior.
This commit is contained in:
Martín Lucas Golini
2026-08-14 13:52:55 -03:00
parent f8cef977d6
commit 1b901eaa02
8 changed files with 179 additions and 29 deletions
+2 -1
View File
@@ -105,7 +105,8 @@ void FontPickerController::openFontDialog( std::string& fontPath, bool loadingMo
defaultResourceScope().publishLocalFont( std::move( fontName ), font );
};
const Uint32 flags = ( pickFontSize ? UIFontPickerDialog::ShowSize : 0 ) |
const Uint32 flags = UIFontPickerDialog::ShowStyle |
( pickFontSize ? UIFontPickerDialog::ShowSize : 0 ) |
( loadingMonoFont ? UIFontPickerDialog::MonospaceOnly : 0 );
UIFontPickerDialog* dialog = UIFontPickerDialog::New( flags );
dialog->setTitle( mApp->i18n( "select_font", "Select Font" ) );