MartinTopfstedt/FontAwesome6

[WPF] Duotone icon glitch

Closed this issue · 2 comments

Source: FontAwesome6.Pro.Fonts 2.3.0 nuget package

Icons are being showed three times when trying to use Duotone icons. Works normally on anything else (top image)
image

Implementation using styles (middle image)

<dxa:AccordionItem Header="Remote Work Request"
                                           MouseUp="OnRemoteWorkRequestClick" 
                                           HeaderTemplate="{StaticResource IconHouseLaptop}"/>

 <Style TargetType="fa6:ImageAwesome" x:Key="DuotoneAwesomeIcon">
        <Setter Property="Width" Value="128" />
        <Setter Property="Height" Value="128" />
        <Setter Property="Margin" Value="5" />
        <Setter Property="SwapOpacity" Value="True" />
        <Setter Property="PrimaryOpacity" Value="1" />
        <Setter Property="SecondaryOpacity" Value="0.8" />
        <Setter Property="PrimaryColor" Value="{dxi:ThemeResource {themes:PaletteBrushThemeKey ResourceKey=Focused}}" />
        <Setter Property="SecondaryColor" Value="{dxi:ThemeResource {themes:PaletteBrushThemeKey ResourceKey=Backstage.Focused}}" />
    </Style>

Implementation without style (last image)

                                <DataTemplate >
                                    <StackPanel Orientation="Horizontal">
                                        <fa6:ImageAwesome Icon="Duotone_HouseLaptop"  
                                                      Width="128"
                                                      Height="128"
                                                      Margin="5"
                                                      SwapOpacity="True"
                                                      PrimaryOpacity="1"
                                                      SecondaryOpacity="0.8"
                                                      PrimaryColor="{dxi:ThemeResource {themes:PaletteBrushThemeKey ResourceKey=Focused}}"
                                                      SecondaryColor="{dxi:ThemeResource {themes:PaletteBrushThemeKey ResourceKey=Backstage.Focused}}" />
                                        <TextBlock Text="{Binding }"  
                                               Style="{StaticResource DataTemplateText}"/>
                                    </StackPanel>
                                </DataTemplate>

Hi,

how do you load the fonts? Are you loading the ttf fonts?

As far as i can tell the icon works in the Example for WPF.NetCore and WPF.NetFramework.

Hello,

I have used the desktop version as per readme from the FA site. Which was currently using .otf format. Used the web version instead as per your recommendation and it is now working as expected.

Thanks