Browse Source

Merge pull request #410 in CORE/base-third from ~HUGH.C/base-third:release/10.0 to release/10.0

* commit 'f9abf02648b76d2d128860033685d9c4f7a033b5':
  REPORT-29126 导出pdf,字体加粗效果没有了(漏提)
  REPORT-29126 导出pdf,字体加粗效果没有了
release/10.0
Hugh.C 5 years ago
parent
commit
bb383f6a4e
  1. 7
      fine-itext-old/src/com/fr/third/com/lowagie/text/pdf/PdfGraphics2D.java

7
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) {
@ -446,9 +447,9 @@ public class PdfGraphics2D extends Graphics2D {
cb.setGState(gs);
}
cb.setColorStroke(color);
restoreTextRenderingMode = true;
}
}
restoreTextRenderingMode = true;
}
}

Loading…
Cancel
Save