Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: Source/WebCore/platform/graphics/mac/FontCacheMac.mm

Issue 10034005: Merge 113132 - [Chromium] Out-of-process font loading garbles text (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 NSFontManager *fontManager = [NSFontManager sharedFontManager]; 223 NSFontManager *fontManager = [NSFontManager sharedFontManager];
224 NSFontTraitMask actualTraits = 0; 224 NSFontTraitMask actualTraits = 0;
225 if (fontDescription.italic()) 225 if (fontDescription.italic())
226 actualTraits = [fontManager traitsOfFont:nsFont]; 226 actualTraits = [fontManager traitsOfFont:nsFont];
227 NSInteger actualWeight = [fontManager weightOfFont:nsFont]; 227 NSInteger actualWeight = [fontManager weightOfFont:nsFont];
228 228
229 NSFont *platformFont = fontDescription.usePrinterFont() ? [nsFont printerFon t] : [nsFont screenFont]; 229 NSFont *platformFont = fontDescription.usePrinterFont() ? [nsFont printerFon t] : [nsFont screenFont];
230 bool syntheticBold = isAppKitFontWeightBold(weight) && !isAppKitFontWeightBo ld(actualWeight); 230 bool syntheticBold = isAppKitFontWeightBold(weight) && !isAppKitFontWeightBo ld(actualWeight);
231 bool syntheticOblique = (traits & NSFontItalicTrait) && !(actualTraits & NSF ontItalicTrait); 231 bool syntheticOblique = (traits & NSFontItalicTrait) && !(actualTraits & NSF ontItalicTrait);
232 232
233 return new FontPlatformData(platformFont, size, syntheticBold, syntheticObli que, fontDescription.orientation(), fontDescription.textOrientation(), fontDescr iption.widthVariant()); 233 // FontPlatformData::font() can be null for the case of Chromium out-of-proc ess font loading.
234 // In that case, we don't want to use the platformData.
235 OwnPtr<FontPlatformData> platformData = adoptPtr(new FontPlatformData(platfo rmFont, size, syntheticBold, syntheticOblique, fontDescription.orientation(), fo ntDescription.textOrientation(), fontDescription.widthVariant()));
236 if (!platformData->font())
237 return 0;
238 return platformData.leakPtr();
234 } 239 }
235 240
236 } // namespace WebCore 241 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698