Drop "CJK extra leading" crack

It have been unused on Mac OS X since since 2008 (commit
da4d070d9d).

Change-Id: I4b3eabe71a54021903009310a87319c9caecfd4c
This commit is contained in:
Khaled Hosny
2013-06-04 00:16:06 +02:00
parent 5e33f1c09b
commit a3e97576aa
4 changed files with 0 additions and 89 deletions

View File

@@ -66,7 +66,6 @@ ImplMacFontData::ImplMacFontData( const ImplDevFontAttributes& rDFA, ATSUFontID
, mbOs2Read( false ) , mbOs2Read( false )
, mbHasOs2Table( false ) , mbHasOs2Table( false )
, mbCmapEncodingRead( false ) , mbCmapEncodingRead( false )
, mbHasCJKSupport( false )
, mbFontCapabilitiesRead( false ) , mbFontCapabilitiesRead( false )
{} {}
@@ -110,7 +109,6 @@ inline FourCharCode GetTag(const char aTagName[5])
} }
static unsigned GetUShort( const unsigned char* p ){return((p[0]<<8)+p[1]);} static unsigned GetUShort( const unsigned char* p ){return((p[0]<<8)+p[1]);}
static unsigned GetUInt( const unsigned char* p ) { return((p[0]<<24)+(p[1]<<16)+(p[2]<<8)+p[3]);}
#if MACOSX_SDK_VERSION >= 1070 #if MACOSX_SDK_VERSION >= 1070
extern "C" { extern "C" {
@@ -240,16 +238,6 @@ void ImplMacFontData::ReadOs2Table( void ) const
// parse the OS/2 raw data // parse the OS/2 raw data
// TODO: also analyze panose info, etc. // TODO: also analyze panose info, etc.
// check if the fonts needs the "CJK extra leading" heuristic
const unsigned char* pOS2map = &aBuffer[0];
const sal_uInt32 nVersion = GetUShort( pOS2map );
if( nVersion >= 0x0001 )
{
sal_uInt32 ulUnicodeRange2 = GetUInt( pOS2map + 46 );
if( ulUnicodeRange2 & 0x2DF00000 )
mbHasCJKSupport = true;
}
} }
void ImplMacFontData::ReadMacCmapEncoding( void ) const void ImplMacFontData::ReadMacCmapEncoding( void ) const
@@ -281,36 +269,6 @@ void ImplMacFontData::ReadMacCmapEncoding( void ) const
return; return;
if( GetUShort( pCmap ) != 0x0000 ) if( GetUShort( pCmap ) != 0x0000 )
return; return;
// check if the fonts needs the "CJK extra leading" heuristic
int nSubTables = GetUShort( pCmap + 2 );
for( const unsigned char* p = pCmap + 4; --nSubTables >= 0; p += 8 )
{
int nPlatform = GetUShort( p );
if( nPlatform == kFontMacintoshPlatform ) {
int nEncoding = GetUShort (p + 2 );
if( nEncoding == kFontJapaneseScript ||
nEncoding == kFontTraditionalChineseScript ||
nEncoding == kFontKoreanScript ||
nEncoding == kFontSimpleChineseScript )
{
mbHasCJKSupport = true;
break;
}
}
}
}
// -----------------------------------------------------------------------
bool ImplMacFontData::HasCJKSupport( void ) const
{
ReadOs2Table();
if( !mbHasOs2Table )
ReadMacCmapEncoding();
return mbHasCJKSupport;
} }
// ======================================================================= // =======================================================================

View File

