diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-08-16 00:30:02 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-08-16 00:30:02 +0000 |
commit | de03c5e924225ce4939674db845e8752006604b8 (patch) | |
tree | e6f9a39e05c546813eaf190c5c9e39684e59f714 /Build/source/libs/graphite2/graphite2-src/src/inc/Segment.h | |
parent | 85d218211e4fa3ff701221f15c1e4e475fe94793 (diff) |
graphite2 1.3.12
git-svn-id: svn://tug.org/texlive/trunk@48409 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/graphite2/graphite2-src/src/inc/Segment.h')
-rw-r--r-- | Build/source/libs/graphite2/graphite2-src/src/inc/Segment.h | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/Build/source/libs/graphite2/graphite2-src/src/inc/Segment.h b/Build/source/libs/graphite2/graphite2-src/src/inc/Segment.h index e5a8ad408a7..6cf83408d4d 100644 --- a/Build/source/libs/graphite2/graphite2-src/src/inc/Segment.h +++ b/Build/source/libs/graphite2/graphite2-src/src/inc/Segment.h @@ -15,8 +15,8 @@ You should also have received a copy of the GNU Lesser General Public License along with this library in the file named "LICENSE". - If not, write to the Free Software Foundation, 51 Franklin Street, - Suite 500, Boston, MA 02110-1335, USA or visit their web page on the + If not, write to the Free Software Foundation, 51 Franklin Street, + Suite 500, Boston, MA 02110-1335, USA or visit their web page on the internet at http://www.fsf.org/licenses/lgpl.html. Alternatively, the contents of this file may be used under the terms of the @@ -49,9 +49,6 @@ typedef Vector<Slot *> SlotRope; typedef Vector<int16 *> AttributeRope; typedef Vector<SlotJustify *> JustifyRope; -#ifndef GRAPHITE2_NSEGCACHE -class SegmentScopeState; -#endif class Font; class Segment; class Silf; @@ -91,26 +88,18 @@ public: SEG_HASCOLLISIONS = 2 }; - unsigned int slotCount() const { return m_numGlyphs; } //one slot per glyph - void extendLength(int num) { m_numGlyphs += num; } + size_t slotCount() const { return m_numGlyphs; } //one slot per glyph + void extendLength(ptrdiff_t num) { m_numGlyphs += num; } Position advance() const { return m_advance; } bool runGraphite() { if (m_silf) return m_face->runGraphite(this, m_silf); else return true;}; void chooseSilf(uint32 script) { m_silf = m_face->chooseSilf(script); } const Silf *silf() const { return m_silf; } - unsigned int charInfoCount() const { return m_numCharinfo; } + size_t charInfoCount() const { return m_numCharinfo; } const CharInfo *charinfo(unsigned int index) const { return index < m_numCharinfo ? m_charinfo + index : NULL; } CharInfo *charinfo(unsigned int index) { return index < m_numCharinfo ? m_charinfo + index : NULL; } - Segment(unsigned int numchars, const Face* face, uint32 script, int dir); + Segment(size_t numchars, const Face* face, uint32 script, int dir); ~Segment(); -#ifndef GRAPHITE2_NSEGCACHE - SegmentScopeState setScope(Slot * firstSlot, Slot * lastSlot, size_t subLength); - void removeScope(SegmentScopeState & state); - void append(const Segment &other); - void splice(size_t offset, size_t length, Slot * const startSlot, - Slot * endSlot, const Slot * srcSlot, - const size_t numGlyphs); -#endif uint8 flags() const { return m_flags; } void flags(uint8 f) { m_flags = f; } Slot *first() { return m_first; } @@ -123,14 +112,14 @@ public: SlotJustify *newJustify(); void freeJustify(SlotJustify *aJustify); Position positionSlots(const Font *font=0, Slot *first=0, Slot *last=0, bool isRtl = false, bool isFinal = true); - void associateChars(int offset, int num); + void associateChars(int offset, size_t num); void linkClusters(Slot *first, Slot *last); uint16 getClassGlyph(uint16 cid, uint16 offset) const { return m_silf->getClassGlyph(cid, offset); } uint16 findClassIndex(uint16 cid, uint16 gid) const { return m_silf->findClassIndex(cid, gid); } - int addFeatures(const Features& feats) { m_feats.push_back(feats); return m_feats.size() - 1; } + int addFeatures(const Features& feats) { m_feats.push_back(feats); return int(m_feats.size()) - 1; } uint32 getFeature(int index, uint8 findex) const { const FeatureRef* pFR=m_face->theSill().theFeatureMap().featureRef(findex); if (!pFR) return 0; else return pFR->getFeatureVal(m_feats[index]); } void setFeature(int index, uint8 findex, uint32 val) { - const FeatureRef* pFR=m_face->theSill().theFeatureMap().featureRef(findex); + const FeatureRef* pFR=m_face->theSill().theFeatureMap().featureRef(findex); if (pFR) { if (val > pFR->maxVal()) val = pFR->maxVal(); @@ -139,8 +128,8 @@ public: int8 dir() const { return m_dir; } void dir(int8 val) { m_dir = val; } bool currdir() const { return ((m_dir >> 6) ^ m_dir) & 1; } - unsigned int passBits() const { return m_passBits; } - void mergePassBits(const unsigned int val) { m_passBits &= val; } + uint8 passBits() const { return m_passBits; } + void mergePassBits(const uint8 val) { m_passBits &= val; } int16 glyphAttr(uint16 gid, uint16 gattr) const { const GlyphFace * p = m_face->glyphs().glyphSafe(gid); return p ? p->attrs()[gattr] : 0; } int32 getGlyphMetric(Slot *iSlot, uint8 metric, uint8 attrLevel, bool rtl) const; float glyphAdvance(uint16 gid) const { return m_face->glyphs().glyph(gid)->theAdvance().x; } @@ -168,7 +157,7 @@ public: //only used by: GrSegment* makeAndInitialize(const GrFont *font, c void finalise(const Font *font, bool reverse=false); float justify(Slot *pSlot, const Font *font, float width, enum justFlags flags, Slot *pFirst, Slot *pLast); bool initCollisions(); - + private: Position m_advance; // whole segment advance SlotRope m_slots; // Vector of slot buffers @@ -183,13 +172,13 @@ private: const Silf * m_silf; Slot * m_first; // first slot in segment Slot * m_last; // last slot in segment - unsigned int m_bufSize, // how big a buffer to create when need more slots + size_t m_bufSize, // how big a buffer to create when need more slots m_numGlyphs, - m_numCharinfo, // size of the array and number of input characters - m_passBits; // if bit set then skip pass + m_numCharinfo; // size of the array and number of input characters int m_defaultOriginal; // number of whitespace chars in the string int8 m_dir; - uint8 m_flags; // General purpose flags + uint8 m_flags, // General purpose flags + m_passBits; // if bit set then skip pass }; inline @@ -245,4 +234,3 @@ bool Segment::isWhitespace(const int cid) const } // namespace graphite2 struct gr_segment : public graphite2::Segment {}; - |