Hello,
I will use com.lowagie.text.pdf.BaseFont "getWidths()" and have a
problem with Fonts!
FontFactory.registerDirectory("d:/");Font
font = FontFactory.getFont("LETTERGOTHIC
LT",
BaseFont.WINANSI,
BaseFont.EMBEDDED);
font= Font (id=44)
baseFont=
TrueTypeFont (id=26)
…
embedded=
true
encoding=
"Cp1252"
…
fileName=
"d:\lte50102.ttf"
fontName=
"LetterGothicLT"
…
forceWidthsOutput=
false
...
You see
it’s ok but the Font is cached and this is not what I want.
Therefore
I use the BaseFont.
To produce
the BaseFont I have this problem. For example:
BaseFont testfont = BaseFont.createFont("LETTERGOTHIC LT", BaseFont.WINANSI, BaseFont.EMBEDDED, false, null, null);
com.lowagie.text.DocumentException: Font 'LETTERGOTHIC LT' with 'Cp1252' is not
recognized.
I think, I
need the “cached” flag, because I use “getWidths()” from BaseFont,
therefore I
need a new Font.
I can copy
and so on
Font
com.lowagie.text.FontFactoryImp.getFont(String
fontname, String encoding, boolean embedded, float size, int style,
Color
color),
but this
is not my goal.
Is it possible
to extend the FontFactory with a “cached” flag or is there another
possibility?
Thanks in
advance
Thorben