Java Code Examples for java.awt.font.GlyphJustificationInfo

The following are top voted examples for showing how to use java.awt.font.GlyphJustificationInfo. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: cn1   File: GlyphJustificationInfoTest.java   Source Code and License 6 votes vote down vote up
public final void testGlyphJustificationInfo() {
    GlyphJustificationInfo gji = new GlyphJustificationInfo(weight, growAbsorb, 
            growPriority, growLeftLimit, growRightLimit, shrinkAbsorb, 
            shrinkPriority, shrinkLeftLimit, shrinkRightLimit);
    
    assertEquals("weight", weight, gji.weight, 0F);
    assertEquals("growAbsorb", growAbsorb, gji.growAbsorb);
    assertEquals("growPriority", growPriority, gji.growPriority);
    assertEquals("growLeftLimit", growLeftLimit, gji.growLeftLimit, 0F);
    assertEquals("growRightLimit", growRightLimit, gji.growRightLimit, 0F);
    assertEquals("shrinkAbsorb", shrinkAbsorb, gji.shrinkAbsorb);
    assertEquals("shrinkPriority", shrinkPriority, gji.shrinkPriority);
    assertEquals("shrinkLeftLimit", shrinkLeftLimit, gji.shrinkLeftLimit, 0F);
    assertEquals("shrinkRightLimit", shrinkRightLimit, gji.shrinkRightLimit, 0F);
    
}
 
Example 2
Project: cn1   File: ImageGraphicAttributeTest.java   Source Code and License 6 votes vote down vote up
public final void testGetJustificationInfo() {
    iga = new ImageGraphicAttribute(img, alignment);
    float advance = iga.getAdvance();
    GlyphJustificationInfo gji = new GlyphJustificationInfo(
            advance,
            false,
            GlyphJustificationInfo.PRIORITY_INTERCHAR,
            advance / 3,
            advance / 3,
            false,
            GlyphJustificationInfo.PRIORITY_WHITESPACE,
            0,
            0);
    equalsGlyphJustificationInfo(gji, iga.getJustificationInfo());

}
 
Example 3
Project: cn1   File: ShapeGraphicAttributeTest.java   Source Code and License 6 votes vote down vote up
public final void testGetJustificationInfo() {
    sga = new ShapeGraphicAttribute(shape, alignment, stroke);
    float advance = sga.getAdvance();
    GlyphJustificationInfo gji = new GlyphJustificationInfo(
            advance,
            false,
            GlyphJustificationInfo.PRIORITY_INTERCHAR,
            advance / 3,
            advance / 3,
            false,
            GlyphJustificationInfo.PRIORITY_WHITESPACE,
            0,
            0);
    equalsGlyphJustificationInfo(gji, sga.getJustificationInfo());

}
 
Example 4
Project: freeVM   File: GlyphJustificationInfoTest.java   Source Code and License 6 votes vote down vote up
public final void testGlyphJustificationInfo() {
    GlyphJustificationInfo gji = new GlyphJustificationInfo(weight, growAbsorb, 
            growPriority, growLeftLimit, growRightLimit, shrinkAbsorb, 
            shrinkPriority, shrinkLeftLimit, shrinkRightLimit);
    
    assertEquals("weight", weight, gji.weight, 0F);
    assertEquals("growAbsorb", growAbsorb, gji.growAbsorb);
    assertEquals("growPriority", growPriority, gji.growPriority);
    assertEquals("growLeftLimit", growLeftLimit, gji.growLeftLimit, 0F);
    assertEquals("growRightLimit", growRightLimit, gji.growRightLimit, 0F);
    assertEquals("shrinkAbsorb", shrinkAbsorb, gji.shrinkAbsorb);
    assertEquals("shrinkPriority", shrinkPriority, gji.shrinkPriority);
    assertEquals("shrinkLeftLimit", shrinkLeftLimit, gji.shrinkLeftLimit, 0F);
    assertEquals("shrinkRightLimit", shrinkRightLimit, gji.shrinkRightLimit, 0F);
    
}
 
Example 5
Project: freeVM   File: ImageGraphicAttributeTest.java   Source Code and License 6 votes vote down vote up
public final void testGetJustificationInfo() {
    iga = new ImageGraphicAttribute(img, alignment);
    float advance = iga.getAdvance();
    GlyphJustificationInfo gji = new GlyphJustificationInfo(
            advance,
            false,
            GlyphJustificationInfo.PRIORITY_INTERCHAR,
            advance / 3,
            advance / 3,
            false,
            GlyphJustificationInfo.PRIORITY_WHITESPACE,
            0,
            0);
    equalsGlyphJustificationInfo(gji, iga.getJustificationInfo());

}
 
Example 6
Project: freeVM   File: ShapeGraphicAttributeTest.java   Source Code and License 6 votes vote down vote up
public final void testGetJustificationInfo() {
    sga = new ShapeGraphicAttribute(shape, alignment, stroke);
    float advance = sga.getAdvance();
    GlyphJustificationInfo gji = new GlyphJustificationInfo(
            advance,
            false,
            GlyphJustificationInfo.PRIORITY_INTERCHAR,
            advance / 3,
            advance / 3,
            false,
            GlyphJustificationInfo.PRIORITY_WHITESPACE,
            0,
            0);
    equalsGlyphJustificationInfo(gji, sga.getJustificationInfo());

}
 
Example 7
Project: freeVM   File: GlyphJustificationInfoTest.java   Source Code and License 6 votes vote down vote up
public final void testGlyphJustificationInfo() {
    GlyphJustificationInfo gji = new GlyphJustificationInfo(weight, growAbsorb, 
            growPriority, growLeftLimit, growRightLimit, shrinkAbsorb, 
            shrinkPriority, shrinkLeftLimit, shrinkRightLimit);
    
    assertEquals("weight", weight, gji.weight, 0F);
    assertEquals("growAbsorb", growAbsorb, gji.growAbsorb);
    assertEquals("growPriority", growPriority, gji.growPriority);
    assertEquals("growLeftLimit", growLeftLimit, gji.growLeftLimit, 0F);
    assertEquals("growRightLimit", growRightLimit, gji.growRightLimit, 0F);
    assertEquals("shrinkAbsorb", shrinkAbsorb, gji.shrinkAbsorb);
    assertEquals("shrinkPriority", shrinkPriority, gji.shrinkPriority);
    assertEquals("shrinkLeftLimit", shrinkLeftLimit, gji.shrinkLeftLimit, 0F);
    assertEquals("shrinkRightLimit", shrinkRightLimit, gji.shrinkRightLimit, 0F);
    
}
 
Example 8
Project: freeVM   File: ImageGraphicAttributeTest.java   Source Code and License 6 votes vote down vote up
public final void testGetJustificationInfo() {
    iga = new ImageGraphicAttribute(img, alignment);
    float advance = iga.getAdvance();
    GlyphJustificationInfo gji = new GlyphJustificationInfo(
            advance,
            false,
            GlyphJustificationInfo.PRIORITY_INTERCHAR,
            advance / 3,
            advance / 3,
            false,
            GlyphJustificationInfo.PRIORITY_WHITESPACE,
            0,
            0);
    equalsGlyphJustificationInfo(gji, iga.getJustificationInfo());

}
 
