Quoting Sergio Lopez Rodriguez <[EMAIL PROTECTED]>:

> As we say here, "clearer, water", I mean ur explanation is perfect, so if i
> do
> 
>             BaseFont helvetica = BaseFont.createFont(BaseFont.HELVETICA,
> BaseFont.CP1252, BaseFont.EMBEDDED);
> 
> I'll have to crate the corresponding helveticaBold, right? and it will be
> embedded ...

That is would you should do:
> BaseFont helvetica = BaseFont.createFont(BaseFont.HELVETICA_BOLD,
> BaseFont.CP1252, BaseFont.EMBEDDED);

But in this case the font will NOT BE EMBEDDED, because in class
baseFont, the embedded parameter is set to false for built-in fonts
and CJK fonts.

see line 334-335 of BaseFont.java:
334: if (isBuiltinFonts14 || isCJKFont)
335:            embedded = false;

This is because iText doesn't have the data needed to embed these fonts.
YOU have to provide this data in the form of a path to a TTF file on
your system. For instance:
> BaseFont helvetica = BaseFont.createFont("C:\\winnt\\fonts\\helveticab.ttf",
> BaseFont.CP1252, BaseFont.EMBEDDED);

(Remark: on my system I don't have a ttf-file for helvetica, so I should
look for a ttf on the net somewhere. Maybe this will also be the case
for you.)

kind regards,
Bruno

_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to