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


Java Font.getFontHeightInPoints方法代碼示例

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


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

示例1: fontStyle

import org.apache.poi.ss.usermodel.Font; //導入方法依賴的package包/類
private void fontStyle(Font font) {
    if (font.getBoldweight() >= Font.BOLDWEIGHT_BOLD)
        out.format("  font-weight: bold;%n");
    if (font.getItalic())
        out.format("  font-style: italic;%n");
    out.format("  font-family: %s;%n", font.getFontName());

    int fontheight = font.getFontHeightInPoints();
    if (fontheight == 9) {
        fontheight = 10;
    }
    out.format("  font-size: %dpt;%n", fontheight);
    helper.styleColor(out, "color", getColor(font));
}
 
開發者ID:rushingpig,項目名稱:poix,代碼行數:15,代碼來源:StylerHelper.java

示例2: PoiFontDto

import org.apache.poi.ss.usermodel.Font; //導入方法依賴的package包/類
/**
 * コンストラクタ
 * @param font
 */
public PoiFontDto(Font font) {
	if (font == null) return;
	
	boldweight = StyleUtil.getBoldWeight(font.getBoldweight());
	color = StyleUtil.getColor(font.getColor());
	fontHeight = font.getFontHeight();
	fontHeightInPoints = font.getFontHeightInPoints();
	fontName = font.getFontName();
	italic = font.getItalic();
	strikeout = font.getStrikeout();
	typeOffset = StyleUtil.getFontOffset(font.getTypeOffset());
	underline = StyleUtil.getFontUnderline(font.getUnderline());
	
	this.font = font;
}
 
開發者ID:yu-ki106f,項目名稱:PoiManager,代碼行數:20,代碼來源:PoiFontDto.java

示例3: getPoiFont

import org.apache.poi.ss.usermodel.Font; //導入方法依賴的package包/類
PoiFont getPoiFont(com.dua3.utility.text.Font font, TextAttributes attributes) {
    String name = String.valueOf(attributes.getOrDefault(TextAttributes.FONT_FAMILY, font.getFamily()));

    Object sSize = attributes.get(TextAttributes.FONT_SIZE);
    short height = (short) Math.round(sSize == null ? font.getSizeInPoints() : TextUtil.decodeFontSize(sSize.toString()));

    final Object sStyle = attributes.get(TextAttributes.FONT_STYLE);
    boolean italic = sStyle == null ? font.isItalic() : "italic".equals(sStyle);

    final Object sWeight = attributes.get(TextAttributes.FONT_WEIGHT);
    boolean bold = sWeight == null ? font.isBold() : "bold".equals(sWeight);

    Object sDecoration = attributes.get(TextAttributes.TEXT_DECORATION);
    boolean underline = sDecoration == null ? font.isUnderlined() : "underline".equals(sDecoration);
    boolean strikethrough = sDecoration == null ? font.isStrikeThrough() : "line-through".equals(sDecoration);

    Object sColor = attributes.get(TextAttributes.COLOR);
    Color color = sColor == null ? font.getColor() : Color.valueOf(sColor.toString());

    // try to find existing font
    for (short i = 0; i < poiWorkbook.getNumberOfFonts(); i++) {
        Font poiFont = poiWorkbook.getFontAt(i);

        if (poiFont.getFontName().equalsIgnoreCase(name)
                && poiFont.getFontHeightInPoints() == height
                && poiFont.getBold() == bold
                && poiFont.getItalic() == italic
                && (poiFont.getUnderline() != Font.U_NONE) == underline
                && poiFont.getStrikeout() == strikethrough
                && getColor(poiFont, Color.BLACK).equals(color)
                && poiFont.getTypeOffset() == Font.SS_NONE) {
            return new PoiFont(this, poiFont);
        }
    }

    // if not found, create it
    return createFont(font);
}
 
開發者ID:xzel23,項目名稱:meja,代碼行數:39,代碼來源:PoiWorkbook.java

示例4: getScale

import org.apache.poi.ss.usermodel.Font; //導入方法依賴的package包/類
private static double getScale(Font font) {
	String name = font.getFontName();
	int pt = font.getFontHeightInPoints();
	if ("MS Pゴシック".equals(name) && pt == 11) return SCALE_MSGOTHIC;
	if ("Arial".equals(name) && pt == 10) return SCALE_ARIAL;
	
	System.out.println("Unknown font: " + name + ", " + pt);
	return SCALE_MSGOTHIC;
}
 
開發者ID:shunjikonishi,項目名稱:excel2canvas,代碼行數:10,代碼來源:ColumnWidth.java

示例5: get

import org.apache.poi.ss.usermodel.Font; //導入方法依賴的package包/類
@Override
public Object get(Column column, Cell cell, Font font) {
	return (long) font.getFontHeightInPoints();
}
 
開發者ID:hishidama,項目名稱:embulk-parser-poi_excel,代碼行數:5,代碼來源:PoiExcelCellFontVisitor.java


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