Java Code Examples for sun.font.CoreMetrics#get()
The following examples show how to use
sun.font.CoreMetrics#get() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TextLayout.java From jdk-1.7-annotated with Apache License 2.0 | 6 votes |
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); }
Example 2
Source File: TextLayout.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
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); }
Example 3
Source File: TextLayout.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
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); }
Example 4
Source File: TextLayout.java From Java8CN with Apache License 2.0 | 6 votes |
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); }
Example 5
Source File: TextLayout.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
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); }
Example 6
Source File: TextLayout.java From Bytecoder with Apache License 2.0 | 6 votes |
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); }
Example 7
Source File: TextLayout.java From jdk1.8-source-analysis with Apache License 2.0 | 6 votes |
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); }
Example 8
Source File: TextLayout.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
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); }
Example 9
Source File: TextLayout.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
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); }
Example 10
Source File: TextLine.java From hottub with GNU General Public License v2.0 | 4 votes |
/** * 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; }
Example 11
Source File: TextLine.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
/** * 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; }
Example 12
Source File: TextLine.java From Bytecoder with Apache License 2.0 | 4 votes |
/** * 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; }
Example 13
Source File: TextLine.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * 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; }
Example 14
Source File: TextLine.java From JDKSourceCode1.8 with MIT License | 4 votes |
/** * 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; }
Example 15
Source File: TextLine.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
/** * 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; }
Example 16
Source File: TextLine.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * 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; }
Example 17
Source File: TextLine.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** * 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; }
Example 18
Source File: TextLine.java From Java8CN with Apache License 2.0 | 4 votes |
/** * 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; }
Example 19
Source File: TextLine.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
/** * 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; }
Example 20
Source File: TextLine.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** * 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; }