Shujaat,

just to underline what Leonard and Kevin said...

Shujaat wrote
> 1.       FullFontName is a 2D array, not a string. I can overcome this
> issue by always reading FullFontName[0][3] for now.

This attribute (at least in Java) is documented as "If it is a True Type
font each array element will have {Platform ID, Platform Encoding ID,
Language ID, font name}. The interpretation of this values can be found in
the Open Type specification, chapter 2, in the 'name' table. For the other
fonts the array has a single element with {"", "", "", font name}."

Shujaat wrote
> 2.       It contains "CJFLDK+" string before the font name. I need to know
> if this is some constant or what. Couldn't find any reference in the code
> or on the Internet. Should I simply trim that?

This prefix is documented in the PDF specification for Type 1 and TrueType
fonts (9.6.4 "Font Subsets"): "For a font subset, the PostScript name of the
font — the value of the font’s BaseFont entry and the font descriptor’s
FontName entry — shall begin with a tag followed by a plus sign (+). The tag
shall consist of exactly six uppercase letters; the choice of letters is
arbitrary, but different subsets in the same PDF file shall have different
tags."

Shujaat wrote
> 3.       It also concatenates font style with the font name. For example,
> my machine has only Calibri font installed, but the FullFontName shows it
> like "Calibri-Bold". This is also simple to fix if it will always return
> font style with the font name, separated by dash. This will also solve the
> issue of not having any Style property.

Are you sure your machine has only one font Calibri installed? The Windows
I'm working on has:

10.06.2009  22:43           811.052 calibri.ttf
10.06.2009  22:43           848.720 calibrib.ttf
10.06.2009  22:43           853.348 calibrii.ttf
10.06.2009  22:43           899.560 calibriz.ttf

i.e. normal Calibri, bold Calibri, italics Calibri, and bold italics
Calibri,

You should be aware that "XXX-Bold" in general is not "XXX" stretched to
appear bold but is instead a completely separate font. It may be created
from the same font drawing commands with a slightly different
parametrization but it also be created from a completely different set of
such commands.

Shujaat wrote
> 4.       I also need to know the font size in points. I couldn't a
> property for that.

This indeed is missing. On the other hand it is not easy to return as the
actually given font has a size but its graphical display then is resized by
the transformation matrix. Thus, a font appearing as a 10pt font may
actually be a 5pt one stretched by a factor of 2. The font at 10pt and the
font at 5pt stretched by 2 are not necessarily identical, though. So, what
should be returned?

Additionally you can do some funny things with the transformation matrix.
You can make normal fonts appear somewhat bolded, slanted, densified, ... To
analyze this aspect you do need to look at the current transformation
matrix.

Therefore, read the specifications and be prepared that typesetting is not
as easy as Word processors make it appear, and more complex than text in
System.Drawing is.

Regards,   Michael



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/PdfContentStreamProcessor-not-handling-TJ-operator-correctly-maybe-tp4656117p4656385.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to