Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsMathMLChar.cpp File Reference
#include "nsCOMPtr.h"
#include "nsFrame.h"
#include "nsPresContext.h"
#include "nsUnitConversion.h"
#include "nsStyleContext.h"
#include "nsStyleConsts.h"
#include "nsString.h"
#include "nsUnicharUtils.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#include "nsISupportsPrimitives.h"
#include "nsIComponentManager.h"
#include "nsIPersistentProperties2.h"
#include "nsIServiceManager.h"
#include "nsIObserverService.h"
#include "nsIObserver.h"
#include "nsNetUtil.h"
#include "nsILookAndFeel.h"
#include "nsIDeviceContext.h"
#include "nsCSSRendering.h"
#include "prprf.h"
#include "nsIDOMWindow.h"
#include "nsINonBlockingAlertService.h"
#include "nsIWindowWatcher.h"
#include "nsIStringBundle.h"
#include "nsDoubleHashtable.h"
#include "nsMathMLOperators.h"
#include "nsMathMLChar.h"

Go to the source code of this file.

Classes

class  nsGlyphTable
class  nsBaseFontEntry
class  nsGlyphTableList
struct  StretchyFontEnumContext
struct  PreferredFontEnumContext
struct  MathFontEnumContext

Defines

#define NS_TABLE_TYPE_UNICODE   0
#define NS_TABLE_TYPE_GLYPH_INDEX   1
#define NS_TABLE_STATE_ERROR   -1
#define NS_TABLE_STATE_EMPTY   0
#define NS_TABLE_STATE_READY   1
#define NS_MATHML_DELIMITER_FACTOR   0.901f
#define NS_MATHML_DELIMITER_SHORTFALL   NSFloatPointsToTwips(5.0f)

Functions

static PRBool CheckFontExistence (nsPresContext *aPresContext, const nsString &aFontName)
static void AlertMissingFonts (nsString &aMissingFonts)
static void Clean (nsString &aValue)
static nsresult LoadProperties (const nsString &aName, nsCOMPtr< nsIPersistentProperties > &aProperties)
static nsStretchDirection GetStretchyDirection (PRUnichar aChar)
static PRBool StretchyFontEnumCallback (const nsString &aFamily, PRBool aGeneric, void *aData)
static PRBool PreferredFontEnumCallback (const nsString &aFamily, PRBool aGeneric, void *aData)
static PRBool GetPrefValue (nsIPrefBranch *aPrefBranch, const char *aPrefKey, nsString &aPrefValue)
static void SetPreferredFonts (const char *aKey, nsString &aFamilyList)
static PRBool MathFontEnumCallback (const nsString &aFamily, PRBool aGeneric, void *aData)
static nsresult InitGlobals (nsPresContext *aPresContext)
static void SetBaseFamily (PRUnichar aChar, nsFont &aFont)
static PRBool IsSizeOK (nscoord a, nscoord b, PRUint32 aHint)
static PRBool IsSizeBetter (nscoord a, nscoord olda, nscoord b, PRUint32 aHint)
static nscoord ComputeSizeFromParts (nsGlyphCode *aGlyphs, nscoord *aSizes, nscoord aTargetSize, PRUint32 aHint)
void SetFirstFamily (nsFont &aFont, const nsString &aFamily)

Variables

static const PRUnichar kSpaceCh = PRUnichar(' ')
static const nsGlyphCode kNullGlyph = {0, 0}
static nsCOMPtr
< nsIPersistentProperties
gPUAProperties
static nsGlyphTableListgGlyphTableList = nsnull
static PRBool gInitialized = PR_FALSE

Class Documentation

struct StretchyFontEnumContext

Definition at line 863 of file nsMathMLChar.cpp.

Collaboration diagram for StretchyFontEnumContext:
Class Members
nsMathMLChar * mChar
nsVoidArray * mGlyphTableList
nsPresContext * mPresContext
struct PreferredFontEnumContext

Definition at line 963 of file nsMathMLChar.cpp.

Class Members
PRInt32 mCharIndex
PRInt32 mFontCount
PRBool mIsFontForParts
struct MathFontEnumContext

Definition at line 1102 of file nsMathMLChar.cpp.

Collaboration diagram for MathFontEnumContext:
Class Members
nsString * mMissingFamilyList
nsPresContext * mPresContext

