unicode: isolate properties, tables, and ziglyph into separate files

This makes it cleaner to add new sources of table generation and also
avoids inadvertently depending on different modules (despite Zig's lazy
analysis). 

This also fixes up terminal to only use our look up tables which avoids
bringing ziglyph in for the terminal module.
This commit is contained in:
Mitchell Hashimoto
2025-09-20 14:57:37 -07:00
parent c277ef8d82
commit bf1278deff
5 changed files with 194 additions and 6 deletions

View File

@@ -0,0 +1,18 @@
const Properties = @import("Properties.zig");
const lut = @import("lut.zig");
/// The lookup tables for Ghostty.
pub const table = table: {
// This is only available after running a generator as part of the Ghostty
// build.zig process, but due to Zig's lazy analysis we can still reference
// it here.
//
// An example process is the `main` in `props_ziglyph.zig`
const generated = @import("unicode_tables").Tables(Properties);
const Tables = lut.Tables(Properties);
break :table Tables{
.stage1 = &generated.stage1,
.stage2 = &generated.stage2,
.stage3 = &generated.stage3,
};
};