otfcc是一个C库和实用程序,用于解析和编写Opentype字体文件。
GSUB , GPOS和GDEF ),CID键CFF,垂直指标等的全面支持。ttx比TTX快4×,在TTF上40倍。makeotf快900×,用于构建完全优化的CFF OTF。 您可以在此处下载预制的二进制文件。
如果您有自制,只需在终端中运行以下内容即可。
brew tap caryll/tap
brew install otfcc-mac64注意:需要完整的XCode安装。如果您看到与xcode-select相关的错误,请参考此处的说明。
否则,您可能需要单击上面的“发布”,然后下载其中的档案。
软件包otfcc可以在此处找到。
见下文。
otfccdump :将Opentype字体文件转输给JSON otfccdump [OPTIONS] input.[otf|ttf|ttc]
-h, --help : Display this help message and exit.
-v, --version : Display version information and exit.
-o <file> : Set output file path to <file>. When absent the dump
will be written to STDOUT.
-n <n>, --ttc-index <n> : Use the <n>th subfont within the input font.
--pretty : Prettify the output JSON.
--ugly : Force uglify the output JSON.
--verbose : Show more information when building.
--ignore-glyph-order : Do not export glyph order information.
--glyph-name-prefix pfx : Add a prefix to the glyph names.
--ignore-hints : Do not export hinting information.
--decimal-cmap : Export 'cmap' keys as decimal number.
--name-by-hash : Name glyphs using its hash value.
--add-bom : Add BOM mark in the output. (It is default on Windows
when redirecting to another program. Use --no-bom to
turn it off.)
otfccbuild :从JSON构建一个OpenType字体文件 Usage : otfccbuild [OPTIONS] [input.json] -o output.[ttf|otf]
input.json : Path to input file. When absent the input will be
read from the STDIN.
-h, --help : Display this help message and exit.
-v, --version : Display version information and exit.
-o <file> : Set output file path to <file>.
-s, --dummy-dsig : Include an empty DSIG table in the font. For some
Microsoft applications, DSIG is required to enable
OpenType features.
-O<n> : Specify the level for optimization.
-O0 Turn off any optimization.
-O1 Default optimization.
-O2 More aggressive optimizations for web font. In this
level, the following options will be set:
--merge-features
--short-post
--subroutinize
-O3 The most aggressive opptimization strategy will be
used. In this level, these options will be set:
--force-cid
--ignore-glyph-order
--verbose : Show more information when building.
--ignore-hints : Ignore the hinting information in the input.
--keep-average-char-width : Keep the OS/2.xAvgCharWidth value from the input
instead of stating the average width of glyphs.
Useful when creating a monospaced font.
--keep-unicode-ranges : Keep the OS/2.ulUnicodeRange[1-4] as-is.
--keep-modified-time : Keep the head.modified time in the json, instead of
using current time.
--short-post : Don't export glyph names in the result font.
--ignore-glyph-order, -i : Ignore the glyph order information in the input.
--keep-glyph-order, -k : Keep the glyph order information in the input.
Use to preserve glyph order under -O2 and -O3.
--dont-ignore-glyph-order : Same as --keep-glyph-order.
--merge-features : Merge duplicate OpenType feature definitions.
--dont-merge-features : Keep duplicate OpenType feature definitions.
--merge-lookups : Merge duplicate OpenType lookups.
--dont-merge-lookups : Keep duplicate OpenType lookups.
--force-cid : Convert name-keyed CFF OTF into CID-keyed.
--subroutinize : Subroutinize CFF table.
--stub-cmap4 : Create a stub `cmap` format 4 subtable if format
12 subtable is present.
otfcc可以在许多平台上构建。它使用预制构建系统。
它是针对Clang/LLVM开发和优化的,因此强烈建议使用Clang/LLVM编译,但是如果也支持GCC,则GCC版本5.1或更高版本是性能的首选选择。
在Linux上,可以使用Clang/LLVM或GCC来构建otfcc 。
premake5 gmake
cd build/gmake
make config=release_x64如果系统上安装了忍者,则可以使用忍者:
premake5 ninja
cd build/ninja
ninja otfccdump_release_x64 otfccbuild_release_x64必要时更改上述目标。
在Windows上,在下面列出的工具链下测试了构建otfcc 。默认的premake5 vs2015将使用Clang-CL作为编译器生成视觉工作室解决方案。
TDM-GCC中包含的GCC 5.1或MINGW-W64中的GCC 6.1.0。从命令行运行以下内容(在必要时更改config ):
premake5 gmake
cd build/gmake
make config=release_x64要在Linux中使用忍者,您需要在使用premake5 ninja时指定--os=linux 。
带有Clang/LLVM 3.9的Visual C ++建筑工具(2016年3月)。仅测试唯一的释放构建。从Visual C ++命令提示中运行以下内容:
premake5 vs2015
msbuild buildvsotfcc.sln /property:Configuration=Release Premake5(可以通过brew install premake --devel安装,或在dep/bin-osx目录中找到)提供了生产Xcode项目的功能。跑步
premake5 xcode4然后,您可以打开build/xcode/otfcc.xcworkspace并使用XCode构建。您可以在bin/中找到已建造的二进制文件。
请确保启用Xcode的开发人员模式。
要在您的终端中构建二进制文件,请运行
xcodebuild -workspace build/xcode/otfcc.xcworkspace -scheme otfccbuild -configuration Release
xcodebuild -workspace build/xcode/otfcc.xcworkspace -scheme otfccdump -configuration Release