2011-07-28 18:26:00 +04:00
|
|
|
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
/*
|
2011-07-28 18:26:00 +04:00
|
|
|
* Copyright 2011 Google Inc.
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
*
|
2011-07-28 18:26:00 +04:00
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
*/
|
|
|
|
|
2011-07-28 18:26:00 +04:00
|
|
|
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
#ifndef SkPDFFont_DEFINED
|
|
|
|
#define SkPDFFont_DEFINED
|
|
|
|
|
2011-03-05 00:43:27 +03:00
|
|
|
#include "SkAdvancedTypefaceMetrics.h"
|
2011-07-26 02:34:12 +04:00
|
|
|
#include "SkBitSet.h"
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
#include "SkPDFTypes.h"
|
|
|
|
#include "SkTDArray.h"
|
|
|
|
#include "SkThread.h"
|
2011-07-26 02:34:12 +04:00
|
|
|
#include "SkTypeface.h"
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
|
|
|
|
class SkPaint;
|
2011-07-26 02:34:12 +04:00
|
|
|
class SkPDFCatalog;
|
|
|
|
class SkPDFFont;
|
|
|
|
|
|
|
|
class SkPDFGlyphSet : public SkNoncopyable {
|
|
|
|
public:
|
|
|
|
SkPDFGlyphSet();
|
|
|
|
|
|
|
|
void set(const uint16_t* glyphIDs, int numGlyphs);
|
|
|
|
bool has(uint16_t glyphID) const;
|
|
|
|
void merge(const SkPDFGlyphSet& usage);
|
2011-07-28 00:59:55 +04:00
|
|
|
void exportTo(SkTDArray<uint32_t>* glyphIDs) const;
|
2011-07-26 02:34:12 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
SkBitSet fBitSet;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SkPDFGlyphSetMap : public SkNoncopyable {
|
|
|
|
public:
|
|
|
|
struct FontGlyphSetPair {
|
|
|
|
FontGlyphSetPair(SkPDFFont* font, SkPDFGlyphSet* glyphSet);
|
|
|
|
|
|
|
|
SkPDFFont* fFont;
|
|
|
|
SkPDFGlyphSet* fGlyphSet;
|
|
|
|
};
|
|
|
|
|
|
|
|
SkPDFGlyphSetMap();
|
|
|
|
~SkPDFGlyphSetMap();
|
|
|
|
|
|
|
|
class F2BIter {
|
|
|
|
public:
|
2011-08-16 03:55:03 +04:00
|
|
|
explicit F2BIter(const SkPDFGlyphSetMap& map);
|
2011-07-26 02:34:12 +04:00
|
|
|
FontGlyphSetPair* next() const;
|
|
|
|
void reset(const SkPDFGlyphSetMap& map);
|
|
|
|
|
|
|
|
private:
|
|
|
|
const SkTDArray<FontGlyphSetPair>* fMap;
|
|
|
|
mutable int fIndex;
|
|
|
|
};
|
|
|
|
|
|
|
|
void merge(const SkPDFGlyphSetMap& usage);
|
|
|
|
void reset();
|
|
|
|
|
|
|
|
void noteGlyphUsage(SkPDFFont* font, const uint16_t* glyphIDs,
|
|
|
|
int numGlyphs);
|
|
|
|
|
|
|
|
private:
|
|
|
|
SkPDFGlyphSet* getGlyphSetForFont(SkPDFFont* font);
|
|
|
|
|
|
|
|
SkTDArray<FontGlyphSetPair> fMap;
|
|
|
|
};
|
|
|
|
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
|
|
|
|
/** \class SkPDFFont
|
|
|
|
A PDF Object class representing a font. The font may have resources
|
|
|
|
attached to it in order to embed the font. SkPDFFonts are canonicalized
|
|
|
|
so that resource deduplication will only include one copy of a font.
|
|
|
|
This class uses the same pattern as SkPDFGraphicState, a static weak
|
|
|
|
reference to each instantiated class.
|
|
|
|
*/
|
|
|
|
class SkPDFFont : public SkPDFDict {
|
|
|
|
public:
|
2011-05-31 00:52:33 +04:00
|
|
|
SK_API virtual ~SkPDFFont();
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
|
2011-05-31 00:52:33 +04:00
|
|
|
SK_API virtual void getResources(SkTDArray<SkPDFObject*>* resourceList);
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
|
2011-03-05 00:43:27 +03:00
|
|
|
/** Returns the typeface represented by this class. Returns NULL for the
|
|
|
|
* default typeface.
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
*/
|
2011-05-31 00:52:33 +04:00
|
|
|
SK_API SkTypeface* typeface();
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
|
2011-05-29 09:55:42 +04:00
|
|
|
/** Returns the font type represented in this font. For Type0 fonts,
|
|
|
|
* returns the type of the decendant font.
|
|
|
|
*/
|
2011-07-26 02:34:12 +04:00
|
|
|
SK_API virtual SkAdvancedTypefaceMetrics::FontType getType();
|
2011-01-26 00:01:34 +03:00
|
|
|
|
2011-07-26 02:34:12 +04:00
|
|
|
/** Returns true if this font encoding supports glyph IDs above 255.
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
*/
|
2011-07-26 02:34:12 +04:00
|
|
|
SK_API virtual bool multiByteGlyphs() const = 0;
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
|
2011-07-26 02:34:12 +04:00
|
|
|
/** Return true if this font has an encoding for the passed glyph id.
|
2011-07-24 01:13:30 +04:00
|
|
|
*/
|
2011-07-26 02:34:12 +04:00
|
|
|
SK_API bool hasGlyph(uint16_t glyphID);
|
2011-07-24 01:13:30 +04:00
|
|
|
|
2011-02-28 22:52:18 +03:00
|
|
|
/** Convert (in place) the input glyph IDs into the font encoding. If the
|
|
|
|
* font has more glyphs than can be encoded (like a type 1 font with more
|
|
|
|
* than 255 glyphs) this method only converts up to the first out of range
|
2011-01-26 00:01:34 +03:00
|
|
|
* glyph ID.
|
|
|
|
* @param glyphIDs The input text as glyph IDs.
|
|
|
|
* @param numGlyphs The number of input glyphs.
|
|
|
|
* @return Returns the number of glyphs consumed.
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
*/
|
2011-05-31 00:52:33 +04:00
|
|
|
SK_API size_t glyphsToPDFFontEncoding(uint16_t* glyphIDs, size_t numGlyphs);
|
2011-01-26 00:01:34 +03:00
|
|
|
|
2011-03-05 00:43:27 +03:00
|
|
|
/** Get the font resource for the passed typeface and glyphID. The
|
2011-01-26 00:01:34 +03:00
|
|
|
* reference count of the object is incremented and it is the caller's
|
|
|
|
* responsibility to unreference it when done. This is needed to
|
|
|
|
* accommodate the weak reference pattern used when the returned object
|
|
|
|
* is new and has no other references.
|
2011-03-05 00:43:27 +03:00
|
|
|
* @param typeface The typeface to find.
|
|
|
|
* @param glyphID Specify which section of a large font is of interest.
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
*/
|
2011-07-20 21:20:28 +04:00
|
|
|
SK_API static SkPDFFont* GetFontResource(SkTypeface* typeface,
|
2011-05-31 00:52:33 +04:00
|
|
|
uint16_t glyphID);
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
|
2011-07-26 02:34:12 +04:00
|
|
|
/** Subset the font based on usage set. Returns a SkPDFFont instance with
|
|
|
|
* subset.
|
|
|
|
* @param usage Glyph subset requested.
|
|
|
|
* @return NULL if font does not support subsetting, a new instance
|
|
|
|
* of SkPDFFont otherwise.
|
|
|
|
*/
|
|
|
|
SK_API virtual SkPDFFont* getFontSubset(const SkPDFGlyphSet* usage);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// Common constructor to handle common members.
|
|
|
|
SkPDFFont(SkAdvancedTypefaceMetrics* fontInfo, SkTypeface* typeface,
|
|
|
|
uint16_t glyphID, bool descendantFont);
|
|
|
|
|
|
|
|
// Accessors for subclass.
|
|
|
|
SkAdvancedTypefaceMetrics* fontInfo();
|
2011-08-18 06:38:50 +04:00
|
|
|
void setFontInfo(SkAdvancedTypefaceMetrics* info);
|
2011-07-26 02:34:12 +04:00
|
|
|
uint16_t firstGlyphID() const;
|
|
|
|
uint16_t lastGlyphID() const;
|
|
|
|
void setLastGlyphID(uint16_t glyphID);
|
|
|
|
|
|
|
|
// Add object to resource list.
|
|
|
|
void addResource(SkPDFObject* object);
|
|
|
|
|
|
|
|
// Accessors for FontDescriptor associated with this object.
|
|
|
|
SkPDFDict* getFontDescriptor();
|
|
|
|
void setFontDescriptor(SkPDFDict* descriptor);
|
|
|
|
|
|
|
|
// Add common entries to FontDescriptor.
|
|
|
|
bool addCommonFontDescriptorEntries(int16_t defaultWidth);
|
|
|
|
|
|
|
|
/** Set fFirstGlyphID and fLastGlyphID to span at most 255 glyphs,
|
|
|
|
* including the passed glyphID.
|
|
|
|
*/
|
|
|
|
void adjustGlyphRangeForSingleByteEncoding(int16_t glyphID);
|
|
|
|
|
|
|
|
// Generate ToUnicode table according to glyph usage subset.
|
|
|
|
// If subset is NULL, all available glyph ids will be used.
|
|
|
|
void populateToUnicodeTable(const SkPDFGlyphSet* subset);
|
|
|
|
|
|
|
|
// Create instances of derived types based on fontInfo.
|
|
|
|
static SkPDFFont* Create(SkAdvancedTypefaceMetrics* fontInfo,
|
|
|
|
SkTypeface* typeface, uint16_t glyphID,
|
|
|
|
SkPDFDict* fontDescriptor);
|
|
|
|
|
|
|
|
static bool Find(uint32_t fontID, uint16_t glyphID, int* index);
|
|
|
|
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
private:
|
2011-07-26 02:34:12 +04:00
|
|
|
class FontRec {
|
|
|
|
public:
|
|
|
|
SkPDFFont* fFont;
|
|
|
|
uint32_t fFontID;
|
|
|
|
uint16_t fGlyphID;
|
|
|
|
|
|
|
|
// A fGlyphID of 0 with no fFont always matches.
|
|
|
|
bool operator==(const FontRec& b) const;
|
|
|
|
FontRec(SkPDFFont* font, uint32_t fontID, uint16_t fGlyphID);
|
|
|
|
};
|
|
|
|
|
2011-03-05 00:43:27 +03:00
|
|
|
SkRefPtr<SkTypeface> fTypeface;
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
|
2011-01-26 00:01:34 +03:00
|
|
|
// The glyph IDs accessible with this font. For Type1 (non CID) fonts,
|
|
|
|
// this will be a subset if the font has more than 255 glyphs.
|
|
|
|
uint16_t fFirstGlyphID;
|
|
|
|
uint16_t fLastGlyphID;
|
|
|
|
// The font info is only kept around after construction for large
|
|
|
|
// Type1 (non CID) fonts that need multiple "fonts" to access all glyphs.
|
2011-02-02 05:11:22 +03:00
|
|
|
SkRefPtr<SkAdvancedTypefaceMetrics> fFontInfo;
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
SkTDArray<SkPDFObject*> fResources;
|
2011-01-26 00:01:34 +03:00
|
|
|
SkRefPtr<SkPDFDict> fDescriptor;
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
|
2011-07-26 02:34:12 +04:00
|
|
|
SkAdvancedTypefaceMetrics::FontType fFontType;
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
|
|
|
|
// This should be made a hash table if performance is a problem.
|
2011-07-20 21:20:28 +04:00
|
|
|
static SkTDArray<FontRec>& CanonicalFonts();
|
2012-01-27 01:26:40 +04:00
|
|
|
static SkBaseMutex& CanonicalFontsMutex();
|
PDF: Add text support with a font framework (font embedding to come).
Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.
Review URL: http://codereview.appspot.com/2946041
git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-11-12 00:37:00 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|