Package org.apache.fop.layoutmgr.inline
Class ScaledBaselineTable
java.lang.Object
org.apache.fop.layoutmgr.inline.ScaledBaselineTable
The FOP specific incarnation of the XSL-FO scaled baseline table.
All baseline tables are scaled to the font size of the font they
apply to. This class uses a coordinate system with its origin
where the dominant baseline intersects the start edge of the box.
All measurements are in mpt.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private final int
private int
private final int
private final int
private final int
private static final float
private static final float
private final WritingMode
private final int
-
Constructor Summary
ConstructorsConstructorDescriptionScaledBaselineTable
(int altitude, int depth, int xHeight, int dominantBaselineIdentifier, WritingMode writingMode) Creates a new instance of BasicScaledBaselineTable for the given altitude, depth, xHeight, baseline and writing mode. -
Method Summary
Modifier and TypeMethodDescription(package private) ScaledBaselineTable
deriveScaledBaselineTable
(int baselineIdentifier) Return a new baseline table for the given baseline based on the current baseline table.(package private) int
getBaseline
(int baselineIdentifier) Return the offset of the given baseline from the dominant baseline.private int
getBaselineDefaultOffset
(int baselineIdentifier) Return the baseline offset measured from the font's default baseline for the given baseline.(package private) int
Return the dominant baseline for this baseline table.(package private) WritingMode
Return the writing mode for this baseline table.private boolean
(package private) void
setBeforeAndAfterBaselines
(int beforeBaseline, int afterBaseline) Sets the position of the before and after baselines.
-
Field Details
-
HANGING_BASELINE_FACTOR
private static final float HANGING_BASELINE_FACTOR- See Also:
-
MATHEMATICAL_BASELINE_FACTOR
private static final float MATHEMATICAL_BASELINE_FACTOR- See Also:
-
altitude
private final int altitude -
depth
private final int depth -
xHeight
private final int xHeight -
dominantBaselineIdentifier
private final int dominantBaselineIdentifier -
writingMode
-
dominantBaselineOffset
private final int dominantBaselineOffset -
beforeEdgeOffset
private int beforeEdgeOffset -
afterEdgeOffset
private int afterEdgeOffset
-
-
Constructor Details
-
ScaledBaselineTable
ScaledBaselineTable(int altitude, int depth, int xHeight, int dominantBaselineIdentifier, WritingMode writingMode) Creates a new instance of BasicScaledBaselineTable for the given altitude, depth, xHeight, baseline and writing mode.- Parameters:
altitude
- the height of the box or the font ascenderdepth
- the font descender or 0xHeight
- the font xHeightdominantBaselineIdentifier
- the dominant baseline given as an integer constantwritingMode
- the writing mode given as an integer constant
-
-
Method Details
-
getDominantBaselineIdentifier
int getDominantBaselineIdentifier()Return the dominant baseline for this baseline table.- Returns:
- the dominant baseline
-
getWritingMode
WritingMode getWritingMode()Return the writing mode for this baseline table.- Returns:
- the writing mode
-
getBaseline
int getBaseline(int baselineIdentifier) Return the offset of the given baseline from the dominant baseline.- Parameters:
baselineIdentifier
- a baseline identifier- Returns:
- the offset from the dominant baseline
-
isHorizontalWritingMode
private boolean isHorizontalWritingMode() -
getBaselineDefaultOffset
private int getBaselineDefaultOffset(int baselineIdentifier) Return the baseline offset measured from the font's default baseline for the given baseline.- Parameters:
baselineIdentifier
- the baseline identifier- Returns:
- the baseline offset
-
setBeforeAndAfterBaselines
void setBeforeAndAfterBaselines(int beforeBaseline, int afterBaseline) Sets the position of the before and after baselines. This is usually only done for line areas. For other areas the position of the before and after baselines are fixed when the table is constructed.- Parameters:
beforeBaseline
- the offset of the before-edge baseline from the dominant baselineafterBaseline
- the offset of the after-edge baseline from the dominant baseline
-
deriveScaledBaselineTable
Return a new baseline table for the given baseline based on the current baseline table.- Parameters:
baselineIdentifier
- the baseline identifer- Returns:
- a new baseline with the new baseline
-