Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Character support in text2png #3

Open
graeham opened this issue Aug 26, 2015 · 2 comments
Open

Character support in text2png #3

graeham opened this issue Aug 26, 2015 · 2 comments

Comments

@graeham
Copy link

graeham commented Aug 26, 2015

I've found the Matplotlib libraries seem to only support ascii. Non-supported characters result in a rectangular box on the output.

Also, new lines passed from an html form (Firefox on Linux) result in '\r\n' in the string passed stl_tools, where the \r isn't recognized as a character, and a rectangular box results in the output png.

Consider blocking non-supported characters (I adapted my local code to ignore them) or use a library which supports more characters?

Thanks for the very useful package!

@thearn
Copy link
Owner

thearn commented Aug 27, 2015

Hmm, good catch. Definitely a matplotlib limitation.

some_string.encode('ascii', 'ignore')

might do the trick, but haven't tested that. I'll have to experiment.
Thanks for the feedback!

@graeham
Copy link
Author

graeham commented Aug 28, 2015

I believe I ended up implementing a similar function up-stream when my
python code read input from the html form.

Not a major issue, just thought I'd point it out in case you wanted to fix
it and also to help anyone else who runs into this!

On Thu, Aug 27, 2015 at 6:46 PM, Tristan Hearn [email protected]
wrote:

Hmm, good catch. Definitely a matplotlib limitation.

some_string.encode('ascii', 'ignore')

might do the trick, but haven't tested that. I'll have to experiment.
Thanks for the feedback!


Reply to this email directly or view it on GitHub
#3 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants