text: font: replace x/y offsets with baseline attribute
authorDavid Herrmann <dh.herrmann@googlemail.com>
Mon, 30 Jul 2012 15:42:21 +0000 (17:42 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Mon, 30 Jul 2012 15:42:21 +0000 (17:42 +0200)
When rendering underlines we need the baseline attribute. Therefore,
replace the unused x/y offsets with a baseline attribute.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/text.h
src/text_font_8x16.c

index 01108a1..6b90f63 100644 (file)
@@ -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;
 };
 
index 8cf0344..2bc37e1 100644 (file)
@@ -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;
 }