Java 类sun.font.CoreMetrics 实例源码

项目:OpenJSharp    文件:TextLayout.java   
/**
 * Initialize the paragraph-specific data.
 */
private void paragraphInit(byte aBaseline, CoreMetrics lm,
                           Map<? extends Attribute, ?> paragraphAttrs,
                           char[] text) {

    baseline = aBaseline;

    // normalize to current baseline
    baselineOffsets = TextLine.getNormalizedOffsets(lm.baselineOffsets, baseline);

    justifyRatio = AttributeValues.getJustification(paragraphAttrs);
    NumericShaper shaper = AttributeValues.getNumericShaping(paragraphAttrs);
    if (shaper != null) {
        shaper.shape(text, 0, text.length);
    }
}
项目:OpenJSharp    文件:TextLayout.java   
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);
}
项目:OpenJSharp    文件:TextLine.java   
public CoreMetrics getCoreMetricsAt(int logicalIndex) {

        if (logicalIndex < 0) {
            throw new IllegalArgumentException("Negative logicalIndex.");
        }

        if (logicalIndex > fCharsLimit - fCharsStart) {
            throw new IllegalArgumentException("logicalIndex too large.");
        }

        int currentTlc = 0;
        int tlcStart = 0;
        int tlcLimit = 0;

        do {
            tlcLimit += fComponents[currentTlc].getNumCharacters();
            if (tlcLimit > logicalIndex) {
                break;
            }
            ++currentTlc;
            tlcStart = tlcLimit;
        } while(currentTlc < fComponents.length);

        return fComponents[currentTlc].getCoreMetrics();
    }
项目:jdk8u-jdk    文件:TextLayout.java   
/**
 * Initialize the paragraph-specific data.
 */
private void paragraphInit(byte aBaseline, CoreMetrics lm,
                           Map<? extends Attribute, ?> paragraphAttrs,
                           char[] text) {

    baseline = aBaseline;

    // normalize to current baseline
    baselineOffsets = TextLine.getNormalizedOffsets(lm.baselineOffsets, baseline);

    justifyRatio = AttributeValues.getJustification(paragraphAttrs);
    NumericShaper shaper = AttributeValues.getNumericShaping(paragraphAttrs);
    if (shaper != null) {
        shaper.shape(text, 0, text.length);
    }
}
项目:jdk8u-jdk    文件:TextLayout.java   
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);
}
项目:jdk8u-jdk    文件:TextLine.java   
public CoreMetrics getCoreMetricsAt(int logicalIndex) {

        if (logicalIndex < 0) {
            throw new IllegalArgumentException("Negative logicalIndex.");
        }

        if (logicalIndex > fCharsLimit - fCharsStart) {
            throw new IllegalArgumentException("logicalIndex too large.");
        }

        int currentTlc = 0;
        int tlcStart = 0;
        int tlcLimit = 0;

        do {
            tlcLimit += fComponents[currentTlc].getNumCharacters();
            if (tlcLimit > logicalIndex) {
                break;
            }
            ++currentTlc;
            tlcStart = tlcLimit;
        } while(currentTlc < fComponents.length);

        return fComponents[currentTlc].getCoreMetrics();
    }
项目:openjdk-jdk10    文件:TextLayout.java   
/**
 * Initialize the paragraph-specific data.
 */
