| OLD | NEW |
| 1 /* libs/graphics/ports/SkFontHost_fontconfig_direct.cpp | 1 /* libs/graphics/ports/SkFontHost_fontconfig_direct.cpp |
| 2 ** | 2 ** |
| 3 ** Copyright 2009, Google Inc. | 3 ** Copyright 2009, Google Inc. |
| 4 ** | 4 ** |
| 5 ** Licensed under the Apache License, Version 2.0 (the "License"); | 5 ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 ** you may not use this file except in compliance with the License. | 6 ** you may not use this file except in compliance with the License. |
| 7 ** You may obtain a copy of the License at | 7 ** You may obtain a copy of the License at |
| 8 ** | 8 ** |
| 9 ** http://www.apache.org/licenses/LICENSE-2.0 | 9 ** http://www.apache.org/licenses/LICENSE-2.0 |
| 10 ** | 10 ** |
| 11 ** Unless required by applicable law or agreed to in writing, software | 11 ** Unless required by applicable law or agreed to in writing, software |
| 12 ** distributed under the License is distributed on an "AS IS" BASIS, | 12 ** distributed under the License is distributed on an "AS IS" BASIS, |
| 13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 ** See the License for the specific language governing permissions and | 14 ** See the License for the specific language governing permissions and |
| 15 ** limitations under the License. | 15 ** limitations under the License. |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 #include "SkFontHost_fontconfig_direct.h" | 18 #include "SkFontHost_fontconfig_direct.h" |
| 19 | 19 |
| 20 #include <unistd.h> | 20 #include <unistd.h> |
| 21 #include <fcntl.h> | 21 #include <fcntl.h> |
| 22 | 22 |
| 23 #include <fontconfig/fontconfig.h> | 23 #include <fontconfig/fontconfig.h> |
| 24 | 24 |
| 25 #include "third_party/icu/public/common/unicode/utf16.h" | 25 #include "unicode/utf16.h" |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 // Equivalence classes, used to match the Liberation and Ascender fonts | 29 // Equivalence classes, used to match the Liberation and Ascender fonts |
| 30 // with their metric-compatible replacements. See the discussion in | 30 // with their metric-compatible replacements. See the discussion in |
| 31 // GetFontEquivClass(). | 31 // GetFontEquivClass(). |
| 32 enum FontEquivClass | 32 enum FontEquivClass |
| 33 { | 33 { |
| 34 OTHER, | 34 OTHER, |
| 35 SANS, | 35 SANS, |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 361 |
| 362 int FontConfigDirect::Open(unsigned filefaceid) { | 362 int FontConfigDirect::Open(unsigned filefaceid) { |
| 363 SkAutoMutexAcquire ac(mutex_); | 363 SkAutoMutexAcquire ac(mutex_); |
| 364 const std::map<unsigned, std::string>::const_iterator | 364 const std::map<unsigned, std::string>::const_iterator |
| 365 i = fileid_to_filename_.find(FileFaceIdToFileId(filefaceid)); | 365 i = fileid_to_filename_.find(FileFaceIdToFileId(filefaceid)); |
| 366 if (i == fileid_to_filename_.end()) | 366 if (i == fileid_to_filename_.end()) |
| 367 return -1; | 367 return -1; |
| 368 | 368 |
| 369 return open(i->second.c_str(), O_RDONLY); | 369 return open(i->second.c_str(), O_RDONLY); |
| 370 } | 370 } |
| OLD | NEW |