summaryrefslogtreecommitdiff
path: root/pdf
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2023-02-08 16:57:02 +0000
committerRobin Watts <Robin.Watts@artifex.com>2023-02-09 09:59:41 +0000
commit83fdfdac1b730c3183eadf04f4e705e34078e4e5 (patch)
tree1f544f6e27146c0ab85afbe7db6abcc83c3b2e6f /pdf
parenta24b9624bf31e39df2a16d0d71d783accb155277 (diff)
downloadghostpdl-83fdfdac1b730c3183eadf04f4e705e34078e4e5.tar.gz
GhostPDF - fix type 3 font 'd0' arguments
Bug #706400 "Type 3 CharProcs with wy == 0 argument to d0 not drawn" The width array argument was being initialised incorrectly due to copy/paste errors. We were copying the second argument to both array elements. If the second argument was 0 (which the PDF Reference states it must be) then we would end up drawing a glyph with 0 width and height and so would not draw it at all. Fix that, and get the elements in the correct order. This shows some tiny (1 pixel) alignment shifts in type 3 characters in a couple of files.
Diffstat (limited to 'pdf')
-rw-r--r--pdf/pdf_font.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pdf/pdf_font.c b/pdf/pdf_font.c
index 1d3c1e97d..b6409d483 100644
--- a/pdf/pdf_font.c
+++ b/pdf/pdf_font.c
@@ -1313,11 +1313,11 @@ int pdfi_d0(pdf_context *ctx)
goto d0_error;
}
- if (pdfi_type_of(ctx->stack_top[-1]) == PDF_INT)
- width[0] = (double)((pdf_num *)ctx->stack_top[-1])->value.i;
- else
- width[0] = ((pdf_num *)ctx->stack_top[-1])->value.d;
if (pdfi_type_of(ctx->stack_top[-2]) == PDF_INT)
+ width[0] = (double)((pdf_num *)ctx->stack_top[-2])->value.i;
+ else
+ width[0] = ((pdf_num *)ctx->stack_top[-2])->value.d;
+ if (pdfi_type_of(ctx->stack_top[-1]) == PDF_INT)
width[1] = (double)((pdf_num *)ctx->stack_top[-1])->value.i;
else
width[1] = ((pdf_num *)ctx->stack_top[-1])->value.d;