- Timestamp:
- 10/03/07 14:04:03 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-branch/WebCore/platform/mac/FontCacheMac.mm
r24835 r26027 142 142 143 143 NSFontTraitMask traits = [manager traitsOfFont:nsFont]; 144 if (platformData. syntheticBold)144 if (platformData.m_syntheticBold) 145 145 traits |= NSBoldFontMask; 146 if (platformData. syntheticOblique)146 if (platformData.m_syntheticOblique) 147 147 traits |= NSItalicFontMask; 148 148 … … 186 186 } 187 187 188 FontPlatformData* FontCache::getLastResortFallbackFont(const Font & font)188 FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription) 189 189 { 190 190 static AtomicString timesStr("Times"); … … 193 193 // FIXME: Would be even better to somehow get the user's default font here. For now we'll pick 194 194 // the default that the user would get without changing any prefs. 195 FontPlatformData* platformFont = getCachedFontPlatformData(font .fontDescription(), timesStr);195 FontPlatformData* platformFont = getCachedFontPlatformData(fontDescription, timesStr); 196 196 if (!platformFont) 197 197 // The Times fallback will almost always work, but in the highly unusual case where … … 199 199 // guaranteed to be there, according to Nathan Taylor. This is good enough 200 200 // to avoid a crash at least. 201 platformFont = getCachedFontPlatformData(font .fontDescription(), lucidaGrandeStr);201 platformFont = getCachedFontPlatformData(fontDescription, lucidaGrandeStr); 202 202 203 203 return platformFont; 204 204 } 205 205 206 FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)206 bool FontCache::fontExists(const FontDescription& fontDescription, const AtomicString& family) 207 207 { 208 208 NSFontTraitMask traits = 0; … … 214 214 215 215 NSFont* nsFont = [WebFontCache fontWithFamily:family traits:traits size:size]; 216 return nsFont != 0; 217 } 218 219 FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family) 220 { 221 NSFontTraitMask traits = 0; 222 if (fontDescription.italic()) 223 traits |= NSItalicFontMask; 224 if (fontDescription.bold()) 225 traits |= NSBoldFontMask; 226 float size = fontDescription.computedPixelSize(); 227 228 NSFont* nsFont = [WebFontCache fontWithFamily:family traits:traits size:size]; 216 229 if (!nsFont) 217 230 return 0; … … 225 238 // Use the correct font for print vs. screen. 226 239 result->setFont(fontDescription.usePrinterFont() ? [nsFont printerFont] : [nsFont screenFont]); 227 result-> syntheticBold = (traits & NSBoldFontMask) && !(actualTraits & NSBoldFontMask);228 result-> syntheticOblique = (traits & NSItalicFontMask) && !(actualTraits & NSItalicFontMask);240 result->m_syntheticBold = (traits & NSBoldFontMask) && !(actualTraits & NSBoldFontMask); 241 result->m_syntheticOblique = (traits & NSItalicFontMask) && !(actualTraits & NSItalicFontMask); 229 242 return result; 230 243 }