Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] 4.7 Embedded ttf resource doesn't work in C# code #11310

Closed
EmilAlipiev opened this issue Jul 3, 2020 · 1 comment
Closed

[Bug] 4.7 Embedded ttf resource doesn't work in C# code #11310

EmilAlipiev opened this issue Jul 3, 2020 · 1 comment
Labels

Comments

@EmilAlipiev
Copy link
Contributor

Description

When I try to use below xaml code as C# code it is not working. Please find the attached repro.
Assembly[assembly: ExportFont("FontIcons.ttf", Alias = "FontIcons")]

I am using XF 4.7 and ttf is embeddedresource


    <ContentPage.ToolbarItems>
        <ToolbarItem >
            <ToolbarItem.IconImageSource>
                <FontImageSource Glyph="&#xe700;"
                                 Color="Orange"
                                 FontFamily="FontIcons"
                                 Size="44" />
            </ToolbarItem.IconImageSource>
        </ToolbarItem>
    </ContentPage.ToolbarItems>

C#

 var toolBarItem = new ToolbarItem
            { 
                Order = ToolbarItemOrder.Primary,
                IconImageSource = new FontImageSource(){
                    Glyph = "&#xe700;",
                    Color = Color.Yellow,
                    FontFamily = "FontIcons",
                    Size =   44
                }
            };

Steps to Reproduce

  1. Run the project in Android
  2. Main page has exaclty 2 ToolbarItem defined. 1 in xaml 1 in c# code behind. Xaml displays the icon from ttf, C# displays the code as text

Expected Behavior

C# displays also the code

Actual Behavior

Displays text

Basic Information

  • Platform Target Frameworks:

    • Android: 9 or 10
  • Nuget Packages: XF 4.7 latest

Reproduction Link

FontEmbedded 2.zip

@EmilAlipiev EmilAlipiev added s/unverified New report that has yet to be verified t/bug 🐛 labels Jul 3, 2020
@pauldipietro pauldipietro added this to New in Triage Jul 3, 2020
@PureWeen
Copy link
Contributor

PureWeen commented Jul 9, 2020

@EmilAlipiev specify the glyph like this in code

Glyph = "\ue700;",

and that should work

@PureWeen PureWeen closed this as completed Jul 9, 2020
Triage automation moved this from New to Closed Jul 9, 2020
@samhouts samhouts removed this from Closed in Triage Aug 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants