From dc4bf27b1f6f6db5508f385e30f934bd689c94f0 Mon Sep 17 00:00:00 2001 From: Ken Sharp Date: Tue, 10 Jan 2023 11:54:41 +0000 Subject: GhostPDF - set some default values for type 1 fonts Bug #705872 see comment #4 Although Firefox is wrong to state that an ExpansionFactor of 0 is 'bad' it still isn't what it should be in fact. If the font doesn't have an ExpansionFactor then we should write the default. The same applies to BlueShift and BlueFuzz. Ideally we should also write default values for UnderlinePosition and UnderlineThickness, but I can't see an obvious way to do that, they are not in the same structure. --- pdf/pdf_font1.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pdf/pdf_font1.c b/pdf/pdf_font1.c index 74b7963a8..9ef8b18e0 100644 --- a/pdf/pdf_font1.c +++ b/pdf/pdf_font1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2019-2022 Artifex Software, Inc. +/* Copyright (C) 2019-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -540,6 +540,9 @@ pdfi_read_type1_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dic if (code >= 0) { fpriv.gsu.gst1.data.lenIV = 4; + fpriv.gsu.gst1.data.ExpansionFactor = 0.06; + fpriv.gsu.gst1.data.BlueShift = 7; + fpriv.gsu.gst1.data.BlueFuzz = 1; code = pdfi_read_ps_font(ctx, font_dict, fbuf, fbuflen, &fpriv); gs_free_object(ctx->memory, fbuf, "pdfi_read_type1_font"); -- cgit v1.2.1