Skip to content

Try to normalize family names for embedded fonts#15703

Merged
grokys merged 7 commits intoAvaloniaUI:masterfrom
Gillibald:fixes/fontLoading
May 24, 2024
Merged

Try to normalize family names for embedded fonts#15703
grokys merged 7 commits intoAvaloniaUI:masterfrom
Gillibald:fixes/fontLoading

Conversation

@Gillibald
Copy link
Copy Markdown
Contributor

@Gillibald Gillibald commented May 13, 2024

  • Allow loading typefaces with a family name that includes known keywords like Bold, Black, etc.
  • Make sure we filter out null family names when we call SKFontManager.GetInstalledFontFamilyNames
  • Normalize family names specified via fontSource#FamilyName so known keywords are filtered out before caching them in the font collection.

What does the pull request do?

What is the current behavior?

What is the updated/expected behavior with this PR?

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

@avaloniaui-bot
Copy link
Copy Markdown

You can test this PR using the following package version. 11.2.999-cibuild0048372-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@cla-avalonia
Copy link
Copy Markdown
Collaborator

cla-avalonia commented May 13, 2024

  • All contributors have signed the CLA.

@Gillibald
Copy link
Copy Markdown
Contributor Author

@cla-avalonia agree

@Gillibald Gillibald changed the title Try to normalize family names for embedded fonts [WIP] Try to normalize family names for embedded fonts May 13, 2024
@Gillibald Gillibald changed the title [WIP] Try to normalize family names for embedded fonts Try to normalize family names for embedded fonts May 21, 2024
@avaloniaui-bot
Copy link
Copy Markdown

You can test this PR using the following package version. 11.2.999-cibuild0048566-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@grokys grokys added this pull request to the merge queue May 24, 2024
Merged via the queue into AvaloniaUI:master with commit 1121879 May 24, 2024
@maxkatz6 maxkatz6 added the bug label Aug 9, 2024
foriequal0 added a commit to foriequal0/MSBuildStructuredLog that referenced this pull request Jan 31, 2026
Prior to Avalonia 11.2.0, it wasn't able to use "Monospace" on Linux.
The change AvaloniaUI/Avalonia#15703
shipped in 11.2.0 fixes that.

On Linux, fonts are resolved using fontconfig library.
It can be configured by defining match patterns in fonts.conf.
So, generic family names such as "Monospace" are usually
defined as match pattern.

Prior to the change, this line prevented Avalonia to use
correctly resolved font for the generic family name,
although underlying library (Skia) resolved the correct font.

AvaloniaUI/Avalonia@1121879#diff-047c1353fd5bbb011dbd2dea7c1d1a021f0fcfe583f6b9d4d0ab5888b67302f2L59
foriequal0 added a commit to foriequal0/MSBuildStructuredLog that referenced this pull request Jan 31, 2026
Prior to Avalonia 11.2.0, it wasn't able to use "Monospace" on Linux.
The change AvaloniaUI/Avalonia#15703
shipped in 11.2.0 fixes that.

On Linux, fonts are resolved using fontconfig library.
It can be configured by defining match patterns in fonts.conf.
So, generic family names such as "Monospace" are usually
defined as match patterns.

Prior to the change, this line prevented Avalonia to use
correctly resolved font for the generic family name,
although the underlying library (Skia) resolved the correct font.

AvaloniaUI/Avalonia@1121879#diff-047c1353fd5bbb011dbd2dea7c1d1a021f0fcfe583f6b9d4d0ab5888b67302f2L59
foriequal0 added a commit to foriequal0/MSBuildStructuredLog that referenced this pull request Jan 31, 2026
Prior to Avalonia 11.2.0, it wasn't able to use "Monospace" on Linux.
The change AvaloniaUI/Avalonia#15703
shipped in 11.2.0 fixes that.

On Linux, fonts are resolved using fontconfig library.
It can be configured by defining match patterns in fonts.conf.
So, generic family names such as "Monospace" are usually
defined as match patterns.

Prior to the change, this line prevented Avalonia from using
the correctly resolved font for the generic family name,
although the underlying library (Skia) resolved the correct font.

AvaloniaUI/Avalonia@1121879#diff-047c1353fd5bbb011dbd2dea7c1d1a021f0fcfe583f6b9d4d0ab5888b67302f2L59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants