Package org.apache.fop.layoutmgr.inline
Class ScaledBaselineTable
- java.lang.Object
-
- org.apache.fop.layoutmgr.inline.ScaledBaselineTable
-
final class ScaledBaselineTable extends java.lang.Object
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
Fields Modifier and Type Field Description private int
afterEdgeOffset
private int
altitude
private int
beforeEdgeOffset
private int
depth
private int
dominantBaselineIdentifier
private int
dominantBaselineOffset
private static float
HANGING_BASELINE_FACTOR
private static float
MATHEMATICAL_BASELINE_FACTOR
private WritingMode
writingMode
private int
xHeight
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (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
getDominantBaselineIdentifier()
Return the dominant baseline for this baseline table.(package private) WritingMode
getWritingMode()
Return the writing mode for this baseline table.private boolean
isHorizontalWritingMode()
(package private) void
setBeforeAndAfterBaselines(int beforeBaseline, int afterBaseline)
Sets the position of the before and after baselines.
-
-
-
Field Detail
-
HANGING_BASELINE_FACTOR
private static final float HANGING_BASELINE_FACTOR
- See Also:
- Constant Field Values
-
MATHEMATICAL_BASELINE_FACTOR
private static final float MATHEMATICAL_BASELINE_FACTOR
- See Also:
- Constant Field Values
-
altitude
private final int altitude
-
depth
private final int depth
-
xHeight
private final int xHeight
-
dominantBaselineIdentifier
private final int dominantBaselineIdentifier
-
writingMode
private final WritingMode writingMode
-
dominantBaselineOffset
private final int dominantBaselineOffset
-
beforeEdgeOffset
private int beforeEdgeOffset
-
afterEdgeOffset
private int afterEdgeOffset
-
-
Constructor Detail
-
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 Detail
-
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
ScaledBaselineTable deriveScaledBaselineTable(int baselineIdentifier)
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
-
-