Skip to content

Comment on Capy – Cross-platform library for making native GUIs in Zig

Comments

Very nice!

My only issue is with using literal pixels. With screens that have 3x-4x difference in DPI in wide use, it's easy to shoot oneself in the foot and make a GUI that looks indiscernible on a retina screen, or colossal on a low-end laptop screen.

I hope this will be addressed in a future version (and that there'll be more future versions! and wide adoption!)

It's already handled, each Window has a `source_dpi` which is the DPI for which the layout was made, and depending on that and the monitor's DPI, Capy will habdle the scaling.

Many (maybe all?) native UI environments have a concept like a “logical pixel” which is scaled appropriately. I don’t know how much this project avails itself of those, but I did see that the web/WASM implementation uses `px` which in CSS is such a “logical pixel”. That has other issues on web of course, but I’d generally expect such a project to degrade on web because the native “UI” is very low level and unopinionated.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.