Skip to content

Commit 4d0aff4

Browse files
committed
fix(pangocairo): 断言 ink > 0,而不是按开发机字体调出来的阈值
渲染检查原来写的是 `drawn > 100`。在我这台 184 个字体族的机器上得到 216 像素、 通过;在只有 4 个字体族的 CI runner 上得到 72 像素、失败 —— 几乎没有字体时 「世界」渲染成豆腐块,墨迹更薄。 那让它变成了对**机器**的断言而不是对这次构建的断言,正是周围注释一直在警告的那 类错误:gnome.gio 的 xdgmime 检查刻意不断言具体 MIME,理由完全相同。 墨迹就是墨迹:任何正数都证明七个包把像素放下去了。 tarball 重切:sha256 → 9be92e7f…,CN 容器 tag → 1.56.1-2。
1 parent 44de010 commit 4d0aff4

6 files changed

Lines changed: 38 additions & 14 deletions

File tree

‎.agents/docs/2026-08-30-graphics-stack-coverage-design.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,6 +2100,12 @@ freedesktop.cairo 字形落下去的那张 surface
21002100

21012101
**空白图片意味着其中之一没干活。**
21022102

2103+
⭐ **而断言是 `ink > 0`,刻意不是一个调出来的数。** 早先写的是 `> 100`:在我这台
2104+
有 184 个字体族的机器上得到 216 像素、**通过**;在只有 4 个字体族的 CI runner 上
2105+
得到 72 像素、**失败** —— 因为几乎没有字体时「世界」渲染成豆腐块,墨迹更薄。
2106+
那个阈值是**对机器的断言**,不是对这次构建的断言。和 gnome.gio 的 xdgmime 检查
2107+
刻意不断言具体 MIME 是同一条理由。
2108+
21032109
⚠️ 而且它**诚实地降级**:`freedesktop.fontconfig` 故意把运行期路径编译成空,
21042110
所以没有 `FONTCONFIG_FILE` 的 runner 合法地找到零个字体族 —— 那就没有东西可画、
21052111
也没有东西可断言。**那种情况被报告出来,而不是被静默略过**,因为「0 个字体族,

‎pkgs/p/gnome.pango.lua‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,14 @@ package = {
8484
["1.56.1"] = {
8585
url = {
8686
GLOBAL = "https://github.com/mcpplibs/pango/archive/refs/tags/1.56.1.tar.gz",
87-
-- Verified byte-identical to the GLOBAL tag archive, not
88-
-- merely "same version": the asset IS that archive.
89-
CN = "https://gitcode.com/mcpp-res/pango/releases/download/1.56.1/pango-1.56.1.tar.gz",
87+
-- ⚠️ The container tag is `1.56.1-2`, not `1.56.1`. gitcode
88+
-- refuses to REPLACE an asset of the same name in an
89+
-- existing release, so each corrected tarball needs a new
90+
-- container tag while the PACKAGE version stays upstream's.
91+
-- Verified byte-identical to the GLOBAL tag archive.
92+
CN = "https://gitcode.com/mcpp-res/pango/releases/download/1.56.1-2/pango-1.56.1.tar.gz",
9093
},
91-
sha256 = "52b32cd2b30326459950ad9a6ecb24ab4909dbe3f631a2657e3973d78015ed01",
94+
sha256 = "9be92e7fcbb1544921c67ba2576b070371e864ddda2e8d420c0a6f2ca1ef5b2f",
9295
},
9396
},
9497
},

