Comments (4)
Thanks for the detailed description of the issue!
As you suggested, itβs likely an issue with the anchored_position
or maybe the bounding_box
calculation of a blank string. I will check it out and get back with you.
from adafruit_circuitpython_display_text.
@CedarGroveStudios I tested using the latest version and it works ok for me. I think you are using a slightly older version of the label
.
Can you please pull the latest adafruit_display_text\label
library and let me know your results? Here is the circuitpython.org page with the latest library bundle.
Here's what I found:
- I used the 8/26 library bundle that you specified and it worked correctly for me. It worked both for
label.mpy
from the bundle andlabel.py
from the latest library here. - I went back to the 8/11 version of the library bundle and the results match what you showed above. Here is the older library version I used with the label.py file.
1. Results with the 8/26 library bundle - I think this is working right
Here is the output I get from running your code on the latest label.py
library. I think this is the result that you should get.
adress: (12, 14)
TEST 0: pre-load Label text, change text later
x = 12 y= 14
x = 12 y= 14
TEST 1: no Label text, change text later
x = 12 y= 14
x = 12 y= 14
TEST 2: no Label text, no text in change
x = 12 y= 14
x = 12 y= 14
TEST 3: pre-load Label text, no text in change
x = 12 y= 14
x = 12 y= 14
2. Results with the 8/11 library bundle specified above - This matches the results you showed
adress: (12, 14)
TEST 0: pre-load Label text, change text later
x = 12 y= 14
x = 12 y= 14
TEST 1: no Label text, change text later
x = 12 y= 14
x = 12 y= 21
TEST 2: no Label text, no text in change
x = 12 y= 14
x = 12 y= 14
TEST 3: pre-load Label text, no text in change
x = 12 y= 14
x = 12 y= 7
The test code I used
Here is the code that I ran. The only change I made was import terminalio
at the top:
import terminalio
from adafruit_display_text.label import Label
font_0 = terminalio.FONT # Internal font
print('CircuitPython 5.x Library Bundle 20210-08-26')
address = (12, 14)
print('adress:', address)
print()
print('TEST 0: pre-load Label text, change text later')
test_0 = Label(font_0, text='0', color=0xFFFFFF, max_glyphs=1)
test_0.x, test_0.y = address
print('x =', test_0.x, 'y=', test_0.y)
test_0.text = '1'
print('x =', test_0.x, 'y=', test_0.y)
print()
print('TEST 1: no Label text, change text later')
test_1 = Label(font_0, text='', color=0xFFFFFF, max_glyphs=1)
test_1.x, test_1.y = address
print('x =', test_1.x, 'y=', test_1.y)
test_1.text = '1'
print('x =', test_1.x, 'y=', test_1.y)
print()
print('TEST 2: no Label text, no text in change')
test_2 = Label(font_0, text='', color=0xFFFFFF, max_glyphs=1)
test_2.x, test_2.y = address
print('x =', test_2.x, 'y=', test_2.y)
test_2.text = ''
print('x =', test_2.x, 'y=', test_2.y)
print()
print('TEST 3: pre-load Label text, no text in change')
test_3 = Label(font_0, text='0', color=0xFFFFFF, max_glyphs=1)
test_3.x, test_3.y = address
print('x =', test_3.x, 'y=', test_3.y)
test_3.text = ''
print('x =', test_3.x, 'y=', test_3.y)
while True:
pass
from adafruit_circuitpython_display_text.
Thank you for your speedy response @kmatch98 ! I was able to confirm that 8/26 bundle release had indeed provided the fix. My always reliable automatic library update routine skipped over adafruit_display_text
and a couple of other libraries during its latest execution. Sorry about the fire drill.
from adafruit_circuitpython_display_text.
No worries, Iβm just glad we pre-emptively solved the issue. Cheers!
from adafruit_circuitpython_display_text.
Related Issues (20)
- Spaces are deleted when word-wrapping HOT 1
- Updates to text are inefficient for special case of same length and width text HOT 3
- bitmap_label losing direction HOT 6
- Suppress warnings in bitmap_label HOT 1
- Use `fontio.FontProtocol` for type annotations
- Label can take Tuple[int, int, int] for color HOT 1
- wrap_text_to_pixels() cannot handle Windows line endings HOT 1
- bitmap_label flicker HOT 1
- Unable to update scrolling_label text outside constructor HOT 2
- Exception with multiple consecutive newlines in bitmap label
- label.Label padding is wrong when using DWR or UPR HOT 5
- button simpletest throws error on PyPortal Titano HOT 2
- bitmap_label errors if no bitmaptools module present
- ValueError from negatives on first character
- Convert `.show()` to `.root_group =` for CircuitPython 9
- Program stops without any error when importing the library HOT 4
- bitmap label cuts off part of text HOT 3
- Add error handling for misspelled kwargs in adafruit_display_text.label HOT 4
- Feature Request: wrap_text_to_pixels truncate argument
- Property `background_tight` not working for `bitmap_label.Label`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adafruit_circuitpython_display_text.