From 966d9055cb1abb38fcd80b4f40f70f4942a92cd1 Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Thu, 2 Apr 2020 11:59:40 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-29126=20=E5=AF=BC=E5=87=BApdf=EF=BC=8C?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E5=8A=A0=E7=B2=97=E6=95=88=E6=9E=9C=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/third/com/lowagie/text/pdf/PdfGraphics2D.java | 5 +++-- 1 file changed, 3 insertions(+), 2 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 ee5a7cfcf..9f4db7192 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 @@ -429,10 +429,11 @@ public class PdfGraphics2D extends Graphics2D { // Simulate a bold font. // 30有点粗 ,换成40 float strokeWidth = font.getSize2D() * (weight.floatValue() - TextAttribute.WEIGHT_REGULAR.floatValue()) / 40f; + //重点是这个渲染模式的设置,其他无所谓 + cb.setTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE); if (strokeWidth != 1) { + cb.setLineWidth(strokeWidth); if(realPaint instanceof Color){ - cb.setTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE); - cb.setLineWidth(strokeWidth); Color color = (Color)realPaint; int alpha = color.getAlpha(); if (alpha != currentStrokeGState) {