Fix incorrect length of UTF-8 string for pango layout #393
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I believe this is also related to GiovineItalia/Gadfly.jl#1410.
before
Note that the first case complained about a clipped string array, but still got a correct width. The length of UTF-8 string array for
"α"
supposed to be 2 ("\xce\xb1"
), butpango_text_extents
internally used a length of Julia String which was 1 for this.The second case seemed working fine with no complaints, but due to spurious string length, only the first letter was accounted for layout. That's why we had same widths for them which are not we'd expect.
after
Now we no longer have pango warning and get correct widths for the both cases.