aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2016-07-25 07:18:12 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-25 07:18:12 -0700
commitd0e95a524c20932e0f4e68bab43995188a281395 (patch)
tree7077702ee7d4e3d7deffcbe10f70ba4ff53fe50f /include/core
parent1d35231e7b5cce8c4f54ea71a8e030be893363fb (diff)
typedef uint16_t SkGlyphID
This goes well with our existing `typedef int32_t SkUnichar`. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2095263003 Review-Url: https://codereview.chromium.org/2095263003
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkFont.h2
-rw-r--r--include/core/SkPaint.h4
-rw-r--r--include/core/SkTextBlob.h2
-rw-r--r--include/core/SkTypeface.h8
-rw-r--r--include/core/SkTypes.h4
5 files changed, 12 insertions, 8 deletions
diff --git a/include/core/SkFont.h b/include/core/SkFont.h
index 6e8a71501f..e50909aaec 100644
--- a/include/core/SkFont.h
+++ b/include/core/SkFont.h
@@ -146,7 +146,7 @@ public:
bool isDevKern() const { return SkToBool(fFlags & kDevKern_Flag); }
int textToGlyphs(const void* text, size_t byteLength, SkTextEncoding,
- uint16_t glyphs[], int maxGlyphCount) const;
+ SkGlyphID glyphs[], int maxGlyphCount) const;
int countText(const void* text, size_t byteLength, SkTextEncoding encoding) {
return this->textToGlyphs(text, byteLength, encoding, nullptr, 0);
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index caa185608a..ef80b73f21 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -821,7 +821,7 @@ public:
is returned.
*/
int textToGlyphs(const void* text, size_t byteLength,
- uint16_t glyphs[]) const;
+ SkGlyphID glyphs[]) const;
/** Return true if all of the specified text has a corresponding non-zero
glyph ID. If any of the code-points in the text are not supported in
@@ -836,7 +836,7 @@ public:
to zero. Note: this does not look at the text-encoding setting in the
paint, only at the typeface.
*/
- void glyphsToUnichars(const uint16_t glyphs[], int count, SkUnichar text[]) const;
+ void glyphsToUnichars(const SkGlyphID glyphs[], int count, SkUnichar text[]) const;
/** Return the number of drawable units in the specified text buffer.
This looks at the current TextEncoding field of the paint. If you also
diff --git a/include/core/SkTextBlob.h b/include/core/SkTextBlob.h
index e43ff74a85..c211f85086 100644
--- a/include/core/SkTextBlob.h
+++ b/include/core/SkTextBlob.h
@@ -106,7 +106,7 @@ public:
* A run is a sequence of glyphs sharing the same font metrics and positioning mode.
*/
struct RunBuffer {
- uint16_t* glyphs;
+ SkGlyphID* glyphs;
SkScalar* pos;
};
diff --git a/include/core/SkTypeface.h b/include/core/SkTypeface.h
index e3a311da43..4f3879c6c2 100644
--- a/include/core/SkTypeface.h
+++ b/include/core/SkTypeface.h
@@ -188,7 +188,7 @@ public:
* from the beginning of chars. This value is valid, even if the
* glyphs parameter is NULL.
*/
- int charsToGlyphs(const void* chars, Encoding encoding, uint16_t glyphs[],
+ int charsToGlyphs(const void* chars, Encoding encoding, SkGlyphID glyphs[],
int glyphCount) const;
/**
@@ -262,7 +262,7 @@ public:
* array will be in an undefined state (possibly some values may have been
* written, but none of them should be interpreted as valid values).
*/
- bool getKerningPairAdjustments(const uint16_t glyphs[], int count,
+ bool getKerningPairAdjustments(const SkGlyphID glyphs[], int count,
int32_t adjustments[]) const;
struct LocalizedString {
@@ -364,12 +364,12 @@ protected:
virtual void onGetFontDescriptor(SkFontDescriptor*, bool* isLocal) const = 0;
- virtual int onCharsToGlyphs(const void* chars, Encoding, uint16_t glyphs[],
+ virtual int onCharsToGlyphs(const void* chars, Encoding, SkGlyphID glyphs[],
int glyphCount) const = 0;
virtual int onCountGlyphs() const = 0;
virtual int onGetUPEM() const = 0;
- virtual bool onGetKerningPairAdjustments(const uint16_t glyphs[], int count,
+ virtual bool onGetKerningPairAdjustments(const SkGlyphID glyphs[], int count,
int32_t adjustments[]) const;
/** Returns the family name of the typeface as known by its font manager.
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 279557498e..deb2819740 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -348,6 +348,10 @@ typedef uint32_t SkFourByteTag;
*/
typedef int32_t SkUnichar;
+/** 16 bit unsigned integer to hold a glyph index
+*/
+typedef uint16_t SkGlyphID;
+
/** 32 bit value to hold a millisecond duration
* Note that SK_MSecMax is about 25 days.
*/