On 2/14/07, John Hunter <[EMAIL PROTECTED]> wrote: > On 2/14/07, Paul Barrett <[EMAIL PROTECTED]> wrote: > > > I still feel this way, but maybe I should change my tune and let the > > changes go in. > > What do you think about the comments made earlier in this thread:
My first reply: I suggest that this patch not be applied, since this was the intended behavior when the font manager was implemented. The standard behavior for indicating a missing character is to print a square. In addition, if a space is printed, how will you know when the formatting is correct or not. The unanticipated space could mean font is missing that character, or the layout manager has a bug? and second reply: If my memory ser ves me correctly - or if the implementation has changed over the past few years - get_charmap() is a wrapper on the FreeType method. FreeType had no reverse mapping and creating one may have caused problems later. I prefer the second alternative. If FreeType now has a reverse mapping, then by all means create a wrapper for it. If not, then you will need to take some care that get_rcharmap is reasonably future proof, so that it does cause maintenance problem later on. > > FT2Font.get_charmap() returns a mapping from glyph index to character code. > > This looks like a very bad design decision to me, because several character > > codes can correspond to one glyph. For example, in Times New Roman, both > > 0x32 > > (space) and 0xA0 (nbsp) are mapped to glyph index 3. Of course, the first > > one > > gets lost in get_charmap(). > > I don't remember why we did it this way originally, or if was you or I > who did it, but if it is correct that the mapping is sometimes many > codes point to one one glyph index, but there each glyph index must > point to a single character code (the latter must be correct, right?) > then reversing it seems to be the right course. But it's been a long > time since I delved into freetype internals ... I think I did it. At the time the reverse mapping seemed the best approach, since this ultimately is what the code demanded. (I guess my memory has failed me!) We also did not have any examples of the many to one mapping. As you state, this has now changed and the latter must be correct. This now explains the FreeType implementation. -- Paul ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel