summaryrefslogtreecommitdiff
path: root/vcl/qt5
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@aliftype.com>2022-09-11 06:27:23 +0200
committerخالد حسني <khaled@aliftype.com>2022-09-11 09:54:16 +0200
commit38db900c1f7b471dfdf575bbda522a792db51372 (patch)
tree003257fb312afbff2c81667110f3b2d9b3cd0509 /vcl/qt5
parent4286e745bccc7393ecd8b06346306d13d23316b5 (diff)
vcl: Move CreateFontSubset() to PhysicalFontFace
Having it in SalGraphics is not necessary as the code now depends on PhysicalFontFace for accessing raw font data, and this consolidates all the near identical copies of this code into one. Change-Id: I8a411f102fd2188a456bdeb8a0d794078d74e47b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139762 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'vcl/qt5')
-rw-r--r--vcl/qt5/QtGraphics_Text.cxx32
1 files changed, 0 insertions, 32 deletions
diff --git a/vcl/qt5/QtGraphics_Text.cxx b/vcl/qt5/QtGraphics_Text.cxx
index 69828ea82cc0..42a1037943dc 100644
--- a/vcl/qt5/QtGraphics_Text.cxx
+++ b/vcl/qt5/QtGraphics_Text.cxx
@@ -24,7 +24,6 @@
#include <QtFont.hxx>
#include <QtPainter.hxx>
-#include <fontsubset.hxx>
#include <vcl/fontcharmap.hxx>
#include <unx/geninst.h>
#include <unx/fontmanager.hxx>
@@ -137,37 +136,6 @@ bool QtGraphics::AddTempDevFont(vcl::font::PhysicalFontCollection*, const OUStri
return false;
}
-bool QtGraphics::CreateFontSubset(const OUString& rToFile, const vcl::font::PhysicalFontFace* pFace,
- const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding,
- int nGlyphCount, FontSubsetInfo& rInfo)
-{
- OUString aSysPath;
- if (osl_File_E_None != osl_getSystemPathFromFileURL(rToFile.pData, &aSysPath.pData))
- return false;
-
- const OString aToFile(OUStringToOString(aSysPath, osl_getThreadTextEncoding()));
-
- // handle CFF-subsetting
- auto aData = pFace->GetRawFontData(vcl::T_CFF);
- if (!aData.empty())
- return SalGraphics::CreateCFFfontSubset(aData.data(), aData.size(), aToFile, pGlyphIds,
- pEncoding, nGlyphCount, rInfo);
-
- // prepare data for psprint's font subsetter
- vcl::TrueTypeFace aTTF(*pFace);
- if (aTTF.initialize() != vcl::SFErrCodes::Ok)
- return false;
-
- // get details about the subsetted font
- vcl::TTGlobalFontInfo aTTInfo;
- vcl::GetTTGlobalFontInfo(&aTTF, &aTTInfo);
- OUString aPSName(aTTInfo.psname, std::strlen(aTTInfo.psname), RTL_TEXTENCODING_UTF8);
- FillFontSubsetInfo(aTTInfo, aPSName, rInfo);
-
- // write subset into destination file
- return SalGraphics::CreateTTFfontSubset(aTTF, aToFile, pGlyphIds, pEncoding, nGlyphCount);
-}
-
const void* QtGraphics::GetEmbedFontData(const vcl::font::PhysicalFontFace*,
tools::Long* /*pDataLen*/)
{