Package java.awt.font

Examples of java.awt.font.NumericShaper.shape()


            // expected
        }

        // offset+length out of range
        try{
            ns.shape(chars, chars.length -1, 2);
            fail("IndexOutOfBoundsException expected but wasn't thrown!");
        } catch (IndexOutOfBoundsException e){
            // expected
        }
View Full Code Here


        ns = NumericShaper.getShaper(NumericShaper.BENGALI);
       
        // test text that starts with the digit char and ends with nonDigit char
        char[] chars = testStringNoContext1.toCharArray();

        ns.shape(chars, 0, chars.length);
       
        for (int i=0; i < chars.length; i++){
            assertEquals("shaped char at pos[" + i + "] not equals to the golden one", (int)goldenBengaliStringNoContext1.charAt(i), chars[i]);
        }
View Full Code Here

            assertEquals("shaped char at pos[" + i + "] not equals to the golden one", (int)goldenBengaliStringNoContext1.charAt(i), chars[i]);
        }

        // text starts with the nonDigit char and ends with digit char
        chars = testStringNoContext2.toCharArray();
        ns.shape(chars, 0, chars.length);
       
        for (int i=0; i < chars.length; i++){
            assertEquals("shaped char at pos[" + i + "] not equals to the golden one", (int)goldenBengaliStringNoContext2.charAt(i), chars[i]);
        }
View Full Code Here

        ns = NumericShaper.getContextualShaper(NumericShaper.BENGALI | NumericShaper.DEVANAGARI);
       
        // test text starts with the BENGALI context digit char and ends with nonDigit char
        chars = testStringContext1.toCharArray();

        ns.shape(chars, 0, chars.length);
       
        for (int i=0; i < chars.length; i++){
            assertEquals("shaped char at pos[" + i + "] not equals to the golden one", (int)goldenBengaliDevanagariStringContext1.charAt(i), chars[i]);
        }
View Full Code Here

        // text starts with the nonDigit char and ends with digit char
        // the first set of digits in text folows by "\u0909" char from the DEVANGARI script
        // the second set of digits in text folows by "\u0983" char from the BENGALI script
        chars = testStringContext2.toCharArray();

        ns.shape(chars, 0, chars.length);
       
        for (int i=0; i < chars.length; i++){
            assertEquals("shaped char at pos[" + i + "] not equals to the golden one", (int)goldenBengaliDevanagariStringContext2.charAt(i), chars[i]);
        }
View Full Code Here

       
        // text starts with Digit char and ends with digit char
        // These digits must be replaced with default context digits
        chars = testStringContext3.toCharArray();
       
        ns.shape(chars, 0, chars.length);
       
        for (int i=0; i < chars.length; i++){
            assertEquals("shaped char at pos[" + i + "] not equals to the golden one", (int)goldenTamilDevanagariStringContext3.charAt(i), chars[i]);
        }
       
View Full Code Here

       
        // text starts with Digit char and ends with digit char
        // All digits must stay without changes
        chars = testStringContext3.toCharArray();
       
        ns.shape(chars, 0, chars.length);
       
        for (int i=0; i < chars.length; i++){
            assertEquals("shaped char at pos[" + i + "] not equals to the golden one", (int)testStringContext3.charAt(i), chars[i]);
        }
       
View Full Code Here

            assertEquals("shaped char at pos[" + i + "] not equals to the golden one", (int)testStringContext3.charAt(i), chars[i]);
        }
       
        // offset >= length
        try{
            ns.shape(chars, chars.length + 1, 1);
            fail("IndexOutOfBoundsException expected but wasn't thrown!");
        } catch (IndexOutOfBoundsException e){
            // expected
        }
       
View Full Code Here

            // expected
        }
       
        // offset < 0
        try{
            ns.shape(chars, -1, 1);
            fail("IndexOutOfBoundsException expected but wasn't thrown!");
        } catch (IndexOutOfBoundsException e){
            // expected
        }
View Full Code Here

            // expected
        }

        // offset+length out of range
        try{
            ns.shape(chars, chars.length -1, 2);
            fail("IndexOutOfBoundsException expected but wasn't thrown!");
        } catch (IndexOutOfBoundsException e){
            // expected
        }
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.