当前位置: 首页>>代码示例>>Java>>正文


Java GlyphJustificationInfo类代码示例

本文整理汇总了Java中java.awt.font.GlyphJustificationInfo的典型用法代码示例。如果您正苦于以下问题:Java GlyphJustificationInfo类的具体用法?Java GlyphJustificationInfo怎么用?Java GlyphJustificationInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GlyphJustificationInfo类属于java.awt.font包,在下文中一共展示了GlyphJustificationInfo类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testGlyphJustificationInfo

import java.awt.font.GlyphJustificationInfo; //导入依赖的package包/类
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);
    
}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:GlyphJustificationInfoTest.java

示例2: testGetJustificationInfo

import java.awt.font.GlyphJustificationInfo; //导入依赖的package包/类
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());

}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:ImageGraphicAttributeTest.java

示例3: testGetJustificationInfo

import java.awt.font.GlyphJustificationInfo; //导入依赖的package包/类
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());

}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:ShapeGraphicAttributeTest.java

示例4: getGlyphJustificationInfo

import java.awt.font.GlyphJustificationInfo; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:StandardGlyphVector.java

示例5: getGlyphJustificationInfo

import java.awt.font.GlyphJustificationInfo; //导入依赖的package包/类
@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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:StandardGlyphVector.java

示例6: getGlyphJustificationInfo

import java.awt.font.GlyphJustificationInfo; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:12,代码来源:SVGGVTGlyphVector.java

示例7: equalsGlyphJustificationInfo

import java.awt.font.GlyphJustificationInfo; //导入依赖的package包/类
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;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:14,代码来源:ImageGraphicAttributeTest.java

示例8: getGlyphJustificationInfo

import java.awt.font.GlyphJustificationInfo; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:17,代码来源:CommonGlyphVector.java

示例9: getJustificationInfos

import java.awt.font.GlyphJustificationInfo; //导入依赖的package包/类
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;
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:71,代码来源:ExtendedTextSourceLabel.java

示例10: getGlyphJustificationInfo

import java.awt.font.GlyphJustificationInfo; //导入依赖的package包/类
/**
 * 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]);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:9,代码来源:MultiGlyphVector.java


注:本文中的java.awt.font.GlyphJustificationInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。