本文整理汇总了Java中sun.font.CoreMetrics.get方法的典型用法代码示例。如果您正苦于以下问题:Java CoreMetrics.get方法的具体用法?Java CoreMetrics.get怎么用?Java CoreMetrics.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.font.CoreMetrics
的用法示例。
在下文中一共展示了CoreMetrics.get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fastInit
import sun.font.CoreMetrics; //导入方法依赖的package包/类
private void fastInit(char[] chars, Font font,
Map<? extends Attribute, ?> attrs,
FontRenderContext frc) {
// Object vf = attrs.get(TextAttribute.ORIENTATION);
// isVerticalLine = TextAttribute.ORIENTATION_VERTICAL.equals(vf);
isVerticalLine = false;
LineMetrics lm = font.getLineMetrics(chars, 0, chars.length, frc);
CoreMetrics cm = CoreMetrics.get(lm);
byte glyphBaseline = (byte) cm.baselineIndex;
if (attrs == null) {
baseline = glyphBaseline;
baselineOffsets = cm.baselineOffsets;
justifyRatio = 1.0f;
} else {
paragraphInit(glyphBaseline, cm, attrs, chars);
}
characterCount = chars.length;
textLine = TextLine.fastCreateTextLine(frc, chars, font, cm, attrs);
}
示例2: fastInit
import sun.font.CoreMetrics; //导入方法依赖的package包/类
private void fastInit(char[] chars, Font font, Map attrs, FontRenderContext frc) {
// Object vf = attrs.get(TextAttribute.ORIENTATION);
// isVerticalLine = TextAttribute.ORIENTATION_VERTICAL.equals(vf);
isVerticalLine = false;
LineMetrics lm = font.getLineMetrics(chars, 0, chars.length, frc);
CoreMetrics cm = CoreMetrics.get(lm);
byte glyphBaseline = (byte) cm.baselineIndex;
if (attrs == null) {
baseline = glyphBaseline;
baselineOffsets = cm.baselineOffsets;
justifyRatio = 1.0f;
} else {
paragraphInit(glyphBaseline, cm, attrs, chars);
}
characterCount = chars.length;
textLine = TextLine.fastCreateTextLine(frc, chars, font, cm, attrs);
}
示例3: createComponentsOnRun
import sun.font.CoreMetrics; //导入方法依赖的package包/类
/**
* Returns an array in logical order of the TextLineComponents on
* the text in the given range, with the given attributes.
*/
public static TextLineComponent[] createComponentsOnRun(int runStart,
int runLimit,
char[] chars,
int[] charsLtoV,
byte[] levels,
TextLabelFactory factory,
Font font,
CoreMetrics cm,
FontRenderContext frc,
Decoration decorator,
TextLineComponent[] components,
int numComponents) {
int pos = runStart;
do {
int chunkLimit = firstVisualChunk(charsLtoV, levels, pos, runLimit); // <= displayLimit
do {
int startPos = pos;
int lmCount;
if (cm == null) {
LineMetrics lineMetrics = font.getLineMetrics(chars, startPos, chunkLimit, frc);
cm = CoreMetrics.get(lineMetrics);
lmCount = lineMetrics.getNumChars();
}
else {
lmCount = (chunkLimit-startPos);
}
TextLineComponent nextComponent =
factory.createExtended(font, cm, decorator, startPos, startPos + lmCount);
++numComponents;
if (numComponents >= components.length) {
components = expandArray(components);
}
components[numComponents-1] = nextComponent;
pos += lmCount;
} while (pos < chunkLimit);
} while (pos < runLimit);
return components;
}
示例4: createComponentsOnRun
import sun.font.CoreMetrics; //导入方法依赖的package包/类
/**
* Returns an array in logical order of the TextLineComponents on
* the text in the given range, with the given attributes.
*/
public static TextLineComponent[] createComponentsOnRun(int runStart,
int runLimit,
char[] chars,
int[] charsLtoV,
byte[] levels,
TextLabelFactory factory,
Font font,
CoreMetrics cm,
FontRenderContext frc,
Decoration decorator,
TextLineComponent[] components,
int numComponents) {
int pos = runStart;
do {
int chunkLimit = firstVisualChunk(charsLtoV, levels, pos, runLimit); // <= displayLimit
do {
int startPos = pos;
int lmCount;
if (cm == null) {
LineMetrics lineMetrics = font.getLineMetrics(chars, startPos, chunkLimit, frc);
cm = CoreMetrics.get(lineMetrics);
lmCount = lineMetrics.getNumChars();
}
else {
lmCount = (chunkLimit-startPos);
}
TextLineComponent nextComponent =
factory.createExtended(font, cm, decorator, startPos, startPos + lmCount);
++numComponents;
if (numComponents >= components.length) {
components = expandArray(components);
}
components[numComponents-1] = nextComponent;
pos += lmCount;
} while (pos < chunkLimit);
} while (pos < runLimit);
return components;
}