summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2016-12-01 08:27:01 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2016-12-01 19:13:12 +0000
commitdacd0e94199f154cac5875ec06430df6947e251b (patch)
tree729ee93483b1b4ddb80400cb78bec5091a2d32b0 /vcl
parentaa68c99d88fd7abe08c4aee5206c859a0cdba38e (diff)
Unused code
Change-Id: Idfc964930c242d752a78cd109d75d809bce4de11 Reviewed-on: https://gerrit.libreoffice.org/31470 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/Library_vcl.mk1
-rw-r--r--vcl/inc/salglyphid.hxx3
-rw-r--r--vcl/inc/sallayout.hxx3
-rw-r--r--vcl/inc/sft.hxx5
-rw-r--r--vcl/inc/unx/freetype_glyphcache.hxx30
-rw-r--r--vcl/inc/unx/glyphcache.hxx12
-rw-r--r--vcl/quartz/salgdi.cxx19
-rw-r--r--vcl/quartz/salgdicommon.cxx12
-rw-r--r--vcl/source/fontsubset/gsub.cxx342
-rw-r--r--vcl/source/fontsubset/gsub.h38
-rw-r--r--vcl/source/fontsubset/sft.cxx32
-rw-r--r--vcl/source/gdi/pdffontcache.cxx13
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx8
-rw-r--r--vcl/source/gdi/sallayout.cxx39
-rw-r--r--vcl/unx/generic/glyphs/freetype_glyphcache.cxx142
-rw-r--r--vcl/unx/generic/print/genpspgraphics.cxx2
-rw-r--r--vcl/win/gdi/salfont.cxx26
17 files changed, 23 insertions, 704 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index ce9b6c0bc23d..435e8cfece15 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -388,7 +388,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/font/font \
vcl/source/fontsubset/cff \
vcl/source/fontsubset/fontsubset \
- vcl/source/fontsubset/gsub \
vcl/source/fontsubset/list \
vcl/source/fontsubset/sft \
vcl/source/fontsubset/ttcr \
diff --git a/vcl/inc/salglyphid.hxx b/vcl/inc/salglyphid.hxx
index c449e1bd4b47..dbfd95ebafd2 100644
--- a/vcl/inc/salglyphid.hxx
+++ b/vcl/inc/salglyphid.hxx
@@ -26,7 +26,6 @@ typedef sal_uInt32 sal_GlyphId;
#define GF_NONE 0x00000000
#define GF_FLAGMASK 0xFF800000
#define GF_IDXMASK ~GF_FLAGMASK
-#define GF_ISCHAR 0x00800000
#define GF_ROTL 0x01000000
#ifdef _WIN32
@@ -39,8 +38,6 @@ typedef sal_uInt32 sal_GlyphId;
#define GF_ROTR 0x03000000
#define GF_ROTMASK 0x03000000
-#define GF_UNHINTED 0x04000000
-#define GF_GSUB 0x08000000
#define GF_FONTMASK 0xF0000000
#define GF_FONTSHIFT 28
diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index effb6463d0cb..3df492110bf9 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -120,9 +120,6 @@ protected:
// For nice SAL_INFO logging of ImplLayoutArgs values
std::ostream &operator <<(std::ostream& s, ImplLayoutArgs &rArgs);
-// helper functions often used with ImplLayoutArgs
-int GetVerticalFlags( sal_UCS4 );
-
// all positions/widths are in font units
// one exception: drawposition is in pixel units
diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index fe50a95b59f6..91c13a3d34cd 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -269,7 +269,6 @@ namespace vcl
int VCL_DLLPUBLIC OpenTTFontFile(const char *fname, sal_uInt32 facenum, TrueTypeFont** ttf);
#endif
- void getTTScripts(std::vector< sal_uInt32 > &rScriptTags, const unsigned char* pTable, size_t nLength);
bool getTTCoverage(
boost::optional<std::bitset<UnicodeCoverage::MAX_UC_ENUM>> & rUnicodeCoverage,
boost::optional<std::bitset<CodePageCoverage::MAX_CP_ENUM>> & rCodePageCoverage,
@@ -444,12 +443,10 @@ namespace vcl
*
* @param ttf pointer to the TrueTypeFont structure
* @param ch Unicode (UCS-2) character
- * @param bvertical flag to function that we want to find the vertical
- * GlobalSUBstitution attribute
* @return glyph ID, if the character is missing in the font, the return value is 0.
* @ingroup sft
*/
- sal_uInt16 MapChar(TrueTypeFont *ttf, sal_uInt16 ch, bool bvertical);
+ sal_uInt16 MapChar(TrueTypeFont *ttf, sal_uInt16 ch);
#endif
/**
diff --git a/vcl/inc/unx/freetype_glyphcache.hxx b/vcl/inc/unx/freetype_glyphcache.hxx
index bbd606dc4515..93788953a3ad 100644
--- a/vcl/inc/unx/freetype_glyphcache.hxx
+++ b/vcl/inc/unx/freetype_glyphcache.hxx
@@ -71,9 +71,6 @@ public:
void AnnounceFont( PhysicalFontCollection* );
- int GetGlyphIndex( sal_UCS4 cChar ) const;
- void CacheGlyphIndex( sal_UCS4 cChar, int nGI ) const;
-
bool GetFontCodeRanges( CmapResult& ) const;
const FontCharMapRef& GetFontCharMap();
@@ -86,35 +83,8 @@ private:
FontAttributes maDevFontAttributes;
FontCharMapRef mxFontCharMap;
-
- // cache unicode->glyphid mapping because looking it up is expensive
- // TODO: change to std::unordered_multimap when a use case requires a m:n mapping
- typedef std::unordered_map<int,int> Int2IntMap;
- mutable Int2IntMap* mpChar2Glyph;
- mutable Int2IntMap* mpGlyph2Char;
- void InitHashes() const;
};
-// these two inlines are very important for performance
-
-inline int FreetypeFontInfo::GetGlyphIndex( sal_UCS4 cChar ) const
-{
- if( !mpChar2Glyph )
- return -1;
- Int2IntMap::const_iterator it = mpChar2Glyph->find( cChar );
- if( it == mpChar2Glyph->end() )
- return -1;
- return it->second;
-}
-
-inline void FreetypeFontInfo::CacheGlyphIndex( sal_UCS4 cChar, int nIndex ) const
-{
- if( !mpChar2Glyph )
- InitHashes();
- (*mpChar2Glyph)[ cChar ] = nIndex;
- (*mpGlyph2Char)[ nIndex ] = cChar;
-}
-
class FreetypeManager
{
public:
diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
index f109e610a6d9..65afd4b3ea81 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/unx/glyphcache.hxx
@@ -97,22 +97,17 @@ private:
class GlyphMetric
{
public:
- GlyphMetric() : mnAdvanceWidth(0) {}
+ GlyphMetric() {}
const Point& GetOffset() const { return maOffset; }
const Size& GetSize() const { return maSize; }
- long GetCharWidth() const { return mnAdvanceWidth; }
protected:
friend class GlyphData;
void SetOffset( int nX, int nY ) { maOffset = Point( nX, nY); }
- void SetDelta( int nX, int nY ) { maDelta = Point( nX, nY); }
void SetSize( const Size& s ) { maSize = s; }
- void SetCharWidth( long nW ) { mnAdvanceWidth = nW; }
private:
- long mnAdvanceWidth;
- Point maDelta;
Point maOffset;
Size maSize;
};
@@ -126,8 +121,6 @@ public:
void SetSize( const Size& s) { maGlyphMetric.SetSize( s ); }
void SetOffset( int nX, int nY ) { maGlyphMetric.SetOffset( nX, nY ); }
- void SetDelta( int nX, int nY ) { maGlyphMetric.SetDelta( nX, nY ); }
- void SetCharWidth( long nW ) { maGlyphMetric.SetCharWidth( nW ); }
void SetLruValue( int n ) const { mnLruValue = n; }
long GetLruValue() const { return mnLruValue;}
@@ -166,9 +159,6 @@ public:
const GlyphMetric& GetGlyphMetric(sal_GlyphId aGlyphId);
- sal_GlyphId GetGlyphIndex( sal_UCS4 ) const;
- sal_GlyphId GetRawGlyphIndex( sal_UCS4, sal_UCS4 = 0 ) const;
- sal_GlyphId FixupGlyphIndex( sal_GlyphId aGlyphId, sal_UCS4 ) const;
bool GetGlyphOutline( sal_GlyphId aGlyphId, basegfx::B2DPolyPolygon& ) const;
bool GetAntialiasAdvice() const;
hb_font_t* GetHbFont() { return mpHbFont; }
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 4a363b3892ef..c2dba0242839 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -176,22 +176,7 @@ bool CoreTextFontFace::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilit
}
mbFontCapabilitiesRead = true;
- int nBufSize = 0;
- // prepare to get the GSUB table raw data
- nBufSize = GetFontTable( "GSUB", nullptr );
- if( nBufSize > 0 )
- {
- // allocate a buffer for the GSUB raw data
- std::vector<unsigned char> aBuffer( nBufSize );
- // get the GSUB raw data
- const int nRawLength = GetFontTable( "GSUB", &aBuffer[0] );
- if( nRawLength > 0 )
- {
- const unsigned char* pGSUBTable = &aBuffer[0];
- vcl::getTTScripts(maFontCapabilities.maGSUBScriptTags, pGSUBTable, nRawLength);
- }
- }
- nBufSize = GetFontTable( "OS/2", nullptr );
+ int nBufSize = GetFontTable( "OS/2", nullptr );
if( nBufSize > 0 )
{
// allocate a buffer for the OS/2 raw data
@@ -827,7 +812,7 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV
break;
sal_Ucs nUcsChar = static_cast<sal_Ucs>(nChar);
- sal_uInt32 nGlyph = ::MapChar( pSftFont, nUcsChar, bVertical );
+ sal_uInt32 nGlyph = ::MapChar( pSftFont, nUcsChar );
if( nGlyph > 0 )
{
rUnicodeEnc[ nUcsChar ] = nGlyph;
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index ed6e4dbb468c..d289e010e162 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -275,18 +275,6 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile,
aTempEncs[i] = pEncoding[i];
sal_GlyphId aGlyphId(pGlyphIds[i] & GF_IDXMASK);
- if( pGlyphIds[i] & GF_ISCHAR )
- {
- bool bVertical = (pGlyphIds[i] & GF_ROTMASK) != 0;
- aGlyphId = ::MapChar( pSftFont, static_cast<sal_uInt16>(aGlyphId), bVertical );
- if( aGlyphId == 0 && pFontData->IsSymbolFont() )
- {
- // #i12824# emulate symbol aliasing U+FXXX <-> U+0XXX
- aGlyphId = pGlyphIds[i] & GF_IDXMASK;
- aGlyphId = (aGlyphId & 0xF000) ? (aGlyphId & 0x00FF) : (aGlyphId | 0xF000 );
- aGlyphId = ::MapChar( pSftFont, static_cast<sal_uInt16>(aGlyphId), bVertical );
- }
- }
aShortIDs[i] = static_cast<sal_uInt16>( aGlyphId );
if( !aGlyphId && nNotDef < 0 )
{
diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx
deleted file mode 100644
index 52e6d8cc0a76..000000000000
--- a/vcl/source/fontsubset/gsub.cxx
+++ /dev/null
@@ -1,342 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "sft.hxx"
-
-#include "gsub.h"
-
-#include <osl/diagnose.h>
-
-#include <vector>
-#include <map>
-#include <algorithm>
-
-namespace vcl
-{
-
-typedef sal_uInt8 FT_Byte;
-
-typedef std::map<sal_uInt16,sal_uInt16> GlyphSubstitution;
-
-inline sal_uInt32 NEXT_Long( const unsigned char* &p )
-{
- sal_uInt32 nVal = (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3];
- p += 4;
- return nVal;
-}
-
-inline sal_uInt16 NEXT_UShort( const unsigned char* &p )
-{
- sal_uInt16 nVal = (p[0]<<8) + p[1];
- p += 2;
- return nVal;
-}
-
-#define MKTAG(s) ((((((s[0]<<8)+s[1])<<8)+s[2])<<8)+s[3])
-
-bool ReadGSUB( struct TrueTypeFont* pTTFile,
- int nRequestedScript, int nRequestedLangsys )
-{
- const FT_Byte* pGsubBase = pTTFile->tables[ O_gsub ];
- if( !pGsubBase )
- return false;
-
- // #129682# check offsets inside GSUB table
- const FT_Byte* pGsubLimit = pGsubBase + pTTFile->tlens[ O_gsub ];
-
- // parse GSUB header
- const FT_Byte* pGsubHeader = pGsubBase;
- const sal_uInt32 nVersion = NEXT_Long( pGsubHeader );
- const sal_uInt16 nOfsScriptList = NEXT_UShort( pGsubHeader );
- const sal_uInt16 nOfsFeatureTable = NEXT_UShort( pGsubHeader );
- const sal_uInt16 nOfsLookupList = NEXT_UShort( pGsubHeader );
-
- // sanity check the GSUB header
- if( nVersion != 0x00010000 )
- if( nVersion != 0x00001000 ) // workaround for SunBatang etc.
- return false; // unknown format or broken
-
- std::vector<sal_uInt32> aReqFeatureTagList;
-
- aReqFeatureTagList.push_back( MKTAG("vert") );
-
- std::vector<sal_uInt16> aFeatureIndexList;
-
- // parse Script Table
- const FT_Byte* pScriptHeader = pGsubBase + nOfsScriptList;
- const sal_uInt16 nCntScript = NEXT_UShort( pScriptHeader );
- if( pGsubLimit < pScriptHeader + 6 * nCntScript )
- return false;
- for( sal_uInt16 nScriptIndex = 0; nScriptIndex < nCntScript; ++nScriptIndex )
- {
- const sal_uInt32 nTag = NEXT_Long( pScriptHeader ); // e.g. hani/arab/kana/hang
- const sal_uInt16 nOfsScriptTable= NEXT_UShort( pScriptHeader );
- if( (nTag != (sal_uInt16)nRequestedScript) && (nRequestedScript != 0) )
- continue;
-
- const FT_Byte* pScriptTable = pGsubBase + nOfsScriptList + nOfsScriptTable;
- if( pGsubLimit < pScriptTable + 4 )
- return false;
- const sal_uInt16 nDefaultLangsysOfs = NEXT_UShort( pScriptTable );
- const sal_uInt16 nCntLangSystem = NEXT_UShort( pScriptTable );
- sal_uInt16 nLangsysOffset = 0;
- if( pGsubLimit < pScriptTable + 6 * nCntLangSystem )
- return false;
- for( sal_uInt16 nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
- {
- const sal_uInt32 nInnerTag = NEXT_Long( pScriptTable ); // e.g. KOR/ZHS/ZHT/JAN
- const sal_uInt16 nOffset= NEXT_UShort( pScriptTable );
- if( (nInnerTag != (sal_uInt16)nRequestedLangsys) && (nRequestedLangsys != 0) )
- continue;
- nLangsysOffset = nOffset;
- break;
- }
-
- if( (nDefaultLangsysOfs != 0) && (nDefaultLangsysOfs != nLangsysOffset) )
- {
- const FT_Byte* pLangSys = pGsubBase + nOfsScriptList + nOfsScriptTable + nDefaultLangsysOfs;
- if( pGsubLimit < pLangSys + 6 )
- return false;
- /*const sal_uInt16 nLookupOrder =*/ NEXT_UShort( pLangSys );
- const sal_uInt16 nReqFeatureIdx = NEXT_UShort( pLangSys );
- const sal_uInt16 nCntFeature = NEXT_UShort( pLangSys );
- if( pGsubLimit < pLangSys + 2 * nCntFeature )
- return false;
- aFeatureIndexList.push_back( nReqFeatureIdx );
- for( sal_uInt16 i = 0; i < nCntFeature; ++i )
- {
- const sal_uInt16 nFeatureIndex = NEXT_UShort( pLangSys );
- aFeatureIndexList.push_back( nFeatureIndex );
- }
- }
-
- if( nLangsysOffset != 0 )
- {
- const FT_Byte* pLangSys = pGsubBase + nOfsScriptList + nOfsScriptTable + nLangsysOffset;
- if( pGsubLimit < pLangSys + 6 )
- return false;
- /*const sal_uInt16 nLookupOrder =*/ NEXT_UShort( pLangSys );
- const sal_uInt16 nReqFeatureIdx = NEXT_UShort( pLangSys );
- const sal_uInt16 nCntFeature = NEXT_UShort( pLangSys );
- if( pGsubLimit < pLangSys + 2 * nCntFeature )
- return false;
- aFeatureIndexList.push_back( nReqFeatureIdx );
- for( sal_uInt16 i = 0; i < nCntFeature; ++i )
- {
- const sal_uInt16 nFeatureIndex = NEXT_UShort( pLangSys );
- aFeatureIndexList.push_back( nFeatureIndex );
- }
- }
- }
-
- if( aFeatureIndexList.empty() )
- return true;
-
- std::vector<sal_uInt16> aLookupIndexList;
- std::vector<sal_uInt16> aLookupOffsetList;
-
- // parse Feature Table
- const FT_Byte* pFeatureHeader = pGsubBase + nOfsFeatureTable;
- if( pGsubLimit < pFeatureHeader + 2 )
- return false;
- const sal_uInt16 nCntFeature = NEXT_UShort( pFeatureHeader );
- if( pGsubLimit < pFeatureHeader + 6 * nCntFeature )
- return false;
- for( sal_uInt16 nFeatureIndex = 0; nFeatureIndex < nCntFeature; ++nFeatureIndex )
- {
- const sal_uInt32 nTag = NEXT_Long( pFeatureHeader ); // e.g. locl/vert/trad/smpl/liga/fina/...
- const sal_uInt16 nOffset= NEXT_UShort( pFeatureHeader );
-
- // ignore unneeded feature lookups
- if( aFeatureIndexList[0] != nFeatureIndex ) // do not ignore the required feature
- {
- const int nRequested = std::count( aFeatureIndexList.begin(), aFeatureIndexList.end(), nFeatureIndex);
- if( !nRequested ) // ignore features that are not requested
- continue;
- const int nAvailable = std::count( aReqFeatureTagList.begin(), aReqFeatureTagList.end(), nTag);
- if( !nAvailable ) // some fonts don't provide features they request!
- continue;
- }
-
- const FT_Byte* pFeatureTable = pGsubBase + nOfsFeatureTable + nOffset;
- if( pGsubLimit < pFeatureTable + 2 )
- return false;
- const sal_uInt16 nCntLookups = NEXT_UShort( pFeatureTable );
- if( pGsubLimit < pFeatureTable + 2 * nCntLookups )
- return false;
- for( sal_uInt16 i = 0; i < nCntLookups; ++i )
- {
- const sal_uInt16 nLookupIndex = NEXT_UShort( pFeatureTable );
- aLookupIndexList.push_back( nLookupIndex );
- }
- if( nCntLookups == 0 ) //### hack needed by Mincho/Gothic/Mingliu/Simsun/...
- aLookupIndexList.push_back( 0 );
- }
-
- // parse Lookup List
- const FT_Byte* pLookupHeader = pGsubBase + nOfsLookupList;
- if( pGsubLimit < pLookupHeader + 2 )
- return false;
- const sal_uInt16 nCntLookupTable = NEXT_UShort( pLookupHeader );
- if( pGsubLimit < pLookupHeader + 2 * nCntLookupTable )
- return false;
- for( sal_uInt16 nLookupIdx = 0; nLookupIdx < nCntLookupTable; ++nLookupIdx )
- {
- const sal_uInt16 nOffset = NEXT_UShort( pLookupHeader );
- if( std::count( aLookupIndexList.begin(), aLookupIndexList.end(), nLookupIdx ) )
- aLookupOffsetList.push_back( nOffset );
- }
-
- std::vector<sal_uInt16>::const_iterator it = aLookupOffsetList.begin();
- for(; it != aLookupOffsetList.end(); ++it )
- {
- const sal_uInt16 nOfsLookupTable = *it;
- const FT_Byte* pLookupTable = pGsubBase + nOfsLookupList + nOfsLookupTable;
- if( pGsubLimit < pLookupTable + 6 )
- return false;
- const sal_uInt16 eLookupType = NEXT_UShort( pLookupTable );
- /*const sal_uInt16 eLookupFlag =*/ NEXT_UShort( pLookupTable );
- const sal_uInt16 nCntLookupSubtable = NEXT_UShort( pLookupTable );
-
- // TODO: switch( eLookupType )
- if( eLookupType != 1 ) // TODO: once we go beyond SingleSubst
- continue;
-
- if( pGsubLimit < pLookupTable + 2 * nCntLookupSubtable )
- return false;
- for( sal_uInt16 nSubTableIdx = 0; nSubTableIdx < nCntLookupSubtable; ++nSubTableIdx )
- {
- const sal_uInt16 nOfsSubLookupTable = NEXT_UShort( pLookupTable );
- const FT_Byte* pSubLookup = pGsubBase + nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable;
- if( pGsubLimit < pSubLookup + 6 )
- return false;
- const sal_uInt16 nFmtSubstitution = NEXT_UShort( pSubLookup );
- const sal_uInt16 nOfsCoverage = NEXT_UShort( pSubLookup );
-
- typedef std::pair<sal_uInt16,sal_uInt16> GlyphSubst;
- std::vector<GlyphSubst> aSubstVector;
-
- const FT_Byte* pCoverage = pGsubBase
- + nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable + nOfsCoverage;
- if( pGsubLimit < pCoverage + 4 )
- return false;
- const sal_uInt16 nFmtCoverage = NEXT_UShort( pCoverage );
- switch( nFmtCoverage )
- {
- case 1: // Coverage Format 1
- {
- const sal_uInt16 nCntGlyph = NEXT_UShort( pCoverage );
- if( pGsubLimit < pCoverage + 2 * nCntGlyph )
- // TODO? nCntGlyph = (pGsubLimit - pCoverage) / 2;
- return false;
- aSubstVector.reserve( nCntGlyph );
- for( sal_uInt16 i = 0; i < nCntGlyph; ++i )
- {
- const sal_uInt16 nGlyphId = NEXT_UShort( pCoverage );
- aSubstVector.push_back( GlyphSubst( nGlyphId, 0 ) );
- }
- }
- break;
-
- case 2: // Coverage Format 2
- {
- const sal_uInt16 nCntRange = NEXT_UShort( pCoverage );
- if( pGsubLimit < pCoverage + 6 * nCntRange )
- // TODO? nCntGlyph = (pGsubLimit - pCoverage) / 6;
- return false;
- for( int i = nCntRange; --i >= 0; )
- {
- const sal_uInt32 nGlyph0 = NEXT_UShort( pCoverage );
- const sal_uInt32 nGlyph1 = NEXT_UShort( pCoverage );
- const sal_uInt16 nCovIdx = NEXT_UShort( pCoverage );
- for( sal_uInt32 j = nGlyph0; j <= nGlyph1; ++j )
- aSubstVector.push_back( GlyphSubst( static_cast<sal_uInt16>(j + nCovIdx), 0 ) );
- }
- }
- break;
- }
-
- std::vector<GlyphSubst>::iterator subst_it( aSubstVector.begin() );
-
- switch( nFmtSubstitution )
- {
- case 1: // Single Substitution Format 1
- {
- const sal_uInt16 nDeltaGlyphId = NEXT_UShort( pSubLookup );
-
- for(; subst_it != aSubstVector.end(); ++subst_it )
- (*subst_it).second = (*subst_it).first + nDeltaGlyphId;
- }
- break;
-
- case 2: // Single Substitution Format 2
- {
- const sal_uInt16 nCntGlyph = NEXT_UShort( pSubLookup );
- for( int i = nCntGlyph; (subst_it != aSubstVector.end()) && (--i>=0); ++subst_it )
- {
- if( pGsubLimit < pSubLookup + 2 )
- return false;
- const sal_uInt16 nGlyphId = NEXT_UShort( pSubLookup );
- (*subst_it).second = nGlyphId;
- }
- }
- break;
- }
-
- // now apply the glyph substitutions that have been collected in this subtable
- if( !aSubstVector.empty() )
- {
- GlyphSubstitution* pGSubstitution = new GlyphSubstitution;
- pTTFile->pGSubstitution = static_cast<void*>(pGSubstitution);
- for( subst_it = aSubstVector.begin(); subst_it != aSubstVector.end(); ++subst_it )
- (*pGSubstitution)[ (*subst_it).first ] = (*subst_it).second;
- }
- }
- }
- return true;
-}
-
-void ReleaseGSUB(struct TrueTypeFont* pTTFile)
-{
- GlyphSubstitution* pGlyphSubstitution = static_cast<GlyphSubstitution*>(pTTFile->pGSubstitution);
- delete pGlyphSubstitution;
-}
-
-int UseGSUB( struct TrueTypeFont* pTTFile, int nGlyph )
-{
- GlyphSubstitution* pGlyphSubstitution = static_cast<GlyphSubstitution*>(pTTFile->pGSubstitution);
- if( pGlyphSubstitution != nullptr )
- {
- GlyphSubstitution::const_iterator it( pGlyphSubstitution->find( sal::static_int_cast<sal_uInt16>(nGlyph) ) );
- if( it != pGlyphSubstitution->end() )
- nGlyph = (*it).second;
- }
-
- return nGlyph;
-}
-
-int HasVerticalGSUB( struct TrueTypeFont* pTTFile )
-{
- GlyphSubstitution* pGlyphSubstitution = static_cast<GlyphSubstitution*>(pTTFile->pGSubstitution);
- return pGlyphSubstitution ? +1 : 0;
-}
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/gsub.h b/vcl/source/fontsubset/gsub.h
deleted file mode 100644
index 51f5ce8bbeab..000000000000
--- a/vcl/source/fontsubset/gsub.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_VCL_SOURCE_FONTSUBSET_GSUB_H
-#define INCLUDED_VCL_SOURCE_FONTSUBSET_GSUB_H
-
-namespace vcl
-{
-
-int HasVerticalGSUB( struct vcl::TrueTypeFont* pTTFile );
-
-int UseGSUB( struct vcl::TrueTypeFont* pTTFile, int nGlyph );
-
-bool ReadGSUB( struct vcl::TrueTypeFont* pTTFile, int nRequestedScript, int nRequestedLangsys );
-
-void ReleaseGSUB( struct vcl::TrueTypeFont* pTTFile );
-
-}
-
-#endif // INCLUDED_VCL_SOURCE_FONTSUBSET_GSUB_H
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 69220268aaa0..6ee64ec63463 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -34,7 +34,6 @@
#include <sys/stat.h>
#endif
#include "sft.hxx"
-#include "gsub.h"
#include "ttcr.hxx"
#include "xlat.hxx"
#include <rtl/crc.h>
@@ -1711,7 +1710,6 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
GetNames(t);
FindCmap(t);
GetKern(t);
- ReadGSUB( t, 0, 0 );
return SF_OK;
}
@@ -1735,8 +1733,6 @@ void CloseTTFont(TrueTypeFont *ttf)
free(ttf->tlens);
free(ttf->kerntables);
- ReleaseGSUB(ttf);
-
free(ttf);
return;
}
@@ -2345,7 +2341,7 @@ int CreateT42FromTTGlyphs(TrueTypeFont *ttf,
}
#if defined(_WIN32) || defined(MACOSX) || defined(IOS)
-sal_uInt16 MapChar(TrueTypeFont *ttf, sal_uInt16 ch, bool bvertical)
+sal_uInt16 MapChar(TrueTypeFont *ttf, sal_uInt16 ch)
{
switch (ttf->cmapType) {
case CMAP_MS_Symbol:
@@ -2366,8 +2362,6 @@ sal_uInt16 MapChar(TrueTypeFont *ttf, sal_uInt16 ch, bool bvertical)
}
const sal_uInt32 nMaxCmapSize = ttf->ptr + ttf->fsize - ttf->cmap;
ch = (sal_uInt16)ttf->mapper(ttf->cmap, nMaxCmapSize, ch);
- if (ch!=0 && bvertical)
- ch = (sal_uInt16)UseGSUB(ttf,ch);
return ch;
}
#endif
@@ -2735,30 +2729,6 @@ bool getTTCoverage(
return bRet;
}
-void getTTScripts(std::vector< sal_uInt32 > &rScriptTags, const unsigned char* pTable, size_t nLength)
-{
- if (nLength < 6)
- return;
-
- // parse GSUB/GPOS header
- const sal_uInt16 nOfsScriptList = GetUInt16(pTable, 4);
-
- // parse Script Table
- const sal_uInt16 nCntScript = GetUInt16(pTable, nOfsScriptList);
- sal_uInt32 nCurrentPos = nOfsScriptList+2;
- for( sal_uInt16 nScriptIndex = 0;
- nScriptIndex < nCntScript && nLength >= 6; ++nScriptIndex,
- nLength-=6 )
- {
- sal_uInt32 nTag = GetUInt32(pTable, nCurrentPos);
- nCurrentPos+=6;
- rScriptTags.push_back(nTag); // e.g. hani/arab/kana/hang
- }
-
- std::sort(rScriptTags.begin(), rScriptTags.end());
- rScriptTags.erase(std::unique(rScriptTags.begin(), rScriptTags.end()), rScriptTags.end());
-}
-
} // namespace vcl
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/pdffontcache.cxx b/vcl/source/gdi/pdffontcache.cxx
index 9c1b271b65ba..8140db73ac5b 100644
--- a/vcl/source/gdi/pdffontcache.cxx
+++ b/vcl/source/gdi/pdffontcache.cxx
@@ -59,19 +59,6 @@ sal_Int32 PDFFontCache::getGlyphWidth( const PhysicalFontFace* pFont, sal_GlyphI
if( ! rFontData.m_nWidths.empty() )
{
sal_GlyphId nIndex = nGlyph;
- if( (nGlyph & GF_ISCHAR) != 0 )
- {
- const sal_Ucs cCode = static_cast<sal_Ucs>(nGlyph & GF_IDXMASK);
- Ucs2UIntMap::const_iterator it = rFontData.m_aGlyphIdToIndex.find( cCode );
-
- // allow symbol aliasing U+00xx -> U+F0xx if there is no direct match
- if( it == rFontData.m_aGlyphIdToIndex.end()
- && pFont->IsSymbolFont()
- && (cCode < 0x0100) )
- it = rFontData.m_aGlyphIdToIndex.find( cCode+0xF000 );
-
- nIndex = (it != rFontData.m_aGlyphIdToIndex.end()) ? it->second : 0;
- }
nIndex &= GF_IDXMASK;
if( nIndex < rFontData.m_nWidths.size() )
nWidth = rFontData.m_nWidths[ nIndex ];
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index db27d507d7ef..c3c3bc4b4d73 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -8144,7 +8144,7 @@ void PDFWriterImpl::registerGlyphs( int nGlyphs,
sal_Ucs* pCurUnicode = pUnicodes;
for( int i = 0; i < nGlyphs; pCurUnicode += pUnicodesPerGlyph[i] , i++ )
{
- const int nFontGlyphId = pGlyphs[i] & (GF_IDXMASK | GF_ISCHAR | GF_GSUB);
+ const int nFontGlyphId = pGlyphs[i] & GF_IDXMASK;
const PhysicalFontFace* pCurrentFont = pFallbackFonts[i] ? pFallbackFonts[i] : pDevFont;
FontSubset& rSubset = m_aSubsets[ pCurrentFont ];
@@ -8610,11 +8610,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool
{
// default case: 1 glyph is one unicode
pUnicodesPerGlyph[i] = 1;
- if( (pGlyphs[i] & GF_ISCHAR) )
- {
- aUnicodes.push_back( static_cast<sal_Ucs>(pGlyphs[i] & GF_IDXMASK) );
- }
- else if( pCharPosAry[i] >= nMinCharPos && pCharPosAry[i] <= nMaxCharPos )
+ if( pCharPosAry[i] >= nMinCharPos && pCharPosAry[i] <= nMaxCharPos )
{
int nChars = 1;
pUnicodesPerGlyph[i] = 1;
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index b6b7ee8bcb9a..2a50f679c71d 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -133,34 +133,6 @@ std::ostream &operator <<(std::ostream& s, ImplLayoutArgs &rArgs)
return s;
}
-int GetVerticalFlags( sal_UCS4 nChar )
-{
- if( (nChar >= 0x1100 && nChar <= 0x11f9) // Hangul Jamo
- || (nChar == 0x2030 || nChar == 0x2031) // per mille sign
- || (nChar >= 0x3000 && nChar <= 0xfaff) // unified CJK
- || (nChar >= 0xfe20 && nChar <= 0xfe6f) // CJK compatibility
- || (nChar >= 0xff00 && nChar <= 0xfffd) ) // other CJK
- {
- /* #i52932# remember:
- nChar == 0x2010 || nChar == 0x2015
- nChar == 0x2016 || nChar == 0x2026
- are GF_NONE also, but already handled in the outer if condition
- */
- if((nChar >= 0x3008 && nChar <= 0x301C && nChar != 0x3012)
- || (nChar == 0xFF3B || nChar == 0xFF3D || nChar==0xFF08 || nChar==0xFF09)
- || (nChar >= 0xFF5B && nChar <= 0xFF9F) // halfwidth forms
- || (nChar == 0xFFE3) )
- return GF_NONE; // not rotated
- else if( nChar == 0x30fc )
- return GF_ROTR; // right
- return GF_ROTL; // left
- }
- else if( (nChar >= 0x20000) && (nChar <= 0x3FFFF) ) // all SIP/TIP ideographs
- return GF_ROTL; // left
-
- return GF_NONE; // not rotated as default
-}
-
sal_UCS4 GetMirroredChar( sal_UCS4 nChar )
{
nChar = u_charMirror( nChar );
@@ -758,16 +730,7 @@ bool SalLayout::GetBoundRect( SalGraphics& rSalGraphics, Rectangle& rRect ) cons
bool SalLayout::IsSpacingGlyph( sal_GlyphId nGlyph )
{
bool bRet = false;
- if( nGlyph & GF_ISCHAR )
- {
- long nChar = nGlyph & GF_IDXMASK;
- bRet = (nChar <= 0x0020) // blank
- //|| (nChar == 0x00A0) // non breaking space
- || (nChar >= 0x2000 && nChar <= 0x200F) // whitespace
- || (nChar == 0x3000); // ideographic space
- }
- else
- bRet = ((nGlyph & GF_IDXMASK) == 3);
+ bRet = ((nGlyph & GF_IDXMASK) == 3);
return bRet;
}
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index d9fa789cd865..0d19d8269ee4 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -173,9 +173,7 @@ FreetypeFontInfo::FreetypeFontInfo( const FontAttributes& rDevFontAttributes,
mnRefCount( 0 ),
mnFontId( nFontId ),
maDevFontAttributes( rDevFontAttributes ),
- mxFontCharMap( nullptr ),
- mpChar2Glyph( nullptr ),
- mpGlyph2Char( nullptr )
+ mxFontCharMap( nullptr )
{
// prefer font with low ID
maDevFontAttributes.IncreaseQualityBy( 10000 - nFontId );
@@ -187,15 +185,6 @@ FreetypeFontInfo::~FreetypeFontInfo()
{
if( mxFontCharMap.Is() )
mxFontCharMap.Clear();
- delete mpChar2Glyph;
- delete mpGlyph2Char;
-}
-
-void FreetypeFontInfo::InitHashes() const
-{
- // TODO: avoid pointers when empty stl::hash_* objects become cheap
- mpChar2Glyph = new Int2IntMap();
- mpGlyph2Char = new Int2IntMap();
}
FT_FaceRec_* FreetypeFontInfo::GetFaceFT()
@@ -626,24 +615,22 @@ void FreetypeFont::GetFontMetric(ImplFontMetricDataRef& rxTo) const
}
// initialize kashida width
- // TODO: what if there are different versions of this glyph available
- const int nKashidaGlyphId = GetRawGlyphIndex( 0x0640 );
+ const int nKashidaGlyphId = FT_Get_Char_Index(maFaceFT, 0x0640);
if( nKashidaGlyphId )
{
- GlyphData aGlyphData;
- InitGlyphData( nKashidaGlyphId, aGlyphData );
- rxTo->SetMinKashida( aGlyphData.GetMetric().GetCharWidth() );
+ if (FT_Load_Glyph(maFaceFT, nKashidaGlyphId, mnLoadFlags) == FT_Err_Ok)
+ {
+ int nWidth = (maFaceFT->glyph->metrics.horiAdvance + 32) >> 6;
+ rxTo->SetMinKashida(nWidth);
+ }
}
}
-static inline void SplitGlyphFlags( const FreetypeFont& rFont, sal_GlyphId& rGlyphId, int& nGlyphFlags )
+static inline void SplitGlyphFlags(sal_GlyphId& rGlyphId, int& nGlyphFlags)
{
nGlyphFlags = rGlyphId & GF_FLAGMASK;
rGlyphId &= GF_IDXMASK;
-
- if( rGlyphId & GF_ISCHAR )
- rGlyphId = rFont.GetRawGlyphIndex( rGlyphId );
}
void FreetypeFont::ApplyGlyphTransform( int nGlyphFlags, FT_Glyph pGlyphFT ) const
@@ -709,133 +696,30 @@ void FreetypeFont::ApplyGlyphTransform( int nGlyphFlags, FT_Glyph pGlyphFT ) con
}
}
-sal_GlyphId FreetypeFont::GetRawGlyphIndex(sal_UCS4 aChar, sal_UCS4 aVS) const
-{
- if( mpFontInfo->IsSymbolFont() )
- {
- if( !FT_IS_SFNT( maFaceFT ) )
- {
- if( (aChar & 0xFF00) == 0xF000 )
- aChar &= 0xFF; // PS font symbol mapping
- else if( aChar > 0xFF )
- return 0;
- }
- }
-
- int nGlyphIndex = 0;
-#if HAVE_FT_FACE_GETCHARVARIANTINDEX
- // If asked, check first for variant glyph with the given Unicode variation
- // selector. This is quite uncommon so we don't bother with caching here.
- // Disabled for buggy FreeType versions:
- // https://bugzilla.mozilla.org/show_bug.cgi?id=618406#c8
- if (aVS && nFTVERSION >= 2404)
- nGlyphIndex = FT_Face_GetCharVariantIndex(maFaceFT, aChar, aVS);
-#endif
-
- if (nGlyphIndex == 0)
- {
- // cache glyph indexes in font info to share between different sizes
- nGlyphIndex = mpFontInfo->GetGlyphIndex( aChar );
- if( nGlyphIndex < 0 )
- {
- nGlyphIndex = FT_Get_Char_Index( maFaceFT, aChar );
- if( !nGlyphIndex)
- {
- // check if symbol aliasing helps
- if( (aChar <= 0x00FF) && mpFontInfo->IsSymbolFont() )
- nGlyphIndex = FT_Get_Char_Index( maFaceFT, aChar | 0xF000 );
- }
- mpFontInfo->CacheGlyphIndex( aChar, nGlyphIndex );
- }
- }
-
- return sal_GlyphId( nGlyphIndex);
-}
-
-sal_GlyphId FreetypeFont::FixupGlyphIndex( sal_GlyphId aGlyphId, sal_UCS4 aChar ) const
-{
- int nGlyphFlags = GF_NONE;
-
- // do glyph substitution if necessary
- // CJK vertical writing needs special treatment
- if( GetFontSelData().mbVertical )
- {
- // TODO: rethink when GSUB is used for non-vertical case
- GlyphSubstitution::const_iterator it = maGlyphSubstitution.find( aGlyphId );
- if( it == maGlyphSubstitution.end() )
- {
- nGlyphFlags |= GetVerticalFlags( aChar );
- }
- else
- {
- // for vertical GSUB also compensate for nOrientation=2700
- aGlyphId = (*it).second;
- nGlyphFlags |= GF_GSUB | GF_ROTL;
- }
- }
-
- if( aGlyphId != 0 )
- aGlyphId |= nGlyphFlags;
-
- return aGlyphId;
-}
-
-sal_GlyphId FreetypeFont::GetGlyphIndex( sal_UCS4 aChar ) const
-{
- sal_GlyphId aGlyphId = GetRawGlyphIndex( aChar );
- aGlyphId = FixupGlyphIndex( aGlyphId, aChar );
- return aGlyphId;
-}
-
-static int lcl_GetCharWidth( FT_FaceRec_* pFaceFT, double fStretch, int nGlyphFlags )
-{
- int nCharWidth = pFaceFT->glyph->metrics.horiAdvance;
-
- if( nGlyphFlags & GF_ROTMASK ) // for bVertical rotated glyphs
- {
- const FT_Size_Metrics& rMetrics = pFaceFT->size->metrics;
- nCharWidth = (int)((rMetrics.height + rMetrics.descender) * fStretch);
- }
-
- return (nCharWidth + 32) >> 6;
-}
-
void FreetypeFont::InitGlyphData( sal_GlyphId aGlyphId, GlyphData& rGD ) const
{
FT_Activate_Size( maSizeFT );
int nGlyphFlags;
- SplitGlyphFlags( *this, aGlyphId, nGlyphFlags );
-
- int nLoadFlags = mnLoadFlags;
+ SplitGlyphFlags(aGlyphId, nGlyphFlags );
-// if( mbArtItalic )
-// nLoadFlags |= FT_LOAD_NO_BITMAP;
-
- FT_Error rc = FT_Load_Glyph( maFaceFT, aGlyphId, nLoadFlags );
+ FT_Error rc = FT_Load_Glyph(maFaceFT, aGlyphId, mnLoadFlags);
if( rc != FT_Err_Ok )
{
// we get here e.g. when a PS font lacks the default glyph
- rGD.SetCharWidth( 0 );
- rGD.SetDelta( 0, 0 );
rGD.SetOffset( 0, 0 );
rGD.SetSize( Size( 0, 0 ) );
return;
}
- const bool bOriginallyZeroWidth = (maFaceFT->glyph->metrics.horiAdvance == 0);
if (mbArtBold)
FT_GlyphSlot_Embolden(maFaceFT->glyph);
- const int nCharWidth = bOriginallyZeroWidth ? 0 : lcl_GetCharWidth( maFaceFT, mfStretch, nGlyphFlags );
- rGD.SetCharWidth( nCharWidth );
-
FT_Glyph pGlyphFT;
FT_Get_Glyph( maFaceFT->glyph, &pGlyphFT );
ApplyGlyphTransform( nGlyphFlags, pGlyphFT );
- rGD.SetDelta( (pGlyphFT->advance.x + 0x8000) >> 16, -((pGlyphFT->advance.y + 0x8000) >> 16) );
FT_BBox aBbox;
FT_Glyph_Get_CBox( pGlyphFT, FT_GLYPH_BBOX_PIXELS, &aBbox );
@@ -947,10 +831,6 @@ bool FreetypeFont::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities)
bool bRet = false;
sal_uLong nLength = 0;
- // load GSUB table
- const FT_Byte* pGSUB = mpFontInfo->GetTable("GSUB", &nLength);
- if (pGSUB)
- vcl::getTTScripts(rFontCapabilities.maGSUBScriptTags, pGSUB, nLength);
// load OS/2 table
const FT_Byte* pOS2 = mpFontInfo->GetTable("OS/2", &nLength);
@@ -1130,7 +1010,7 @@ bool FreetypeFont::GetGlyphOutline( sal_GlyphId aGlyphId,
rB2DPolyPoly.clear();
int nGlyphFlags;
- SplitGlyphFlags( *this, aGlyphId, nGlyphFlags );
+ SplitGlyphFlags(aGlyphId, nGlyphFlags);
FT_Int nLoadFlags = FT_LOAD_DEFAULT | FT_LOAD_IGNORE_TRANSFORM;
diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx
index cebc0eb23bfa..f65843581d52 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -618,7 +618,7 @@ void GenPspGraphics::DrawTextLayout(const CommonSalLayout& rLayout)
if( pText )
aUnicodes[i] = (aCharPosAry[i] >= nMinCharPos && aCharPosAry[i] <= nMaxCharPos) ? pText[ aCharPosAry[i] ] : 0;
else
- aUnicodes[i] = (aGlyphAry[i] & GF_ISCHAR) ? aGlyphId : 0;
+ aUnicodes[i] = 0;
aGlyphAry[i] = aGlyphId;
}
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index 7147be10f6c5..301260477888 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -1364,8 +1364,7 @@ bool WinSalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect )
aMat.eM12 = aMat.eM21 = FixedFromDouble( 0.0 );
UINT nGGOFlags = GGO_METRICS;
- if( !(aGlyphId & GF_ISCHAR) )
- nGGOFlags |= GGO_GLYPH_INDEX;
+ nGGOFlags |= GGO_GLYPH_INDEX;
aGlyphId &= GF_IDXMASK;
GLYPHMETRICS aGM;
@@ -1397,8 +1396,7 @@ bool WinSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId,
aMat.eM12 = aMat.eM21 = FixedFromDouble( 0.0 );
UINT nGGOFlags = GGO_NATIVE;
- if( !(aGlyphId & GF_ISCHAR) )
- nGGOFlags |= GGO_GLYPH_INDEX;
+ nGGOFlags |= GGO_GLYPH_INDEX;
aGlyphId &= GF_IDXMASK;
GLYPHMETRICS aGlyphMetrics;
@@ -1673,11 +1671,6 @@ bool WinSalGraphics::CreateFontSubset( const OUString& rToFile,
// TODO: remap notdef glyph if needed
// TODO: use GDI's GetGlyphIndices instead? Does it handle GSUB properly?
sal_GlyphId aGlyphId = pGlyphIds[i] & GF_IDXMASK;
- if( pGlyphIds[i] & GF_ISCHAR ) // remaining pseudo-glyphs need to be translated
- aGlyphId = xFontCharMap->GetGlyphIndex( aGlyphId );
- if( (pGlyphIds[i] & (GF_ROTMASK|GF_GSUB)) != 0) // TODO: vertical substitution
- {/*####*/}
-
aRealGlyphIds[i] = aGlyphId;
}
@@ -1728,18 +1721,6 @@ bool WinSalGraphics::CreateFontSubset( const OUString& rToFile,
{
aTempEncs[i] = pEncoding[i];
sal_GlyphId aGlyphId = pGlyphIds[i] & GF_IDXMASK;
- if( pGlyphIds[i] & GF_ISCHAR )
- {
- sal_Unicode cChar = static_cast<sal_Unicode>(aGlyphId); // TODO: sal_UCS4
- const bool bVertical = ((pGlyphIds[i] & (GF_ROTMASK|GF_GSUB)) != 0);
- aGlyphId = ::MapChar( aSftTTF.get(), cChar, bVertical );
- if( (aGlyphId == 0) && pFont->IsSymbolFont() )
- {
- // #i12824# emulate symbol aliasing U+FXXX <-> U+0XXX
- cChar = (cChar & 0xF000) ? (cChar & 0x00FF) : (cChar | 0xF000);
- aGlyphId = ::MapChar( aSftTTF.get(), cChar, bVertical );
- }
- }
aShortIDs[i] = static_cast<sal_uInt16>( aGlyphId );
if( !aGlyphId )
if( nNotDef < 0 )
@@ -1862,8 +1843,7 @@ void WinSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont,
if( nChar < 0x00010000 )
{
sal_uInt16 nGlyph = ::MapChar( aSftTTF.get(),
- static_cast<sal_Ucs>(nChar),
- bVertical );
+ static_cast<sal_Ucs>(nChar));
if( nGlyph )
rUnicodeEnc[ static_cast<sal_Unicode>(nChar) ] = nGlyph;
}