I tested that in Design panel the Height and Width "pixels" options are not in pixels (px) but in dp. I did not check every control but for layouts and buttons are in dp. I am writing a simple screen test program to check if it is true for every other control, in this case at least "pixels" should be changed in "dp" but I would prefer to add one more option so that we could choose between pixels, dp and percentage. Instead, for texts/fonts the size seems to be in sp. I checked with my smartphones and others and everything is right, to acquire the phones screen data I used the "my device" app and I checked its data with AI2 measurements. To convert dp to pixels: px = dp * density you can read density from "my device" or assume: density = dpi / 160 and read dpi from "my device" (the 1st dpi data).
My phone example:
Xiaomi POCO M2103K19PG:
screen res: 2167 x 1080 px
6.5"
440 dpi
density=2.75
font scale=1.00
Data returned by AI2:
screen width = 392 -> 392*2.75 = 1078
screen height = 788 * 2.75 = 2167
We'd have to really think that through. I think it makes perfect sense to have font size be sp and other pixels sizes be dp. sp scales with user-controllable settings such as system-wide font size, so it makes little sense to have font be anything else (read more here). Regarding dp, recall that App Inventor is intended for educational use, and imagine how complicated a classroom experience might be if everyone tries to follow a tutorial and due to the mix of device screen densities in the room get wildly different UI layouts. By keeping the pixels relatively sized based on density it alleviates those headaches. Changing the semantics to be raw pixels likely would break most existing apps, so there would need to be some other mechanism to do measurements in terms of raw pixels.