compat.harfbuzz
HarfBuzz — OpenType text shaping engine with the FreeType backend
mcpp add compat.harfbuzz@14.3.0
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
// compat.harfbuzz — assert the shaper actually runs, and that the FreeType
// backend is compiled in rather than merely declared.
//
// Shaping needs no font file: hb_font_get_empty() gives a font whose glyphs
// are all .notdef, which is enough to prove the buffer pipeline (itemize →
// shape → read back infos/positions) is wired and returns one glyph per input
// codepoint. That is a real assertion -- if hb-ot-shape.cc had not been
// compiled into the amalgamation, glyph_count would be 0.
#include <hb.h>
#include <hb-ft.h>
import std;
int main() {
bool ok = true;
auto check = [&](bool cond, std::string_view what) {
if (!cond) {
std::println("FAIL: {}", what);
ok = false;
}
};
// …
tests/examples/harfbuzz/tests/shape.cpp · 项目 tests/examples/harfbuzz
构建
- targets
harfbuzz (lib)- language
c++23- import std
- no
- include dirs
mcpp_generated, */src
特性
| 特性 | 声明了 |
|---|---|
| no-unused-api | |
| no-aat-vertical | |
| no-freetype |
源文件 (1)
*/src/harfbuzz.cc
生成的文件
mcpp_generated/config.h