Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Topfstedt committed May 29, 2022
1 parent a2437a7 commit 531ebe0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "Font-Awesome"]
path = Font-Awesome
url = https://github.com/FortAwesome/Font-Awesome.git
branch = 6.x
2 changes: 1 addition & 1 deletion Font-Awesome
Submodule Font-Awesome updated 10504 files
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using FontAwesome6.Extensions;

using System.Collections.Generic;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;

namespace FontAwesome6.Fonts.Extensions
Expand Down Expand Up @@ -110,12 +107,12 @@ public static Drawing CreateDrawing(this EFontAwesomeIcon icon, Brush primary, B
}
else
{
var primaryGlyph = CreateFormattedText(info.Item1, typeface, primary, emSize);
drawingContext.DrawGeometry(primary, null, primaryGlyph.BuildGeometry(new Point(0, 0)));
var primaryFormattedText = CreateFormattedText(info.Item1, typeface, primary, emSize);
drawingContext.DrawText(primaryFormattedText, new Point(0, 0));
}
#else
var primaryGlyph = CreateFormattedText(info.Item1, typeface, primary, emSize);
drawingContext.DrawGeometry(primary, null, primaryGlyph.BuildGeometry(new Point(0, 0)));
var primaryFormattedText = CreateFormattedText(info.Item1, typeface, primary, emSize);
drawingContext.DrawText(primaryFormattedText, new Point(0, 0));
#endif
}
return visual.Drawing;
Expand Down
6 changes: 1 addition & 5 deletions src/FontAwesome6.Fonts.Net/FontAwesome.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,14 @@ private static void OnIconPropertyChanged(DependencyObject d, DependencyProperty
return;
}

var icon = (EFontAwesomeIcon)d.GetValue(IconProperty);
var icon = (EFontAwesomeIcon)d.GetValue(IconProperty);

#if FontAwesomePro
if (icon.IsDuotone())
{
return;
}
#endif

#if NET40
d.SetValue(TextOptions.TextRenderingModeProperty, TextRenderingMode.ClearType);
#endif
d.SetValue(FontFamilyProperty, icon.GetFontFamily() ?? fontAwesome._initialFontFamily);
d.SetValue(TextProperty, icon.GetUnicode());
d.SetValue(TextAlignmentProperty, TextAlignment.Center);
Expand Down

0 comments on commit 531ebe0

Please sign in to comment.