diff options
Diffstat (limited to '')
-rw-r--r-- | libskrift_merge_glyphs.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libskrift_merge_glyphs.c b/libskrift_merge_glyphs.c index 6c62fc8..4df6f7a 100644 --- a/libskrift_merge_glyphs.c +++ b/libskrift_merge_glyphs.c @@ -10,9 +10,24 @@ libskrift_merge_glyphs(LIBSKRIFT_CONTEXT *ctx, const struct libskrift_glyph *gly int16_t x1a, x1b, x2a, x2b, y1a, y1b, y2a, y2b, x1, x2, y1, y2; size_t width, height, r, c, size, psize; size_t src_off, dest_off, src_linesize, dest_linesize; + const struct libskrift_glyph *t; psize = ctx->rendering.smoothing ? 3 : 1; + if (!(glyph1->width | glyph1->height)) { + t = glyph1; + glyph1 = glyph2; + glyph2 = t; + } + if (!(glyph2->width | glyph2->height)) { + size = offsetof(struct libskrift_glyph, image) + glyph1->size; + *glyphp = calloc(1, size); + if (!*glyphp) + return -1; + memcpy(*glyphp, glyph1, size); + return 0; + } + x1a = glyph1->x; x1b = glyph2->x; y1a = glyph1->y; |