Hi, problem is in method PdfFontMetricsFreetype::GetWidthArray when using Windows-1250 encoding or any other diffrence encoding. For example lettr 'ě' has code 236 in windows-1250 but the same code in latin1 has 'ì' which is loaded by method FT_Load_Char in GetWidthArray, so wrong width is inserted to array. In my patch is loaded unicode value of character from encoding object and according to glyph ID (which is not unicode neither ASCII value) correct widht is loaded. PDF file without patch: https://file.bukova.info/f/b4ce036838/?raw=1 PDF file with patch: https://file.bukova.info/f/a752893bce/?raw=1 It was to big for attachement so i have upload it to my server.
Regards J. Rokos On Wed, May 4, 2016 at 7:00 PM, zyx <z...@litepdf.cz> wrote: > On Fri, 2016-04-29 at 15:22 +0200, Josef Rokos wrote: >> in attachement is patch for correct character spacing when using >> TrueType fonts. Method PdfFontSimple::Init has generated array of >> widths but for first 255 glyphs in font regardless of the actual >> glyph >> which depends on encoding. So there was the same issue as in Base14 >> Type1 fonts - characters with accent had incorrect spacing. > > Hi, > thanks for the patch. Maybe I read the code incorrectly, thus please > correct me if I'm wrong, but it seems to me that the only changes you > did were: > a) place GetWidthArray() inline into PdfFontSimple::Init() > b) forced the widths array to start with a space (ASCII 32) > c) made the widths array not referenced by a reference > > Otherwise the arrays should be the same, if I read the code properly. > Bye, > zyx > > -- > http://www.litePDF.cz i...@litepdf.cz > > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > _______________________________________________ > Podofo-users mailing list > Podofo-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/podofo-users ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users