diff options
| author | Jeffrey C. Ollie <jeff@ocjtech.us> | 2025-09-04 23:04:08 -0500 |
|---|---|---|
| committer | Jeffrey C. Ollie <jeff@ocjtech.us> | 2025-09-05 07:58:01 -0500 |
| commit | a7da96faeea305d5ff1758a98557a42afe0fed32 (patch) | |
| tree | ae6ab8b6b6d7f7bf81897dc21f3d0615ec5bd0f0 /src/renderer | |
| parent | 968b9d536dd1a14c23024dd1d10eccabd60fb796 (diff) | |
add two LUT-based implementations of isSymbol
Diffstat (limited to 'src/renderer')
| -rw-r--r-- | src/renderer/cell.zig | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/renderer/cell.zig b/src/renderer/cell.zig index ec13b8953..a75fddf52 100644 --- a/src/renderer/cell.zig +++ b/src/renderer/cell.zig @@ -1,12 +1,12 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; -const ziglyph = @import("ziglyph"); const font = @import("../font/main.zig"); const terminal = @import("../terminal/main.zig"); const renderer = @import("../renderer.zig"); const shaderpkg = renderer.Renderer.API.shaders; const ArrayListCollection = @import("../datastruct/array_list_collection.zig").ArrayListCollection; +const symbols = @import("../unicode/symbols1.zig").table; /// The possible cell content keys that exist. pub const Key = enum { @@ -249,15 +249,7 @@ pub fn isCovering(cp: u21) bool { /// In the future it may be prudent to expand this to encompass more /// symbol-like characters, and/or exclude some PUA sections. pub fn isSymbol(cp: u21) bool { - // TODO: This should probably become a codegen'd LUT - return ziglyph.general_category.isPrivateUse(cp) or - ziglyph.blocks.isDingbats(cp) or - ziglyph.blocks.isEmoticons(cp) or - ziglyph.blocks.isMiscellaneousSymbols(cp) or - ziglyph.blocks.isEnclosedAlphanumerics(cp) or - ziglyph.blocks.isEnclosedAlphanumericSupplement(cp) or - ziglyph.blocks.isMiscellaneousSymbolsAndPictographs(cp) or - ziglyph.blocks.isTransportAndMapSymbols(cp); + return symbols.get(cp); } /// Returns the appropriate `constraint_width` for |
