svx/source/svdraw/svdpdf.cxx | 56 ++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 27 deletions(-)
New commits: commit 8688279b0ec882ee95e7dacbc45a757fe0fe0c6e Author: Caolán McNamara <[email protected]> AuthorDate: Mon Sep 29 20:48:06 2025 +0100 Commit: Miklos Vajna <[email protected]> CommitDate: Wed Oct 1 13:26:35 2025 +0200 Always create cidFontInfo, we will need it if we need to merge fonts Change-Id: I8ffc5efe0ade2d46e318df7ea8cc3352d7ad0fa2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191674 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index b59a1abbab8f..40e7adb7582c 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -1054,37 +1054,39 @@ static bool toPfaCID(SubSetInfo& rSubSetInfo, const OUString& fileUrl, } SAL_INFO("sd.filter", "details are: " << version << Notice << FullName << FamilyName << Weight << srcFontType << FontName); + + // Always create cidFontInfo, we will need it if we need to merge fonts + OString AdobeCopyright, Trademark; + sal_Int32 nSplit = !Notice.isEmpty() ? Notice.lastIndexOf('.', Notice.getLength() - 1) : -1; + if (nSplit != -1) + { + AdobeCopyright = Notice.copy(0, nSplit + 1); + Trademark = Notice.copy(nSplit + 1); + } + else + AdobeCopyright = Notice; + SvFileStream cidFontInfo(cidFontInfoUrl, StreamMode::READWRITE | StreamMode::TRUNC); + cidFontInfo.WriteLine(Concat2View("FontName (" + FontName + ")")); + cidFontInfo.WriteLine(Concat2View("FullName (" + FullName + ")")); + OString OutputFamilyName = FamilyName; + if (!isSimpleFamilyName(Weight)) + OutputFamilyName = OutputFamilyName + " " + Weight; + cidFontInfo.WriteLine(Concat2View("FamilyName (" + OutputFamilyName + ")")); + cidFontInfo.WriteLine(Concat2View("version (" + version + ")")); + cidFontInfo.WriteLine("Registry (Adobe)"); + cidFontInfo.WriteLine("Ordering (Identity)"); + cidFontInfo.WriteLine("Supplement 0"); + cidFontInfo.WriteLine("XUID [1 11 9273828]"); + cidFontInfo.WriteLine("FSType 4"); + cidFontInfo.WriteLine(Concat2View("AdobeCopyright (" + AdobeCopyright + ")")); + cidFontInfo.WriteLine(Concat2View("Trademark (" + Trademark + ")")); + cidFontInfo.Close(); + bNameKeyed = srcFontType.endsWith("(name-keyed)"); if (bNameKeyed) { - OString AdobeCopyright, Trademark; - sal_Int32 nSplit = Notice.lastIndexOf('.', Notice.getLength() - 1); - if (nSplit != -1) - { - AdobeCopyright = Notice.copy(0, nSplit + 1); - Trademark = Notice.copy(nSplit + 1); - } - else - AdobeCopyright = Notice; - SAL_WARN("sd.filter", "convert to cid keyed"); - SvFileStream cidFontInfo(cidFontInfoUrl, StreamMode::READWRITE | StreamMode::TRUNC); - cidFontInfo.WriteLine(Concat2View("FontName (" + FontName + ")")); - cidFontInfo.WriteLine(Concat2View("FullName (" + FullName + ")")); - OString OutputFamilyName = FamilyName; - if (!isSimpleFamilyName(Weight)) - OutputFamilyName = OutputFamilyName + " " + Weight; - cidFontInfo.WriteLine(Concat2View("FamilyName (" + OutputFamilyName + ")")); - cidFontInfo.WriteLine(Concat2View("version (" + version + ")")); - cidFontInfo.WriteLine("Registry (Adobe)"); - cidFontInfo.WriteLine("Ordering (Identity)"); - cidFontInfo.WriteLine("Supplement 0"); - cidFontInfo.WriteLine("XUID [1 11 9273828]"); - cidFontInfo.WriteLine("FSType 4"); - cidFontInfo.WriteLine(Concat2View("AdobeCopyright (" + AdobeCopyright + ")")); - cidFontInfo.WriteLine(Concat2View("Trademark (" + Trademark + ")")); - cidFontInfo.Close(); - + SAL_INFO("sd.filter", "convert to cid keyed"); SvFileStream nameToCIDMap(nameToCIDMapUrl, StreamMode::READWRITE | StreamMode::TRUNC); nameToCIDMap.WriteLine(Concat2View("mergefonts " + FontName + " 0")); for (const auto& glyph : glyphIndexToName)
