else if (ftCharMap.EqualsIgnoreCase("unicode"))
else if (ftCharMap.LowerCaseEqualsLiteral("unicode"))
GetEncoding(const char *aFontName, char **aEncoding, nsXftFontType &aType,            FT_Encoding &aFTEncoding){  // below is a list of common used name for startup    if ((!strcmp(aFontName, "Helvetica" )) ||         (!strcmp(aFontName, "Times" )) ||         (!strcmp(aFontName, "Times New Roman" )) ||         (!strcmp(aFontName, "Courier New" )) ||         (!strcmp(aFontName, "Courier" )) ||         (!strcmp(aFontName, "Arial" )) ||         (!strcmp(aFontName, "MS P Gothic" )) ||        (!strcmp(aFontName, "Verdana" ))) {        // error mean do not get a special encoding        return NS_ERROR_NOT_AVAILABLE;     }    nsCAutoString name;    name.Assign(NS_LITERAL_CSTRING("encoding.") +                 nsDependentCString(aFontName) + NS_LITERAL_CSTRING(".ttf"));    name.StripWhitespace();    ToLowerCase(name);    // if we have not init the property yet, init it right now.    if (!gFontEncodingProperties)        NS_LoadPersistentPropertiesFromURISpec(&gFontEncodingProperties,            NS_LITERAL_CSTRING("resource://gre/res/fonts/fontEncoding.properties"));    nsAutoString encoding;    *aEncoding = nsnull;    if (gFontEncodingProperties) {        nsresult rv = gFontEncodingProperties->GetStringProperty(name,                                                                 encoding);        if (NS_FAILED(rv))             return NS_ERROR_NOT_AVAILABLE;  // Unicode font        // '.wide' at the end indicates 'wide' font.        if (encoding.Length() > 5 &&             StringEndsWith(encoding, NS_LITERAL_STRING(".wide"))) {            aType = eFontTypeCustomWide;            encoding.Truncate(encoding.Length() - 5);        }        else  {            aType = eFontTypeCustom;            // Mathematica and TeX CM truetype fonts have both Apple Roman            // (PID=1, EID=0) and Unicode (PID=3, EID=1) cmaps. In the            // former, Unicode cmap uses codepoints in PUA beginning            // at U+F000 not representable in a single byte encoding            // like MathML encodings. ( On the other hand, TeX CM fonts            // have 'pseudo-Unicode' cmap with codepoints below U+0100.)            // Unicode to font encoding converters for MathML map input             // Unicode codepoints to 'pseudo-glyph indices' in Apple Roman             // for  Mathematica, Symbol and MTExtra fonts while it maps            // input Unicode codepoints  to 'pseudo-glyph indices' in             // 'Unicode cmap' for TeX CM fonts. Therefore we have to select            // different FT_Encoding for two groups to guarantee that            // glyph index look-up with FT_Get_Char_Index succeeds for            // all MathML fonts. Instead of hard-coding this relation,            // it's put in fontEncoding.properties file and is parsed here.                      nsAutoString ftCharMap;             nsresult rv = gFontEncodingProperties->GetStringProperty(                          Substring(name, 0, name.Length() - 4) +                           NS_LITERAL_CSTRING(".ftcmap"), ftCharMap);                      if (NS_FAILED(rv))                 aFTEncoding = ft_encoding_none;            else if (ftCharMap.EqualsIgnoreCase("mac_roman"))                aFTEncoding = ft_encoding_apple_roman;            else if (ftCharMap.EqualsIgnoreCase("unicode"))                aFTEncoding = ft_encoding_unicode;        }        // encoding name is always in US-ASCII so that there's no loss here.        *aEncoding = ToNewCString(encoding);        if (PR_LOG_TEST(gXftFontLoad, PR_LOG_DEBUG)) {          printf("\t\tc> it's %s and encoding is %s\n",                  aType==eFontTypeCustom ? "narrow" : "wide", *aEncoding);        }        return NS_OK;    }    return NS_ERROR_NOT_AVAILABLE;}