Coder Social home page Coder Social logo

davidxuang / fluenticons Goto Github PK

View Code? Open in Web Editor NEW
51.0 4.0 4.0 13.86 MB

A multi-framework wrapper of https://github.com/microsoft/fluentui-system-icons

License: MIT License

C# 78.88% PowerShell 2.01% Python 1.52% TypeScript 17.59%
dotnet fluent icons wpf avalonia fluentui maui uwp winui

fluenticons's People

Contributors

cell001nz avatar davidxuang 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

Watchers

 avatar  avatar  avatar  avatar

fluenticons's Issues

Issue with RTL language support

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.

  • Mark

Avalonia Foreground Color Broken on macOS

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.

Why disable inherit FontSize?

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.

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.