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

Side by Side Diff: Source/platform/fonts/skia/FontCustomPlatformDataSkia.cpp

Issue 141653017: Use SkFontMgr for synthetic font styles on windows (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2007 Apple Computer, Inc. 2 * Copyright (C) 2007 Apple Computer, Inc.
3 * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved. 3 * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved.
4 * Copyright (C) 2010 Company 100, Inc. 4 * Copyright (C) 2010 Company 100, Inc.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 if (syntheticBold || syntheticItalic) { 66 if (syntheticBold || syntheticItalic) {
67 SkString name; 67 SkString name;
68 m_typeface->getFamilyName(&name); 68 m_typeface->getFamilyName(&name);
69 69
70 int style = SkTypeface::kNormal; 70 int style = SkTypeface::kNormal;
71 if (syntheticBold) 71 if (syntheticBold)
72 style |= SkTypeface::kBold; 72 style |= SkTypeface::kBold;
73 if (syntheticItalic) 73 if (syntheticItalic)
74 style |= SkTypeface::kItalic; 74 style |= SkTypeface::kItalic;
75 75
76 RefPtr<SkTypeface> typeface = adoptRef(SkTypeface::CreateFromName(name.c _str(), static_cast<SkTypeface::Style>(style))); 76 RefPtr<SkTypeface> typeface = adoptRef(FontCache::fontCache()->fontManag er()->legacyCreateTypeface(name.c_str(), static_cast<SkTypeface::Style>(style))) ;
77 syntheticBold = false; 77 syntheticBold = false;
78 syntheticItalic = false; 78 syntheticItalic = false;
79 return FontPlatformData(typeface.release(), "", size, syntheticBold, syn theticItalic, orientation); 79 return FontPlatformData(typeface.release(), "", size, syntheticBold, syn theticItalic, orientation);
80 } 80 }
81 #endif 81 #endif
82 return FontPlatformData(m_typeface.get(), "", size, bold && !m_typeface->isB old(), italic && !m_typeface->isItalic(), orientation); 82 return FontPlatformData(m_typeface.get(), "", size, bold && !m_typeface->isB old(), italic && !m_typeface->isItalic(), orientation);
83 } 83 }
84 84
85 PassOwnPtr<FontCustomPlatformData> FontCustomPlatformData::create(SharedBuffer* buffer) 85 PassOwnPtr<FontCustomPlatformData> FontCustomPlatformData::create(SharedBuffer* buffer)
86 { 86 {
(...skipping 16 matching lines...) Expand all
103 103
104 return adoptPtr(new FontCustomPlatformData(typeface.release())); 104 return adoptPtr(new FontCustomPlatformData(typeface.release()));
105 } 105 }
106 106
107 bool FontCustomPlatformData::supportsFormat(const String& format) 107 bool FontCustomPlatformData::supportsFormat(const String& format)
108 { 108 {
109 return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "o pentype") || OpenTypeSanitizer::supportsFormat(format); 109 return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "o pentype") || OpenTypeSanitizer::supportsFormat(format);
110 } 110 }
111 111
112 } 112 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698