This commit is contained in:
rods%netscape.com 1999-05-18 13:46:49 +00:00
Родитель df0af65e2d
Коммит f0ff878dfb
3 изменённых файлов: 30 добавлений и 2 удалений

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

@ -31,14 +31,16 @@ class nsString;
class nsIFontRetrieverService : public nsISupports
// This (singleton) service exists soley as a factory to manufacture iterators
{
{
public:
static const nsIID& GetIID() { static nsIID iid = NS_IFONTRETRIEVERSERVICE_IID; return iid; }
NS_IMETHOD CreateFontNameIterator( nsIFontNameIterator** aIterator ) = 0;
NS_IMETHOD CreateFontSizeIterator( const nsString * aFontName, nsIFontSizeIterator** aIterator ) = 0;
};
NS_IMETHOD IsFontScalable( const nsString * aFontName, PRBool* aResult ) = 0;
};
#endif

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

@ -163,6 +163,7 @@ NS_IMETHODIMP nsFontRetrieverService::Advance()
return NS_ERROR_FAILURE;
}
//----------------------------------------------------------
static int CALLBACK MyEnumFontFamProc(ENUMLOGFONT FAR *lpelf,
NEWTEXTMETRIC FAR *lpntm,
unsigned long fontType,
@ -320,3 +321,26 @@ NS_IMETHODIMP nsFontRetrieverService::LoadFontList()
return NS_OK;
}
//----------------------------------------------------------
NS_IMETHODIMP nsFontRetrieverService::IsFontScalable( const nsString * aFontName, PRBool* aResult )
{
PRBool found = PR_FALSE;
Reset();
do {
nsAutoString name;
Get(&name);
if (name.Equals(*aFontName)) {
found = PR_TRUE;
break;
}
} while (Advance() == NS_OK);
if (found) {
FontInfo * fontInfo = (FontInfo *)mFontList->ElementAt(mNameIterInx);
*aResult = fontInfo->mIsScalable;
return NS_OK;
}
return NS_ERROR_FAILURE;
}

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

@ -38,6 +38,8 @@ public:
NS_IMETHOD CreateFontSizeIterator( const nsString * aFontName, nsIFontSizeIterator** aIterator );
NS_IMETHOD IsFontScalable( const nsString * aFontName, PRBool* aResult );
// nsIFontNameIterator
NS_IMETHOD Reset();