Classes | Public Types | Static Public Member Functions | Static Protected Member Functions | Static Protected Attributes

gfxFontUtils Class Reference

#include <gfxFontUtils.h>

Collaboration diagram for gfxFontUtils:

List of all members.

Classes

struct  MacFontNameCharsetMapping
struct  NameHeader
struct  NameRecord

Public Types

enum  {
  NAME_ID_FAMILY = 1, NAME_ID_STYLE = 2, NAME_ID_UNIQUE = 3, NAME_ID_FULL = 4,
  NAME_ID_VERSION = 5, NAME_ID_POSTSCRIPT = 6, NAME_ID_PREFERRED_FAMILY = 16, NAME_ID_PREFERRED_STYLE = 17,
  PLATFORM_ALL = -1, PLATFORM_ID_UNICODE = 0, PLATFORM_ID_MAC = 1, PLATFORM_ID_ISO = 2,
  PLATFORM_ID_MICROSOFT = 3, ENCODING_ID_MAC_ROMAN = 0, ENCODING_ID_MAC_JAPANESE = 1, ENCODING_ID_MAC_TRAD_CHINESE = 2,
  ENCODING_ID_MAC_KOREAN = 3, ENCODING_ID_MAC_ARABIC = 4, ENCODING_ID_MAC_HEBREW = 5, ENCODING_ID_MAC_GREEK = 6,
  ENCODING_ID_MAC_CYRILLIC = 7, ENCODING_ID_MAC_DEVANAGARI = 9, ENCODING_ID_MAC_GURMUKHI = 10, ENCODING_ID_MAC_GUJARATI = 11,
  ENCODING_ID_MAC_SIMP_CHINESE = 25, ENCODING_ID_MICROSOFT_SYMBOL = 0, ENCODING_ID_MICROSOFT_UNICODEBMP = 1, ENCODING_ID_MICROSOFT_SHIFTJIS = 2,
  ENCODING_ID_MICROSOFT_PRC = 3, ENCODING_ID_MICROSOFT_BIG5 = 4, ENCODING_ID_MICROSOFT_WANSUNG = 5, ENCODING_ID_MICROSOFT_JOHAB = 6,
  ENCODING_ID_MICROSOFT_UNICODEFULL = 10, LANG_ALL = -1, LANG_ID_MAC_ENGLISH = 0, LANG_ID_MAC_HEBREW = 10,
  LANG_ID_MAC_JAPANESE = 11, LANG_ID_MAC_ARABIC = 12, LANG_ID_MAC_ICELANDIC = 15, LANG_ID_MAC_TURKISH = 17,
  LANG_ID_MAC_TRAD_CHINESE = 19, LANG_ID_MAC_URDU = 20, LANG_ID_MAC_KOREAN = 23, LANG_ID_MAC_POLISH = 25,
  LANG_ID_MAC_FARSI = 31, LANG_ID_MAC_SIMP_CHINESE = 33, LANG_ID_MAC_ROMANIAN = 37, LANG_ID_MAC_CZECH = 38,
  LANG_ID_MAC_SLOVAK = 39, LANG_ID_MICROSOFT_EN_US = 0x0409, CMAP_MAX_CODEPOINT = 0x10ffff
}
enum  { kUnicodeVS1 = 0xFE00, kUnicodeVS16 = 0xFE0F, kUnicodeVS17 = 0xE0100, kUnicodeVS256 = 0xE01EF }
enum  {
  kUnicodeBidiScriptsStart = 0x0590, kUnicodeBidiScriptsEnd = 0x08FF, kUnicodeBidiPresentationStart = 0xFB1D, kUnicodeBidiPresentationEnd = 0xFEFC,
  kUnicodeFirstHighSurrogateBlock = 0xD800, kUnicodeRLM = 0x200F, kUnicodeRLE = 0x202B, kUnicodeRLO = 0x202E
}

Static Public Member Functions

