From 1e0bc03d9e50ea4d69e08fdbb0a85e56203299f2 Mon Sep 17 00:00:00 2001 From: Masamichi Hosoda Date: Wed, 26 Oct 2016 20:56:49 +0900 Subject: [PATCH] Issue 4989/1: Fix Type1 (PFA) font embedding Type1 (PFA) fonts can contain '\0'. e.g. URW++ June 2016 (Ghostscript 9.20) In order to avoid problems with '\0', this commit makes to use the file length instead of zero-terminated string. --- lily/pfb-scheme.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lily/pfb-scheme.cc b/lily/pfb-scheme.cc index e718a13bf0..0f96d63fb6 100644 --- a/lily/pfb-scheme.cc +++ b/lily/pfb-scheme.cc @@ -33,8 +33,8 @@ LY_DEFINE (ly_type1_2_pfa, "ly:type1->pfa", else { /* The file is in PFA format. Pass it through. */ - type1_string.push_back(0); - pfa_scm = scm_from_latin1_string (&type1_string[0]); + pfa_scm = scm_from_latin1_stringn (&type1_string[0], + type1_string.size ()); } debug_output ("]", false); -- 2.39.2