SVG Font-family does not apply after convert to png(Splash screen)
See original GitHub issueDescription
Font ‘Poppins’ after conversion does not apply to the result PNG files: obj\Debug\net7.0-android\resizetizer\r\drawable (any folders)
I’m using the following SVG file:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="413.852" height="808.197" viewBox="0 0 413.852 808.197">
<defs>
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@800');
.st0{fill:#223F3B;}
.st1{fill:#5AC87A;}
</style>
<pattern id="pattern" x="0" y="0" width="30" height="31" viewBox="0 0 30 31" patternUnits="userSpaceOnUse" >
<rect x="0" y="0" width="30" height="31" fill="#ffffff"/>
<path d="M-12.627,0H-21.6a1.07,1.07,0,0,0-1.062,1.075A1.071,1.071,0,0,0-21.6,2.152h7.908v7.975A1.069,1.069,0,0,0-12.627,11.2a1.068,1.068,0,0,0,1.061-1.076V1.075A1.068,1.068,0,0,0-12.627,0" transform="translate(24.996 9.291)" fill="rgba(82,190,41,0.1)"/>
</pattern>
</defs>
<rect x="0" y="0" width="413.852" height="808.197" opacity="0.999" fill="url(#pattern)"/>
<g transform="translate(87.526 250) scale(1.5)">
<g id="Text" transform="translate(77.589 0)">
<text y="70" font-family="Poppins" font-size="15" fill="#404D3A" text-anchor="middle">Test message with font</text>
<text y="90" font-size="15" fill="#404D3A" text-anchor="middle">Test message without font</text>
</g>
</g>
</svg>
Steps to Reproduce
- Create a MAUI App solution
- Paste the following svg to existing splash.svg
- Change in proj file: <MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128"/> to <MauiSplashScreen Include="Resources\Splash\splash.svg"/>
- Clean bin and obj folders if build project previously
- Run on the Android 10 where full screen splash supported or see result png in folder: \obj\Debug\net7.0-android\resizetizer\r\drawable-xxxhdpi
- The result png and opened svg are not the same, font-family does not apply
Please note
- the same issue for iOS font do not apply after publish to test flight
- the same when I use @font-face { font-family: ‘PoppinsBoldBase64’; src: url('data:font/truetype;base64,AAEAA… and font-family=“PoppinsBoldBase64”
Link to public reproduction project repository
https://github.com/denhaandrei/BadSvgConverter.App
Version with bug
7.0.49
Last version that worked well
NOT work
Affected platforms
iOS, Android
Affected platform versions
I think all Android/IOS, because issue with convert svg
Did you find any workaround?
No response
Relevant log output
No response
Issue Analytics
- State:
- Created 2 months ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Font style of text in svg not propagating to png on download
I am generating an svg, with text, using D3.js for a user to download. Unfortunately, when an svg is downloaded, the font family...
Read more >Using Custom Fonts With SVG in an Image Tag
When we produce a PNG image, we use an <img> tag or a CSS background, and that's about it. It is dead simple...
Read more >png to .svg issue
Solved: When I try to convert a .png logo to a .svg with a transparent background, the logo looks black. It's in RGB...
Read more >Preserving font type in illustrator SVG file
The reason why the font does not render correctly to the actual font type is because, when the SVG is saved using the...
Read more >Why svg image font changes - General
Hi, I have created an svg images and imported into webflow. When viewing the published state ... It is an image not an...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is not directly maui issue. namely managed libraries used by
resizetizer
have issues converting some (complex) SVG images to PNG.Workaround would be to convert SVG to PNG using reliable converters.
original
! OK - github does not render font correctly
splash.svg
resizetizer
! OK - font
resizetizer-splash.png
Chrome browser - screenshot MacOSX
OK
inkscape
! OK - font
Online Converters
https://svgtopng.com/
OK
svgtopng.com-splash.png
https://cloudconvert.com/
! OK
cloudconvert.com-splash.png
https://convertio.co/svg-png/
! OK
convertio.co-splash.png
https://ezgif.com/svg-to-png
! OK
ezgif.com-splash.png
I work on collecting reported issues in MAUI repo, so I can open issues on GitHub in relevant repositories.
I understand you completely. There are expectations which are not fulfilled.
My suggestion is: please open issue in Svg.Net repo too (with svg that has issue and expected png output).
You re welcome. This is the reason we are here.
I understand. This must be fixed. Only the problem is where and how fast. Rewriting everything could cause more issues.
Thanks for the info. It was quite confusing when I saw several online converters having issues (similar incorrect output)