/// <summary>Copy a Glyph and assign new placement and advance offsets and a new index delta to base glyph</summary> /// <param name="glyph">Glyph to copy</param> /// <param name="xPlacement">x - placement offset</param> /// <param name="yPlacement">y - placement offset</param> /// <param name="xAdvance">x - advance offset</param> /// <param name="yAdvance">y - advance offset</param> /// <param name="anchorDelta">Index delta to base glyph. If after a glyph there are several anchored glyphs we should know we to find base glyph. /// </param> public Glyph(iText.IO.Font.Otf.Glyph glyph, int xPlacement, int yPlacement, int xAdvance, int yAdvance, int anchorDelta) : this(glyph) { this.xPlacement = (short)xPlacement; this.yPlacement = (short)yPlacement; this.xAdvance = (short)xAdvance; this.yAdvance = (short)yAdvance; this.anchorDelta = (short)anchorDelta; }
/// <summary>Two Glyphs are equal if their unicode characters, code and normalized width are equal.</summary> /// <param name="obj"/> /// <returns>True if this equals obj cast to Glyph, false otherwise.</returns> public override bool Equals(Object obj) { if (this == obj) { return(true); } if (obj == null || GetType() != obj.GetType()) { return(false); } iText.IO.Font.Otf.Glyph other = (iText.IO.Font.Otf.Glyph)obj; return(iText.IO.Util.JavaUtil.ArraysEquals(chars, other.chars) && code == other.code && width == other.width); }
/// <summary>Copy a Glyph.</summary> /// <param name="glyph">Glyph to copy</param> public Glyph(iText.IO.Font.Otf.Glyph glyph) { this.code = glyph.code; this.width = glyph.width; this.chars = glyph.chars; this.unicode = glyph.unicode; this.isMark = glyph.isMark; this.bbox = glyph.bbox; this.xPlacement = glyph.xPlacement; this.yPlacement = glyph.yPlacement; this.xAdvance = glyph.xAdvance; this.yAdvance = glyph.yAdvance; this.anchorDelta = glyph.anchorDelta; }
/// <summary>Copy a glyph and assign the copied glyph a new unicode point and characters</summary> /// <param name="glyph">glyph to copy</param> /// <param name="unicode">new unicode point</param> public Glyph(iText.IO.Font.Otf.Glyph glyph, int unicode) : this(glyph.code, glyph.width, unicode, GetChars(unicode), glyph.IsMark()) { }