diff options
author | Mattias Andrée <maandree@kth.se> | 2020-04-26 18:02:41 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2020-04-26 18:02:41 +0200 |
commit | 26203066cb324a6c4bb8e14ae4198d0ae21b4276 (patch) | |
tree | e9a1c24da7271ef714c8bceb403e3b71fb05b510 | |
parent | Add autohinting and autokerning renders flags and prepare for fallback fonts (diff) | |
download | libskrift-26203066cb324a6c4bb8e14ae4198d0ae21b4276.tar.gz libskrift-26203066cb324a6c4bb8e14ae4198d0ae21b4276.tar.bz2 libskrift-26203066cb324a6c4bb8e14ae4198d0ae21b4276.tar.xz |
libskrift_merge_glyphs: support any pixel encoding
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | libskrift_merge_glyphs.c | 8 |
2 files changed, 6 insertions, 4 deletions
@@ -1,4 +1,4 @@ -\#*\# +*\#* *~ *.o *.a diff --git a/libskrift_merge_glyphs.c b/libskrift_merge_glyphs.c index 548e8fb..76ddb6b 100644 --- a/libskrift_merge_glyphs.c +++ b/libskrift_merge_glyphs.c @@ -8,11 +8,12 @@ libskrift_merge_glyphs(LIBSKRIFT_CONTEXT *ctx, struct libskrift_glyph *glyph1, struct libskrift_glyph *glyph2, struct libskrift_glyph **glyphp) { int16_t x1a, x1b, x2a, x2b, y1a, y1b, y2a, y2b, x1, x2, y1, y2; - size_t width, height, r, c, size = 1, psize = 1; + size_t width, height, r, c, size, psize; size_t src_off, dest_off, src_linesize, dest_linesize; - if (ctx->rendering.smoothing == LIBSKRIFT_SUBPIXEL) - size = psize = 3; + (void) ctx; + + psize = glyph1->size / ((size_t)glyph1->width * (size_t)glyph1->height); x1a = glyph1->x; x1b = glyph2->x; @@ -29,6 +30,7 @@ libskrift_merge_glyphs(LIBSKRIFT_CONTEXT *ctx, struct libskrift_glyph *glyph1, x2 = MAX(x2a, x2b); y2 = MAX(y2a, y2b); + size = psize; size *= width = (uint16_t)(x2 - x1); size *= height = (uint16_t)(y2 - y1); |