Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions
nsMacUnicodeFontInfo Class Reference

#include <nsMacUnicodeFontInfo.h>

List of all members.

Public Member Functions

PRBool HasGlyphFor (PRUnichar aChar)

Static Public Member Functions

static void FreeGlobals ()
static nsresult GetConverterAndCCMap (const nsString &aFontName, nsIUnicodeEncoder **aConverter, PRUint16 **aCCMap)

Detailed Description

Definition at line 45 of file nsMacUnicodeFontInfo.h.


Member Function Documentation

Definition at line 618 of file nsMacUnicodeFontInfo.cpp.

Here is the call graph for this function:

nsresult nsMacUnicodeFontInfo::GetConverterAndCCMap ( const nsString aFontName,
nsIUnicodeEncoder **  aConverter,
PRUint16 **  aCCMap 
) [static]

Definition at line 565 of file nsMacUnicodeFontInfo.cpp.

{
    if(NS_SUCCEEDED(GetConverter(NS_ConvertUCS2toUTF8(aFontName), aConverter)) && *aConverter)
    {
        // make sure we have the hashtable
        if(!gFontMaps)
        {
            gFontMaps = new nsObjectHashtable(nsnull, nsnull, HashtableFreeCCMap, nsnull);
            if(!gFontMaps)
            {
                *aConverter = nsnull;
                return NS_ERROR_OUT_OF_MEMORY;
            }
        }

        // first try to retrieve the ccmap for this font from the hashtable
        nsStringKey hashKey(aFontName);
        *aCCMap = (PRUint16*) gFontMaps->Get(&hashKey);
        if(!*aCCMap)
        {
            // if it's not already in the hashtable, create it and add it to the hashtable
            *aCCMap = GetCCMapThroughConverter(*aConverter);
            if(!*aCCMap)
            {
                *aConverter = nsnull;
                return NS_ERROR_FAILURE;
            }
            gFontMaps->Put(&hashKey, *aCCMap);
        }
        return NS_OK;
    }
    return NS_ERROR_FAILURE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 602 of file nsMacUnicodeFontInfo.cpp.

{
  if (0xfffd == aChar)
    return PR_FALSE;

  if (!gCCMap) 
    gCCMap = InitGlobalCCMap();

  NS_ASSERTION(gCCMap, "cannot init global ccmap");
    
  if (gCCMap)
    return CCMAP_HAS_CHAR(gCCMap, aChar);

  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:


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