├── .editorconfig ├── .gitattributes ├── .gitignore ├── .gitmodules ├── CHANGELOG.md ├── LICENSE ├── README.md ├── bin └── FontAwesome5.Generator │ ├── FontAwesome5.Generator.exe │ ├── FontAwesome5.Generator.exe.config │ ├── Newtonsoft.Json.dll │ └── Newtonsoft.Json.xml ├── build ├── GitVersion.yml ├── Scripts │ └── UpdateFontAwesome.bat └── build.yml └── src ├── Examples ├── FontAwesome5.Examples.sln ├── FontAwesome5.Net40.Example │ ├── App.config │ ├── App.xaml │ ├── App.xaml.cs │ ├── FodyWeavers.xml │ ├── FodyWeavers.xsd │ ├── FontAwesome5.Net40.Example.csproj │ ├── Key.snk │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── ViewModels │ │ └── MainWindowViewModel.cs │ └── packages.config ├── FontAwesome5.NetCore.Example │ ├── App.xaml │ ├── App.xaml.cs │ ├── FodyWeavers.xml │ ├── FodyWeavers.xsd │ ├── FontAwesome5.NetCore.Example.csproj │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ └── ViewModels │ │ └── MainWindowViewModel.cs ├── FontAwesome5.UWP.Example │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ ├── LockScreenLogo.scale-200.png │ │ ├── SplashScreen.scale-200.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ │ ├── StoreLogo.png │ │ └── Wide310x150Logo.scale-200.png │ ├── FontAwesome5.UWP.Example.csproj │ ├── FontAwesome5.UWP.Example_TemporaryKey.pfx │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── Default.rd.xml │ └── ViewModels │ │ └── MainViewModel.cs └── FontAwesome5.WinUI.Example │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ ├── LockScreenLogo.scale-200.png │ ├── SplashScreen.scale-200.png │ ├── Square150x150Logo.scale-200.png │ ├── Square44x44Logo.scale-200.png │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ ├── StoreLogo.png │ └── Wide310x150Logo.scale-200.png │ ├── FontAwesome5.WinUI.Example.csproj │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── Package.appxmanifest │ ├── Properties │ └── launchSettings.json │ ├── ViewModels │ └── MainViewModel.cs │ └── app.manifest ├── FontAwesome.Shared ├── Extensions │ ├── ControlExtensions.cs │ └── EFontAwesomeIconExtensions.cs ├── FontAwesome.Shared.projitems ├── FontAwesome.Shared.shproj ├── IFlippable.cs ├── IPulsable.cs ├── IRotatable.cs └── ISpinable.cs ├── FontAwesome5.Net.sln ├── FontAwesome5.Net ├── Awesome.cs ├── Converters │ ├── DrawingConverter.cs │ ├── ImageSourceConverter.cs │ ├── ImageSourceSvgConverter.cs │ ├── LabelConverter.cs │ ├── StyleConverter.cs │ └── VisibilityConverter.cs ├── Extensions │ └── EFontAwesomeIconsExtensions.cs ├── FontAwesome.cs ├── FontAwesome5.Net.csproj ├── Fonts.cs ├── ImageAwesome.cs ├── Key.snk ├── SvgAwesome.cs └── XmlNamespace.cs ├── FontAwesome5.UWP.sln ├── FontAwesome5.UWP ├── FontAwesome.cs ├── FontAwesome5.UWP.csproj ├── Fonts.cs ├── Key.snk └── Properties │ ├── AssemblyInfo.cs │ └── FontAwesome5.UWP.rd.xml ├── FontAwesome5.WinUI.sln ├── FontAwesome5.WinUI ├── FontAwesome.cs ├── FontAwesome5.WinUI.csproj └── Fonts.cs ├── FontAwesome5.sln ├── FontAwesome5 ├── EFontAwesomeIcon.cs ├── Extensions │ └── EFontAwesomeIconExtensions.cs ├── FontAwesome5.csproj ├── FontAwesomeInternal.cs └── Key.snk ├── NuGet ├── FontAwesome5.WinUI.nuspec ├── FontAwesome5.nuspec └── nuget.exe ├── Tools └── FontAwesome5.Generator │ ├── App.config │ ├── FontAwesome.cs │ ├── FontAwesome5.Generator.csproj │ ├── Program.cs │ ├── Properties │ └── AssemblyInfo.cs │ └── packages.config └── icon.png /.editorconfig: -------------------------------------------------------------------------------- 1 | # Code files 2 | [*.cs] 3 | indent_size = 2 -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # .NET Core 46 | project.lock.json 47 | project.fragment.lock.json 48 | artifacts/ 49 | **/Properties/launchSettings.json 50 | 51 | *_i.c 52 | *_p.c 53 | *_i.h 54 | *.ilk 55 | *.meta 56 | *.obj 57 | *.pch 58 | *.pdb 59 | *.pgc 60 | *.pgd 61 | *.rsp 62 | *.sbr 63 | *.tlb 64 | *.tli 65 | *.tlh 66 | *.tmp 67 | *.tmp_proj 68 | *.log 69 | *.vspscc 70 | *.vssscc 71 | .builds 72 | *.pidb 73 | *.svclog 74 | *.scc 75 | 76 | # Chutzpah Test files 77 | _Chutzpah* 78 | 79 | # Visual C++ cache files 80 | ipch/ 81 | *.aps 82 | *.ncb 83 | *.opendb 84 | *.opensdf 85 | *.sdf 86 | *.cachefile 87 | *.VC.db 88 | *.VC.VC.opendb 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | *.sap 95 | 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | 99 | # Guidance Automation Toolkit 100 | *.gpState 101 | 102 | # ReSharper is a .NET coding add-in 103 | _ReSharper*/ 104 | *.[Rr]e[Ss]harper 105 | *.DotSettings.user 106 | 107 | # JustCode is a .NET coding add-in 108 | .JustCode 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # Visual Studio code coverage results 117 | *.coverage 118 | *.coveragexml 119 | 120 | # NCrunch 121 | _NCrunch_* 122 | .*crunch*.local.xml 123 | nCrunchTemp_* 124 | 125 | # MightyMoose 126 | *.mm.* 127 | AutoTest.Net/ 128 | 129 | # Web workbench (sass) 130 | .sass-cache/ 131 | 132 | # Installshield output folder 133 | [Ee]xpress/ 134 | 135 | # DocProject is a documentation generator add-in 136 | DocProject/buildhelp/ 137 | DocProject/Help/*.HxT 138 | DocProject/Help/*.HxC 139 | DocProject/Help/*.hhc 140 | DocProject/Help/*.hhk 141 | DocProject/Help/*.hhp 142 | DocProject/Help/Html2 143 | DocProject/Help/html 144 | 145 | # Click-Once directory 146 | publish/ 147 | 148 | # Publish Web Output 149 | *.[Pp]ublish.xml 150 | *.azurePubxml 151 | # TODO: Comment the next line if you want to checkin your web deploy settings 152 | # but database connection strings (with potential passwords) will be unencrypted 153 | *.pubxml 154 | *.publishproj 155 | 156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 157 | # checkin your Azure Web App publish settings, but sensitive information contained 158 | # in these scripts will be unencrypted 159 | PublishScripts/ 160 | 161 | # NuGet Packages 162 | *.nupkg 163 | # The packages folder can be ignored because of Package Restore 164 | **/packages/* 165 | # except build/, which is used as an MSBuild target. 166 | !**/packages/build/ 167 | # Uncomment if necessary however generally it will be regenerated when needed 168 | #!**/packages/repositories.config 169 | # NuGet v3's project.json files produces more ignorable files 170 | *.nuget.props 171 | *.nuget.targets 172 | 173 | # Microsoft Azure Build Output 174 | csx/ 175 | *.build.csdef 176 | 177 | # Microsoft Azure Emulator 178 | ecf/ 179 | rcf/ 180 | 181 | # Windows Store app package directories and files 182 | AppPackages/ 183 | BundleArtifacts/ 184 | Package.StoreAssociation.xml 185 | _pkginfo.txt 186 | 187 | # Visual Studio cache files 188 | # files ending in .cache can be ignored 189 | *.[Cc]ache 190 | # but keep track of directories ending in .cache 191 | !*.[Cc]ache/ 192 | 193 | # Others 194 | ClientBin/ 195 | ~$* 196 | *~ 197 | *.dbmdl 198 | *.dbproj.schemaview 199 | *.jfm 200 | *.pfx 201 | *.publishsettings 202 | orleans.codegen.cs 203 | 204 | # Since there are multiple workflows, uncomment next line to ignore bower_components 205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 206 | #bower_components/ 207 | 208 | # RIA/Silverlight projects 209 | Generated_Code/ 210 | 211 | # Backup & report files from converting an old project file 212 | # to a newer Visual Studio version. Backup files are not needed, 213 | # because we have git ;-) 214 | _UpgradeReport_Files/ 215 | Backup*/ 216 | UpgradeLog*.XML 217 | UpgradeLog*.htm 218 | 219 | # SQL Server files 220 | *.mdf 221 | *.ldf 222 | *.ndf 223 | 224 | # Business Intelligence projects 225 | *.rdl.data 226 | *.bim.layout 227 | *.bim_*.settings 228 | 229 | # Microsoft Fakes 230 | FakesAssemblies/ 231 | 232 | # GhostDoc plugin setting file 233 | *.GhostDoc.xml 234 | 235 | # Node.js Tools for Visual Studio 236 | .ntvs_analysis.dat 237 | node_modules/ 238 | 239 | # Typescript v1 declaration files 240 | typings/ 241 | 242 | # Visual Studio 6 build log 243 | *.plg 244 | 245 | # Visual Studio 6 workspace options file 246 | *.opt 247 | 248 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 249 | *.vbw 250 | 251 | # Visual Studio LightSwitch build output 252 | **/*.HTMLClient/GeneratedArtifacts 253 | **/*.DesktopClient/GeneratedArtifacts 254 | **/*.DesktopClient/ModelManifest.xml 255 | **/*.Server/GeneratedArtifacts 256 | **/*.Server/ModelManifest.xml 257 | _Pvt_Extensions 258 | 259 | # Paket dependency manager 260 | .paket/paket.exe 261 | paket-files/ 262 | 263 | # FAKE - F# Make 264 | .fake/ 265 | 266 | # JetBrains Rider 267 | .idea/ 268 | *.sln.iml 269 | 270 | # CodeRush 271 | .cr/ 272 | 273 | # Python Tools for Visual Studio (PTVS) 274 | __pycache__/ 275 | *.pyc 276 | 277 | # Cake - Uncomment if you are using it 278 | # tools/** 279 | # !tools/packages.config 280 | 281 | # Telerik's JustMock configuration file 282 | *.jmconfig 283 | 284 | # BizTalk build output 285 | *.btp.cs 286 | *.btm.cs 287 | *.odx.cs 288 | *.xsd.cs 289 | 290 | # Excludes 291 | !/bin/**/* -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Font-Awesome"] 2 | path = Font-Awesome 3 | url = https://github.com/FortAwesome/Font-Awesome 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 2.1.11 2 | - separated WinUI in new package 3 | # 2.1.5 4 | - added WinUi support (thanks to David Hovey) 5 | - Updated FontAwesome v5.15.4 6 | # 2.1.4 7 | - Removed ResourceDictionary(FontAwesome5Dictionary.xaml) 8 | - Added new function for Font saving and loading to Fonts class. 9 | - fonts now get saved to temporary directory and referenced from there to prevent memory leak 10 | # 2.1.3 11 | - Added ImageSourceSvgConverter 12 | - Made the Font Families adjustable on the static Fonts class 13 | - Introduced a new ReosurceDictionary (FontAwesome5Dictionary.xaml) to prevent memory leaks 14 | # 2.1.2 15 | - Fixed issue #31 16 | # 2.1.1 17 | - Updated FontAwesome v5.15.3 18 | - Updated UWP Min Target to: 10.0.10240.0 19 | - Updated UWP Target to: 10.0.19041.0 20 | # 2.0.0 21 | - Added .Net Core 3.0 support 22 | - Updated UWP Target Version to 17763 23 | - Breaking Change: merged FontAwesome5.WPF namespace into FontAwesome5 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 MartinTopfstedt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | > **FontAwesome 6 is out.** -> Check out https://github.com/MartinTopfstedt/FontAwesome6 3 | 4 | # FontAwesome5 5 | 6 | [![Build Status](https://dev.azure.com/codinion/FontAwesome5/_apis/build/status/MartinTopfstedt.FontAwesome5?branchName=master)](https://dev.azure.com/codinion/FontAwesome5/_build/latest?definitionId=11&branchName=master) 7 | 8 | WPF (.Net and .Net Core) and UWP/WinUI controls for the iconic SVG, font, and CSS toolkit Font Awesome 5. 9 | 10 | Font Awesome: https://github.com/FortAwesome/Font-Awesome 11 | 12 | + Current Version: v5.15.4 13 | 14 | # Getting Started 15 | 16 | #### Installation 17 | 18 | Install the FontAwesome5 NuGet Package: ```Install-Package FontAwesome5``` 19 | or 20 | Install the FontAwesome5.WinUI NuGet Package: ```Install-Package FontAwesome5.WinUI``` 21 | 22 | 23 | #### Usage XAML 24 | 25 | The usage is the same like the version from charri, just the FontAwesomeIcon enumeration has changed to EFontAwesomeIcon and has the Styles included, which means "Flag" changed to "Solid_Flag" or "Regular_Flag", and the name space changed from "http://schemas.fontawesome.io" to "http://schemas.fontawesome.com". 26 | 27 | https://github.com/charri/Font-Awesome-WPF/blob/master/README-WPF.md#usage-xaml 28 | 29 | 30 | 31 | #### Usage XAML SVG 32 | 33 | The SvgAwesome can be used like the ImageAwesome. 34 | 35 | ``` 36 | 41 | 42 | 43 | 44 | 45 | ``` 46 | 47 | ## Converters (WPF only) 48 | 49 | #### ImageSourceConverter 50 | 51 | https://github.com/charri/Font-Awesome-WPF/blob/master/README-WPF.md#imagesourceconverter 52 | 53 | #### ImageSourceSvgConverter 54 | 55 | This is the same like the *ImageSourceConverter*, except it does use the Svg information to draw the icon instead of the font. 56 | 57 | #### LabelConverter 58 | 59 | Gets the Label/Name of a EFontAwesomeIcon. The converter parameter can contain a format string, where {0} is the label/name and {1} is the style. 60 | 61 | Example: 62 | ``` 63 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | ``` 77 | 78 | #### StyleConverter 79 | 80 | Gets the EFontAwesomeStyle of a EFontAwesomeIcon. 81 | 82 | Example: 83 | ``` 84 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | ``` 97 | 98 | # Credits 99 | 100 | * @davegandy: https://github.com/FortAwesome/Font-Awesome 101 | * @charri: https://github.com/charri/Font-Awesome-WPF 102 | -------------------------------------------------------------------------------- /bin/FontAwesome5.Generator/FontAwesome5.Generator.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/bin/FontAwesome5.Generator/FontAwesome5.Generator.exe -------------------------------------------------------------------------------- /bin/FontAwesome5.Generator/FontAwesome5.Generator.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /bin/FontAwesome5.Generator/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/bin/FontAwesome5.Generator/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /build/GitVersion.yml: -------------------------------------------------------------------------------- 1 | assembly-versioning-scheme: MajorMinorPatch 2 | assembly-file-versioning-scheme: MajorMinorPatchTag 3 | mode: ContinuousDeployment 4 | tag-prefix: '[vV]' 5 | continuous-delivery-fallback-tag: ci 6 | next-version: 2.0.0 7 | major-version-bump-message: '\+semver:\s?(breaking|major)' 8 | minor-version-bump-message: '\+semver:\s?(feature|minor)' 9 | patch-version-bump-message: '\+semver:\s?(fix|patch)' 10 | no-bump-message: '\+semver:\s?(none|skip)' 11 | legacy-semver-padding: 4 12 | build-metadata-padding: 4 13 | commits-since-version-source-padding: 4 14 | commit-message-incrementing: Enabled 15 | ignore: 16 | sha: [] 17 | increment: Inherit 18 | commit-date-format: yyyy-MM-dd 19 | 20 | branches: 21 | master: 22 | regex: master 23 | mode: ContinuousDelivery 24 | tag: '' 25 | increment: Patch 26 | prevent-increment-of-merged-branch-version: true 27 | track-merge-target: false 28 | tracks-release-branches: false 29 | is-release-branch: false 30 | release: 31 | regex: release(s)?[/-] 32 | mode: ContinuousDelivery 33 | tag: beta 34 | increment: Patch 35 | prevent-increment-of-merged-branch-version: true 36 | track-merge-target: false 37 | tracks-release-branches: false 38 | is-release-branch: true 39 | feature: 40 | regex: feature(s)?[/-] 41 | mode: ContinuousDelivery 42 | tag: useBranchName 43 | increment: Inherit 44 | prevent-increment-of-merged-branch-version: false 45 | track-merge-target: false 46 | tracks-release-branches: false 47 | is-release-branch: false 48 | pull-request: 49 | regex: (pull|pull\-requests|pr)[/-] 50 | mode: ContinuousDelivery 51 | tag: PullRequest 52 | increment: Inherit 53 | prevent-increment-of-merged-branch-version: false 54 | tag-number-pattern: '[/-](?\d+)[-/]' 55 | track-merge-target: false 56 | tracks-release-branches: false 57 | is-release-branch: false 58 | hotfix: 59 | regex: hotfix(es)?[/-] 60 | mode: ContinuousDelivery 61 | tag: beta 62 | increment: Patch 63 | prevent-increment-of-merged-branch-version: false 64 | track-merge-target: false 65 | tracks-release-branches: false 66 | is-release-branch: false 67 | support: 68 | regex: support[/-] 69 | mode: ContinuousDelivery 70 | tag: '' 71 | increment: Patch 72 | prevent-increment-of-merged-branch-version: true 73 | track-merge-target: false 74 | tracks-release-branches: false 75 | is-release-branch: false 76 | develop: 77 | regex: dev(elop)?(ment)?$ 78 | mode: ContinuousDeployment 79 | tag: unstable 80 | increment: Minor 81 | prevent-increment-of-merged-branch-version: false 82 | track-merge-target: true 83 | tracks-release-branches: true 84 | is-release-branch: false 85 | -------------------------------------------------------------------------------- /build/Scripts/UpdateFontAwesome.bat: -------------------------------------------------------------------------------- 1 | cd ..\..\Font-Awesome 2 | git checkout master 3 | git pull 4 | cd ..\ 5 | .\bin\FontAwesome5.Generator\FontAwesome5.Generator.exe .\ -------------------------------------------------------------------------------- /build/build.yml: -------------------------------------------------------------------------------- 1 | # Starter pipeline 2 | # Start with a minimal pipeline that you can customize to build and deploy your code. 3 | # Add steps that build, run tests, deploy, and more: 4 | # https://aka.ms/yaml 5 | 6 | pool: 7 | vmImage: 'windows-latest' 8 | 9 | variables: 10 | solution: 'src/FontAwesome5.sln' 11 | nuspec: 'src/NuGet/*.nuspec' 12 | buildPlatform: 'Any CPU' 13 | buildConfiguration: 'Release' 14 | 15 | steps: 16 | 17 | - task: UseDotNet@2 18 | displayName: 'Install .NET Core' 19 | inputs: 20 | packageType: 'sdk' 21 | version: '6.x' 22 | includePreviewVersions: true 23 | performMultiLevelLookup: true 24 | 25 | - task: GitVersion@5 26 | inputs: 27 | runtime: 'full' 28 | configFilePath: 'build/GitVersion.yml' 29 | updateAssemblyInfo: true 30 | 31 | - script: echo %Action%%BuildVersion% 32 | displayName: 'Set build version' 33 | env: 34 | Action: '##vso[build.updatebuildnumber]' 35 | BuildVersion: $(GitVersion.NuGetVersionV2) 36 | 37 | - task: NuGetToolInstaller@1 38 | inputs: 39 | versionSpec: 40 | checkLatest: true 41 | 42 | - task: NuGetCommand@2 43 | displayName: 'NuGet Restore (All Solutions)' 44 | inputs: 45 | command: 'restore' 46 | restoreSolution: 'src/*.sln' 47 | feedsToUse: 'select' 48 | verbosityRestore: 'Normal' 49 | 50 | - task: DotNetCoreCLI@2 51 | displayName: 'dotnet restore (All Solutions)' 52 | inputs: 53 | command: 'restore' 54 | projects: 'src/*.sln' 55 | feedsToUse: 'select' 56 | 57 | - task: CmdLine@2 58 | displayName: 'Update FontAwesome SubModule' 59 | inputs: 60 | script: | 61 | cd Font-Awesome 62 | git checkout master 63 | git pull 64 | cd .. 65 | .\bin\FontAwesome5.Generator\FontAwesome5.Generator.exe .\ 66 | workingDirectory: '.' 67 | 68 | - task: DotNetCoreCLI@2 69 | displayName: 'Build: Net Core' 70 | inputs: 71 | command: 'build' 72 | projects: 'src/FontAwesome5.Net.sln' 73 | arguments: '--configuration $(buildConfiguration) /p:Version=$(GitVersion.AssemblySemVer);AssemblyVersion=$(GitVersion.AssemblySemVer);FileVersion=$(GitVersion.AssemblySemFileVer)' 74 | 75 | - task: VSBuild@1 76 | displayName: 'Build: UWP' 77 | inputs: 78 | solution: 'src/FontAwesome5.UWP.sln' 79 | msbuildArgs: '/p:Version=$(GitVersion.AssemblySemVer);AssemblyVersion=$(GitVersion.AssemblySemVer);FileVersion=$(GitVersion.AssemblySemFileVer)' 80 | platform: '$(buildPlatform)' 81 | configuration: '$(buildConfiguration)' 82 | 83 | - task: VSBuild@1 84 | displayName: 'Build: WinUI' 85 | inputs: 86 | solution: 'src/FontAwesome5.WinUI.sln' 87 | msbuildArgs: '/p:Version=$(GitVersion.AssemblySemVer);AssemblyVersion=$(GitVersion.AssemblySemVer);FileVersion=$(GitVersion.AssemblySemFileVer)' 88 | platform: '$(buildPlatform)' 89 | configuration: '$(buildConfiguration)' 90 | 91 | - task: NuGetCommand@2 92 | displayName: 'NuGet pack' 93 | inputs: 94 | command: 'pack' 95 | packagesToPack: '$(nuspec)' 96 | versioningScheme: 'byEnvVar' 97 | versionEnvVar: 'GitVersion.NuGetVersionV2' 98 | includeSymbols: true 99 | 100 | - task: PublishBuildArtifacts@1 101 | displayName: 'Publish Artifact: FontAwesome5' 102 | inputs: 103 | PathtoPublish: '$(build.artifactstagingdirectory)' 104 | ArtifactName: 'FontAwesome5' -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.Net40.Example/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.Net40.Example/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.Net40.Example/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace FontAwesome5.Net40.Example 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.Net40.Example/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.Net40.Example/FodyWeavers.xsd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Used to control if the On_PropertyName_Changed feature is enabled. 12 | 13 | 14 | 15 | 16 | Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form. 17 | 18 | 19 | 20 | 21 | Used to control if equality checks should be inserted. If false, equality checking will be disabled for the project. 22 | 23 | 24 | 25 | 26 | Used to control if equality checks should use the Equals method resolved from the base class. 27 | 28 | 29 | 30 | 31 | Used to control if equality checks should use the static Equals method resolved from the base class. 32 | 33 | 34 | 35 | 36 | Used to turn off build warnings from this weaver. 37 | 38 | 39 | 40 | 41 | Used to turn off build warnings about mismatched On_PropertyName_Changed methods. 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. 50 | 51 | 52 | 53 | 54 | A comma-separated list of error codes that can be safely ignored in assembly verification. 55 | 56 | 57 | 58 | 59 | 'false' to turn off automatic generation of the XML Schema file. 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.Net40.Example/FontAwesome5.Net40.Example.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Debug 7 | AnyCPU 8 | {C746EF21-96BB-4345-B888-A7BBEBAFBA3C} 9 | WinExe 10 | FontAwesome5.WPF.Example 11 | FontAwesome5.WPF.Example 12 | v4.5 13 | 512 14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 4 16 | true 17 | 18 | 19 | 20 | 21 | 22 | AnyCPU 23 | true 24 | full 25 | false 26 | bin\Debug\ 27 | DEBUG;TRACE 28 | prompt 29 | 4 30 | 31 | 32 | AnyCPU 33 | pdbonly 34 | true 35 | bin\Release\ 36 | TRACE 37 | prompt 38 | 4 39 | 40 | 41 | true 42 | 43 | 44 | Key.snk 45 | 46 | 47 | 48 | ..\..\packages\PropertyChanged.Fody.3.2.7\lib\net40\PropertyChanged.dll 49 | True 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | ..\..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 4.0 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | MSBuild:Compile 75 | Designer 76 | 77 | 78 | 79 | MSBuild:Compile 80 | Designer 81 | 82 | 83 | App.xaml 84 | Code 85 | 86 | 87 | MainWindow.xaml 88 | Code 89 | 90 | 91 | 92 | 93 | Code 94 | 95 | 96 | True 97 | True 98 | Resources.resx 99 | 100 | 101 | True 102 | Settings.settings 103 | True 104 | 105 | 106 | ResXFileCodeGenerator 107 | Resources.Designer.cs 108 | 109 | 110 | 111 | 112 | SettingsSingleFileGenerator 113 | Settings.Designer.cs 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | {1a59d62e-5831-4d38-92af-6eaef5db3395} 125 | FontAwesome5.Net 126 | 127 | 128 | {30c458c0-e963-4972-b9d3-8fb51e434f7c} 129 | FontAwesome5 130 | 131 | 132 | 133 | 134 | 135 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.Net40.Example/Key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.Net40.Example/Key.snk -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.Net40.Example/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using FontAwesome5; 2 | using FontAwesome5.Net40.Example.ViewModels; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Documents; 12 | using System.Windows.Input; 13 | using System.Windows.Media; 14 | using System.Windows.Media.Imaging; 15 | using System.Windows.Navigation; 16 | using System.Windows.Shapes; 17 | 18 | namespace FontAwesome5.Net40.Example 19 | { 20 | /// 21 | /// Interaction logic for MainWindow.xaml 22 | /// 23 | public partial class MainWindow : Window 24 | { 25 | public MainWindow() 26 | { 27 | DataContext = new MainWindowViewModel(); 28 | InitializeComponent(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.Net40.Example/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("FontAwesome5.Net40.Example")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("Codinion")] 14 | [assembly: AssemblyProduct("FontAwesome5.Net40.Example")] 15 | [assembly: AssemblyCopyright("Copyright © Codinion 2018")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.Net40.Example/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace FontAwesome5.WPF.Example.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FontAwesome5.WPF.Example.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.Net40.Example/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.Net40.Example/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace FontAwesome5.WPF.Example.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.Net40.Example/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.Net40.Example/ViewModels/MainWindowViewModel.cs: -------------------------------------------------------------------------------- 1 | using FontAwesome5.Extensions; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Linq; 6 | using System.Text.RegularExpressions; 7 | using System.Windows; 8 | 9 | namespace FontAwesome5.Net40.Example.ViewModels 10 | { 11 | public class MainWindowViewModel : INotifyPropertyChanged 12 | { 13 | public MainWindowViewModel() 14 | { 15 | AllIcons = Enum.GetValues(typeof(EFontAwesomeIcon)).Cast() 16 | .OrderBy(i => i.GetStyle()).ThenBy(i => i.GetLabel()).ToList(); 17 | 18 | AllIcons.Remove(EFontAwesomeIcon.None); 19 | UpdateVisibleIcons(); 20 | 21 | FlipOrientations = Enum.GetValues(typeof(EFlipOrientation)).Cast().ToList(); 22 | SpinDuration = 5; 23 | PulseDuration = 5; 24 | FontSize = 30; 25 | Rotation = 0; 26 | 27 | Visibilities = Enum.GetValues(typeof(Visibility)).Cast().ToList(); 28 | Visibility = Visibility.Visible; 29 | } 30 | 31 | public Visibility Visibility { get; set; } 32 | public List Visibilities { get; set; } = new List(); 33 | 34 | public EFontAwesomeIcon SelectedIcon { get; set; } 35 | 36 | public bool SpinIsEnabled { get; set; } 37 | public double SpinDuration { get; set; } 38 | public bool PulseIsEnabled { get; set; } 39 | public double PulseDuration { get; set; } 40 | public EFlipOrientation FlipOrientation { get; set; } 41 | public double FontSize { get; set; } 42 | public double Rotation { get; set; } 43 | 44 | public List FlipOrientations { get; set; } = new List(); 45 | public List AllIcons { get; set; } = new List(); 46 | 47 | public event PropertyChangedEventHandler PropertyChanged; 48 | 49 | #region Visible Icon Filtering 50 | 51 | public List VisibleIcons { get; private set; } 52 | 53 | public string FilterText { get; set; } 54 | 55 | private void OnFilterTextChanged() 56 | { 57 | UpdateVisibleIcons(); 58 | } 59 | 60 | private void UpdateVisibleIcons() 61 | { 62 | var addAll = string.IsNullOrWhiteSpace(FilterText); 63 | 64 | //Confirm regex is valid 65 | if (!addAll) 66 | { 67 | try 68 | { 69 | _ = Regex.IsMatch(string.Empty, FilterText); 70 | } 71 | catch (Exception) 72 | { 73 | addAll = true; 74 | } 75 | } 76 | 77 | //Add all if no proper filter is applied 78 | VisibleIcons = addAll 79 | ? AllIcons 80 | : new List(AllIcons.Where(icon => Regex.IsMatch( 81 | icon.GetInformation().Label 82 | , FilterText 83 | , RegexOptions.IgnoreCase 84 | ))); 85 | 86 | SelectedIcon = VisibleIcons.FirstOrDefault(); 87 | } 88 | 89 | #endregion 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.Net40.Example/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.NetCore.Example/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.NetCore.Example/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace FontAwesome5.NetCore30 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.NetCore.Example/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.NetCore.Example/FodyWeavers.xsd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Used to control if the On_PropertyName_Changed feature is enabled. 12 | 13 | 14 | 15 | 16 | Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form. 17 | 18 | 19 | 20 | 21 | Used to control if equality checks should be inserted. If false, equality checking will be disabled for the project. 22 | 23 | 24 | 25 | 26 | Used to control if equality checks should use the Equals method resolved from the base class. 27 | 28 | 29 | 30 | 31 | Used to control if equality checks should use the static Equals method resolved from the base class. 32 | 33 | 34 | 35 | 36 | Used to turn off build warnings from this weaver. 37 | 38 | 39 | 40 | 41 | Used to turn off build warnings about mismatched On_PropertyName_Changed methods. 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. 50 | 51 | 52 | 53 | 54 | A comma-separated list of error codes that can be safely ignored in assembly verification. 55 | 56 | 57 | 58 | 59 | 'false' to turn off automatic generation of the XML Schema file. 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.NetCore.Example/FontAwesome5.NetCore.Example.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WinExe 5 | netcoreapp3.1 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.NetCore.Example/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | using FontAwesome5.NetCore30.Example.ViewModels; 17 | 18 | namespace FontAwesome5.NetCore30.Example 19 | { 20 | /// 21 | /// Interaction logic for MainWindow.xaml 22 | /// 23 | public partial class MainWindow : Window 24 | { 25 | public MainWindow() 26 | { 27 | DataContext = new MainWindowViewModel(); 28 | InitializeComponent(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.NetCore.Example/ViewModels/MainWindowViewModel.cs: -------------------------------------------------------------------------------- 1 | using FontAwesome5.Extensions; 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel; 6 | using System.Linq; 7 | using System.Text.RegularExpressions; 8 | using System.Windows; 9 | 10 | namespace FontAwesome5.NetCore30.Example.ViewModels 11 | { 12 | public class MainWindowViewModel : INotifyPropertyChanged 13 | { 14 | public MainWindowViewModel() 15 | { 16 | AllIcons = Enum.GetValues(typeof(EFontAwesomeIcon)).Cast() 17 | .OrderBy(i => i.GetStyle()).ThenBy(i => i.GetLabel()).ToList(); 18 | AllIcons.Remove(EFontAwesomeIcon.None); 19 | UpdateVisibleIcons(); 20 | 21 | FlipOrientations = Enum.GetValues(typeof(EFlipOrientation)).Cast().ToList(); 22 | SpinDuration = 5; 23 | PulseDuration = 5; 24 | 25 | FontSize = 30; 26 | Rotation = 0; 27 | 28 | Visibilities = Enum.GetValues(typeof(Visibility)).Cast().ToList(); 29 | Visibility = Visibility.Visible; 30 | } 31 | 32 | public Visibility Visibility { get; set; } 33 | public EFontAwesomeIcon SelectedIcon { get; set; } 34 | 35 | public bool SpinIsEnabled { get; set; } 36 | public double SpinDuration { get; set; } 37 | public bool PulseIsEnabled { get; set; } 38 | public double PulseDuration { get; set; } 39 | public EFlipOrientation FlipOrientation { get; set; } 40 | public double FontSize { get; set; } 41 | public double Rotation { get; set; } 42 | 43 | public List Visibilities { get; set; } = new List(); 44 | public List FlipOrientations { get; set; } = new List(); 45 | public List AllIcons { get; set; } = new List(); 46 | 47 | public event PropertyChangedEventHandler PropertyChanged; 48 | 49 | #region Visible Icon Filtering 50 | 51 | public List VisibleIcons { get; private set; } 52 | 53 | public string FilterText { get; set; } 54 | private void OnFilterTextChanged() 55 | { 56 | UpdateVisibleIcons(); 57 | } 58 | 59 | private void UpdateVisibleIcons() 60 | { 61 | var addAll = string.IsNullOrWhiteSpace(FilterText); 62 | 63 | //Confirm regex is valid 64 | if (!addAll) 65 | { 66 | try 67 | { 68 | _ = Regex.IsMatch(string.Empty, FilterText); 69 | } 70 | catch (Exception) 71 | { 72 | addAll = true; 73 | } 74 | } 75 | 76 | //Add all if no proper filter is applied 77 | VisibleIcons = addAll 78 | ? AllIcons 79 | : new List(AllIcons.Where(icon => Regex.IsMatch( 80 | icon.GetInformation().Label 81 | , FilterText 82 | , RegexOptions.IgnoreCase 83 | ))); 84 | 85 | SelectedIcon = VisibleIcons.FirstOrDefault(); 86 | } 87 | 88 | #endregion 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Navigation; 17 | 18 | namespace FontAwesome5.UWP.Example 19 | { 20 | /// 21 | /// Provides application-specific behavior to supplement the default Application class. 22 | /// 23 | sealed partial class App : Application 24 | { 25 | /// 26 | /// Initializes the singleton application object. This is the first line of authored code 27 | /// executed, and as such is the logical equivalent of main() or WinMain(). 28 | /// 29 | public App() 30 | { 31 | this.InitializeComponent(); 32 | this.Suspending += OnSuspending; 33 | } 34 | 35 | /// 36 | /// Invoked when the application is launched normally by the end user. Other entry points 37 | /// will be used such as when the application is launched to open a specific file. 38 | /// 39 | /// Details about the launch request and process. 40 | protected override void OnLaunched(LaunchActivatedEventArgs e) 41 | { 42 | // Do not repeat app initialization when the Window already has content, 43 | // just ensure that the window is active 44 | if (!(Window.Current.Content is Frame rootFrame)) 45 | { 46 | // Create a Frame to act as the navigation context and navigate to the first page 47 | rootFrame = new Frame(); 48 | 49 | rootFrame.NavigationFailed += OnNavigationFailed; 50 | 51 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 52 | { 53 | //TODO: Load state from previously suspended application 54 | } 55 | 56 | // Place the frame in the current Window 57 | Window.Current.Content = rootFrame; 58 | } 59 | 60 | if (e.PrelaunchActivated == false) 61 | { 62 | if (rootFrame.Content == null) 63 | { 64 | // When the navigation stack isn't restored navigate to the first page, 65 | // configuring the new page by passing required information as a navigation 66 | // parameter 67 | rootFrame.Navigate(typeof(MainPage), e.Arguments); 68 | } 69 | // Ensure the current window is active 70 | Window.Current.Activate(); 71 | } 72 | } 73 | 74 | /// 75 | /// Invoked when Navigation to a certain page fails 76 | /// 77 | /// The Frame which failed navigation 78 | /// Details about the navigation failure 79 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 80 | { 81 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName); 82 | } 83 | 84 | /// 85 | /// Invoked when application execution is being suspended. Application state is saved 86 | /// without knowing whether the application will be terminated or resumed with the contents 87 | /// of memory still intact. 88 | /// 89 | /// The source of the suspend request. 90 | /// Details about the suspend request. 91 | private void OnSuspending(object sender, SuspendingEventArgs e) 92 | { 93 | var deferral = e.SuspendingOperation.GetDeferral(); 94 | //TODO: Save application state and stop any background activity 95 | deferral.Complete(); 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.UWP.Example/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.UWP.Example/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.UWP.Example/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.UWP.Example/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.UWP.Example/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.UWP.Example/Assets/StoreLogo.png -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.UWP.Example/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/FontAwesome5.UWP.Example.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x86 7 | {F9E78A5B-F7DB-4870-A2C4-9FE7FAFA5212} 8 | AppContainerExe 9 | Properties 10 | FontAwesome5.UWP.Example 11 | FontAwesome5.UWP.Example 12 | en-US 13 | UAP 14 | 10.0.18362.0 15 | 10.0.18362.0 16 | 14 17 | 512 18 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 19 | true 20 | 21 | 22 | BEB47BED91117F27FA26AE222431E6FA39ACCA3E 23 | True 24 | 25 | 26 | true 27 | bin\x86\Debug\ 28 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 29 | ;2008 30 | full 31 | x86 32 | false 33 | prompt 34 | true 35 | 36 | 37 | bin\x86\Release\ 38 | TRACE;NETFX_CORE;WINDOWS_UWP 39 | true 40 | ;2008 41 | pdbonly 42 | x86 43 | false 44 | prompt 45 | true 46 | true 47 | 48 | 49 | true 50 | bin\ARM\Debug\ 51 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 52 | ;2008 53 | full 54 | ARM 55 | false 56 | prompt 57 | true 58 | 59 | 60 | bin\ARM\Release\ 61 | TRACE;NETFX_CORE;WINDOWS_UWP 62 | true 63 | ;2008 64 | pdbonly 65 | ARM 66 | false 67 | prompt 68 | true 69 | true 70 | 71 | 72 | true 73 | bin\x64\Debug\ 74 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 75 | ;2008 76 | full 77 | x64 78 | false 79 | prompt 80 | true 81 | 82 | 83 | bin\x64\Release\ 84 | TRACE;NETFX_CORE;WINDOWS_UWP 85 | true 86 | ;2008 87 | pdbonly 88 | x64 89 | false 90 | prompt 91 | true 92 | true 93 | 94 | 95 | PackageReference 96 | 97 | 98 | 99 | App.xaml 100 | 101 | 102 | MainPage.xaml 103 | 104 | 105 | 106 | 107 | 108 | 109 | Designer 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | MSBuild:Compile 126 | Designer 127 | 128 | 129 | MSBuild:Compile 130 | Designer 131 | 132 | 133 | 134 | 135 | 6.2.8 136 | 137 | 138 | 139 | 140 | {3da649d8-590a-4bbd-8181-f01bc81748b7} 141 | FontAwesome5.UWP 142 | 143 | 144 | {30c458c0-e963-4972-b9d3-8fb51e434f7c} 145 | FontAwesome5 146 | 147 | 148 | 149 | 14.0 150 | 151 | 152 | 159 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/FontAwesome5.UWP.Example_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.UWP.Example/FontAwesome5.UWP.Example_TemporaryKey.pfx -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 60 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Controls.Primitives; 11 | using Windows.UI.Xaml.Data; 12 | using Windows.UI.Xaml.Input; 13 | using Windows.UI.Xaml.Media; 14 | using Windows.UI.Xaml.Navigation; 15 | using FontAwesome5.UWP.Example.ViewModels; 16 | 17 | // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 18 | 19 | namespace FontAwesome5.UWP.Example 20 | { 21 | /// 22 | /// An empty page that can be used on its own or navigated to within a Frame. 23 | /// 24 | public sealed partial class MainPage : Page 25 | { 26 | public MainPage() 27 | { 28 | this.DataContext = new MainViewModel(); 29 | this.InitializeComponent(); 30 | } 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | FontAwesome5.UWP.Example 18 | Codinion 19 | Assets\StoreLogo.png 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("FontAwesome5.UWP.Example")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("FontAwesome5.UWP.Example")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.UWP.Example/ViewModels/MainViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text.RegularExpressions; 6 | using FontAwesome5.Extensions; 7 | 8 | namespace FontAwesome5.UWP.Example.ViewModels 9 | { 10 | public class MainViewModel : INotifyPropertyChanged 11 | { 12 | public MainViewModel() 13 | { 14 | AllIcons = Enum.GetValues(typeof(EFontAwesomeIcon)).Cast() 15 | .OrderBy(i => i.GetStyle()).ThenBy(i => i.GetLabel()).ToList(); 16 | 17 | AllIcons.Remove(EFontAwesomeIcon.None); 18 | UpdateVisibleIcons(); 19 | 20 | FlipOrientations = Enum.GetValues(typeof(EFlipOrientation)).Cast().ToList(); 21 | SpinDuration = 5; 22 | PulseDuration = 5; 23 | FontSize = 30; 24 | Rotation = 0; 25 | } 26 | 27 | private EFontAwesomeIcon _selectedIcon; 28 | public EFontAwesomeIcon SelectedIcon 29 | { 30 | get => _selectedIcon; 31 | set 32 | { 33 | _selectedIcon = value; 34 | RaisePropertyChanged(nameof(SelectedIcon)); 35 | RaisePropertyChanged(nameof(FontText)); 36 | } 37 | } 38 | 39 | private bool _spinIsEnabled; 40 | public bool SpinIsEnabled 41 | { 42 | get => _spinIsEnabled; 43 | set 44 | { 45 | _spinIsEnabled = value; 46 | RaisePropertyChanged(nameof(SpinIsEnabled)); 47 | RaisePropertyChanged(nameof(FontText)); 48 | } 49 | } 50 | 51 | private double _spinDuration; 52 | public double SpinDuration 53 | { 54 | get => _spinDuration; 55 | set 56 | { 57 | _spinDuration = value; 58 | RaisePropertyChanged(nameof(SpinDuration)); 59 | RaisePropertyChanged(nameof(FontText)); 60 | } 61 | } 62 | 63 | private bool _pulseIsEnabled; 64 | public bool PulseIsEnabled 65 | { 66 | get => _pulseIsEnabled; 67 | set 68 | { 69 | _pulseIsEnabled = value; 70 | RaisePropertyChanged(nameof(PulseIsEnabled)); 71 | RaisePropertyChanged(nameof(FontText)); 72 | } 73 | } 74 | 75 | private double _pulseDuration; 76 | public double PulseDuration 77 | { 78 | get => _pulseDuration; 79 | set 80 | { 81 | _pulseDuration = value; 82 | RaisePropertyChanged(nameof(PulseDuration)); 83 | RaisePropertyChanged(nameof(FontText)); 84 | } 85 | } 86 | 87 | private EFlipOrientation _flipOrientation; 88 | public EFlipOrientation FlipOrientation 89 | { 90 | get => _flipOrientation; 91 | set 92 | { 93 | _flipOrientation = value; 94 | RaisePropertyChanged(nameof(FlipOrientation)); 95 | RaisePropertyChanged(nameof(FontText)); 96 | } 97 | } 98 | 99 | private double _fontSize; 100 | public double FontSize 101 | { 102 | get => _fontSize; 103 | set 104 | { 105 | _fontSize = value; 106 | RaisePropertyChanged(nameof(FontSize)); 107 | RaisePropertyChanged(nameof(FontText)); 108 | } 109 | } 110 | 111 | private double _rotation; 112 | public double Rotation 113 | { 114 | get => _rotation; 115 | set 116 | { 117 | _rotation = value; 118 | RaisePropertyChanged(nameof(Rotation)); 119 | RaisePropertyChanged(nameof(FontText)); 120 | } 121 | } 122 | 123 | public List FlipOrientations { get; set; } = new List(); 124 | public List AllIcons { get; set; } = new List(); 125 | 126 | public string FontText => $""; 128 | 129 | public void RaisePropertyChanged(string propertyName) 130 | { 131 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); 132 | } 133 | 134 | public event PropertyChangedEventHandler PropertyChanged; 135 | 136 | #region Visible Icon Filtering 137 | 138 | public List VisibleIcons { get; private set; } 139 | 140 | private string _filterText; 141 | public string FilterText 142 | { 143 | get => _filterText; 144 | set 145 | { 146 | _filterText = value; 147 | UpdateVisibleIcons(); 148 | } 149 | } 150 | 151 | private void UpdateVisibleIcons() 152 | { 153 | var addAll = string.IsNullOrWhiteSpace(FilterText); 154 | 155 | //Confirm regex is valid 156 | if (!addAll) 157 | { 158 | try 159 | { 160 | _ = Regex.IsMatch(string.Empty, FilterText); 161 | } 162 | catch (Exception) 163 | { 164 | addAll = true; 165 | } 166 | } 167 | 168 | //Add all if no proper filter is applied 169 | VisibleIcons = addAll 170 | ? AllIcons 171 | : new List(AllIcons.Where(icon => Regex.IsMatch( 172 | icon.GetInformation().Label 173 | , FilterText 174 | , RegexOptions.IgnoreCase 175 | ))); 176 | 177 | SelectedIcon = VisibleIcons.FirstOrDefault(); 178 | 179 | RaisePropertyChanged(nameof(VisibleIcons)); 180 | RaisePropertyChanged(nameof(SelectedIcon)); 181 | } 182 | 183 | #endregion 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.UI.Xaml; 2 | using Microsoft.UI.Xaml.Controls; 3 | using Microsoft.UI.Xaml.Controls.Primitives; 4 | using Microsoft.UI.Xaml.Data; 5 | using Microsoft.UI.Xaml.Input; 6 | using Microsoft.UI.Xaml.Media; 7 | using Microsoft.UI.Xaml.Navigation; 8 | using Microsoft.UI.Xaml.Shapes; 9 | using System; 10 | using System.Collections.Generic; 11 | using System.IO; 12 | using System.Linq; 13 | using System.Runtime.InteropServices.WindowsRuntime; 14 | using Windows.ApplicationModel; 15 | using Windows.ApplicationModel.Activation; 16 | using Windows.Foundation; 17 | using Windows.Foundation.Collections; 18 | 19 | // To learn more about WinUI, the WinUI project structure, 20 | // and more about our project templates, see: http://aka.ms/winui-project-info. 21 | 22 | namespace FontAwesome5.WinUI.Example 23 | { 24 | /// 25 | /// Provides application-specific behavior to supplement the default Application class. 26 | /// 27 | public partial class App : Application 28 | { 29 | /// 30 | /// Initializes the singleton application object. This is the first line of authored code 31 | /// executed, and as such is the logical equivalent of main() or WinMain(). 32 | /// 33 | public App() 34 | { 35 | this.InitializeComponent(); 36 | } 37 | 38 | /// 39 | /// Invoked when the application is launched normally by the end user. Other entry points 40 | /// will be used such as when the application is launched to open a specific file. 41 | /// 42 | /// Details about the launch request and process. 43 | protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) 44 | { 45 | m_window = new MainWindow(); 46 | m_window.Activate(); 47 | } 48 | 49 | private Window m_window; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.WinUI.Example/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.WinUI.Example/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.WinUI.Example/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.WinUI.Example/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.WinUI.Example/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.WinUI.Example/Assets/StoreLogo.png -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/Examples/FontAwesome5.WinUI.Example/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/FontAwesome5.WinUI.Example.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | WinExe 4 | net6.0-windows10.0.19041.0 5 | 10.0.17763.0 6 | FontAwesome5.WinUI.Example 7 | app.manifest 8 | x86;x64;arm64 9 | win10-x86;win10-x64;win10-arm64 10 | win10-$(Platform).pubxml 11 | true 12 | true 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.UI.Xaml; 2 | using FontAwesome5.WinUI.Example.ViewModels; 3 | 4 | // To learn more about WinUI, the WinUI project structure, 5 | // and more about our project templates, see: http://aka.ms/winui-project-info. 6 | 7 | namespace FontAwesome5.WinUI.Example 8 | { 9 | /// 10 | /// An empty window that can be used on its own or navigated to within a Frame. 11 | /// 12 | public sealed partial class MainWindow : Window 13 | { 14 | public MainWindow() 15 | { 16 | this.InitializeComponent(); 17 | 18 | if (this.Content is FrameworkElement element) 19 | element.DataContext = new MainViewModel(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 8 | 9 | 13 | 14 | 15 | FontAwesome5.WinUI.Example 16 | FontAwesome5 17 | Assets\StoreLogo.png 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "FontAwesome5.WinUI.Example (Package)": { 4 | "commandName": "MsixPackage" 5 | }, 6 | "FontAwesome5.WinUI.Example (Unpackaged)": { 7 | "commandName": "Project" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/ViewModels/MainViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using FontAwesome5.Extensions; 6 | 7 | namespace FontAwesome5.WinUI.Example.ViewModels 8 | { 9 | public class MainViewModel : INotifyPropertyChanged 10 | { 11 | public MainViewModel() 12 | { 13 | AllIcons = Enum.GetValues(typeof(EFontAwesomeIcon)).Cast() 14 | .OrderBy(i => i.GetStyle()).ThenBy(i => i.GetLabel()).ToList(); 15 | 16 | AllIcons.Remove(EFontAwesomeIcon.None); 17 | SelectedIcon = AllIcons.First(); 18 | 19 | FlipOrientations = Enum.GetValues(typeof(EFlipOrientation)).Cast().ToList(); 20 | SpinDuration = 5; 21 | PulseDuration = 5; 22 | FontSize = 30; 23 | Rotation = 0; 24 | } 25 | 26 | private EFontAwesomeIcon _selectedIcon; 27 | public EFontAwesomeIcon SelectedIcon 28 | { 29 | get => _selectedIcon; 30 | set 31 | { 32 | _selectedIcon = value; 33 | RaisePropertyChanged(nameof(SelectedIcon)); 34 | RaisePropertyChanged(nameof(FontText)); 35 | } 36 | } 37 | 38 | private bool _spinIsEnabled; 39 | public bool SpinIsEnabled 40 | { 41 | get => _spinIsEnabled; 42 | set 43 | { 44 | _spinIsEnabled = value; 45 | RaisePropertyChanged(nameof(SpinIsEnabled)); 46 | RaisePropertyChanged(nameof(FontText)); 47 | } 48 | } 49 | 50 | private double _spinDuration; 51 | public double SpinDuration 52 | { 53 | get => _spinDuration; 54 | set 55 | { 56 | _spinDuration = value; 57 | RaisePropertyChanged(nameof(SpinDuration)); 58 | RaisePropertyChanged(nameof(FontText)); 59 | } 60 | } 61 | 62 | private bool _pulseIsEnabled; 63 | public bool PulseIsEnabled 64 | { 65 | get => _pulseIsEnabled; 66 | set 67 | { 68 | _pulseIsEnabled = value; 69 | RaisePropertyChanged(nameof(PulseIsEnabled)); 70 | RaisePropertyChanged(nameof(FontText)); 71 | } 72 | } 73 | 74 | private double _pulseDuration; 75 | public double PulseDuration 76 | { 77 | get => _pulseDuration; 78 | set 79 | { 80 | _pulseDuration = value; 81 | RaisePropertyChanged(nameof(PulseDuration)); 82 | RaisePropertyChanged(nameof(FontText)); 83 | } 84 | } 85 | 86 | private EFlipOrientation _flipOrientation; 87 | public EFlipOrientation FlipOrientation 88 | { 89 | get => _flipOrientation; 90 | set 91 | { 92 | _flipOrientation = value; 93 | RaisePropertyChanged(nameof(FlipOrientation)); 94 | RaisePropertyChanged(nameof(FontText)); 95 | } 96 | } 97 | 98 | private double _fontSize; 99 | public double FontSize 100 | { 101 | get => _fontSize; 102 | set 103 | { 104 | _fontSize = value; 105 | RaisePropertyChanged(nameof(FontSize)); 106 | RaisePropertyChanged(nameof(FontText)); 107 | } 108 | } 109 | 110 | private double _rotation; 111 | public double Rotation 112 | { 113 | get => _rotation; 114 | set 115 | { 116 | _rotation = value; 117 | RaisePropertyChanged(nameof(Rotation)); 118 | RaisePropertyChanged(nameof(FontText)); 119 | } 120 | } 121 | 122 | public List FlipOrientations { get; set; } = new List(); 123 | public List AllIcons { get; set; } = new List(); 124 | 125 | public string FontText => $""; 127 | 128 | public void RaisePropertyChanged(string propertyName) 129 | { 130 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); 131 | } 132 | 133 | public event PropertyChangedEventHandler PropertyChanged; 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /src/Examples/FontAwesome5.WinUI.Example/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | true/PM 12 | PerMonitorV2, PerMonitor 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/FontAwesome.Shared/Extensions/EFontAwesomeIconExtensions.cs: -------------------------------------------------------------------------------- 1 | using FontAwesome5.Extensions; 2 | #if WINDOWS_UWP 3 | using Windows.UI.Xaml.Media; 4 | #elif WINUI 5 | using Microsoft.UI.Xaml.Media; 6 | #else 7 | using System.Windows.Media; 8 | #endif 9 | namespace FontAwesome5.Extensions 10 | { 11 | /// 12 | /// EFontAwesomeIcon extensions 13 | /// 14 | public static class EFontAwesomeIconExtensions 15 | { 16 | #if !WINDOWS_UWP && !WINUI 17 | /// 18 | /// Get the Typeface of an icon 19 | /// 20 | public static Typeface GetTypeFace(this EFontAwesomeIcon icon) 21 | { 22 | switch (icon.GetStyle()) 23 | { 24 | case EFontAwesomeStyle.Regular: return Fonts.RegularTypeface; 25 | case EFontAwesomeStyle.Solid: return Fonts.SolidTypeface; 26 | case EFontAwesomeStyle.Brands: return Fonts.BrandsTypeface; 27 | } 28 | 29 | return Fonts.RegularTypeface; 30 | } 31 | #endif 32 | /// 33 | /// Get the FontFamily of an icon 34 | /// 35 | public static FontFamily GetFontFamily(this EFontAwesomeIcon icon) 36 | { 37 | switch (icon.GetStyle()) 38 | { 39 | case EFontAwesomeStyle.Regular: return Fonts.RegularFontFamily; 40 | case EFontAwesomeStyle.Solid: return Fonts.SolidFontFamily; 41 | case EFontAwesomeStyle.Brands: return Fonts.BrandsFontFamily; 42 | } 43 | 44 | return Fonts.RegularFontFamily; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/FontAwesome.Shared/FontAwesome.Shared.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 2f36f2df-f8b2-49cb-91e7-e5c88e3a96d5 7 | 8 | 9 | FontAwesome.Shared 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/FontAwesome.Shared/FontAwesome.Shared.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2f36f2df-f8b2-49cb-91e7-e5c88e3a96d5 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/FontAwesome.Shared/IFlippable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | 8 | namespace FontAwesome5 9 | { 10 | /// 11 | /// Defines the different flip orientations that a icon can have. 12 | /// 13 | #if !WINDOWS_UWP && !WINUI 14 | [Localizability(LocalizationCategory.None, Readability = Readability.Unreadable)] 15 | #endif 16 | public enum EFlipOrientation 17 | { 18 | /// 19 | /// Default 20 | /// 21 | Normal = 0, 22 | /// 23 | /// Flip horizontally (on x-achsis) 24 | /// 25 | Horizontal, 26 | /// 27 | /// Flip vertically (on y-achsis) 28 | /// 29 | Vertical, 30 | } 31 | 32 | /// 33 | /// Represents a flippable control 34 | /// 35 | public interface IFlippable 36 | { 37 | /// 38 | /// Gets or sets the current orientation (horizontal, vertical). 39 | /// 40 | EFlipOrientation FlipOrientation { get; set; } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/FontAwesome.Shared/IPulsable.cs: -------------------------------------------------------------------------------- 1 | namespace FontAwesome5 2 | { 3 | /// 4 | /// Represents a control that can have the pulse animation 5 | /// 6 | public interface IPulsable 7 | { 8 | /// 9 | /// Gets or sets the state of the pulse animation 10 | /// 11 | bool Pulse { get; set; } 12 | 13 | /// 14 | /// Gets or sets the duration of the pulse animation 15 | /// 16 | double PulseDuration { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/FontAwesome.Shared/IRotatable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace FontAwesome5 8 | { 9 | /// 10 | /// Represents a rotatable control 11 | /// 12 | public interface IRotatable 13 | { 14 | /// 15 | /// Gets or sets the current rotation (angle). 16 | /// 17 | double Rotation { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/FontAwesome.Shared/ISpinable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace FontAwesome5 8 | { 9 | /// 10 | /// Represents a spinable control 11 | /// 12 | public interface ISpinable 13 | { 14 | /// 15 | /// Gets or sets the current spin (angle) animation of the icon. 16 | /// 17 | bool Spin { get; set; } 18 | 19 | /// 20 | /// Gets or sets the duration of the spinning animation (in seconds). This will stop and start the spin animation. 21 | /// 22 | double SpinDuration { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/FontAwesome5.Net.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29102.190 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B1387CB2-E6D3-4266-B1E7-065826845F0E}" 7 | ProjectSection(SolutionItems) = preProject 8 | ..\README.md = ..\README.md 9 | EndProjectSection 10 | EndProject 11 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FontAwesome5", "FontAwesome5\FontAwesome5.csproj", "{C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}" 12 | EndProject 13 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{C2DF6A3D-4A1A-43C4-9474-7591294B72E9}" 14 | ProjectSection(SolutionItems) = preProject 15 | NuGet\FontAwesome5.nuspec = NuGet\FontAwesome5.nuspec 16 | EndProjectSection 17 | EndProject 18 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{5DB18EB6-0943-4E8A-A9D7-C7146AD79C00}" 19 | EndProject 20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FontAwesome5.Generator", "Tools\FontAwesome5.Generator\FontAwesome5.Generator.csproj", "{36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}" 21 | EndProject 22 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FontAwesome5.Net", "FontAwesome5.Net\FontAwesome5.Net.csproj", "{E3B67831-928E-4B93-8249-3BAB7E52AE3F}" 23 | EndProject 24 | Global 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|Any CPU = Debug|Any CPU 27 | Debug|ARM = Debug|ARM 28 | Debug|x64 = Debug|x64 29 | Debug|x86 = Debug|x86 30 | Release|Any CPU = Release|Any CPU 31 | Release|ARM = Release|ARM 32 | Release|x64 = Release|x64 33 | Release|x86 = Release|x86 34 | EndGlobalSection 35 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 36 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|ARM.ActiveCfg = Debug|Any CPU 39 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|ARM.Build.0 = Debug|Any CPU 40 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|x64.ActiveCfg = Debug|Any CPU 41 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|x64.Build.0 = Debug|Any CPU 42 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|x86.ActiveCfg = Debug|Any CPU 43 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|x86.Build.0 = Debug|Any CPU 44 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|Any CPU.Build.0 = Release|Any CPU 46 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|ARM.ActiveCfg = Release|Any CPU 47 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|ARM.Build.0 = Release|Any CPU 48 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|x64.ActiveCfg = Release|Any CPU 49 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|x64.Build.0 = Release|Any CPU 50 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|x86.ActiveCfg = Release|Any CPU 51 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|x86.Build.0 = Release|Any CPU 52 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 53 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|Any CPU.Build.0 = Debug|Any CPU 54 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|ARM.ActiveCfg = Debug|Any CPU 55 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|ARM.Build.0 = Debug|Any CPU 56 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|x64.ActiveCfg = Debug|Any CPU 57 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|x64.Build.0 = Debug|Any CPU 58 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|x86.ActiveCfg = Debug|Any CPU 59 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|x86.Build.0 = Debug|Any CPU 60 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|Any CPU.ActiveCfg = Release|Any CPU 61 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|ARM.ActiveCfg = Release|Any CPU 62 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|ARM.Build.0 = Release|Any CPU 63 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|x64.ActiveCfg = Release|Any CPU 64 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|x64.Build.0 = Release|Any CPU 65 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|x86.ActiveCfg = Release|Any CPU 66 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|x86.Build.0 = Release|Any CPU 67 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 68 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Debug|Any CPU.Build.0 = Debug|Any CPU 69 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Debug|ARM.ActiveCfg = Debug|Any CPU 70 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Debug|ARM.Build.0 = Debug|Any CPU 71 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Debug|x64.ActiveCfg = Debug|Any CPU 72 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Debug|x64.Build.0 = Debug|Any CPU 73 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Debug|x86.ActiveCfg = Debug|Any CPU 74 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Debug|x86.Build.0 = Debug|Any CPU 75 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Release|Any CPU.ActiveCfg = Release|Any CPU 76 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Release|Any CPU.Build.0 = Release|Any CPU 77 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Release|ARM.ActiveCfg = Release|Any CPU 78 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Release|ARM.Build.0 = Release|Any CPU 79 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Release|x64.ActiveCfg = Release|Any CPU 80 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Release|x64.Build.0 = Release|Any CPU 81 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Release|x86.ActiveCfg = Release|Any CPU 82 | {E3B67831-928E-4B93-8249-3BAB7E52AE3F}.Release|x86.Build.0 = Release|Any CPU 83 | EndGlobalSection 84 | GlobalSection(SolutionProperties) = preSolution 85 | HideSolutionNode = FALSE 86 | EndGlobalSection 87 | GlobalSection(NestedProjects) = preSolution 88 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B} = {5DB18EB6-0943-4E8A-A9D7-C7146AD79C00} 89 | EndGlobalSection 90 | GlobalSection(ExtensibilityGlobals) = postSolution 91 | SolutionGuid = {CCE0C24A-AD07-48ED-8A93-2B927239ED7E} 92 | EndGlobalSection 93 | EndGlobal 94 | -------------------------------------------------------------------------------- /src/FontAwesome5.Net/Awesome.cs: -------------------------------------------------------------------------------- 1 | using FontAwesome5.Extensions; 2 | using System; 3 | using System.Windows; 4 | using System.Windows.Controls; 5 | using System.Windows.Media; 6 | 7 | namespace FontAwesome5 8 | { 9 | /// 10 | /// Provides attached properties to set FontAwesome icons on controls. 11 | /// 12 | public static class Awesome 13 | { 14 | /// 15 | /// Identifies the FontAwesome.WPF.Awesome.Content attached dependency property. 16 | /// 17 | public static readonly DependencyProperty ContentProperty = 18 | DependencyProperty.RegisterAttached( 19 | "Content", 20 | typeof(EFontAwesomeIcon), 21 | typeof(Awesome), 22 | new PropertyMetadata(DEFAULT_CONTENT, ContentChanged)); 23 | 24 | /// 25 | /// Gets the content of a ContentControl, expressed as a FontAwesome icon. 26 | /// 27 | /// The ContentControl subject of the query 28 | /// FontAwesome icon found as content 29 | public static EFontAwesomeIcon GetContent(DependencyObject target) 30 | { 31 | return (EFontAwesomeIcon)target.GetValue(ContentProperty); 32 | } 33 | /// 34 | /// Sets the content of a ContentControl expressed as a FontAwesome icon. This will cause the content to be redrawn. 35 | /// 36 | /// The ContentControl where to set the content 37 | /// FontAwesome icon to set as content 38 | public static void SetContent(DependencyObject target, EFontAwesomeIcon value) 39 | { 40 | target.SetValue(ContentProperty, value); 41 | } 42 | 43 | private static void ContentChanged(DependencyObject sender, DependencyPropertyChangedEventArgs evt) 44 | { 45 | // If target is not a ContenControl just ignore: Awesome.Content property can only be set on a ContentControl element 46 | if (sender is not ContentControl) 47 | { 48 | return; 49 | } 50 | 51 | var target = (ContentControl)sender; 52 | 53 | // If value is not a FontAwesomeIcon just ignore: Awesome.Content property can only be set to a FontAwesomeIcon value 54 | if (evt.NewValue is not EFontAwesomeIcon) 55 | { 56 | return; 57 | } 58 | 59 | var symbolIcon = (EFontAwesomeIcon)evt.NewValue; 60 | 61 | target.FontFamily = symbolIcon.GetFontFamily(); 62 | target.Content = symbolIcon.GetUnicode(); 63 | } 64 | 65 | private const EFontAwesomeIcon DEFAULT_CONTENT = EFontAwesomeIcon.None; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/FontAwesome5.Net/Converters/DrawingConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Windows.Data; 7 | using System.Windows.Markup; 8 | using System.Windows.Media; 9 | 10 | using FontAwesome5.Extensions; 11 | 12 | namespace FontAwesome5.Converters 13 | { 14 | public class DrawingConverter : MarkupExtension, IValueConverter 15 | { 16 | public override object ProvideValue(IServiceProvider serviceProvider) 17 | { 18 | return this; 19 | } 20 | 21 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 22 | { 23 | if (value is not EFontAwesomeIcon) 24 | { 25 | return null; 26 | } 27 | 28 | if (parameter is not Brush brush) 29 | { 30 | brush = Brushes.Black; 31 | } 32 | 33 | return ((EFontAwesomeIcon)value).CreateDrawing(brush); 34 | } 35 | 36 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 37 | { 38 | throw new NotImplementedException(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/FontAwesome5.Net/Converters/ImageSourceConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Windows.Data; 7 | using System.Windows.Markup; 8 | using System.Windows.Media; 9 | 10 | using FontAwesome5.Extensions; 11 | 12 | namespace FontAwesome5.Converters 13 | { 14 | /// 15 | /// Converts a FontAwesomIcon to an ImageSource. Use the ConverterParameter to pass the Brush. 16 | /// 17 | public class ImageSourceConverter : MarkupExtension, IValueConverter 18 | { 19 | public override object ProvideValue(IServiceProvider serviceProvider) 20 | { 21 | return this; 22 | } 23 | 24 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 25 | { 26 | if (value is not EFontAwesomeIcon) 27 | { 28 | return null; 29 | } 30 | 31 | if (parameter is not Brush brush) 32 | { 33 | brush = Brushes.Black; 34 | } 35 | 36 | return ((EFontAwesomeIcon)value).CreateImageSource(brush); 37 | } 38 | 39 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 40 | { 41 | throw new NotImplementedException(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/FontAwesome5.Net/Converters/ImageSourceSvgConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Windows.Data; 7 | using System.Windows.Markup; 8 | using System.Windows.Media; 9 | 10 | using FontAwesome5.Extensions; 11 | 12 | namespace FontAwesome5.Converters 13 | { 14 | /// 15 | /// Converts a FontAwesomIcon to an ImageSource. Use the ConverterParameter to pass the Brush. 16 | /// 17 | public class ImageSourceSvgConverter : MarkupExtension, IValueConverter 18 | { 19 | public override object ProvideValue(IServiceProvider serviceProvider) 20 | { 21 | return this; 22 | } 23 | 24 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 25 | { 26 | if (value is not EFontAwesomeIcon) 27 | { 28 | return null; 29 | } 30 | 31 | if (parameter is not Brush brush) 32 | { 33 | brush = Brushes.Black; 34 | } 35 | 36 | return ((EFontAwesomeIcon)value).CreateImageSource(brush, new Pen()); 37 | } 38 | 39 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 40 | { 41 | throw new NotImplementedException(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/FontAwesome5.Net/Converters/LabelConverter.cs: -------------------------------------------------------------------------------- 1 | using FontAwesome5.Extensions; 2 | using System; 3 | using System.Globalization; 4 | using System.Windows.Data; 5 | using System.Windows.Markup; 6 | 7 | namespace FontAwesome5.Converters 8 | { 9 | public class LabelConverter : MarkupExtension, IValueConverter 10 | { 11 | public override object ProvideValue(IServiceProvider serviceProvider) 12 | { 13 | return this; 14 | } 15 | 16 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 17 | { 18 | if (value is not EFontAwesomeIcon) 19 | { 20 | return null; 21 | } 22 | 23 | var icon = (EFontAwesomeIcon)value; 24 | var info = icon.GetInformation(); 25 | if (info == null) 26 | { 27 | return null; 28 | } 29 | 30 | return parameter is string format && !string.IsNullOrEmpty(format) ? string.Format(format, info.Label, info.Style) : info.Label; 31 | } 32 | 33 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/FontAwesome5.Net/Converters/StyleConverter.cs: -------------------------------------------------------------------------------- 1 | using FontAwesome5.Extensions; 2 | using System; 3 | using System.Globalization; 4 | using System.Windows.Data; 5 | using System.Windows.Markup; 6 | 7 | namespace FontAwesome5.Converters 8 | { 9 | public class StyleConverter : MarkupExtension, IValueConverter 10 | { 11 | public override object ProvideValue(IServiceProvider serviceProvider) 12 | { 13 | return this; 14 | } 15 | 16 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 17 | { 18 | if (value is not EFontAwesomeIcon) 19 | { 20 | return EFontAwesomeStyle.None; 21 | } 22 | 23 | var icon = (EFontAwesomeIcon)value; 24 | return icon.GetStyle(); 25 | } 26 | 27 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/FontAwesome5.Net/Converters/VisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Data; 7 | using System.Windows.Markup; 8 | 9 | namespace FontAwesome5.Converters 10 | { 11 | [ValueConversion(typeof(EFontAwesomeIcon), typeof(Visibility))] 12 | public class VisibilityConverter : MarkupExtension, IValueConverter 13 | { 14 | public override object ProvideValue(IServiceProvider serviceProvider) 15 | { 16 | return this; 17 | } 18 | 19 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 20 | { 21 | if (value is not EFontAwesomeIcon) 22 | { 23 | throw new InvalidOperationException("The target must be a EFontAwesomeIcon"); 24 | } 25 | 26 | return (EFontAwesomeIcon)value == EFontAwesomeIcon.None ? parameter ?? Visibility.Collapsed : Visibility.Visible; 27 | } 28 | 29 | 30 | public object ConvertBack(object value, Type targetType, object parameter, 31 | System.Globalization.CultureInfo culture) 32 | { 33 | throw new NotSupportedException(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/FontAwesome5.Net/Extensions/EFontAwesomeIconsExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Windows; 7 | using System.Windows.Media; 8 | using System.Windows.Shapes; 9 | 10 | namespace FontAwesome5.Extensions 11 | { 12 | public static class EFontAwesomeIconsExtensions 13 | { 14 | /// 15 | /// Creates a new System.Windows.Media.ImageSource of a specified FontAwesomeIcon and foreground System.Windows.Media.Brush. 16 | /// 17 | /// The FontAwesome icon to be drawn. 18 | /// The System.Windows.Media.Brush to be used as the foreground. 19 | /// The font size in em. 20 | /// A new System.Windows.Media.ImageSource 21 | public static ImageSource CreateImageSource(this EFontAwesomeIcon icon, Brush foregroundBrush, double emSize = 100) 22 | { 23 | return new DrawingImage(icon.CreateDrawing(foregroundBrush, emSize)); 24 | } 25 | 26 | /// 27 | /// Creates a new System.Windows.Media.ImageSource of a specified FontAwesomeIcon and foreground System.Windows.Media.Brush. 28 | /// 29 | /// The FontAwesome icon to be drawn. 30 | /// The System.Windows.Media.Brush to be used as the foreground. 31 | /// A new System.Windows.Media.ImageSource 32 | public static ImageSource CreateImageSource(this EFontAwesomeIcon icon, Brush foregroundBrush, Pen pen) 33 | { 34 | return new DrawingImage(icon.CreateDrawing(foregroundBrush, pen)); 35 | } 36 | 37 | /// 38 | /// Creates a new System.Windows.Media.Drawing of a specified FontAwesomeIcon and foreground System.Windows.Media.Brush. 39 | /// This will use the Font for the Drawing creation. 40 | /// 41 | /// The FontAwesome icon to be drawn. 42 | /// The System.Windows.Media.Brush to be used as the foreground. 43 | /// The font size in em. 44 | /// A new System.Windows.Media.Drawing 45 | public static Drawing CreateDrawing(this EFontAwesomeIcon icon, Brush foregroundBrush, double emSize = 100) 46 | { 47 | var visual = new DrawingVisual(); 48 | using (var drawingContext = visual.RenderOpen()) 49 | { 50 | drawingContext.DrawText(icon.CreateFormattedText(foregroundBrush, emSize), new Point(0, 0)); 51 | } 52 | return visual.Drawing; 53 | } 54 | 55 | /// 56 | /// Creates a new System.Windows.Media.Drawing of a specified FontAwesomeIcon. 57 | /// This will use the SVG for the Drawing creation. 58 | /// 59 | /// The FontAwesome icon to be drawn. 60 | /// The Brush with which to fill the Geometry. This is optional, and can be null. If the brush is null, no fill is drawn. 61 | /// The Pen with which to stroke the Geometry. This is optional, and can be null. If the pen is null, no stroke is drawn. 62 | /// A new System.Windows.Media.Drawing 63 | public static Drawing CreateDrawing(this EFontAwesomeIcon icon, Brush brush, Pen pen) 64 | { 65 | var visual = new DrawingVisual(); 66 | using (var drawingContext = visual.RenderOpen()) 67 | { 68 | if (icon.GetSvg(out var strPath, out var width, out var height)) 69 | { 70 | drawingContext.DrawGeometry(brush, pen, Geometry.Parse(strPath)); 71 | } 72 | } 73 | return visual.Drawing; 74 | } 75 | 76 | /// 77 | /// Creates a new System.Windows.Media.FormattedText of a specified FontAwesomeIcon and foreground System.Windows.Media.Brush. 78 | /// 79 | /// The FontAwesome icon to be drawn. 80 | /// The System.Windows.Media.Brush to be used as the foreground. 81 | /// The font size in em. 82 | /// A new System.Windows.Media.FormattedText 83 | public static FormattedText CreateFormattedText(this EFontAwesomeIcon icon, Brush foregroundBrush, double emSize = 100) 84 | { 85 | return new FormattedText(icon.GetUnicode(), CultureInfo.InvariantCulture, FlowDirection.LeftToRight, 86 | icon.GetTypeFace(), emSize, foregroundBrush) 87 | { 88 | TextAlignment = TextAlignment.Center, 89 | }; 90 | } 91 | 92 | /// 93 | /// Creates a new System.Windows.Media.FormattedText of a specified FontAwesomeIcon and foreground System.Windows.Media.Brush. 94 | /// 95 | /// The FontAwesome icon to be drawn. 96 | /// The System.Windows.Media.Brush to be used as the foreground. 97 | /// The font size in em. 98 | /// The flow direction of the font 99 | /// The text formatting mode of the font 100 | /// The number substitution of the font. 101 | /// A new System.Windows.Media.FormattedText 102 | public static FormattedText CreateFormattedText(this EFontAwesomeIcon icon, Brush foregroundBrush, double emSize, 103 | FlowDirection flowDirection, 104 | TextFormattingMode textFormattingMode, 105 | NumberSubstitution numberSubstitution) 106 | { 107 | return new FormattedText(icon.GetUnicode(), CultureInfo.InvariantCulture, flowDirection, 108 | icon.GetTypeFace(), emSize, foregroundBrush, numberSubstitution, textFormattingMode); 109 | } 110 | 111 | /// 112 | /// Creates a new System.Windows.Shapes.Path of a specified FontAwesomeIcon and foreground System.Windows.Media.Brush. 113 | /// 114 | /// The FontAwesome icon to be drawn. 115 | /// The System.Windows.Media.Brush to be used as the foreground. 116 | /// The font size in em. 117 | /// A new System.Windows.Shapes.Path 118 | public static Path CreatePath(this EFontAwesomeIcon icon, Brush foregroundBrush, double emSize = 100) 119 | { 120 | if (icon.GetSvg(out var strPath, out var width, out var height)) 121 | { 122 | return new Path 123 | { 124 | Data = Geometry.Parse(strPath), 125 | Width = width, 126 | Height = height, 127 | Fill = foregroundBrush 128 | }; 129 | } 130 | return null; 131 | } 132 | 133 | /// 134 | /// Creates a new System.Windows.Media.Geometry of a specified FontAwesomeIcon. 135 | /// 136 | /// The FontAwesome icon to be drawn. 137 | /// The width of the SVG. 138 | /// The height of the SVG 139 | /// A new System.Windows.Media.Geometry 140 | public static Geometry CreateGeometry(this EFontAwesomeIcon icon, out int width, out int height) 141 | { 142 | if (icon.GetSvg(out var strPath, out width, out height)) 143 | { 144 | return Geometry.Parse(strPath); 145 | } 146 | return null; 147 | } 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /src/FontAwesome5.Net/FontAwesome5.Net.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net40;net462;net472;netcoreapp3.1;net5.0-windows;net6.0-windows 5 | true 6 | true 7 | Key.snk 8 | false 9 | FontAwesome5.Net 10 | FontAwesome5 11 | latest 12 | 13 | 14 | 15 | True 16 | Martin Topfstedt 17 | MIT 18 | Copyright © Codinion 2018 19 | Codinion 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/FontAwesome5.Net/Fonts.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Resources; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows; 10 | using System.Windows.Media; 11 | 12 | namespace FontAwesome5 13 | { 14 | /// 15 | /// Provides FontFamilies and Typefaces of FontAwesome5. 16 | /// 17 | public static class Fonts 18 | { 19 | static Fonts() 20 | { 21 | var path = Path.GetTempPath(); 22 | SaveFontFilesToDirectory(path); 23 | LoadFromDirectory(path); 24 | } 25 | 26 | public static void LoadFromResource() 27 | { 28 | RegularFontFamily = new FontFamily(new Uri("pack://application:,,,/FontAwesome5.Net;component/"), "./Fonts/#Font Awesome 5 Free Regular"); 29 | SolidFontFamily = new FontFamily(new Uri("pack://application:,,,/FontAwesome5.Net;component/"), "./Fonts/#Font Awesome 5 Free Solid"); 30 | BrandsFontFamily = new FontFamily(new Uri("pack://application:,,,/FontAwesome5.Net;component/"), "./Fonts/#Font Awesome 5 Brands Regular"); 31 | } 32 | 33 | public static void LoadFromDirectory(string path) 34 | { 35 | RegularFontFamily = new FontFamily(new Uri($"file:///{path}", UriKind.Absolute), "./#Font Awesome 5 Free Regular"); 36 | SolidFontFamily = new FontFamily(new Uri($"file:///{path}", UriKind.Absolute), "./#Font Awesome 5 Free Solid"); 37 | BrandsFontFamily = new FontFamily(new Uri($"file:///{path}", UriKind.Absolute), "./#Font Awesome 5 Brands Regular"); 38 | } 39 | 40 | public static void SaveFontFilesToDirectory(string path) 41 | { 42 | var resManager = new ResourceManager("FontAwesome5.Net.g", Assembly.GetExecutingAssembly()); 43 | WriteResourceToFile(resManager, $"Fonts/Font Awesome 5 Free-Solid-900.otf", Path.Combine(path, "Font Awesome 5 Free-Solid-900.otf")); 44 | WriteResourceToFile(resManager, $"Fonts/Font Awesome 5 Free-Regular-400.otf", Path.Combine(path, "Font Awesome 5 Free-Regular-400.otf")); 45 | WriteResourceToFile(resManager, $"Fonts/Font Awesome 5 Brands-Regular-400.otf", Path.Combine(path, "Font Awesome 5 Brands-Regular-400.otf")); 46 | } 47 | 48 | private static void WriteResourceToFile(ResourceManager resManager, string resourceName, string fileName) 49 | { 50 | if (File.Exists(fileName)) 51 | { 52 | return; 53 | } 54 | 55 | using (var res = resManager.GetStream(Uri.EscapeUriString(resourceName).ToLowerInvariant())) 56 | { 57 | using (var file = new FileStream(fileName, FileMode.Create, FileAccess.Write)) 58 | { 59 | res.CopyTo(file); 60 | } 61 | } 62 | } 63 | 64 | /// 65 | /// FontAwesome5 Regular FontFamily 66 | /// 67 | public static FontFamily RegularFontFamily; 68 | 69 | /// 70 | /// FontAwesome5 Solid FontFamily 71 | /// 72 | public static FontFamily SolidFontFamily; 73 | 74 | /// 75 | /// FontAwesome5 Brands FontFamily 76 | /// 77 | public static FontFamily BrandsFontFamily; 78 | 79 | 80 | /// 81 | /// FontAwesome5 Regular Typeface 82 | /// 83 | public static Typeface RegularTypeface => new Typeface(RegularFontFamily, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal); 84 | /// 85 | /// FontAwesome5 Solid Typeface 86 | /// 87 | public static Typeface SolidTypeface => new Typeface(SolidFontFamily, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal); 88 | /// 89 | /// FontAwesome5 Brands Typeface 90 | /// 91 | public static Typeface BrandsTypeface => new Typeface(BrandsFontFamily, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/FontAwesome5.Net/Key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/FontAwesome5.Net/Key.snk -------------------------------------------------------------------------------- /src/FontAwesome5.Net/XmlNamespace.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Markup; 2 | 3 | [assembly: XmlnsPrefix("http://schemas.fontawesome.com/icons/", "fa5")] 4 | [assembly: XmlnsDefinition("http://schemas.fontawesome.com/icons/", "FontAwesome5")] 5 | [assembly: XmlnsDefinition("http://schemas.fontawesome.com/icons/", "FontAwesome5.Converters")] 6 | -------------------------------------------------------------------------------- /src/FontAwesome5.UWP.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29102.190 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B1387CB2-E6D3-4266-B1E7-065826845F0E}" 7 | ProjectSection(SolutionItems) = preProject 8 | ..\README.md = ..\README.md 9 | EndProjectSection 10 | EndProject 11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FontAwesome5.UWP", "FontAwesome5.UWP\FontAwesome5.UWP.csproj", "{3DA649D8-590A-4BBD-8181-F01BC81748B7}" 12 | EndProject 13 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FontAwesome5", "FontAwesome5\FontAwesome5.csproj", "{C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}" 14 | EndProject 15 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{C2DF6A3D-4A1A-43C4-9474-7591294B72E9}" 16 | ProjectSection(SolutionItems) = preProject 17 | NuGet\FontAwesome5.nuspec = NuGet\FontAwesome5.nuspec 18 | EndProjectSection 19 | EndProject 20 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{5DB18EB6-0943-4E8A-A9D7-C7146AD79C00}" 21 | EndProject 22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FontAwesome5.Generator", "Tools\FontAwesome5.Generator\FontAwesome5.Generator.csproj", "{36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}" 23 | EndProject 24 | Global 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|Any CPU = Debug|Any CPU 27 | Debug|ARM = Debug|ARM 28 | Debug|x64 = Debug|x64 29 | Debug|x86 = Debug|x86 30 | Release|Any CPU = Release|Any CPU 31 | Release|ARM = Release|ARM 32 | Release|x64 = Release|x64 33 | Release|x86 = Release|x86 34 | EndGlobalSection 35 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 36 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|ARM.ActiveCfg = Debug|ARM 39 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|ARM.Build.0 = Debug|ARM 40 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|x64.ActiveCfg = Debug|x64 41 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|x64.Build.0 = Debug|x64 42 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|x86.ActiveCfg = Debug|x86 43 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|x86.Build.0 = Debug|x86 44 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|Any CPU.Build.0 = Release|Any CPU 46 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|ARM.ActiveCfg = Release|ARM 47 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|ARM.Build.0 = Release|ARM 48 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|x64.ActiveCfg = Release|x64 49 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|x64.Build.0 = Release|x64 50 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|x86.ActiveCfg = Release|x86 51 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|x86.Build.0 = Release|x86 52 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 53 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|Any CPU.Build.0 = Debug|Any CPU 54 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|ARM.ActiveCfg = Debug|Any CPU 55 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|ARM.Build.0 = Debug|Any CPU 56 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|x64.ActiveCfg = Debug|Any CPU 57 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|x64.Build.0 = Debug|Any CPU 58 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|x86.ActiveCfg = Debug|Any CPU 59 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|x86.Build.0 = Debug|Any CPU 60 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|Any CPU.ActiveCfg = Release|Any CPU 61 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|Any CPU.Build.0 = Release|Any CPU 62 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|ARM.ActiveCfg = Release|Any CPU 63 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|ARM.Build.0 = Release|Any CPU 64 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|x64.ActiveCfg = Release|Any CPU 65 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|x64.Build.0 = Release|Any CPU 66 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|x86.ActiveCfg = Release|Any CPU 67 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|x86.Build.0 = Release|Any CPU 68 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 69 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|Any CPU.Build.0 = Debug|Any CPU 70 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|ARM.ActiveCfg = Debug|Any CPU 71 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|ARM.Build.0 = Debug|Any CPU 72 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|x64.ActiveCfg = Debug|Any CPU 73 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|x64.Build.0 = Debug|Any CPU 74 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|x86.ActiveCfg = Debug|Any CPU 75 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|x86.Build.0 = Debug|Any CPU 76 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|Any CPU.ActiveCfg = Release|Any CPU 77 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|ARM.ActiveCfg = Release|Any CPU 78 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|ARM.Build.0 = Release|Any CPU 79 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|x64.ActiveCfg = Release|Any CPU 80 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|x64.Build.0 = Release|Any CPU 81 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|x86.ActiveCfg = Release|Any CPU 82 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|x86.Build.0 = Release|Any CPU 83 | EndGlobalSection 84 | GlobalSection(SolutionProperties) = preSolution 85 | HideSolutionNode = FALSE 86 | EndGlobalSection 87 | GlobalSection(NestedProjects) = preSolution 88 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B} = {5DB18EB6-0943-4E8A-A9D7-C7146AD79C00} 89 | EndGlobalSection 90 | GlobalSection(ExtensibilityGlobals) = postSolution 91 | SolutionGuid = {CCE0C24A-AD07-48ED-8A93-2B927239ED7E} 92 | EndGlobalSection 93 | EndGlobal 94 | -------------------------------------------------------------------------------- /src/FontAwesome5.UWP/FontAwesome.cs: -------------------------------------------------------------------------------- 1 | using Windows.UI.Xaml; 2 | using Windows.UI.Xaml.Controls; 3 | using FontAwesome5.Extensions; 4 | 5 | namespace FontAwesome5 6 | { 7 | /// 8 | /// Represents ann icon that uses the FontAwesome font 9 | /// 10 | public class FontAwesome : FontIcon, ISpinable, IFlippable, IRotatable, IPulsable 11 | { 12 | static FontAwesome() 13 | { 14 | 15 | } 16 | 17 | /// 18 | /// Identifies the FontAwesome.Icon dependency property. 19 | /// 20 | public static readonly DependencyProperty IconProperty = DependencyProperty.Register( 21 | nameof(Icon), typeof(EFontAwesomeIcon), typeof(FontAwesome), new PropertyMetadata(EFontAwesomeIcon.None, Icon_PropertyChangedCallback)); 22 | 23 | /// 24 | /// Identifies the FontAwesome.Spin dependency property. 25 | /// 26 | public static readonly DependencyProperty SpinProperty = DependencyProperty.Register( 27 | nameof(Spin), typeof(bool), typeof(FontAwesome), new PropertyMetadata(false, OnSpinPropertyChanged)); 28 | 29 | /// 30 | /// Identifies the FontAwesome.SpinDuration dependency property. 31 | /// 32 | public static readonly DependencyProperty SpinDurationProperty = DependencyProperty.Register( 33 | nameof(SpinDuration), typeof(double), typeof(FontAwesome), new PropertyMetadata(1d, SpinDurationChanged)); 34 | 35 | /// 36 | /// Identifies the FontAwesome.Pulse dependency property 37 | /// 38 | public static readonly DependencyProperty PulseProperty = DependencyProperty.Register( 39 | nameof(Pulse), typeof(bool), typeof(FontAwesome), new PropertyMetadata(false, OnPulsePropertyChanged)); 40 | 41 | /// 42 | /// Identifies the FontAwesome.PulseDuartion dependency property 43 | /// 44 | public static readonly DependencyProperty PulseDurationProperty = DependencyProperty.Register( 45 | nameof(PulseDuration), typeof(double), typeof(FontAwesome), new PropertyMetadata(1d, PulseDurationChanged)); 46 | 47 | /// 48 | /// Identifies the FontAwesome.Rotation dependency property. 49 | /// 50 | public static readonly DependencyProperty RotationProperty = DependencyProperty.Register( 51 | nameof(Rotation), typeof(double), typeof(FontAwesome), new PropertyMetadata(0d, RotationChanged)); 52 | 53 | /// 54 | /// Identifies the FontAwesome.FlipOrientation dependency property. 55 | /// 56 | public static readonly DependencyProperty FlipOrientationProperty = DependencyProperty.Register( 57 | nameof(FlipOrientation), typeof(EFlipOrientation), typeof(FontAwesome), new PropertyMetadata(EFlipOrientation.Normal, FlipOrientationChanged)); 58 | 59 | private static void Icon_PropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) 60 | { 61 | var fontAwesome = (FontAwesome)dependencyObject; 62 | var newValue = (EFontAwesomeIcon)e.NewValue; 63 | 64 | var fontFamily = newValue.GetFontFamily(); 65 | var glyph = newValue.GetUnicode(); 66 | 67 | fontAwesome.SetValue(FontFamilyProperty, fontFamily); 68 | fontAwesome.SetValue(GlyphProperty, glyph); 69 | } 70 | 71 | /// 72 | /// Gets or sets the FontAwesome icon 73 | /// 74 | public EFontAwesomeIcon Icon 75 | { 76 | get => (EFontAwesomeIcon)GetValue(IconProperty); 77 | set => SetValue(IconProperty, value); 78 | } 79 | 80 | /// 81 | /// Gets or sets the current spin (angle) animation of the icon. 82 | /// 83 | public bool Spin 84 | { 85 | get => (bool)GetValue(SpinProperty); 86 | set => SetValue(SpinProperty, value); 87 | } 88 | 89 | private static void OnSpinPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 90 | { 91 | if (!(d is FontAwesome fontAwesome)) 92 | { 93 | return; 94 | } 95 | 96 | if ((bool)e.NewValue) 97 | { 98 | fontAwesome.BeginSpin(); 99 | } 100 | else 101 | { 102 | fontAwesome.StopSpin(); 103 | fontAwesome.SetRotation(); 104 | } 105 | } 106 | 107 | /// 108 | /// Gets or sets the duration of the spinning animation (in seconds). This will stop and start the spin animation. 109 | /// 110 | public double SpinDuration 111 | { 112 | get => (double)GetValue(SpinDurationProperty); 113 | set => SetValue(SpinDurationProperty, value); 114 | } 115 | 116 | private static void SpinDurationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 117 | { 118 | if (!(d is FontAwesome fontAwesome) || !fontAwesome.Spin || !(e.NewValue is double) || e.NewValue.Equals(e.OldValue)) 119 | { 120 | return; 121 | } 122 | 123 | fontAwesome.StopSpin(); 124 | fontAwesome.BeginSpin(); 125 | } 126 | 127 | /// 128 | /// Gets or sets the state of the pulse animation 129 | /// 130 | public bool Pulse 131 | { 132 | get => (bool)GetValue(PulseProperty); 133 | set => SetValue(PulseProperty, value); 134 | } 135 | 136 | private static void OnPulsePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 137 | { 138 | if (!(d is FontAwesome fontAwesome)) 139 | { 140 | return; 141 | } 142 | 143 | if ((bool)e.NewValue) 144 | { 145 | fontAwesome.BeginPulse(); 146 | } 147 | else 148 | { 149 | fontAwesome.StopPulse(); 150 | fontAwesome.SetRotation(); 151 | } 152 | } 153 | 154 | /// 155 | /// Gets or sets the duration of the pulse animation 156 | /// 157 | public double PulseDuration 158 | { 159 | get => (double)GetValue(PulseDurationProperty); 160 | set => SetValue(PulseDurationProperty, value); 161 | } 162 | 163 | private static void PulseDurationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 164 | { 165 | if (!(d is FontAwesome fontAwesome) || !fontAwesome.Pulse || !(e.NewValue is double) || e.NewValue.Equals(e.OldValue)) 166 | { 167 | return; 168 | } 169 | 170 | fontAwesome.StopPulse(); 171 | fontAwesome.BeginPulse(); 172 | } 173 | 174 | /// 175 | /// Gets or sets the current rotation (angle). 176 | /// 177 | public new double Rotation 178 | { 179 | get { return (double)GetValue(RotationProperty); } 180 | set { SetValue(RotationProperty, value); } 181 | } 182 | 183 | private static void RotationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 184 | { 185 | if (!(d is FontAwesome fontAwesome) || fontAwesome.Spin || !(e.NewValue is double) || e.NewValue.Equals(e.OldValue)) 186 | { 187 | return; 188 | } 189 | 190 | fontAwesome.SetRotation(); 191 | } 192 | 193 | /// 194 | /// Gets or sets the current orientation (horizontal, vertical). 195 | /// 196 | public EFlipOrientation FlipOrientation 197 | { 198 | get { return (EFlipOrientation)GetValue(FlipOrientationProperty); } 199 | set { SetValue(FlipOrientationProperty, value); } 200 | } 201 | 202 | private static void FlipOrientationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 203 | { 204 | if (!(d is FontAwesome fontAwesome) || !(e.NewValue is EFlipOrientation) || e.NewValue.Equals(e.OldValue)) 205 | { 206 | return; 207 | } 208 | 209 | fontAwesome.SetFlipOrientation(); 210 | } 211 | } 212 | } -------------------------------------------------------------------------------- /src/FontAwesome5.UWP/Fonts.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Reflection; 4 | 5 | using Windows.UI.Xaml; 6 | using Windows.UI.Xaml.Media; 7 | 8 | namespace FontAwesome5 9 | { 10 | /// 11 | /// Provides FontFamilies and Typefaces of FontAwesome5. 12 | /// 13 | public static class Fonts 14 | { 15 | /// 16 | /// FontAwesome5 Regular FontFamily 17 | /// 18 | public static FontFamily RegularFontFamily = new FontFamily("ms-appx:///FontAwesome5.UWP/Fonts/Font Awesome 5 Free-Regular-400.otf#Font Awesome 5 Free"); 19 | 20 | /// 21 | /// FontAwesome5 Solid FontFamily 22 | /// 23 | public static FontFamily SolidFontFamily = new FontFamily("ms-appx:///FontAwesome5.UWP/Fonts/Font Awesome 5 Free-Solid-900.otf#Font Awesome 5 Free"); 24 | 25 | /// 26 | /// FontAwesome5 Brands FontFamily 27 | /// 28 | public static FontFamily BrandsFontFamily = new FontFamily("ms-appx:///FontAwesome5.UWP/Fonts/Font Awesome 5 Brands-Regular-400.otf#Font Awesome 5 Brands"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/FontAwesome5.UWP/Key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/FontAwesome5.UWP/Key.snk -------------------------------------------------------------------------------- /src/FontAwesome5.UWP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("FontAwesome5.UWP")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Codinion")] 12 | [assembly: AssemblyProduct("FontAwesome5.UWP")] 13 | [assembly: AssemblyCopyright("Copyright © Codinion 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /src/FontAwesome5.UWP/Properties/FontAwesome5.UWP.rd.xml: -------------------------------------------------------------------------------- 1 | 2 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/FontAwesome5.WinUI.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29102.190 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B1387CB2-E6D3-4266-B1E7-065826845F0E}" 7 | ProjectSection(SolutionItems) = preProject 8 | ..\README.md = ..\README.md 9 | EndProjectSection 10 | EndProject 11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FontAwesome5.WinUI", "FontAwesome5.WinUI\FontAwesome5.WinUI.csproj", "{3DA649D8-590A-4BBD-8181-F01BC81748B7}" 12 | EndProject 13 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FontAwesome5", "FontAwesome5\FontAwesome5.csproj", "{C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}" 14 | EndProject 15 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{C2DF6A3D-4A1A-43C4-9474-7591294B72E9}" 16 | ProjectSection(SolutionItems) = preProject 17 | NuGet\FontAwesome5.nuspec = NuGet\FontAwesome5.nuspec 18 | EndProjectSection 19 | EndProject 20 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{5DB18EB6-0943-4E8A-A9D7-C7146AD79C00}" 21 | EndProject 22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FontAwesome5.Generator", "Tools\FontAwesome5.Generator\FontAwesome5.Generator.csproj", "{36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}" 23 | EndProject 24 | Global 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|Any CPU = Debug|Any CPU 27 | Debug|ARM = Debug|ARM 28 | Debug|x64 = Debug|x64 29 | Debug|x86 = Debug|x86 30 | Release|Any CPU = Release|Any CPU 31 | Release|ARM = Release|ARM 32 | Release|x64 = Release|x64 33 | Release|x86 = Release|x86 34 | EndGlobalSection 35 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 36 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|ARM.ActiveCfg = Debug|ARM 39 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|ARM.Build.0 = Debug|ARM 40 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|x64.ActiveCfg = Debug|x64 41 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|x64.Build.0 = Debug|x64 42 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|x86.ActiveCfg = Debug|x86 43 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Debug|x86.Build.0 = Debug|x86 44 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|Any CPU.Build.0 = Release|Any CPU 46 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|ARM.ActiveCfg = Release|ARM 47 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|ARM.Build.0 = Release|ARM 48 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|x64.ActiveCfg = Release|x64 49 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|x64.Build.0 = Release|x64 50 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|x86.ActiveCfg = Release|x86 51 | {3DA649D8-590A-4BBD-8181-F01BC81748B7}.Release|x86.Build.0 = Release|x86 52 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 53 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|Any CPU.Build.0 = Debug|Any CPU 54 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|ARM.ActiveCfg = Debug|Any CPU 55 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|ARM.Build.0 = Debug|Any CPU 56 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|x64.ActiveCfg = Debug|Any CPU 57 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|x64.Build.0 = Debug|Any CPU 58 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|x86.ActiveCfg = Debug|Any CPU 59 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Debug|x86.Build.0 = Debug|Any CPU 60 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|Any CPU.ActiveCfg = Release|Any CPU 61 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|Any CPU.Build.0 = Release|Any CPU 62 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|ARM.ActiveCfg = Release|Any CPU 63 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|ARM.Build.0 = Release|Any CPU 64 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|x64.ActiveCfg = Release|Any CPU 65 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|x64.Build.0 = Release|Any CPU 66 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|x86.ActiveCfg = Release|Any CPU 67 | {C5B304E1-FA5C-4A51-A2F2-816EB2D2A888}.Release|x86.Build.0 = Release|Any CPU 68 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 69 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|Any CPU.Build.0 = Debug|Any CPU 70 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|ARM.ActiveCfg = Debug|Any CPU 71 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|ARM.Build.0 = Debug|Any CPU 72 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|x64.ActiveCfg = Debug|Any CPU 73 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|x64.Build.0 = Debug|Any CPU 74 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|x86.ActiveCfg = Debug|Any CPU 75 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Debug|x86.Build.0 = Debug|Any CPU 76 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|Any CPU.ActiveCfg = Release|Any CPU 77 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|ARM.ActiveCfg = Release|Any CPU 78 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|ARM.Build.0 = Release|Any CPU 79 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|x64.ActiveCfg = Release|Any CPU 80 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|x64.Build.0 = Release|Any CPU 81 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|x86.ActiveCfg = Release|Any CPU 82 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B}.Release|x86.Build.0 = Release|Any CPU 83 | EndGlobalSection 84 | GlobalSection(SolutionProperties) = preSolution 85 | HideSolutionNode = FALSE 86 | EndGlobalSection 87 | GlobalSection(NestedProjects) = preSolution 88 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B} = {5DB18EB6-0943-4E8A-A9D7-C7146AD79C00} 89 | EndGlobalSection 90 | GlobalSection(ExtensibilityGlobals) = postSolution 91 | SolutionGuid = {CCE0C24A-AD07-48ED-8A93-2B927239ED7E} 92 | EndGlobalSection 93 | EndGlobal 94 | -------------------------------------------------------------------------------- /src/FontAwesome5.WinUI/FontAwesome.cs: -------------------------------------------------------------------------------- 1 | using FontAwesome5.Extensions; 2 | using Microsoft.UI.Xaml; 3 | using Microsoft.UI.Xaml.Controls; 4 | 5 | namespace FontAwesome5 6 | { 7 | /// 8 | /// Represents ann icon that uses the FontAwesome font 9 | /// 10 | public class FontAwesome : FontIcon, ISpinable, IFlippable, IRotatable, IPulsable 11 | { 12 | static FontAwesome() 13 | { 14 | 15 | } 16 | 17 | /// 18 | /// Identifies the FontAwesome.Icon dependency property. 19 | /// 20 | public static readonly DependencyProperty IconProperty = DependencyProperty.Register( 21 | nameof(Icon), typeof(EFontAwesomeIcon), typeof(FontAwesome), new PropertyMetadata(EFontAwesomeIcon.None, Icon_PropertyChangedCallback)); 22 | 23 | /// 24 | /// Identifies the FontAwesome.Spin dependency property. 25 | /// 26 | public static readonly DependencyProperty SpinProperty = DependencyProperty.Register( 27 | nameof(Spin), typeof(bool), typeof(FontAwesome), new PropertyMetadata(false, OnSpinPropertyChanged)); 28 | 29 | /// 30 | /// Identifies the FontAwesome.SpinDuration dependency property. 31 | /// 32 | public static readonly DependencyProperty SpinDurationProperty = DependencyProperty.Register( 33 | nameof(SpinDuration), typeof(double), typeof(FontAwesome), new PropertyMetadata(1d, SpinDurationChanged)); 34 | 35 | /// 36 | /// Identifies the FontAwesome.Pulse dependency property 37 | /// 38 | public static readonly DependencyProperty PulseProperty = DependencyProperty.Register( 39 | nameof(Pulse), typeof(bool), typeof(FontAwesome), new PropertyMetadata(false, OnPulsePropertyChanged)); 40 | 41 | /// 42 | /// Identifies the FontAwesome.PulseDuartion dependency property 43 | /// 44 | public static readonly DependencyProperty PulseDurationProperty = DependencyProperty.Register( 45 | nameof(PulseDuration), typeof(double), typeof(FontAwesome), new PropertyMetadata(1d, PulseDurationChanged)); 46 | 47 | /// 48 | /// Identifies the FontAwesome.Rotation dependency property. 49 | /// 50 | public static readonly DependencyProperty RotationProperty = DependencyProperty.Register( 51 | nameof(Rotation), typeof(double), typeof(FontAwesome), new PropertyMetadata(0d, RotationChanged)); 52 | 53 | /// 54 | /// Identifies the FontAwesome.FlipOrientation dependency property. 55 | /// 56 | public static readonly DependencyProperty FlipOrientationProperty = DependencyProperty.Register( 57 | nameof(FlipOrientation), typeof(EFlipOrientation), typeof(FontAwesome), new PropertyMetadata(EFlipOrientation.Normal, FlipOrientationChanged)); 58 | 59 | private static void Icon_PropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) 60 | { 61 | var fontAwesome = (FontAwesome)dependencyObject; 62 | var newValue = (EFontAwesomeIcon)e.NewValue; 63 | 64 | var fontFamily = newValue.GetFontFamily(); 65 | var glyph = newValue.GetUnicode(); 66 | 67 | fontAwesome.SetValue(FontFamilyProperty, fontFamily); 68 | fontAwesome.SetValue(GlyphProperty, glyph); 69 | } 70 | 71 | /// 72 | /// Gets or sets the FontAwesome icon 73 | /// 74 | public EFontAwesomeIcon Icon 75 | { 76 | get => (EFontAwesomeIcon)GetValue(IconProperty); 77 | set => SetValue(IconProperty, value); 78 | } 79 | 80 | /// 81 | /// Gets or sets the current spin (angle) animation of the icon. 82 | /// 83 | public bool Spin 84 | { 85 | get => (bool)GetValue(SpinProperty); 86 | set => SetValue(SpinProperty, value); 87 | } 88 | 89 | private static void OnSpinPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 90 | { 91 | if (!(d is FontAwesome fontAwesome)) 92 | { 93 | return; 94 | } 95 | 96 | if ((bool)e.NewValue) 97 | { 98 | fontAwesome.BeginSpin(); 99 | } 100 | else 101 | { 102 | fontAwesome.StopSpin(); 103 | fontAwesome.SetRotation(); 104 | } 105 | } 106 | 107 | /// 108 | /// Gets or sets the duration of the spinning animation (in seconds). This will stop and start the spin animation. 109 | /// 110 | public double SpinDuration 111 | { 112 | get => (double)GetValue(SpinDurationProperty); 113 | set => SetValue(SpinDurationProperty, value); 114 | } 115 | 116 | private static void SpinDurationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 117 | { 118 | if (!(d is FontAwesome fontAwesome) || !fontAwesome.Spin || !(e.NewValue is double) || e.NewValue.Equals(e.OldValue)) 119 | { 120 | return; 121 | } 122 | 123 | fontAwesome.StopSpin(); 124 | fontAwesome.BeginSpin(); 125 | } 126 | 127 | /// 128 | /// Gets or sets the state of the pulse animation 129 | /// 130 | public bool Pulse 131 | { 132 | get => (bool)GetValue(PulseProperty); 133 | set => SetValue(PulseProperty, value); 134 | } 135 | 136 | private static void OnPulsePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 137 | { 138 | if (!(d is FontAwesome fontAwesome)) 139 | { 140 | return; 141 | } 142 | 143 | if ((bool)e.NewValue) 144 | { 145 | fontAwesome.BeginPulse(); 146 | } 147 | else 148 | { 149 | fontAwesome.StopPulse(); 150 | fontAwesome.SetRotation(); 151 | } 152 | } 153 | 154 | /// 155 | /// Gets or sets the duration of the pulse animation 156 | /// 157 | public double PulseDuration 158 | { 159 | get => (double)GetValue(PulseDurationProperty); 160 | set => SetValue(PulseDurationProperty, value); 161 | } 162 | 163 | private static void PulseDurationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 164 | { 165 | if (!(d is FontAwesome fontAwesome) || !fontAwesome.Pulse || !(e.NewValue is double) || e.NewValue.Equals(e.OldValue)) 166 | { 167 | return; 168 | } 169 | 170 | fontAwesome.StopPulse(); 171 | fontAwesome.BeginPulse(); 172 | } 173 | 174 | /// 175 | /// Gets or sets the current rotation (angle). 176 | /// 177 | public new double Rotation 178 | { 179 | get { return (double)GetValue(RotationProperty); } 180 | set { SetValue(RotationProperty, value); } 181 | } 182 | 183 | private static void RotationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 184 | { 185 | if (!(d is FontAwesome fontAwesome) || fontAwesome.Spin || !(e.NewValue is double) || e.NewValue.Equals(e.OldValue)) 186 | { 187 | return; 188 | } 189 | 190 | fontAwesome.SetRotation(); 191 | } 192 | 193 | /// 194 | /// Gets or sets the current orientation (horizontal, vertical). 195 | /// 196 | public EFlipOrientation FlipOrientation 197 | { 198 | get { return (EFlipOrientation)GetValue(FlipOrientationProperty); } 199 | set { SetValue(FlipOrientationProperty, value); } 200 | } 201 | 202 | private static void FlipOrientationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 203 | { 204 | if (!(d is FontAwesome fontAwesome) || !(e.NewValue is EFlipOrientation) || e.NewValue.Equals(e.OldValue)) 205 | { 206 | return; 207 | } 208 | 209 | fontAwesome.SetFlipOrientation(); 210 | } 211 | } 212 | } -------------------------------------------------------------------------------- /src/FontAwesome5.WinUI/FontAwesome5.WinUI.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net6.0-windows10.0.19041.0 4 | 10.0.17763.0 5 | FontAwesome5.WinUI 6 | win10-x86;win10-x64;win10-arm64 7 | true 8 | WINUI 9 | 10 | 11 | 12 | True 13 | Martin Topfstedt 14 | MIT 15 | Copyright © Codinion 2018 16 | Codinion 17 | 18 | 19 | 20 | 21 | Always 22 | 23 | 24 | Always 25 | 26 | 27 | Always 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/FontAwesome5.WinUI/Fonts.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.UI.Xaml.Media; 2 | 3 | namespace FontAwesome5 4 | { 5 | /// 6 | /// Provides FontFamilies and Typefaces of FontAwesome5. 7 | /// 8 | public static class Fonts 9 | { 10 | /// 11 | /// FontAwesome5 Regular FontFamily 12 | /// 13 | public static FontFamily RegularFontFamily = new FontFamily("ms-appx:///FontAwesome5.WinUI/Fonts/Font Awesome 5 Free-Regular-400.otf#Font Awesome 5 Free"); 14 | 15 | /// 16 | /// FontAwesome5 Solid FontFamily 17 | /// 18 | public static FontFamily SolidFontFamily = new FontFamily("ms-appx:///FontAwesome5.WinUI/Fonts/Font Awesome 5 Free-Solid-900.otf#Font Awesome 5 Free"); 19 | 20 | /// 21 | /// FontAwesome5 Brands FontFamily 22 | /// 23 | public static FontFamily BrandsFontFamily = new FontFamily("ms-appx:///FontAwesome5.WinUI/Fonts/Font Awesome 5 Brands-Regular-400.otf#Font Awesome 5 Brands"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/FontAwesome5/Extensions/EFontAwesomeIconExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Reflection; 4 | 5 | namespace FontAwesome5.Extensions 6 | { 7 | /// 8 | /// EFontAwesomeIcon extensions 9 | /// 10 | public static class EFontAwesomeIconExtensions 11 | { 12 | /// 13 | /// Get the Font Awesome information of an icon 14 | /// 15 | public static FontAwesomeInformation GetInformation(this EFontAwesomeIcon icon) 16 | { 17 | return FontAwesomeInternal.Information.TryGetValue(icon, out var info) ? info : null; 18 | } 19 | 20 | /// 21 | /// Get the Font Awesome label of an icon 22 | /// 23 | public static string GetLabel(this EFontAwesomeIcon icon) 24 | { 25 | return FontAwesomeInternal.Information.TryGetValue(icon, out var info) ? info.Label : null; 26 | } 27 | 28 | /// 29 | /// Get the Font Awesome Style of an icon 30 | /// 31 | public static EFontAwesomeStyle GetStyle(this EFontAwesomeIcon icon) 32 | { 33 | return FontAwesomeInternal.Information.TryGetValue(icon, out var info) ? info.Style : EFontAwesomeStyle.None; 34 | } 35 | 36 | /// 37 | /// Get the SVG path of an icon 38 | /// 39 | public static bool GetSvg(this EFontAwesomeIcon icon, out string path, out int width, out int height) 40 | { 41 | path = string.Empty; 42 | width = -1; 43 | height = -1; 44 | if (FontAwesomeInternal.Information.TryGetValue(icon, out var info) && info.Svg != null) 45 | { 46 | path = info.Svg.Path; 47 | width = info.Svg.Width; 48 | height = info.Svg.Height; 49 | return true; 50 | } 51 | 52 | return false; 53 | } 54 | 55 | /// 56 | /// Get the Unicode of an icon 57 | /// 58 | public static string GetUnicode(this EFontAwesomeIcon icon) 59 | { 60 | return FontAwesomeInternal.Information.TryGetValue(icon, out var info) ? info.Unicode : char.ConvertFromUtf32(0); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/FontAwesome5/FontAwesome5.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard1.4;netstandard2.1;net40;net5.0;net6.0 5 | Codinion 6 | Martin Topfstedt 7 | true 8 | Key.snk 9 | false 10 | 11 | 12 | 13 | True 14 | 15 | 16 | 17 | true 18 | ../FontAwesome5.NET/Key.snk 19 | MIT 20 | Copyright © Codinion 2018 21 | 22 | 23 | 24 | 25 | 4.5.0 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/FontAwesome5/Key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/FontAwesome5/Key.snk -------------------------------------------------------------------------------- /src/NuGet/FontAwesome5.WinUI.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | FontAwesome5.WinUI 5 | $version$ 6 | 7 | WinUI controls for the iconic SVG, font, and CSS toolkit Font Awesome 5. 8 | For examples https://github.com/MartinTopfstedt/FontAwesome5 9 | Font-Awesome Version: 5.15.4 10 | 11 | Codinion 12 | MIT 13 | https://github.com/MartinTopfstedt/FontAwesome5 14 | icon.png 15 | false 16 | fontawesome fontawesome5 17 | Copyright © 2021 Codinion 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/NuGet/FontAwesome5.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | FontAwesome5 5 | $version$ 6 | 7 | WPF (.Net and .Net Core) and UWP controls for the iconic SVG, font, and CSS toolkit Font Awesome 5. 8 | For examples https://github.com/MartinTopfstedt/FontAwesome5 9 | Font-Awesome Version: 5.15.4 10 | 11 | Codinion 12 | MIT 13 | https://github.com/MartinTopfstedt/FontAwesome5 14 | icon.png 15 | false 16 | fontawesome fontawesome5 17 | Copyright © 2021 Codinion 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /src/NuGet/nuget.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/NuGet/nuget.exe -------------------------------------------------------------------------------- /src/Tools/FontAwesome5.Generator/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Tools/FontAwesome5.Generator/FontAwesome.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Text.RegularExpressions; 8 | using System.Threading; 9 | using System.Threading.Tasks; 10 | 11 | namespace FontAwesome5.Generator 12 | { 13 | public enum EStyles 14 | { 15 | Solid, 16 | Regular, 17 | Brands 18 | } 19 | 20 | public class FontAwesomeManager 21 | { 22 | private static readonly Regex REG_PROP = new Regex(@"\([^)]*\)"); 23 | 24 | public FontAwesomeManager(string iconsJson) 25 | { 26 | Icons = JsonConvert.DeserializeObject>(File.ReadAllText(iconsJson)); 27 | } 28 | 29 | public string Convert(string text) 30 | { 31 | var cultureInfo = Thread.CurrentThread.CurrentCulture; 32 | var textInfo = cultureInfo.TextInfo; 33 | 34 | var stringBuilder = new StringBuilder(textInfo.ToTitleCase(text.Replace("-", " "))); 35 | 36 | stringBuilder 37 | .Replace("-", string.Empty).Replace("/", "_") 38 | .Replace(" ", string.Empty).Replace(".", string.Empty) 39 | .Replace("'", string.Empty); 40 | 41 | var matches = REG_PROP.Matches(stringBuilder.ToString()); 42 | stringBuilder = new StringBuilder(REG_PROP.Replace(stringBuilder.ToString(), string.Empty)); 43 | var hasMatch = false; 44 | 45 | for (var i = 0; i < matches.Count; i++) 46 | { 47 | var match = matches[i]; 48 | if (match.Value.IndexOf("Hand", StringComparison.InvariantCultureIgnoreCase) > -1) 49 | { 50 | hasMatch = true; 51 | break; 52 | } 53 | } 54 | 55 | if (hasMatch) 56 | { 57 | stringBuilder.Insert(0, "Hand"); 58 | } 59 | 60 | if (char.IsDigit(stringBuilder[0])) 61 | { 62 | stringBuilder.Insert(0, '_'); 63 | } 64 | 65 | return stringBuilder.ToString(); 66 | } 67 | 68 | public Dictionary Icons 69 | { 70 | get; set; 71 | } 72 | 73 | public class Icon 74 | { 75 | public string label { get; set; } 76 | public string unicode { get; set; } 77 | public List styles { get; set; } 78 | public Dictionary svg { get; set; } 79 | } 80 | 81 | public class SVG 82 | { 83 | public string[] viewBox { get; set; } 84 | public int width { get; set; } 85 | public int height { get; set; } 86 | public string path { get; set; } 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/Tools/FontAwesome5.Generator/FontAwesome5.Generator.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {36BAF672-62DD-46A9-B6E6-1F3B0AA0D84B} 8 | Exe 9 | FontAwesome5.Generator 10 | FontAwesome5.Generator 11 | v4.6.2 12 | 512 13 | true 14 | true 15 | false 16 | D:\codinion\repos\FontAwesome5\bin\FontAwesome5.Generator\ 17 | true 18 | Disk 19 | false 20 | Foreground 21 | 7 22 | Days 23 | false 24 | false 25 | true 26 | 1 27 | 1.0.0.%2a 28 | false 29 | true 30 | false 31 | 32 | 33 | AnyCPU 34 | true 35 | full 36 | false 37 | bin\Debug\ 38 | DEBUG;TRACE 39 | prompt 40 | 4 41 | 42 | 43 | AnyCPU 44 | pdbonly 45 | true 46 | ..\..\..\bin\FontAwesome5.Generator\ 47 | TRACE 48 | prompt 49 | 4 50 | 51 | 52 | F3A5AD03D7728016CCFF89A40AB816D8C5E6C3E1 53 | 54 | 55 | FontAwesome5.Generator_TemporaryKey.pfx 56 | 57 | 58 | true 59 | 60 | 61 | false 62 | 63 | 64 | 65 | ..\..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | False 88 | Microsoft .NET Framework 4.6.2 %28x86 and x64%29 89 | true 90 | 91 | 92 | False 93 | .NET Framework 3.5 SP1 94 | false 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /src/Tools/FontAwesome5.Generator/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("FontAwesome5.Generator")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("FontAwesome5.Generator")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("36baf672-62dd-46a9-b6e6-1f3b0aa0d84b")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/Tools/FontAwesome5.Generator/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinTopfstedt/FontAwesome5/ff53f0c641f801b3774f3e174d095be8ab476eb8/src/icon.png --------------------------------------------------------------------------------