Open lrh3321 opened 7 months ago
--font.file
option could not help for png format output.Seems embed font file has no effect for github.com/kanrichan/resvg-go
.
I am having the same problem -- using the linux build of freeze from inside wsl2 on windows 11 -- trying to specify font.family
as "Source Code Pro", or setting font.file
as the path to the "SourceCodePro-Regular.ttf" file in my windows\fonts directory. Either way, I get a blank .PNG file. If I use "JetBrains Mono" for the font.family
, the file renders correctly (but with an undesirable font).
I am having the same problem -- using the linux build of freeze from inside wsl2 on windows 11 -- trying to specify
font.family
as "Source Code Pro", or settingfont.file
as the path to the "SourceCodePro-Regular.ttf" file in my windows\fonts directory. Either way, I get a blank .PNG file. If I use "JetBrains Mono" for thefont.family
, the file renders correctly (but with an undesirable font).
Same for me in Ubuntu 22.04
I'm getting this on mac as well. It looks like the font config is not actually considered on this line: https://github.com/charmbracelet/freeze/blob/578e9d05c3196241fa3c49ce857f9f4c8ae6a77b/png.go#L50
I've had a quick play to see if I can hard code another font file but its not working. Must be more at play here. I'll make do with default font for now as I don't have more time
Came here to say I’m having the same issue:
freeze css.css -t dracula --font.family 'Sarasa Term J Nerd Font' --font.size 16 -o css.png
This just outputs a PNG file with a background but no text.
Describe the bug
Output blank png image when use custom font family in windows
To Reproduce Steps to reproduce the behavior:
freeze -x "echo Something" --font.family "Microsoft YaHei" -o freeze.png
explorer freeze.png
Expected behavior
Got an blank image.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Load the default fonts dir may help this
https://github.com/charmbracelet/freeze/blob/80803ebd021ee31dacdf77dca2674d05b0c81b8b/png.go#L50-L57