aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/fonts/SkTestSVGTypeface.h
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2018-03-27 18:15:53 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-27 18:16:04 +0000
commit3560b58de36988e1fba54d9ac341735ab849e913 (patch)
treebedddd24f268048bf5974914fd9ba81c8d35e018 /tools/fonts/SkTestSVGTypeface.h
parent83ee463c315851c53f6368fcc3df0a30b0052a57 (diff)
Revert "Add color fonts."
This reverts commit d3b933f3e03d5c22e9e7c56d2110469e41509720. Reason for revert: we're not mirroring experimental/ everywhere. Original change's description: > Add color fonts. > > BUG=skia:7624 > > Change-Id: I1d0974282adce2fd7b13a003309e63593b6e1a9c > Reviewed-on: https://skia-review.googlesource.com/109521 > Commit-Queue: Ben Wagner <bungeman@google.com> > Reviewed-by: Mike Klein <mtklein@google.com> > Reviewed-by: Herb Derby <herb@google.com> > Reviewed-on: https://skia-review.googlesource.com/116541 TBR=mtklein@google.com,bungeman@google.com,herb@google.com Change-Id: Ic2d763244cbce663a23eb53321ac45201c466501 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7624 Reviewed-on: https://skia-review.googlesource.com/116680 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'tools/fonts/SkTestSVGTypeface.h')
-rw-r--r--tools/fonts/SkTestSVGTypeface.h135
1 files changed, 0 insertions, 135 deletions
diff --git a/tools/fonts/SkTestSVGTypeface.h b/tools/fonts/SkTestSVGTypeface.h
deleted file mode 100644
index c6e9f4e2cf..0000000000
--- a/tools/fonts/SkTestSVGTypeface.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkTestSVGTypeface_DEFINED
-#define SkTestSVGTypeface_DEFINED
-
-#include "SkFontArguments.h"
-#include "SkMutex.h"
-#include "SkPaint.h"
-#include "SkPoint.h"
-#include "SkRect.h"
-#include "SkRefCnt.h"
-#include "SkScalar.h"
-#include "SkString.h"
-#include "SkTArray.h"
-#include "SkTHash.h"
-#include "SkTypeface.h"
-#include "SkTypes.h"
-
-#include <memory>
-
-class SkDescriptor;
-class SkFontDescriptor;
-class SkFontStyle;
-class SkGlyph;
-class SkPath;
-class SkScalerContext;
-class SkStreamAsset;
-class SkSVGDOM;
-class SkWStream;
-struct SkAdvancedTypefaceMetrics;
-struct SkScalerContextEffects;
-struct SkScalerContextRec;
-
-struct SkSVGTestTypefaceGlyphData {
- const char* fSvgResourcePath;
- SkPoint fOrigin;
- SkScalar fAdvance;
- SkUnichar fUnicode; //TODO: this limits to 1:1
-};
-
-class SkTestSVGTypeface : public SkTypeface {
-public:
- SkTestSVGTypeface(const char* name,
- int upem,
- const SkPaint::FontMetrics& metrics,
- const SkSVGTestTypefaceGlyphData* data, int dataCount,
- const SkFontStyle& style);
- ~SkTestSVGTypeface() override;
- void getAdvance(SkGlyph* glyph) const;
- void getFontMetrics(SkPaint::FontMetrics* metrics) const;
- void getPath(SkGlyphID glyph, SkPath* path) const;
-
- static sk_sp<SkTestSVGTypeface> Default();
- void exportTtxCbdt(SkWStream*) const;
- void exportTtxSbix(SkWStream*) const;
- void exportTtxColr(SkWStream*) const;
-
- struct GlyfLayerInfo {
- GlyfLayerInfo(int layerColorIndex, SkIRect bounds)
- : fLayerColorIndex(layerColorIndex)
- , fBounds(bounds) {}
- int fLayerColorIndex;
- SkIRect fBounds;
- };
- struct GlyfInfo {
- GlyfInfo() : fBounds(SkIRect::MakeEmpty()) {}
- SkIRect fBounds;
- SkTArray<GlyfLayerInfo> fLayers;
- };
-protected:
- void exportTtxCommon(SkWStream*, const char* type, const SkTArray<GlyfInfo>* = nullptr) const;
-
- SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
- const SkDescriptor* desc) const override;
- void onFilterRec(SkScalerContextRec* rec) const override;
- std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override;
-
- SkStreamAsset* onOpenStream(int* ttcIndex) const override {
- return nullptr;
- }
-
- void onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const override;
-
- int onCharsToGlyphs(const void* chars, Encoding encoding,
- uint16_t glyphs[], int glyphCount) const override;
-
- int onCountGlyphs() const override {
- return fGlyphCount;
- }
-
- int onGetUPEM() const override {
- return fUpem;
- }
-
- void onGetFamilyName(SkString* familyName) const override;
- SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const override;
-
- int onGetVariationDesignPosition(SkFontArguments::VariationPosition::Coordinate coordinates[],
- int coordinateCount) const override
- {
- return 0;
- }
-
- int onGetTableTags(SkFontTableTag tags[]) const override {
- return 0;
- }
-
- size_t onGetTableData(SkFontTableTag tag, size_t offset,
- size_t length, void* data) const override {
- return 0;
- }
-private:
- struct Glyph {
- Glyph();
- ~Glyph();
- sk_sp<SkSVGDOM> fSvg;
- SkMutex fSvgMutex;
- SkPoint fOrigin;
- SkScalar fAdvance;
- };
- SkString fName;
- int fUpem;
- const SkPaint::FontMetrics fFontMetrics;
- std::unique_ptr<Glyph[]> fGlyphs;
- int fGlyphCount;
- SkTHashMap<SkUnichar, SkGlyphID> fCMap;
- friend class SkTestSVGScalerContext;
-};
-
-#endif