uno
uno copied to clipboard
Uno with Wpf Chinese code display messy code
Current behavior
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <TextBlock Text="你好,世界!" Margin="20" FontSize="30" /> </Grid>
Expected behavior
Environment
Uno.UI / Uno.UI.Skia, Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
Affected platforms
Skia (WPF)
IDE
Visual Studio 2019
IDE version
Microsoft Visual Studio Community 2019 16.11.2 Preview 1.0
Anything else we need to know?
I can set fontfamily for textblock and textbox controls to solve this problem, but setting fontfamily in contentdialog is invalid.
Affects Gtk as well.
@ywmoyue For ContentDialog, you can customise the TitleTemplate to change the used font.
@ywmoyue For ContentDialog, you can customise the TitleTemplate to change the used font.
Thanks, I can use this method to solve the problem
@jeromelaban Maybe I fix this by https://github.com/mono/SkiaSharp/pull/2146
Could you help me confirm this bug is fixed?
@lindexi once there's a working build for the SkiaSharp PR, we'll be able to validate if that helps.
@jeromelaban Thank you and My PR is merged. Could you help me confirm this bug is fixed?
@lindexi you'll need to either wait for an official skia build to be released in preview. You can upgrade all SkiaSharp packages in your uno project once those are available.
@jeromelaban Can I replace the output file ?
Looks like this has not been fixed in SkiaSharp 2.88.3 version
But I test the demo without UNO and I find the demo code work well. Demo code: https://github.com/lindexi/lindexi_gd/tree/0dc53049b7b74e57472408db161d2c066755bace/SkiaSharp/BihuwelcairkiDelalurnere
See https://github.com/mono/SkiaSharp/pull/2146
It seems that UNO still has bugs.
Uno is not using SKTextBlob
to render text, but rather HarfBuzz. How does an Uno app render text with your sample now?
@Jaiganeshkumaran Thank you and I just replace the output file.
My demo code: https://github.com/lindexi/lindexi_gd/tree/08c2d7c8da65ffbb1d873a9f4fdb21304a9c2688/TestUnoIslands
Yes, and I update it.
Thanks. I see that your app is using an older version of Uno, and it is not updated to the latest version of SkiaSharp. Can you do this and post a screenshot again?
@jeromelaban Yes, thank you. I'm worried that my testing method is wrong. Because my test method just replaces SkiaSharp.dll file
@jeromelaban Sorry, the bug still exists after I updated to 4.5.14 version
My demo code: https://github.com/lindexi/lindexi_gd/tree/4b484190536c301f94ee574f36925155b4a9773c/TestUnoIslands
Make sure to update SkiaSharp.
@jeromelaban Can I add <PackageReference Include="SkiaSharp" Version="2.88.3" />
to update the SkiaSharp?
Demo Code: https://github.com/lindexi/lindexi_gd/tree/613b6ec4fc7650fba9af341a090b653899d5cb63/TestUnoIslands
Thank you @jeromelaban
It is fixed !
Uno is not using
SKTextBlob
to render text, but rather HarfBuzz. How does an Uno app render text with your sample now?
Sorry, I can not get your point at first. And I do not update the SkiaSharp.Harfbuzz
at first.
How to fix it?
- Set the Chinese FontFamily to TextBlock
- Update the
SkiaSharp
andSkiaSharp.Harfbuzz
package
Great thanks for the update!
This works in Windows without changing the FontFamily. So if this is a requirement currently, then there is still a bug here.
It display messy code without set the Chinese FontFamily.
@lindexi But it works on UWP/WinUI right? Then I think this is still a bug @jeromelaban .
@Youssef1313 It works well in UWP and WPF without set the FontFamily
@lindexi whn you say WPF, do you mean an actual WPF app, not a Uno+WPF app? Either way, Skia is using the default system font at this point, and we'll probably fix this by switching to open-sans by default.
@jeromelaban I mean the raw WPF application without uno.
And I think we can set the global font by style. So it doesn't need to be repaired.