Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fonts displaying incorrectly under Java 6

I'm using IcePDF library to display PDFs in the web application. Under Java 6 (jdk1.6.0_37 32bits), fonts are displayed incorrectly (are substituted with some default font)

Java 6

while under Java 7 it looks ok.

Java 7

I need to use Java 6 in my app, have you got any idea what could be the cause of this behavior?

like image 602
Odarpi Avatar asked Jan 17 '13 17:01

Odarpi


3 Answers

you can always import the fonts to your library..

You can try with this:

Font font = Font.createFont(Font.TRUETYPE_FONT, fontStream);

Next,

GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(font);

And,

new Font("nameOfFont", Font.BOLD, 13)
like image 110
Rachel Gallen Avatar answered Nov 15 '22 03:11

Rachel Gallen


ICEpdf Pro supports OpenType/CFF fonts. If your having problems with font substitution in the Open source version then try installing the following fonts on your server instance. http://www.icesoft.org/wiki/display/PDF/Optimized+Font+Substitution

like image 33
pcorless Avatar answered Nov 15 '22 04:11

pcorless


Below steps may help you.I hope you are getting this in RedHat OS.

  1. Copy required font files to \Java\jre6\lib\fonts\ directory of below build version.
  2. Set the Java & JRE to this build and test it.

    java version "1.6.0_15" Java(TM) SE Runtime Environment (build 1.6.0_15-b03) Java HotSpot(TM) Server VM (build 14.1-b02, mixed mode)

I anticipate your problem will solve.

like image 1
Anil Avatar answered Nov 15 '22 04:11

Anil