Skip to content

Commit 7495fa2

Browse files
committed
Update DVUI and header font
1 parent ca2fa00 commit 7495fa2

9 files changed

Lines changed: 39 additions & 14 deletions

File tree

assets/fonts/NotoSans-Bold.ttf

-616 KB
Binary file not shown.

assets/fonts/NotoSans-Light.ttf

-615 KB
Binary file not shown.

assets/fonts/NotoSans-Thin.ttf

-614 KB
Binary file not shown.
92.6 KB
Binary file not shown.
92.5 KB
Binary file not shown.

build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
.lazy = true,
2727
},
2828
.dvui = .{
29-
.url = "https://github.com/foxnne/dvui-dev/archive/bb2ab8fd7215bda4b85174112bba8f8cad6640fa.tar.gz",
30-
.hash = "dvui-0.5.0-dev-AQFJmTgI9gAPyMVuqyhVYtHeP6chM1cvLDRDvWS3rQ_y",
29+
.url = "https://github.com/foxnne/dvui-dev/archive/0af49af588ff0446af2e3b00aa9295b860dd80b3.tar.gz",
30+
.hash = "dvui-0.5.0-dev-AQFJmSIG9gCFmDEw0HDkDXhp0_VTlsQiAhJVumpjrUMb",
3131
//.path = "../dvui-dev",
3232
},
3333
.assetpack = .{

src/editor/Editor.zig

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const cozette_bold_ttf = assets.files.fonts.@"CozetteVectorBold.ttf";
1212
const comfortaa_ttf = assets.files.fonts.@"Comfortaa-Regular.ttf";
1313
const comfortaa_bold_ttf = assets.files.fonts.@"Comfortaa-Bold.ttf";
1414

15-
const noto_sans_ttf = assets.files.fonts.@"NotoSans-Light.ttf";
16-
const noto_sans_bold_ttf = assets.files.fonts.@"NotoSans-Bold.ttf";
15+
const plus_jakarta_sans_ttf = assets.files.fonts.@"PlusJakartaSans-Regular.ttf";
16+
const plus_jakarta_sans_bold_ttf = assets.files.fonts.@"PlusJakartaSans-Bold.ttf";
1717

1818
const fizzy = @import("../fizzy.zig");
1919
const dvui = @import("dvui");
@@ -165,14 +165,13 @@ const embedded_fonts: []const dvui.Font.Source = &.{
165165
.bytes = comfortaa_bold_ttf,
166166
.weight = .bold,
167167
},
168-
169168
.{
170-
.family = dvui.Font.array("NotoSans"),
171-
.bytes = noto_sans_ttf,
169+
.family = dvui.Font.array("PlusJakartaSans"),
170+
.bytes = plus_jakarta_sans_ttf,
172171
},
173172
.{
174-
.family = dvui.Font.array("NotoSans"),
175-
.bytes = noto_sans_bold_ttf,
173+
.family = dvui.Font.array("PlusJakartaSans"),
174+
.bytes = plus_jakarta_sans_bold_ttf,
176175
.weight = .bold,
177176
},
178177
};
@@ -264,9 +263,9 @@ pub fn init(
264263

265264
fizzy_dark.dark = true;
266265
fizzy_dark.name = "Fizzy Dark";
267-
fizzy_dark.font_body = .find(.{ .family = "Comfortaa", .size = editor.settings.font_body_size, .weight = .bold });
268-
fizzy_dark.font_title = .find(.{ .family = "NotoSans", .size = editor.settings.font_title_size, .weight = .bold });
269-
fizzy_dark.font_heading = .find(.{ .family = "NotoSans", .size = editor.settings.font_heading_size, .weight = .bold });
266+
fizzy_dark.font_body = .find(.{ .family = "Comfortaa", .size = editor.settings.font_body_size });
267+
fizzy_dark.font_title = .find(.{ .family = "Comfortaa", .size = editor.settings.font_title_size, .weight = .bold });
268+
fizzy_dark.font_heading = .find(.{ .family = "PlusJakartaSans", .size = editor.settings.font_heading_size, .weight = .bold });
270269
fizzy_dark.font_mono = .find(.{ .family = "CozetteVector", .size = editor.settings.font_mono_size });
271270

272271
var moi: dvui.Theme = fizzy_dark;
@@ -493,6 +492,32 @@ pub fn applySettingsTheme(editor: *Editor) !void {
493492
}
494493
dvui.themeSet(t.*);
495494
editor.applyFontSizesFromSettings();
495+
496+
// TEMP diagnostic: dump every Source registered in the font database, plus
497+
// the active theme's heading/title font specs. Helps confirm whether the
498+
// Comfortaa-Bold entry actually made it in and what weight font_heading asks for.
499+
{
500+
const cw = dvui.currentWindow();
501+
dvui.log.info("[font-debug] active theme: {s}", .{cw.theme.name});
502+
dvui.log.info("[font-debug] font_heading: family={s} weight={s} size={d}", .{
503+
cw.theme.font_heading.familyName(),
504+
@tagName(cw.theme.font_heading.weight),
505+
cw.theme.font_heading.size,
506+
});
507+
dvui.log.info("[font-debug] font_title: family={s} weight={s} size={d}", .{
508+
cw.theme.font_title.familyName(),
509+
@tagName(cw.theme.font_title.weight),
510+
cw.theme.font_title.size,
511+
});
512+
for (cw.fonts.database.items, 0..) |src, i| {
513+
dvui.log.info("[font-debug] db[{d}]: family={s} weight={s} bytes.ptr={x}", .{
514+
i,
515+
src.familyName(),
516+
@tagName(src.weight),
517+
@intFromPtr(src.bytes.ptr),
518+
});
519+
}
520+
}
496521
}
497522

498523
pub fn currentGroupingID(editor: *Editor) u64 {

src/editor/Settings.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ titlebar_top_buffer: f32 = 10.0,
100100

101101
pub fn resolvedPanZoomScheme(settings: *const Settings) ResolvedPanZoomScheme {
102102
return switch (settings.input_scheme) {
103-
.auto => switch (dvui.getMouseTypeHint()) {
103+
.auto => switch (dvui.mouseType()) {
104104
.unknown => if (builtin.os.tag == .macos) .trackpad else .mouse,
105105
.mouse => .mouse,
106106
.trackpad => .trackpad,

src/editor/explorer/settings.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ pub fn draw() !void {
225225
});
226226

227227
const label_text: []const u8 = switch (fizzy.editor.settings.input_scheme) {
228-
.auto => switch (dvui.getMouseTypeHint()) {
228+
.auto => switch (dvui.mouseType()) {
229229
// Pre-classification (no scroll events seen yet) — drop the parenthetical
230230
// entirely rather than showing "Auto (unknown)".
231231
.unknown => "Auto",

0 commit comments

Comments
 (0)