Giter Site home page Giter Site logo

martintopfstedt / fontawesome6 Goto Github PK

View Code? Open in Web Editor NEW
73.0 5.0 11.0 7.18 MB

WPF (.Net and .Net Core), UWP and WinUI controls for the web's most popular icon set and toolkit.

License: MIT License

Batchfile 0.01% C# 100.00%
fontawesome6 wpf winui uwp fontawesome

fontawesome6's People

Contributors

lafleurh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fontawesome6's Issues

How to use FontAwesome6.Pro.Svg

Hello!

The FontAwesome6.Pro.Svg "Setup" of your documentation steps seems to be missing, the Setup only exist for Fonts.
I'm using WPF and have correctly generated the json file, and use the following to load the SVGs:

FontAwesome6.Svg.FontAwesomeSvg.LoadFromDirectory(ProgramConstants.FONT_AWESOME_FILE);

This works when the program is compiled, but when designing and building my XAML UI, I receive dozens of errors: "Couldn't load icon "ICON NAME". Please load the svg data for that icon first". As the icons are only loaded after compile, I understand the error. But what is the solution?

Perhaps using FontAwesome6.Svg.FontAwesomeSvg.LoadFromResource() will solve this problem, but I can't get this to work.

I've added the json as both Embedded Resource, Resource and even Content, but and am using:
FontAwesome6.Svg.FontAwesomeSvg.LoadFromResource("/Resources/FontAwesome6Svg.json", System.Reflection.Assembly.GetExecutingAssembly());

But that line of code still generates the following error on compile:
System.ArgumentNullException: 'Value cannot be null. Parameter name: stream'

Thanks for your help!

Duotone on some icons doesn't take second color

Some icons appear to not be configured for the secondary color when using Duotone mode.

Here is one example that doesn't respond to the second color (this renders in Firebrick but doesn't fill the square in white:

<fa6:ImageAwesome Icon="Duotone_CircleStop"
           Height="18"
           Margin="0 1 6 0"                                                                                                                                          
           SecondaryColor="Firebrick"
           PrimaryColor="White" 
           />

image

All of the icons you see are using Duotone with two colors and it works, except for the Stop icon. The icon does have a duotone mode in FontAwesome.

I've run into this with a few others as well, but I can't recall which ones at this point. It's fairly rare.

Other

I'm using FontAwesome6 Pro icons in font mode.

How to use this?

First of all, thank you! I'm trying to use this but this is not very straight forward. There is no clear step-by-step installation. Readme is very comprehensive but it's also confusing. There is multiple methods overlapping with each other. Pretending that installation was successful, how can I use this as icon? Especially for or ? As trying to use the glyphs didn't work, I looked for alternatives and found this however I don't understand how to use it. Readme says check examples for advanced usage, the examples are very shorts and don't work.

WINUI examples doesn't work for me (VS 2022)

After installing nuget packages of FontAwesome6.Fonts.WinUI and FontAwesome6.Svg.WinUI the shown examples like:

<Window x:Class="FontAwesome6.Example.WPF.MainWindow" xmlns:fa="http://schemas.fontawesome.com/icons/svg"> <fa:ImageAwesome Icon="Solid_Flag" /> <fa:SvgAwesome Icon="Solid_Flag" /> </Window>

do not work for me as the xmlns is not recognized.

After some fiddling I found this working instead:

xmlns:fa6="using:FontAwesome6.Svg"
<fa6:SvgAwesome  Icon="Regular_CircleStop" />

Recommend to either fix the nuget registration or just the docu ;-) Thx anyway!

[WinUI] The 'Icon' property that can be attached was not found in type 'SvgAwesome'.

Using the attached property SvgAwesome.Icon does not work.

<Button svg:SvgAwesome.Icon="Soild_Flags"/>

grafik

*.csproj

  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net6.0-windows10.0.18362.0</TargetFramework>
    <TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
    <RootNamespace>HtSuite.WinUI.Leitstand</RootNamespace>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <Platforms>x86;x64;arm64</Platforms>
    <RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
    <PublishProfile>win10-$(Platform).pubxml</PublishProfile>
    <UseWinUI>true</UseWinUI>
    <EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
    <WindowsPackageType>None</WindowsPackageType>
    <SupportedOSPlatformVersion>10.0.18362.0</SupportedOSPlatformVersion>
  </PropertyGroup>

Strong naming

Would it be possible to strong name the Fonts & Svg libraries?

DevExpress XAML designer issue

Thanks for the new FA6 package, much appreciated.

I've use DevExpress controls extensively, and got my application up and running fine. However I'm getting a XAML designer errors because of the changes to the ImageSourceConverter.

image

image

image

Is there a way around this? Should I create my own ImageSourceConverter which inherits MarkupExtension like FA5 does?

FA6
image

FA5
image

reduce TargetFramework to net6.0-windows10.0.18362.0

I would like to install the package for my project, but I can't go to a version higher than net6.0-windows10.0.18362.0 because Resharper (https://youtrack.jetbrains.com/issue/RSRP-487429) is currently incompatible with it.

So would it be possible to adapt TargetFramework to net6.0-windows10.0.18362.0?

<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>

Font doesn`t works

I met problem with free font version on .NET 6.0. I``ve done everything like in tutorial, but icons don`t want to appear
xmlns link:
image_2022-04-23_201031873
Button front:
image_2022-04-23_201000060
Runtime result:
image_2022-04-23_200906401

[WinUI] FontAwesome is not beeing rendered

Seems to be the same issue like #9 but with WinUI

  xmlns:fonts="using:FontAwesome6.Fonts"
  mc:Ignorable="d"
  Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

  <StackPanel Orientation="Vertical" Spacing="20">
    
    <fonts:FontAwesome Icon="Solid_TriangleExclamation" />
    <FontIcon FontFamily="Segoe UI Emoji" Glyph="&#x1F514;" />
  </StackPanel>

grafik

*.csproj

  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net6.0-windows10.0.18362.0</TargetFramework>
    <TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
    <RootNamespace>HtSuite.WinUI.Leitstand</RootNamespace>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <Platforms>x86;x64;arm64</Platforms>
    <RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
    <PublishProfile>win10-$(Platform).pubxml</PublishProfile>
    <UseWinUI>true</UseWinUI>
    <EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
    <WindowsPackageType>None</WindowsPackageType>
    <SupportedOSPlatformVersion>10.0.18362.0</SupportedOSPlatformVersion>
  </PropertyGroup>

How to stretch the icon?

I want to set an arrow icon for a button. Besides, I want to adjust the thickness by stretching the SVG image. How to realize it?

  <Grid Width="400" Height="300" >
      <Rectangle Stroke="BurlyWood" StrokeThickness="2"  StrokeDashArray="4 2"/>
      <Image fa6:FontAwesome.Icon="Solid_ArrowRightLong" width="40"/>
  </Grid>

Building locally and/or nuget package?

I'd like to use this. ARE there plans for a nuget package?

If not, how does one build this locally; I pulled it down - it builds, but I cannot get the samples to run.

I dont see that it supports the new "sharp" style of icons... sharp-light, sharp-regular, sharp-solid, sharp-then.

SVG Icon not working with Version 2.0.0

I updated to the latest stabel version today and encountered errors in mmy project.
I am using the FontAwesome6.Svg package.

I do not know what I have to change that the new version is Working...
I am using the SVG nuGet like that:

xmlns:fa6="http://schemas.fontawesome.com/icons/svg"

and then in my button:
<Button> <Button.Content> <Grid> <Grid.RowDefinitions> <RowDefinition Height="80"/> <RowDefinition Height="0.5*"/> </Grid.RowDefinitions> <fa6:ImageAwesome Icon="Solid_Building" Height="80" PrimaryColor="{Binding SomeBinding}"/> <TextBlock Text="Button Text" Grid.Row="1"/> </Grid> </Button.Content> </Button

