Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
3a939463
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
9 个月 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
3a939463
编写于
6月 17, 2019
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add CONFIG.md
https://github.com/harfbuzz/harfbuzz/issues/1652
上级
1c56b5d1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
54 addition
and
0 deletion
+54
-0
CONFIG.md
CONFIG.md
+51
-0
Makefile.am
Makefile.am
+1
-0
README.md
README.md
+2
-0
未找到文件。
CONFIG.md
0 → 100644
浏览文件 @
3a939463
# Configuring HarfBuzz
Most of the time you will not need any custom configuration. The configuration
options provided by
`configure`
or
`cmake`
should be enough. In particular,
if you just want HarfBuzz library plus hb-shape / hb-view utilities, make sure
FreeType and Cairo are available and found during configuration.
If you are building for distribution, you should more carefully consider whether
you need Glib, ICU, Graphite2, as well as CoreText / Uniscribe / DWrite. Make
sure the relevant ones are enabled.
If you are building for custom environment (embedded, downloadable app, etc)
where you mostly just want to call
`hb_shape()`
and the binary size of the
resulting library is very important to you, the rest of this file guides you
through your options to disable features you may not need, in exchange for
binary size savings.
## Compiler Options
Make sure you build with your compiler's "optimize for size" option. On
`gcc`
this is
`-Os`
, and can be enabled by passing
`CXXFLAGS=-Os`
either to
`configure`
(sticky) or to
`make`
(non-sticky). On clang there is an even more extreme flag,
`-Oz`
.
HarfBuzz heavily uses inline functions and the optimize-size flag can make the
library smaller by 20% or more. Moreover, sometimes, based on the target CPU,
the optimize-size builds perform
*faster*
as well, thanks to lower code
footprint and caching effects. So, definitely try that even if size is not
extremely tight but you have a huge application. For example, Chrome does
that. Note that this configuration also automatically enables certain internal
optimizations. Search for
`HB_OPTIMIZE_SIZE`
for details, if you are using
other compilers, or continue reading.
Another compiler option to consider is "link-time optimization", also known as
'lto'. To enable that, with
`gcc`
or
`clang`
, add
`-flto`
to both
`CXXFLAGS`
and
`LDFLAGS`
, either on
`configure`
invocation (sticky) or on
`make`
(non-sticky).
This, also, can have a huge impact on the final size, 20% or more.
Finally, if you are making a static library build or otherwise linking the
library into your app, make sure your linker removes unused functions. This
can be tricky and differ from environment to environment, but you definitely
want to make sure this happens. Otherwise, every unused public function will
be adding unneeded bytes to your binary.
Combining the above three build options should already shrink your library a lot.
The rest of this file shows you ways to shrink the library even further at the
expense of removing functionality (that may not be needed).
## Custom configuration
TODO
Makefile.am
浏览文件 @
3a939463
...
...
@@ -13,6 +13,7 @@ EXTRA_DIST = \
README.mingw.md
\
README.python.md
\
BUILD.md
\
CONFIG.md
\
RELEASING.md
\
TESTING.md
\
CMakeLists.txt
\
...
...
README.md
浏览文件 @
3a939463
...
...
@@ -17,6 +17,8 @@ For license information, see [COPYING](COPYING).
For build information, see
[
BUILD.md
](
BUILD.md
)
.
For custom configurations, see
[
CONFIG.md
](
CONFIG.md
)
.
For test execution, see
[
TESTING.md
](
TESTING.md
)
.
Documentation: https://harfbuzz.github.io
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录