bmpblk: Derive text font size from screen height and SCALE_BASE
The font size of text bitmaps is calculated as "height / 2", where the
divisor 2 makes dpi 96 in boards.yaml roughly equivalent to the screen
resolution 1366x768 with SCALE_BASE 1000. The divisor implicitly
depends on SCALE_BASE, so changing SCALE_BASE would change the meaning
of the dpi values in boards.yaml.
Write the formula explicitly in terms of SCALE_BASE, the reference
screen height 768 at dpi 96, and the line height ratio of the default
font (Roboto), so that the dpi values keep their meaning when SCALE_BASE
changes. With SCALE_BASE 1000, the font size changes from "height / 2"
to "height / 2.03", which is negligible.
Also pass the font size instead of the height to run_pango_view(),
because the height is only used to calculate the font size.
BUG=b:551743258
BRANCH=none
TEST=LOCALES=en BOARD=asurada make
TAG=agy
CONV=4d411a1c-369f-4fd3-ac8a-7bd726afa3b5
Change-Id: I67f70083fb59bad1c2756303e3722f657089bc4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/bmpblk/+/8499254
Tested-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org>
Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
GitOrigin-RevId: 48b9b72198ce8fcdbf83afbaeaa7a20aa9fda20d
1 file changed
tree: ca7622ac40f31edd27cfb2dc7d71c61ddda15edb
-
bmpblk/