It was working perfectly fine but now I get an error in the Icon --> Value cannot be null (Parameter 'stream')
What is the soluton for this problem?

...type 'fa:SvgAwesome' and ...type faf:FontAwesome" not found

Trying to use FontAwesome 6 in my WinUI 3 project. But I can't get it to run. I installed the packages of svg and / or fonts via NuGet
from youtr installation guides

The error message and code:
errors

I installed all of those together and each on on their own

  • FontAwesome6.Fonts.WinUI
  • FontAwesome6.Fonts
  • FontAwesome6.Svg.WinUI
  • FontAwesome6.Svg
    and tried to fit the xmlns:fa address accordingly.
    I restarted Visual Studio multiple times, but I could not bring it to work

Proof

MS WIndows 11 Pro 22H2
MS Visual Studio Community 2022 (64-bit) 17.6.4
net6.0-windows10.0.19041.0

Couldnt find FontFamily for None exception

Hi guys.

I was trying out version 6 (upgrading from 5) and am seeing this error when CLOSING a UI control within a window which would, essentially, remove the FontAwesome icon from the visual tree:

3/1/2022 3:27:06 PM		Failed to apply settings from dock layout manager: TargetSite=System.Object InvokeMethod(System.Object, System.Span`1[System.Object] ByRef, System.Signature, Boolean, Boolean)||Message=Exception has been thrown by the target of an invocation.||Data=System.Collections.ListDictionaryInternal||InnerException=System.Exception: Couldn't find FontFamily for None. Please load the font file for None.
   at FontFamily FontAwesome6.Fonts.FontAwesomeFonts.GetFontFamily(EFontAwesomeStyle style)
   at FontFamily FontAwesome6.Fonts.Extensions.EFontAwesomeIconExtensions.GetFontFamily(EFontAwesomeIcon icon)
   at void FontAwesome6.Fonts.FontAwesome.OnIconPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at void System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at void System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at void System.Windows.Controls.TextBlock.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at void System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at UpdateResult System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, ref EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, OperationType operationType)
   at void System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, bool preserveCurrentValue)
   at void System.Windows.StyleHelper.InvalidatePropertiesOnTemplateNode(DependencyObject container, FrameworkObject child, int childIndex, ref FrugalStructList<ChildRecord> childRecordFromChildIndex, bool isDetach, FrameworkElementFactory templateRoot)
   at void System.Windows.StyleHelper.ClearTemplateChain(HybridDictionary[] instanceData, FrameworkElement feContainer, FrameworkContentElement fceContainer, List<DependencyObject> templateChain, FrameworkTemplate oldFrameworkTemplate)
   at void System.Windows.StyleHelper.ClearGeneratedSubTree(HybridDictionary[] instanceData, FrameworkElement feContainer, FrameworkContentElement fceContainer, FrameworkTemplate oldFrameworkTemplate)
   at void System.Windows.StyleHelper.DoTemplateInvalidations(FrameworkElement feContainer, FrameworkTemplate oldFrameworkTemplate)
   at void System.Windows.Controls.Control.OnTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at void System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at void System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at void System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at UpdateResult System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, ref EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, OperationType operationType)
   at void System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, bool preserveCurrentValue)
   at void System.Windows.StyleHelper.InvalidateContainerDependents(DependencyObject container, ref FrugalStructList<ContainerDependent> exclusionContainerDependents, ref FrugalStructList<ContainerDependent> oldContainerDependents, ref FrugalStructList<ContainerDependent> newContainerDependents)
   at void System.Windows.StyleHelper.DoStyleInvalidations(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle)
   at void System.Windows.FrameworkElement.OnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at void System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at void System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at void System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at UpdateResult System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, ref EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, OperationType operationType)
   at void System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, bool preserveCurrentValue)
   at void System.Windows.StyleHelper.ClearTemplateChain(HybridDictionary[] instanceData, FrameworkElement feContainer, FrameworkContentElement fceContainer, List<DependencyObject> templateChain, FrameworkTemplate oldFrameworkTemplate)
   at void System.Windows.StyleHelper.ClearGeneratedSubTree(HybridDictionary[] instanceData, FrameworkElement feContainer, FrameworkContentElement fceContainer, FrameworkTemplate oldFrameworkTemplate)
   at void System.Windows.StyleHelper.DoTemplateInvalidations(FrameworkElement feContainer, FrameworkTemplate oldFrameworkTemplate)
   at void System.Windows.Controls.ContentPresenter.OnTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at void System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at void System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at void System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at UpdateResult System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, ref EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, OperationType operationType)
   at void System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, object value, PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, OperationType operationType, bool isInternal)
   at void System.Windows.Controls.ContentPresenter.OnContentTemplateChanged(DataTemplate oldContentTemplate, DataTemplate newContentTemplate)
   at void System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at void System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at void System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at UpdateResult System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, ref EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, OperationType operationType)
   at void System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, bool preserveCurrentValue)
   at void System.Windows.StyleHelper.InvalidateDependents(Style ownerStyle, FrameworkTemplate frameworkTemplate, DependencyObject container, DependencyProperty dp, ref FrugalStructList<ChildPropertyDependent> dependents, bool invalidateOnlyContainer)
   at void System.Windows.StyleHelper.OnTriggerSourcePropertyInvalidated(Style ownerStyle, FrameworkTemplate frameworkTemplate, DependencyObject container, DependencyProperty dp, DependencyPropertyChangedEventArgs changedArgs, bool invalidateOnlyContainer, ref FrugalStructList<ItemStructMap<TriggerSourceRecord>> triggerSourceRecordFromChildIndex, ref FrugalMap propertyTriggersWithActions, int sourceChildIndex)
   at void System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at void System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at UpdateResult System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, ref EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, OperationType operationType)
   at void System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, object value, PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, OperationType operationType, bool isInternal)
   at void System.Windows.DependencyObject.SetValue(DependencyPropertyKey key, object value)
   at void DevExpress.Xpf.Docking.VisualElements.TemplatedCaptionControl.set_ActualContentTemplate(DataTemplate value)
   at void DevExpress.Xpf.Docking.VisualElements.TemplatedCaptionControl.SelectTemplate()
   at void DevExpress.Xpf.Docking.VisualElements.TemplatedCaptionControl.OnItemPropertyChanged()
   at static DevExpress.Xpf.Docking.VisualElements.TemplatedCaptionControl()+(TemplatedCaptionControl d) => { }
   at PropertyChangedCallback DevExpress.Mvvm.UI.Native.DependencyPropertyRegistrator<T>.ToHandler<TOwner, TProperty>(Func<TOwner, DPValueStorage<TProperty>> getStorage, Action<TOwner> changedCallback)+(DependencyObject d, DependencyPropertyChangedEventArgs e) => { }
   at void System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at void System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at void System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at UpdateResult System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, ref EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, OperationType operationType)
   at void System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, bool preserveCurrentValue)
   at void System.Windows.Data.BindingExpression.TransferValue(object newValue, bool isASubPropertyChange)
   at void MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(int k, ICollectionView collectionView, object newValue, bool isASubPropertyChange)
   at void MS.Internal.Data.PropertyPathWorker.OnDependencyPropertyChanged(DependencyObject d, DependencyProperty dp, bool isASubPropertyChange)
   at void System.Windows.Data.BindingExpression.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
   at void System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs)
   at void System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at UpdateResult System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, ref EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, OperationType operationType)
   at void System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, bool preserveCurrentValue)
   at void System.Windows.StyleHelper.InvalidateDependents(Style ownerStyle, FrameworkTemplate frameworkTemplate, DependencyObject container, DependencyProperty dp, ref FrugalStructList<ChildPropertyDependent> dependents, bool invalidateOnlyContainer)
   at void System.Windows.StyleHelper.OnTriggerSourcePropertyInvalidated(Style ownerStyle, FrameworkTemplate frameworkTemplate, DependencyObject container, DependencyProperty dp, DependencyPropertyChangedEventArgs changedArgs, bool invalidateOnlyContainer, ref FrugalStructList<ItemStructMap<TriggerSourceRecord>> triggerSourceRecordFromChildIndex, ref FrugalMap propertyTriggersWithActions, int sourceChildIndex)
   at void System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at void System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at UpdateResult System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, ref EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, OperationType operationType)
   at void System.Windows.DependencyObject.CoerceValue(DependencyProperty dp)
   at void DevExpress.Xpf.Docking.LayoutPanel.InvokeCoerceDockItemStateCore()
   at void DevExpress.Xpf.Docking.BaseLayoutItem.InvokeCoerceDockItemState()
   at void DevExpress.Xpf.Docking.BaseLayoutItem.UnlockDockItemState()
   at void DevExpress.Xpf.Docking.BaseLayoutItem.UnlockItemInLogicalTree()
   at void DevExpress.Xpf.Docking.LogicalTreeLocker.Dispose()+(BaseLayoutItem item) => { }
   at void DevExpress.Xpf.Layout.Core.CollectionHelper.Accept<T>(ICollection<T> collection, VisitDelegate<T> visit)
   at void DevExpress.Xpf.Docking.LogicalTreeLocker.Dispose()
   at void DevExpress.Xpf.Docking.SerializationController.EndRestoreLayout()
   at void DevExpress.Xpf.Docking.SerializationController.OnEndDeserializing(object sender, EndDeserializingEventArgs e)||HelpLink=||Source=System.Private.CoreLib||HResult=-2146232828||StackTrace=   at object RuntimeMethodHandle.InvokeMethod(object target, in Span<object> arguments, Signature sig, bool constructor, bool wrapExceptions)
   at object System.Reflection.RuntimeMethodInfo.Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
   at object Delegate.DynamicInvokeImpl(object[] args)
   at void System.Windows.RoutedEventArgs.InvokeEventHandler(Delegate genericHandler, object genericTarget)
   at void System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, object target)
   at void System.Windows.EventRoute.InvokeHandlersImpl(object source, RoutedEventArgs args, bool reRaised)
   at void System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at void DevExpress.Xpf.Core.DependencyObjectWrapper.RaiseEvent(DependencyObject obj, RoutedEventArgs e)
   at void DevExpress.Xpf.Core.Serialization.SerializationProvider.RaiseEvent(RoutedEventArgs e)
   at void DevExpress.Xpf.Core.Serialization.SerializationProvider.OnEndDeserializing(DependencyObject dObj, string restoredVersion)
   at void DevExpress.Xpf.Core.Serialization.Native.SerializationProviderWrapper.DevExpress.Utils.Serializing.IXtraSerializable.OnEndDeserializing(string restoredVersion)
   at void DevExpress.Utils.Serializing.Helpers.DeserializeHelper.CallEndDeserializing(object obj, string layoutVersion)
   at void DevExpress.Utils.Serializing.Helpers.DeserializeHelper.RaiseEndDeserializing(object obj, string restoredLayoutVersion)
   at void DevExpress.Xpf.Core.Serialization.DXSerializer+DXDeserializeHelper.RaiseEndDeserializing(object obj, string restoredLayoutVersion)
   at void DevExpress.Utils.Serializing.Helpers.DeserializeHelper.DeserializeObject(object obj, IXtraPropertyCollection store, XtraSerializationFlags parentFlags, OptionsLayoutBase options)
   at void DevExpress.Xpf.Core.Serialization.DXSerializer+SerializationStore.DevExpress.Utils.Serializing.Helpers.IXtraSerializable2.Deserialize(IList props)
   at void DevExpress.Utils.Serializing.Helpers.DeserializeHelper.DeserializeObject(object obj, IXtraPropertyCollection store, XtraSerializationFlags parentFlags, OptionsLayoutBase options) x 2
   at void DevExpress.Utils.Serializing.XtraSerializer.DeserializeObject(object obj, IXtraPropertyCollection store, OptionsLayoutBase options) x 3
   at void DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeCore(DependencyObject root, object path, string appName, DXOptionsLayout options, AcceptNestedObjects acceptNested)
   at void DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeSingleObject(DependencyObject d, object path, string appName)
   at void DevExpress.Xpf.Docking.SerializationController.RestoreLayout(object path)
   at void DevExpress.Xpf.Docking.DockLayoutManager.RestoreLayoutCore(object path)
   at void DevExpress.Xpf.Docking.DockLayoutManager.RestoreLayoutFromStream(Stream stream)
   at void UI.Helpers.DockLayoutHelpers.ApplySettings(DockLayoutManager dockManager, string xml) in D:/git/src/ui/UI/Helpers/DockLayoutHelpers.cs:line 46

Have not had much luck reproducing it in a separate app. Our app uses the DevExpress Docking Manager controls that has the option to close a Layout (i.e. tile). Any ideas before I go to far down the rabit hole?

[WPF] Duotone icon glitch

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>

Can't have multiple instances.

It appears that it's not possible to have multiple instances of a .Net Framework (4.8) WPF app containing FontAwesome6 icons.

Your FontAwesome5 implementation worked just fine (and still does), so I'm wondering if some extra steps are required to achieve the same result, or if it's simply not intended to support multiple instances at all?

To reproduce you simply have to make a new .Net Framework WPF app, place any font awesome icon in the xaml and launch the app.
If you try to launch another instance of this app (execute the .exe again), it will crash instantly, giving the following exception:

Exception:

'Set property 'FontAwesome6.Fonts.FontAwesome.Icon' threw an exception.' Line number '13' and line position '18'.
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at WpfApp2.MainWindow.InitializeComponent() in C:\...\WpfApp2\MainWindow.xaml:line 1

Inner 1:
The type initializer for 'FontAwesome6.Fonts.FontAwesomeFonts' threw an exception.
   at FontAwesome6.Fonts.FontAwesomeFonts.GetFontFamily(EFontAwesomeStyle style)
   at FontAwesome6.Fonts.FontAwesome.OnIconPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.Controls.TextBlock.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.Baml2006.WpfMemberInvoker.SetValue(Object instance, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)

Inner2:
Access to the path 'C:\Users\...\AppData\Local\Temp\fa-solid-900.ttf' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalDelete(String path, Boolean checkHost)
   at System.IO.File.Delete(String path)
   at FontAwesome6.Fonts.FontAwesomeFonts.WriteResourceToFile(ResourceManager resManager, String resourceName, String fileName)
   at FontAwesome6.Fonts.FontAwesomeFonts.SaveFontFilesToDirectory(String path)
   at FontAwesome6.Fonts.FontAwesomeFonts..cctor()

WPF Icons do not display unless fonts are in temp/. Fonts being in temp/6.1.2/ does not work.

Fresh install - ensure there are NO font awesome fonts in your %temp% folder.

image

Run a project with a simple UI as above that uses some icons. The icons do not display:
image

Now copy the fonts from %temp%/6.1.2/ into %temp% (main temp folder). Re run the application and it works:
image

I tried to fix this myself, I though this was due to this change: 3d2d307

But I cannot seem to fix it. I changed the code so that the base URI for the font families is %temp%/6.1.2/ rather than just %temp%, but it still only works when the font files are in %temp%. Not sure from where those files are being loaded.

Any help appreciated.

MAUI

Please support of MAUI

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.