From 72ee15206300064f37b2217c41b30849d5cb1066 Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Mon, 9 Dec 2019 16:16:39 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-24915=20REPORT-24809=20PDF=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E7=B2=97=E4=BD=93=E5=AD=97=E4=BD=93=E8=BF=87=E7=B2=97?= =?UTF-8?q?;html=E6=98=BE=E7=A4=BA=20=E6=95=B0=E6=8D=AE=E5=AF=BC=E5=87=BAp?= =?UTF-8?q?df=E6=B2=A1=E6=9C=89=E5=8A=A0=E7=B2=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third/com/lowagie/text/pdf/PdfGraphics2D.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/fine-itext-old/src/com/fr/third/com/lowagie/text/pdf/PdfGraphics2D.java b/fine-itext-old/src/com/fr/third/com/lowagie/text/pdf/PdfGraphics2D.java index 5a13315c3..ee5a7cfcf 100755 --- a/fine-itext-old/src/com/fr/third/com/lowagie/text/pdf/PdfGraphics2D.java +++ b/fine-itext-old/src/com/fr/third/com/lowagie/text/pdf/PdfGraphics2D.java @@ -382,7 +382,10 @@ public class PdfGraphics2D extends Graphics2D { // value. When they are the same value then we are normally dealing // with a single font that has been made into an italic or bold // font. - if (font.isItalic() && font.getFontName().equals(font.getName())) { + if (font.isItalic()) + //awt.font只要样式,不验证是否安装,真实绘制的字体是 baseFont + // && font.getFontName().equals(font.getName())) + { float angle = baseFont.getFontDescriptor(BaseFont.ITALICANGLE, 1000); float angle2 = font.getItalicAngle(); // We don't have an italic version of this font so we need @@ -419,10 +422,13 @@ public class PdfGraphics2D extends Graphics2D { weight = (font.isBold()) ? TextAttribute.WEIGHT_BOLD : TextAttribute.WEIGHT_REGULAR; } - if ((font.isBold() || (weight.floatValue() >= TextAttribute.WEIGHT_SEMIBOLD.floatValue())) - && (font.getFontName().equals(font.getName()))) { + if ((font.isBold() || (weight.floatValue() >= TextAttribute.WEIGHT_SEMIBOLD.floatValue()))) + //awt.font只要样式,不验证是否安装,真实绘制的字体是 baseFont + // && (font.getFontName().equals(font.getName()))) + { // Simulate a bold font. - float strokeWidth = font.getSize2D() * (weight.floatValue() - TextAttribute.WEIGHT_REGULAR.floatValue()) / 30f; + // 30有点粗 ,换成40 + float strokeWidth = font.getSize2D() * (weight.floatValue() - TextAttribute.WEIGHT_REGULAR.floatValue()) / 40f; if (strokeWidth != 1) { if(realPaint instanceof Color){ cb.setTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE);