summaryrefslogtreecommitdiff
path: root/genfontfile.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-12-18 13:30:19 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-12-18 13:30:19 +0100
commitf5fc989ac713bac5cad8b48b4359b5027757c1ce (patch)
tree40e00dc98aea3656ff23a4b8ea190f69290a44b2 /genfontfile.c
parent9bbcf23a86d9373eb1f0ecbd039636b1375b8a61 (diff)
downloadvdr-f5fc989ac713bac5cad8b48b4359b5027757c1ce.tar.gz
vdr-f5fc989ac713bac5cad8b48b4359b5027757c1ce.tar.bz2
Fixed genfontfile.c (wrong width, shifted values)
Diffstat (limited to 'genfontfile.c')
-rw-r--r--genfontfile.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/genfontfile.c b/genfontfile.c
index bc171cf2..af45ad5d 100644
--- a/genfontfile.c
+++ b/genfontfile.c
@@ -240,7 +240,7 @@ printGlyph(FontInfoPtr font, int c)
{
PerGlyphInfoPtr glyph;
unsigned char *bitmapData;
- int width, height, spanLength;
+ int width, height, spanLength, charWidth;
int x, y, l;
char buf[1000], *b;
@@ -253,12 +253,15 @@ printGlyph(FontInfoPtr font, int c)
width = glyph->width;
spanLength = (width + 7) / 8;
height = glyph->height;
+ charWidth = glyph->xoffset + width;
+ if (charWidth < glyph->advance)
+ charWidth = glyph->advance;
printf(" { // %d\n", c);
- printf(" %d, %d,\n", glyph->advance, font->max_ascent + font->max_descent);
+ printf(" %d, %d,\n", charWidth, font->max_ascent + font->max_descent);
for (y = 0; y < font->max_ascent - glyph->yoffset - height; y++) {
printf(" 0x%08X, // ", 0);
- for (x = 0; x < glyph->xoffset + width || x < glyph->advance; x++)
+ for (x = 0; x < charWidth; x++)
putchar('.');
putchar('\n');
}
@@ -269,13 +272,13 @@ printGlyph(FontInfoPtr font, int c)
*b++ = '.';
if (bitmapData) {
for (x = 0; x < width; x++) {
+ l <<= 1;
if (bitmapData[y * spanLength + x / 8] & (1 << (x & 7))) {
*b++ = '*';
l |= 1;
}
else
*b++ = '.';
- l <<= 1;
}
for (x = 0; x < glyph->advance - width - glyph->xoffset; x++) {
*b++ = '.';