Menu

#143 Problems with width of chars like Á ã, etc

closed-works-for-me
wxpdfdoc (23)
5
2015-06-10
2012-04-30
No

I am having problems with chars with accents making the rendering of text containing these chars compressed....
I have found the solution for this too...
In line 130 of file pdffontdatacore.cpp needs a (unsigned char) for correct mapping of table...

for (ch = t.begin(); ch != t.end(); ++ch)
{
- w += (*m_cw)[*ch];
+ w += (*m_cw)[(unsigned char)*ch];
}

Thanks
Maycon

Discussion

  • Ulrich Telle

    Ulrich Telle - 2012-04-30

    Could you please tell which version and which build of wxWidgets you are using on which platform with which compiler?

    I guess you are using an ANSI build since *ch returns a wxChar which is unsigned in Unicode build but potentially signed in ANSI build.

    Since the key type of the underlying hash map m_cw is an unsigned integer type I would have expected that the conversion to unsigned would take place implicitly. I have to further investigate the issue. (Using unsigned char is not a general solution as in Unicode build wxChar is a wide character.)

    For applications dealing with non-ASCII characters I would strongly recommend to use the Unicode build of wxWidgets.

     
  • Ulrich Telle

    Ulrich Telle - 2012-04-30
    • assigned_to: nobody --> utelle
     
  • Ulrich Telle

    Ulrich Telle - 2012-04-30

    In January I made a change to pdffontdatacore.cpp to fix a similar problem surfacing on OS X. Please get the latest version of the file from the wxCode SVN repository and check whether this solves your problem.

     
  • Ulrich Telle

    Ulrich Telle - 2015-06-10
    • status: open --> closed-works-for-me
     

Log in to post a comment.