From 36938b59d7a683ea9d4b387adb88b28d507a0902 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Mon, 30 Jul 2012 17:42:21 +0200 Subject: [PATCH] text: font: replace x/y offsets with baseline attribute When rendering underlines we need the baseline attribute. Therefore, replace the unused x/y offsets with a baseline attribute. Signed-off-by: David Herrmann --- src/text.h | 3 +-- src/text_font_8x16.c | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/text.h b/src/text.h index 01108a1..6b90f63 100644 --- a/src/text.h +++ b/src/text.h @@ -70,8 +70,6 @@ bool kmscon_font_attr_match(const struct kmscon_font_attr *a1, struct kmscon_glyph { unsigned int ascent; unsigned int descent; - unsigned int xoff; - unsigned int yoff; struct uterm_video_buffer buf; }; @@ -79,6 +77,7 @@ struct kmscon_font { unsigned long ref; const struct kmscon_font_ops *ops; struct kmscon_font_attr attr; + unsigned int baseline; void *data; }; diff --git a/src/text_font_8x16.c b/src/text_font_8x16.c index 8cf0344..2bc37e1 100644 --- a/src/text_font_8x16.c +++ b/src/text_font_8x16.c @@ -71,6 +71,7 @@ static int kmscon_font_8x16_init(struct kmscon_font *out, out->attr.width = 8; out->attr.height = 16; kmscon_font_attr_normalize(&out->attr); + out->baseline = 4; return 0; }