Package com.itextpdf.io.font.otf
Class GlyphLine
- java.lang.Object
-
- com.itextpdf.io.font.otf.GlyphLine
-
public class GlyphLine extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
GlyphLine.ActualText
static class
GlyphLine.GlyphLinePart
static interface
GlyphLine.IGlyphLineFilter
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<GlyphLine.ActualText>
actualText
private int
end
protected java.util.List<Glyph>
glyphs
private int
idx
private int
start
-
Constructor Summary
Constructors Modifier Constructor Description GlyphLine()
GlyphLine(GlyphLine other)
Copy a line of Glyphs.GlyphLine(GlyphLine other, int start, int end)
Copy a slice of a line of GlyphsGlyphLine(java.util.List<Glyph> glyphs)
Create a new line of Glyphs.GlyphLine(java.util.List<Glyph> glyphs, int start, int end)
Create a new line of Glyphs from a slice of a List of Glyphs.protected
GlyphLine(java.util.List<Glyph> glyphs, java.util.List<GlyphLine.ActualText> actualText, int start, int end)
Create a new line of Glyphs from a slice of a List of Glyphs, and add the actual text.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, Glyph glyph)
void
add(Glyph glyph)
void
add(GlyphLine other)
Add a line to the current one.private void
addAllGlyphs(int index, java.util.List<Glyph> additionalGlyphs)
GlyphLine
copy(int left, int right)
Copy a slice of this Glyphline.boolean
equals(java.lang.Object obj)
GlyphLine
filter(GlyphLine.IGlyphLineFilter filter)
Glyph
get(int index)
int
getEnd()
Retrieves the end of the glyph line.int
getIdx()
Retrieves the idx of the glyph line.int
getStart()
Retrieves the start of the glyph line.int
hashCode()
java.util.Iterator<GlyphLine.GlyphLinePart>
iterator()
private void
removeGlyph(int index)
void
replaceContent(GlyphLine other)
Replaces the current content with the other line's content.Glyph
set(int index, Glyph glyph)
void
setActualText(int left, int right, java.lang.String text)
void
setEnd(int end)
Sets the end of the glyph line.void
setGlyphs(java.util.List<Glyph> replacementGlyphs)
void
setIdx(int idx)
Sets the idx of the glyph line.void
setStart(int start)
Sets the start of the glyph line.int
size()
void
substituteManyToOne(OpenTypeFontTableReader tableReader, int lookupFlag, int rightPartLen, int substitutionGlyphIndex)
void
substituteOneToMany(OpenTypeFontTableReader tableReader, int[] substGlyphIds)
void
substituteOneToOne(OpenTypeFontTableReader tableReader, int substitutionGlyphIndex)
java.lang.String
toString()
java.lang.String
toUnicodeString(int start, int end)
Get the unicode string representation of the GlyphLine slice.
-
-
-
Field Detail
-
start
private int start
-
end
private int end
-
idx
private int idx
-
glyphs
protected java.util.List<Glyph> glyphs
-
actualText
protected java.util.List<GlyphLine.ActualText> actualText
-
-
Constructor Detail
-
GlyphLine
public GlyphLine()
-
GlyphLine
public GlyphLine(java.util.List<Glyph> glyphs)
Create a new line of Glyphs.- Parameters:
glyphs
- list containing the glyphs
-
GlyphLine
public GlyphLine(java.util.List<Glyph> glyphs, int start, int end)
Create a new line of Glyphs from a slice of a List of Glyphs.- Parameters:
glyphs
- list of Glyphs to slicestart
- starting index of the sliceend
- terminating index of the slice
-
GlyphLine
protected GlyphLine(java.util.List<Glyph> glyphs, java.util.List<GlyphLine.ActualText> actualText, int start, int end)
Create a new line of Glyphs from a slice of a List of Glyphs, and add the actual text.- Parameters:
glyphs
- list of Glyphs to sliceactualText
- corresponding list containing the actual text the glyphs representstart
- starting index of the sliceend
- terminating index of the slice
-
GlyphLine
public GlyphLine(GlyphLine other)
Copy a line of Glyphs.- Parameters:
other
- line of Glyphs to copy
-
GlyphLine
public GlyphLine(GlyphLine other, int start, int end)
Copy a slice of a line of Glyphs- Parameters:
other
- line of Glyphs to copystart
- starting index of the sliceend
- terminating index of the slice
-
-
Method Detail
-
getStart
public int getStart()
Retrieves the start of the glyph line.- Returns:
- start of glyph line
-
setStart
public void setStart(int start)
Sets the start of the glyph line.- Parameters:
start
- start of glyph line
-
getEnd
public int getEnd()
Retrieves the end of the glyph line.- Returns:
- end of glyph line
-
setEnd
public void setEnd(int end)
Sets the end of the glyph line.- Parameters:
end
- end of glyph line
-
getIdx
public int getIdx()
Retrieves the idx of the glyph line.- Returns:
- idx of glyph line
-
setIdx
public void setIdx(int idx)
Sets the idx of the glyph line.- Parameters:
idx
- idx of glyph line
-
toUnicodeString
public java.lang.String toUnicodeString(int start, int end)
Get the unicode string representation of the GlyphLine slice.- Parameters:
start
- starting index of the sliceend
- terminating index of the slice- Returns:
- String containing the unicode representation of the slice.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
copy
public GlyphLine copy(int left, int right)
Copy a slice of this Glyphline.- Parameters:
left
- leftmost index of the sliceright
- rightmost index of the slice- Returns:
- new GlyphLine containing the copied slice
-
get
public Glyph get(int index)
-
add
public void add(Glyph glyph)
-
add
public void add(int index, Glyph glyph)
-
setGlyphs
public void setGlyphs(java.util.List<Glyph> replacementGlyphs)
-
add
public void add(GlyphLine other)
Add a line to the current one. The glyphs from the start till the end points will be copied. The same is true for the actual text.- Parameters:
other
- the line that should be added to the current one
-
replaceContent
public void replaceContent(GlyphLine other)
Replaces the current content with the other line's content.- Parameters:
other
- the line with the content to be set to the current one
-
size
public int size()
-
substituteManyToOne
public void substituteManyToOne(OpenTypeFontTableReader tableReader, int lookupFlag, int rightPartLen, int substitutionGlyphIndex)
-
substituteOneToOne
public void substituteOneToOne(OpenTypeFontTableReader tableReader, int substitutionGlyphIndex)
-
substituteOneToMany
public void substituteOneToMany(OpenTypeFontTableReader tableReader, int[] substGlyphIds)
-
filter
public GlyphLine filter(GlyphLine.IGlyphLineFilter filter)
-
setActualText
public void setActualText(int left, int right, java.lang.String text)
-
iterator
public java.util.Iterator<GlyphLine.GlyphLinePart> iterator()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
removeGlyph
private void removeGlyph(int index)
-
addAllGlyphs
private void addAllGlyphs(int index, java.util.List<Glyph> additionalGlyphs)
-
-