зеркало из https://github.com/mozilla/gecko-dev.git
Added IsFontScaleable method
This commit is contained in:
Родитель
df0af65e2d
Коммит
f0ff878dfb
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче