bin/find-can-be-private-symbols.functions.results | 2 - bin/find-mergedlib-can-be-private-symbols.functions.results | 2 - include/vcl/embeddedfontsmanager.hxx | 6 ++--- svx/source/inc/svdpdf.hxx | 13 ++++++++++++ svx/source/svdraw/svdpdf.cxx | 8 +++---- vcl/source/gdi/embeddedfontsmanager.cxx | 6 ++--- 6 files changed, 25 insertions(+), 12 deletions(-)
New commits: commit 90b35d2293f7e88e17472ea6c9316e3da30f8995 Author: Caolán McNamara <[email protected]> AuthorDate: Mon Sep 29 10:26:10 2025 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Tue Oct 14 20:36:44 2025 +0200 add some info about what the structs are for Change-Id: Idb6e48641e80d6ed4efe2b72aa516765efaf09b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191603 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit c77a08175d777cf92b413fbbd25834e6f2928c4a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192342 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/svx/source/inc/svdpdf.hxx b/svx/source/inc/svdpdf.hxx index a1cca4a07373..c506f096b2c1 100644 --- a/svx/source/inc/svdpdf.hxx +++ b/svx/source/inc/svdpdf.hxx @@ -44,21 +44,32 @@ class SdrModel; class SdrObject; class SvdProgressInfo; +// Fonts are typically saved in pdf files as multiple subsets. +// This describes a single font subset: struct FontSubSet { + // The location of a file containing the dumped info about the font OUString cidFontInfoUrl; + // The location of a 'mergefile' derived from glyphToChars/charsToGlyph + // that indicates what positions the glyphs of this font should go in + // a final font merged from multiple subsets OUString toMergedMapUrl; + // The location of the extracted font, converted to a cid font. OUString pfaCIDUrl; + // What glyphs are in the subset and what characters those represent. std::map<sal_Int32, OString> glyphToChars; std::map<OString, sal_Int32> charsToGlyph; int nGlyphCount; }; +// The collection of all font subsets in the document. struct SubSetInfo { std::vector<FontSubSet> aComponents; }; +// Describes a final, possibly merged from multiple input fontsubsets, +// font of a given name and fontweight available as fontfile struct EmbeddedFontInfo { OUString sFontName; @@ -66,6 +77,8 @@ struct EmbeddedFontInfo FontWeight eFontWeight; }; +// A description of such a final font as LibreOffice sees it +// e.g. "Name SemiBold" struct OfficeFontInfo { OUString sFontName; commit e18cee9eae129ff7f73ff19786e4c872e92849a7 Author: Caolán McNamara <[email protected]> AuthorDate: Mon Sep 29 10:14:28 2025 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Tue Oct 14 20:36:33 2025 +0200 fileUrlForTemporaryFont->getFileUrlForTemporaryFont Change-Id: I1c023feae73828fdf5cf88ffc9dc871ac2e3d51a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191602 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> (cherry picked from commit 7011359c9e3c48dc91ef0f294fead85ff7a7818e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192341 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/bin/find-can-be-private-symbols.functions.results b/bin/find-can-be-private-symbols.functions.results index 0646ae702adf..755f62df9469 100644 --- a/bin/find-can-be-private-symbols.functions.results +++ b/bin/find-can-be-private-symbols.functions.results @@ -480,7 +480,7 @@ EditUndo::~EditUndo() EditUndoManager::SetEditEngine(EditEngine*) EmbeddedFontsManager::activateFont(rtl::OUString const&, rtl::OUString const&) EmbeddedFontsManager::clearTemporaryFontFiles() -EmbeddedFontsManager::fileUrlForTemporaryFont(rtl::OUString const&, std::basic_string_view<char16_t, std::char_traits<char16_t> >) +EmbeddedFontsManager::getFileUrlForTemporaryFont(rtl::OUString const&, std::basic_string_view<char16_t, std::char_traits<char16_t> >) EmbeddedFontsManager::sufficientTTFRights(void const*, long, EmbeddedFontsManager::FontRights) EnhancedCustomShapeTypeNames::GetAccName(rtl::OUString const&) ErrorContext::GetParent() diff --git a/bin/find-mergedlib-can-be-private-symbols.functions.results b/bin/find-mergedlib-can-be-private-symbols.functions.results index c94c575267a0..67e5a47fd127 100644 --- a/bin/find-mergedlib-can-be-private-symbols.functions.results +++ b/bin/find-mergedlib-can-be-private-symbols.functions.results @@ -655,7 +655,7 @@ EditView::SetReadOnly(bool) EditView::SetSelectionMode(EESelectionMode) EmbeddedFontsManager::activateFont(rtl::OUString const&, rtl::OUString const&) EmbeddedFontsManager::clearTemporaryFontFiles() -EmbeddedFontsManager::fileUrlForTemporaryFont(rtl::OUString const&, std::basic_string_view<char16_t, std::char_traits<char16_t> >) +EmbeddedFontsManager::getFileUrlForTemporaryFont(rtl::OUString const&, std::basic_string_view<char16_t, std::char_traits<char16_t> >) EmbeddedFontsManager::sufficientTTFRights(void const*, long, EmbeddedFontsManager::FontRights) EnhancedCustomShape2d::ApplyGluePoints(SdrObject*) EnhancedCustomShape2d::CreateObject(bool) diff --git a/include/vcl/embeddedfontsmanager.hxx b/include/vcl/embeddedfontsmanager.hxx index 537f8e704d05..dcfa29eb836e 100644 --- a/include/vcl/embeddedfontsmanager.hxx +++ b/include/vcl/embeddedfontsmanager.hxx @@ -62,7 +62,7 @@ public: bool bSubsetted = false); /** - fileUrl needs to be created via fileUrlForTemporaryFont + fileUrl needs to be created via getFileUrlForTemporaryFont */ bool addEmbeddedFont( const OUString& fileUrl, const OUString& fontName, bool sufficientFontRights ); @@ -84,7 +84,7 @@ public: static bool analyzeTTF(const void* data, tools::Long size, FontWeight& weight); /** - Removes all temporary fonts in the path used by fileUrlForTemporaryFont(). + Removes all temporary fonts in the path used by getFileUrlForTemporaryFont(). @internal */ static void clearTemporaryFontFiles(); @@ -116,7 +116,7 @@ public: EmbeddedFontsManager(const css::uno::Reference<css::frame::XModel>& xModel); ~EmbeddedFontsManager(); - static OUString fileUrlForTemporaryFont(std::u16string_view name, std::u16string_view suffix); + static OUString getFileUrlForTemporaryFont(std::u16string_view name, std::u16string_view suffix); #if HAVE_FEATURE_PDFIMPORT // write text dump diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 1aff34a65cae..adb527a4e496 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -259,7 +259,7 @@ void ImpSdrPdfImport::CollectFonts() bool bTTF = EmbeddedFontsManager::analyzeTTF(aFontData.data(), aFontData.size(), eFontWeight); SAL_INFO_IF(!bTTF, "sd.filter", "not ttf/otf, converting"); - OUString fileUrl = EmbeddedFontsManager::fileUrlForTemporaryFont( + OUString fileUrl = EmbeddedFontsManager::getFileUrlForTemporaryFont( sFontFileName, bTTF ? u".ttf" : u".t1"); if (!writeFontFile(fileUrl, aFontData)) SAL_WARN("sd.filter", "ttf not written"); @@ -1389,7 +1389,7 @@ static EmbeddedFontInfo mergeFontSubsets(const OUString& mergedFontUrl, Features.Close(); } - OUString otfUrl = EmbeddedFontsManager::fileUrlForTemporaryFont(postScriptName, u".otf"); + OUString otfUrl = EmbeddedFontsManager::getFileUrlForTemporaryFont(postScriptName, u".otf"); OUString features = !ligatureGlyphToChars.empty() ? mergedFeaturesUrl : OUString(); if (EmbeddedFontsManager::makeotf(mergedFontUrl, otfUrl, FontMenuNameDBUrl, mergedCMapUrl, features)) @@ -1439,13 +1439,13 @@ EmbeddedFontInfo ImpSdrPdfImport::convertToOTF(SubSetInfo& rSubSetInfo, const OU if (rSubSetInfo.aComponents.size() > 1) { OUString mergedFontUrl - = EmbeddedFontsManager::fileUrlForTemporaryFont(postScriptName, u".merged.pfa.cid"); + = EmbeddedFontsManager::getFileUrlForTemporaryFont(postScriptName, u".merged.pfa.cid"); return mergeFontSubsets(mergedFontUrl, FontMenuNameDBUrl, postScriptName, longFontName, Weight, rSubSetInfo); } // Otherwise not merged font, just a single subset - OUString otfUrl = EmbeddedFontsManager::fileUrlForTemporaryFont(fontFileName, u".otf"); + OUString otfUrl = EmbeddedFontsManager::getFileUrlForTemporaryFont(fontFileName, u".otf"); OUString features = bFeatures ? FeaturesUrl : OUString(); if (EmbeddedFontsManager::makeotf(pfaCIDUrl, otfUrl, FontMenuNameDBUrl, CMapUrl, features)) return { longFontName, otfUrl, toOfficeWeight(Weight) }; diff --git a/vcl/source/gdi/embeddedfontsmanager.cxx b/vcl/source/gdi/embeddedfontsmanager.cxx index 6b52fdc81122..69760e1d3899 100644 --- a/vcl/source/gdi/embeddedfontsmanager.cxx +++ b/vcl/source/gdi/embeddedfontsmanager.cxx @@ -111,7 +111,7 @@ void clearDir( const OUString& path ) // The file may or not may not exist yet, and will be cleaned up automatically as appropriate. // Use activateFonts() to actually enable usage of the font. // static -OUString EmbeddedFontsManager::fileUrlForTemporaryFont(std::u16string_view name, std::u16string_view suffix) +OUString EmbeddedFontsManager::getFileUrlForTemporaryFont(std::u16string_view name, std::u16string_view suffix) { OUString filename = OUString::Concat(name) + suffix; @@ -168,7 +168,7 @@ bool writeFontBytesToFile(osl::File& file, const void* data, sal_uInt64 size) // @param name name of the font file OUString writeFontBytesToFile(const std::vector<char>& bytes, std::u16string_view name) { - OUString url = EmbeddedFontsManager::fileUrlForTemporaryFont(name, u".ttf"); + OUString url = EmbeddedFontsManager::getFileUrlForTemporaryFont(name, u".ttf"); std::optional<osl::File> file(url); auto rc = file->open(osl_File_OpenFlag_Create | osl_File_OpenFlag_Write); @@ -195,7 +195,7 @@ OUString writeFontBytesToFile(const std::vector<char>& bytes, std::u16string_vie } } } - url = EmbeddedFontsManager::fileUrlForTemporaryFont(Concat2View(name + OUString::number(counter++)), u".ttf"); + url = EmbeddedFontsManager::getFileUrlForTemporaryFont(Concat2View(name + OUString::number(counter++)), u".ttf"); file.emplace(url); rc = file->open(osl_File_OpenFlag_Create | osl_File_OpenFlag_Write); }
