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

Summation two cyrillic symbols. #129

Closed
TyupkinV opened this issue Apr 16, 2018 · 7 comments
Closed

Summation two cyrillic symbols. #129

TyupkinV opened this issue Apr 16, 2018 · 7 comments

Comments

@TyupkinV
Copy link

Hello, there was a problem with the application of arithmetic operations to \text {} with Cyrillic. The screenshots show the problem. If you put English characters in \text or or put into another operator
everything works fine. Use in WPF C# .NET 4.5.2
err
fine

@ForNeVeR
Copy link
Owner

For me, English characters doesn't work inside \text either:
image

But it's actually a bug, you're right. SystemFont (which is used for \text rendering) is a rather simple class. That's why it doesn't try to determine actual font metrics and just returns whatever System.Windows.Media.FormattedText tells it: https://github.com/ForNeVeR/wpf-math/blob/380507cc15b0d6f1b43cafa98d7d7b360c0ff03c/src/WpfMath/SystemFont.cs#L113-L122

@TheOneAmir
Copy link
Contributor

TheOneAmir commented Apr 18, 2018

The problem is occurring because even though the Cyrillic symbols are inside "\Text{}", they are considered as SystemFont instead of DefaultTexFont by RowAtom.cs. As a result, the function to GetFontMetrics() inside SystemFont.cs is never called. DefaultTexFont works for the first 256 characters but will fail for any character if a symbol is added afterwards.

By adding a check inside RowAtom.cs for the Element.TextStyle, we actually can avoid the incorrect usage of DefaultTexFont for rendering the Cyrillic characters.

PR at: #130

@ForNeVeR
Copy link
Owner

I am sorry, guys, my initial understanding of the problem was wrong. @TheOneAmir, your patch actually fixes the problem, thank you!

ForNeVeR added a commit to TheOneAmir/wpf-math that referenced this issue Apr 22, 2018
ForNeVeR pushed a commit to TheOneAmir/wpf-math that referenced this issue Apr 29, 2018
ForNeVeR added a commit to TheOneAmir/wpf-math that referenced this issue Apr 29, 2018
ForNeVeR added a commit to TheOneAmir/wpf-math that referenced this issue Apr 29, 2018
ForNeVeR added a commit to TheOneAmir/wpf-math that referenced this issue Apr 29, 2018
ForNeVeR added a commit to TheOneAmir/wpf-math that referenced this issue Apr 29, 2018
ForNeVeR added a commit to TheOneAmir/wpf-math that referenced this issue May 5, 2018
@ForNeVeR
Copy link
Owner

ForNeVeR commented May 5, 2018

Guys, please notify me if you want the fixed version to be released on NuGet.

@TyupkinV
Copy link
Author

TyupkinV commented May 5, 2018 via email

@ForNeVeR
Copy link
Owner

ForNeVeR commented May 6, 2018

Alright, got it. I'll prepare a NuGet release soon (in the next 48 hours).

Regarding everything else I'll contact you by email.

@ForNeVeR
Copy link
Owner

ForNeVeR commented May 8, 2018

@TyupkinV WPF-Math 0.5.0 is live on NuGet.

Thanks to all the contributors (issue reporters included)!

Please report any additional issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants