aPresContext->GetTwipsToPixels(&t2p);
aPresContext->GetTwipsToPixelsForFonts(&t2p);
static nscoord NewCalcFontPointSize(PRInt32 aHTMLSize, PRInt32 aBasePointSize,                                       float aScalingFactor, nsIPresContext* aPresContext,                                       nsFontSizeType aFontSizeType){#define sFontSizeTableMin  9 #define sFontSizeTableMax 16 // This table seems to be the one used by MacIE5. We hope its adoption in Mozilla// and eventually in WinIE5.5 will help to establish a standard rendering across// platforms and browsers. For now, it is used only in Strict mode. More can be read// in the document written by Todd Farhner at:// http://style.verso.com/font_size_intervals/altintervals.html//  static PRInt32 sStrictFontSizeTable[sFontSizeTableMax - sFontSizeTableMin + 1][8] =  {      { 9,    9,     9,     9,    11,    14,    18,    27},      { 9,    9,     9,    10,    12,    15,    20,    30},      { 9,    9,    10,    11,    13,    17,    22,    33},      { 9,    9,    10,    12,    14,    18,    24,    36},      { 9,   10,    12,    13,    16,    20,    26,    39},      { 9,   10,    12,    14,    17,    21,    28,    42},      { 9,   10,    13,    15,    18,    23,    30,    45},      { 9,   10,    13,    16,    18,    24,    32,    48}  };// HTML       1      2      3      4      5      6      7// CSS  xxs   xs     s      m      l     xl     xxl//                          |//                      user pref////------------------------------------------------------------//// This table gives us compatibility with WinNav4 for the default fonts only.// In WinNav4, the default fonts were:////     Times/12pt ==   Times/16px at 96ppi//   Courier/10pt == Courier/13px at 96ppi//// The 2 lines below marked "anchored" have the exact pixel sizes used by// WinNav4 for Times/12pt and Courier/10pt at 96ppi. As you can see, the// HTML size 3 (user pref) for those 2 anchored lines is 13px and 16px.//// All values other than the anchored values were filled in by hand, never// going below 9px, and maintaining a "diagonal" relationship. See for// example the 13s -- they follow a diagonal line through the table.//  static PRInt32 sQuirksFontSizeTable[sFontSizeTableMax - sFontSizeTableMin + 1][8] =  {      { 9,    9,     9,     9,    11,    14,    18,    28 },      { 9,    9,     9,    10,    12,    15,    20,    31 },      { 9,    9,     9,    11,    13,    17,    22,    34 },      { 9,    9,    10,    12,    14,    18,    24,    37 },      { 9,    9,    10,    13,    16,    20,    26,    40 }, // anchored (13)      { 9,    9,    11,    14,    17,    21,    28,    42 },      { 9,   10,    12,    15,    17,    23,    30,    45 },      { 9,   10,    13,    16,    18,    24,    32,    48 }  // anchored (16)  };// HTML       1      2      3      4      5      6      7// CSS  xxs   xs     s      m      l     xl     xxl//                          |//                      user pref#if 0//// These are the exact pixel values used by WinIE5 at 96ppi.//      { ?,    8,    11,    12,    13,    16,    21,    32 }, // smallest      { ?,    9,    12,    13,    16,    21,    27,    40 }, // smaller      { ?,   10,    13,    16,    18,    24,    32,    48 }, // medium      { ?,   13,    16,    19,    21,    27,    37,    ?? }, // larger      { ?,   16,    19,    21,    24,    32,    43,    ?? }  // largest//// HTML       1      2      3      4      5      6      7// CSS  ?     ?      ?      ?      ?      ?      ?      ?//// (CSS not tested yet.)//#endif  static PRInt32 sFontSizeFactors[8] = { 60,75,89,100,120,150,200,300 };  static PRInt32 sCSSColumns[7]  = {0, 1, 2, 3, 4, 5, 6}; // xxs...xxl  static PRInt32 sHTMLColumns[7] = {1, 2, 3, 4, 5, 6, 7}; // 1...7  double dFontSize;  if (aFontSizeType == eFontSize_HTML) {    aHTMLSize--;    // input as 1-7  }  if (aHTMLSize < 0)    aHTMLSize = 0;  else if (aHTMLSize > 6)    aHTMLSize = 6;  PRInt32* column;  switch (aFontSizeType)  {    case eFontSize_HTML: column = sHTMLColumns; break;    case eFontSize_CSS:  column = sCSSColumns;  break;  }  float t2p;  aPresContext->GetTwipsToPixels(&t2p);  PRInt32 fontSize = NSTwipsToIntPixels(aBasePointSize, t2p);  if ((fontSize >= sFontSizeTableMin) && (fontSize <= sFontSizeTableMax))  {    float p2t;    aPresContext->GetPixelsToTwips(&p2t);    PRInt32 row = fontSize - sFontSizeTableMin;		nsCompatibility mode;	  aPresContext->GetCompatibilityMode(&mode);	  if (mode == eCompatibility_NavQuirks) {	    dFontSize = NSIntPixelsToTwips(sQuirksFontSizeTable[row][column[aHTMLSize]], p2t);	  } else {	    dFontSize = NSIntPixelsToTwips(sStrictFontSizeTable[row][column[aHTMLSize]], p2t);	  }  }  else  {    PRInt32 factor = sFontSizeFactors[column[aHTMLSize]];    dFontSize = (factor * aBasePointSize) / 100;  }  dFontSize *= aScalingFactor;  if (1.0 < dFontSize) {    return (nscoord)dFontSize;  }  return (nscoord)1;}