From 4cac375fcf32d0b3c5d4fda2fa6fe0db9ce8a321 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 25 Nov 2022 15:22:59 -0800 Subject: [PATCH] more --- conformance/blocks.zig | 16 ++++++++++++++++ src/font/BoxFont.zig | 20 ++++++++++++++++++++ src/font/Group.zig | 2 ++ 3 files changed, 38 insertions(+) diff --git a/conformance/blocks.zig b/conformance/blocks.zig index cd4ae5b0b..9cc3881d9 100644 --- a/conformance/blocks.zig +++ b/conformance/blocks.zig @@ -80,4 +80,20 @@ pub fn main() !void { try stdout.print("\n\n", .{}); } } + + { + try stdout.print("\x1b[4mOther\x1b[0m\n", .{}); + var i: usize = 0x1FB70; + var step: usize = 32; + const end = 0x1FB8B; + while (i <= end) : (i += step) { + var j: usize = 0; + while (j < step) : (j += 1) { + const v = i + j; + if (v <= end) try stdout.print("{u} ", .{@intCast(u21, v)}); + } + + try stdout.print("\n\n", .{}); + } + } } diff --git a/src/font/BoxFont.zig b/src/font/BoxFont.zig index 91001ffb2..4cea89869 100644 --- a/src/font/BoxFont.zig +++ b/src/font/BoxFont.zig @@ -332,6 +332,26 @@ fn draw(self: BoxFont, alloc: Allocator, img: *pixman.Image, cp: u32) !void { try self.draw_wedge_triangle(img, 0x1fb6e); }, + 0x1FB70 => self.draw_vertical_one_eighth_block_n(img, 1), + 0x1FB71 => self.draw_vertical_one_eighth_block_n(img, 2), + 0x1FB72 => self.draw_vertical_one_eighth_block_n(img, 3), + 0x1FB73 => self.draw_vertical_one_eighth_block_n(img, 4), + 0x1FB74 => self.draw_vertical_one_eighth_block_n(img, 5), + 0x1FB75 => self.draw_vertical_one_eighth_block_n(img, 6), + + 0x1FB76 => self.draw_horizontal_one_eighth_block_n(img, 1), + 0x1FB77 => self.draw_horizontal_one_eighth_block_n(img, 2), + 0x1FB78 => self.draw_horizontal_one_eighth_block_n(img, 3), + 0x1FB79 => self.draw_horizontal_one_eighth_block_n(img, 4), + 0x1FB7A => self.draw_horizontal_one_eighth_block_n(img, 5), + 0x1FB7B => self.draw_horizontal_one_eighth_block_n(img, 6), + + 0x1fb82 => self.draw_upper_one_quarter_block(img), + 0x1fb83 => self.draw_upper_three_eighths_block(img), + 0x1fb84 => self.draw_upper_five_eighths_block(img), + 0x1fb85 => self.draw_upper_three_quarters_block(img), + 0x1fb86 => self.draw_upper_seven_eighths_block(img), + else => return error.InvalidCodepoint, } } diff --git a/src/font/Group.zig b/src/font/Group.zig index 13f2190b3..935af8db1 100644 --- a/src/font/Group.zig +++ b/src/font/Group.zig @@ -217,6 +217,8 @@ pub fn indexForCodepoint( 0x1FB9B, => true, + 0x1FB70...0x1FB8B => true, + else => false, }) { return FontIndex.initSpecial(.box);