-
Notifications
You must be signed in to change notification settings - Fork 747
Closed
Labels
A-formattingarea: changes to formattersarea: changes to formattersS-minorseverity: minorseverity: minorT-bugtype: a bugtype: a bugX-importedimported from Bitbucketimported from Bitbucket
Milestone
Description
(Original issue 1509 created by hhsprings on 2019-04-26T01:11:55.667733+00:00)
Note that I have reproduced this problem only on Windows (Japanese edition).
In the case where the lexer is other than "text", the drawing position of tokens other than the first one appearing on the line is wrong.
If you change the passing text to getsize in the "get_char_size" method of class FontManager from "M" to "a", it will draw in the correct position, but I can't explain what's happened. Apart from this mysterious fix method, I think that in the first place the approach adopted does not work when it contains kanji characters.
Maybe I think this is the conclusion:
- Don't multiply the font size by the character position.
- Use the size of all text before the drawing target token in the line.
used versions:
- python 2.7, 3.5
- pygments 2.3.1
- pillow 4.2.1
- Windows 7
Metadata
Metadata
Assignees
Labels
A-formattingarea: changes to formattersarea: changes to formattersS-minorseverity: minorseverity: minorT-bugtype: a bugtype: a bugX-importedimported from Bitbucketimported from Bitbucket