We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@fogleman,
I have noticed many examples from "fogleman/gg" save it output image file to "out.png".
That can be tricky!
I would like to suggest two additional lines, who it'll save the PNG with the same name of executable. Changing the extension only!
outPNG := strings.ReplaceAll(filepath.Base(os.Args[0]), filepath.Ext(os.Args[0]), ".png") dc.SavePNG(outPNG)
I have the habit of build all the samples and test it one at the time. But this litlte folks overwrite the old output file.
The text was updated successfully, but these errors were encountered:
I also noticed you are using a Apple computer with Mac OSX. So you hard coded the font file path.
/Library/Fonts/Arial Bold.ttf
/Library/Fonts/Arial.ttf
I suggest you get a free truetype font and include it into the repository. Than your code can localy load it and use!
Otherwise your code will compile on Linux and Windows, but it'll runtime panic!
panic: open /Library/Fonts/Arial.ttf: The system cannot find the path specified.
Sorry, something went wrong.
this has been fixed in "my" fork of gg:
gg
No branches or pull requests
@fogleman,
I have noticed many examples from "fogleman/gg" save it output image file to "out.png".
That can be tricky!
I would like to suggest two additional lines, who it'll save the PNG with the same name of executable. Changing the extension only!
I have the habit of build all the samples and test it one at the time.
But this litlte folks overwrite the old output file.
The text was updated successfully, but these errors were encountered: