OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkFontHost_DEFINED | 10 #ifndef SkFontHost_DEFINED |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 static SkTypeface* CreateTypefaceFromStream(SkStream*); | 145 static SkTypeface* CreateTypefaceFromStream(SkStream*); |
146 | 146 |
147 /** Return a new typeface from the specified file path. If the file does not | 147 /** Return a new typeface from the specified file path. If the file does not |
148 represent a valid font, this returns null. If a typeface is returned, | 148 represent a valid font, this returns null. If a typeface is returned, |
149 the caller is responsible for calling unref() when it is no longer used. | 149 the caller is responsible for calling unref() when it is no longer used. |
150 */ | 150 */ |
151 static SkTypeface* CreateTypefaceFromFile(const char path[]); | 151 static SkTypeface* CreateTypefaceFromFile(const char path[]); |
152 | 152 |
153 /////////////////////////////////////////////////////////////////////////// | 153 /////////////////////////////////////////////////////////////////////////// |
154 | 154 |
155 /** Write a unique identifier to the stream, so that the same typeface can | |
156 be retrieved with Deserialize(). The standard format is to serialize | |
157 a SkFontDescriptor followed by a uint32_t length value. If the length | |
158 is non-zero then the following bytes (of that length) represent a | |
159 serialized copy of the font which can be recreated from a stream. | |
160 */ | |
161 static void Serialize(const SkTypeface*, SkWStream*); | |
162 | |
163 /** Given a stream created by Serialize(), return a new typeface (like | |
164 CreateTypeface) which is either an exact match to the one serialized | |
165 or the best available typeface based on the data in the deserialized | |
166 SkFontDescriptor. | |
167 */ | |
168 static SkTypeface* Deserialize(SkStream*); | |
169 | |
170 /////////////////////////////////////////////////////////////////////////// | |
171 | |
172 friend class SkTypeface; | 155 friend class SkTypeface; |
173 }; | 156 }; |
174 | 157 |
175 #endif | 158 #endif |
OLD | NEW |