Skip to content

Commit d451764

Browse files
author
Margaret Matocha
committed
added glyphs and moved variable outside of memory check
1 parent b0d1d59 commit d451764

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/display_text_label_vs_bitmap_label_comparison.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@
9696
if preload_glyphs and not use_builtinfont:
9797

9898
# identify the glyphs to load into memory -> increases rendering speed
99-
glyphs = b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-,.:?! "
99+
glyphs = (
100+
b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/-_,.:?!'\n "
101+
)
100102

101103
print("loading glyphs...")
102104
fontToUse.load_glyphs(glyphs)
@@ -108,6 +110,7 @@
108110
# create group
109111

110112
long_string = "The purple snake\nbrings python fun\nto everyone."
113+
label2_padding = 10
111114

112115
#####
113116
# Create the "bitmap_label.py" versions of the text labels.
@@ -130,7 +133,7 @@
130133
anchor_point=(0.0, 0),
131134
anchored_position=(10, 60),
132135
)
133-
label2_padding = 10
136+
134137
bmap_label2 = bitmap_label.Label(
135138
font=fontToUse,
136139
text=long_string,

0 commit comments

Comments
 (0)