Example 9
Project: freeVM   File: ShapeGraphicAttributeTest.java   Source Code and License 6 votes vote down vote up
public final void testGetJustificationInfo() {
    sga = new ShapeGraphicAttribute(shape, alignment, stroke);
    float advance = sga.getAdvance();
    GlyphJustificationInfo gji = new GlyphJustificationInfo(
            advance,
            false,
            GlyphJustificationInfo.PRIORITY_INTERCHAR,
            advance / 3,
            advance / 3,
            false,
            GlyphJustificationInfo.PRIORITY_WHITESPACE,
            0,
            0);
    equalsGlyphJustificationInfo(gji, sga.getJustificationInfo());

}
 
Example 10
Project: OpenJSharp   File: StandardGlyphVector.java   Source Code and License 5 votes vote down vote up
public GlyphJustificationInfo getGlyphJustificationInfo(int ix) {
    if (ix < 0 || ix >= glyphs.length) {
        throw new IndexOutOfBoundsException("ix = " + ix);
    }

    // currently we don't have enough information to do this right.  should
    // get info from the font and use real OT/GX justification.  Right now
    // sun/font/ExtendedTextSourceLabel assigns one of three infos
    // based on whether the char is kanji, space, or other.

    return null;
}
 
Example 11
Project: OpenJSharp   File: StandardGlyphVector.java   Source Code and License 5 votes vote down vote up
@Override
public GlyphJustificationInfo getGlyphJustificationInfo(int ix) {
    if (ix < 0 || ix >= glyphs.length()) {
        throw new IndexOutOfBoundsException("ix = " + ix);
    }

    // currently we don't have enough information to do this right.  should
    // get info from the font and use real OT/GX justification.  Right now
    // sun/font/ExtendedTextSourceLabel assigns one of three infos
    // based on whether the char is kanji, space, or other.

    return null;
}
 
Example 12
Project: jdk8u-jdk   File: StandardGlyphVector.java   Source Code and License 5 votes vote down vote up
public GlyphJustificationInfo getGlyphJustificationInfo(int ix) {
    if (ix < 0 || ix >= glyphs.length) {
        throw new IndexOutOfBoundsException("ix = " + ix);
    }

    // currently we don't have enough information to do this right.  should
    // get info from the font and use real OT/GX justification.  Right now
    // sun/font/ExtendedTextSourceLabel assigns one of three infos
    // based on whether the char is kanji, space, or other.

    return null;
}
 
Example 13
Project: openjdk-jdk10   File: StandardGlyphVector.java   Source Code and License 5 votes vote down vote up
public GlyphJustificationInfo getGlyphJustificationInfo(int ix) {
    if (ix < 0 || ix >= glyphs.length) {
        throw new IndexOutOfBoundsException("ix = " + ix);
    }

    // currently we don't have enough information to do this right.  should
    // get info from the font and use real OT/GX justification.  Right now
    // sun/font/ExtendedTextSourceLabel assigns one of three infos
    // based on whether the char is kanji, space, or other.

    return null;
}
 
Example 14
Project: openjdk9   File: StandardGlyphVector.java   Source Code and License 5 votes vote down vote up
public GlyphJustificationInfo getGlyphJustificationInfo(int ix) {
    if (ix < 0 || ix >= glyphs.length) {
        throw new IndexOutOfBoundsException("ix = " + ix);
    }

    // currently we don't have enough information to do this right.  should
    // get info from the font and use real OT/GX justification.  Right now
    // sun/font/ExtendedTextSourceLabel assigns one of three infos
    // based on whether the char is kanji, space, or other.

    return null;
}
 
Example 15
Project: Push2Display   File: SVGGVTGlyphVector.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the justification information for the glyph at the specified
 * index into this GlyphVector.
 */
public GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex) {
    if (glyphIndex < 0 || (glyphIndex > glyphs.length-1)) {
        throw new IndexOutOfBoundsException("glyphIndex: " + glyphIndex
        + ", is out of bounds. Should be between 0 and " + (glyphs.length-1) + ".");
    }
    return null;
}
 
Example 16
Project: jdk8u_jdk   File: StandardGlyphVector.java   Source Code and License 5 votes vote down vote up
public GlyphJustificationInfo getGlyphJustificationInfo(int ix) {
    if (ix < 0 || ix >= glyphs.length) {
        throw new IndexOutOfBoundsException("ix = " + ix);
    }

    // currently we don't have enough information to do this right.  should
    // get info from the font and use real OT/GX justification.  Right now
    // sun/font/ExtendedTextSourceLabel assigns one of three infos
    // based on whether the char is kanji, space, or other.

    return null;
}
 
Example 17
Project: lookaside_java-1.8.0-openjdk   File: StandardGlyphVector.java   Source Code and License 5 votes vote down vote up
public GlyphJustificationInfo getGlyphJustificationInfo(int ix) {
    if (ix < 0 || ix >= glyphs.length) {
        throw new IndexOutOfBoundsException("ix = " + ix);
    }

    // currently we don't have enough information to do this right.  should
    // get info from the font and use real OT/GX justification.  Right now
    // sun/font/ExtendedTextSourceLabel assigns one of three infos
    // based on whether the char is kanji, space, or other.

    return null;
}
 
Example 18
Project: Push2Display   File: SVGGVTGlyphVector.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the justification information for the glyph at the specified
 * index into this GlyphVector.
 */
public GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex) {
    if (glyphIndex < 0 || (glyphIndex > glyphs.length-1)) {
        throw new IndexOutOfBoundsException("glyphIndex: " + glyphIndex
        + ", is out of bounds. Should be between 0 and " + (glyphs.length-1) + ".");
    }
    return null;
}
 
Example 19
Project: infobip-open-jdk-8   File: StandardGlyphVector.java   Source Code and License 5 votes vote down vote up
public GlyphJustificationInfo getGlyphJustificationInfo(int ix) {
    if (ix < 0 || ix >= glyphs.length) {
        throw new IndexOutOfBoundsException("ix = " + ix);
    }

    // currently we don't have enough information to do this right.  should
    // get info from the font and use real OT/GX justification.  Right now
    // sun/font/ExtendedTextSourceLabel assigns one of three infos
    // based on whether the char is kanji, space, or other.

    return null;
}
 
Example 20
Project: jdk8u-dev-jdk   File: StandardGlyphVector.java   Source Code and License 5 votes vote down vote up
public GlyphJustificationInfo getGlyphJustificationInfo(int ix) {
    if (ix < 0 || ix >= glyphs.length) {
        throw new IndexOutOfBoundsException("ix = " + ix);
    }

    // currently we don't have enough information to do this right.  should
    // get info from the font and use real OT/GX justification.  Right now
    // sun/font/ExtendedTextSourceLabel assigns one of three infos
    // based on whether the char is kanji, space, or other.

    return null;
}
 
Example 21
Project: feathers-sdk   File: SVGGVTGlyphVector.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the justification information for the glyph at the specified
 * index into this GlyphVector.
 */
public GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex) {
    if (glyphIndex < 0 || (glyphIndex > glyphs.length-1)) {
        throw new IndexOutOfBoundsException("glyphIndex: " + glyphIndex
        + ", is out of bounds. Should be between 0 and " + (glyphs.length-1) + ".");
    }
    return null;
}
 
