Re: [Podofo-users] String bounding box
> > > 1. I would need to know the horizontal displacement of a glyph and I am > using GetGlyphWidth(), if that is correct what about the vertical > displacement? > If I am not wrong fonts in pdf have defined only widths. But I guess height could be in font file or can be calculated from glyph vector representation. Would not be enough to use font size as general height? > 2. What is the correct way to determine, given the PdfString, the > GlyphId(s) contained within it ? > > If you mean that you have PdfString with some text for example obtained in this way from utf8: PdfString text(reinterpret_cast("Abc")); And you have instance of PdfEncoding and PdfFont then in order to get glyphs can be called PdfEncoding::ConvertToEncoding( const PdfString & rString, const PdfFont* pFont ) This is used in PdfFont::WriteStringToStream to generate hex encoded parameter for Tj operator and is used for example in PdfPainter::DrawText. But using PdfEncoding and PdfFont loaded from pdf has still some bugs: https://sourceforge.net/p/podofo/mailman/message/36484599/ https://sourceforge.net/p/podofo/mailman/message/36488037/ > Thanks, > Pietro. > > > > > > > ___ > Podofo-users mailing list > Podofo-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/podofo-users > ___ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users
[Podofo-users] String bounding box
Hi all, I'd like to compute the bounding box of a given string part of a text drawing instruction, such as TJ or similar. I've started writing a draft for it but I've stopped halfway through as I am unsure if PoDoFo implements such a thing off the shelf. Does it? While writing a very rudimentary implementation of the "Text Space Details" computation as outlined in the PDF Reference two questions came to my mind: 1. I would need to know the horizontal displacement of a glyph and I am using GetGlyphWidth(), if that is correct what about the vertical displacement? 2. What is the correct way to determine, given the PdfString, the GlyphId(s) contained within it ? Thanks, Pietro. ___ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users