aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--demo.c2
-rw-r--r--libskrift.h3
-rw-r--r--libskrift_apply_glyph.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/demo.c b/demo.c
index e7d4eec..7673314 100644
--- a/demo.c
+++ b/demo.c
@@ -307,7 +307,7 @@ main(int argc, char *argv[])
{
LIBSKRIFT_FONT *font;
LIBSKRIFT_CONTEXT *ctx;
- struct libskrift_image image = {LIBSKRIFT_R8G8B8A8, LIBSKRIFT_BE_SUBPIXEL, 0, 800, 600, NULL, NULL, NULL};
+ struct libskrift_image image = {LIBSKRIFT_R8G8B8A8, LIBSKRIFT_BE_SUBPIXEL, 0, 800, 600, 0, NULL, NULL, NULL};
struct libskrift_rendering rendering = LIBSKRIFT_DEFAULT_RENDERING;
struct libskrift_colour colour;
const char *font_file = DEMO_FONT;
diff --git a/libskrift.h b/libskrift.h
index 4873d7d..4c8cd25 100644
--- a/libskrift.h
+++ b/libskrift.h
@@ -145,12 +145,13 @@ struct libskrift_saved_grapheme {
size_t len;
};
-struct libskrift_image { /* TODO need horizontal blanking */
+struct libskrift_image {
enum libskrift_format format;
enum libskrift_endian endian;
int premultiplied;
uint16_t width;
uint16_t height;
+ size_t hblanking;
void (*preprocess)(struct libskrift_image *image, size_t x, size_t y, size_t width, size_t height);
void (*postprocess)(struct libskrift_image *image, size_t x, size_t y, size_t width, size_t height);
void *image;
diff --git a/libskrift_apply_glyph.c b/libskrift_apply_glyph.c
index 3fc3fc5..6e61732 100644
--- a/libskrift_apply_glyph.c
+++ b/libskrift_apply_glyph.c
@@ -99,7 +99,7 @@ libskrift_apply_glyph(LIBSKRIFT_CONTEXT *ctx, const struct libskrift_glyph *glyp
endc = (uint16_t)((int16_t)x2 - sx1);
endr = (uint16_t)((int16_t)y2 - sy1);
- img_linesize = (size_t)image->width * psize;
+ img_linesize = (size_t)image->width * psize + image->hblanking;
img_start += (size_t)y1 * img_linesize;
img_start += (size_t)x1 * psize;