Example 22
Project: jdk7-jdk   File: StandardGlyphVector.java   Source Code and License 5 votes vote down vote up
public GlyphJustificationInfo getGlyphJustificationInfo(int ix) {
    if (ix < 0 || ix >= glyphs.length) {
        throw new IndexOutOfBoundsException("ix = " + ix);
    }

    // currently we don't have enough information to do this right.  should
    // get info from the font and use real OT/GX justification.  Right now
    // sun/font/ExtendedTextSourceLabel assigns one of three infos
    // based on whether the char is kanji, space, or other.

    return null;
}
 
Example 23
Project: openjdk-source-code-learn   File: StandardGlyphVector.java   Source Code and License 5 votes vote down vote up
public GlyphJustificationInfo getGlyphJustificationInfo(int ix) {
    if (ix < 0 || ix >= glyphs.length) {
        throw new IndexOutOfBoundsException("ix = " + ix);
    }

    // currently we don't have enough information to do this right.  should
    // get info from the font and use real OT/GX justification.  Right now
    // sun/font/ExtendedTextSourceLabel assigns one of three infos
    // based on whether the char is kanji, space, or other.

    return null;
}
 
Example 24
Project: OLD-OpenJDK8   File: StandardGlyphVector.java   Source Code and License 5 votes vote down vote up
public GlyphJustificationInfo getGlyphJustificationInfo(int ix) {
    if (ix < 0 || ix >= glyphs.length) {
        throw new IndexOutOfBoundsException("ix = " + ix);
    }

    // currently we don't have enough information to do this right.  should
    // get info from the font and use real OT/GX justification.  Right now
    // sun/font/ExtendedTextSourceLabel assigns one of three infos
    // based on whether the char is kanji, space, or other.

    return null;
}
 
Example 25
Project: cn1   File: ImageGraphicAttributeTest.java   Source Code and License 5 votes vote down vote up
private boolean equalsGlyphJustificationInfo(GlyphJustificationInfo info1, GlyphJustificationInfo info2){
    assertEquals("weight", info1.weight, info2.weight, 0F);
    assertEquals("growAbsorb", info1.growAbsorb, info2.growAbsorb);
    assertEquals("growPriority", info1.growPriority, info2.growPriority);
    assertEquals("growLeftLimit", info1.growLeftLimit, info2.growLeftLimit, 0F);
    assertEquals("growRightLimit", info1.growRightLimit, info2.growRightLimit, 0F);
    assertEquals("shrinkAbsorb", info1.shrinkAbsorb, info2.shrinkAbsorb);
    assertEquals("shrinkPriority", info1.shrinkPriority, info2.shrinkPriority);
    assertEquals("shrinkLeftLimit", info1.shrinkLeftLimit, info2.shrinkLeftLimit, 0F);
    assertEquals("shrinkRightLimit", info1.shrinkRightLimit, info2.shrinkRightLimit, 0F);
    
    return true;
}
 
Example 26
Project: cn1   File: ShapeGraphicAttributeTest.java   Source Code and License 5 votes vote down vote up
private boolean equalsGlyphJustificationInfo(GlyphJustificationInfo info1, GlyphJustificationInfo info2){
    assertEquals("weight", info1.weight, info2.weight, 0F);
    assertEquals("growAbsorb", info1.growAbsorb, info2.growAbsorb);
    assertEquals("growPriority", info1.growPriority, info2.growPriority);
    assertEquals("growLeftLimit", info1.growLeftLimit, info2.growLeftLimit, 0F);
    assertEquals("growRightLimit", info1.growRightLimit, info2.growRightLimit, 0F);
    assertEquals("shrinkAbsorb", info1.shrinkAbsorb, info2.shrinkAbsorb);
    assertEquals("shrinkPriority", info1.shrinkPriority, info2.shrinkPriority);
    assertEquals("shrinkLeftLimit", info1.shrinkLeftLimit, info2.shrinkLeftLimit, 0F);
    assertEquals("shrinkRightLimit", info1.shrinkRightLimit, info2.shrinkRightLimit, 0F);
    
    return true;
}
 
Example 27
Project: openjdk-jdk7u-jdk   File: StandardGlyphVector.java   Source Code and License 5 votes vote down vote up
public GlyphJustificationInfo getGlyphJustificationInfo(int ix) {
    if (ix < 0 || ix >= glyphs.length) {
        throw new IndexOutOfBoundsException("ix = " + ix);
    }

    // currently we don't have enough information to do this right.  should
    // get info from the font and use real OT/GX justification.  Right now
    // sun/font/ExtendedTextSourceLabel assigns one of three infos
    // based on whether the char is kanji, space, or other.

    return null;
}
 
Example 28
Project: freeVM   File: CommonGlyphVector.java   Source Code and License 5 votes vote down vote up
/**
 * Returns a justification information for the glyph with specified glyph 
 * index.
 * @param glyphIndex index of a glyph which GlyphJustificationInfo is to be 
 * received   
 * @return a GlyphJustificationInfo object that contains glyph justification 
 * properties of the specified glyph
 */
@Override
public GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex) {
    // TODO : Find out the source of Justification info
    if (true) {
        throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
    }
    return null;
}
 
Example 29
Project: freeVM   File: ImageGraphicAttributeTest.java   Source Code and License 5 votes vote down vote up
private boolean equalsGlyphJustificationInfo(GlyphJustificationInfo info1, GlyphJustificationInfo info2){
    assertEquals("weight", info1.weight, info2.weight, 0F);
    assertEquals("growAbsorb", info1.growAbsorb, info2.growAbsorb);
    assertEquals("growPriority", info1.growPriority, info2.growPriority);
    assertEquals("growLeftLimit", info1.growLeftLimit, info2.growLeftLimit, 0F);
    assertEquals("growRightLimit", info1.growRightLimit, info2.growRightLimit, 0F);
    assertEquals("shrinkAbsorb", info1.shrinkAbsorb, info2.shrinkAbsorb);
    assertEquals("shrinkPriority", info1.shrinkPriority, info2.shrinkPriority);
    assertEquals("shrinkLeftLimit", info1.shrinkLeftLimit, info2.shrinkLeftLimit, 0F);
    assertEquals("shrinkRightLimit", info1.shrinkRightLimit, info2.shrinkRightLimit, 0F);
    
    return true;
}
 
Example 30
Project: freeVM   File: ShapeGraphicAttributeTest.java   Source Code and License 5 votes vote down vote up
private boolean equalsGlyphJustificationInfo(GlyphJustificationInfo info1, GlyphJustificationInfo info2){
    assertEquals("weight", info1.weight, info2.weight, 0F);
    assertEquals("growAbsorb", info1.growAbsorb, info2.growAbsorb);
    assertEquals("growPriority", info1.growPriority, info2.growPriority);
    assertEquals("growLeftLimit", info1.growLeftLimit, info2.growLeftLimit, 0F);
    assertEquals("growRightLimit", info1.growRightLimit, info2.growRightLimit, 0F);
    assertEquals("shrinkAbsorb", info1.shrinkAbsorb, info2.shrinkAbsorb);
    assertEquals("shrinkPriority", info1.shrinkPriority, info2.shrinkPriority);
    assertEquals("shrinkLeftLimit", info1.shrinkLeftLimit, info2.shrinkLeftLimit, 0F);
    assertEquals("shrinkRightLimit", info1.shrinkRightLimit, info2.shrinkRightLimit, 0F);
    
    return true;
}
 
