Hi,

> What about fixing PdfFontMetricsFreetype::GetWidthArray() instead? It
> would make more sense, I believe, and fix more (future) issues at once

Yes you are right. In attached patch is refactored method
GetWidthArray(). I added pointer to encoding as default parameter
equals NULL. If it is not passed widths are generated "old" way. I
have refactored width array generation in PdfFontMetricsBase14 too.
Width array is now generated for TrueType also Base 14 Type1 fonts in
the same manner.
In PdfFontMetricsFreetype is fixed formatting (tabs converted to spaces).

Regards
J. Rokos

On Sun, May 8, 2016 at 7:23 PM, zyx <z...@litepdf.cz> wrote:
> On Fri, 2016-05-06 at 12:20 +0000, Matthew Brincke wrote:
>> > a) place GetWidthArray() inline into PdfFontSimple::Init()
>>
>> your (zyx') point a) is wrong, because (as Josef has posted already) the
>> method PdfFontMetricsFreetype::GetWidthArray calls FT_Load_Char which
>> uses a different encoding from what he'd like to use, and in his patch
>> the index into the Widths array is first transformed according to the
>> encoding of the font object, which isn't done without the patch. AFAIK
>> (guessing here ;-) ) FT_Load_Glyph called by the method the patch calls,
>>
>> PdfFontMetricsFreetype::GetGlyphWidth( int nGlyphId ), doesn't have this
>> problem.
>
>         Hi,
> aha, I see, I overlooked that GetGlyphWidth() uses FT_Load_Glyph(),
> while GetWidthArray() calls FT_Load_Char() instead. My fault, I'm sorry
> for that.
>
> What about fixing PdfFontMetricsFreetype::GetWidthArray() instead? It
> would make more sense, I believe, and fix more (future) issues at once.
>         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

Attachment: width.patch
Description: Binary data

------------------------------------------------------------------------------
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

Reply via email to