[poppler] Vertical or horizontal writing?

mpsuzuki at hiroshima-u.ac.jp mpsuzuki at hiroshima-u.ac.jp
Mon Jul 26 18:32:45 PDT 2010


Dear Albert,

On Mon, 26 Jul 2010 20:15:33 +0100
Albert Astals Cid <aacid at kde.org> wrote:

>A Dilluns, 26 de juliol de 2010, mpsuzuki at hiroshima-u.ac.jp va escriure:
>> Hi,
>> 
>> Attached is a draft patch to do:
>> 
>> 1) extend poppler's FontInfo object to hold writing mode info.
>> 
>> 2) extend poppler-qt4's FontInfo object to provide an API to
>>    return writing mode info copied from poppler's FontInfo.
>> 
>> 3) extend qt4/tests/poppler-fonts to show writing mode info.
>> 
>> Also I attached a sample PDF including vertical/horizontal
>> Japanese text, generated by MS Word + Adobe Acrobat.
>> poppler-fonts detects the writing mode aslike:
>> 
>> $ ./qt4/tests/poppler-fonts vert-horiz-ipa-std.pdf
>> name                                 type         emb sub font file wmode
>> ------------------------------------ ------------ --- --- --------- -----
>> LDGIFP+IPAMincho                     CID TrueType      yes yes  Vert
>> LDGIFP+IPAMincho                     CID TrueType      yes yes  Hori
>> 
>> I think the diff for poppler-fonts.cpp shows how to use the
>> extended API. Cobra, please check if the extended API can help
>> your application.
>
>Good work :-)

Great thank you for comment. I was worrying how I can
ask for your official adoption of such feature.
Just I've drafted the patch for glib and cpp bindings
too, and I'm waiting Cobra's evaluation.

>But i'd prefer you to use an enum instead of an int, at least on the poppler-
>qt4 level, can you do the appropiate changes?

OK, I will improve, of course. But please let me ask
your comment about the appropriate design.

When CMap->parse() parses CMap resource, it can load any
integer value to CMap->wMode. And, The type of the return
value from CMap->getWMode() (and GfxFont->getWMode()) is
int.

In FontInfo class, should I restrict the writing mode
enumeration value to 2 correct values: 0/horizontal or
1/vertical?

Or, it is better to have 3 values: 0/horizontal, 1/vertical
and -1 (or 2, or anything else) for broken writing mode
info?

Regards,
mpsuzuki


More information about the poppler mailing list