I was just looking up the definition of pixel coordinates for the flutter framework. You specify sizes in logical pixels. There are 96 logical pixels in an inch, which translates to roughly 38 pixels per cm.
This seems like a very odd number. I mean, using inches as unit of length is already slightly strange to a European, but since the framework is developed by an American company, that makes sense at least. But still: Why not have 100 logical pixels per inch? That would make all conversions so much easier.
I looked this up and the official term is Device Independent Pixel. Windows has been using 96 pixels per inch as well (now this is exposed as a scaling setting), while Android is based on 160 pixels per inch. iOS expects you to specify sizes in UIKit pixels, where the conversion to actual physical lengths depends on the specific device. They can probably get away with it because iOS runs on a limited number of devices, but it does look confusing already.
What is the reason behind this? Is it historical, based on some typesetting conventions, or does it have advantages when you calculate the layout of your design?
Maybe this number was chosen because 96 = 3 * 2^5
.
So it's close to 100, divisible by 3 and the other divisors are 2. That seems useful.