static PRUint16 ReadShortAt (const PRUint8 *aBuf, PRUint32 aIndex)
static PRUint16 ReadShortAt16 (const PRUint16 *aBuf, PRUint32 aIndex)
static PRUint32 ReadUint24At (const PRUint8 *aBuf, PRUint32 aIndex)
static PRUint32 ReadLongAt (const PRUint8 *aBuf, PRUint32 aIndex)
static nsresult ReadCMAPTableFormat12 (const PRUint8 *aBuf, PRUint32 aLength, gfxSparseBitSet &aCharacterMap)
static nsresult ReadCMAPTableFormat4 (const PRUint8 *aBuf, PRUint32 aLength, gfxSparseBitSet &aCharacterMap)
static nsresult ReadCMAPTableFormat14 (const PRUint8 *aBuf, PRUint32 aLength, PRUint8 *&aTable)
static PRUint32 FindPreferredSubtable (const PRUint8 *aBuf, PRUint32 aBufLength, PRUint32 *aTableOffset, PRUint32 *aUVSTableOffset, PRBool *aSymbolEncoding)
static nsresult ReadCMAP (const PRUint8 *aBuf, PRUint32 aBufLength, gfxSparseBitSet &aCharacterMap, PRUint32 &aUVSOffset, PRPackedBool &aUnicodeFont, PRPackedBool &aSymbolFont)
static PRUint32 MapCharToGlyphFormat4 (const PRUint8 *aBuf, PRUnichar aCh)
static PRUint32 MapCharToGlyphFormat12 (const PRUint8 *aBuf, PRUint32 aCh)
static PRUint16 MapUVSToGlyphFormat14 (const PRUint8 *aBuf, PRUint32 aCh, PRUint32 aVS)
static PRUint32 MapCharToGlyph (const PRUint8 *aBuf, PRUint32 aBufLength, PRUint32 aCh)
static gfxUserFontType DetermineFontDataType (const PRUint8 *aFontData, PRUint32 aFontDataLength)
static PRBool ValidateSFNTHeaders (const PRUint8 *aFontData, PRUint32 aFontDataLength)
static nsresult RenameFont (const nsAString &aName, const PRUint8 *aFontData, PRUint32 aFontDataLength, FallibleTArray< PRUint8 > *aNewFont)
static nsresult ReadNames (FallibleTArray< PRUint8 > &aNameTable, PRUint32 aNameID, PRInt32 aPlatformID, nsTArray< nsString_external > &aNames)
static nsresult ReadCanonicalName (FallibleTArray< PRUint8 > &aNameTable, PRUint32 aNameID, nsString_external &aName)
static PRBool DecodeFontName (const PRUint8 *aBuf, PRInt32 aLength, PRUint32 aPlatformCode, PRUint32 aScriptCode, PRUint32 aLangCode, nsAString &dest)
static bool IsJoinCauser (PRUint32 ch)
static bool IsVarSelector (PRUint32 ch)
static bool IsInvalid (PRUint32 ch)
static PRBool PotentialRTLChar (PRUnichar aCh)
static PRUint8 CharRangeBit (PRUint32 ch)
static void GetPrefsFontList (const char *aPrefName, nsTArray< nsString_external > &aFontList)
static nsresult MakeUniqueUserFontName (nsAString &aName)

Static Protected Member Functions

static nsresult ReadNames (FallibleTArray< PRUint8 > &aNameTable, PRUint32 aNameID, PRInt32 aLangID, PRInt32 aPlatformID, nsTArray< nsString_external > &aNames)
static const char * GetCharsetForFontName (PRUint16 aPlatform, PRUint16 aScript, PRUint16 aLanguage)

Static Protected Attributes

static const
MacFontNameCharsetMapping 
gMacFontNameCharsets []
static const char * gISOFontNameCharsets []
static const char * gMSFontNameCharsets []

Member Enumeration Documentation