Define Documentation

Definition at line 1422 of file nsMathMLChar.cpp.

Definition at line 1423 of file nsMathMLChar.cpp.

Definition at line 128 of file nsMathMLChar.cpp.

Definition at line 127 of file nsMathMLChar.cpp.

Definition at line 129 of file nsMathMLChar.cpp.

Definition at line 125 of file nsMathMLChar.cpp.

Definition at line 124 of file nsMathMLChar.cpp.


Function Documentation

static void AlertMissingFonts ( nsString aMissingFonts) [static]

Definition at line 150 of file nsMathMLChar.cpp.

{
  nsCOMPtr<nsIStringBundleService> sbs(do_GetService(NS_STRINGBUNDLE_CONTRACTID));
  if (!sbs)
    return;

  nsCOMPtr<nsIStringBundle> sb;
  sbs->CreateBundle("resource://gre/res/fonts/mathfont.properties", getter_AddRefs(sb));
  if (!sb)
    return;

  nsXPIDLString title, message;
  const PRUnichar* strings[] = { aMissingFonts.get() };
  sb->GetStringFromName(NS_LITERAL_STRING("mathfont_missing_dialog_title").get(), getter_Copies(title));
  sb->FormatStringFromName(NS_LITERAL_STRING("mathfont_missing_dialog_message").get(),
                           strings, 1, getter_Copies(message));

  nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
  if (!wwatch)
    return;

  nsCOMPtr<nsIDOMWindow> parent;
  wwatch->GetActiveWindow(getter_AddRefs(parent));
  nsresult rv;
  nsCOMPtr<nsINonBlockingAlertService> prompter =
    do_GetService("@mozilla.org/embedcomp/nbalert-service;1", &rv);

  if (prompter && parent) {
    prompter->ShowNonBlockingAlert(parent, title.get(), message.get());
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool CheckFontExistence ( nsPresContext aPresContext,
const nsString aFontName 
) [static]

Definition at line 136 of file nsMathMLChar.cpp.

{
  PRBool aliased;
  nsAutoString localName;
  nsIDeviceContext *deviceContext = aPresContext->DeviceContext();
  deviceContext->GetLocalFontName(aFontName, localName, aliased);
  PRBool rv = (aliased || (NS_OK == deviceContext->CheckFontExistence(localName)));
  // (see bug 35824 for comments about the aliased localName)
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void Clean ( nsString aValue) [static]

Definition at line 184 of file nsMathMLChar.cpp.

{
  // chop the trailing # comment portion if any ...
  PRInt32 comment = aValue.RFindChar('#');
  if (comment > 0) aValue.Truncate(comment);
  aValue.CompressWhitespace();
}

Here is the caller graph for this function:

static nscoord ComputeSizeFromParts ( nsGlyphCode aGlyphs,
nscoord aSizes,
nscoord  aTargetSize,
PRUint32  aHint 
) [static]

Definition at line 1478 of file nsMathMLChar.cpp.

{
  enum {first, middle, last, glue};
  float flex[] = {0.901f, 0.901f, 0.901f};
  // refine the flexibility depending on whether some parts can be left out
  if (aGlyphs[glue] == aGlyphs[middle]) flex[middle] = 0.0f;
  if (aGlyphs[glue] == aGlyphs[first]) flex[first] = 0.0f;
  if (aGlyphs[glue] == aGlyphs[last]) flex[last] = 0.0f;

  // get the minimum allowable size
  nscoord computedSize = nscoord(flex[first] * aSizes[first] +
                                 flex[middle] * aSizes[middle] +
                                 flex[last] * aSizes[last]);

  if (computedSize <= aTargetSize) {
    // if we can afford more room, the default is to fill-up the target area
    return aTargetSize;
  }
  if (IsSizeOK(computedSize, aTargetSize, aHint)) {
    // settle with the size, and let Paint() do the rest
    return computedSize;
  }
  // reject these parts
  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool GetPrefValue ( nsIPrefBranch aPrefBranch,
const char *  aPrefKey,
nsString aPrefValue 
) [static]

Definition at line 1033 of file nsMathMLChar.cpp.

{
  aPrefValue.Truncate();
  if (aPrefBranch) {
    nsCOMPtr<nsISupportsString> prefString;
    aPrefBranch->GetComplexValue(aPrefKey,
                                 NS_GET_IID(nsISupportsString),
                                 getter_AddRefs(prefString));
    if (prefString) {
      prefString->GetData(aPrefValue);
    }
  }
  return !aPrefValue.IsEmpty();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 208 of file nsMathMLChar.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult InitGlobals ( nsPresContext aPresContext) [static]

Definition at line 1134 of file nsMathMLChar.cpp.

{
  NS_ASSERTION(!gInitialized, "Error -- already initialized");
  gInitialized = PR_TRUE;
  PRUint32 count = nsMathMLOperators::CountStretchyOperator();
  if (!count) {
    // nothing to stretch, so why bother...
    return NS_OK;
  }

  // Allocate the placeholders for the preferred parts and variants
  nsresult rv = NS_ERROR_OUT_OF_MEMORY;
  gGlyphTableList = new nsGlyphTableList();
  nsGlyphTableList::gBaseFonts = new nsBaseFontHashtable();
  if (gGlyphTableList && nsGlyphTableList::gBaseFonts) {
    nsGlyphTableList::gParts = new PRInt32[count];
    nsGlyphTableList::gVariants = new PRInt32[count];
    if (nsGlyphTableList::gParts && nsGlyphTableList::gVariants) {
      rv = gGlyphTableList->Initialize();
    }
  }
  if (NS_FAILED(rv)) {
    delete gGlyphTableList;
    delete nsGlyphTableList::gBaseFonts;
    delete [] nsGlyphTableList::gParts;
    delete [] nsGlyphTableList::gVariants;
    gGlyphTableList = nsnull;
    nsGlyphTableList::gBaseFonts = nsnull;
    nsGlyphTableList::gParts = nsnull;
    nsGlyphTableList::gVariants = nsnull;
    return rv;
  }
  /*
  else
    The gGlyphTableList has been successfully registered as a shutdown observer.
    It will be deleted at shutdown, even if a failure happens below.
  */

  PRUint32 i;
  for (i = 0; i < count; i++) {
    nsGlyphTableList::gParts[i] = kNotFound; // i.e., -1
    nsGlyphTableList::gVariants[i] = kNotFound; // i.e., -1
  }
  nsGlyphTableList::gBaseFonts->Init(5);

  nsCAutoString key;
  nsAutoString value;
  nsCOMPtr<nsIPersistentProperties> mathfontProp;
  nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));

  // Add the math fonts in the gGlyphTableList in order of preference ...
  // Note: we only load font-names at this stage. The actual glyph tables will
  // be loaded lazily (see nsGlyphTable::ElementAt()).

  // Load the "mathfont.properties" file
  value.Truncate();
  rv = LoadProperties(value, mathfontProp);
  if (NS_FAILED(rv)) return rv;

  // Load the "mathfontPUA.properties" file
  value.AssignLiteral("PUA");
  rv = LoadProperties(value, gPUAProperties);
  if (NS_FAILED(rv)) return rv;

  // Get the default list of mathfonts to be used for stretchy characters
  nsFont font(nsnull, 0, 0, 0, 0, 0);
  NS_NAMED_LITERAL_CSTRING(defaultKey, "font.mathfont-family");
  if (!GetPrefValue(prefBranch, defaultKey.get(), font.name)) {
    // fallback to the internal default list
    rv = mathfontProp->GetStringProperty(defaultKey, font.name);
    if (NS_FAILED(rv)) return rv;
  }

  // Parse the font list and append an entry for each family to gGlyphTableList
  nsAutoString missingFamilyList;
  MathFontEnumContext context = {aPresContext, &missingFamilyList};
  font.EnumerateFamilies(MathFontEnumCallback, &context);
  // Append a null separator
  gGlyphTableList->AppendTable(nsnull);

  // alert the user if some of the expected fonts are missing
  if (!missingFamilyList.IsEmpty()) {
    AlertMissingFonts(missingFamilyList);
  }

  // Let the particular characters have their preferred fonts

  // First, look the prefs of the user
  char **allKey = nsnull;
  prefBranch->GetChildList("font.mathfont-family.", &count, &allKey);    
  for (i = 0; i < count; ++i) {
#ifdef DEBUG_rbs
    char str[50];
    GetPrefValue(prefBranch, allKey[i], value);
    value.ToCString(str, sizeof(str));
    printf("Found user pref %s: %s\n", allKey[i], str);
#endif
    if ((30 < strlen(allKey[i])) && 
        GetPrefValue(prefBranch, allKey[i], value)) {
      SetPreferredFonts(allKey[i], value);
    }
  }
  NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(count, allKey);

  // Next, look our internal settings
  nsCOMPtr<nsISimpleEnumerator> iterator;
  if (NS_SUCCEEDED(mathfontProp->Enumerate(getter_AddRefs(iterator)))) {
    PRBool more;
    while ((NS_SUCCEEDED(iterator->HasMoreElements(&more))) && more) {
      nsCOMPtr<nsIPropertyElement> element;
      if (NS_SUCCEEDED(iterator->GetNext(getter_AddRefs(element)))) {
        if (NS_SUCCEEDED(element->GetKey(key))) {
          if ((30 < key.Length()) && 
              (0 == key.Find("font.mathfont-family.\\u")) &&
              !GetPrefValue(prefBranch, key.get(), value) && // priority to user
              NS_SUCCEEDED(element->GetValue(value))) {
            Clean(value);
            SetPreferredFonts(key.get(), value);
          }
        }
      }
    }
  }
  return rv;
}

Here is the call graph for this function:

static PRBool IsSizeBetter ( nscoord  a,
nscoord  olda,
nscoord  b,
PRUint32  aHint 
) [static]

Definition at line 1459 of file nsMathMLChar.cpp.

{
  if (0 == olda) return PR_TRUE;
  if (PR_ABS(a - b) < PR_ABS(olda - b)) {
    if (aHint & (NS_STRETCH_NORMAL | NS_STRETCH_NEARER))
      return PR_TRUE;
    if (aHint & NS_STRETCH_SMALLER)
      return PRBool(a < olda);
    if (aHint & (NS_STRETCH_LARGER | NS_STRETCH_LARGEOP))
      return PRBool(a > olda);
  }
  return PR_FALSE;
}

Here is the caller graph for this function:

static PRBool IsSizeOK ( nscoord  a,
nscoord  b,
PRUint32  aHint 
) [static]

Definition at line 1426 of file nsMathMLChar.cpp.

{
  // Normal: True if 'a' is around +/-10% of the target 'b' (10% is
  // 1-DelimiterFactor). This often gives a chance to the base size to
  // win, especially in the context of <mfenced> without tall elements
  // or in sloppy markups without protective <mrow></mrow>
  PRBool isNormal =
    (aHint & NS_STRETCH_NORMAL)
    && PRBool(float(PR_ABS(a - b))
              < (1.0f - NS_MATHML_DELIMITER_FACTOR) * float(b));
  // Nearer: True if 'a' is around max{ +/-10% of 'b' , 'b' - 5pt },
  // as documented in The TeXbook, Ch.17, p.152.
  PRBool isNearer = PR_FALSE;
  if (aHint & (NS_STRETCH_NEARER | NS_STRETCH_LARGEOP)) {
    float c = PR_MAX(float(b) * NS_MATHML_DELIMITER_FACTOR,
                     float(b) - NS_MATHML_DELIMITER_SHORTFALL);
    isNearer = PRBool(float(PR_ABS(b - a)) <= (float(b) - c));
  }
  // Smaller: Mainly for transitory use, to compare two candidate
  // choices
  PRBool isSmaller =
    (aHint & NS_STRETCH_SMALLER)
    && PRBool((float(a) >= (NS_MATHML_DELIMITER_FACTOR * float(b)))
              && (a <= b));
  // Larger: Critical to the sqrt code to ensure that the radical
  // size is tall enough
  PRBool isLarger =
    (aHint & (NS_STRETCH_LARGER | NS_STRETCH_LARGEOP))
    && PRBool(a >= b);
  return (isNormal || isSmaller || isNearer || isLarger);
}

Here is the caller graph for this function:

static nsresult LoadProperties ( const nsString aName,
nsCOMPtr< nsIPersistentProperties > &  aProperties 
) [static]

Definition at line 194 of file nsMathMLChar.cpp.

{
  nsAutoString uriStr;
  uriStr.AssignLiteral("resource://gre/res/fonts/mathfont");
  uriStr.Append(aName);
  uriStr.StripWhitespace(); // that may come from aName
  uriStr.AppendLiteral(".properties");
  return NS_LoadPersistentPropertiesFromURISpec(getter_AddRefs(aProperties), 
                                                NS_ConvertUTF16toUTF8(uriStr));
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool MathFontEnumCallback ( const nsString aFamily,
PRBool  aGeneric,
void aData 
) [static]

Definition at line 1108 of file nsMathMLChar.cpp.

{
  // check if the font is missing
  MathFontEnumContext* context = (MathFontEnumContext*)aData;
  nsPresContext* presContext = context->mPresContext;
  nsString* missingFamilyList = context->mMissingFamilyList;
  if (!CheckFontExistence(presContext, aFamily)) {
//#ifndef _WIN32
   // XXX In principle, the mathfont-family list in the mathfont.properties file
   // is customizable depending on the platform. For now, this is here since there
   // is no need to alert Linux users about TrueType fonts specific to Windows.
   if (aFamily.LowerCaseEqualsLiteral("mt extra"))
     return PR_TRUE; // continue to try other fonts
//#endif
    if (!missingFamilyList->IsEmpty()) {
      missingFamilyList->AppendLiteral(", ");
    }
    missingFamilyList->Append(aFamily);
  }

  if (!gGlyphTableList->AddGlyphTable(aFamily))
    return PR_FALSE; // stop in low-memory situations
  return PR_TRUE; // don't stop
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool PreferredFontEnumCallback ( const nsString aFamily,
PRBool  aGeneric,
void aData 
) [static]

Definition at line 971 of file nsMathMLChar.cpp.

{
  PRInt32 i;
  nsAutoString fontName;
  nsGlyphTable* glyphTable = nsnull;
  PreferredFontEnumContext* context = (PreferredFontEnumContext*)aData;
  // see if the table already exists in mTableList[0..mDefaultCount-1]
  PRBool found = PR_FALSE;
  PRInt32 count = gGlyphTableList->Count();
  for (i = 0; i < count; i++) {
    glyphTable = gGlyphTableList->TableAt(i);
    glyphTable->GetPrimaryFontName(fontName);
    if (fontName.Equals(aFamily, nsCaseInsensitiveStringComparator())) {
      found = PR_TRUE;
      break;
    }
  }
  if (!found) {
    // the table wasn't found in the default sharable list,
    // see if it exists in the additional list
    count = gGlyphTableList->AdditionalCount();
    for (i = 0; i < count; i++) {
      glyphTable = gGlyphTableList->AdditionalTableAt(i);
      glyphTable->GetPrimaryFontName(fontName);
      if (fontName.Equals(aFamily, nsCaseInsensitiveStringComparator())) {
        found = PR_TRUE;
        break;
      }
    }
    if (!found) {
      // the table wasn't found in the additional list either, add it now
      glyphTable = gGlyphTableList->AddAdditionalGlyphTable(aFamily);
      if (!glyphTable)
        return PR_FALSE; // stop in low-memory situations
    }
  }

  // Add the table to the list of preferred extension tables for this char
  if (!context->mFontCount) {
    // this is the first font to be retained, remember
    // the starting index where the first glyphTable was appended
    PRInt32 startingIndex = gGlyphTableList->Count(PR_TRUE);
    if (context->mIsFontForParts) {
      NS_ASSERTION(nsGlyphTableList::gParts[context->mCharIndex] == -1,
                   "remove duplicate property in mathfont.properties");
      nsGlyphTableList::gParts[context->mCharIndex] = startingIndex;
    }
    else {
      NS_ASSERTION(nsGlyphTableList::gVariants[context->mCharIndex] == -1,
                   "remove duplicate property in mathfont.properties");
      nsGlyphTableList::gVariants[context->mCharIndex] = startingIndex;
    }
  }

  gGlyphTableList->AppendTable(glyphTable);
  ++context->mFontCount;

  return PR_TRUE; // don't stop
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void SetBaseFamily ( PRUnichar  aChar,
nsFont aFont 
) [static]

Definition at line 1264 of file nsMathMLChar.cpp.

{
  if (!nsGlyphTableList::gBaseFonts) return;
  nsBaseFontEntry* entry = nsGlyphTableList::gBaseFonts->GetEntry(aChar);
  if (entry) {
    aFont.name.Assign(entry->mFontFamily);
  }
}

Here is the caller graph for this function:

void SetFirstFamily ( nsFont aFont,
const nsString aFamily 
) [inline]

Definition at line 1510 of file nsMathMLChar.cpp.

{
  // overwrite the old value of font-family:
  aFont.name.Assign(aFamily);
}

Here is the caller graph for this function:

static void SetPreferredFonts ( const char *  aKey,
nsString aFamilyList 
) [static]

Definition at line 1050 of file nsMathMLChar.cpp.

{
  NS_ASSERTION(30 < strlen(aKey), "invalid call");

  // expected key:
  // "font.mathfont-family.\uNNNN.base"     -- fonts for the base size
  // "font.mathfont-family.\uNNNN.parts"    -- fonts for partial glyphs
  // "font.mathfont-family.\uNNNN.variants" -- fonts for larger glyphs
  PRInt32 error = 0;
  // 22 is to skip "font.mathfont-family.\\u";
  PRUnichar uchar = nsCAutoString(aKey + 22).ToInteger(&error, 16);
  if (error) return;
  // 27 is to skip "font.mathfont-family.\\uNNNN"
  const char* extension = aKey + 27;

#ifdef DEBUG_rbs
  char str[50];
  aFamilyList.ToCString(str, sizeof(str));
  printf("Setting preferred fonts for \\u%04X%s: %s\n", uchar, extension, str);
#endif

  if (!strcmp(extension, ".base")) {
    // fonts to be used for the base size of the char (i.e., no stretching)
    nsBaseFontEntry* entry = nsGlyphTableList::gBaseFonts->AddEntry(uchar);
    if (entry) {
      entry->mFontFamily = aFamilyList;
    }
    return;
  }

  PRBool isFontForParts;
  if (!strcmp(extension, ".parts"))
    isFontForParts = PR_TRUE;
  else if (!strcmp(extension, ".variants"))
    isFontForParts = PR_FALSE;
  else return; // input is not applicable

  // Ensure that this is a valid stretchy operator
  PRInt32 k = nsMathMLOperators::FindStretchyOperator(uchar);
  if (k != kNotFound) {
    // We just want to iterate over the font-family list using the
    // callback mechanism that nsFont has...
    nsFont font(aFamilyList, 0, 0, 0, 0, 0);
    PreferredFontEnumContext context = {k, isFontForParts, 0};
    font.EnumerateFamilies(PreferredFontEnumCallback, &context);
    if (context.mFontCount) { // at least one font was retained
      // Append a null separator
      gGlyphTableList->AppendTable(nsnull);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool StretchyFontEnumCallback ( const nsString aFamily,
PRBool  aGeneric,
void aData 
) [static]

Definition at line 872 of file nsMathMLChar.cpp.

{
  if (aGeneric) return PR_FALSE; // stop now
  StretchyFontEnumContext* context = (StretchyFontEnumContext*)aData;
  nsPresContext* currPresContext = context->mPresContext;
  nsMathMLChar* currChar = context->mChar;
  nsVoidArray* currList = context->mGlyphTableList;
  // check if the current font is associated to a known glyph table
  for (PRInt32 i = 0; i < gGlyphTableList->Count(); i++) {
    nsGlyphTable* glyphTable = gGlyphTableList->TableAt(i);
    nsAutoString fontName;
    glyphTable->GetPrimaryFontName(fontName);
    if (fontName.Equals(aFamily, nsCaseInsensitiveStringComparator()) &&
        glyphTable->Has(currPresContext, currChar)) {
      currList->AppendElement(glyphTable); // the table is retained
      return PR_TRUE; // don't stop
    }
  }
  return PR_TRUE; // don't stop
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 759 of file nsMathMLChar.cpp.

Definition at line 764 of file nsMathMLChar.cpp.

Definition at line 132 of file nsMathMLChar.cpp.

const nsGlyphCode kNullGlyph = {0, 0} [static]

Definition at line 79 of file nsMathMLChar.cpp.

const PRUnichar kSpaceCh = PRUnichar(' ') [static]

Definition at line 78 of file nsMathMLChar.cpp.