Please stop calling this DPI scaling. DPI is “dot per inches”. It depends on one single thing, the physical size of the pixels, and it can’t be scaled in any way. Call it “GUI scaling” or whatever.
Anyway for implementing this:
- We aleady have settings for font size, and Tracker icon sizes. Font sizes are in “points” for which there is not really a precise definition, so we can consider it an arbitrary unit. Tracker icon sizes are currently in pixels, and if there is extra scaling it would not actually be pixels anymore. Maybe we could rename the settings to “small, medium, large, huge” or similar.
- For the actual implementation: the drawing API has a SetScale and a SetTransform, both of which can be used to change the drawing size of everything. The idea would be to do this automatically when a view is created, and set a global scale (so, it’s a little more work than adding a slider to the Appearance prefs).
- After doing this, expect to discover bugs because of interactions with other drawing primitives: saving to BPicture, applying more transforms, or using Clipping are likely to miss something and result in broken drawing.
An alternative to this approach (global scaling, similar to what macOS does), is to instead change just the font size (in Appearance prefs) and then make sure all apps properly scale their whole UI according to that. So if there is a large font, apps would also use larger icons, etc. This requires more work (as each app needs to be tweaked), but it is possibly simpler (no need to mess with the app_server drawing, transforms and clipping and stuff).