diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-01-07 16:17:17 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-01-11 08:31:08 +0000 |
| commit | 5ea37adaf407c63d8915a0ace2437bce46cf06cc (patch) | |
| tree | e5542ce664838b53db006d64e8488cf6b9c77020 | |
| parent | doc: foot.ini: line-height, letter-spacing and offsets are in points (by default) (diff) | |
term: add pt_or_px_as_pixels()
This function takes a ‘union pt_or_px’ and converts its value to a
pixel value.
| -rw-r--r-- | terminal.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -608,6 +608,15 @@ err_sem_destroy: return false; } +static int +pt_or_px_as_pixels(const struct terminal *term, + const union pt_or_px *pt_or_px) +{ + return pt_or_px->px == 0 + ? pt_or_px->pt * term->font_dpi / 72 + : pt_or_px->px; +} + static bool term_set_fonts(struct terminal *term, struct fcft_font *fonts[static 4]) { |