anonymous enum
Enumerator:
NAME_ID_FAMILY 
NAME_ID_STYLE 
NAME_ID_UNIQUE 
NAME_ID_FULL 
NAME_ID_VERSION 
NAME_ID_POSTSCRIPT 
NAME_ID_PREFERRED_FAMILY 
NAME_ID_PREFERRED_STYLE 
PLATFORM_ALL 
PLATFORM_ID_UNICODE 
PLATFORM_ID_MAC 
PLATFORM_ID_ISO 
PLATFORM_ID_MICROSOFT 
ENCODING_ID_MAC_ROMAN 
ENCODING_ID_MAC_JAPANESE 
ENCODING_ID_MAC_TRAD_CHINESE 
ENCODING_ID_MAC_KOREAN 
ENCODING_ID_MAC_ARABIC 
ENCODING_ID_MAC_HEBREW 
ENCODING_ID_MAC_GREEK 
ENCODING_ID_MAC_CYRILLIC 
ENCODING_ID_MAC_DEVANAGARI 
ENCODING_ID_MAC_GURMUKHI 
ENCODING_ID_MAC_GUJARATI 
ENCODING_ID_MAC_SIMP_CHINESE 
ENCODING_ID_MICROSOFT_SYMBOL 
ENCODING_ID_MICROSOFT_UNICODEBMP 
ENCODING_ID_MICROSOFT_SHIFTJIS 
ENCODING_ID_MICROSOFT_PRC 
ENCODING_ID_MICROSOFT_BIG5 
ENCODING_ID_MICROSOFT_WANSUNG 
ENCODING_ID_MICROSOFT_JOHAB 
ENCODING_ID_MICROSOFT_UNICODEFULL 
LANG_ALL 
LANG_ID_MAC_ENGLISH 
LANG_ID_MAC_HEBREW 
LANG_ID_MAC_JAPANESE 
LANG_ID_MAC_ARABIC 
LANG_ID_MAC_ICELANDIC 
LANG_ID_MAC_TURKISH 
LANG_ID_MAC_TRAD_CHINESE 
LANG_ID_MAC_URDU 
LANG_ID_MAC_KOREAN 
LANG_ID_MAC_POLISH 
LANG_ID_MAC_FARSI 
LANG_ID_MAC_SIMP_CHINESE 
LANG_ID_MAC_ROMANIAN 
LANG_ID_MAC_CZECH 
LANG_ID_MAC_SLOVAK 
LANG_ID_MICROSOFT_EN_US 
CMAP_MAX_CODEPOINT 
anonymous enum
Enumerator:
kUnicodeVS1 
kUnicodeVS16 
kUnicodeVS17 
kUnicodeVS256 
anonymous enum
Enumerator:
kUnicodeBidiScriptsStart 
kUnicodeBidiScriptsEnd 
kUnicodeBidiPresentationStart 
kUnicodeBidiPresentationEnd 
kUnicodeFirstHighSurrogateBlock 
kUnicodeRLM 
kUnicodeRLE 
kUnicodeRLO 

Member Function Documentation