Example 31
Project: freeVM   File: ImageGraphicAttributeTest.java   Source Code and License 5 votes vote down vote up
private boolean equalsGlyphJustificationInfo(GlyphJustificationInfo info1, GlyphJustificationInfo info2){
    assertEquals("weight", info1.weight, info2.weight, 0F);
    assertEquals("growAbsorb", info1.growAbsorb, info2.growAbsorb);
    assertEquals("growPriority", info1.growPriority, info2.growPriority);
    assertEquals("growLeftLimit", info1.growLeftLimit, info2.growLeftLimit, 0F);
    assertEquals("growRightLimit", info1.growRightLimit, info2.growRightLimit, 0F);
    assertEquals("shrinkAbsorb", info1.shrinkAbsorb, info2.shrinkAbsorb);
    assertEquals("shrinkPriority", info1.shrinkPriority, info2.shrinkPriority);
    assertEquals("shrinkLeftLimit", info1.shrinkLeftLimit, info2.shrinkLeftLimit, 0F);
    assertEquals("shrinkRightLimit", info1.shrinkRightLimit, info2.shrinkRightLimit, 0F);
    
    return true;
}
 
Example 32
Project: freeVM   File: ShapeGraphicAttributeTest.java   Source Code and License 5 votes vote down vote up
private boolean equalsGlyphJustificationInfo(GlyphJustificationInfo info1, GlyphJustificationInfo info2){
    assertEquals("weight", info1.weight, info2.weight, 0F);
    assertEquals("growAbsorb", info1.growAbsorb, info2.growAbsorb);
    assertEquals("growPriority", info1.growPriority, info2.growPriority);
    assertEquals("growLeftLimit", info1.growLeftLimit, info2.growLeftLimit, 0F);
    assertEquals("growRightLimit", info1.growRightLimit, info2.growRightLimit, 0F);
    assertEquals("shrinkAbsorb", info1.shrinkAbsorb, info2.shrinkAbsorb);
    assertEquals("shrinkPriority", info1.shrinkPriority, info2.shrinkPriority);
    assertEquals("shrinkLeftLimit", info1.shrinkLeftLimit, info2.shrinkLeftLimit, 0F);
    assertEquals("shrinkRightLimit", info1.shrinkRightLimit, info2.shrinkRightLimit, 0F);
    
    return true;
}
 
Example 33
Project: openjdk-icedtea7   File: StandardGlyphVector.java   Source Code and License 5 votes vote down vote up
public GlyphJustificationInfo getGlyphJustificationInfo(int ix) {
    if (ix < 0 || ix >= glyphs.length) {
        throw new IndexOutOfBoundsException("ix = " + ix);
    }

    // currently we don't have enough information to do this right.  should
    // get info from the font and use real OT/GX justification.  Right now
    // sun/font/ExtendedTextSourceLabel assigns one of three infos
    // based on whether the char is kanji, space, or other.

    return null;
}
 
Example 34
Project: OpenJSharp   File: ExtendedTextSourceLabel.java   Source Code and License 4 votes vote down vote up
public void getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit) {
  // This simple implementation only uses spaces for justification.
  // Since regular characters aren't justified, we don't need to deal with
  // special infos for combining marks or ligature substitution glyphs.
  // added character justification for kanjii only 2/22/98

  StandardGlyphVector gv = getGV();

  float[] charinfo = getCharinfo();

  float size = gv.getFont().getSize2D();

  GlyphJustificationInfo nullInfo =
    new GlyphJustificationInfo(0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  GlyphJustificationInfo spaceInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size / 4f);

  GlyphJustificationInfo kanjiInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_INTERCHAR, size, size,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  char[] chars = source.getChars();
  int offset = source.getStart();

  // assume data is 1-1 and either all rtl or all ltr, for now

  int numGlyphs = gv.getNumGlyphs();
  int minGlyph = 0;
  int maxGlyph = numGlyphs;
  boolean ltr = (source.getLayoutFlags() & 0x1) == 0;
  if (charStart != 0 || charLimit != source.getLength()) {
    if (ltr) {
      minGlyph = charStart;
      maxGlyph = charLimit;
    } else {
      minGlyph = numGlyphs - charLimit;
      maxGlyph = numGlyphs - charStart;
    }
  }

  for (int i = 0; i < numGlyphs; ++i) {
    GlyphJustificationInfo info = null;
    if (i >= minGlyph && i < maxGlyph) {
      if (charinfo[i * numvals + advx] == 0) { // combining marks don't justify
        info = nullInfo;
      } else {
        int ci = v2l(i); // 1-1 assumption again
        char c = chars[offset + ci];
        if (Character.isWhitespace(c)) {
          info = spaceInfo;
          // CJK, Hangul, CJK Compatibility areas
        } else if (c >= 0x4e00 &&
                   (c < 0xa000) ||
                   (c >= 0xac00 && c < 0xd7b0) ||
                   (c >= 0xf900 && c < 0xfb00)) {
          info = kanjiInfo;
        } else {
          info = nullInfo;
        }
      }
    }
    infos[infoStart + i] = info;
  }
}
 
Example 35
Project: jdk8u-jdk   File: ExtendedTextSourceLabel.java   Source Code and License 4 votes vote down vote up
public void getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit) {
  // This simple implementation only uses spaces for justification.
  // Since regular characters aren't justified, we don't need to deal with
  // special infos for combining marks or ligature substitution glyphs.
  // added character justification for kanjii only 2/22/98

  StandardGlyphVector gv = getGV();

  float[] charinfo = getCharinfo();

  float size = gv.getFont().getSize2D();

  GlyphJustificationInfo nullInfo =
    new GlyphJustificationInfo(0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  GlyphJustificationInfo spaceInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size / 4f);

  GlyphJustificationInfo kanjiInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_INTERCHAR, size, size,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  char[] chars = source.getChars();
  int offset = source.getStart();

  // assume data is 1-1 and either all rtl or all ltr, for now

  int numGlyphs = gv.getNumGlyphs();
  int minGlyph = 0;
  int maxGlyph = numGlyphs;
  boolean ltr = (source.getLayoutFlags() & 0x1) == 0;
  if (charStart != 0 || charLimit != source.getLength()) {
    if (ltr) {
      minGlyph = charStart;
      maxGlyph = charLimit;
    } else {
      minGlyph = numGlyphs - charLimit;
      maxGlyph = numGlyphs - charStart;
    }
  }

  for (int i = 0; i < numGlyphs; ++i) {
    GlyphJustificationInfo info = null;
    if (i >= minGlyph && i < maxGlyph) {
      if (charinfo[i * numvals + advx] == 0) { // combining marks don't justify
        info = nullInfo;
      } else {
        int ci = v2l(i); // 1-1 assumption again
        char c = chars[offset + ci];
        if (Character.isWhitespace(c)) {
          info = spaceInfo;
          // CJK, Hangul, CJK Compatibility areas
        } else if (c >= 0x4e00 &&
                   (c < 0xa000) ||
                   (c >= 0xac00 && c < 0xd7b0) ||
                   (c >= 0xf900 && c < 0xfb00)) {
          info = kanjiInfo;
        } else {
          info = nullInfo;
        }
      }
    }
    infos[infoStart + i] = info;
  }
}
 
Example 36
Project: openjdk-jdk10   File: ExtendedTextSourceLabel.java   Source Code and License 4 votes vote down vote up
public void getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit) {
  // This simple implementation only uses spaces for justification.
  // Since regular characters aren't justified, we don't need to deal with
  // special infos for combining marks or ligature substitution glyphs.
  // added character justification for kanjii only 2/22/98

  StandardGlyphVector gv = getGV();

  float[] charinfo = getCharinfo();

  float size = gv.getFont().getSize2D();

  GlyphJustificationInfo nullInfo =
    new GlyphJustificationInfo(0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  GlyphJustificationInfo spaceInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size / 4f);

  GlyphJustificationInfo kanjiInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_INTERCHAR, size, size,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  char[] chars = source.getChars();
  int offset = source.getStart();

  // assume data is 1-1 and either all rtl or all ltr, for now

  int numGlyphs = gv.getNumGlyphs();
  int minGlyph = 0;
  int maxGlyph = numGlyphs;
  boolean ltr = (source.getLayoutFlags() & 0x1) == 0;
  if (charStart != 0 || charLimit != source.getLength()) {
    if (ltr) {
      minGlyph = charStart;
      maxGlyph = charLimit;
    } else {
      minGlyph = numGlyphs - charLimit;
      maxGlyph = numGlyphs - charStart;
    }
  }

  for (int i = 0; i < numGlyphs; ++i) {
    GlyphJustificationInfo info = null;
    if (i >= minGlyph && i < maxGlyph) {
      if (charinfo[i * numvals + advx] == 0) { // combining marks don't justify
        info = nullInfo;
      } else {
        int ci = v2l(i); // 1-1 assumption again
        char c = chars[offset + ci];
        if (Character.isWhitespace(c)) {
          info = spaceInfo;
          // CJK, Hangul, CJK Compatibility areas
        } else if (c >= 0x4e00 &&
                   (c < 0xa000) ||
                   (c >= 0xac00 && c < 0xd7b0) ||
                   (c >= 0xf900 && c < 0xfb00)) {
          info = kanjiInfo;
        } else {
          info = nullInfo;
        }
      }
    }
    infos[infoStart + i] = info;
  }
}
 
Example 37
Project: openjdk9   File: ExtendedTextSourceLabel.java   Source Code and License 4 votes vote down vote up
public void getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit) {
  // This simple implementation only uses spaces for justification.
  // Since regular characters aren't justified, we don't need to deal with
  // special infos for combining marks or ligature substitution glyphs.
  // added character justification for kanjii only 2/22/98

  StandardGlyphVector gv = getGV();

  float[] charinfo = getCharinfo();

  float size = gv.getFont().getSize2D();

  GlyphJustificationInfo nullInfo =
    new GlyphJustificationInfo(0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  GlyphJustificationInfo spaceInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size / 4f);

  GlyphJustificationInfo kanjiInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_INTERCHAR, size, size,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  char[] chars = source.getChars();
  int offset = source.getStart();

  // assume data is 1-1 and either all rtl or all ltr, for now

  int numGlyphs = gv.getNumGlyphs();
  int minGlyph = 0;
  int maxGlyph = numGlyphs;
  boolean ltr = (source.getLayoutFlags() & 0x1) == 0;
  if (charStart != 0 || charLimit != source.getLength()) {
    if (ltr) {
      minGlyph = charStart;
      maxGlyph = charLimit;
    } else {
      minGlyph = numGlyphs - charLimit;
      maxGlyph = numGlyphs - charStart;
    }
  }

  for (int i = 0; i < numGlyphs; ++i) {
    GlyphJustificationInfo info = null;
    if (i >= minGlyph && i < maxGlyph) {
      if (charinfo[i * numvals + advx] == 0) { // combining marks don't justify
        info = nullInfo;
      } else {
        int ci = v2l(i); // 1-1 assumption again
        char c = chars[offset + ci];
        if (Character.isWhitespace(c)) {
          info = spaceInfo;
          // CJK, Hangul, CJK Compatibility areas
        } else if (c >= 0x4e00 &&
                   (c < 0xa000) ||
                   (c >= 0xac00 && c < 0xd7b0) ||
                   (c >= 0xf900 && c < 0xfb00)) {
          info = kanjiInfo;
        } else {
          info = nullInfo;
        }
      }
    }
    infos[infoStart + i] = info;
  }
}
 
Example 38
Project: Push2Display   File: MultiGlyphVector.java   Source Code and License 4 votes vote down vote up
/**
 * Returns the justification information for the glyph at the specified
 * index into this GlyphVector.
 */
public GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex) {
    int idx = getGVIdx(glyphIndex);
    return gvs[idx].getGlyphJustificationInfo(glyphIndex-off[idx]);
}
 
Example 39
Project: jdk8u_jdk   File: ExtendedTextSourceLabel.java   Source Code and License 4 votes vote down vote up
public void getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit) {
  // This simple implementation only uses spaces for justification.
  // Since regular characters aren't justified, we don't need to deal with
  // special infos for combining marks or ligature substitution glyphs.
  // added character justification for kanjii only 2/22/98

  StandardGlyphVector gv = getGV();

  float[] charinfo = getCharinfo();

  float size = gv.getFont().getSize2D();

  GlyphJustificationInfo nullInfo =
    new GlyphJustificationInfo(0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  GlyphJustificationInfo spaceInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size / 4f);

  GlyphJustificationInfo kanjiInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_INTERCHAR, size, size,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  char[] chars = source.getChars();
  int offset = source.getStart();

  // assume data is 1-1 and either all rtl or all ltr, for now

  int numGlyphs = gv.getNumGlyphs();
  int minGlyph = 0;
  int maxGlyph = numGlyphs;
  boolean ltr = (source.getLayoutFlags() & 0x1) == 0;
  if (charStart != 0 || charLimit != source.getLength()) {
    if (ltr) {
      minGlyph = charStart;
      maxGlyph = charLimit;
    } else {
      minGlyph = numGlyphs - charLimit;
      maxGlyph = numGlyphs - charStart;
    }
  }

  for (int i = 0; i < numGlyphs; ++i) {
    GlyphJustificationInfo info = null;
    if (i >= minGlyph && i < maxGlyph) {
      if (charinfo[i * numvals + advx] == 0) { // combining marks don't justify
        info = nullInfo;
      } else {
        int ci = v2l(i); // 1-1 assumption again
        char c = chars[offset + ci];
        if (Character.isWhitespace(c)) {
          info = spaceInfo;
          // CJK, Hangul, CJK Compatibility areas
        } else if (c >= 0x4e00 &&
                   (c < 0xa000) ||
                   (c >= 0xac00 && c < 0xd7b0) ||
                   (c >= 0xf900 && c < 0xfb00)) {
          info = kanjiInfo;
        } else {
          info = nullInfo;
        }
      }
    }
    infos[infoStart + i] = info;
  }
}
 
