-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Labels
Description
Describe the bug
I found that Avalonia's TextBox caret and hit-testing behave incorrectly for certain fonts. When using Calibri and typing "ti", the caret movements and mouse hit-testing treat "ti" (as the Standard Ligatures ‘liga’ words) like a single character (the caret jumps over the "ti" pair and you cannot place the caret between them). The same font behaves correctly in WPF.
To Reproduce
Steps to reproduce
- Create an Avalonia window with a TextBox.
- Set the FontFamily to "Calibri".
- Type the text: ti
- Press the left/right arrow keys or try to click between the characters with the mouse.
The main code is:
<TextBox Margin="10,10,10,10" FontSize="30" FontFamily="Calibri" Text="tia"></TextBox>
You can find all code in https://github.com/lindexi/lindexi_gd/tree/7c3c7e35c93f7a0dd3ae8f08a04257f20ecaf8c2/AvaloniaIDemo/JeheryucereceruNejukicairloru
The current behavior is:
Expected behavior
Work as WPF:

Avalonia version
Any
OS
No response
Additional context
Reference: https://stackoverflow.com/questions/62552451/why-harfbuzz-shape-2-single-char-into-one-glyph