-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fixed web export of SVG and PNG #683
Conversation
Thank you <3 How do you want to be mentioned in Authors.md? Just Qainguin or also your real name? |
What's going on with the font import changing |
Qainguin is good, thank you for including me! |
Whenever I edit this repository with my Mac it just gets rid of the fallbacks. |
What Godot version do you use? Also in git you can specify the files you want to commit changes of. |
I am using 4.2.2 stable. Also, thanks for letting me know that. |
Ok, I have reverted all changes to unrelated files, it should now be ready for merge. |
Ok, I went to check out if this works and noticed that on my laptop Godot also changed stuff in the font import file. |
Maybe to reduce code duplication: func web_save_svg() -> void:
var file_name := Utils.get_file_name(GlobalSettings.save_data.current_file_path)
if file_name.is_empty():
file_name = "export"
JavaScriptBridge.download_buffer(
SVG.text.to_utf8_buffer(),
file_name + ".svg",
"image/svg+xml"
)
func web_save_png(img: Image) -> void:
var file_name := Utils.get_file_name(GlobalSettings.save_data.current_file_path)
if file_name.is_empty():
file_name = "export"
JavaScriptBridge.download_buffer(
img.save_png_to_buffer(),
file_name + ".png",
"image/png"
)
|
Note: You don't need to add the "+ '.(file extension)'", MIME does it automatically
I added those changes as well as getting rid of adding the file extensions. (MIME already adds the file extension) |
Is this ready to be merged? If you want, you can include the font change we discussed and close #685 here too |
It's ready to be merged but I'm gonna add the font change, give me like 15 minutes. |
It is now ready to be merged, including fixing #685 |
This fixes #682 by adding MIME types to the JavaScriptBridge and setting a default name if there is no file name in GlobalSettings.