@@ -77,7 +77,6 @@ ImplMacFontData::ImplMacFontData( const ImplMacFontData& rSrc )
, mbOs2Read( rSrc.mbOs2Read ) , mbOs2Read( rSrc.mbOs2Read )
, mbHasOs2Table( rSrc.mbHasOs2Table ) , mbHasOs2Table( rSrc.mbHasOs2Table )
, mbCmapEncodingRead( rSrc.mbCmapEncodingRead ) , mbCmapEncodingRead( rSrc.mbCmapEncodingRead )
, mbHasCJKSupport( rSrc.mbHasCJKSupport )
{ {
if( mpCharMap ) if( mpCharMap )
mpCharMap->AddReference(); mpCharMap->AddReference();
@@ -92,7 +91,6 @@ ImplMacFontData::ImplMacFontData( const ImplDevFontAttributes& rDFA, sal_IntPtr
, mbOs2Read( false ) , mbOs2Read( false )
, mbHasOs2Table( false ) , mbHasOs2Table( false )
, mbCmapEncodingRead( false ) , mbCmapEncodingRead( false )
, mbHasCJKSupport( false )
, mbFontCapabilitiesRead( false ) , mbFontCapabilitiesRead( false )
{} {}
@@ -121,7 +119,6 @@ ImplFontEntry* ImplMacFontData::CreateFontInstance(FontSelectPattern& rFSD) cons
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
static unsigned GetUShort( const unsigned char* p ){return((p[0]<<8)+p[1]);} static unsigned GetUShort( const unsigned char* p ){return((p[0]<<8)+p[1]);}
static unsigned GetUInt( const unsigned char* p ) { return((p[0]<<24)+(p[1]<<16)+(p[2]<<8)+p[3]);}
const ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const const ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const
{ {
@@ -233,16 +230,6 @@ void ImplMacFontData::ReadOs2Table( void ) const
// parse the OS/2 raw data // parse the OS/2 raw data
// TODO: also analyze panose info, etc. // TODO: also analyze panose info, etc.
// check if the fonts needs the "CJK extra leading" heuristic
const unsigned char* pOS2map = &aBuffer[0];
const sal_uInt32 nVersion = GetUShort( pOS2map );
if( nVersion >= 0x0001 )
{
sal_uInt32 ulUnicodeRange2 = GetUInt( pOS2map + 46 );
if( ulUnicodeRange2 & 0x2DF00000 )
mbHasCJKSupport = true;
}
} }
void ImplMacFontData::ReadMacCmapEncoding( void ) const void ImplMacFontData::ReadMacCmapEncoding( void ) const
@@ -266,40 +253,10 @@ void ImplMacFontData::ReadMacCmapEncoding( void ) const
const unsigned char* pCmap = &aBuffer[0]; const unsigned char* pCmap = &aBuffer[0];
if( GetUShort( pCmap ) != 0x0000 ) if( GetUShort( pCmap ) != 0x0000 )
return; return;
// check if the fonts needs the "CJK extra leading" heuristic
int nSubTables = GetUShort( pCmap + 2 );
for( const unsigned char* p = pCmap + 4; --nSubTables >= 0; p += 8 )
{
int nPlatform = GetUShort( p );
if( nPlatform == kFontMacintoshPlatform ) {
int nEncoding = GetUShort (p + 2 );
if( nEncoding == kFontJapaneseScript ||
nEncoding == kFontTraditionalChineseScript ||
nEncoding == kFontKoreanScript ||
nEncoding == kFontSimpleChineseScript )
{
mbHasCJKSupport = true;
break;
}
}
}
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
bool ImplMacFontData::HasCJKSupport( void ) const
{
ReadOs2Table();
if( !mbHasOs2Table )
ReadMacCmapEncoding();
return mbHasCJKSupport;
}
// =======================================================================
AquaSalGraphics::AquaSalGraphics() AquaSalGraphics::AquaSalGraphics()
: mpFrame( NULL ) : mpFrame( NULL )
, mxLayer( NULL ) , mxLayer( NULL )

View File

@@ -60,7 +60,6 @@ public:
void ReadOs2Table() const; void ReadOs2Table() const;
void ReadMacCmapEncoding() const; void ReadMacCmapEncoding() const;
bool HasCJKSupport() const;
private: private:
const ATSUFontID mnFontId; const ATSUFontID mnFontId;
@@ -69,7 +68,6 @@ private:
mutable bool mbOs2Read; // true if OS2-table related info is valid mutable bool mbOs2Read; // true if OS2-table related info is valid
mutable bool mbHasOs2Table; mutable bool mbHasOs2Table;
mutable bool mbCmapEncodingRead; // true if cmap encoding of Mac font is read mutable bool mbCmapEncodingRead; // true if cmap encoding of Mac font is read
mutable bool mbHasCJKSupport; // #i78970# CJK fonts need extra leading
mutable bool mbFontCapabilitiesRead; mutable bool mbFontCapabilitiesRead;
}; };

View File

@@ -71,7 +71,6 @@ public:
void ReadOs2Table() const; void ReadOs2Table() const;
void ReadMacCmapEncoding() const; void ReadMacCmapEncoding() const;
bool HasCJKSupport() const;
protected: protected:
ImplMacFontData( const ImplMacFontData&); ImplMacFontData( const ImplMacFontData&);
@@ -82,7 +81,6 @@ private:
mutable bool mbOs2Read; // true if OS2-table related info is valid mutable bool mbOs2Read; // true if OS2-table related info is valid
mutable bool mbHasOs2Table; mutable bool mbHasOs2Table;
mutable bool mbCmapEncodingRead; // true if cmap encoding of Mac font is read mutable bool mbCmapEncodingRead; // true if cmap encoding of Mac font is read
mutable bool mbHasCJKSupport; // #i78970# CJK fonts need extra leading
mutable bool mbFontCapabilitiesRead; mutable bool mbFontCapabilitiesRead;
}; };