This commit is contained in:
kostello%netscape.com 1998-08-07 18:34:13 +00:00
Родитель a4c98fdbaa
Коммит 415f4acd12
5 изменённых файлов: 92 добавлений и 4 удалений

Просмотреть файл

@ -548,8 +548,48 @@ nsDrawingSurface nsDeviceContextMac :: GetDrawingSurface()
return nsnull;
}
NS_IMETHODIMP nsDeviceContextMac::FirstExistingFont(const nsFont& aFont, nsString& aFaceName)
{
/*
IMPLEMENT THIS! -- gpk
FontEnumData data(this, aFaceName);
if (aFont.EnumerateFamilies(FontEnumCallback, &data)) {
return NS_ERROR_FAILURE; // ran out
}
*/
return NS_OK;
}
NS_IMETHODIMP nsDeviceContextMac::GetLocalFontName(const nsString& aFaceName, nsString& aLocalName,
PRBool& aAliased)
{
nsresult result = NS_OK;
/*
IMPLEMENT THIS! -- gpk
if (nsnull == mFontAliasTable) {
result = CreateFontAliasTable();
}
if (nsnull != mFontAliasTable) {
StringKey key(aFaceName);
const nsString* alias = (const nsString*)mFontAliasTable->Get(&key);
if (nsnull != alias) {
aLocalName = *alias;
aAliased = PR_TRUE;
}
else {
aLocalName = aFaceName;
aAliased = PR_FALSE;
}
}
*/
return result;
}

Просмотреть файл

@ -84,6 +84,10 @@ public:
NS_IMETHOD CheckFontExistence(const nsString& aFontName);
NS_IMETHOD CreateILColorSpace(IL_ColorSpace*& aColorSpace);
NS_IMETHOD GetDepth(PRUint32& aDepth);
NS_IMETHOD FirstExistingFont(const nsFont& aFont, nsString& aFaceName);
NS_IMETHOD GetLocalFontName(const nsString& aFaceName, nsString& aLocalName,
PRBool& aAliased);
protected:
~nsDeviceContextMac();

Просмотреть файл

@ -293,12 +293,12 @@ nscoord nsFontMetricsMac :: GetWidth(const PRUnichar *aString, PRUint32 aLength)
// PR_Free(xstring);
//return (nscoord(width * mContext->GetDevUnitsToAppUnits()));
return width;
}
// XXX this needs to be implemented correctly
nscoord nsFontMetricsWin :: GetWidth(nsIDeviceContext *aContext, const nsString& aString)
nscoord nsFontMetricsMac:: GetWidth(nsIDeviceContext *aContext, const nsString& aString)
{
return GetWidth(aString.GetUnicode(), aString.Length());
}

Просмотреть файл

@ -548,8 +548,48 @@ nsDrawingSurface nsDeviceContextMac :: GetDrawingSurface()
return nsnull;
}
NS_IMETHODIMP nsDeviceContextMac::FirstExistingFont(const nsFont& aFont, nsString& aFaceName)
{
/*
IMPLEMENT THIS! -- gpk
FontEnumData data(this, aFaceName);
if (aFont.EnumerateFamilies(FontEnumCallback, &data)) {
return NS_ERROR_FAILURE; // ran out
}
*/
return NS_OK;
}
NS_IMETHODIMP nsDeviceContextMac::GetLocalFontName(const nsString& aFaceName, nsString& aLocalName,
PRBool& aAliased)
{
nsresult result = NS_OK;
/*
IMPLEMENT THIS! -- gpk
if (nsnull == mFontAliasTable) {
result = CreateFontAliasTable();
}
if (nsnull != mFontAliasTable) {
StringKey key(aFaceName);
const nsString* alias = (const nsString*)mFontAliasTable->Get(&key);
if (nsnull != alias) {
aLocalName = *alias;
aAliased = PR_TRUE;
}
else {
aLocalName = aFaceName;
aAliased = PR_FALSE;
}
}
*/
return result;
}

Просмотреть файл

@ -84,6 +84,10 @@ public:
NS_IMETHOD CheckFontExistence(const nsString& aFontName);
NS_IMETHOD CreateILColorSpace(IL_ColorSpace*& aColorSpace);
NS_IMETHOD GetDepth(PRUint32& aDepth);
NS_IMETHOD FirstExistingFont(const nsFont& aFont, nsString& aFaceName);
NS_IMETHOD GetLocalFontName(const nsString& aFaceName, nsString& aLocalName,
PRBool& aAliased);
protected:
~nsDeviceContextMac();