Keep dunst, libgemui dialogs, and anode-vkbd on Fira Code

This commit is contained in:
Luxferre committed 2026-11-26 17:10:08 +02:00
1 parent 418fa85b3a
commit cf1544eb0c
9 files changed
+16 -75

No files matched your search

+5 -28
View File
@@ -159,7 +159,6 @@ void gemui_theme_defaults(gemui_theme_t *t) {
memset(t, 0, sizeof(*t));
snprintf(t->name, sizeof(t->name), "AnodeDefault");
snprintf(t->font_face, sizeof(t->font_face), "Fira Code");
snprintf(t->ui_font_face, sizeof(t->ui_font_face), "Roboto");
snprintf(t->icon_font_face, sizeof(t->icon_font_face), "DejaVuSansM Nerd Font");
t->base_font_size = 15;
t->dpi = 96;
@@ -247,9 +246,6 @@ static void gemui_apply_xrm_db(XrmDatabase db, gemui_theme_t *t) {
if (XrmGetResource(db, "theme.fontFace", "Theme.FontFace", &type, &val) && val.addr) {
snprintf(t->font_face, sizeof(t->font_face), "%s", val.addr);
}
if (XrmGetResource(db, "theme.uiFontFace", "Theme.UiFontFace", &type, &val) && val.addr) {
snprintf(t->ui_font_face, sizeof(t->ui_font_face), "%s", val.addr);
}
if (XrmGetResource(db, "theme.iconFontFace", "Theme.IconFontFace", &type, &val) && val.addr) {
snprintf(t->icon_font_face, sizeof(t->icon_font_face), "%s", val.addr);
}
@@ -1091,7 +1087,7 @@ static int gemui_draw_pango(cairo_t *cr, const char *face, int px_size,
PangoLayout *layout = g_active_layout ? g_active_layout : pango_cairo_create_layout(cr);
char desc_str[288];
snprintf(desc_str, sizeof(desc_str), "%s%s %dpx",
face && face[0] ? face : "Roboto, Noto Sans",
face && face[0] ? face : "Fira Code",
bold ? " Bold" : "",
px_size > 8 ? px_size : 14);
PangoFontDescription *desc = pango_font_description_from_string(desc_str);
@@ -1121,39 +1117,20 @@ static int gemui_draw_pango(cairo_t *cr, const char *face, int px_size,
return tw;
}
static int gemui_draw_text_with_face(cairo_t *cr, const gemui_theme_t *t, gemui_rect_t r,
const char *face, const char *text, int pt_delta,
bool bold, int align, gemui_color_t c) {
int gemui_draw_text(cairo_t *cr, const gemui_theme_t *t, gemui_rect_t r,
const char *text, int pt_delta, bool bold, int align, gemui_color_t c) {
double sc = (t && t->scale > 0.0) ? t->scale : 1.0;
int base_px = (t && t->base_font_size > 0) ? t->base_font_size : anode_scale_px(15, sc);
int delta_px = (int)llround((double)pt_delta * sc);
int px = base_px + delta_px;
if (px < 8) px = 8;
char fam[256];
char fam[224];
snprintf(fam, sizeof(fam), "%s, %s",
(face && face[0]) ? face : "Roboto, Noto Sans",
(t && t->font_face[0]) ? t->font_face : "Fira Code",
(t && t->icon_font_face[0]) ? t->icon_font_face : "DejaVuSansM Nerd Font");
return gemui_draw_pango(cr, fam, px, r, text, bold, align, c);
}
int gemui_draw_text(cairo_t *cr, const gemui_theme_t *t, gemui_rect_t r,
const char *text, int pt_delta, bool bold, int align, gemui_color_t c) {
const char *uface = (t && t->ui_font_face[0]) ? t->ui_font_face : "Roboto";
char ui_with_fallback[128];
if (strcmp(uface, "Noto Sans") == 0) {
snprintf(ui_with_fallback, sizeof(ui_with_fallback), "Noto Sans");
} else {
snprintf(ui_with_fallback, sizeof(ui_with_fallback), "%s, Noto Sans", uface);
}
return gemui_draw_text_with_face(cr, t, r, ui_with_fallback, text, pt_delta, bold, align, c);
}
int gemui_draw_mono_text(cairo_t *cr, const gemui_theme_t *t, gemui_rect_t r,
const char *text, int pt_delta, bool bold, int align, gemui_color_t c) {
const char *mface = (t && t->font_face[0]) ? t->font_face : "Fira Code";
return gemui_draw_text_with_face(cr, t, r, mface, text, pt_delta, bold, align, c);
}
int gemui_draw_icon(cairo_t *cr, const gemui_theme_t *t, gemui_rect_t r,
const char *icon_utf8, int pt_delta, int align, gemui_color_t c) {
double sc = (t && t->scale > 0.0) ? t->scale : 1.0;