OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 Google Inc. | 2 * Copyright 2008 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkFontConfigInterface.h" | 8 #include "SkFontConfigInterface.h" |
9 #include "SkFontConfigTypeface.h" | 9 #include "SkFontConfigTypeface.h" |
10 #include "SkFontDescriptor.h" | 10 #include "SkFontDescriptor.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 SkAutoTUnref<SkFontConfigInterface> fci(RefFCI()); | 177 SkAutoTUnref<SkFontConfigInterface> fci(RefFCI()); |
178 if (NULL == fci.get()) { | 178 if (NULL == fci.get()) { |
179 return NULL; | 179 return NULL; |
180 } | 180 } |
181 stream = fci->openStream(this->getIdentity()); | 181 stream = fci->openStream(this->getIdentity()); |
182 *ttcIndex = this->getIdentity().fTTCIndex; | 182 *ttcIndex = this->getIdentity().fTTCIndex; |
183 } | 183 } |
184 return stream; | 184 return stream; |
185 } | 185 } |
186 | 186 |
187 int FontConfigTypeface::onGetTableTags(SkFontTableTag tags[]) const { | |
188 int ttcIndex; | |
189 SkAutoTUnref<SkStream> stream(this->openStream(&ttcIndex)); | |
190 return stream.get() | |
191 ? SkFontStream::GetTableTags(stream, ttcIndex, tags) | |
192 : 0; | |
193 } | |
194 | |
195 size_t FontConfigTypeface::onGetTableData(SkFontTableTag tag, size_t offset, | |
196 size_t length, void* data) const { | |
197 int ttcIndex; | |
198 SkAutoTUnref<SkStream> stream(this->openStream(&ttcIndex)); | |
199 return stream.get() | |
200 ? SkFontStream::GetTableData(stream, ttcIndex, | |
201 tag, offset, length, data) | |
202 : 0; | |
203 } | |
204 | |
205 void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc, | 187 void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc, |
206 bool* isLocalStream) const { | 188 bool* isLocalStream) const { |
207 desc->setFamilyName(this->getFamilyName()); | 189 desc->setFamilyName(this->getFamilyName()); |
208 *isLocalStream = SkToBool(this->getLocalStream()); | 190 *isLocalStream = SkToBool(this->getLocalStream()); |
209 } | 191 } |
210 | 192 |
211 SkTypeface* FontConfigTypeface::onRefMatchingStyle(Style style) const { | 193 SkTypeface* FontConfigTypeface::onRefMatchingStyle(Style style) const { |
212 return LegacyCreateTypeface(this, NULL, style); | 194 return LegacyCreateTypeface(this, NULL, style); |
213 } | 195 } |
OLD | NEW |