finish win32 gui support for double-wide characters
This commit is contained in:
parent
8278a080af
commit
05b87b1406
3 changed files with 25 additions and 7 deletions
|
|
@ -75,6 +75,7 @@ pub fn render(
|
|||
self: *const DwriteRenderer,
|
||||
font: Font,
|
||||
utf8: []const u8,
|
||||
double_width: bool,
|
||||
) void {
|
||||
var utf16_buf: [10]u16 = undefined;
|
||||
const utf16_len = std.unicode.utf8ToUtf16Le(&utf16_buf, utf8) catch unreachable;
|
||||
|
|
@ -85,7 +86,10 @@ pub fn render(
|
|||
const rect: win32.D2D_RECT_F = .{
|
||||
.left = 0,
|
||||
.top = 0,
|
||||
.right = @floatFromInt(font.cell_size.x),
|
||||
.right = if (double_width)
|
||||
@as(f32, @floatFromInt(font.cell_size.x)) * @as(f32, @floatFromInt(font.cell_size.x))
|
||||
else
|
||||
@as(f32, @floatFromInt(font.cell_size.x)),
|
||||
.bottom = @floatFromInt(font.cell_size.y),
|
||||
};
|
||||
self.render_target.BeginDraw();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue