davidxuang / fluenticons Goto Github PK
View Code? Open in Web Editor NEWA multi-framework wrapper of https://github.com/microsoft/fluentui-system-icons
License: MIT License
A multi-framework wrapper of https://github.com/microsoft/fluentui-system-icons
License: MIT License
Can it be used in Winform?
Can I use these icons with FluentAvalonia, for example for NavigationViewItem?
https://github.com/amwx/FluentAvalonia
Hi!
I noticed that since this change
80ae5f2
the base class for SymbolIcon has changed to Control (from IconElement). I'm wondering why that was changed? Any insights?
Regards,
Stefan
Hello,
I have a WPF application that uses FluentIcons, and recently came across an interesting issue. A user sent me a screenshot of my application with all the icons either missing entirely or incorrectly positioned.
I struggled to reproduce the problem at first, but eventually tracked it down to his use of Arabic as his system display language.
I believe the problem is with this line of code in the SymbolIcon class:
_formattedText = new FormattedText( Symbol.ToString(IsFilled), CultureInfo.CurrentCulture, CultureInfo.CurrentCulture.TextInfo.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight, _font, FontSize, Foreground, VisualTreeHelper.GetDpi(this).PixelsPerDip);
As you can see, the FlowDirection of the FormattedText object is changed based on the current culture, but I believe WPF always defaults to FlowDirection.LeftToRight.
I pulled the code into a local repo and changed it to pass FlowDirection.LeftToRight as the third argument to the FormattedText constructor. Doing so resolved the problem, and allowed the icons to appear correctly on the user's Arabic language system.
Interestingly, even if I change the FlowDirection of my entire application the icons will only appear (on systems using Arabic language) if I use the code change described above. They never show otherwise, regardless of FlowDirection.
I'm not sure if my testing is thorough enough to warrant a permanent code change, but I wanted to share the results of my tests in case they help someone else.
I discovered that with the latest version of FluentIcons.Avalonia on macOS (Sonoma 14.4.1)
the Foreground color is not applied. However, this works on Win 11
as well as on Linux Ubuntu 22.04
.
The behavior was introduced in FluentIcons.Avalonia v1.1.230
, but it was still working in version FluentIcons.Avalonia v1.1.228
.
I could not figure out the root cause, but I noticed that the fonts have been updated between these versions. Maybe this is related.
Behavior/Issue:
SymbolIcon Foreground color is not applied on macOS
.
Steps to reproduce:
Project File:
<Project Sdk="Microsoft.NET.Sdk">
...
<ItemGroup>
<!-- Broken starting with 1.1.230 -->
<PackageReference Include="FluentIcons.Avalonia" Version="1.1.233" />
<!-- Working -->
<!-- <PackageReference Include="FluentIcons.Avalonia" Version="1.1.228" /> -->
</ItemGroup>
....
</Project>
MainWindow.axaml
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ic="clr-namespace:FluentIcons.Avalonia;assembly=FluentIcons.Avalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SymbolForegroundIssue.MainWindow"
Title="SymbolForegroundIssue">
<ic:SymbolIcon Symbol="Home" IsFilled="True" Foreground="Red" />
</Window>
Expected Outcome:
SymbolIcon Foreground color should be Red on macOS
.
I was updating Nuget packages and found that my buttons' content was larger than normal. It took a while to find out that the SymbolIcon was showing the wrong FontSize property and I couldn't figure out why until I found a commit ad81b51 describing exactly what I found.
Is there a change log somewhere that documents this? It was quite unexpected.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.