Skip to content

Commit d38d0f3

Browse files
committedOct 14, 2024
font/sprite: replace pixman with z2d, extend Box coverage
More complete coverage of the Symbols For Legacy Computing block, including characters from Unicode 16.0. Pixman and the web canvas impl for Canvas have been removed in favor of z2d for drawing, since it has a nicer API with more powerful methods, and is in Zig with no specific platform optimizations so should compile to wasm no problem.
1 parent c86b5f4 commit d38d0f3

File tree

115 files changed

+1025
-68176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+1025
-68176
lines changed
 

‎build.zig

+6-10
Original file line numberDiff line numberDiff line change
@@ -1007,10 +1007,6 @@ fn addDeps(
10071007
.optimize = optimize,
10081008
});
10091009
const opengl_dep = b.dependency("opengl", .{});
1010-
const pixman_dep = b.dependency("pixman", .{
1011-
.target = target,
1012-
.optimize = optimize,
1013-
});
10141010
const sentry_dep = b.dependency("sentry", .{
10151011
.target = target,
10161012
.optimize = optimize,
@@ -1044,6 +1040,7 @@ fn addDeps(
10441040
.target = target,
10451041
.optimize = optimize,
10461042
});
1043+
const z2d_dep = b.dependency("z2d", .{});
10471044

10481045
// Wasm we do manually since it is such a different build.
10491046
if (step.rootModuleTarget().cpu.arch == .wasm32) {
@@ -1125,12 +1122,16 @@ fn addDeps(
11251122
step.root_module.addImport("spirv_cross", spirv_cross_dep.module("spirv_cross"));
11261123
step.root_module.addImport("xev", libxev_dep.module("xev"));
11271124
step.root_module.addImport("opengl", opengl_dep.module("opengl"));
1128-
step.root_module.addImport("pixman", pixman_dep.module("pixman"));
11291125
step.root_module.addImport("sentry", sentry_dep.module("sentry"));
11301126
step.root_module.addImport("ziglyph", ziglyph_dep.module("ziglyph"));
11311127
step.root_module.addImport("vaxis", vaxis_dep.module("vaxis"));
11321128
step.root_module.addImport("wuffs", wuffs_dep.module("wuffs"));
11331129
step.root_module.addImport("zf", zf_dep.module("zf"));
1130+
step.root_module.addImport("z2d", b.addModule("z2d", .{
1131+
.root_source_file = z2d_dep.path("src/z2d.zig"),
1132+
.target = target,
1133+
.optimize = optimize,
1134+
}));
11341135

11351136
// Mac Stuff
11361137
if (step.rootModuleTarget().isDarwin()) {
@@ -1196,7 +1197,6 @@ fn addDeps(
11961197
step.linkSystemLibrary2("freetype2", dynamic_link_opts);
11971198
step.linkSystemLibrary2("libpng", dynamic_link_opts);
11981199
step.linkSystemLibrary2("oniguruma", dynamic_link_opts);
1199-
step.linkSystemLibrary2("pixman-1", dynamic_link_opts);
12001200
step.linkSystemLibrary2("zlib", dynamic_link_opts);
12011201

12021202
if (config.font_backend.hasFontconfig()) {
@@ -1222,10 +1222,6 @@ fn addDeps(
12221222
step.linkLibrary(freetype_dep.artifact("freetype"));
12231223
try static_libs.append(freetype_dep.artifact("freetype").getEmittedBin());
12241224

1225-
// Pixman
1226-
step.linkLibrary(pixman_dep.artifact("pixman"));
1227-
try static_libs.append(pixman_dep.artifact("pixman").getEmittedBin());
1228-
12291225
// Harfbuzz
12301226
if (config.font_backend.hasHarfbuzz()) {
12311227
step.linkLibrary(harfbuzz_dep.artifact("harfbuzz"));

‎build.zig.zon

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
.macos = .{ .path = "./pkg/macos" },
3737
.oniguruma = .{ .path = "./pkg/oniguruma" },
3838
.opengl = .{ .path = "./pkg/opengl" },
39-
.pixman = .{ .path = "./pkg/pixman" },
4039
.sentry = .{ .path = "./pkg/sentry" },
4140
.simdutf = .{ .path = "./pkg/simdutf" },
4241
.utfcpp = .{ .path = "./pkg/utfcpp" },
@@ -61,5 +60,9 @@
6160
.url = "git+https://github.com/natecraddock/zf.git?ref=main#bb27a917c3513785c6a91f0b1c10002a5029cacc",
6261
.hash = "1220a74107c7f153a2f809e41c7fa7e8dbf75c91043e39fad998247804e5edac2cc8",
6362
},
63+
.z2d = .{
64+
.url = "git+https://github.com/vancluever/z2d?ref=main#285a796eb9c25a2389f087d008f0e60faf0b8eda",
65+
.hash = "12206445aa45bcf0170ace371905f705aec1d8d4f61e7dd77839c6621b8c407680a5",
66+
},
6467
},
6568
}

0 commit comments

Comments
 (0)
Please sign in to comment.