Examples of ArabicShaping


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

Examples of com.ibm.icu.text.ArabicShaping

        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

Examples of com.ibm.icu.text.ArabicShaping

            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

Examples of com.ibm.icu.text.ArabicShaping

            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

Examples of com.ibm.icu.text.ArabicShaping

        }
    }

    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

Examples of com.ibm.icu.text.ArabicShaping

    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

Examples of com.lowagie.text.pdf.ArabicShaping

      String reversed;
      String value;
      boolean inverse;
      String nodeName;
     
      ArabicShaping arabicshaper = new ArabicShaping(
                    ArabicShaping.LETTERS_SHAPE|
                    ArabicShaping.TEXT_DIRECTION_LOGICAL|
                    ArabicShaping.LENGTH_GROW_SHRINK);
     
      String elementNames[] = {"fo:block", "fo:inline",
        "fo:basic-link"};
      //nameCount = elementNames.length();
      nameCount = 3;
      for(l = 0; l < nameCount; l++) {
        elements = document.getElementsByTagName(elementNames[l]);
        if (elements != null) {
      elementCount = elements.getLength();
      for (k = 0; k < elementCount; k++) {
          element = (Element)elements.item(k);
          element.setAttribute("direction", "rtl");
          if(element.hasChildNodes()) {
            childs = element.getChildNodes();
            childCount = childs.getLength();
            // check whether node only contains inline and link elements
            inverse = true;
            for (j = 0; j < childCount; j++) {
        child = childs.item(j);
        if(child.getNodeType() == Node.TEXT_NODE) {
          if((child.getNodeValue().replaceAll(" ", "").length() > 1)) {
            value = childs.item(j).getNodeValue();
            value = arabicshaper.shape(value);
            value = invertArabic(value);
            /*reversed = "";
            for(m = value.length()-1; m >= 0; m--) {
              reversed += value.charAt(m);
            }*/
 
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.