michael@0: /* michael@0: * Copyright 2009 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef SkHarfBuzzFont_DEFINED michael@0: #define SkHarfBuzzFont_DEFINED michael@0: michael@0: extern "C" { michael@0: #include "harfbuzz-shaper.h" michael@0: //#include "harfbuzz-unicode.h" michael@0: } michael@0: michael@0: #include "SkTypes.h" michael@0: michael@0: class SkPaint; michael@0: class SkTypeface; michael@0: michael@0: class SkHarfBuzzFont { michael@0: public: michael@0: /** The subclass returns the typeface for this font, or NULL michael@0: */ michael@0: virtual SkTypeface* getTypeface() const = 0; michael@0: /** The subclass sets the text related attributes of the paint. michael@0: e.g. textSize, typeface, textSkewX, etc. michael@0: All of the attributes that could effect how the text is measured. michael@0: Color information (e.g. color, xfermode, shader, etc.) are not required. michael@0: */ michael@0: virtual void setupPaint(SkPaint*) const = 0; michael@0: michael@0: /** Implementation of HB_GetFontTableFunc, using SkHarfBuzzFont* as michael@0: the first parameter. michael@0: */ michael@0: static HB_Error GetFontTableFunc(void* skharfbuzzfont, const HB_Tag tag, michael@0: HB_Byte* buffer, HB_UInt* len); michael@0: michael@0: static const HB_FontClass& GetFontClass(); michael@0: }; michael@0: michael@0: #endif