Open
Conversation
- Update to the latest version (`2.13.3`) - Add a build script (`build_freetype.bat`) - Add support for OTF files - Only build and include necessary files
The build script now detects the platform (`x64` vs `x86`) of `cl` and builds into the appropriate folder. This only works when `cl` is set up via `setup_cl_xxx.bat`. If `cl` is added directly to `PATH`, the detection will likely fail because it relies on the `%Platform%` variable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
2.13.3)build_freetype.batDetails
FreeType is configured and built following this video. The old 4coder build only included the font driver for TTF fonts (
truetype.c). I’ve added an additional driver for OTF fonts (cff.c). After that, you need to include a renderer to rasterize the glyphs. For this, I use thesmooth.crenderer.src/truetype/truetype.cneedssfnt.candpsnames.csrc/cff/cff.cneedssfnt.c,psaux.c, andpsnames.c.INSTALL.ANYsayspshinter.cis required and doesn't mentionpsaux.c. This is incorrect. The latter is mandatory, while the former is only needed for hinting. I include both.src/cff/,src/psaux/,src/truetype/, etc.) are copied as-is, except that I removed allmkfiles. The only exception issrc/base/, where I deleted several unnecessary files.You need to put all these source folders inside
non-source/foreign/freetype2/src/. Next to thesrcdirectory, add thefreetypefolder copied fromfreetype-x.x.x/include/freetype. This folder contains all the header files required to use the library.The
ft2build.h,long_ftmodule.h, andlong_ftoption.hfiles are configured the same way as shown in the previous video. The main difference from the old 4coder setup is that I disable file stream support that relies on the CRT by definingFT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT. As a result,FT_New_Facecannot be used—you must useFT_Open_Faceinstead. If you don’t want this behavior, simply comment out the#define.