term: use logical DPI+scale factor when scaling fonts

This fixes an issue where the fonts were rendered too small when the
output had fractional scaling.

For integral scaling, using the logical (scaled) DPI multiplied with
the scaling factor results in the same final DPI value as if we had
used the physical DPI.

But for fractional scaling, this works around the fact that the
compositor downscales the surface after we've rendered it.

Closes #5
This commit is contained in:
Daniel Eklöf 2020-03-11 16:10:55 +01:00
parent 5a89ac67eb
commit acecab1c8b
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 80 additions and 23 deletions

View file

@ -24,14 +24,39 @@ struct monitor {
int x;
int y;
int width_mm;
int height_mm;
struct {
/* Physical size, in mm */
struct {
int width;
int height;
} mm;
int width_px;
int height_px;
/* Physical size, in pixels */
struct {
int width;
int height;
} px_real;
int x_ppi;
int y_ppi;
/* Scaled size, in pixels */
struct {
int width;
int height;
} px_scaled;
} dim;
struct {
/* PPI, based on physical size */
struct {
int x;
int y;
} real;
/* PPI, logical, based on scaled size */
struct {
int x;
int y;
} scaled;
} ppi;
int scale;
float refresh;