Closed GrahamHannington closed 3 years ago
A snippet from the input SVG file (created by CorelDRAW 2019):
<defs> <style type="text/css"> <![CDATA[ /* ... */ .fnt2 {font-weight:normal;font-size:141.06px;font-family:'IBM Plex Mono'} .fnt0 {font-weight:normal;font-size:141.06px;font-family:'IBM Plex Sans'} .fnt5 {font-weight:bold;font-size:141.06px;font-family:'IBM Plex Mono'} .fnt1 {font-weight:bold;font-size:141.06px;font-family:'IBM Plex Sans'} .fnt3 {font-style:italic;font-weight:normal;font-size:141.06px;font-family:'IBM Plex Mono'} .fnt4 {font-style:italic;font-weight:normal;font-size:141.06px;font-family:'IBM Plex Sans'} ]]> </style> </defs>
svg-buddy 1.2.2 reports "No fonts detected".
svg-buddy
After looking at the relevant regex in SvgFontDetector.kt, I can see why:
SvgFontDetector.kt
val fonts1 = detectusedFontsWithRegex(inputSvgString, Pattern.compile("font-family:(.*?);"))
My input SVG is missing the expected trailing semicolon after font-family:.
font-family:
Sure enough, after I edited the input SVG file and appended the missing semicolons, svg-buddy detected the fonts.
For some thoughts on those semicolons, see the Stack Overflow question "Leaving out the last semicolon of a CSS block".
Thank you for reporting this issue. I just released version 1.2.3 containing the fix. :-)
You're welcome. Thank you for svg-buddy!
A snippet from the input SVG file (created by CorelDRAW 2019):
svg-buddy
1.2.2 reports "No fonts detected".After looking at the relevant regex in
SvgFontDetector.kt
, I can see why:My input SVG is missing the expected trailing semicolon after
font-family:
.Sure enough, after I edited the input SVG file and appended the missing semicolons,
svg-buddy
detected the fonts.For some thoughts on those semicolons, see the Stack Overflow question "Leaving out the last semicolon of a CSS block".