Skip to content

Commit d65ebe2

Browse files
authored
Update Display_LVGL_Font.py
1 parent 632b3f5 commit d65ebe2

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Fruit_Jam/CircuitPython_DVI_Video/Display_LVGL_Font.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
# Display an LVGL (.bin) font on a CircuitPython board and
66
# 640x480 DVI display. Unknown characters will be "."
77
#
8+
# pylint: disable=broad-except, bare-except
9+
10+
import gc
811
import displayio
912
import supervisor
1013
from adafruit_bitmap_font import bitmap_font
1114
from adafruit_display_text import label
12-
import gc
1315
from adafruit_fruitjam.peripherals import request_display_config
1416

1517
# Use the easy library call to set the resolution
@@ -25,7 +27,7 @@
2527
# Font loading with error handling and diagnostics
2628
font_file = "fonts/CP437_16h.bin"
2729
try:
28-
font = bitmap_font.load_font(font_file)
30+
font = bitmap_font.load_font(font_file) # pylint: disable=redefined-outer-name
2931
print(f"Font loaded: {font_file}")
3032
print(f"Memory after font load: {gc.mem_free()}")
3133

@@ -73,12 +75,12 @@
7375
current_y = char_height
7476
current_line_start = 0
7577

76-
def create_char_label(font, char, x, y):
78+
def create_char_label(font, chr, x, y):
7779
"""Helper function to create character labels with error handling"""
7880
try:
79-
return label.Label(font, text=char, color=0xFFFFFF, x=x, y=y)
81+
return label.Label(font, text=chr, color=0xFFFFFF, x=x, y=y)
8082
except Exception as e:
81-
print(f"Error creating label for '{char}': {e}")
83+
print(f"Error creating label for '{chr}': {e}")
8284
return None
8385

8486
# Add first line number
@@ -147,7 +149,8 @@ def create_char_label(font, char, x, y):
147149

148150
# Progress indicator for debugging
149151
if char_code % 32 == 0:
150-
print(f"Processed up to character {char_code}, memory: {gc.mem_free()}")
152+
print(f"Processed up to character {char_code}, memory: {gc.mem_free()}") /
153+
# pylint: disable=f-string-without-interpolation
151154

152155
print(f"\nCompleted character display:")
153156
print(f"Found {displayed_count - skipped_count} characters with glyphs")

0 commit comments

Comments
 (0)