ScratchAddons
ScratchAddons copied to clipboard
Ability to Upload Fonts to Editor
I think you should be able to add more fonts. There could be a button under all the fonts that says "upload new font". And once you upload the font, it would be saved to your storage for use in different projects. Why can't you just use Google Drawings or something? When you try editing that in Scratch, it would go back to default Sans Serif.
We don't have storage to store uploaded fonts, rejected.
We don't have storage to store uploaded fonts, rejected.
I said that it could be saved to the computer storage.
We don't have storage to store uploaded fonts, rejected.
I said that it could be saved to the computer storage.
Other users would not see it.
You can store a link to the font in the svg? I think I've done this with Sora before...
@TheColaber This is only possible with fonts that are available online, not with uploaded fonts.
True, so why not do that? Why not use some API or something, so the user can input "Sora" and returns a URL to it's styles
Reopening. Classic Apple closing stuff for reading only a portion of the text. Alternatives may exist in various form.
@TheColaber This is only possible with fonts that are available online, not with uploaded fonts.
Well, he said to store "the link," not "the file".
I don't know, is it possible to embed fonts to .svg
s?
We could provide more fonts by converting SVG text into path (but somehow storing metadata that will still allow the user to edit the path as if it was text)
We could provide more fonts by converting SVG text into path (but somehow storing metadata that will still allow the user to edit the path as if it was text)
In that case, there might as well be a scratch tool website to do this. Enter text, choose point, download svg. Then import to scratch
Downloading is a little too much, I have more than 100 files just from doing that from Google Drawings
We don't have storage to store uploaded fonts, rejected.
I said that it could be saved to the computer storage.
Other users would not see it.
I think this person wants it to be stored locally for personal use. Maybe the backpack can be abused so it can saved through the account.
Solution: use Google Fonts. A list of google fonts, like the google docs one.
For the Google Fonts suggestion, my idea is: When you click the font dropdown, you see a button labeled More Fonts (above or under the normal ones). When you click that button, you see a search box, a Pinned Fonts list, and, below that, the list of all the Google fonts.
@Secret-chest there are waaaaaay too many google fonts for that to work.
@Secret-chest there are waaaaaay too many google fonts for that to work.
@RedGuy12 It will only link to the font when you actually choose it
Re Google Docs, I believe their TTF files are in google/fonts. They don't need to be included as part of the extension files; instead, perhaps they could be fetched when used, ideally from fonts.googleapis.com
To convert to SVG, one could use opentype.js; it only supports OTF and TTF formats, so a different library is needed to decompress WOFF/WOFF2 files.
AFAIK, Scratch already allows any arbitrary font family value in SVGs, and presumably if the font isn't supported, it reverts to a fallback
We could just load a font selected by a user (either by uploading or from Google Fonts) but remind the user to convert their text to a path or it won't show the same for other people. (This matches the behaviour of some vector editors like Adobe Illustrator, I think)
Re Google Docs, I believe their TTF files are in google/fonts. They don't need to be included as part of the extension files; instead, perhaps they could be fetched when used, ideally from fonts.googleapis.com
To convert to SVG, one could use opentype.js; it only supports OTF and TTF formats, so a different library is needed to decompress WOFF/WOFF2 files.
AFAIK, Scratch already allows any arbitrary font family value in SVGs, and presumably if the font isn't supported, it reverts to a fallback
We could just load a font selected by a user (either by uploading or from Google Fonts) but remind the user to convert their text to a path or it won't show the same for other people. (This matches the behaviour of some vector editors like Adobe Illustrator, I think)
Will the option to import fonts also be included?
I'm only suggesting how this could be implemented, but I have no plans on actually implementing this
It should be possible to import fonts of a select few file formats; it would have the same issue as with Google Fonts where it won't work for others if they don't have Scratch Addons (until converted to an SVG path, which would be hard to edit as text unless, as W_L suggested, we kept track of the text paths in some metadata). Another concern might be that we won't have access to the font file on reload; it could be saved in the browser, which would be a bit redundant, or we could just have users reupload the font when they return to editing, displaying the fallback in the meantime
(though I suppose another option would be to upload fonts to Scratch's asset servers :eyes:)
(though I suppose another option would be to upload fonts to Scratch's asset servers 👀)
oh yes
don't svgs have the ability to import fonts and stuff from a url? we could upload some nice fonts to assets.scratch.mit.edu and then automatically import them for the user
don't svgs have the ability to import fonts and stuff from a url? we could upload some nice fonts to assets.scratch.mit.edu and then automatically import them for the user
IIRC if rendered as an embedded image as opposed to opened standalone in a new tab, SVGs won't fetch external resources. The assets server might also not return the correct MIME type for the font files, which might anger the browser
It's not out of the ordinary to have to manually and explicitly irreversibly convert text to a path IMO
It would be better if we included some fonts, and then possibly as we update, add more fonts?
don't svgs have the ability to import fonts and stuff from a url? we could upload some nice fonts to assets.scratch.mit.edu and then automatically import them for the user
@jeffalo you will only add Sora
Okay, we cloud use only the most popular Google fonts:
- Roboto
- Lato
- Montserrat
- Source Sans Pro
- Noto Sans is already included
- Roboto Mono (we need a monospaced font)
Good idea.
Bump?
Bump?
This is not the scratch forums. Bumping doesn't actually do anything. Someone will attempt to make this an addon, or you can.
We could provide more fonts by converting SVG text into path (but somehow storing metadata that will still allow the user to edit the path as if it was text)
In that case, there might as well be a scratch tool website to do this. Enter text, choose point, download svg. Then import to scratch
I use this to get the path I need, then copy and paste it into an empty .txt file and change the extension . . . maybe base the code off of this and allow a drag n' drop for a ttf file instead of saving the link? This is beyond my skillset, but I was thinking maybe make a little popup or use prompt to get the text, then insert it into the svg?
It's been suggested to add back the "Scratch" font, which is apparently already loaded into scratch but just isn't an option.