mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
Bug 1028497 - Part 17: Factor out FontFace family-name getting. r=jdaggett
This commit is contained in:
parent
cf965693b0
commit
b4bf68ac33
@ -418,6 +418,21 @@ FontFace::SetUserFontEntry(gfxUserFontEntry* aEntry)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
FontFace::GetFamilyName(nsString& aResult)
|
||||
{
|
||||
nsCSSValue value;
|
||||
GetDesc(eCSSFontDesc_Family, value);
|
||||
|
||||
if (value.GetUnit() == eCSSUnit_String) {
|
||||
nsString familyname;
|
||||
value.GetStringValue(familyname);
|
||||
aResult.Append(familyname);
|
||||
}
|
||||
|
||||
return !aResult.IsEmpty();
|
||||
}
|
||||
|
||||
// -- FontFace::Entry --------------------------------------------------------
|
||||
|
||||
/* virtual */ void
|
||||
|
@ -78,6 +78,13 @@ public:
|
||||
gfxUserFontEntry* GetUserFontEntry() const { return mUserFontEntry; }
|
||||
void SetUserFontEntry(gfxUserFontEntry* aEntry);
|
||||
|
||||
/**
|
||||
* Gets the family name of the FontFace as a raw string (such as 'Times', as
|
||||
* opposed to GetFamily, which returns a CSS-escaped string, such as
|
||||
* '"Times"'). Returns whether a valid family name was available.
|
||||
*/
|
||||
bool GetFamilyName(nsString& aResult);
|
||||
|
||||
// Web IDL
|
||||
static already_AddRefed<FontFace>
|
||||
Constructor(const GlobalObject& aGlobal,
|
||||
|
Loading…
Reference in New Issue
Block a user