| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of the internal font implementation. | 2 * This file is part of the internal font implementation. |
| 3 * | 3 * |
| 4 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 4 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 5 * Copyright (c) 2010 Google Inc. All rights reserved. | 5 * Copyright (c) 2010 Google Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| 11 * | 11 * |
| 12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
| 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
| 16 * | 16 * |
| 17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
| 18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
| 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
| 21 * | 21 * |
| 22 */ | 22 */ |
| 23 | 23 |
| 24 #import "config.h" | 24 #import "config.h" |
| 25 #import "platform/fonts/FontPlatformData.h" | 25 #import "platform/fonts/FontPlatformData.h" |
| 26 | 26 |
| 27 #import <AppKit/NSFont.h> | |
| 28 #import <AvailabilityMacros.h> | |
| 29 #import <wtf/text/WTFString.h> | |
| 30 | |
| 31 #import "platform/LayoutTestSupport.h" | 27 #import "platform/LayoutTestSupport.h" |
| 32 #import "platform/fonts/Font.h" | 28 #import "platform/fonts/Font.h" |
| 33 #import "platform/fonts/shaping/HarfBuzzFace.h" | 29 #import "platform/fonts/shaping/HarfBuzzFace.h" |
| 34 #import "public/platform/Platform.h" | 30 #import "public/platform/Platform.h" |
| 35 #import "public/platform/mac/WebSandboxSupport.h" | 31 #import "public/platform/mac/WebSandboxSupport.h" |
| 36 #import "third_party/skia/include/ports/SkTypeface_mac.h" | 32 #import "third_party/skia/include/ports/SkTypeface_mac.h" |
| 33 #import "wtf/RetainPtr.h" |
| 34 #import "wtf/text/WTFString.h" |
| 35 #import <AppKit/NSFont.h> |
| 36 #import <AvailabilityMacros.h> |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 static bool canLoadInProcess(NSFont* nsFont) { | 40 static bool canLoadInProcess(NSFont* nsFont) { |
| 41 RetainPtr<CGFontRef> cgFont(AdoptCF, CTFontCopyGraphicsFont(toCTFontRef(nsFo
nt), 0)); | 41 RetainPtr<CGFontRef> cgFont(AdoptCF, CTFontCopyGraphicsFont(toCTFontRef(nsFo
nt), 0)); |
| 42 // Toll-free bridged types CFStringRef and NSString*. | 42 // Toll-free bridged types CFStringRef and NSString*. |
| 43 RetainPtr<NSString> fontName(AdoptNS, const_cast<NSString*>(reinterpret_cast
<const NSString*>(CGFontCopyPostScriptName(cgFont.get())))); | 43 RetainPtr<NSString> fontName(AdoptNS, const_cast<NSString*>(reinterpret_cast
<const NSString*>(CGFontCopyPostScriptName(cgFont.get())))); |
| 44 return ![fontName.get() isEqualToString:@"LastResort"]; | 44 return ![fontName.get() isEqualToString:@"LastResort"]; |
| 45 } | 45 } |
| 46 | 46 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 164 } |
| 165 } | 165 } |
| 166 | 166 |
| 167 bool FontPlatformData::defaultUseSubpixelPositioning() | 167 bool FontPlatformData::defaultUseSubpixelPositioning() |
| 168 { | 168 { |
| 169 return FontDescription::subpixelPositioning(); | 169 return FontDescription::subpixelPositioning(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 | 172 |
| 173 } // namespace blink | 173 } // namespace blink |
| OLD | NEW |