纤维通常被作为“填充型体”。 你们可以通过改变文本“放任方式”来增加一些宽度的中风。
And it looks like iText has already implemented this very feature (along with "poor man s italic", in PdfChunk.java. It uses a stroke width of 1/30 the font size.
因此,如果你只是要求用黑体联盟编码,那么你就应当获得“穷人的 bold”已经果敢。
至于联合体,我不知道有这样的制度,即没有。 你们可以做像在更高一级那样的事情,打破chu。 类似:
void addTextToPara(Paragraph paragraph, String string, Font font, Font otherFont) {
BaseFont mainfont = font.getBaseFont();
StringBuffer curChunk = new StringBuffer();
StringBuffer otherChunk = new StringBuffer();
for (int curCharIdx = 0; curCharIdx< string.length(); ++curCharIdx) {
char curChar = string.charAt(curCharIdx);
byte charBytes[] = mainFont.convertToBytes(curChar);
if (charBytes == null || charBytes.length == 0) {
// can t represent that character in the main font
if (curChunk.length() > 0) {
paragraph.add(new Chunk(curChunk.toString(), font);
curChunk.setLength(0);
}
otherChunk.append(curChar);
} else {
if (otherChunk.length() > 0) {
paragraph.add(new Chunk(otherChunk.toString(), otherFont);
otherChunk.setLength(0);
}
curChunk.append(curChar);
// can represent the character with the main font
}
}
if (curChunk.length() > 0) {
paragraph.add(new Chunk(curChunk.toString(), font);
} else if (otherChunk.length() > 0) {
paragraph.add(new Chunk(otherChunk.toString(), otherFont);
}
}
BaseFont arialBoldBaseFont = BaseFont.createFont(arialBoldPath, BaseFont.WINANSI, false); // not embedded
BaseFont arialUnicodeBaseFont = BaseFont.createFont(arialUniPath, BaseFont.IDENTITY_H, true); // IDENITY_H forces an embedded subset, ignores "embedded" param.
Font mainFont = new Font(arialBoldBaseFont, size);
Font backupFont = new Font(arialUnicodeBaseFont, size, Font.BOLD);
...
addTextToPara(paragraph, string, mainFont, backupFont);
请注意,上述代码无意试图看到某一个果园是否可在<条码>中提取。 有可能改写如下:addTextToPara(
),以掌握一系列的字体,但I m并非几乎照亮;]
根据上述法典,你可以与你一样创建基地基金会,我更喜欢那里98%的病例的“实体H”。 <代码>mainFont 可在 font和backupFont
上建立 或许是Else。 He,你甚至可以做这样的事情:
BaseFont mainFont = BaseFont.createFont(arialBoldPath, BaseFont.WINANSI, false);
BaseFont backupFont = BaseFont.createFont(arialBoldPath, BaseFont.IDENTITY_H, true);
Use the same system-level font for both, and only embed the characters that fall outside "the norm". This still produces two separate font resources in the PDF, but one is not embedded (and used most of the time), and the other is an embedded subset of hopefully-rare characters.