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 "SkFontDescriptor.h" | 9 #include "SkFontDescriptor.h" |
10 #include "SkFontHost.h" | 10 #include "SkFontHost.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 stream->skip(length); | 242 stream->skip(length); |
243 } | 243 } |
244 | 244 |
245 return SkFontHost::CreateTypeface(NULL, familyName, style); | 245 return SkFontHost::CreateTypeface(NULL, familyName, style); |
246 } | 246 } |
247 | 247 |
248 /////////////////////////////////////////////////////////////////////////////// | 248 /////////////////////////////////////////////////////////////////////////////// |
249 | 249 |
250 static SkStream* open_stream(const FontConfigTypeface* face, int* ttcIndex) { | 250 static SkStream* open_stream(const FontConfigTypeface* face, int* ttcIndex) { |
251 SkStream* stream = face->getLocalStream(); | 251 SkStream* stream = face->getLocalStream(); |
252 int index; | |
253 if (stream) { | 252 if (stream) { |
254 stream->ref(); | 253 stream->ref(); |
255 // should have been provided by CreateFromStream() | 254 // should have been provided by CreateFromStream() |
256 *ttcIndex = 0; | 255 *ttcIndex = 0; |
257 } else { | 256 } else { |
258 SkAutoTUnref<SkFontConfigInterface> fci(RefFCI()); | 257 SkAutoTUnref<SkFontConfigInterface> fci(RefFCI()); |
259 if (NULL == fci.get()) { | 258 if (NULL == fci.get()) { |
260 return NULL; | 259 return NULL; |
261 } | 260 } |
262 stream = fci->openStream(face->getIdentity()); | 261 stream = fci->openStream(face->getIdentity()); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 return stream.get() | 312 return stream.get() |
314 ? SkFontStream::GetTableData(stream, ttcIndex, | 313 ? SkFontStream::GetTableData(stream, ttcIndex, |
315 tag, offset, length, data) | 314 tag, offset, length, data) |
316 : 0; | 315 : 0; |
317 } | 316 } |
318 | 317 |
319 void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc) const { | 318 void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc) const { |
320 desc->setStyle(this->style()); | 319 desc->setStyle(this->style()); |
321 desc->setFamilyName(this->getFamilyName()); | 320 desc->setFamilyName(this->getFamilyName()); |
322 } | 321 } |
OLD | NEW |