AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology

Home Page:https://avaloniaui.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom font family is not working in WebAssembly

amirhoseinadlfar opened this issue · comments

Describe the bug

in desktop :
image
in WebAssembly:
image

Is there any arabic/persian support for WebAssembly?

To Reproduce

code :
im using Avalonia.Markup.Declarative

protected override object Build()
{
    return new StackPanel()
        .Orientation(Orientation.Vertical)
        .Children(
            new TextBlock()
                .Text("نام کاربری"),
            new TextBox(),

            new TextBlock()
                .Text("رمزعبور"),
            new TextBox(),

            new TextBlock()
                .Text("تکرار رمزعبور"),
            new TextBox()
        );
}

font style :

    Styles.Add(new Style()
        .Selector(selector => selector.Is<TemplatedControl>())
        .Setter(TemplatedControl.FontFamilyProperty, new FontFamily("Nahid")));

font resource loading :

    //avares://AvaloniaClient/Assets/Fonts/Nahid.ttf
    FontFamily nahidFontFamily = new FontFamily(Assets.Fonts.NahidPath);

    Resources.Add("Nahid", nahidFontFamily);

Expected behavior

No response

Avalonia version

11.0.10

OS

WebAssembly

Additional context

font family is https://github.com/rastikerdar/nahid-font

without any font:
image
image
also, with default font, some characters like 'م' are not rendering correctly.

commented

can you try 11.1 beta? Please mind the breaking changes for browser when you do so (mentioned in 11.1 beta1 thread)