From 4db9046e56c884a350fa2c5087f8d5b8110463c4 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Mon, 19 Jun 2017 17:07:40 -0400 Subject: Add heuristic for improving text rendering in CPDF_CharPosList::Load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL uses the following algorithm for improving substitute font spacing (we are assuming the text layout is horizontal): * Calculate PDFWidth, the width that the PDF says the glyph should have. * Calculate FTWidth, the width calculated by freetype for the glyph, using the substitute font that we'll use to render it. Note that some embedded fonts have PDFWidth == FTWidth + 1, so we consider that to be matching widths. * If PDFWidth > FTWidth + 1 , move the x coordinate by the difference / 2 so that the glyph is rendered in a more centered spot and the text looks better. * If PDFWidth < FTWidth, transform the glyph horizontally by PDFWidth / FTWidth so that the glyph gets compressed and does not overlap with surrounding glyphs. Bug: chromium:431507 Change-Id: Ia378344253fabe44d93af4daab98bb3b7bca22de Reviewed-on: https://pdfium-review.googlesource.com/6630 Reviewed-by: Lei Zhang Commit-Queue: Nicolás Peña --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'DEPS') diff --git a/DEPS b/DEPS index 7cecfe542e..67159e016c 100644 --- a/DEPS +++ b/DEPS @@ -19,7 +19,7 @@ vars = { 'jinja2_revision': 'd34383206fa42d52faa10bb9931d6d538f3a57e0', 'jpeg_turbo_revision': '7260e4d8b8e1e40b17f03fafdf1cd83296900f76', 'markupsafe_revision': '8f45f5cfa0009d2a70589bcda0349b8cb2b72783', - 'pdfium_tests_revision': '5379e0a6580443318c8192cdfc78a76e880ca3f6', + 'pdfium_tests_revision': '692df048179862d2e2eae2492e33a4673debe8bc', 'skia_revision': 'bb581ce30f55360fd3a12e7f5aa1fe324b16d085', 'tools_memory_revision': '427f10475e1a8d72424c29d00bf689122b738e5d', 'trace_event_revision': '06294c8a4a6f744ef284cd63cfe54dbf61eea290', -- cgit v1.2.3