java.awt.font.NumericShaper#shape ( )源码实例Demo

下面列出了java.awt.font.NumericShaper#shape ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: jdk8u-dev-jdk   文件: ShapingTest.java
private static void checkResult(String ranges, NumericShaper ns,
                                String given, String expected) {
    char[] text = given.toCharArray();
    ns.shape(text, 0, text.length);
    String got = new String(text);

    if (!expected.equals(got)) {
        err = true;
        System.err.println("Error with range(s) <" + ranges + ">.");
        System.err.println("  text     = " + given);
        System.err.println("  got      = " + got);
        System.err.println("  expected = " + expected);
    } else {
        System.out.println("OK with range(s) <" + ranges + ">.");
        System.out.println("  text     = " + given);
        System.out.println("  got      = " + got);
        System.out.println("  expected = " + expected);
    }
}
 
源代码2 项目: 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);
    }
}
 
源代码3 项目: TencentKona-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);
    }
}
 
源代码4 项目: 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);
    }
}
 
源代码5 项目: jdk8u60   文件: 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);
    }
}
 
源代码6 项目: 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);
    }
}
 
源代码7 项目: hottub   文件: 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);
    }
}
 
源代码8 项目: openjdk-jdk8u   文件: 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);
    }
}
 
源代码9 项目: openjdk-jdk8u   文件: ShapingTest.java
private static void checkResult(String ranges, NumericShaper ns,
                                String given, String expected) {
    char[] text = given.toCharArray();
    ns.shape(text, 0, text.length);
    String got = new String(text);

    if (!expected.equals(got)) {
        err = true;
        System.err.println("Error with range(s) <" + ranges + ">.");
        System.err.println("  text     = " + given);
        System.err.println("  got      = " + got);
        System.err.println("  expected = " + expected);
    } else {
        System.out.println("OK with range(s) <" + ranges + ">.");
        System.out.println("  text     = " + given);
        System.out.println("  got      = " + got);
        System.out.println("  expected = " + expected);
    }
}
 
源代码10 项目: jdk8u-jdk   文件: ShapingTest.java
private static void checkResult(String ranges, NumericShaper ns,
                                String given, String expected) {
    char[] text = given.toCharArray();
    ns.shape(text, 0, text.length);
    String got = new String(text);

    if (!expected.equals(got)) {
        err = true;
        System.err.println("Error with range(s) <" + ranges + ">.");
        System.err.println("  text     = " + given);
        System.err.println("  got      = " + got);
        System.err.println("  expected = " + expected);
    } else {
        System.out.println("OK with range(s) <" + ranges + ">.");
        System.out.println("  text     = " + given);
        System.out.println("  got      = " + got);
        System.out.println("  expected = " + expected);
    }
}
 
源代码11 项目: openjdk-8-source   文件: 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);
    }
}
 
源代码12 项目: Bytecoder   文件: 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);
    }
}
 
源代码13 项目: openjdk-jdk9   文件: 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);
    }
}
 