Example 40
Project: lookaside_java-1.8.0-openjdk   File: ExtendedTextSourceLabel.java   Source Code and License 4 votes vote down vote up
public void getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit) {
  // This simple implementation only uses spaces for justification.
  // Since regular characters aren't justified, we don't need to deal with
  // special infos for combining marks or ligature substitution glyphs.
  // added character justification for kanjii only 2/22/98

  StandardGlyphVector gv = getGV();

  float[] charinfo = getCharinfo();

  float size = gv.getFont().getSize2D();

  GlyphJustificationInfo nullInfo =
    new GlyphJustificationInfo(0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  GlyphJustificationInfo spaceInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size / 4f);

  GlyphJustificationInfo kanjiInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_INTERCHAR, size, size,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  char[] chars = source.getChars();
  int offset = source.getStart();

  // assume data is 1-1 and either all rtl or all ltr, for now

  int numGlyphs = gv.getNumGlyphs();
  int minGlyph = 0;
  int maxGlyph = numGlyphs;
  boolean ltr = (source.getLayoutFlags() & 0x1) == 0;
  if (charStart != 0 || charLimit != source.getLength()) {
    if (ltr) {
      minGlyph = charStart;
      maxGlyph = charLimit;
    } else {
      minGlyph = numGlyphs - charLimit;
      maxGlyph = numGlyphs - charStart;
    }
  }

  for (int i = 0; i < numGlyphs; ++i) {
    GlyphJustificationInfo info = null;
    if (i >= minGlyph && i < maxGlyph) {
      if (charinfo[i * numvals + advx] == 0) { // combining marks don't justify
        info = nullInfo;
      } else {
        int ci = v2l(i); // 1-1 assumption again
        char c = chars[offset + ci];
        if (Character.isWhitespace(c)) {
          info = spaceInfo;
          // CJK, Hangul, CJK Compatibility areas
        } else if (c >= 0x4e00 &&
                   (c < 0xa000) ||
                   (c >= 0xac00 && c < 0xd7b0) ||
                   (c >= 0xf900 && c < 0xfb00)) {
          info = kanjiInfo;
        } else {
          info = nullInfo;
        }
      }
    }
    infos[infoStart + i] = info;
  }
}
 
Example 41
Project: intellij-ce-playground   File: MockFontLayoutService.java   Source Code and License 4 votes vote down vote up
@Override
public GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex) {
  throw new UnsupportedOperationException();
}
 
Example 42
Project: Push2Display   File: MultiGlyphVector.java   Source Code and License 4 votes vote down vote up
/**
 * Returns the justification information for the glyph at the specified
 * index into this GlyphVector.
 */
public GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex) {
    int idx = getGVIdx(glyphIndex);
    return gvs[idx].getGlyphJustificationInfo(glyphIndex-off[idx]);
}
 
Example 43
Project: infobip-open-jdk-8   File: ExtendedTextSourceLabel.java   Source Code and License 4 votes vote down vote up
public void getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit) {
  // This simple implementation only uses spaces for justification.
  // Since regular characters aren't justified, we don't need to deal with
  // special infos for combining marks or ligature substitution glyphs.
  // added character justification for kanjii only 2/22/98

  StandardGlyphVector gv = getGV();

  float[] charinfo = getCharinfo();

  float size = gv.getFont().getSize2D();

  GlyphJustificationInfo nullInfo =
    new GlyphJustificationInfo(0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  GlyphJustificationInfo spaceInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size / 4f);

  GlyphJustificationInfo kanjiInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_INTERCHAR, size, size,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  char[] chars = source.getChars();
  int offset = source.getStart();

  // assume data is 1-1 and either all rtl or all ltr, for now

  int numGlyphs = gv.getNumGlyphs();
  int minGlyph = 0;
  int maxGlyph = numGlyphs;
  boolean ltr = (source.getLayoutFlags() & 0x1) == 0;
  if (charStart != 0 || charLimit != source.getLength()) {
    if (ltr) {
      minGlyph = charStart;
      maxGlyph = charLimit;
    } else {
      minGlyph = numGlyphs - charLimit;
      maxGlyph = numGlyphs - charStart;
    }
  }

  for (int i = 0; i < numGlyphs; ++i) {
    GlyphJustificationInfo info = null;
    if (i >= minGlyph && i < maxGlyph) {
      if (charinfo[i * numvals + advx] == 0) { // combining marks don't justify
        info = nullInfo;
      } else {
        int ci = v2l(i); // 1-1 assumption again
        char c = chars[offset + ci];
        if (Character.isWhitespace(c)) {
          info = spaceInfo;
          // CJK, Hangul, CJK Compatibility areas
        } else if (c >= 0x4e00 &&
                   (c < 0xa000) ||
                   (c >= 0xac00 && c < 0xd7b0) ||
                   (c >= 0xf900 && c < 0xfb00)) {
          info = kanjiInfo;
        } else {
          info = nullInfo;
        }
      }
    }
    infos[infoStart + i] = info;
  }
}
 
Example 44
Project: jdk8u-dev-jdk   File: ExtendedTextSourceLabel.java   Source Code and License 4 votes vote down vote up
public void getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit) {
  // This simple implementation only uses spaces for justification.
  // Since regular characters aren't justified, we don't need to deal with
  // special infos for combining marks or ligature substitution glyphs.
  // added character justification for kanjii only 2/22/98

  StandardGlyphVector gv = getGV();

  float[] charinfo = getCharinfo();

  float size = gv.getFont().getSize2D();

  GlyphJustificationInfo nullInfo =
    new GlyphJustificationInfo(0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  GlyphJustificationInfo spaceInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size / 4f);

  GlyphJustificationInfo kanjiInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_INTERCHAR, size, size,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  char[] chars = source.getChars();
  int offset = source.getStart();

  // assume data is 1-1 and either all rtl or all ltr, for now

  int numGlyphs = gv.getNumGlyphs();
  int minGlyph = 0;
  int maxGlyph = numGlyphs;
  boolean ltr = (source.getLayoutFlags() & 0x1) == 0;
  if (charStart != 0 || charLimit != source.getLength()) {
    if (ltr) {
      minGlyph = charStart;
      maxGlyph = charLimit;
    } else {
      minGlyph = numGlyphs - charLimit;
      maxGlyph = numGlyphs - charStart;
    }
  }

  for (int i = 0; i < numGlyphs; ++i) {
    GlyphJustificationInfo info = null;
    if (i >= minGlyph && i < maxGlyph) {
      if (charinfo[i * numvals + advx] == 0) { // combining marks don't justify
        info = nullInfo;
      } else {
        int ci = v2l(i); // 1-1 assumption again
        char c = chars[offset + ci];
        if (Character.isWhitespace(c)) {
          info = spaceInfo;
          // CJK, Hangul, CJK Compatibility areas
        } else if (c >= 0x4e00 &&
                   (c < 0xa000) ||
                   (c >= 0xac00 && c < 0xd7b0) ||
                   (c >= 0xf900 && c < 0xfb00)) {
          info = kanjiInfo;
        } else {
          info = nullInfo;
        }
      }
    }
    infos[infoStart + i] = info;
  }
}
 
Example 45
Project: feathers-sdk   File: MultiGlyphVector.java   Source Code and License 4 votes vote down vote up
/**
 * Returns the justification information for the glyph at the specified
 * index into this GlyphVector.
 */
public GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex) {
    int idx = getGVIdx(glyphIndex);
    return gvs[idx].getGlyphJustificationInfo(glyphIndex-off[idx]);
}
 
Example 46
Project: jdk7-jdk   File: ExtendedTextSourceLabel.java   Source Code and License 4 votes vote down vote up
public void getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit) {
  // This simple implementation only uses spaces for justification.
  // Since regular characters aren't justified, we don't need to deal with
  // special infos for combining marks or ligature substitution glyphs.
  // added character justification for kanjii only 2/22/98

  StandardGlyphVector gv = getGV();

  float[] charinfo = getCharinfo();

  float size = gv.getFont().getSize2D();

  GlyphJustificationInfo nullInfo =
    new GlyphJustificationInfo(0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  GlyphJustificationInfo spaceInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size / 4f);

  GlyphJustificationInfo kanjiInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_INTERCHAR, size, size,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  char[] chars = source.getChars();
  int offset = source.getStart();

  // assume data is 1-1 and either all rtl or all ltr, for now

  int numGlyphs = gv.getNumGlyphs();
  int minGlyph = 0;
  int maxGlyph = numGlyphs;
  boolean ltr = (source.getLayoutFlags() & 0x1) == 0;
  if (charStart != 0 || charLimit != source.getLength()) {
    if (ltr) {
      minGlyph = charStart;
      maxGlyph = charLimit;
    } else {
      minGlyph = numGlyphs - charLimit;
      maxGlyph = numGlyphs - charStart;
    }
  }

  for (int i = 0; i < numGlyphs; ++i) {
    GlyphJustificationInfo info = null;
    if (i >= minGlyph && i < maxGlyph) {
      if (charinfo[i * numvals + advx] == 0) { // combining marks don't justify
        info = nullInfo;
      } else {
        int ci = v2l(i); // 1-1 assumption again
        char c = chars[offset + ci];
        if (Character.isWhitespace(c)) {
          info = spaceInfo;
          // CJK, Hangul, CJK Compatibility areas
        } else if (c >= 0x4e00 &&
                   (c < 0xa000) ||
                   (c >= 0xac00 && c < 0xd7b0) ||
                   (c >= 0xf900 && c < 0xfb00)) {
          info = kanjiInfo;
        } else {
          info = nullInfo;
        }
      }
    }
    infos[infoStart + i] = info;
  }
}
 
Example 47
Project: openjdk-source-code-learn   File: ExtendedTextSourceLabel.java   Source Code and License 4 votes vote down vote up
public void getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit) {
  // This simple implementation only uses spaces for justification.
  // Since regular characters aren't justified, we don't need to deal with
  // special infos for combining marks or ligature substitution glyphs.
  // added character justification for kanjii only 2/22/98

  StandardGlyphVector gv = getGV();

  float[] charinfo = getCharinfo();

  float size = gv.getFont().getSize2D();

  GlyphJustificationInfo nullInfo =
    new GlyphJustificationInfo(0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  GlyphJustificationInfo spaceInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size / 4f);

  GlyphJustificationInfo kanjiInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_INTERCHAR, size, size,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  char[] chars = source.getChars();
  int offset = source.getStart();

  // assume data is 1-1 and either all rtl or all ltr, for now

  int numGlyphs = gv.getNumGlyphs();
  int minGlyph = 0;
  int maxGlyph = numGlyphs;
  boolean ltr = (source.getLayoutFlags() & 0x1) == 0;
  if (charStart != 0 || charLimit != source.getLength()) {
    if (ltr) {
      minGlyph = charStart;
      maxGlyph = charLimit;
    } else {
      minGlyph = numGlyphs - charLimit;
      maxGlyph = numGlyphs - charStart;
    }
  }

  for (int i = 0; i < numGlyphs; ++i) {
    GlyphJustificationInfo info = null;
    if (i >= minGlyph && i < maxGlyph) {
      if (charinfo[i * numvals + advx] == 0) { // combining marks don't justify
        info = nullInfo;
      } else {
        int ci = v2l(i); // 1-1 assumption again
        char c = chars[offset + ci];
        if (Character.isWhitespace(c)) {
          info = spaceInfo;
          // CJK, Hangul, CJK Compatibility areas
        } else if (c >= 0x4e00 &&
                   (c < 0xa000) ||
                   (c >= 0xac00 && c < 0xd7b0) ||
                   (c >= 0xf900 && c < 0xfb00)) {
          info = kanjiInfo;
        } else {
          info = nullInfo;
        }
      }
    }
    infos[infoStart + i] = info;
  }
}
 
Example 48
Project: OLD-OpenJDK8   File: ExtendedTextSourceLabel.java   Source Code and License 4 votes vote down vote up
public void getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit) {
  // This simple implementation only uses spaces for justification.
  // Since regular characters aren't justified, we don't need to deal with
  // special infos for combining marks or ligature substitution glyphs.
  // added character justification for kanjii only 2/22/98

  StandardGlyphVector gv = getGV();

  float[] charinfo = getCharinfo();

  float size = gv.getFont().getSize2D();

  GlyphJustificationInfo nullInfo =
    new GlyphJustificationInfo(0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  GlyphJustificationInfo spaceInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size / 4f);

  GlyphJustificationInfo kanjiInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_INTERCHAR, size, size,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  char[] chars = source.getChars();
  int offset = source.getStart();

  // assume data is 1-1 and either all rtl or all ltr, for now

  int numGlyphs = gv.getNumGlyphs();
  int minGlyph = 0;
  int maxGlyph = numGlyphs;
  boolean ltr = (source.getLayoutFlags() & 0x1) == 0;
  if (charStart != 0 || charLimit != source.getLength()) {
    if (ltr) {
      minGlyph = charStart;
      maxGlyph = charLimit;
    } else {
      minGlyph = numGlyphs - charLimit;
      maxGlyph = numGlyphs - charStart;
    }
  }

  for (int i = 0; i < numGlyphs; ++i) {
    GlyphJustificationInfo info = null;
    if (i >= minGlyph && i < maxGlyph) {
      if (charinfo[i * numvals + advx] == 0) { // combining marks don't justify
        info = nullInfo;
      } else {
        int ci = v2l(i); // 1-1 assumption again
        char c = chars[offset + ci];
        if (Character.isWhitespace(c)) {
          info = spaceInfo;
          // CJK, Hangul, CJK Compatibility areas
        } else if (c >= 0x4e00 &&
                   (c < 0xa000) ||
                   (c >= 0xac00 && c < 0xd7b0) ||
                   (c >= 0xf900 && c < 0xfb00)) {
          info = kanjiInfo;
        } else {
          info = nullInfo;
        }
      }
    }
    infos[infoStart + i] = info;
  }
}
 
Example 49
Project: cn1   File: GlyphVector.java   Source Code and License 4 votes vote down vote up
public abstract GlyphJustificationInfo getGlyphJustificationInfo(
int glyphIndex);
 
Example 50
Project: cn1   File: Glyph.java   Source Code and License 4 votes vote down vote up
/**
 *  Retruns GlyphJustificationInfo of this glyph object
 */
public GlyphJustificationInfo getGlyphJustificationInfo(){
    return glJustInfo;
}
 
