summaryrefslogtreecommitdiff
path: root/codegen
diff options
context:
space:
mode:
authorGravatar Jose Colon Rodriguez2024-02-18 13:28:09 -0400
committerGravatar Jose Colon Rodriguez2024-02-18 13:28:09 -0400
commite2f2e8f25e1b4507d502bea3900031c16eb6a52d (patch)
tree8a2cab5d8166cb7f4cafa9fe9e3a1fd991bfce85 /codegen
parentGrapheme -> grapheme (diff)
downloadzg-e2f2e8f25e1b4507d502bea3900031c16eb6a52d.tar.gz
zg-e2f2e8f25e1b4507d502bea3900031c16eb6a52d.tar.xz
zg-e2f2e8f25e1b4507d502bea3900031c16eb6a52d.zip
Added cjk build option to set ambiguous width to 2 at build time
Diffstat (limited to 'codegen')
-rw-r--r--codegen/dwp.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/codegen/dwp.zig b/codegen/dwp.zig
index a8cef57..36ab7cb 100644
--- a/codegen/dwp.zig
+++ b/codegen/dwp.zig
@@ -1,5 +1,7 @@
1const std = @import("std"); 1const std = @import("std");
2 2
3const options = @import("options");
4
3const block_size = 256; 5const block_size = 256;
4const Block = [block_size]i3; 6const Block = [block_size]i3;
5 7
@@ -75,7 +77,10 @@ pub fn main() !void {
75 }, 77 },
76 1 => { 78 1 => {
77 // Width 79 // Width
78 if (std.mem.eql(u8, field, "W") or std.mem.eql(u8, field, "F")) { 80 if (std.mem.eql(u8, field, "W") or
81 std.mem.eql(u8, field, "F") or
82 (options.cjk and std.mem.eql(u8, field, "A")))
83 {
79 for (current_code[0]..current_code[1] + 1) |cp| try flat_map.put(@intCast(cp), 2); 84 for (current_code[0]..current_code[1] + 1) |cp| try flat_map.put(@intCast(cp), 2);
80 } 85 }
81 }, 86 },