本文整理了Java中com.itextpdf.text.pdf.BaseFont.getCidCode()
方法的一些代码示例,展示了BaseFont.getCidCode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BaseFont.getCidCode()
方法的具体详情如下:
包路径:com.itextpdf.text.pdf.BaseFont
类名称:BaseFont
方法名:getCidCode
[英]Gets the CID code given an Unicode. It has only meaning with CJK fonts.
[中]获取给定Unicode的CID代码。它仅对CJK字体有意义。
代码示例来源:origin: com.itextpdf/itextpdf
/**
* Gets the width of a <CODE>char</CODE> in normalized 1000 units.
* @param char1 the unicode <CODE>char</CODE> to get the width of
* @return the width in normalized 1000 units
*/
@Override
public int getWidth(int char1) {
if (isType0) {
if(hMetrics != null && cjkMirror != null && !cjkMirror.isVertical()) {
int c = cjkMirror.getCidCode(char1);
int v = hMetrics.get(c);
if (v > 0)
return v;
else
return defaultWidth;
} else {
int[] ws = metrics.get(Integer.valueOf(char1));
if (ws != null)
return ws[1];
else
return 0;
}
}
if (cjkMirror != null)
return cjkMirror.getWidth(char1);
return super.getWidth(char1);
}
代码示例来源:origin: com.itextpdf/itextg
/**
* Gets the width of a <CODE>char</CODE> in normalized 1000 units.
* @param char1 the unicode <CODE>char</CODE> to get the width of
* @return the width in normalized 1000 units
*/
@Override
public int getWidth(int char1) {
if (isType0) {
if(hMetrics != null && cjkMirror != null && !cjkMirror.isVertical()) {
int c = cjkMirror.getCidCode(char1);
int v = hMetrics.get(c);
if (v > 0)
return v;
else
return defaultWidth;
} else {
int[] ws = metrics.get(Integer.valueOf(char1));
if (ws != null)
return ws[1];
else
return 0;
}
}
if (cjkMirror != null)
return cjkMirror.getWidth(char1);
return super.getWidth(char1);
}
内容来源于网络,如有侵权,请联系作者删除!