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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 } | 561 } |
562 return stream; | 562 return stream; |
563 } | 563 } |
564 | 564 |
565 size_t SkFontHost::GetFileName(SkFontID fontID, char path[], size_t length, | 565 size_t SkFontHost::GetFileName(SkFontID fontID, char path[], size_t length, |
566 int32_t* index) { | 566 int32_t* index) { |
567 // SkDebugf("SkFontHost::GetFileName unimplemented\n"); | 567 // SkDebugf("SkFontHost::GetFileName unimplemented\n"); |
568 return 0; | 568 return 0; |
569 } | 569 } |
570 | 570 |
571 SkFontID SkFontHost::NextLogicalFont(SkFontID currFontID, SkFontID origFontID) { | 571 SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID currFontID, SkFontID origFo
ntID) { |
572 return 0; | 572 return NULL; |
573 } | 573 } |
574 | 574 |
575 /////////////////////////////////////////////////////////////////////////////// | 575 /////////////////////////////////////////////////////////////////////////////// |
576 | 576 |
577 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { | 577 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { |
578 if (NULL == stream || stream->getLength() <= 0) { | 578 if (NULL == stream || stream->getLength() <= 0) { |
579 SkDELETE(stream); | 579 SkDELETE(stream); |
580 return NULL; | 580 return NULL; |
581 } | 581 } |
582 | 582 |
583 bool isFixedWidth; | 583 bool isFixedWidth; |
584 SkTypeface::Style style; | 584 SkTypeface::Style style; |
585 if (find_name_and_attributes(stream, NULL, &style, &isFixedWidth)) { | 585 if (find_name_and_attributes(stream, NULL, &style, &isFixedWidth)) { |
586 return SkNEW_ARGS(StreamTypeface, (style, false, NULL, stream, isFixedWi
dth)); | 586 return SkNEW_ARGS(StreamTypeface, (style, false, NULL, stream, isFixedWi
dth)); |
587 } else { | 587 } else { |
588 return NULL; | 588 return NULL; |
589 } | 589 } |
590 } | 590 } |
591 | 591 |
592 SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) { | 592 SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) { |
593 SkTypeface* face = NULL; | 593 SkTypeface* face = NULL; |
594 SkFILEStream* stream = SkNEW_ARGS(SkFILEStream, (path)); | 594 SkFILEStream* stream = SkNEW_ARGS(SkFILEStream, (path)); |
595 | 595 |
596 if (stream->isValid()) { | 596 if (stream->isValid()) { |
597 face = CreateTypefaceFromStream(stream); | 597 face = CreateTypefaceFromStream(stream); |
598 } | 598 } |
599 stream->unref(); | 599 stream->unref(); |
600 return face; | 600 return face; |
601 } | 601 } |
OLD | NEW |