private void paragraphInit(byte aBaseline, CoreMetrics lm,
                           Map<? extends Attribute, ?> paragraphAttrs,
                           char[] text) {

    baseline = aBaseline;

    // normalize to current baseline
    baselineOffsets = TextLine.getNormalizedOffsets(lm.baselineOffsets, baseline);

    justifyRatio = AttributeValues.getJustification(paragraphAttrs);
    NumericShaper shaper = AttributeValues.getNumericShaping(paragraphAttrs);
    if (shaper != null) {
        shaper.shape(text, 0, text.length);
    }
}
项目:openjdk-jdk10    文件:TextLayout.java   
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);
}
项目:openjdk-jdk10    文件:TextLine.java   
public CoreMetrics getCoreMetricsAt(int logicalIndex) {

        if (logicalIndex < 0) {
            throw new IllegalArgumentException("Negative logicalIndex.");
        }

        if (logicalIndex > fCharsLimit - fCharsStart) {
            throw new IllegalArgumentException("logicalIndex too large.");
        }

        int currentTlc = 0;
        int tlcStart = 0;
        int tlcLimit = 0;

        do {
            tlcLimit += fComponents[currentTlc].getNumCharacters();
            if (tlcLimit > logicalIndex) {
                break;
            }
            ++currentTlc;
            tlcStart = tlcLimit;
        } while(currentTlc < fComponents.length);

        return fComponents[currentTlc].getCoreMetrics();
    }
项目:openjdk9    文件:TextLayout.java   
/**
 * Initialize the paragraph-specific data.
 */
private void paragraphInit(byte aBaseline, CoreMetrics lm,
                           Map<? extends Attribute, ?> paragraphAttrs,
                           char[] text) {

    baseline = aBaseline;

    // normalize to current baseline
    baselineOffsets = TextLine.getNormalizedOffsets(lm.baselineOffsets, baseline);

    justifyRatio = AttributeValues.getJustification(paragraphAttrs);
    NumericShaper shaper = AttributeValues.getNumericShaping(paragraphAttrs);
    if (shaper != null) {
        shaper.shape(text, 0, text.length);
    }
}
项目:openjdk9    文件:TextLayout.java   
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);
}
项目:openjdk9    文件:TextLine.java   
public CoreMetrics getCoreMetricsAt(int logicalIndex) {

        if (logicalIndex < 0) {
            throw new IllegalArgumentException("Negative logicalIndex.");
        }

        if (logicalIndex > fCharsLimit - fCharsStart) {
            throw new IllegalArgumentException("logicalIndex too large.");
        }

        int currentTlc = 0;
        int tlcStart = 0;
        int tlcLimit = 0;

        do {
            tlcLimit += fComponents[currentTlc].getNumCharacters();
            if (tlcLimit > logicalIndex) {
                break;
            }
            ++currentTlc;
            tlcStart = tlcLimit;
        } while(currentTlc < fComponents.length);

        return fComponents[currentTlc].getCoreMetrics();
    }
项目:Java8CN    文件:TextLayout.java   
/**
 * Initialize the paragraph-specific data.
 */
private void paragraphInit(byte aBaseline, CoreMetrics lm,
                           Map<? extends Attribute, ?> paragraphAttrs,
                           char[] text) {

    baseline = aBaseline;

    // normalize to current baseline
    baselineOffsets = TextLine.getNormalizedOffsets(lm.baselineOffsets, baseline);

    justifyRatio = AttributeValues.getJustification(paragraphAttrs);
    NumericShaper shaper = AttributeValues.getNumericShaping(paragraphAttrs);
    if (shaper != null) {
        shaper.shape(text, 0, text.length);
    }
}
项目:Java8CN    文件:TextLayout.java   
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);
}
项目:Java8CN    文件:TextLine.java   
public CoreMetrics getCoreMetricsAt(int logicalIndex) {

        if (logicalIndex < 0) {
            throw new IllegalArgumentException("Negative logicalIndex.");
        }

        if (logicalIndex > fCharsLimit - fCharsStart) {
            throw new IllegalArgumentException("logicalIndex too large.");
        }

        int currentTlc = 0;
        int tlcStart = 0;
        int tlcLimit = 0;

        do {
            tlcLimit += fComponents[currentTlc].getNumCharacters();
            if (tlcLimit > logicalIndex) {
                break;
            }
            ++currentTlc;
            tlcStart = tlcLimit;
        } while(currentTlc < fComponents.length);

        return fComponents[currentTlc].getCoreMetrics();
    }
项目:jdk8u_jdk    文件:TextLayout.java   
/**
 * Initialize the paragraph-specific data.
 */
private void paragraphInit(byte aBaseline, CoreMetrics lm,
                           Map<? extends Attribute, ?> paragraphAttrs,
                           char[] text) {

    baseline = aBaseline;

    // normalize to current baseline
    baselineOffsets = TextLine.getNormalizedOffsets(lm.baselineOffsets, baseline);

    justifyRatio = AttributeValues.getJustification(paragraphAttrs);
    NumericShaper shaper = AttributeValues.getNumericShaping(paragraphAttrs);
    if (shaper != null) {
        shaper.shape(text, 0, text.length);
    }
}
项目:jdk8u_jdk    文件:TextLayout.java   
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);
}
项目:jdk8u_jdk    文件:TextLine.java   
public CoreMetrics getCoreMetricsAt(int logicalIndex) {

        if (logicalIndex < 0) {
            throw new IllegalArgumentException("Negative logicalIndex.");
        }

        if (logicalIndex > fCharsLimit - fCharsStart) {
            throw new IllegalArgumentException("logicalIndex too large.");
        }

        int currentTlc = 0;
        int tlcStart = 0;
        int tlcLimit = 0;

        do {
            tlcLimit += fComponents[currentTlc].getNumCharacters();
            if (tlcLimit > logicalIndex) {
                break;
            }
            ++currentTlc;
            tlcStart = tlcLimit;
        } while(currentTlc < fComponents.length);

        return fComponents[currentTlc].getCoreMetrics();
    }
项目:lookaside_java-1.8.0-openjdk    文件:TextLayout.java   
/**
 * Initialize the paragraph-specific data.
 */
private void paragraphInit(byte aBaseline, CoreMetrics lm,
                           Map<? extends Attribute, ?> paragraphAttrs,
                           char[] text) {

    baseline = aBaseline;

    // normalize to current baseline
    baselineOffsets = TextLine.getNormalizedOffsets(lm.baselineOffsets, baseline);

    justifyRatio = AttributeValues.getJustification(paragraphAttrs);
    NumericShaper shaper = AttributeValues.getNumericShaping(paragraphAttrs);
    if (shaper != null) {
        shaper.shape(text, 0, text.length);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:TextLayout.java   
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);
}
项目:lookaside_java-1.8.0-openjdk    文件:TextLine.java   
public CoreMetrics getCoreMetricsAt(int logicalIndex) {

        if (logicalIndex < 0) {
            throw new IllegalArgumentException("Negative logicalIndex.");
        }

        if (logicalIndex > fCharsLimit - fCharsStart) {
            throw new IllegalArgumentException("logicalIndex too large.");
        }

        int currentTlc = 0;
        int tlcStart = 0;
        int tlcLimit = 0;

        do {
            tlcLimit += fComponents[currentTlc].getNumCharacters();
            if (tlcLimit > logicalIndex) {
                break;
            }
            ++currentTlc;
            tlcStart = tlcLimit;
        } while(currentTlc < fComponents.length);

        return fComponents[currentTlc].getCoreMetrics();
    }
项目:VarJ    文件:TextLayout.java   
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);
}
项目:VarJ    文件:TextLine.java   
public CoreMetrics getCoreMetricsAt(int logicalIndex) {

        if (logicalIndex < 0) {
            throw new IllegalArgumentException("Negative logicalIndex.");
        }

        if (logicalIndex > fCharsLimit - fCharsStart) {
            throw new IllegalArgumentException("logicalIndex too large.");
        }

        int currentTlc = 0;
        int tlcStart = 0;
        int tlcLimit = 0;

        do {
            tlcLimit += fComponents[currentTlc].getNumCharacters();
            if (tlcLimit > logicalIndex) {
                break;
            }
            ++currentTlc;
            tlcStart = tlcLimit;
        } while(currentTlc < fComponents.length);

        return fComponents[currentTlc].getCoreMetrics();
    }
项目:jdk-1.7-annotated    文件:TextLayout.java   
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);
}
项目:jdk-1.7-annotated    文件:TextLine.java   
public CoreMetrics getCoreMetricsAt(int logicalIndex) {

        if (logicalIndex < 0) {
            throw new IllegalArgumentException("Negative logicalIndex.");
        }

        if (logicalIndex > fCharsLimit - fCharsStart) {
            throw new IllegalArgumentException("logicalIndex too large.");
        }

        int currentTlc = 0;
        int tlcStart = 0;
        int tlcLimit = 0;

        do {
            tlcLimit += fComponents[currentTlc].getNumCharacters();
            if (tlcLimit > logicalIndex) {
                break;
            }
            ++currentTlc;
            tlcStart = tlcLimit;
        } while(currentTlc < fComponents.length);

        return fComponents[currentTlc].getCoreMetrics();
    }
项目:infobip-open-jdk-8    文件:TextLayout.java   
/**
 * Initialize the paragraph-specific data.
 */
private void paragraphInit(byte aBaseline, CoreMetrics lm,
                           Map<? extends Attribute, ?> paragraphAttrs,
                           char[] text) {

    baseline = aBaseline;

    // normalize to current baseline
    baselineOffsets = TextLine.getNormalizedOffsets(lm.baselineOffsets, baseline);

    justifyRatio = AttributeValues.getJustification(paragraphAttrs);
    NumericShaper shaper = AttributeValues.getNumericShaping(paragraphAttrs);
    if (shaper != null) {
        shaper.shape(text, 0, text.length);
    }
}
项目:infobip-open-jdk-8    文件:TextLayout.java   
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);
}
项目:infobip-open-jdk-8    文件:TextLine.java   
public CoreMetrics getCoreMetricsAt(int logicalIndex) {

        if (logicalIndex < 0) {
            throw new IllegalArgumentException("Negative logicalIndex.");
        }

        if (logicalIndex > fCharsLimit - fCharsStart) {
            throw new IllegalArgumentException("logicalIndex too large.");
        }

        int currentTlc = 0;
        int tlcStart = 0;
        int tlcLimit = 0;

        do {
            tlcLimit += fComponents[currentTlc].getNumCharacters();
            if (tlcLimit > logicalIndex) {
                break;
            }
            ++currentTlc;
            tlcStart = tlcLimit;
        } while(currentTlc < fComponents.length);

        return fComponents[currentTlc].getCoreMetrics();
    }
项目:jdk8u-dev-jdk    文件:TextLayout.java   
/**
 * Initialize the paragraph-specific data.
 */
private void paragraphInit(byte aBaseline, CoreMetrics lm,
                           Map<? extends Attribute, ?> paragraphAttrs,
                           char[] text) {

    baseline = aBaseline;

    // normalize to current baseline
    baselineOffsets = TextLine.getNormalizedOffsets(lm.baselineOffsets, baseline);

    justifyRatio = AttributeValues.getJustification(paragraphAttrs);
    NumericShaper shaper = AttributeValues.getNumericShaping(paragraphAttrs);
    if (shaper != null) {
        shaper.shape(text, 0, text.length);
    }
}
项目:jdk8u-dev-jdk    文件:TextLayout.java   
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);
}
项目:jdk8u-dev-jdk    文件:TextLine.java   
public CoreMetrics getCoreMetricsAt(int logicalIndex) {

        if (logicalIndex < 0) {
            throw new IllegalArgumentException("Negative logicalIndex.");
        }

        if (logicalIndex > fCharsLimit - fCharsStart) {
            throw new IllegalArgumentException("logicalIndex too large.");
        }

        int currentTlc = 0;
        int tlcStart = 0;
        int tlcLimit = 0;

        do {
            tlcLimit += fComponents[currentTlc].getNumCharacters();
            if (tlcLimit > logicalIndex) {
                break;
            }
            ++currentTlc;
            tlcStart = tlcLimit;
        } while(currentTlc < fComponents.length);

        return fComponents[currentTlc].getCoreMetrics();
    }
