當前位置: 首頁>>代碼示例>>Java>>正文


Java GlyphMetrics.STANDARD屬性代碼示例

本文整理匯總了Java中java.awt.font.GlyphMetrics.STANDARD屬性的典型用法代碼示例。如果您正苦於以下問題:Java GlyphMetrics.STANDARD屬性的具體用法?Java GlyphMetrics.STANDARD怎麽用?Java GlyphMetrics.STANDARD使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.awt.font.GlyphMetrics的用法示例。


在下文中一共展示了GlyphMetrics.STANDARD屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getGlyphMetrics

public GlyphMetrics getGlyphMetrics(int ix) {
    if (ix < 0 || ix >= glyphs.length) {
        throw new IndexOutOfBoundsException("ix = " + ix);
    }

    Rectangle2D vb = getGlyphVisualBounds(ix).getBounds2D();
    Point2D pt = getGlyphPosition(ix);
    vb.setRect(vb.getMinX() - pt.getX(),
               vb.getMinY() - pt.getY(),
               vb.getWidth(),
               vb.getHeight());
    Point2D.Float adv =
        getGlyphStrike(ix).strike.getGlyphMetrics(glyphs[ix]);
    GlyphMetrics gm = new GlyphMetrics(true, adv.x, adv.y,
                                       vb,
                                       GlyphMetrics.STANDARD);
    return gm;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:18,代碼來源:StandardGlyphVector.java

示例2: getGlyphMetrics

@Override
public GlyphMetrics getGlyphMetrics(){
    if (glMetrics == null) {
        float[] metrics = getGlyphMetrics(glyphPointer);
        
        this.glMetrics = new GlyphMetrics(
                true, 
                Math.round(metrics[0]),//metrics[0], 
                Math.round(metrics[1]),//metrics[1],
                //new Rectangle2D.Double(initOutline().getBounds2D().getMinX(), initOutline().getBounds2D().getMinY(), initOutline().getBounds2D().getMaxX() + 5, initOutline().getBounds2D().getMaxY()),                    
                initOutline().getBounds2D(),//new Rectangle2D.Float(metrics[2], -metrics[5]-1,metrics[4]- metrics[2] + 1, metrics[5] - metrics[3] + 1),
                GlyphMetrics.STANDARD);
    }
    
    return glMetrics;
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:16,代碼來源:FLGlyph.java

示例3: getGlyphMetrics

/**
 * Returns the metrics of the glyph at the specified index into this
 * GVTGlyphVector.
 */
public GVTGlyphMetrics getGlyphMetrics(int glyphIndex) {
    if (glyphMetrics[glyphIndex] != null)
        return glyphMetrics[glyphIndex];

    // -- start glyph cache code --
    Point2D glyphPos = defaultGlyphPositions[glyphIndex];
    char c = ci.setIndex(ci.getBeginIndex()+glyphIndex);
    ci.setIndex(ci.getBeginIndex());
    AWTGlyphGeometryCache.Value v = AWTGVTFont.getGlyphGeometry
        (gvtFont, c, awtGlyphVector, glyphIndex, glyphPos);
    Rectangle2D gmB = v.getBounds2D();
    // -- end glyph cache code --

    Rectangle2D bounds = new Rectangle2D.Double
        (gmB.getX()     * scaleFactor, gmB.getY()      * scaleFactor,
         gmB.getWidth() * scaleFactor, gmB.getHeight() * scaleFactor);

    // defaultGlyphPositions has one more entry than glyphs
    // the last entry stores the total advance for the
    // glyphVector.
    float adv = (float)(defaultGlyphPositions[glyphIndex+1].getX()-
                        defaultGlyphPositions[glyphIndex]  .getX());
    glyphMetrics[glyphIndex] =  new GVTGlyphMetrics
        ((float)(adv*scaleFactor), (ascent+descent),
         bounds, GlyphMetrics.STANDARD);

    return glyphMetrics[glyphIndex];
}
 
開發者ID:git-moss,項目名稱:Push2Display,代碼行數:32,代碼來源:AWTGVTGlyphVector.java

示例4: getGlyphMetrics

/**
 * Returns the metrics of the glyph at the specified index into this
 * GVTGlyphVector.
 */
public GVTGlyphMetrics getGlyphMetrics(int glyphIndex) {
    if (glyphMetrics[glyphIndex] != null)
        return glyphMetrics[glyphIndex];

    // -- start glyph cache code --
    Point2D glyphPos = defaultGlyphPositions[glyphIndex];
    char c = ci.setIndex(ci.getBeginIndex()+glyphIndex);
    ci.setIndex(ci.getBeginIndex());
    AWTGlyphGeometryCache.Value v = AWTGVTFont.getGlyphGeometry
        (gvtFont, c, awtGlyphVector, glyphIndex, glyphPos);
    Rectangle2D gmB = v.getBounds2D();
    // -- end glyph cache code --

    Rectangle2D bounds = new Rectangle2D.Double
        (gmB.getX()     * scaleFactor, gmB.getY()      * scaleFactor,
         gmB.getWidth() * scaleFactor, gmB.getHeight() * scaleFactor);

    // defaultGlyphPositions has one more entry than glyphs
    // the last entry stores the total advance for the
    // glyphVector.
    float adv = (float)(defaultGlyphPositions[glyphIndex+1].getX()-
                        defaultGlyphPositions[glyphIndex]  .getX());
    glyphMetrics[glyphIndex] =  new GVTGlyphMetrics
        (adv*scaleFactor, (ascent+descent),
         bounds, GlyphMetrics.STANDARD);

    return glyphMetrics[glyphIndex];
}
 
開發者ID:BowlerHatLLC,項目名稱:feathers-sdk,代碼行數:32,代碼來源:AWTGVTGlyphVector.java


注:本文中的java.awt.font.GlyphMetrics.STANDARD屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。