eaburns / eaburns/T

ui: fonts are scaled down

Open
#23 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
10
Forks
2
PR merge metrics
No merged PRs in 30d

Description

With the default settings, I have very tiny font size on windows.
It's about 6 pixels height (for the `defaultFontSize` of 11).

Shiny's size event reports 1 PixelPerPt.
main.go creates a Win with `dpi: float32(e.PixelsPerPt) * 72.0`

truetype.NewFace also scales with 72: `scale: fixed.Int26_6(0.5 + (opts.size() * opts.dpi() * 64 / 72))`

Why does `ui.NewWin(dpi float32)` call NewFace with a DPI scaled down by 72/96?
```
face := truetype.NewFace(defaultFont, &truetype.Options{
Size: float64(defaultFontSize),
DPI: float64(dpi * (72.0 / 96.0)),
})
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in main.go at the Win creation and follow the dpi value into ui.NewWin and its truetype.NewFace call. Compare Shiny's PixelsPerPt with the DPI passed to the font options; done means the default Windows font is no longer rendered at the reported tiny size.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.