Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: src/pdf/SkPDFFont.h

Issue 2241683005: SkPDF: unify drawText and drawPosText (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: stop assuming typeface has glyphs Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/pdf/SkPDFFont.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #ifndef SkPDFFont_DEFINED 9 #ifndef SkPDFFont_DEFINED
10 #define SkPDFFont_DEFINED 10 #define SkPDFFont_DEFINED
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 bool hasGlyph(uint16_t glyphID); 99 bool hasGlyph(uint16_t glyphID);
100 100
101 /** Convert (in place) the input glyph IDs into the font encoding. If the 101 /** Convert (in place) the input glyph IDs into the font encoding. If the
102 * font has more glyphs than can be encoded (like a type 1 font with more 102 * font has more glyphs than can be encoded (like a type 1 font with more
103 * than 255 glyphs) this method only converts up to the first out of range 103 * than 255 glyphs) this method only converts up to the first out of range
104 * glyph ID. 104 * glyph ID.
105 * @param glyphIDs The input text as glyph IDs. 105 * @param glyphIDs The input text as glyph IDs.
106 * @param numGlyphs The number of input glyphs. 106 * @param numGlyphs The number of input glyphs.
107 * @return Returns the number of glyphs consumed. 107 * @return Returns the number of glyphs consumed.
108 */ 108 */
109 int glyphsToPDFFontEncoding(uint16_t* glyphIDs, int numGlyphs); 109 int glyphsToPDFFontEncoding(SkGlyphID* glyphIDs, int numGlyphs) const;
110 /**
111 * Like above, but does not modify glyphIDs array.
112 */
113 int glyphsToPDFFontEncodingCount(const SkGlyphID* glyphIDs,
114 int numGlyphs) const;
110 115
111 /** Get the font resource for the passed typeface and glyphID. The 116 /** Get the font resource for the passed typeface and glyphID. The
112 * reference count of the object is incremented and it is the caller's 117 * reference count of the object is incremented and it is the caller's
113 * responsibility to unreference it when done. This is needed to 118 * responsibility to unreference it when done. This is needed to
114 * accommodate the weak reference pattern used when the returned object 119 * accommodate the weak reference pattern used when the returned object
115 * is new and has no other references. 120 * is new and has no other references.
116 * @param typeface The typeface to find. 121 * @param typeface The typeface to find.
117 * @param glyphID Specify which section of a large font is of interest. 122 * @param glyphID Specify which section of a large font is of interest.
118 */ 123 */
119 static SkPDFFont* GetFontResource(SkPDFCanon* canon, 124 static SkPDFFont* GetFontResource(SkPDFCanon* canon,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 uint16_t fLastGlyphID; 205 uint16_t fLastGlyphID;
201 sk_sp<const SkAdvancedTypefaceMetrics> fFontInfo; 206 sk_sp<const SkAdvancedTypefaceMetrics> fFontInfo;
202 sk_sp<SkPDFDict> fDescriptor; 207 sk_sp<SkPDFDict> fDescriptor;
203 208
204 SkAdvancedTypefaceMetrics::FontType fFontType; 209 SkAdvancedTypefaceMetrics::FontType fFontType;
205 210
206 typedef SkPDFDict INHERITED; 211 typedef SkPDFDict INHERITED;
207 }; 212 };
208 213
209 #endif 214 #endif
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/pdf/SkPDFFont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698