From f5296800e5a717a5715e9ebad97020d827053404 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Sun, 30 Aug 2026 23:01:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(freetype):=20=E8=A1=A5=20ftsynth.c=E2=80=94?= =?UTF-8?q?=E2=80=94=E5=90=88=E6=88=90=E7=B2=97=E4=BD=93/=E6=96=9C?= =?UTF-8?q?=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 上游把它编在 base 里,所有发行版都出;这里漏了,而这个缺口在有消费者调它之前 完全看不见——freetype 自己不调。 cairo 无条件调:cairo-ft-font.c:2443 在字体没有所要字重时调 FT_GlyphSlot_Embolden,没有任何 HAVE_ 守卫可关。所以拿这套 freetype 建 cairo 会在链接期得到两个未定义引用。加 freedesktop.cairo 时实测撞到的。 freetype 自己的测试成员照常绿。只改 pkgs/。 --- pkgs/c/compat.freetype.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/c/compat.freetype.lua b/pkgs/c/compat.freetype.lua index a9063062..28b5b4f4 100644 --- a/pkgs/c/compat.freetype.lua +++ b/pkgs/c/compat.freetype.lua @@ -51,6 +51,17 @@ package = { "*/src/base/ftbbox.c", -- Base extra (individual) "*/src/base/ftmm.c", + -- Synthetic bold and oblique. Upstream builds it in `base` and + -- every distribution ships it; it was missing here and the gap is + -- invisible until a consumer calls it, because nothing in freetype + -- itself does. + -- + -- cairo does, unconditionally: `cairo-ft-font.c:2443` calls + -- `FT_GlyphSlot_Embolden` when a font is asked for a weight it does + -- not have, with no HAVE_ guard to turn off. So a cairo built + -- against this freetype failed to LINK with two undefined + -- references — measured while adding freedesktop.cairo. + "*/src/base/ftsynth.c", -- Modules (aggregates) "*/src/autofit/autofit.c", "*/src/bdf/bdf.c",