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


Java PDType1Font.TIMES_ROMAN属性代码示例

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


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

示例1: chooseMatchingTimes

/**
 * Get a PDType1Font.TIMES-variant, which matches the given font
 * 
 * @param font
 *            Font to get the styles from
 * @return a PDFont Times variant which matches the style in the given Font
 *         object.
 */
public static PDFont chooseMatchingTimes(Font font) {
	if ((font.getStyle() & (Font.ITALIC | Font.BOLD)) == (Font.ITALIC | Font.BOLD))
		return PDType1Font.TIMES_BOLD_ITALIC;
	if ((font.getStyle() & Font.ITALIC) == Font.ITALIC)
		return PDType1Font.TIMES_ITALIC;
	if ((font.getStyle() & Font.BOLD) == Font.BOLD)
		return PDType1Font.TIMES_BOLD;
	return PDType1Font.TIMES_ROMAN;
}
 
开发者ID:rototor,项目名称:pdfbox-graphics2d,代码行数:17,代码来源:PdfBoxGraphics2DFontTextDrawerDefaultFonts.java

示例2: HexPdf

/**
 * Sole constructor, creates a new instance of HexPdf.
 */
public HexPdf() {
    super();
    this.ignorePagebleed = false;
    this.numPages = 0;
    this.rightMargin = 50f;
    this.leftMargin = 50f;
    this.bottomMargin = 50f;
    this.topMargin = 50f;
    this.fontSize = 10;
    this.font = PDType1Font.TIMES_ROMAN;
    this.pageSize = PDRectangle.A4;
    this.normalColor = Color.black;
    this.titleColor = Color.black;
    this.orientation = HexPdf.PORTRAIT;
    //firstPage();
}
 
开发者ID:bhits,项目名称:common-libraries,代码行数:19,代码来源:HexPdf.java

示例3: rText

public float rText(float x, float y, int space, String labelField,
           String value, int fieldWidth, int valueWidth) 
throws Exception {
PDFont font = PDType1Font.TIMES_BOLD;
content.setFont(font, 9);
float y1 = 0f;
float y2 = 0f;
if (value == null) {
    return rText(labelField, fieldWidth, x, y - 19, space, font, false);
} else {
    if (labelField == null) {
    font = PDType1Font.TIMES_ROMAN;
    content.setFont(font, 9);
    return rText(value, valueWidth, x, y - 19, space, font, true);
    } else {
    y1 = rText(labelField, fieldWidth, x, y - 30, space, font, 
           false);
    font = PDType1Font.TIMES_ROMAN;
    content.setFont(font, 9);
    float y3 = y;
    y2 = rText(value, valueWidth, x + fieldWidth + 10, y - 30,
           space, font, true);
    if (y3 < y2) {
        return y2;
    } else {
        if (y1 >= y2) {
        return y2;
        } else {
        return y1;
        }
    }
    }
}
}
 
开发者ID:mkl-public,项目名称:testarea-pdfbox1,代码行数:34,代码来源:PdfRenderingEndorsement.java

示例4: tryBuiltinFallback

private PDFont tryBuiltinFallback(String fontFamily, boolean isItalic, boolean isBold)
{
    PDFont font;
    
    fontFamily = fontFamily.toLowerCase();
    switch (fontFamily) {
    case "courier":
    case "courier new":
    case "lucida console":
        if (isBold && isItalic) { font = PDType1Font.COURIER_BOLD_OBLIQUE;}
        else if (isBold) { font = PDType1Font.COURIER_BOLD;}
        else if (isItalic) { font = PDType1Font.COURIER_OBLIQUE;}
        else { font = PDType1Font.COURIER;}
        break;
    case "times":
    case "garamond":
    case "georgia":
    case "times new roman":
    case "serif":
        if (isBold && isItalic) { font = PDType1Font.TIMES_BOLD_ITALIC;}
        else if (isBold) { font = PDType1Font.TIMES_BOLD;}
        else if (isItalic) { font = PDType1Font.TIMES_ITALIC;}
        else { font = PDType1Font.TIMES_ROMAN;}
        break;
    default:
        if (isBold && isItalic) { font = PDType1Font.HELVETICA_BOLD_OBLIQUE;}
        else if (isBold) { font = PDType1Font.HELVETICA_BOLD;}
        else if (isItalic) { font = PDType1Font.HELVETICA_OBLIQUE;}
        else { font = PDType1Font.HELVETICA;}
        break;
    }
    return font;
}
 
开发者ID:radkovo,项目名称:CSSBoxPdf,代码行数:33,代码来源:PDFRenderer.java


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