diff options
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | demo.c | 7 | ||||
-rw-r--r-- | libskrift_create_context.c | 1 | ||||
-rw-r--r-- | libskrift_draw_text.c | 4 |
4 files changed, 8 insertions, 8 deletions
@@ -38,6 +38,8 @@ Currently implemented: Affine transformations on glyphs and texts. + Inter-character spacing. + Not implemented yet @@ -53,8 +55,6 @@ Not implemented yet Vertical text. - Inter-character spacing. - Text shaping. Font searching. @@ -15,9 +15,10 @@ main(void) double height; size_t size, i; - rendering.smoothing = LIBSKRIFT_SUBPIXEL; - rendering.subpixel_order = LIBSKRIFT_NONE; - rendering.flags = LIBSKRIFT_MIRROR_CHARS * 0; + rendering.smoothing = LIBSKRIFT_SUBPIXEL; + rendering.subpixel_order = LIBSKRIFT_NONE; + rendering.flags = LIBSKRIFT_MIRROR_CHARS * 0; + rendering.interletter_spacing = -5; if (libskrift_open_font_file(&font, DEMO_FONT)) { perror("libskrift_open_font_file"); diff --git a/libskrift_create_context.c b/libskrift_create_context.c index f034240..c1732c0 100644 --- a/libskrift_create_context.c +++ b/libskrift_create_context.c @@ -103,7 +103,6 @@ libskrift_create_context(LIBSKRIFT_CONTEXT **ctxp, LIBSKRIFT_FONT **fonts, size_ (*ctxp)->rendering.flags |= LIBSKRIFT_REMOVE_GAMMA; /* libschrift does not add gamma */ (*ctxp)->rendering.grid_fineness = 1; (*ctxp)->rendering.kerning = 0; - (*ctxp)->rendering.interletter_spacing = 0; if (!(*ctxp)->rendering.smoothing) (*ctxp)->rendering.smoothing = LIBSKRIFT_GREYSCALE; diff --git a/libskrift_draw_text.c b/libskrift_draw_text.c index 95fd523..05f278c 100644 --- a/libskrift_draw_text.c +++ b/libskrift_draw_text.c @@ -17,8 +17,8 @@ libskrift_draw_text(LIBSKRIFT_CONTEXT *ctx, const char *text, const struct libsk return -1; r = libskrift_apply_glyph(ctx, glyph, colour, x, y, image); - xpos += glyph->advance * ctx->x_advancement; - ypos += glyph->advance * ctx->y_advancement; + xpos += (glyph->advance + ctx->rendering.interletter_spacing) * ctx->x_advancement; + ypos += (glyph->advance + ctx->rendering.interletter_spacing) * ctx->y_advancement; free(glyph); if (r) return -1; |