| 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_PUBLIC_COMMON_DWRITE_FONT_PLATFORM_WIN_H_ | |
| 6 #define CONTENT_PUBLIC_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 // This is the shared section that is used between browser and renderer for | |
| 17 // loading font cache. Section name is suffixed with browser process id so that | |
| 18 // multiple instance chrome scenario works fine. | |
| 19 CONTENT_EXPORT extern const char kFontCacheSharedSectionName[]; | |
| 20 | |
| 21 // Function returns custom font collection in terms of IDWriteFontCollection. | |
| 22 // This function maintains singleton instance of font collection and returns | |
| 23 // it on repeated calls. | |
| 24 CONTENT_EXPORT IDWriteFontCollection* GetCustomFontCollection( | |
| 25 IDWriteFactory* factory); | |
| 26 | |
| 27 // Builds static font cache. As this function need to iterate through all | |
| 28 // available fonts in the system, it may take a while. | |
| 29 CONTENT_EXPORT bool BuildFontCache(const base::FilePath& file); | |
| 30 | |
| 31 // Loads font cache from file. This is supposed to be used from browser | |
| 32 // side where loading means creating readonly shared memory file mapping so that | |
| 33 // renderers can read from it. | |
| 34 CONTENT_EXPORT bool LoadFontCache(const base::FilePath& path); | |
| 35 | |
| 36 // Added in header mainly for unittest | |
| 37 CONTENT_EXPORT bool ValidateFontCacheFile(base::File* file); | |
| 38 | |
| 39 } // namespace content | |
| 40 | |
| 41 #endif // CONTENT_PUBLIC_COMMON_DWRITE_FONT_PLATFORM_WIN_H_ | |
| OLD | NEW |