Skip to content

Commit 0d2928b

Browse files
committed
individual font scale
1 parent 7bfffa1 commit 0d2928b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

app.ahk

+10-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ if (A_IsCompiled) {
2727
MonitorGet(1, &Left, &Top, &Right, &Bottom)
2828
DPIScale := A_ScreenDPI / 96
2929
DPIScaled(n) {
30-
return Round(n*DPIScale)
30+
return Round(n * DPIScale)
31+
}
32+
DPIScaledFont(n) {
33+
return Round(n * (DPIScale ** 0.5))
3134
}
3235
Screen_Height := Bottom - Top
3336
Screen_Width := Right - Left
@@ -73,7 +76,7 @@ if A_IsCompiled {
7376
mygui.Add("Picture", debugBorder "x" DPIScaled(10) " y" DPIScaled(10) " h" DPIScaled(30) " w-1 Section", "app_title.png")
7477
}
7578

76-
mygui.SetFont("s" DPIScaled(8) " Q5 bold", "Comic Sans MS")
79+
mygui.SetFont("s" DPIScaledFont(8) " Q5 bold", "Comic Sans MS")
7780
swapbtn := mygui.Add("Button", "xs y+5 h" DPIScaled(22) " w" DPIScaled(90), 'SWAP(s)')
7881
swapbtn.OnEvent("Click", swap)
7982

@@ -82,6 +85,10 @@ autoCenterSwitch.OnEvent("Click", autoPosSwitch_cb)
8285
backgroundSwitch := mygui.Add("Checkbox", debugBorder "x+10 yp hp " runbackgroud_default_check, 'Runs in background')
8386
backgroundSwitch.OnEvent("Click", backgroundSwitch_cb)
8487

88+
mygui.SetFont("s" DPIScaledFont(10) " Q5 norm", "Comic Sans MS")
89+
mygui.Add("Text", "Section xs y+0 h" DPIScaled(12), 'Current:')
90+
mygui.Add("Text", "xs y+0 hp wp", 'EXIF:')
91+
8592
txt_indicator := mygui.Add("Text", debugBorder "x+10 ys hp w" DPIScaled(360), 'NULL')
8693
txt_indicator.SetFont("cTeal bold")
8794

@@ -93,7 +100,7 @@ pic := mygui.Add("Picture", "x10 y+0 w" DPIScaled(500) " h" DPIScaled(400) " 0xE
93100
pic.OnEvent("Click", pic_on_click)
94101
pic.OnEvent("DoubleClick", pic_on_click)
95102

96-
mygui.SetFont("s" DPIScaled(8) " Q5 Norm", "Comic Sans MS")
103+
mygui.SetFont("s" DPIScaledFont(8) " Q5 Norm", "Comic Sans MS")
97104
info := Array()
98105
info.Push(mygui.Add("Text", debugBorder "x" DPIScaled(420) " y" DPIScaled(12) " h0", "v" . version))
99106
info.Push(mygui.Add("Link", debugBorder "xp y+0 hp", 'bilibili: <a href="https://space.bilibili.com/895523">TecNico</a>'))

0 commit comments

Comments
 (0)