diff --git a/tools/mcufontencoder/binaries/windows/freetype6.dll b/tools/mcufontencoder/binaries/windows/freetype6.dll deleted file mode 100644 index e35edc6b..00000000 Binary files a/tools/mcufontencoder/binaries/windows/freetype6.dll and /dev/null differ diff --git a/tools/mcufontencoder/binaries/windows/libgcc_s_dw2-1.dll b/tools/mcufontencoder/binaries/windows/libgcc_s_dw2-1.dll deleted file mode 100644 index 99a76cf3..00000000 Binary files a/tools/mcufontencoder/binaries/windows/libgcc_s_dw2-1.dll and /dev/null differ diff --git a/tools/mcufontencoder/binaries/windows/mcufont.exe b/tools/mcufontencoder/binaries/windows/mcufont.exe index c3c670d2..f12c9c47 100644 Binary files a/tools/mcufontencoder/binaries/windows/mcufont.exe and b/tools/mcufontencoder/binaries/windows/mcufont.exe differ diff --git a/tools/mcufontencoder/binaries/windows/zlib1.dll b/tools/mcufontencoder/binaries/windows/zlib1.dll deleted file mode 100644 index bb116109..00000000 Binary files a/tools/mcufontencoder/binaries/windows/zlib1.dll and /dev/null differ diff --git a/tools/mcufontencoder/src/freetype_import.cc b/tools/mcufontencoder/src/freetype_import.cc index 27a0734d..07a9cde5 100644 --- a/tools/mcufontencoder/src/freetype_import.cc +++ b/tools/mcufontencoder/src/freetype_import.cc @@ -163,14 +163,22 @@ std::unique_ptr LoadFreetype(std::istream &file, int size, bool bw) glyphtable.push_back(glyph); charcode = FT_Get_Next_Char(face, charcode, &gindex); + if (gindex % 1000 == 0) + std::cout << "."; } - + + std::cout << "\nEliminating duplicates (this may take a while)..."; + eliminate_duplicates(glyphtable); - crop_glyphs(glyphtable, fontinfo); - detect_flags(glyphtable, fontinfo); + std::cout << "\nCropping glyphs..."; + crop_glyphs(glyphtable, fontinfo); + std::cout << "\nDetecting flags..."; + detect_flags(glyphtable, fontinfo); - std::unique_ptr result(new DataFile( + std::cout << "\nGenerating datafile..."; + std::unique_ptr result(new DataFile( dictionary, glyphtable, fontinfo)); + std::cout << "\n"; return result; } diff --git a/tools/mcufontencoder/src/main.cc b/tools/mcufontencoder/src/main.cc index 19c9c6f7..70cd9132 100644 --- a/tools/mcufontencoder/src/main.cc +++ b/tools/mcufontencoder/src/main.cc @@ -90,7 +90,7 @@ static status_t cmd_import_ttf(const std::vector &args) int size = std::stoi(args.at(2)); bool bw = (args.size() == 4 && args.at(3) == "bw"); std::string dest = strip_extension(src) + std::to_string(size) + (bw ? "bw" : "") + ".dat"; - std::ifstream infile(src); + std::ifstream infile(src, std::ios::binary); if (!infile.good()) { @@ -118,7 +118,7 @@ static status_t cmd_import_bdf(const std::vector &args) std::string src = args.at(1); std::string dest = strip_extension(args.at(1)) + ".dat"; - std::ifstream infile(src); + std::ifstream infile(src, std::ios::binary); if (!infile.good()) { diff --git a/tools/mcufontencoder/src/mcufont.ico b/tools/mcufontencoder/src/mcufont.ico new file mode 100644 index 00000000..66f8a131 Binary files /dev/null and b/tools/mcufontencoder/src/mcufont.ico differ diff --git a/tools/mcufontencoder/src/mcufont.rc b/tools/mcufontencoder/src/mcufont.rc new file mode 100644 index 00000000..84481771 Binary files /dev/null and b/tools/mcufontencoder/src/mcufont.rc differ diff --git a/tools/mcufontencoder/src/mcufont.sln b/tools/mcufontencoder/src/mcufont.sln new file mode 100644 index 00000000..156c6b27 --- /dev/null +++ b/tools/mcufontencoder/src/mcufont.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mcufont", "mcufont.vcxproj", "{387183DE-A542-4506-8BB1-1A240036E4F4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {387183DE-A542-4506-8BB1-1A240036E4F4}.Debug|x86.ActiveCfg = Debug|Win32 + {387183DE-A542-4506-8BB1-1A240036E4F4}.Debug|x86.Build.0 = Debug|Win32 + {387183DE-A542-4506-8BB1-1A240036E4F4}.Release|x86.ActiveCfg = Release|Win32 + {387183DE-A542-4506-8BB1-1A240036E4F4}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/tools/mcufontencoder/src/mcufont.vcxproj b/tools/mcufontencoder/src/mcufont.vcxproj new file mode 100644 index 00000000..3f6e0ee1 --- /dev/null +++ b/tools/mcufontencoder/src/mcufont.vcxproj @@ -0,0 +1,177 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {387183DE-A542-4506-8BB1-1A240036E4F4} + Win32Proj + mcufont + 8.1 + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + false + false + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + freetype-2.7\include + MultiThreadedDebug + + + Console + true + freetype-2.7\objs\vc2010\Win32\freetype27MTd.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + freetype-2.7\include + MultiThreaded + None + + + Console + true + true + freetype-2.7\objs\vc2010\Win32\freetype27MT.lib;%(AdditionalDependencies) + false + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/mcufontencoder/src/readme_win32.txt b/tools/mcufontencoder/src/readme_win32.txt new file mode 100644 index 00000000..42b18466 --- /dev/null +++ b/tools/mcufontencoder/src/readme_win32.txt @@ -0,0 +1,9 @@ +How to build on Windows using Visual Studio 2015 + +* Download freetype-2.7 and extract to mcufont dir. result will contain freetype-2.7\src, freetype-2.7\include, etc. +* Go to freetype-2.7\builds\windows\vc2010 and open freetype.sln +* Select "Debug Multithreaded" and build. Select "Release Multithreaded" and build. Close Visual Studio. +* Open mcufont.sln +* Select Debug or Release, and build +* Resulting mcufont.exe is in Release\ or Debug\ folder and needs no further dependencies. +