Skip to content

Commit be8416d

Browse files
singaraionaclaude
andcommitted
style(grid): IBM Plex Sans font, increased cell padding
- Replace Fira Code with IBM Plex Sans for cleaner data display - Use regular weight for grid data cells, bold for headers - Increase cell padding to (12, 6) for better visual separation - Add font index 2 for regular weight grid cells Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6b78dcc commit be8416d

6 files changed

Lines changed: 34 additions & 6 deletions

File tree

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ endif
170170
default: $(TARGET)
171171
debug: $(TARGET)
172172

173-
EMBED_ASSETS = assets/fonts/FiraCode-Bold.ttf assets/fonts/fa-solid-900.otf assets/images/logo.svg assets/images/icon.svg
173+
EMBED_ASSETS = assets/fonts/IBMPlexSans-Bold.ttf assets/fonts/IBMPlexSans-Regular.ttf assets/fonts/fa-solid-900.otf assets/images/logo.svg assets/images/icon.svg
174174

175175
src/embed_assets.h: $(EMBED_ASSETS) scripts/embed.sh
176176
sh scripts/embed.sh $(EMBED_ASSETS) > $@
@@ -246,11 +246,17 @@ deps:
246246
EXT_DIR = deps/rayforce/ext
247247
EXT_RAYKX = $(EXT_DIR)/raykx
248248

249-
# Build extensions and copy to ext/
249+
# Build extensions and copy to ext/ (skip on Windows - raykx uses POSIX sockets)
250+
ifneq (,$(IS_WINDOWS))
251+
ext:
252+
@echo "Skipping extensions on Windows (raykx requires POSIX sockets)"
253+
@mkdir -p ext
254+
else
250255
ext:
251256
$(MAKE) -C $(EXT_RAYKX) release
252257
@mkdir -p ext
253258
@cp $(EXT_RAYKX)/libraykx.so ext/ 2>/dev/null || cp $(EXT_RAYKX)/libraykx.dylib ext/ 2>/dev/null || true
259+
endif
254260

255261
clean:
256262
rm -f src/embed_assets.h

assets/fonts/FiraCode-Bold.ttf

-312 KB
Binary file not shown.

assets/fonts/IBMPlexSans-Bold.ttf

55.4 KB
Binary file not shown.
55.4 KB
Binary file not shown.

src/grid_renderer.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,9 @@ nil_t rfui_render_grid(rfui_widget_t* widget) {
439439
// Use available content region for table
440440
ImVec2 outer_size = ImVec2(0.0f, 0.0f);
441441

442+
// Increase cell padding for better data separation
443+
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2(12.0f, 6.0f));
444+
442445
if (ImGui::BeginTable("##grid", (int)ncols, table_flags, outer_size)) {
443446
// Setup columns with headers
444447
for (i64_t col_idx = 0; col_idx < ncols; col_idx++) {
@@ -520,6 +523,12 @@ nil_t rfui_render_grid(rfui_widget_t* widget) {
520523
// Cache column pointers for performance (avoid repeated AS_LIST dereference)
521524
obj_p* cols = AS_LIST(vals);
522525

526+
// Use regular (non-bold) font for data cells
527+
ImGuiIO& io = ImGui::GetIO();
528+
if (io.Fonts->Fonts.Size > 2) {
529+
ImGui::PushFont(io.Fonts->Fonts[2]);
530+
}
531+
523532
while (clipper.Step()) {
524533
for (int row = clipper.DisplayStart; row < clipper.DisplayEnd; row++) {
525534
ImGui::TableNextRow();
@@ -634,8 +643,16 @@ nil_t rfui_render_grid(rfui_widget_t* widget) {
634643
}
635644

636645
clipper.End();
646+
647+
// Pop regular font
648+
ImGuiIO& io_pop = ImGui::GetIO();
649+
if (io_pop.Fonts->Fonts.Size > 2) {
650+
ImGui::PopFont();
651+
}
652+
637653
ImGui::EndTable();
638654
}
655+
ImGui::PopStyleVar(); // CellPadding
639656

640657
// Column dropdown popup — opened once on click frame
641658
if (ui_state && ui_state->menu_open_request) {

src/ui.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,11 @@ i32_t rfui_ui_init(nil_t) {
177177
// Apply dashboard theme (replaces StyleColorsDark)
178178
rfui_theme_apply();
179179

180-
// Load Fira Code + FontAwesome as the single UI font (index 0)
180+
// Load IBM Plex Sans Bold + FontAwesome as the main UI font (index 0)
181181
float font_size = 30.0f;
182182
ImFontConfig font_cfg;
183183
font_cfg.FontDataOwnedByAtlas = false;
184-
io.Fonts->AddFontFromMemoryTTF((void*)embed_FiraCode_Bold_ttf, embed_FiraCode_Bold_ttf_len, font_size, &font_cfg);
184+
io.Fonts->AddFontFromMemoryTTF((void*)embed_IBMPlexSans_Bold_ttf, embed_IBMPlexSans_Bold_ttf_len, font_size, &font_cfg);
185185

186186
static const ImWchar icon_ranges[] = { 0xf000, 0xf8ff, 0 };
187187
float icon_size = font_size * 0.75f;
@@ -193,11 +193,16 @@ i32_t rfui_ui_init(nil_t) {
193193
icon_cfg.FontDataOwnedByAtlas = false;
194194
io.Fonts->AddFontFromMemoryTTF((void*)embed_fa_solid_900_otf, embed_fa_solid_900_otf_len, icon_size, &icon_cfg, icon_ranges);
195195

196-
// Large Fira Code for text/label widgets (index 1)
196+
// Large IBM Plex Sans for text/label widgets (index 1)
197197
float large_font_size = 64.0f;
198198
ImFontConfig large_cfg;
199199
large_cfg.FontDataOwnedByAtlas = false;
200-
io.Fonts->AddFontFromMemoryTTF((void*)embed_FiraCode_Bold_ttf, embed_FiraCode_Bold_ttf_len, large_font_size, &large_cfg);
200+
io.Fonts->AddFontFromMemoryTTF((void*)embed_IBMPlexSans_Bold_ttf, embed_IBMPlexSans_Bold_ttf_len, large_font_size, &large_cfg);
201+
202+
// Regular IBM Plex Sans for grid data cells (index 2)
203+
ImFontConfig regular_cfg;
204+
regular_cfg.FontDataOwnedByAtlas = false;
205+
io.Fonts->AddFontFromMemoryTTF((void*)embed_IBMPlexSans_Regular_ttf, embed_IBMPlexSans_Regular_ttf_len, font_size, &regular_cfg);
201206

202207
// Setup Platform/Renderer backends
203208
ImGui_ImplGlfw_InitForOpenGL(g_window, true);

0 commit comments

Comments
 (0)