| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <fcntl.h> | 5 #include <fcntl.h> |
| 6 #include <fontconfig/fontconfig.h> | 6 #include <fontconfig/fontconfig.h> |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/posix/eintr_wrapper.h" | 14 #include "base/posix/eintr_wrapper.h" |
| 15 #include "ppapi/c/private/pp_private_font_charset.h" | 15 |
| 16 #include "ppapi/c/trusted/ppb_browser_font_trusted.h" | 16 // TODO(crbug/685022): Guard the inclusion of ppapi headers with |
| 17 // BUILDFLAG(ENABLE_PLUGINS). |
| 18 #include "ppapi/c/private/pp_private_font_charset.h" // nogncheck |
| 19 #include "ppapi/c/trusted/ppb_browser_font_trusted.h" // nogncheck |
| 17 | 20 |
| 18 namespace { | 21 namespace { |
| 19 | 22 |
| 20 // MSCharSetToFontconfig translates a Microsoft charset identifier to a | 23 // MSCharSetToFontconfig translates a Microsoft charset identifier to a |
| 21 // fontconfig language set by appending to |langset|. | 24 // fontconfig language set by appending to |langset|. |
| 22 // Returns true if |langset| is Latin/Greek/Cyrillic. | 25 // Returns true if |langset| is Latin/Greek/Cyrillic. |
| 23 bool MSCharSetToFontconfig(FcLangSet* langset, unsigned fdwCharSet) { | 26 bool MSCharSetToFontconfig(FcLangSet* langset, unsigned fdwCharSet) { |
| 24 // We have need to translate raw fdwCharSet values into terms that | 27 // We have need to translate raw fdwCharSet values into terms that |
| 25 // fontconfig can understand. (See the description of fdwCharSet in the MSDN | 28 // fontconfig can understand. (See the description of fdwCharSet in the MSDN |
| 26 // documentation for CreateFont: | 29 // documentation for CreateFont: |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 } | 256 } |
| 254 | 257 |
| 255 if (font_set) | 258 if (font_set) |
| 256 FcFontSetDestroy(font_set); | 259 FcFontSetDestroy(font_set); |
| 257 FcPatternDestroy(pattern); | 260 FcPatternDestroy(pattern); |
| 258 | 261 |
| 259 return font_fd; | 262 return font_fd; |
| 260 } | 263 } |
| 261 | 264 |
| 262 } // namespace content | 265 } // namespace content |
| OLD | NEW |