Package com.ibm.icu.text

Examples of com.ibm.icu.text.ArabicShaping


        if (dl < 0) {
            dl = 2 * sl;
            System.out.println("dl defaulting to " + dl);
        }

        ArabicShaping shaper = new ArabicShaping(options);
        System.out.println("shaper: " + shaper);

        char[] src = text.toCharArray();
        System.out.println(" input: '" + escapedText(src, ss, sl) + "'");
        if (testtype != STRING) {
            System.out.println("start: " + ss + " length: " + sl + " total length: " + src.length);
        }

        int result = -1;
        char[] dest = null;

        try {
            switch (testtype) {
            case COPY:
                dest = new char[ds + dl];
                result = shaper.shape(src, ss, sl, dest, ds, dl);
                break;

            case INPLACE:
                shaper.shape(src, ss, sl);
                ds = ss;
                result = sl;
                dest = src;
                break;

            case STRING:
                dest = shaper.shape(text).toCharArray();
                ds = 0;
                result = dest.length;
                break;
            }

View Full Code Here


        for (int i = 0; i < standardTests.length; ++i) {
            TestData test = standardTests[i];

            Exception ex = null;
            String result = null;
            ArabicShaping shaper = null;

            try {
                shaper = new ArabicShaping(test.flags);
                result = shaper.shape(test.source);
            }
            catch(MissingResourceException e){
                throw e;
            }
            catch (IllegalStateException ie){
View Full Code Here

            TestData test = preflightTests[i];

            Exception ex = null;
            char src[] = null;
            int len = 0;
            ArabicShaping shaper = null;

            if (test.source != null) {
                src = test.source.toCharArray();
            }

            try {
                shaper = new ArabicShaping(test.flags);
                len = shaper.shape(src, 0, src.length, null, 0, 0);
            }
            catch (Exception e) {
                ex = e;
            }
View Full Code Here

            TestData test = errorTests[i];

            Exception ex = null;
            char src[] = null;
            int len = 0;
            ArabicShaping shaper = null;

            if (test.source != null) {
                src = test.source.toCharArray();
                len = src.length;
            }

            try {
                shaper = new ArabicShaping(test.flags);
                shaper.shape(src, 0, len);
            }
            catch (Exception e) {
                ex = e;
            }
View Full Code Here

        }
    }

    public void testEquals()
    {
        ArabicShaping as1 = new ArabicShaping(LETTERS_SHAPE | TEXT_DIRECTION_VISUAL_LTR | LENGTH_FIXED_SPACES_NEAR);
        ArabicShaping as2 = new ArabicShaping(LETTERS_SHAPE | TEXT_DIRECTION_VISUAL_LTR | LENGTH_FIXED_SPACES_NEAR);
        ArabicShaping as3 = new ArabicShaping(LETTERS_UNSHAPE | TEXT_DIRECTION_LOGICAL | LENGTH_FIXED_SPACES_AT_BEGINNING);

        if (! as1.equals(as1)) {
            err("as1: " + as1 + " does not equal itself!\n");
        }
View Full Code Here

    private String bidiReorder(String p_147647_1_)
    {
        try
        {
            Bidi bidi = new Bidi((new ArabicShaping(8)).shape(p_147647_1_), 127);
            bidi.setReorderingMode(0);
            return bidi.writeReordered(2);
        }
        catch (ArabicShapingException arabicshapingexception)
        {
View Full Code Here

TOP

Related Classes of com.ibm.icu.text.ArabicShaping

Copyright © 2018 www.massapicom. 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.