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 #include "SkFontHost.h" | 10 #include "SkFontHost.h" |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 } | 538 } |
539 return stream; | 539 return stream; |
540 } | 540 } |
541 | 541 |
542 size_t SkFontHost::GetFileName(SkFontID fontID, char path[], size_t length, | 542 size_t SkFontHost::GetFileName(SkFontID fontID, char path[], size_t length, |
543 int32_t* index) { | 543 int32_t* index) { |
544 // SkDebugf("SkFontHost::GetFileName unimplemented\n"); | 544 // SkDebugf("SkFontHost::GetFileName unimplemented\n"); |
545 return 0; | 545 return 0; |
546 } | 546 } |
547 | 547 |
548 SkFontID SkFontHost::NextLogicalFont(SkFontID currFontID, SkFontID origFontID) { | 548 SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID currFontID, SkFontID origFo
ntID) { |
549 return 0; | 549 return NULL; |
550 } | 550 } |
551 | 551 |
552 /////////////////////////////////////////////////////////////////////////////// | 552 /////////////////////////////////////////////////////////////////////////////// |
553 | 553 |
554 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { | 554 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { |
555 if (NULL == stream || stream->getLength() <= 0) { | 555 if (NULL == stream || stream->getLength() <= 0) { |
556 SkDELETE(stream); | 556 SkDELETE(stream); |
557 return NULL; | 557 return NULL; |
558 } | 558 } |
559 | 559 |
560 bool isFixedWidth; | 560 bool isFixedWidth; |
561 SkTypeface::Style style; | 561 SkTypeface::Style style; |
562 if (find_name_and_attributes(stream, NULL, &style, &isFixedWidth)) { | 562 if (find_name_and_attributes(stream, NULL, &style, &isFixedWidth)) { |
563 return SkNEW_ARGS(StreamTypeface, (style, false, NULL, stream, isFixedWi
dth)); | 563 return SkNEW_ARGS(StreamTypeface, (style, false, NULL, stream, isFixedWi
dth)); |
564 } else { | 564 } else { |
565 return NULL; | 565 return NULL; |
566 } | 566 } |
567 } | 567 } |
568 | 568 |
569 SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) { | 569 SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) { |
570 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path)); | 570 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path)); |
571 return stream.get() ? CreateTypefaceFromStream(stream) : NULL; | 571 return stream.get() ? CreateTypefaceFromStream(stream) : NULL; |
572 } | 572 } |
OLD | NEW |