mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-01-07 05:43:20 +00:00
pkg/dcimgui: fix wchar size mismatch
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
pub const build_options = @import("build_options");
|
||||
|
||||
pub const c = @cImport({
|
||||
// This is set during the build so it also has to be set
|
||||
// during import time to get the right types. Without this
|
||||
// you get stack size mismatches on some structs.
|
||||
@cDefine("IMGUI_USE_WCHAR32", "1");
|
||||
@cInclude("dcimgui.h");
|
||||
});
|
||||
|
||||
|
||||
@@ -138,24 +138,24 @@ pub fn setup() void {
|
||||
io.IniFilename = null;
|
||||
io.LogFilename = null;
|
||||
|
||||
// // Use our own embedded font
|
||||
// {
|
||||
// // TODO: This will have to be recalculated for different screen DPIs.
|
||||
// // This is currently hardcoded to a 2x content scale.
|
||||
// const font_size = 16 * 2;
|
||||
//
|
||||
// var font_config: cimgui.c.ImFontConfig = .{};
|
||||
// cimgui.ext.ImFontConfig_ImFontConfig(&font_config);
|
||||
// font_config.FontDataOwnedByAtlas = false;
|
||||
// _ = cimgui.c.ImFontAtlas_AddFontFromMemoryTTF(
|
||||
// io.Fonts,
|
||||
// @ptrCast(@constCast(font.embedded.regular.ptr)),
|
||||
// @intCast(font.embedded.regular.len),
|
||||
// font_size,
|
||||
// &font_config,
|
||||
// null,
|
||||
// );
|
||||
// }
|
||||
// Use our own embedded font
|
||||
{
|
||||
// TODO: This will have to be recalculated for different screen DPIs.
|
||||
// This is currently hardcoded to a 2x content scale.
|
||||
const font_size = 16 * 2;
|
||||
|
||||
var font_config: cimgui.c.ImFontConfig = undefined;
|
||||
cimgui.ext.ImFontConfig_ImFontConfig(&font_config);
|
||||
font_config.FontDataOwnedByAtlas = false;
|
||||
_ = cimgui.c.ImFontAtlas_AddFontFromMemoryTTF(
|
||||
io.Fonts,
|
||||
@ptrCast(@constCast(font.embedded.regular.ptr)),
|
||||
@intCast(font.embedded.regular.len),
|
||||
font_size,
|
||||
&font_config,
|
||||
null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn init(surface: *Surface) !Inspector {
|
||||
|
||||
Reference in New Issue
Block a user