added support for font definitions with different character offset and size
[rocksndiamonds.git] / src / libgame / text.c
index c8e90d116f47b462d37d585f4a165e71fc8f6dc7..e7765fc68282ee2582894df215a379548ececc2c 100644 (file)
@@ -103,8 +103,8 @@ void getFontCharSource(int font_nr, char c, Bitmap **bitmap, int *x, int *y)
   int font_pos = getFontCharPosition(font_nr, c);
 
   *bitmap = font->bitmap;
-  *x = font->src_x + (font_pos % font->num_chars_per_line) * font->width;
-  *y = font->src_y + (font_pos / font->num_chars_per_line) * font->height;
+  *x = font->src_x + (font_pos % font->num_chars_per_line) * font->offset_x;
+  *y = font->src_y + (font_pos / font->num_chars_per_line) * font->offset_y;
 }