OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_COMMON_DWRITE_FONT_PLATFORM_WIN_H_ |
| 6 #define CONTENT_COMMON_DWRITE_FONT_PLATFORM_WIN_H_ |
| 7 |
| 8 #include "base/files/file.h" |
| 9 #include "content/common/content_export.h" |
| 10 |
| 11 struct IDWriteFactory; |
| 12 struct IDWriteFontCollection; |
| 13 |
| 14 namespace content { |
| 15 |
| 16 // Function returns custom font collection in terms of IDWriteFontCollection. |
| 17 // This function maintains singleton instance of font collection and returns |
| 18 // it on repeated calls. |
| 19 CONTENT_EXPORT IDWriteFontCollection* GetCustomFontCollection( |
| 20 IDWriteFactory* factory); |
| 21 |
| 22 // Build and load is to accomplish both tasks of creating a font cache within |
| 23 // specified file and then loading it, where loading means creating |
| 24 // readonly shared memory mapping. As this function need to iterate through all |
| 25 // available fonts in the system, it may take a while. |
| 26 CONTENT_EXPORT bool BuildAndLoadFontCache(const base::FilePath& file); |
| 27 |
| 28 // Loads font cache from file. This is supposed to be used from browser |
| 29 // side where loading means creating readonly shared memory file mapping so that |
| 30 // renderers can read from it. |
| 31 CONTENT_EXPORT bool LoadFontCache(const base::FilePath& path); |
| 32 |
| 33 // Added in header mainly for unittest |
| 34 CONTENT_EXPORT bool ValidateFontCacheFile(base::File* file); |
| 35 |
| 36 } // namespace content |
| 37 |
| 38 #endif // CONTENT_COMMON_DWRITE_FONT_PLATFORM_WIN_H_ |
OLD | NEW |