@@ -42,7 +42,7 @@ def main():
4242 print ("No SVGs to check, ending script." )
4343 svg_err_msg = "Error checking SVGs: no SVGs to check. Might be caused by above issues."
4444 else :
45- svg_err_msg = check_svgs (svgs )
45+ svg_err_msg = check_svgs (svgs , filtered_icon )
4646
4747 err_msg = []
4848 if devicon_err_msg != []:
@@ -163,7 +163,7 @@ def check_devicon_object(icon: dict):
163163 return ""
164164
165165
166- def check_svgs (svg_file_paths : List [Path ]):
166+ def check_svgs (svg_file_paths : List [Path ], devicon_object : dict ):
167167 """
168168 Check the width, height, viewBox and style of each svgs passed in.
169169 The viewBox must be '0 0 128 128'.
@@ -195,10 +195,11 @@ def check_svgs(svg_file_paths: List[Path]):
195195 err_msg .append ("- 'viewBox' is not '0 0 128 128' -> Set it or scale the file using https://www.iloveimg.com/resize-image/resize-svg." )
196196
197197 # goes through all elems and check for strokes
198- for child in tree .iter ():
199- if child .get ("stroke" ) != None :
200- err_msg .append ("- SVG contains `stroke` property. This will get ignored by Icomoon. Please convert them to fills." )
201- break
198+ if util .is_svg_in_font_attribute (svg_path , devicon_object ):
199+ for child in tree .iter ():
200+ if child .get ("stroke" ) != None :
201+ err_msg .append ("- SVG contains `stroke` property. This will get ignored by Icomoon. Please convert them to fills." )
202+ break
202203
203204 if len (err_msg ) > 1 :
204205 err_msgs .append ("\n " .join (err_msg ))
0 commit comments