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

Unified Diff: src/core/SkFontHost.cpp

Issue 13094005: impl part of SKFontMgr for mac (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 months 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 | « include/ports/SkFontMgr.h ('k') | src/ports/SkFontHost_mac.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkFontHost.cpp
===================================================================
--- src/core/SkFontHost.cpp (revision 8387)
+++ src/core/SkFontHost.cpp (working copy)
@@ -46,3 +46,65 @@
void SkFontHost::SetSubpixelOrder(LCDOrder order) {
SkFontLCDConfig::SetSubpixelOrder((SkFontLCDConfig::LCDOrder)order);
}
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+#include "SkFontMgr.h"
+
+SkFontStyle::SkFontStyle() {
+ fUnion.fU32 = 0;
+ fUnion.fR.fWeight = kNormal_Weight;
+ fUnion.fR.fWidth = kNormal_Width;
+ fUnion.fR.fSlant = kUpright_Slant;
+}
+
+SkFontStyle::SkFontStyle(int weight, int width, Slant slant) {
+ fUnion.fU32 = 0;
+ fUnion.fR.fWeight = SkPin32(weight, kThin_Weight, kBlack_Weight);
+ fUnion.fR.fWidth = SkPin32(width, kUltraCondensed_Width, kUltaExpanded_Width);
+ fUnion.fR.fSlant = kUpright_Slant;
sugoi 2013/03/26 18:03:42 Not sure if this is the intended behavior, but the
+}
+
+int SkFontMgr::countFamilies() {
+ return this->onCountFamilies();
+}
+
+void SkFontMgr::getFamilyName(int index, SkString* familyName) {
+ this->onGetFamilyName(index, familyName);
+}
+
+SkFontStyleSet* SkFontMgr::createStyleSet(int index) {
+ return this->onCreateStyleSet(index);
+}
+
+SkTypeface* SkFontMgr::matchFamilyStyle(const char familyName[],
+ const SkFontStyle& fs) {
+ return this->onMatchFamilyStyle(familyName, fs);
+}
+
+SkTypeface* SkFontMgr::matchFaceStyle(const SkTypeface* face,
+ const SkFontStyle& fs) {
+ return this->matchFaceStyle(face, fs);
+}
+
+SkTypeface* SkFontMgr::createFromData(SkData* data, int ttcIndex) {
+ return this->onCreateFromData(data, ttcIndex);
+}
+
+SkTypeface* SkFontMgr::createFromStream(SkStream* stream, int ttcIndex) {
+ return this->onCreateFromStream(stream, ttcIndex);
+}
+
+SkTypeface* SkFontMgr::createFromFile(const char path[], int ttcIndex) {
+ return this->onCreateFromFile(path, ttcIndex);
+}
+
+SkFontMgr* SkFontMgr::RefDefault() {
+ static SkFontMgr* gFM;
+ if (NULL == gFM) {
+ gFM = SkFontMgr::Factory();
+ }
+ return SkRef(gFM);
+}
+
« no previous file with comments | « include/ports/SkFontMgr.h ('k') | src/ports/SkFontHost_mac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698