From e784b3314b61f8dfb65e21cd04d7b0ff53251ce1 Mon Sep 17 00:00:00 2001 From: Chris Liddell Date: Thu, 23 Jun 2022 15:36:36 +0100 Subject: Change how pdfi interacts with FAPI for Truetype fonts In PDF, only symbolic Truetype fonts draw marks from the glyph at GID zero (the TTF notdef). But the default TTF notdef is an empty rectangle, rather than the Postscript style non-marking glyph. The FAPI/Freetype incremental interface integration includes code to spot that case, and return an empty glyph. Since PDFs don't do incremental font definitions, the pdfi code simply passed the TTF into FAPI, and onto Freetype as a complete font, so all the glyph lookups were handled inside Freetype, not using the incremental interface. Thus we lost the ability to do that "filtering". Equally, we don't want to take the time to break down the font and "reassemble" it as the Postscript interpreter is forced to do. This implements a hybrid approach where we still pass the font data unchanged into Freetype, but we still use the incremental interface, allowing that notdef filtering to happen. This commit affects a heuristic in freetype which autmatically enables autohinting, meaning we'll no longer get autohinting in cases where we previously did. That gives a perceived drop in quality at low resolutions. Since autohinting can be enabled at the command line, it's not a serious concern. --- xps/xpsfapi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xps') diff --git a/xps/xpsfapi.c b/xps/xpsfapi.c index 5d8ae533a..88feff3c0 100644 --- a/xps/xpsfapi.c +++ b/xps/xpsfapi.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2021 Artifex Software, Inc. +/* Copyright (C) 2001-2022 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -84,6 +84,7 @@ static const gs_fapi_font pl_ff_stub = { NULL, /* get_raw_subr */ xps_fapi_get_glyph, /* get_glyph */ xps_fapi_serialize_tt_font, /* serialize_tt_font */ + NULL, /* retrieve_tt_font */ NULL, /* get_charstring */ NULL, /* get_charstring_name */ xps_get_glyphdirectory_data, /* get_GlyphDirectory_data_ptr */ -- cgit v1.2.1