@@ -89,10 +89,9 @@ def _draw_device_front(self, drawing, device, start, end, text):
8989 )
9090 link .set_desc (self ._get_device_description (device ))
9191 link .add (drawing .rect (start , end , style = 'fill: #{}' .format (color ), class_ = 'slot' ))
92- hex_color = '#{}' .format (foreground_color (color ))
93- link .add (drawing .text (str (name ), insert = text , fill = hex_color ))
9492
9593 # Embed front device type image if one exists
94+ text_color = '#{}' .format (foreground_color (color ))
9695 if self .include_images and device .device_type .front_image :
9796 image = drawing .image (
9897 href = device .device_type .front_image .url ,
@@ -103,11 +102,14 @@ def _draw_device_front(self, drawing, device, start, end, text):
103102 image .fit (scale = 'slice' )
104103 link .add (image )
105104
105+ link .add (drawing .text (str (name ), insert = text , stroke = '#{}' .format (color ),
106+ stroke_width = '0.2em' , stroke_linejoin = 'round' , class_ = 'device-label' ))
107+ link .add (drawing .text (str (name ), insert = text , fill = text_color , class_ = 'device-label' ))
108+
106109 def _draw_device_rear (self , drawing , device , start , end , text ):
107110 rect = drawing .rect (start , end , class_ = "slot blocked" )
108111 rect .set_desc (self ._get_device_description (device ))
109112 drawing .add (rect )
110- drawing .add (drawing .text (str (device ), insert = text ))
111113
112114 # Embed rear device type image if one exists
113115 if self .include_images and device .device_type .rear_image :
@@ -120,6 +122,10 @@ def _draw_device_rear(self, drawing, device, start, end, text):
120122 image .fit (scale = 'slice' )
121123 drawing .add (image )
122124
125+ drawing .add (drawing .text (str (device ), insert = text , stroke = 'white' ,
126+ stroke_width = '0.2em' , stroke_linejoin = 'round' , class_ = 'device-label' ))
127+ drawing .add (drawing .text (str (device ), insert = text , class_ = 'device-label' ))
128+
123129 @staticmethod
124130 def _draw_empty (drawing , rack , start , end , text , id_ , face_id , class_ , reservation ):
125131 link = drawing .add (
0 commit comments