nsresult nsDeviceContextOS2::CreateFontAliasTable() { nsresult result = NS_OK; if( !mFontAliasTable) { mFontAliasTable = new nsHashtable; nsAutoString times; times.AssignLiteral("Times"); nsAutoString timesNewRoman; timesNewRoman.AssignLiteral("Times New Roman"); nsAutoString timesRoman; timesRoman.AssignLiteral("Tms Rmn"); nsAutoString arial; arial.AssignLiteral("Arial"); nsAutoString helv; helv.AssignLiteral("Helv"); nsAutoString helvetica; helvetica.AssignLiteral("Helvetica"); nsAutoString courier; courier.AssignLiteral("Courier"); nsAutoString courierNew; courierNew.AssignLiteral("Courier New"); nsAutoString sans; sans.AssignLiteral("Sans"); nsAutoString unicode; unicode.AssignLiteral("Unicode"); nsAutoString timesNewRomanMT30; timesNewRomanMT30.AssignLiteral("Times New Roman MT 30"); nsAutoString nullStr; AliasFont(times, timesNewRoman, timesRoman, PR_FALSE); AliasFont(timesRoman, timesNewRoman, times, PR_FALSE); AliasFont(timesNewRoman, timesRoman, times, PR_FALSE); AliasFont(arial, helv, helvetica, PR_FALSE); AliasFont(helvetica, helv, arial, PR_FALSE); AliasFont(courier, courierNew, nullStr, PR_TRUE); AliasFont(courierNew, courier, nullStr, PR_FALSE); AliasFont(sans, helv, arial, PR_FALSE); // Is this right? AliasFont(unicode, timesNewRomanMT30, nullStr, PR_FALSE); } return result; }
nsresult nsThebesDeviceContext::CreateFontAliasTable() { nsresult result = NS_OK; if (nsnull == mFontAliasTable) { mFontAliasTable = new nsHashtable(); if (nsnull != mFontAliasTable) { nsAutoString times; times.AssignLiteral("Times"); nsAutoString timesNewRoman; timesNewRoman.AssignLiteral("Times New Roman"); nsAutoString timesRoman; timesRoman.AssignLiteral("Times Roman"); nsAutoString arial; arial.AssignLiteral("Arial"); nsAutoString helvetica; helvetica.AssignLiteral("Helvetica"); nsAutoString courier; courier.AssignLiteral("Courier"); nsAutoString courierNew; courierNew.AssignLiteral("Courier New"); nsAutoString nullStr; AliasFont(times, timesNewRoman, timesRoman, PR_FALSE); AliasFont(timesRoman, timesNewRoman, times, PR_FALSE); AliasFont(timesNewRoman, timesRoman, times, PR_FALSE); AliasFont(arial, helvetica, nullStr, PR_FALSE); AliasFont(helvetica, arial, nullStr, PR_FALSE); AliasFont(courier, courierNew, nullStr, PR_TRUE); AliasFont(courierNew, courier, nullStr, PR_FALSE); } else { result = NS_ERROR_OUT_OF_MEMORY; } } return result; }