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


Java FontInfo.getFontInstance方法代码示例

本文整理汇总了Java中org.apache.fop.fonts.FontInfo.getFontInstance方法的典型用法代码示例。如果您正苦于以下问题:Java FontInfo.getFontInstance方法的具体用法?Java FontInfo.getFontInstance怎么用?Java FontInfo.getFontInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.fop.fonts.FontInfo的用法示例。


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

示例1: initialize

import org.apache.fop.fonts.FontInfo; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void initialize() {
    super.initialize();
    org.apache.fop.fo.flow.Block fo = getBlockFO();
    FontInfo fi = fo.getFOEventHandler().getFontInfo();
    FontTriplet[] fontkeys = fo.getCommonFont().getFontState(fi);
    Font initFont = fi.getFontInstance(fontkeys[0],
            getBlockFO().getCommonFont().fontSize.getValue(this));
    lead = initFont.getAscender();
    follow = -initFont.getDescender();
    //middleShift = -fs.getXHeight() / 2;
    lineHeight = fo.getLineHeight().getOptimum(this).getLength();
    startIndent = fo.getCommonMarginBlock().startIndent.getValue(this);
    endIndent = fo.getCommonMarginBlock().endIndent.getValue(this);
    foSpaceBefore = new SpaceVal(fo.getCommonMarginBlock().spaceBefore, this).getSpace();
    foSpaceAfter = new SpaceVal(fo.getCommonMarginBlock().spaceAfter, this).getSpace();
    // use optimum space values
    adjustedSpaceBefore = fo.getCommonMarginBlock().spaceBefore.getSpace()
                                .getOptimum(this).getLength().getValue(this);
    adjustedSpaceAfter = fo.getCommonMarginBlock().spaceAfter.getSpace()
                                .getOptimum(this).getLength().getValue(this);
}
 
开发者ID:pellcorp,项目名称:fop,代码行数:24,代码来源:BlockLayoutManager.java

示例2: getNextKnuthElements

import org.apache.fop.fonts.FontInfo; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public List getNextKnuthElements(LayoutContext context, int alignment) {
    if (alignmentContext == null) {
        FontInfo fi = fobj.getFOEventHandler().getFontInfo();
        FontTriplet[] fontkeys = fobj.getCommonFont().getFontState(fi);
        Font fs = fi.getFontInstance(fontkeys[0], fobj.getCommonFont().fontSize.getValue(this));
        alignmentContext = new AlignmentContext(fs, lineHeight.getValue(this),
                context.getWritingMode());
    }
    context.setAlignmentContext(alignmentContext);
    ipd = context.getRefIPD();

    //PHASE 1: Create Knuth elements
    if (knuthParagraphs == null) {
        // it's the first time this method is called
        knuthParagraphs = new ArrayList<KnuthSequence>();

        // here starts Knuth's algorithm
        collectInlineKnuthElements(context);
    } else {
        // this method has been called before
        // all line breaks are already calculated
    }

    // return finished when there's no content
    if (knuthParagraphs.size() == 0) {
        setFinished(true);
        return null;
    }

    //PHASE 2: Create line breaks
    return createLineBreaks(context.getBPAlignment(), context);
}
 
开发者ID:pellcorp,项目名称:fop,代码行数:35,代码来源:LineLayoutManager.java

示例3: initialize

import org.apache.fop.fonts.FontInfo; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void initialize() {
    FontInfo fi = fobj.getFOEventHandler().getFontInfo();
    FontTriplet[] fontkeys = fobj.getCommonFont().getFontState(fi);
    font = fi.getFontInstance(fontkeys[0], fobj.getCommonFont().fontSize.getValue(this));
    setCommonBorderPaddingBackground(fobj.getCommonBorderPaddingBackground());
}
 
开发者ID:pellcorp,项目名称:fop,代码行数:8,代码来源:AbstractPageNumberCitationLayoutManager.java

示例4: initialize

import org.apache.fop.fonts.FontInfo; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void initialize() {
    FontInfo fi = fobj.getFOEventHandler().getFontInfo();
    FontTriplet[] fontkeys = fobj.getCommonFont().getFontState(fi);
    font = fi.getFontInstance(fontkeys[0], fobj.getCommonFont().fontSize.getValue(this));
    // the property leader-alignment does not affect vertical positioning
    // (see section 7.21.1 in the XSL Recommendation)
    // setAlignment(node.getLeaderAlignment());
    setCommonBorderPaddingBackground(fobj.getCommonBorderPaddingBackground());
}
 
开发者ID:pellcorp,项目名称:fop,代码行数:11,代码来源:LeaderLayoutManager.java

示例5: initialize

import org.apache.fop.fonts.FontInfo; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void initialize() {
    InlineLevel fobj = (InlineLevel) this.fobj;

    int padding = 0;

    FontInfo fi = fobj.getFOEventHandler().getFontInfo();
    CommonFont commonFont = fobj.getCommonFont();
    FontTriplet[] fontkeys = commonFont.getFontState(fi);
    font = fi.getFontInstance(fontkeys[0], commonFont.fontSize.getValue(this));

    lineHeight = fobj.getLineHeight();
    borderProps = fobj.getCommonBorderPaddingBackground();
    inlineProps = fobj.getCommonMarginInline();

    if (fobj instanceof Inline) {
        alignmentAdjust = ((Inline)fobj).getAlignmentAdjust();
        alignmentBaseline = ((Inline)fobj).getAlignmentBaseline();
        baselineShift = ((Inline)fobj).getBaselineShift();
        dominantBaseline = ((Inline)fobj).getDominantBaseline();
    } else if (fobj instanceof Leader) {
        alignmentAdjust = ((Leader)fobj).getAlignmentAdjust();
        alignmentBaseline = ((Leader)fobj).getAlignmentBaseline();
        baselineShift = ((Leader)fobj).getBaselineShift();
        dominantBaseline = ((Leader)fobj).getDominantBaseline();
    } else if (fobj instanceof BasicLink) {
        alignmentAdjust = ((BasicLink)fobj).getAlignmentAdjust();
        alignmentBaseline = ((BasicLink)fobj).getAlignmentBaseline();
        baselineShift = ((BasicLink)fobj).getBaselineShift();
        dominantBaseline = ((BasicLink)fobj).getDominantBaseline();
    }
    if (borderProps != null) {
        padding = borderProps.getPadding(CommonBorderPaddingBackground.BEFORE, false, this);
        padding += borderProps.getBorderWidth(CommonBorderPaddingBackground.BEFORE,
                                             false);
        padding += borderProps.getPadding(CommonBorderPaddingBackground.AFTER, false, this);
        padding += borderProps.getBorderWidth(CommonBorderPaddingBackground.AFTER, false);
    }
    extraBPD = MinOptMax.getInstance(padding);

}
 
开发者ID:pellcorp,项目名称:fop,代码行数:43,代码来源:InlineLayoutManager.java


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