Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: manually load font file or fonts dirs when use resvg-go #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lrh3321
Copy link

@lrh3321 lrh3321 commented Apr 18, 2024

fix #80

switch runtime.GOOS {
case "windows":
DefaultFontsDirectories = []string{filepath.Join(os.Getenv("windir"), "Fonts")}
case "linux":
Copy link
Contributor

@isabelroses isabelroses Apr 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not make this (the linux case) the default case then it should also be able to handle BSD systems too (at least in theory)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if librsvg was installed, it won't meet this case.it easy for linux / BSD systems user to install librsvg

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would be better to do this at build time, rather than runtime? I.e. have font_linux.go, font_darwin.go, font_windows.go files, with the //go:build directives.

@maaslalani
Copy link
Contributor

maaslalani commented Apr 22, 2024

Thank you for this PR, it's very much appreciated ❤️

@remino
Copy link

remino commented Aug 15, 2024

Appreciated, yet never merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output blank png image when use custom font family in windows
4 participants