Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'x' character is replaced by multplication in TextBlock.Text (Avalonia 11.1.4) #17282

Closed
Kruno313 opened this issue Oct 15, 2024 · 7 comments
Closed
Labels
by-design The behavior reported in the issue is actually correct.

Comments

@Kruno313
Copy link

Kruno313 commented Oct 15, 2024

Describe the bug

I format my values as hexadecimal (with "0x" preamble) and output them on TextBlock.
I noticed that the x is replaced with an higher placed x, so "0x1A30" looks like multiplication operation. It is done only when x is between numbers.
It looks strange and it's wrong.

To Reproduce

<TextBlock Text="0x1234" />

It is obvious in designer.

Expected behavior

TextBlock should not change text. Searching and replacing makes it only slover for no benefit, making only problems.

Avalonia version

11.1.4

OS

Windows

Additional context

No response

@Kruno313 Kruno313 added the bug label Oct 15, 2024
@timunie
Copy link
Contributor

timunie commented Oct 15, 2024

please provide some sample code to reproduce

@Gillibald
Copy link
Contributor

This is just regular text shaping. Use a different font or disable the font feature.

@Kruno313
Copy link
Author

Kruno313 commented Oct 15, 2024

This is just regular text shaping. Use a different font or disable the font feature.

No, it is not. Text like "x0x23" has first x normal and second x changed.
I searched unicode table and found cyrilic x, 525 i think. Looks same as latin x. That is not changed.

@Kruno313
Copy link
Author

please provide some sample code to reproduce

It was not visible:
<TextBlock Text="0x1234" />

@maxkatz6
Copy link
Member

@Kruno313 since you haven't mentioned which font are you using, I assume it's Inter. Inter is a default font used in our templates.

I uploaded Inter font into https://fontdrop.info/ font viewer webapp, and input your text x0x1234.
image

Avalonia renders this text as expected from the font. I am closing this issue as by design.

TextBlock should not change text. Searching and replacing makes it only slover for no benefit, making only problems.

https://en.wikipedia.org/wiki/Ligature_(writing)

@maxkatz6 maxkatz6 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2024
@maxkatz6 maxkatz6 added by-design The behavior reported in the issue is actually correct. and removed bug labels Oct 15, 2024
@maxkatz6
Copy link
Member

@Kruno313 it's also possible to disable specific font features:

<TextBlock Text="x0x1234" FontFeatures="-calt" />

For a complete FontFeatures syntax, see https://harfbuzz.github.io/harfbuzz-hb-common.html#hb-feature-from-string

@Kruno313
Copy link
Author

Thanks.
I have never heard about this and never noticed it in Win-Framework or other Libraries (I use the Hexadecimal formatting often).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
by-design The behavior reported in the issue is actually correct.
Projects
None yet
Development

No branches or pull requests

4 participants