0

I have a custom font that I add on my project and I make it work. This is how it look like in the editor with the WPF code :

    <TextBlock Style="{StaticResource ArabicFont1}" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="30" HorizontalAlignment="Right">
        <Run Text="{Binding text_arabe}"/>
    </TextBlock>

Font displayed on the editor

But when I start the app, this is what font I have, with the exact same text :

Font when the app is started

So as you can see it's two different font, but in the editor, it show the right one and in the software the default one

So I don't really understand, can someone help me with this, please?

Thank you

If it can help- here is the app.xml

    <Application.Resources>
    
    <Style x:Key="ArabicFont1">
        <Setter Property="TextElement.FontFamily"
        Value="pack://application:,,,/fonts/#noorehidayat" />
    </Style>
    
</Application.Resources>

1 Answers1

0

You need to make sure that the font is installed on the executing system or the font is found in the execution folder of your application.

Please look at this example, maybe this will help you: Use custom fonts in wpf c# applications

Robert Wolf
  • 191
  • 1
  • 11