Examples of NumericShaper


Examples of ae.java.awt.font.NumericShaper

        // 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);
        }
    }
View Full Code Here

Examples of com.google.code.appengine.awt.font.NumericShaper

        if (obj == this) {
            return true;
        }

        try {
            NumericShaper ns = (NumericShaper)obj;
            return (fRanges == ns.fRanges &&
                    fDefaultContextIndex == ns.fDefaultContextIndex &&
                    fContextual == ns.fContextual);
        } catch (ClassCastException e){
        }
View Full Code Here

Examples of com.google.code.appengine.awt.font.NumericShaper

    public static NumericShaper getContextualShaper(int ranges,
            int defaultContext) {
        ranges &= ALL_RANGES;
        defaultContext &= ALL_RANGES;
        return new NumericShaper(ranges, defaultContext, true);
    }
View Full Code Here

Examples of com.google.code.appengine.awt.font.NumericShaper

        return new NumericShaper(ranges, defaultContext, true);
    }

    public static NumericShaper getContextualShaper(int ranges) {
        ranges &= ALL_RANGES;
        return new NumericShaper(ranges, EUROPEAN, true);
    }
View Full Code Here

Examples of com.google.code.appengine.awt.font.NumericShaper

        return fRanges;
    }

    public static NumericShaper getShaper(int singleRange) {
        singleRange &= ALL_RANGES;
        return new NumericShaper(singleRange, EUROPEAN, false);
    }
View Full Code Here

Examples of java.awt.font.NumericShaper

        // 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);
        }
    }
View Full Code Here

Examples of java.awt.font.NumericShaper

        }
        catch (ClassCastException e) {
        }

  try {
      NumericShaper shaper = (NumericShaper)paragraph.getAttribute(TextAttribute.NUMERIC_SHAPING);
      if (shaper != null) {
    shaper.shape(text, 0, text.length);
      }
  }
  catch (ClassCastException e) {
  }
View Full Code Here

Examples of java.awt.font.NumericShaper

  }

  public void test(TestHarness harness)
  {
    harness.checkPoint("non-contextual");
    NumericShaper nonc = NumericShaper.getShaper(NumericShaper.TIBETAN);
    harness.check(! nonc.isContextual());
    testOne(harness, "abc 0123", nonc,
        "abc \u0f20\u0f21\u0f22\u0f23", -1);
    testOne(harness, "abc 0123", nonc,
        "abc \u0f20\u0f21\u0f22\u0f23", NumericShaper.BENGALI);
   
    // Note that the JDK fails some of these, as ethiopic does not
    // have a digit zero.
    nonc = NumericShaper.getShaper(NumericShaper.ETHIOPIC);
    testOne(harness, "abc 0123", nonc,
        "abc 0\u1369\u136a\u136b", -1);
    testOne(harness, "abc 0123", nonc,
        "abc 0\u1369\u136a\u136b", NumericShaper.EASTERN_ARABIC);
   
    harness.checkPoint("contextual");
    NumericShaper contextualI
      = NumericShaper.getContextualShaper(NumericShaper.KHMER
                          | NumericShaper.ETHIOPIC);
    NumericShaper contextualE
      = NumericShaper.getContextualShaper(NumericShaper.KHMER
                          | NumericShaper.ETHIOPIC,
                          NumericShaper.EUROPEAN);
    harness.check(contextualE.equals(contextualI));
    harness.check(contextualE.isContextual());

    // Use built-in context.
    testOne(harness, "45", contextualE, "45", -1);
    // Explicit context.
    testOne(harness, "45", contextualE, "\u17e4\u17e5", NumericShaper.KHMER);
    // Explicit but unrecognized context.
    testOne(harness, "45", contextualE, "45", NumericShaper.ARABIC);
    // The other explicit context.
    testOne(harness, "45", contextualE, "\u136c\u136d", NumericShaper.ETHIOPIC);
    // Context from the text.  The first \\u is ethiopic, the second khmer.
    testOne(harness, "45 \u134d 045 \u1782 045", contextualI,
        "45 \u134d 0\u136c\u136d \u1782 \u17e0\u17e4\u17e5", -1);

    harness.checkPoint("arabic");
    NumericShaper arabic
      = NumericShaper.getContextualShaper(NumericShaper.ARABIC
          | NumericShaper.EASTERN_ARABIC);
    // According to testing, eastern arabic takes precedence here.
    testOne(harness, "\u062b 1", arabic, "\u062b \u06f1", -1);
    // This should choose eastern arabic.
View Full Code Here

Examples of java.awt.font.NumericShaper

        // 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);
        }
    }
View Full Code Here

Examples of java.awt.font.NumericShaper

            ++i;
        }

//#if defined(J2SE13)
//#else
        NumericShaper shaper = (NumericShaper) paragraph.getAttribute(TextAttribute.NUMERIC_SHAPING);
        if (shaper != null) {
            shaper.shape(txt, 0, len);
        }
//#endif
        setPara(txt, paraLvl, lvls);
    }
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.