Browse Source

Merge pull request #1816 in CORE/base-third from feature/10.0 to feature/x

* commit '41556ee6f916d4a6bedb7beb38aae99b7835dd7a':
  REPORT-47816 在某些字体、字号下,导出pdf文字会有一个黑边(REPORT-29126 改动导致)
research/11.0
superman 3 years ago
parent
commit
a8f44f593c
  1. 28
      fine-itext-old/src/main/java/com/fr/third/com/lowagie/text/pdf/PdfGraphics2D.java

28
fine-itext-old/src/main/java/com/fr/third/com/lowagie/text/pdf/PdfGraphics2D.java

@ -434,22 +434,22 @@ public class PdfGraphics2D extends Graphics2D {
if (strokeWidth != 1) {
cb.setLineWidth(strokeWidth);
oldStroke = new BasicStroke(strokeWidth);
if(realPaint instanceof Color){
Color color = (Color)realPaint;
int alpha = color.getAlpha();
if (alpha != currentStrokeGState) {
currentStrokeGState = alpha;
PdfGState gs = strokeGState[alpha];
if (gs == null) {
gs = new PdfGState();
gs.setStrokeOpacity(alpha / 255f);
strokeGState[alpha] = gs;
}
cb.setGState(gs);
}
if (realPaint instanceof Color) {
Color color = (Color) realPaint;
int alpha = color.getAlpha();
if (alpha != currentStrokeGState) {
currentStrokeGState = alpha;
PdfGState gs = strokeGState[alpha];
if (gs == null) {
gs = new PdfGState();
gs.setStrokeOpacity(alpha / 255f);
strokeGState[alpha] = gs;
}
paintStroke = color;
cb.setColorStroke(color);
cb.setGState(gs);
}
paintStroke = color;
cb.setColorStroke(color);
}
restoreTextRenderingMode = true;
}

Loading…
Cancel
Save