2013-05-31 20:17:57 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2013 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkGScalerContext_DEFINED
|
|
|
|
#define SkGScalerContext_DEFINED
|
|
|
|
|
|
|
|
#include "SkScalerContext.h"
|
|
|
|
#include "SkTypeface.h"
|
|
|
|
|
|
|
|
class SkGTypeface : public SkTypeface {
|
|
|
|
public:
|
2016-05-12 17:09:30 +00:00
|
|
|
SkGTypeface(sk_sp<SkTypeface> proxy, const SkPaint&);
|
2013-06-01 07:01:39 +00:00
|
|
|
|
2016-05-12 17:09:30 +00:00
|
|
|
SkTypeface* proxy() const { return fProxy.get(); }
|
2013-05-31 20:17:57 +00:00
|
|
|
const SkPaint& paint() const { return fPaint; }
|
|
|
|
|
|
|
|
protected:
|
2016-04-12 13:47:05 +00:00
|
|
|
SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
|
|
|
|
const SkDescriptor*) const override;
|
2015-03-26 01:17:31 +00:00
|
|
|
void onFilterRec(SkScalerContextRec*) const override;
|
2015-04-24 21:25:33 +00:00
|
|
|
SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
|
2015-05-12 16:50:04 +00:00
|
|
|
PerGlyphInfo,
|
2015-04-24 21:25:33 +00:00
|
|
|
const uint32_t* glyphIDs,
|
|
|
|
uint32_t glyphIDsCount) const override;
|
2015-03-26 01:17:31 +00:00
|
|
|
SkStreamAsset* onOpenStream(int* ttcIndex) const override;
|
|
|
|
void onGetFontDescriptor(SkFontDescriptor*, bool* isLocal) const override;
|
2013-06-01 07:01:39 +00:00
|
|
|
|
2015-04-24 21:25:33 +00:00
|
|
|
int onCharsToGlyphs(const void* chars, Encoding encoding,
|
|
|
|
uint16_t glyphs[], int glyphCount) const override;
|
2015-03-26 01:17:31 +00:00
|
|
|
int onCountGlyphs() const override;
|
|
|
|
int onGetUPEM() const override;
|
2013-06-01 07:01:39 +00:00
|
|
|
|
2015-03-26 01:17:31 +00:00
|
|
|
void onGetFamilyName(SkString* familyName) const override;
|
|
|
|
SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const override;
|
2013-08-07 02:45:25 +00:00
|
|
|
|
2015-03-26 01:17:31 +00:00
|
|
|
int onGetTableTags(SkFontTableTag tags[]) const override;
|
2015-04-24 21:25:33 +00:00
|
|
|
size_t onGetTableData(SkFontTableTag, size_t offset,
|
|
|
|
size_t length, void* data) const override;
|
2013-06-01 07:01:39 +00:00
|
|
|
|
2013-05-31 20:17:57 +00:00
|
|
|
private:
|
2016-05-12 17:09:30 +00:00
|
|
|
sk_sp<SkTypeface> fProxy;
|
|
|
|
SkPaint fPaint;
|
2013-05-31 20:17:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|