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

Multiple spaces are stripped when using text API #210

Open
jjcohen opened this issue Oct 23, 2019 · 1 comment
Open

Multiple spaces are stripped when using text API #210

jjcohen opened this issue Oct 23, 2019 · 1 comment

Comments

@jjcohen
Copy link

jjcohen commented Oct 23, 2019

Hi I recently set up a Papirus and Raspberry Pi 3 (not used for anything else, fresh install etc), both of which I bought a while back.
Loving the display it's great however it seems that multiple spaces are swallowed by the PapirusTextPos. For instance "hello word" would be printed as "hello world".

  • I did the manual install as the automatic install did not work for me.
  • This is the version of the git repo I have locally : c6da9c1
  • The following is the script I ran:
from papirus import PapirusTextPos

text = PapirusTextPos()

text.AddText("hello                            world", 10, 10, Id="Start" ) 
  • Here is what is displayed on the physical device:
    20191023_084528
@tvoverbeek
Copy link
Contributor

Yes, the text is split into words to calculate how many words of the text fit on a single line before
starting a new line.
See the code of the addToImageText function around line 112 in textpos.py (https://github.com/PiSupply/PaPiRus/blob/master/papirus/textpos.py).
If you really need that much space between words, use two separate calls to AddText with the same y but different x coordinates.

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