Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded FontAwesome icons to 4.7.0 #189

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bin/
obj/
/Visual Studio 2013
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;

/**
* This tool reads the _variables.scss file that is included in the fontAwesome download.
* Based on this file a FontAwesomeIcons.java file is generated.
*/
namespace FontAwesomeIconsGenerator
{
public class FontAwesomeIconsGenerator
{
public static void Main(string[] args)
{
String usage = @"Usage : FontAwesomeIconsGenerator {path to dir containing _variable.css}\n
Example : FontAwesomeIconsGenerator C:\Users\frank\Downloads\font-awesome-4.7.0\font-awesome-4.7.0\scss";

if (args.Length == 0)
{
Console.WriteLine(usage);
}
else
{
if (!File.Exists(args[0] + @"\_variables.scss"))
{
Console.WriteLine(args[0] + " file could not be found.");
Console.WriteLine(usage);
}
else
{
string output = "package com.joanzapata.iconify.fonts;\n\n";
output += "import com.joanzapata.iconify.Icon;\n\n";
output += "public enum FontAwesomeIcons implements Icon {\n";

var content = File.ReadAllLines(args[0] + @"\_variables.scss");
foreach (var line in content)
{
if (line.Contains(@"\f"))
{
var splitLine = line.Split(':');
var name = splitLine[0];
name = name.Replace("$", "");
name = name.Replace("-var", "");
name = name.Replace("-", "_");

var value = splitLine[1];
value = value.Replace("\"\\", "'\\u");
value = value.Replace("\";", "'),");

var result = name + "(" + value.Trim(); ;

output += " " + result + "\n";
}
}

output = output.Substring(0, output.Length - 2);
output += ";";

output += "\n\n";
output += " char character;\n\n";
output += " FontAwesomeIcons(char character) {\n";
output += " this.character = character;\n";
output += " }\n\n";
output += " @Override\n";
output += " public String key() {\n";
output += " return name().replace('_', '-');\n";
output += " }\n\n";
output += " @Override\n";
output += " public char character() {\n";
output += " return character;\n";
output += " }\n";
output += "}";



File.WriteAllText(args[0] + @"\FontAwesomeIcons.java", output);

Console.WriteLine("\n\nExport completed...");
Console.WriteLine(@"\n\nGenerated file is located at: " + args[0] + @"\FontAwesomeIcons.java");
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{355258F8-BC79-4DEA-A389-EAAB03520E78}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FontAwesomeIconsGenerator</RootNamespace>
<AssemblyName>FontAwesomeIconsGenerator</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="FontAwesomeIconsGenerator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartArguments>C:\Users\frank\Downloads\font-awesome-4.7.0\font-awesome-4.7.0\scss\</StartArguments>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FontAwesomeIconsGenerator", "FontAwesomeIconsGenerator.csproj", "{355258F8-BC79-4DEA-A389-EAAB03520E78}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{355258F8-BC79-4DEA-A389-EAAB03520E78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{355258F8-BC79-4DEA-A389-EAAB03520E78}.Debug|Any CPU.Build.0 = Debug|Any CPU
{355258F8-BC79-4DEA-A389-EAAB03520E78}.Release|Any CPU.ActiveCfg = Release|Any CPU
{355258F8-BC79-4DEA-A389-EAAB03520E78}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("IconTypeGenerator")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("IconTypeGenerator")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ee3d9f47-fde1-4674-9605-2c8f82fb3eb5")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file not shown.
Loading