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
*/src
原始檔 (1)
*/src/harfbuzz.cc