Example 51
Project: openjdk-jdk7u-jdk   File: ExtendedTextSourceLabel.java   Source Code and License 4 votes vote down vote up
public void getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit) {
  // This simple implementation only uses spaces for justification.
  // Since regular characters aren't justified, we don't need to deal with
  // special infos for combining marks or ligature substitution glyphs.
  // added character justification for kanjii only 2/22/98

  StandardGlyphVector gv = getGV();

  float[] charinfo = getCharinfo();

  float size = gv.getFont().getSize2D();

  GlyphJustificationInfo nullInfo =
    new GlyphJustificationInfo(0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  GlyphJustificationInfo spaceInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size / 4f);

  GlyphJustificationInfo kanjiInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_INTERCHAR, size, size,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  char[] chars = source.getChars();
  int offset = source.getStart();

  // assume data is 1-1 and either all rtl or all ltr, for now

  int numGlyphs = gv.getNumGlyphs();
  int minGlyph = 0;
  int maxGlyph = numGlyphs;
  boolean ltr = (source.getLayoutFlags() & 0x1) == 0;
  if (charStart != 0 || charLimit != source.getLength()) {
    if (ltr) {
      minGlyph = charStart;
      maxGlyph = charLimit;
    } else {
      minGlyph = numGlyphs - charLimit;
      maxGlyph = numGlyphs - charStart;
    }
  }

  for (int i = 0; i < numGlyphs; ++i) {
    GlyphJustificationInfo info = null;
    if (i >= minGlyph && i < maxGlyph) {
      if (charinfo[i * numvals + advx] == 0) { // combining marks don't justify
        info = nullInfo;
      } else {
        int ci = v2l(i); // 1-1 assumption again
        char c = chars[offset + ci];
        if (Character.isWhitespace(c)) {
          info = spaceInfo;
          // CJK, Hangul, CJK Compatibility areas
        } else if (c >= 0x4e00 &&
                   (c < 0xa000) ||
                   (c >= 0xac00 && c < 0xd7b0) ||
                   (c >= 0xf900 && c < 0xfb00)) {
          info = kanjiInfo;
        } else {
          info = nullInfo;
        }
      }
    }
    infos[infoStart + i] = info;
  }
}
 
Example 52
Project: awtonandroid   File: FreetypeGlyphVector.java   Source Code and License 4 votes vote down vote up
@Override
public GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex) {
	throw new UnsupportedOperationException("Not yet implemented.");
	//return null;
}
 
Example 53
Project: freeVM   File: GlyphVector.java   Source Code and License 4 votes vote down vote up
public abstract GlyphJustificationInfo getGlyphJustificationInfo(
int glyphIndex);
 
Example 54
Project: freeVM   File: Glyph.java   Source Code and License 4 votes vote down vote up
/**
 *  Retruns GlyphJustificationInfo of this glyph object
 */
public GlyphJustificationInfo getGlyphJustificationInfo(){
    return glJustInfo;
}
 
Example 55
Project: freeVM   File: GlyphVector.java   Source Code and License 4 votes vote down vote up
public abstract GlyphJustificationInfo getGlyphJustificationInfo(
int glyphIndex);
 
Example 56
Project: freeVM   File: Glyph.java   Source Code and License 4 votes vote down vote up
/**
 *  Retruns GlyphJustificationInfo of this glyph object
 */
public GlyphJustificationInfo getGlyphJustificationInfo(){
    return glJustInfo;
}
 
Example 57
Project: openjdk-icedtea7   File: ExtendedTextSourceLabel.java   Source Code and License 4 votes vote down vote up
public void getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit) {
  // This simple implementation only uses spaces for justification.
  // Since regular characters aren't justified, we don't need to deal with
  // special infos for combining marks or ligature substitution glyphs.
  // added character justification for kanjii only 2/22/98

  StandardGlyphVector gv = getGV();

  float[] charinfo = getCharinfo();

  float size = gv.getFont().getSize2D();

  GlyphJustificationInfo nullInfo =
    new GlyphJustificationInfo(0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  GlyphJustificationInfo spaceInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size,
                               true, GlyphJustificationInfo.PRIORITY_WHITESPACE, 0, size / 4f);

  GlyphJustificationInfo kanjiInfo =
    new GlyphJustificationInfo(size,
                               true, GlyphJustificationInfo.PRIORITY_INTERCHAR, size, size,
                               false, GlyphJustificationInfo.PRIORITY_NONE, 0, 0);

  char[] chars = source.getChars();
  int offset = source.getStart();

  // assume data is 1-1 and either all rtl or all ltr, for now

  int numGlyphs = gv.getNumGlyphs();
  int minGlyph = 0;
  int maxGlyph = numGlyphs;
  boolean ltr = (source.getLayoutFlags() & 0x1) == 0;
  if (charStart != 0 || charLimit != source.getLength()) {
    if (ltr) {
      minGlyph = charStart;
      maxGlyph = charLimit;
    } else {
      minGlyph = numGlyphs - charLimit;
      maxGlyph = numGlyphs - charStart;
    }
  }

  for (int i = 0; i < numGlyphs; ++i) {
    GlyphJustificationInfo info = null;
    if (i >= minGlyph && i < maxGlyph) {
      if (charinfo[i * numvals + advx] == 0) { // combining marks don't justify
        info = nullInfo;
      } else {
        int ci = v2l(i); // 1-1 assumption again
        char c = chars[offset + ci];
        if (Character.isWhitespace(c)) {
          info = spaceInfo;
          // CJK, Hangul, CJK Compatibility areas
        } else if (c >= 0x4e00 &&
                   (c < 0xa000) ||
                   (c >= 0xac00 && c < 0xd7b0) ||
                   (c >= 0xf900 && c < 0xfb00)) {
          info = kanjiInfo;
        } else {
          info = nullInfo;
        }
      }
    }
    infos[infoStart + i] = info;
  }
}
 
Example 58
Project: consulo   File: AbstractMockGlyphVector.java   Source Code and License 4 votes vote down vote up
@Override
public GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex) {
  throw new UnsupportedOperationException();
}
 
Example 59
Project: OpenJSharp   File: GlyphVector.java   Source Code and License 2 votes vote down vote up
/**
 * Returns the justification information for the glyph at
 * the specified index into this <code>GlyphVector</code>.
 * @param glyphIndex the index into this <code>GlyphVector</code>
 *   that corresponds to the glyph from which to retrieve its
 *   justification properties
 * @return a {@link GlyphJustificationInfo} object that
 *   represents the justification properties of the glyph at the
 *   specified <code>glyphIndex</code> into this
 *   <code>GlyphVector</code>.
 * @throws IndexOutOfBoundsException if <code>glyphIndex</code>
 *   is less than 0 or greater than or equal to the number
 *   of glyphs in this <code>GlyphVector</code>
 */
public abstract GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex);
 
Example 60
Project: OpenJSharp   File: GraphicComponent.java   Source Code and License 2 votes vote down vote up
/**
 * Return GlyphJustificationInfo objects for the characters between
 * charStart and charLimit, starting at offset infoStart.  Infos
 * will be in visual order.  All positions between infoStart and
 * getNumJustificationInfos will be set.  If a position corresponds
 * to a character outside the provided range, it is set to null.
 */
public void getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit) {
}