OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CONTENT_COMMON_FONT_LOADER_MAC_H_ | 5 #ifndef CONTENT_COMMON_FONT_LOADER_MAC_H_ |
6 #define CONTENT_COMMON_FONT_LOADER_MAC_H_ | 6 #define CONTENT_COMMON_FONT_LOADER_MAC_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <ApplicationServices/ApplicationServices.h> | 9 #include <ApplicationServices/ApplicationServices.h> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 class FontLoader { | 25 class FontLoader { |
26 public: | 26 public: |
27 // Load a font specified by |font_to_encode| into a shared memory buffer | 27 // Load a font specified by |font_to_encode| into a shared memory buffer |
28 // suitable for sending over IPC. | 28 // suitable for sending over IPC. |
29 // | 29 // |
30 // On return: | 30 // On return: |
31 // returns true on success, false on failure. | 31 // returns true on success, false on failure. |
32 // |font_data| - shared memory buffer containing the raw data for the font | 32 // |font_data| - shared memory buffer containing the raw data for the font |
33 // file. | 33 // file. |
34 // |font_data_size| - size of data contained in |font_data|. | 34 // |font_data_size| - size of data contained in |font_data|. |
| 35 // |font_id| - unique identifier for the on-disk file we load for the font. |
35 static bool LoadFontIntoBuffer(NSFont* font_to_encode, | 36 static bool LoadFontIntoBuffer(NSFont* font_to_encode, |
36 base::SharedMemory* font_data, | 37 base::SharedMemory* font_data, |
37 uint32* font_data_size); | 38 uint32* font_data_size, |
| 39 uint32* font_id); |
38 | 40 |
39 // Given a shared memory buffer containing the raw data for a font file, load | 41 // Given a shared memory buffer containing the raw data for a font file, load |
40 // the font and return a container ref. | 42 // the font and return a container ref. |
41 // | 43 // |
42 // |data| - A shared memory handle pointing to the raw data from a font file. | 44 // |data| - A shared memory handle pointing to the raw data from a font file. |
43 // |data_size| - Size of |data|. | 45 // |data_size| - Size of |data|. |
44 // | 46 // |
45 // On return: | 47 // On return: |
46 // returns true on success, false on failure. | 48 // returns true on success, false on failure. |
47 // |font_container| - A font container corresponding to the designated font. | 49 // |font_container| - A font container corresponding to the designated font. |
48 // The caller is responsible for releasing this value via ATSFontDeactivate() | 50 // The caller is responsible for releasing this value via ATSFontDeactivate() |
49 // when done | 51 // when done |
50 static bool ATSFontContainerFromBuffer(base::SharedMemoryHandle font_data, | 52 static bool ATSFontContainerFromBuffer(base::SharedMemoryHandle font_data, |
51 uint32 font_data_size, | 53 uint32 font_data_size, |
52 ATSFontContainerRef* font_container); | 54 ATSFontContainerRef* font_container); |
53 }; | 55 }; |
54 | 56 |
55 #endif // CONTENT_COMMON_FONT_LOADER_MAC_H_ | 57 #endif // CONTENT_COMMON_FONT_LOADER_MAC_H_ |
OLD | NEW |