summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-10-21 11:56:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-10-22 08:29:54 +0200
commita3c7d78f3dc5ccce60dc198d2466ec7470f7fe9c (patch)
tree90fafc65d3f560d6266c817042b91b744dfec004 /vcl
parentdb8f0528eb71252b4af9c3f7ec213ea7fb29591a (diff)
loplugin:unusedmethods
Change-Id: I3c94d68cb85adc2005a5a5e3b03a311732f782c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141617 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/sft.hxx12
-rw-r--r--vcl/inc/unx/glyphcache.hxx2
-rw-r--r--vcl/source/fontsubset/sft.cxx43
-rw-r--r--vcl/source/fontsubset/ttcr.cxx33
-rw-r--r--vcl/source/fontsubset/ttcr.hxx6
-rw-r--r--vcl/unx/generic/glyphs/freetype_glyphcache.cxx5
6 files changed, 0 insertions, 101 deletions
diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index 25c8fe693c3a..4814c0e87245 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -651,18 +651,6 @@ class TrueTypeFont;
int nGlyphs);
/**
- * Queries glyph metrics. Allocates an array of advance width/height values and returns it.
- *
- * @param ttf pointer to the TrueTypeFont structure
- * @param glyphArray pointer to an array of glyphs that are to be extracted from ttf
- * @param nGlyphs number of glyph IDs in glyphArray and encoding values in encoding
- * @param vertical writing mode: false - horizontal, true - vertical
- * @ingroup sft
- *
- */
- VCL_DLLPUBLIC std::unique_ptr<sal_uInt16[]> GetTTSimpleGlyphMetrics(AbstractTrueTypeFont const *ttf, const sal_uInt16 *glyphArray, int nGlyphs, bool vertical);
-
-/**
* Returns global font information about the TrueType font.
* @see TTGlobalFontInfo
*
diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
index 255a5216d49b..f6f885badbf3 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/unx/glyphcache.hxx
@@ -124,8 +124,6 @@ public:
bool NeedsArtificialItalic() const { return mbArtItalic; }
void GetFontMetric(ImplFontMetricDataRef const &) const;
- const unsigned char* GetTable( const char* pName, sal_uLong* pLength ) const;
- bool GetFontCapabilities(vcl::FontCapabilities &) const;
bool GetGlyphBoundRect(sal_GlyphId, tools::Rectangle&, bool) const;
bool GetGlyphOutline(sal_GlyphId, basegfx::B2DPolyPolygon&, bool) const;
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 3bf3beac9080..9a9d5fc34a96 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2177,49 +2177,6 @@ SFErrCodes CreateT42FromTTGlyphs(TrueTypeFont *ttf,
return SFErrCodes::Ok;
}
-std::unique_ptr<sal_uInt16[]> GetTTSimpleGlyphMetrics(AbstractTrueTypeFont const *ttf, const sal_uInt16 *glyphArray, int nGlyphs, bool vertical)
-{
- const sal_uInt8* pTable;
- sal_uInt32 n;
- sal_uInt32 nTableSize;
-
- if (!vertical)
- {
- n = ttf->horzMetricCount();
- pTable = ttf->table(O_hmtx, nTableSize);
- }
- else
- {
- n = ttf->vertMetricCount();
- pTable = ttf->table(O_vmtx, nTableSize);
- }
-
- if (!nGlyphs || !glyphArray) return nullptr; /* invalid parameters */
- if (!n || !pTable) return nullptr; /* the font does not contain the requested metrics */
-
- std::unique_ptr<sal_uInt16[]> res(new sal_uInt16[nGlyphs]);
-
- const int UPEm = ttf->unitsPerEm();
- for( int i = 0; i < nGlyphs; ++i) {
- sal_uInt32 nAdvOffset;
- sal_uInt16 glyphID = glyphArray[i];
-
- if (glyphID < n) {
- nAdvOffset = 4 * glyphID;
- } else {
- nAdvOffset = 4 * (n - 1);
- }
-
- if (nAdvOffset >= nTableSize || UPEm == 0)
- res[i] = 0; /* better than a crash for buggy fonts */
- else
- res[i] = static_cast<sal_uInt16>(
- XUnits( UPEm, GetUInt16( pTable, nAdvOffset) ) );
- }
-
- return res;
-}
-
bool GetTTGlobalFontHeadInfo(const AbstractTrueTypeFont *ttf, int& xMin, int& yMin, int& xMax, int& yMax, sal_uInt16& macStyle)
{
sal_uInt32 table_size;
diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index 5214f15885c4..4bd53ca6e053 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -226,29 +226,6 @@ SFErrCodes TrueTypeCreator::StreamToMemory(std::vector<sal_uInt8>& rOutBuffer)
return SFErrCodes::Ok;
}
-SFErrCodes TrueTypeCreator::StreamToFile(const char* fname)
-{
- SFErrCodes r;
- std::vector<sal_uInt8> aOutBuffer;
-
- if ((r = StreamToMemory(aOutBuffer)) != SFErrCodes::Ok) return r;
- r = SFErrCodes::BadFile;
- if (fname)
- {
- FILE* fd = fopen(fname, "wb");
- if (fd)
- {
- if (fwrite(aOutBuffer.data(), 1, aOutBuffer.size(), fd) != aOutBuffer.size()) {
- r = SFErrCodes::FileIo;
- } else {
- r = SFErrCodes::Ok;
- }
- fclose(fd);
- }
- }
- return r;
-}
-
/*
* TrueTypeTable private methods
*/
@@ -750,16 +727,6 @@ TrueTypeTableCmap::TrueTypeTableCmap()
m_cmap->s.reset(new CmapSubTable[CMAP_SUBTABLE_INIT]);
}
-TrueTypeTableName::TrueTypeTableName(int n, NameRecord const *nr)
- : TrueTypeTable(T_name)
-{
- m_list.resize(n);
- for (int i = 0; i < n; i++) {
- const NameRecord* p = nr + i;
- m_list[i] = *p;
- }
-}
-
TrueTypeTableName::TrueTypeTableName(std::vector<NameRecord> nr)
: TrueTypeTable(T_name)
, m_list(std::move(nr))
diff --git a/vcl/source/fontsubset/ttcr.hxx b/vcl/source/fontsubset/ttcr.hxx
index d5cf47d97308..e48d9fe69d75 100644
--- a/vcl/source/fontsubset/ttcr.hxx
+++ b/vcl/source/fontsubset/ttcr.hxx
@@ -78,11 +78,6 @@ struct TableEntry;
* @return value of SFErrCodes type
*/
SFErrCodes StreamToMemory(std::vector<sal_uInt8>& rOutBuffer);
- /**
- * Writes a TrueType font generated by the TrueTypeCreator to a file
- * @return value of SFErrCodes type
- */
- SFErrCodes StreamToFile(const char* fname);
private:
TrueTypeTable *FindTable(sal_uInt32 tag);
@@ -266,7 +261,6 @@ struct TableEntry;
class TrueTypeTableName : public TrueTypeTable
{
public:
- TrueTypeTableName(int n, NameRecord const *nr);
TrueTypeTableName(std::vector<NameRecord> nr);
virtual ~TrueTypeTableName() override;
virtual int GetRawData(TableEntry*) override;
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index a9cc4e8ae56f..4aca36d6c101 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -890,9 +890,4 @@ bool FreetypeFont::GetGlyphOutline(sal_GlyphId nId, basegfx::B2DPolyPolygon& rB2
return true;
}
-const unsigned char* FreetypeFont::GetTable(const char* pName, sal_uLong* pLength) const
-{
- return mxFontInfo->GetTable( pName, pLength );
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */