Skip to content

Commit f633db3

Browse files
committed
im.font_size()
1 parent c93ac00 commit f633db3

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

dev/src/imbind.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,22 @@ nfr("font_end", "", "", "",
14211421
NPop(vm, N_FONT);
14221422
});
14231423

1424+
nfr("font_size_start", "size", "F", "",
1425+
"(use im.font instead)",
1426+
[](StackPtr &sp, VM &vm) {
1427+
IsInit(vm);
1428+
auto f = Pop(sp).fltval();
1429+
ImGui::PushFont(nullptr, f);
1430+
NPush(N_FONT);
1431+
});
1432+
1433+
nfr("font_size_end", "", "", "",
1434+
"",
1435+
[](StackPtr &, VM &vm) {
1436+
IsInit(vm);
1437+
NPop(vm, N_FONT);
1438+
});
1439+
14241440
nfr("color_start", "color", "F}:4", "",
14251441
"(use im.color instead)",
14261442
[](StackPtr &sp, VM &vm) {

modules/imgui.lobster

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,11 @@ def font(font_idx, body):
440440
body()
441441
font_end()
442442

443+
def font_size(size, body):
444+
font_size_start(size)
445+
body()
446+
font_size_end()
447+
443448
def color(col, body):
444449
color_start(col)
445450
body()

0 commit comments

Comments
 (0)