@@ -100,6 +100,11 @@ def __init__(
100
100
)
101
101
102
102
def _add_outline (self ):
103
+ """
104
+ Blit the outline into the labels Bitmap. We will stamp self._stamp_source for each
105
+ pixel of the foreground color but skip the foreground color when we blit.
106
+ :return: None
107
+ """
103
108
if hasattr (self , "_stamp_source" ):
104
109
for y in range (self .bitmap .height ):
105
110
for x in range (self .bitmap .width ):
@@ -119,12 +124,6 @@ def _add_outline(self):
119
124
"Try using either larger padding sizes, or smaller outline_size."
120
125
) from value_error
121
126
122
- # bitmaptools.blit(bitmap, stamp_source, x - size, y - size)
123
- # for y_loc in range(-size, size+1):
124
- # for x_loc in range(-size, size+1):
125
- # if bitmap[x+x_loc, y+y_loc] != target_color_index:
126
- # bitmap[x + x_loc, y + y_loc] = outline_color_index
127
-
128
127
def _place_text (
129
128
self ,
130
129
bitmap : Bitmap ,
@@ -136,6 +135,16 @@ def _place_text(
136
135
# when copying glyph bitmaps (this is important for slanted text
137
136
# where rectangular glyph boxes overlap)
138
137
) -> Tuple [int , int , int , int ]:
138
+ """
139
+ Copy the glpyphs that represent the value of the string into the labels Bitmap.
140
+ :param bitmap: The bitmap to place text into
141
+ :param text: The text to render
142
+ :param font: The font to render the text in
143
+ :param xposition: x location of the starting point within the bitmap
144
+ :param yposition: y location of the starting point within the bitmap
145
+ :param skip_index: Color index to skip during rendering instead of covering up
146
+ :return Tuple bounding_box: tuple with x, y, width, height values of the bitmap
147
+ """
139
148
parent_result = super ()._place_text (
140
149
bitmap , text , font , xposition , yposition , skip_index = skip_index
141
150
)
0 commit comments