-
Notifications
You must be signed in to change notification settings - Fork 601
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
[Uno WASM] Setting font crashes runtime #1784
Comments
I also tried embedding the Arial font into the project and using that with the same result. |
Doing |
The problem is here: LiveCharts2/src/skiasharp/LiveChartsCore.SkiaSharp/Drawing/Geometries/LabelGeometry.cs Line 72 in fc8320b
It crashes when it tries to load the harfbuzz library to create the SKShaper. Not sure what the fix is though. |
Adding this to the project fixed the issue: <ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'browserwasm'">
<PackageReference Include="HarfBuzzSharp.NativeAssets.WebAssembly" Version="7.3.0.3" />
</ItemGroup> Out of curiosity - why does it need the shaper only for non-default fonts? |
Describe the bug
Changing the font from the default crashes the runtime when a chart is first drawn.
To Reproduce
Using:
The above code successfully loads the Open Sans font that is the default on Uno WASM into
DefaultSKTypeface
, but if it is used anywhere in LiveCharts, such as setting it on an axis label or setting it globally like:Then the runtime crashes as per above as soon as a page with a chart is shown. The code above works fine on WinUI and Desktop targets. Commenting out the line that sets the typeface stops the app from crashing and showing any of the errors indicated above in the console.
Expected behavior
A clear and concise description of what you expected to happen.
Desktop (please complete the following information):
Additional context
Tested with both
rc4.5
andrc5.1
.The text was updated successfully, but these errors were encountered: