GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||
GeezerVison is showing github.com — Ensure non-ASCII characters are typeset correctly even if PS_CHAR_ENCODING is not 'ISOLatin1+' by seisman · Pull Request #3611 · GenericMappingTools/pygmt Conversation
|
| PS_CHAR_ENCODING=Standard+ | PS_CHAR_ENCODING=ISOLatin1+ |
|---|---|
![]() |
![]() |
Previously, we assumed the default PS_CHAR_ENCODING is ISOLatin1+ and didn't add --PS_CHAR_ENCODING=ISOLatin1+ if the text string contains non-ASCII characters in the ISOLatin1+ charset. This PR fixes the issue by always adding --PS_CHAR_ENCODING=<encoding> even if encoding is ISOLatin1+.
In 8c34683, the existing test test_text_nonascii is modified to show that setting PS_CHAR_ENCODING to Standard+ breaks the test (https://github.com/GenericMappingTools/pygmt/actions/runs/11800822308/job/32872646796?pr=3611). The fix is added in d9e5203.
Closes #2204.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
1ad9d70 to
a575805
Compare
a575805 to
8c34683
Compare
…ODING is not 'ISOLatin1+'
| Default PS_CHAR_ENCODING setting should not affect the result. | ||
| """ | ||
| fig = Figure() | ||
| if encoding == "Standard+": # Temporarily set the PS_CHAR_ENCODING to "Standard+". |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we should test the case that PS_CHAR_ENCODING is set to "Standard+" in a global "gmt.conf" file. However, it's technically difficult. Similar to the test test_gmt_compat_6_is_applied at
| def test_gmt_compat_6_is_applied(capsys): |
Generally we need to:
But the issue is that, after starting a new global session, we can't return the Figure instance for comparing images, because mpl_image_compare needs to call Figure.savefig which no longer works after the session is destroied.
So here we only test the case that PS_CHAR_ENCODING is changed in the middle of a script.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'll merge this PR in 24 hours. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Support non-ASCII characters in PyGMT arguments and text in Figure.text
There was an error while loading. Please reload this page.