Package com.snowtide.pdf.layout
Interface Line
-
- All Superinterfaces:
Bounded
,OutputSource
public interface Line extends Bounded, OutputSource
Instances of this class represent distinct runs of text at a specific position within aBlock
.- Since:
- v1.4
- Version:
- ©2004-2024 Snowtide
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TextUnit
getTextUnit(int idx)
Returns theTextUnit
at the specified index.int
getTextUnitCnt()
Returns the number ofTextUnit
s in this Line.List<TextUnit>
getTextUnits()
Returns a List view of theTextUnit
s held by this Line.TextUnit
remove(int idx)
Removes theTextUnit
at the specified index, and returns it.List<Span>
spans(Direction basedir)
Returns a list ofSpan
s identified within this line of text.-
Methods inherited from interface com.snowtide.pdf.OutputSource
pipe, pipe
-
-
-
-
Method Detail
-
getTextUnitCnt
int getTextUnitCnt()
Returns the number ofTextUnit
s in this Line.
-
getTextUnits
List<TextUnit> getTextUnits()
Returns a List view of theTextUnit
s held by this Line. This List is guaranteed to provide efficient random access.
-
spans
List<Span> spans(Direction basedir)
Returns a list ofSpan
s identified within this line of text. This allows for directionally-aware word-by-word iteration within a line: while the {code Line}'s direct storage of characters (viagetTextUnit(int)
, etc) always holds them in a strictly left-to-right order, without explicitly representing spaces, theSpan
s returned from this method will:- Contain explicitly-represented
Spaces
(as calculated by PDFxStream using adjacent characters' fonts and other metrics) - Reorder the
Word
Span
s in order to account for those words' aggregate directionality (eitherDirection.LTR
orDirection.RTL
.
- Contain explicitly-represented
-
-