ttfhorizontalheadertable.java
来自「纯java操作系统jnode,安装简单和操作简单的个人使用的Java操作系统」· Java 代码 · 共 137 行
JAVA
137 行
package org.jnode.awt.font.truetype;
import java.io.IOException;
/**
* HHEA Table.
*
* @author Simon Fischer
* @version $Id: TTFHorizontalHeaderTable.java,v 1.1 2003/11/25 11:51:38 epr Exp $
*/
public class TTFHorizontalHeaderTable extends TTFVersionTable {
private int ascender;
private int descender;
private int lineGap;
private int advanceWidthMax;
private int minLeftSideBearing;
private int minRightSideBearing;
private int xMaxExtent;
private int caretSlopeRise;
private int caretSlopeRun;
private int metricDataFormat;
private int numberOfHMetrics;
public String getTag() {
return "hhea";
}
public void readTable() throws IOException {
readVersion();
ascender = ttf.readFWord();
descender = ttf.readFWord();
lineGap = ttf.readFWord();
advanceWidthMax = ttf.readUFWord();
minLeftSideBearing = ttf.readFWord();
minRightSideBearing = ttf.readFWord();
xMaxExtent = ttf.readFWord();
caretSlopeRise = ttf.readShort();
caretSlopeRun = ttf.readShort();
for (int i = 0; i < 5; i++) {
ttf.checkShortZero();
}
metricDataFormat = ttf.readShort();
numberOfHMetrics = ttf.readUShort();
}
public String toString() {
String str = super.toString();
str += "\n asc:" + ascender + " desc:" + descender + " lineGap:" + lineGap + " maxAdvance:" + advanceWidthMax;
str += "\n metricDataFormat:" + metricDataFormat + " #HMetrics:" + numberOfHMetrics;
return str;
}
/**
* @return The maximum advance
*/
public int getMaxAdvance() {
return this.advanceWidthMax;
}
/**
* @return The ascent
*/
public int getAscent() {
return this.ascender;
}
/**
* @return The descent
*/
public int getDescent() {
return this.descender;
}
/**
* @return The line gap
*/
public int getLineGap() {
return this.lineGap;
}
/**
* @return The X max extent
*/
public int getXMaxExtent() {
return this.xMaxExtent;
}
/**
* @return The caret slope rise
*/
public int getCaretSlopeRise() {
return this.caretSlopeRise;
}
/**
* @return The caret slope run
*/
public int getCaretSlopeRun() {
return this.caretSlopeRun;
}
/**
* @return The metric data format
*/
public int getMetricDataFormat() {
return this.metricDataFormat;
}
/**
* @return The minimum left side bearing
*/
public int getMinLeftSideBearing() {
return this.minLeftSideBearing;
}
/**
* @return The minimum right side bearing
*/
public int getMinRightSideBearing() {
return this.minRightSideBearing;
}
/**
* @return The number of h-metrics
*/
public int getNumberOfHMetrics() {
return this.numberOfHMetrics;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?