Skip to content

Commit

Permalink
- Support write kernel (experimental)
Browse files Browse the repository at this point in the history
- Add credits
  • Loading branch information
eprilx committed Oct 22, 2021
1 parent 5196a06 commit b217ace
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 22 deletions.
2 changes: 1 addition & 1 deletion FFDConverter/FFDConverter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<NeutralLanguage>en</NeutralLanguage>
<AssemblyVersion>1.1.4</AssemblyVersion>
<AssemblyVersion>1.1.5</AssemblyVersion>
<PackageProjectUrl>https://github.com/eprilx/FFDConverter</PackageProjectUrl>
<RepositoryUrl>https://github.com/eprilx/FFDConverter</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down
13 changes: 9 additions & 4 deletions FFDConverter/FFDFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public static void CreateFFD(string inputFFD, string inputBMF, string outputFFD,

//Load FFD
generalInfoFFD infoFFD = new();
infoFFD.CreateListBitmapName();
infoFFD.BitmapName = new();
List<charDescFFD> FFDDescList = new();
List<xadvanceDescFFD> FFDxadvanceList = new();
List<kernelDescFFD> FFDkernelList = new();
Expand Down Expand Up @@ -251,9 +251,14 @@ public static void CreateFFD(string inputFFD, string inputBMF, string outputFFD,

if (infoFFD.kernsCount > 0 && infoBMF.kernsCount > 0)
{
output.WriteValueU16(0);
//TODO kernel stuff
//output.WriteValueU16((ushort)infoBMF.kernsCount);
//kernel stuff
output.WriteValueU16((ushort)infoBMF.kernsCount);
foreach (kernelDescBMF kerning in BMFkernelDescList)
{
output.WriteValueU16((ushort)kerning.first);
output.WriteValueU16((ushort)kerning.second);
output.WriteValueS16((short)(kerning.amount * 200));
}
}
else
{
Expand Down
5 changes: 0 additions & 5 deletions FFDConverter/FFDStruct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ public struct generalInfoFFD
public short table5Value;
public ushort kernsCount;
public List<string> BitmapName;

public void CreateListBitmapName()
{
this.BitmapName = new();
}
}

public struct charDescFFD
Expand Down
29 changes: 18 additions & 11 deletions FFDConverter/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,15 @@ static void Main(string[] args)

void ShowHelp(OptionSet p)
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Write("\nFFDConverter v" + ToolVersion);
Console.WriteLine(" by eprilx");
Console.Write("Check for more update: ");
Console.WriteLine("https://github.com/eprilx/FFDConverter/releases");

PrintCredit();
Console.WriteLine("\nUsage: FFDConverter [OPTIONS]");
Console.WriteLine("Options:");
p.WriteOptionDescriptions(Console.Out);

Console.WriteLine("\nExample: FFDConverter -v FC5 -f fcz_bold_default.ffd -b arialFC5.fnt -o fcz_bold_default.new.ffd");
Console.WriteLine("\nExample: \nFFDConverter -l\nFFDConverter -v FC5 -f fcz_bold_default.ffd -b arialFC5.fnt -o fcz_bold_default.new.ffd");
Console.WriteLine("\nMore usage: https://github.com/eprilx/FFDConverter#usage");
Console.ResetColor();
Console.Write("More update: ");
Console.WriteLine("https://github.com/eprilx/FFDConverter/releases");
}

void PrintSupportedGame()
Expand All @@ -138,12 +134,23 @@ void PrintSupportedGame()
Console.WriteLine(game);
}
}

void Done()
void PrintCredit()
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Write("\nFFDConverter v" + ToolVersion);
Console.WriteLine(" by eprilx");
Console.WriteLine("Done!");
Console.Write("Special thanks to: ");
Console.WriteLine("abodora, rezamms, Eirlys, halfway, ramyzahran");
Console.ResetColor();
}
void Done()
{
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("\n" + output + " has been created!");
Console.ResetColor();
Console.Write("\n********************************************");
PrintCredit();
Console.WriteLine("********************************************");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion FFDConverter/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"FFDConverter": {
"commandName": "Project",
"commandLineArgs": "-v ACR -b test.fnt -f \"ACR\\2823-AC2Aaux_ProMedium_Latin.Fire_Font_Descriptor\" -o new.ffd"
"commandLineArgs": "-v ACR -b AC2KERN.fnt -f \"ACR\\2823-AC2Aaux_ProMedium_Latin.Fire_Font_Descriptor\" -o new.ffd"
}
}
}

0 comments on commit b217ace

Please sign in to comment.