当前位置: 首页>>代码示例>>Java>>正文


Java NumericShaper.shape方法代码示例

本文整理汇总了Java中java.awt.font.NumericShaper.shape方法的典型用法代码示例。如果您正苦于以下问题:Java NumericShaper.shape方法的具体用法?Java NumericShaper.shape怎么用?Java NumericShaper.shape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.font.NumericShaper的用法示例。


在下文中一共展示了NumericShaper.shape方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: paragraphInit

import java.awt.font.NumericShaper; //导入方法依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:TextLayout.java

示例2: checkResult

import java.awt.font.NumericShaper; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:20,代码来源:ShapingTest.java

示例3: test6943963

import java.awt.font.NumericShaper; //导入方法依赖的package包/类
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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:31,代码来源:ShapingTest.java

示例4: paragraphInit

import java.awt.font.NumericShaper; //导入方法依赖的package包/类
/**
 * Initialize the paragraph-specific data.
 */
private void paragraphInit(byte aBaseline, CoreMetrics lm, Map 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);
    }
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:17,代码来源:TextLayout.java

示例5: paragraphInit

import java.awt.font.NumericShaper; //导入方法依赖的package包/类
/**
 * Initialize the paragraph-specific data.
 */
private void paragraphInit(byte aBaseline, CoreMetrics lm, Map 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);
    }
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:17,代码来源:TextLayout.java

示例6: format

import java.awt.font.NumericShaper; //导入方法依赖的package包/类
/**
 * Format.
 *
 * @param str
 *            String
 * @return String
 */
public static String format(final String str) {
	final NumericShaper shaper = NumericShaper.getContextualShaper(NumericShaper.ARABIC);
	final char[] c = str.toCharArray();
	shaper.shape(c, 0, c.length, NumericShaper.ARABIC);
	return new String(c);
}
 
开发者ID:kiswanij,项目名称:jk-util,代码行数:14,代码来源:ArabicDigits.java


注:本文中的java.awt.font.NumericShaper.shape方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。