-
Notifications
You must be signed in to change notification settings - Fork 7
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
Issue with RTL language support #4
Comments
Could you test the patch (27e3d27) please?
Maybe it's that you changed |
Hi David, After testing in various language environments, I can confirm that your patch corrects the issue. Thanks for your rapid response to this problem.
|
Hello,
I have a WPF application that uses FluentIcons, and recently came across an interesting issue. A user sent me a screenshot of my application with all the icons either missing entirely or incorrectly positioned.
I struggled to reproduce the problem at first, but eventually tracked it down to his use of Arabic as his system display language.
I believe the problem is with this line of code in the SymbolIcon class:
_formattedText = new FormattedText( Symbol.ToString(IsFilled), CultureInfo.CurrentCulture, CultureInfo.CurrentCulture.TextInfo.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight, _font, FontSize, Foreground, VisualTreeHelper.GetDpi(this).PixelsPerDip);
As you can see, the FlowDirection of the FormattedText object is changed based on the current culture, but I believe WPF always defaults to FlowDirection.LeftToRight.
I pulled the code into a local repo and changed it to pass FlowDirection.LeftToRight as the third argument to the FormattedText constructor. Doing so resolved the problem, and allowed the icons to appear correctly on the user's Arabic language system.
Interestingly, even if I change the FlowDirection of my entire application the icons will only appear (on systems using Arabic language) if I use the code change described above. They never show otherwise, regardless of FlowDirection.
I'm not sure if my testing is thorough enough to warrant a permanent code change, but I wanted to share the results of my tests in case they help someone else.
The text was updated successfully, but these errors were encountered: