Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1048)

Unified Diff: src/ports/SkFontHost_fontconfig.cpp

Issue 66783003: Remove SK_FONTHOST_USES_FONTMGR. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ports/SkFontConfigTypeface.h ('k') | src/ports/SkFontHost_linux.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_fontconfig.cpp
===================================================================
--- src/ports/SkFontHost_fontconfig.cpp (revision 12201)
+++ src/ports/SkFontHost_fontconfig.cpp (working copy)
@@ -124,45 +124,6 @@
return face;
}
-#ifndef SK_FONTHOST_USES_FONTMGR
-
-SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
- const char familyName[],
- SkTypeface::Style style) {
- return FontConfigTypeface::LegacyCreateTypeface(familyFace, familyName,
- style);
-}
-
-SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) {
- if (!stream) {
- return NULL;
- }
- const size_t length = stream->getLength();
- if (!length) {
- return NULL;
- }
- if (length >= 1024 * 1024 * 1024) {
- return NULL; // don't accept too large fonts (>= 1GB) for safety.
- }
-
- // ask freetype for reported style and if it is a fixed width font
- SkTypeface::Style style = SkTypeface::kNormal;
- bool isFixedWidth = false;
- if (!find_name_and_attributes(stream, NULL, &style, &isFixedWidth)) {
- return NULL;
- }
-
- SkTypeface* face = SkNEW_ARGS(FontConfigTypeface, (style, isFixedWidth, stream));
- return face;
-}
-
-SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) {
- SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path));
- return stream.get() ? CreateTypefaceFromStream(stream) : NULL;
-}
-
-#endif
-
///////////////////////////////////////////////////////////////////////////////
SkStream* FontConfigTypeface::onOpenStream(int* ttcIndex) const {
@@ -210,7 +171,3 @@
desc->setFamilyName(this->getFamilyName());
*isLocalStream = SkToBool(this->getLocalStream());
}
-
-SkTypeface* FontConfigTypeface::onRefMatchingStyle(Style style) const {
- return LegacyCreateTypeface(this, NULL, style);
-}
« no previous file with comments | « src/ports/SkFontConfigTypeface.h ('k') | src/ports/SkFontHost_linux.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698