‎pkgs/p/gnome.pangocairo.lua‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,14 @@ package = {
9090
["1.56.1"] = {
9191
url = {
9292
GLOBAL = "https://github.com/mcpplibs/pango/archive/refs/tags/1.56.1.tar.gz",
93-
-- Verified byte-identical to the GLOBAL tag archive, not
94-
-- merely "same version": the asset IS that archive.
95-
CN = "https://gitcode.com/mcpp-res/pango/releases/download/1.56.1/pango-1.56.1.tar.gz",
93+
-- ⚠️ The container tag is `1.56.1-2`, not `1.56.1`. gitcode
94+
-- refuses to REPLACE an asset of the same name in an
95+
-- existing release, so each corrected tarball needs a new
96+
-- container tag while the PACKAGE version stays upstream's.
97+
-- Verified byte-identical to the GLOBAL tag archive.
98+
CN = "https://gitcode.com/mcpp-res/pango/releases/download/1.56.1-2/pango-1.56.1.tar.gz",
9699
},
97-
sha256 = "52b32cd2b30326459950ad9a6ecb24ab4909dbe3f631a2657e3973d78015ed01",
100+
sha256 = "9be92e7fcbb1544921c67ba2576b070371e864ddda2e8d420c0a6f2ca1ef5b2f",
98101
},
99102
},
100103
},

‎pkgs/p/gnome.pangoft2.lua‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,14 @@ package = {
6868
["1.56.1"] = {
6969
url = {
7070
GLOBAL = "https://github.com/mcpplibs/pango/archive/refs/tags/1.56.1.tar.gz",
71-
-- Verified byte-identical to the GLOBAL tag archive, not
72-
-- merely "same version": the asset IS that archive.
73-
CN = "https://gitcode.com/mcpp-res/pango/releases/download/1.56.1/pango-1.56.1.tar.gz",
71+
-- ⚠️ The container tag is `1.56.1-2`, not `1.56.1`. gitcode
72+
-- refuses to REPLACE an asset of the same name in an
73+
-- existing release, so each corrected tarball needs a new
74+
-- container tag while the PACKAGE version stays upstream's.
75+
-- Verified byte-identical to the GLOBAL tag archive.
76+
CN = "https://gitcode.com/mcpp-res/pango/releases/download/1.56.1-2/pango-1.56.1.tar.gz",
7477
},
75-
sha256 = "52b32cd2b30326459950ad9a6ecb24ab4909dbe3f631a2657e3973d78015ed01",
78+
sha256 = "9be92e7fcbb1544921c67ba2576b070371e864ddda2e8d420c0a6f2ca1ef5b2f",
7679
},
7780
},
7881
},

‎tests/examples/pangocairo/tests/module.cpp‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ int main()
6767
int families = -1;
6868
{ PangoFontFamily **f = nullptr; pango_font_map_list_families(map, &f, &families); g_free(f); }
6969
if (families > 0)
70-
check(drawn > 100, "pango_cairo_show_layout put ink on the surface");
70+
// `> 0`, not a tuned number — see the header-route test next door for
71+
// why a threshold here is an assertion about the runner's fonts.
72+
check(drawn > 0, "pango_cairo_show_layout put ink on the surface");
7173
else
7274
g_print(" ⚠️ 0 font families: the rendering assertion was NOT run.\n");
7375

‎tests/examples/pangocairo/tests/pangocairo.cpp‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,14 @@ int main()
130130
if (families > 0) {
131131
// ⭐ THE WHOLE LINE, IN ONE ASSERTION.
132132
check(w > 0 && h > 0, "the layout measured a non-empty box");
133-
check(drawn > 100,
133+
// ⚠️ `> 0`, NOT `> 100`. An earlier version used 100 and PASSED here
134+
// (216 pixels, 184 font families) while FAILING on a CI runner with
135+
// four families and 72 — because with almost no fonts "世界" renders
136+
// as tofu boxes and the ink is thinner. The threshold was calibrated
137+
// to the developer's font set, which makes it an assertion about the
138+
// MACHINE rather than about this build. Ink is ink: any positive count
139+
// proves all seven packages put pixels down.
140+
check(drawn > 0,
134141
"pango_cairo_show_layout put ink on the surface — seven packages");
135142
} else {
136143
// Not a pass. The runner has no fonts, so the only real check could

0 commit comments

Comments
 (0)