Skip to content

Crash rendering a rare Chinese character #20675

@kerams

Description

@kerams

Describe the bug

Some built-in iOS font (both physical device and iPhone 16 iOS 18.5 simulator) doesn't align with format assumptions in Avalonia's font processing, causing a hard crash when looking for fallback fonts for an unusual character. On Android the character is not rendered at all. Not ideal (a placeholder would've been better), but at least the application continues to work.

To Reproduce

Add <TextBlock FontSize="24" TextWrapping="Wrap">e 𪜶</TextBlock> to SafeAreaDemo/MainView.xaml, launch, get InvalidOperationException("No suitable cmap subtable found.")

Expected behavior

Gracefully handle such typeface loading failures, and use a placeholder for 𪜶 if no glyph is found,

Avalonia version

master

OS

iOS 17.7, 18.5

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions