Skip to content
Snippets Groups Projects
Commit 351338fc authored by deuce's avatar deuce
Browse files

Fix font loading issues.

parent cbc24872
No related branches found
No related tags found
No related merge requests found
......@@ -1324,18 +1324,19 @@ load_font(char *filename, int width, int height, int scale)
}
FW = width;
FH = height;
memcpy(fontdata, font, height*256);
/* Swap bit order... leftmost bit is most significant, X11 wants it the
* other way. */
for(i=0; i<256; i++) {
for(j=0; j<height; j++) {
font[i*height+j]= ((font[i*height+j] & 0x80) >> 7)
| ((font[i*height+j] & 0x40) >> 5)
| ((font[i*height+j] & 0x20) >> 3)
| ((font[i*height+j] & 0x10) >> 1)
| ((font[i*height+j] & 0x08) << 1)
| ((font[i*height+j] & 0x04) << 3)
| ((font[i*height+j] & 0x02) << 5)
| ((font[i*height+j] & 0x01) << 7);
fontdata[i*height+j]= ((fontdata[i*height+j] & 0x80) >> 7)
| ((fontdata[i*height+j] & 0x40) >> 5)
| ((fontdata[i*height+j] & 0x20) >> 3)
| ((fontdata[i*height+j] & 0x10) >> 1)
| ((fontdata[i*height+j] & 0x08) << 1)
| ((fontdata[i*height+j] & 0x04) << 3)
| ((fontdata[i*height+j] & 0x02) << 5)
| ((fontdata[i*height+j] & 0x01) << 7);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment