mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 18:47:53 +00:00
Bug 465463 - use style attributes defined in @font-face rule (Mac OS X). r=vlad
This commit is contained in:
parent
d27b42a061
commit
2b7d253fff
@ -127,7 +127,8 @@ gfxFontEntry*
|
|||||||
gfxPlatformMac::LookupLocalFont(const gfxProxyFontEntry *aProxyEntry,
|
gfxPlatformMac::LookupLocalFont(const gfxProxyFontEntry *aProxyEntry,
|
||||||
const nsAString& aFontName)
|
const nsAString& aFontName)
|
||||||
{
|
{
|
||||||
return gfxQuartzFontCache::SharedFontCache()->LookupLocalFont(aFontName);
|
return gfxQuartzFontCache::SharedFontCache()->LookupLocalFont(aProxyEntry,
|
||||||
|
aFontName);
|
||||||
}
|
}
|
||||||
|
|
||||||
gfxFontEntry*
|
gfxFontEntry*
|
||||||
|
@ -234,7 +234,8 @@ public:
|
|||||||
|
|
||||||
void AddOtherFamilyName(MacOSFamilyEntry *aFamilyEntry, nsAString& aOtherFamilyName);
|
void AddOtherFamilyName(MacOSFamilyEntry *aFamilyEntry, nsAString& aOtherFamilyName);
|
||||||
|
|
||||||
gfxFontEntry* LookupLocalFont(const nsAString& aFontName);
|
gfxFontEntry* LookupLocalFont(const gfxProxyFontEntry *aProxyEntry,
|
||||||
|
const nsAString& aFontName);
|
||||||
|
|
||||||
gfxFontEntry* MakePlatformFont(const gfxFontEntry *aProxyEntry, const PRUint8 *aFontData, PRUint32 aLength);
|
gfxFontEntry* MakePlatformFont(const gfxFontEntry *aProxyEntry, const PRUint8 *aFontData, PRUint32 aLength);
|
||||||
|
|
||||||
|
@ -1289,25 +1289,37 @@ gfxQuartzFontCache::AddOtherFamilyName(MacOSFamilyEntry *aFamilyEntry, nsAString
|
|||||||
}
|
}
|
||||||
|
|
||||||
gfxFontEntry*
|
gfxFontEntry*
|
||||||
gfxQuartzFontCache::LookupLocalFont(const nsAString& aFontName)
|
gfxQuartzFontCache::LookupLocalFont(const gfxProxyFontEntry *aProxyEntry,
|
||||||
|
const nsAString& aFontName)
|
||||||
{
|
{
|
||||||
NSString *faceName = GetNSStringForString(aFontName);
|
NSString *faceName = GetNSStringForString(aFontName);
|
||||||
NSFont *font = [NSFont fontWithName:faceName size:0.0];
|
|
||||||
|
// first lookup a single face based on postscript name
|
||||||
|
ATSFontRef fontRef = ATSFontFindFromPostScriptName(CFStringRef(faceName),
|
||||||
|
kATSOptionFlagsDefault);
|
||||||
|
|
||||||
if (font) {
|
// if not found, lookup using full font name
|
||||||
nsAutoString availableFamilyName;
|
if (fontRef == kInvalidFont)
|
||||||
NSString *availableFamily = [font familyName];
|
fontRef = ATSFontFindFromName(CFStringRef(faceName),
|
||||||
GetStringForNSString(availableFamily, availableFamilyName);
|
kATSOptionFlagsDefault);
|
||||||
|
|
||||||
|
// not found
|
||||||
|
if (fontRef == kInvalidFont)
|
||||||
|
return nsnull;
|
||||||
|
|
||||||
MacOSFamilyEntry *familyEntry = FindFamily(availableFamilyName);
|
PRUint16 w = aProxyEntry->mWeight;
|
||||||
if (familyEntry) {
|
NS_ASSERTION(w >= 100 && w <= 900, "bogus font weight value!");
|
||||||
MacOSFontEntry *fontEntry = familyEntry->FindFont(aFontName);
|
|
||||||
return fontEntry;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// didn't find the font
|
MacOSFontEntry *newFontEntry =
|
||||||
return nsnull;
|
new MacOSFontEntry(aFontName,
|
||||||
|
FMGetFontFromATSFontRef(fontRef),
|
||||||
|
w, aProxyEntry->mStretch,
|
||||||
|
(PRUint32(aProxyEntry->mItalic) ?
|
||||||
|
FONT_STYLE_ITALIC :
|
||||||
|
FONT_STYLE_NORMAL),
|
||||||
|
nsnull);
|
||||||
|
|
||||||
|
return newFontEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
// grumble, another non-publised Apple API dependency (found in Webkit code)
|
// grumble, another non-publised Apple API dependency (found in Webkit code)
|
||||||
|
@ -25,6 +25,11 @@ HTTP(..) == src-list-format-6.html src-list-format-3-ref.html
|
|||||||
# assumes AAT fonts are only supported on MacOS
|
# assumes AAT fonts are only supported on MacOS
|
||||||
skip-if(MOZ_WIDGET_TOOLKIT=="cocoa") HTTP(..) == src-list-format-7.html src-list-format-2-ref.html
|
skip-if(MOZ_WIDGET_TOOLKIT=="cocoa") HTTP(..) == src-list-format-7.html src-list-format-2-ref.html
|
||||||
skip-if(MOZ_WIDGET_TOOLKIT!="cocoa") HTTP(..) == src-list-format-7.html src-list-format-3-ref.html
|
skip-if(MOZ_WIDGET_TOOLKIT!="cocoa") HTTP(..) == src-list-format-7.html src-list-format-3-ref.html
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == src-list-local-full.html src-list-local-full-ref.html # bug 468387
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == src-list-local-full-quotes.html src-list-local-full-ref.html # bug 468387
|
||||||
|
# Postscript name lookup only supported on MacOS currently
|
||||||
|
skip-if(MOZ_WIDGET_TOOLKIT!="cocoa") == src-list-local-ps.html src-list-local-full-ref.html
|
||||||
|
|
||||||
# FIXME: The behavior here is neither mandated nor specified by the spec, but
|
# FIXME: The behavior here is neither mandated nor specified by the spec, but
|
||||||
# it really ought to be.
|
# it really ought to be.
|
||||||
HTTP(..) == order-1.html order-1-ref.html
|
HTTP(..) == order-1.html order-1-ref.html
|
||||||
@ -66,4 +71,4 @@ HTTP(..) == ahem-metrics-1.html ahem-metrics-1-ref.html
|
|||||||
HTTP(..) == ex-unit-1.html ex-unit-1-ref.html
|
HTTP(..) == ex-unit-1.html ex-unit-1-ref.html
|
||||||
HTTP(..) == ex-unit-1-dynamic.html ex-unit-1-ref.html
|
HTTP(..) == ex-unit-1-dynamic.html ex-unit-1-ref.html
|
||||||
|
|
||||||
fails-if(MOZ_WIDGET_TOOLKIT!="gtk2") == local-1.html local-1-ref.html # fails on MS Windows and Mac due to bug 465463
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == local-1.html local-1-ref.html # bug 468387
|
||||||
|
Loading…
Reference in New Issue
Block a user