/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkTypeface_DEFINED #define SkTypeface_DEFINED #include "SkFontStyle.h" #include "SkLazyPtr.h" #include "SkRect.h" #include "SkString.h" #include "SkWeakRefCnt.h" class SkDescriptor; class SkFontData; class SkFontDescriptor; class SkScalerContext; struct SkScalerContextRec; class SkStream; class SkStreamAsset; class SkAdvancedTypefaceMetrics; class SkWStream; typedef uint32_t SkFontID; /** Machine endian. */ typedef uint32_t SkFontTableTag; /** \class SkTypeface The SkTypeface class specifies the typeface and intrinsic style of a font. This is used in the paint, along with optionally algorithmic settings like textSize, textSkewX, textScaleX, kFakeBoldText_Mask, to specify how text appears when drawn (and measured). Typeface objects are immutable, and so they can be shared between threads. */ class SK_API SkTypeface : public SkWeakRefCnt { public: /** Style specifies the intrinsic style attributes of a given typeface */ enum Style { kNormal = 0, kBold = 0x01, kItalic = 0x02, // helpers kBoldItalic = 0x03 }; /** Returns the typeface's intrinsic style attributes. */ SkFontStyle fontStyle() const { return fStyle; } /** Returns the typeface's intrinsic style attributes. * @deprecated use fontStyle() instead. */ Style style() const { return static_cast