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

get custom typeface is no ok in blazor wasm environment #251

Open
ttet00 opened this issue Nov 23, 2024 · 0 comments
Open

get custom typeface is no ok in blazor wasm environment #251

ttet00 opened this issue Nov 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ttet00
Copy link

ttet00 commented Nov 23, 2024

hi, boss,
I am using Svg.Skia to draw a svg to canvas in blazor wasm, and my svg file have a text and the font-family is PingFang SC,I am trying to load this typeface to application by method: Loading custom typeface

I see the result of loading typeface is ok, but can not get typeface when painting the svg to canvas.
I study the code, and found the typeface is got from SkiaSharp.SKFontManager.Default at SkiaAssetLoader.cs line 38.

SkiaSharp.SKFontManager.Default can got typeface from OS, but in WASM, it is not work.

Is there a good way to solve this problem?
thank you for your great work

here is my svg content:

<svg width="75" height="38" viewBox="0 0 75 38" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect opacity="0.35" width="68" height="38" rx="8" fill="black"/>
<mask id="mask0_139_54" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="68" height="38">
<rect width="68" height="38" rx="8" fill="white"/>
</mask>
<g mask="url(#mask0_139_54)">
<rect width="60" height="38" fill="black"/>
</g>
<path opacity="0.4" fill-rule="evenodd" clip-rule="evenodd" d="M70.6387 13.1367C73.1547 14.1909 74.8772 16.3362 74.8772 18.8112C74.8772 21.2863 73.1547 23.4316 70.6387 24.4858V13.1367Z" fill="black"/>
<text fill="white"  font-family="PingFang SC" font-weight="400" font-size="35"  x="13.1697" y="31.32" >49</text>
</svg>
@wieslawsoltes wieslawsoltes added the bug Something isn't working label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants