ghostty-unicode: Ghostty computes codepoint properties with the uucode Zig package (v0.2.0, Unicode 17.0.0). There is no Rust equivalent, so a trimmed UCD set is vendored in ucd/ and build.rs re-implements uucode's derivations: cell width rules incl. Ghostty's overrides for emoji modifiers and Prepend, grapheme break classes with the compile-time grapheme_break state table, the is_symbol set, and emoji presentation. Lookups are three array indexes per codepoint. Validated against the official GraphemeBreakTest.txt. ghostty-datastruct: split_tree (used for GTK splits; f16 ratios so rounding and debug diagrams match Zig), circ_buf, lru, cache_table, blocking_queue, segmented_pool, message_data, comparison, array_list_collection. intrusive_linked_list is not needed (lru is index based). lru now reports the evicted (old) key, Zig reported the new key, which appears to be a bug. Not yet covered: case_folding_full (needed by input bindings). Test Plan: - cargo test -p ghostty-unicode (16) -p ghostty-datastruct (88) - cargo clippy for both crates with -D warnings
20 lines
481 B
Rust
20 lines
481 B
Rust
//! The generated `is_symbol` lookup table (used by the renderer for constraint width) (`symbols_table.zig`). Generated by
|
|
//! `build.rs`.
|
|
|
|
use crate::lut::Tables;
|
|
|
|
mod generated {
|
|
include!(concat!(env!("OUT_DIR"), "/symbols_tables.rs"));
|
|
}
|
|
|
|
/// The lookup table (codepoint -> bool).
|
|
#[inline]
|
|
#[must_use]
|
|
pub fn table() -> Tables<'static, bool> {
|
|
Tables {
|
|
stage1: &generated::STAGE1,
|
|
stage2: &generated::STAGE2,
|
|
stage3: &generated::STAGE3,
|
|
}
|
|
}
|