static PRUint8 gfxFontUtils::CharRangeBit ( PRUint32  ch  )  [static]
static PRBool gfxFontUtils::DecodeFontName ( const PRUint8 *  aBuf,
PRInt32  aLength,
PRUint32  aPlatformCode,
PRUint32  aScriptCode,
PRUint32  aLangCode,
nsAString dest 
) [static]
static gfxUserFontType gfxFontUtils::DetermineFontDataType ( const PRUint8 *  aFontData,
PRUint32  aFontDataLength 
) [static]
static PRUint32 gfxFontUtils::FindPreferredSubtable ( const PRUint8 *  aBuf,
PRUint32  aBufLength,
PRUint32 *  aTableOffset,
PRUint32 *  aUVSTableOffset,
PRBool aSymbolEncoding 
) [static]
static const char* gfxFontUtils::GetCharsetForFontName ( PRUint16  aPlatform,
PRUint16  aScript,
PRUint16  aLanguage 
) [static, protected]
static void gfxFontUtils::GetPrefsFontList ( const char *  aPrefName,
nsTArray< nsString_external > &  aFontList 
) [static]
static bool gfxFontUtils::IsInvalid ( PRUint32  ch  )  [inline, static]
static bool gfxFontUtils::IsJoinCauser ( PRUint32  ch  )  [inline, static]
static bool gfxFontUtils::IsVarSelector ( PRUint32  ch  )  [inline, static]
static nsresult gfxFontUtils::MakeUniqueUserFontName ( nsAString aName  )  [static]
static PRUint32 gfxFontUtils::MapCharToGlyph ( const PRUint8 *  aBuf,
PRUint32  aBufLength,
PRUint32  aCh 
) [static]
static PRUint32 gfxFontUtils::MapCharToGlyphFormat12 ( const PRUint8 *  aBuf,
PRUint32  aCh 
) [static]
static PRUint32 gfxFontUtils::MapCharToGlyphFormat4 ( const PRUint8 *  aBuf,
PRUnichar  aCh 
) [static]
static PRUint16 gfxFontUtils::MapUVSToGlyphFormat14 ( const PRUint8 *  aBuf,
PRUint32  aCh,
PRUint32  aVS 
) [static]
static PRBool gfxFontUtils::PotentialRTLChar ( PRUnichar  aCh  )  [inline, static]
static nsresult gfxFontUtils::ReadCanonicalName ( FallibleTArray< PRUint8 > &  aNameTable,
PRUint32  aNameID,
nsString_external aName 
) [static]
static nsresult gfxFontUtils::ReadCMAP ( const PRUint8 *  aBuf,
PRUint32  aBufLength,
gfxSparseBitSet aCharacterMap,
PRUint32 &  aUVSOffset,
PRPackedBool aUnicodeFont,
PRPackedBool aSymbolFont 
) [static]
static nsresult gfxFontUtils::ReadCMAPTableFormat12 ( const PRUint8 *  aBuf,
PRUint32  aLength,
gfxSparseBitSet aCharacterMap 
) [static]
static nsresult gfxFontUtils::ReadCMAPTableFormat14 ( const PRUint8 *  aBuf,
PRUint32  aLength,
PRUint8 *&  aTable 
) [static]
static nsresult gfxFontUtils::ReadCMAPTableFormat4 ( const PRUint8 *  aBuf,
PRUint32  aLength,
gfxSparseBitSet aCharacterMap 
) [static]
static PRUint32 gfxFontUtils::ReadLongAt ( const PRUint8 *  aBuf,
PRUint32  aIndex 
) [inline, static]
static nsresult gfxFontUtils::ReadNames ( FallibleTArray< PRUint8 > &  aNameTable,
PRUint32  aNameID,
PRInt32  aLangID,
PRInt32  aPlatformID,
nsTArray< nsString_external > &  aNames 
) [static, protected]
static nsresult gfxFontUtils::ReadNames ( FallibleTArray< PRUint8 > &  aNameTable,
PRUint32  aNameID,
PRInt32  aPlatformID,
nsTArray< nsString_external > &  aNames 
) [static]
static PRUint16 gfxFontUtils::ReadShortAt ( const PRUint8 *  aBuf,
PRUint32  aIndex 
) [inline, static]
static PRUint16 gfxFontUtils::ReadShortAt16 ( const PRUint16 *  aBuf,
PRUint32  aIndex 
) [inline, static]
static PRUint32 gfxFontUtils::ReadUint24At ( const PRUint8 *  aBuf,
PRUint32  aIndex 
) [inline, static]
static nsresult gfxFontUtils::RenameFont ( const nsAString aName,
const PRUint8 *  aFontData,
PRUint32  aFontDataLength,
FallibleTArray< PRUint8 > *  aNewFont 
) [static]
static PRBool gfxFontUtils::ValidateSFNTHeaders ( const PRUint8 *  aFontData,
PRUint32  aFontDataLength 
) [static]

Member Data Documentation

const char* gfxFontUtils::gISOFontNameCharsets[] [static, protected]
const char* gfxFontUtils::gMSFontNameCharsets[] [static, protected]

The documentation for this class was generated from the following file: