diff options
Diffstat (limited to 'vcl/source/fontsubset')
-rw-r--r-- | vcl/source/fontsubset/sft.cxx | 43 | ||||
-rw-r--r-- | vcl/source/fontsubset/ttcr.cxx | 33 | ||||
-rw-r--r-- | vcl/source/fontsubset/ttcr.hxx | 6 |
3 files changed, 0 insertions, 82 deletions
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; |