项目:jdk7-jdk    文件:TextLayout.java   
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);
}
项目:jdk7-jdk    文件:TextLine.java   
public CoreMetrics getCoreMetricsAt(int logicalIndex) {

        if (logicalIndex < 0) {
            throw new IllegalArgumentException("Negative logicalIndex.");
        }

        if (logicalIndex > fCharsLimit - fCharsStart) {
            throw new IllegalArgumentException("logicalIndex too large.");
        }

        int currentTlc = 0;
        int tlcStart = 0;
        int tlcLimit = 0;

        do {
            tlcLimit += fComponents[currentTlc].getNumCharacters();
            if (tlcLimit > logicalIndex) {
                break;
            }
            ++currentTlc;
            tlcStart = tlcLimit;
        } while(currentTlc < fComponents.length);

        return fComponents[currentTlc].getCoreMetrics();
    }
项目:openjdk-source-code-learn    文件:TextLayout.java   
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);
}
项目:openjdk-source-code-learn    文件:TextLine.java   
public CoreMetrics getCoreMetricsAt(int logicalIndex) {

        if (logicalIndex < 0) {
            throw new IllegalArgumentException("Negative logicalIndex.");
        }

        if (logicalIndex > fCharsLimit - fCharsStart) {
            throw new IllegalArgumentException("logicalIndex too large.");
        }

        int currentTlc = 0;
        int tlcStart = 0;
        int tlcLimit = 0;

        do {
            tlcLimit += fComponents[currentTlc].getNumCharacters();
            if (tlcLimit > logicalIndex) {
                break;
            }
            ++currentTlc;
            tlcStart = tlcLimit;
        } while(currentTlc < fComponents.length);

        return fComponents[currentTlc].getCoreMetrics();
    }
项目:OLD-OpenJDK8    文件:TextLayout.java   
/**
 * Initialize the paragraph-specific data.
 */
private void paragraphInit(byte aBaseline, CoreMetrics lm,
                           Map<? extends Attribute, ?> paragraphAttrs,
                           char[] text) {

    baseline = aBaseline;

    // normalize to current baseline
    baselineOffsets = TextLine.getNormalizedOffsets(lm.baselineOffsets, baseline);

    justifyRatio = AttributeValues.getJustification(paragraphAttrs);
    NumericShaper shaper = AttributeValues.getNumericShaping(paragraphAttrs);
    if (shaper != null) {
        shaper.shape(text, 0, text.length);
    }
}
项目:OLD-OpenJDK8    文件:TextLayout.java   
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);
}
项目:OLD-OpenJDK8    文件:TextLine.java   
public CoreMetrics getCoreMetricsAt(int logicalIndex) {

        if (logicalIndex < 0) {
            throw new IllegalArgumentException("Negative logicalIndex.");
        }

        if (logicalIndex > fCharsLimit - fCharsStart) {
            throw new IllegalArgumentException("logicalIndex too large.");
        }

        int currentTlc = 0;
        int tlcStart = 0;
        int tlcLimit = 0;

        do {
            tlcLimit += fComponents[currentTlc].getNumCharacters();
            if (tlcLimit > logicalIndex) {
                break;
            }
            ++currentTlc;
            tlcStart = tlcLimit;
        } while(currentTlc < fComponents.length);

        return fComponents[currentTlc].getCoreMetrics();
    }
项目:openjdk-jdk7u-jdk    文件:TextLayout.java   
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);
}
项目:openjdk-jdk7u-jdk    文件:TextLine.java   
public CoreMetrics getCoreMetricsAt(int logicalIndex) {

        if (logicalIndex < 0) {
            throw new IllegalArgumentException("Negative logicalIndex.");
        }

        if (logicalIndex > fCharsLimit - fCharsStart) {
            throw new IllegalArgumentException("logicalIndex too large.");
        }

        int currentTlc = 0;
        int tlcStart = 0;
        int tlcLimit = 0;

        do {
            tlcLimit += fComponents[currentTlc].getNumCharacters();
            if (tlcLimit > logicalIndex) {
                break;
            }
            ++currentTlc;
            tlcStart = tlcLimit;
        } while(currentTlc < fComponents.length);

        return fComponents[currentTlc].getCoreMetrics();
    }