Re: [Podofo-users] Justify text

2018-03-13 Thread Matthew Brincke
Hello Luis, hello all,
> On 13 March 2018 at 00:49 Luis Otavio  wrote: 
> 
> 
> Since PoDoFo seems to lack the ability to print multi line text into the 
> Justified format, and I am a newbie on PoDoFo 
> 
> Id like the help of you guys to get a few information 
> 
... snip ... 
> My questions are: 
> How do I get the length of a word in PDF units, or do i need to do it Glyph 
> by glyph? 
> Is there a better way to do that? 
as the PoDoFo method PdfPainter::DrawMultilineText() supports only left- and 
right-
aligned  as well as centered text drawing, PdfFontMetrics::StringWidth() can be
used (get the font metrics from a font by PdfFont::GetFontMetrics()) to have the
width of a string calculated (be wary of those overloads taking const char*, the
encoding they expect is undocumented). However, this method mostly just sums up
the widths of the characters, only processing spaces as special, so kerning of 
character pairs/triplets is not taken into account. I hope this helps you 
enough.

> 
> 
> -- 
> 
> Luis Otavio 

Best regards, mabri

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] Justify text

2018-03-12 Thread Luis Otavio
Since PoDoFo seems to lack the ability to print multi line text into the
Justified format, and I am a newbie on PoDoFo

Id like the help of you guys to get a few information

my idea is to get the length of each word and process it in a loop printing
word by word, the idea is to also store in the string the
commands to apply bold italic and underline before and after the characters
once a character is near the end of the line it will write the
'-' and start a new line ill need to adjust the space of the space between
words only on the last character if necessary.
My questions are:
How do I get the length of a word in PDF units, or do i need to do it Glyph
by glyph?
Is there a better way to do that?

-- 
Luis Otavio
8148-0832
3331-5908
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users