源代码14 项目: jdk8u-dev-jdk   文件: ShapingTest.java
private static void test6943963() {
    // Needed to reproduce this bug.
    NumericShaper ns_dummy = getContextualShaper(ARABIC | TAMIL | ETHIOPIC,
                               EUROPEAN);
    char[] c = "\u1200 1".toCharArray();
    ns_dummy.shape(c, 0, c.length);


    String given = "\u0627\u0628 456";
    String expected_ARABIC = "\u0627\u0628 \u0664\u0665\u0666";
    String expected_EASTERN_ARABIC = "\u0627\u0628 \u06f4\u06f5\u06f6";

    NumericShaper ns = getContextualShaper(ARABIC);
    checkResult("ARABIC", ns, given, expected_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.ARABIC));
    checkResult("Range.ARABIC", ns, given, expected_ARABIC);

    ns = getContextualShaper(EASTERN_ARABIC);
    checkResult("EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.EASTERN_ARABIC));
    checkResult("Range.EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(ARABIC | EASTERN_ARABIC);
    checkResult("ARABIC | EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.ARABIC, Range.EASTERN_ARABIC));
    checkResult("Range.ARABIC, Range.EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);
}
 
源代码15 项目: openjdk-8-source   文件: ShapingTest.java
private static void test6943963() {
    // Needed to reproduce this bug.
    NumericShaper ns_dummy = getContextualShaper(ARABIC | TAMIL | ETHIOPIC,
                               EUROPEAN);
    char[] c = "\u1200 1".toCharArray();
    ns_dummy.shape(c, 0, c.length);


    String given = "\u0627\u0628 456";
    String expected_ARABIC = "\u0627\u0628 \u0664\u0665\u0666";
    String expected_EASTERN_ARABIC = "\u0627\u0628 \u06f4\u06f5\u06f6";

    NumericShaper ns = getContextualShaper(ARABIC);
    checkResult("ARABIC", ns, given, expected_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.ARABIC));
    checkResult("Range.ARABIC", ns, given, expected_ARABIC);

    ns = getContextualShaper(EASTERN_ARABIC);
    checkResult("EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.EASTERN_ARABIC));
    checkResult("Range.EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(ARABIC | EASTERN_ARABIC);
    checkResult("ARABIC | EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.ARABIC, Range.EASTERN_ARABIC));
    checkResult("Range.ARABIC, Range.EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);
}
 
源代码16 项目: TencentKona-8   文件: ShapingTest.java
private static void test6943963() {
    // Needed to reproduce this bug.
    NumericShaper ns_dummy = getContextualShaper(ARABIC | TAMIL | ETHIOPIC,
                               EUROPEAN);
    char[] c = "\u1200 1".toCharArray();
    ns_dummy.shape(c, 0, c.length);


    String given = "\u0627\u0628 456";
    String expected_ARABIC = "\u0627\u0628 \u0664\u0665\u0666";
    String expected_EASTERN_ARABIC = "\u0627\u0628 \u06f4\u06f5\u06f6";

    NumericShaper ns = getContextualShaper(ARABIC);
    checkResult("ARABIC", ns, given, expected_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.ARABIC));
    checkResult("Range.ARABIC", ns, given, expected_ARABIC);

    ns = getContextualShaper(EASTERN_ARABIC);
    checkResult("EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.EASTERN_ARABIC));
    checkResult("Range.EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(ARABIC | EASTERN_ARABIC);
    checkResult("ARABIC | EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.ARABIC, Range.EASTERN_ARABIC));
    checkResult("Range.ARABIC, Range.EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);
}
 
源代码17 项目: hottub   文件: ShapingTest.java
private static void test6943963() {
    // Needed to reproduce this bug.
    NumericShaper ns_dummy = getContextualShaper(ARABIC | TAMIL | ETHIOPIC,
                               EUROPEAN);
    char[] c = "\u1200 1".toCharArray();
    ns_dummy.shape(c, 0, c.length);


    String given = "\u0627\u0628 456";
    String expected_ARABIC = "\u0627\u0628 \u0664\u0665\u0666";
    String expected_EASTERN_ARABIC = "\u0627\u0628 \u06f4\u06f5\u06f6";

    NumericShaper ns = getContextualShaper(ARABIC);
    checkResult("ARABIC", ns, given, expected_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.ARABIC));
    checkResult("Range.ARABIC", ns, given, expected_ARABIC);

    ns = getContextualShaper(EASTERN_ARABIC);
    checkResult("EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.EASTERN_ARABIC));
    checkResult("Range.EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(ARABIC | EASTERN_ARABIC);
    checkResult("ARABIC | EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.ARABIC, Range.EASTERN_ARABIC));
    checkResult("Range.ARABIC, Range.EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);
}
 
源代码18 项目: openjdk-jdk8u   文件: ShapingTest.java
private static void test6943963() {
    // Needed to reproduce this bug.
    NumericShaper ns_dummy = getContextualShaper(ARABIC | TAMIL | ETHIOPIC,
                               EUROPEAN);
    char[] c = "\u1200 1".toCharArray();
    ns_dummy.shape(c, 0, c.length);


    String given = "\u0627\u0628 456";
    String expected_ARABIC = "\u0627\u0628 \u0664\u0665\u0666";
    String expected_EASTERN_ARABIC = "\u0627\u0628 \u06f4\u06f5\u06f6";

    NumericShaper ns = getContextualShaper(ARABIC);
    checkResult("ARABIC", ns, given, expected_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.ARABIC));
    checkResult("Range.ARABIC", ns, given, expected_ARABIC);

    ns = getContextualShaper(EASTERN_ARABIC);
    checkResult("EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.EASTERN_ARABIC));
    checkResult("Range.EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(ARABIC | EASTERN_ARABIC);
    checkResult("ARABIC | EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.ARABIC, Range.EASTERN_ARABIC));
    checkResult("Range.ARABIC, Range.EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);
}
 
源代码19 项目: openjdk-jdk8u-backup   文件: ShapingTest.java
private static void test6943963() {
    // Needed to reproduce this bug.
    NumericShaper ns_dummy = getContextualShaper(ARABIC | TAMIL | ETHIOPIC,
                               EUROPEAN);
    char[] c = "\u1200 1".toCharArray();
    ns_dummy.shape(c, 0, c.length);


    String given = "\u0627\u0628 456";
    String expected_ARABIC = "\u0627\u0628 \u0664\u0665\u0666";
    String expected_EASTERN_ARABIC = "\u0627\u0628 \u06f4\u06f5\u06f6";

    NumericShaper ns = getContextualShaper(ARABIC);
    checkResult("ARABIC", ns, given, expected_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.ARABIC));
    checkResult("Range.ARABIC", ns, given, expected_ARABIC);

    ns = getContextualShaper(EASTERN_ARABIC);
    checkResult("EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.EASTERN_ARABIC));
    checkResult("Range.EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(ARABIC | EASTERN_ARABIC);
    checkResult("ARABIC | EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.ARABIC, Range.EASTERN_ARABIC));
    checkResult("Range.ARABIC, Range.EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);
}
 
源代码20 项目: openjdk-jdk9   文件: ShapingTest.java
private static void test6943963() {
    // Needed to reproduce this bug.
    NumericShaper ns_dummy = getContextualShaper(ARABIC | TAMIL | ETHIOPIC,
                               EUROPEAN);
    char[] c = "\u1200 1".toCharArray();
    ns_dummy.shape(c, 0, c.length);


    String given = "\u0627\u0628 456";
    String expected_ARABIC = "\u0627\u0628 \u0664\u0665\u0666";
    String expected_EASTERN_ARABIC = "\u0627\u0628 \u06f4\u06f5\u06f6";

    NumericShaper ns = getContextualShaper(ARABIC);
    checkResult("ARABIC", ns, given, expected_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.ARABIC));
    checkResult("Range.ARABIC", ns, given, expected_ARABIC);

    ns = getContextualShaper(EASTERN_ARABIC);
    checkResult("EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.EASTERN_ARABIC));
    checkResult("Range.EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(ARABIC | EASTERN_ARABIC);
    checkResult("ARABIC | EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);

    ns = getContextualShaper(EnumSet.of(Range.ARABIC, Range.EASTERN_ARABIC));
    checkResult("Range.ARABIC, Range.EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC);
}
 
 方法所在类
 同类方法