OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/gfx/font_fallback.h" | 5 #include "ui/gfx/font_fallback.h" |
6 | 6 |
| 7 #include <dlfcn.h> |
7 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
8 #include <dlfcn.h> | |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #import "base/strings/sys_string_conversions.h" | |
13 #include "base/mac/foundation_util.h" | 12 #include "base/mac/foundation_util.h" |
14 #import "base/mac/mac_util.h" | 13 #import "base/mac/mac_util.h" |
| 14 #import "base/strings/sys_string_conversions.h" |
15 | 15 |
16 // CTFontCopyDefaultCascadeListForLanguages() doesn't exist in the 10.6 SDK. | 16 // CTFontCopyDefaultCascadeListForLanguages() doesn't exist in the 10.6 SDK. |
17 // There is only the following. It doesn't exist in the public header files, | 17 // There is only the following. It doesn't exist in the public header files, |
18 // but is an exported symbol so should always link. | 18 // but is an exported symbol so should always link. |
19 extern "C" CFArrayRef CTFontCopyDefaultCascadeList(CTFontRef font_ref); | 19 extern "C" CFArrayRef CTFontCopyDefaultCascadeList(CTFontRef font_ref); |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 // Wrapper for CTFontCopyDefaultCascadeListForLanguages() which should appear in | 23 // Wrapper for CTFontCopyDefaultCascadeListForLanguages() which should appear in |
24 // CoreText.h from 10.8 onwards. | 24 // CoreText.h from 10.8 onwards. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 fallback_fonts.push_back(base::SysCFStringRefToUTF8(font_name)); | 93 fallback_fonts.push_back(base::SysCFStringRefToUTF8(font_name)); |
94 } | 94 } |
95 | 95 |
96 if (fallback_fonts.empty()) | 96 if (fallback_fonts.empty()) |
97 return std::vector<std::string>(1, font_family); | 97 return std::vector<std::string>(1, font_family); |
98 | 98 |
99 return fallback_fonts; | 99 return fallback_fonts; |
100 } | 100 } |
101 | 101 |
102 } // namespace gfx | 102 } // namespace gfx |
OLD | NEW |