Describe the project you are working on:
This applies to numerous projects, all using GUI.
Describe the problem or limitation you are having in your project:
Every time I create a new project that uses GUI, I inevitably fall into the same problem - I need a font. Now, I'm used to needing to find a TTF file and import it into project so that I can put some labels. But I've come into _some engines_ that handle this in better way which is, most importantly, more friendly towards beginners. Making labels of different size has multiple problems. Scaled labels/buttons look super-ugly, but aside from that, their anchors are broken (https://github.com/godotengine/godot/issues/19068). So using a dynamic font for text size is a necessity.
Describe how this feature / enhancement will help you overcome this problem or limitation:
The biggest problem with this workflow is whenever you want to have nice text, you have to go out of your way and get a TTF file from somewhere. It might be web or system fonts, but I imagine this is not obvious step for beginners.
I've seen that in _some other engines_, the fonts are seemingly built-in. Not sure if they are provided with the engine (which is a no-no-no for Godot), but the option to get a system font into your project without having to navigate to Windows/Linux directory would be really useful.
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:

(imagine there's some button saying "Import system font" here and clicking it opens some dropdown/lists of system fonts, clicking which will copy the font into your project)
Describe implementation detail for your proposal (in code), if possible:
I don't recall any similar system in Godot, so can't recommend any copy-paste material here, but the idea is to access system's font directory (like C:/Windows/Fonts or /Linux/Fonts) and allow to copy a font into your project without leaving the editor. So it requires platform-specific code.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
This will be used by everyone the second this is added, trust me.
Is there a reason why this should be core and not an add-on in the asset library?:
The purpose is to be friendly to newbies, so having this in asset lib and being basically a "standard plugin to use" would make it a bit pointless...
Being able to also load systemfonts directly would be great!
As a beginner, the biggest hurdle to overcome for me was to find the place where I should load the actual font file. Still to this day I have to "look for" the place a few seconds if I have not used Richlabel or Labels in a while. The other hurdle for beginners is that if they found the place "Custom Font", they need two go down two more sub-stages until they finally can load the font. They need to select "Dynamic Font", then find "Font" and only under "Font Data" they are finally at the place.
As UI designers we have to keep in mind every click into a sub menu is a confidence check. If the user thinks this is a very popular menu item, they expect it to be very prominent and very surface level. If they won't find it on the surface level, they will as themselves with every click: am I still at the right place? Is this where I should look?
This should probably be it's own issue, though, now that I think more about it.
I'm not sure about this, as Windows' and macOS' system fonts are under proprietary licenses. Redistributing the font files isn't allowed per the respective EULAs. You definitely don't want to include them in your exported PCK :slightly_smiling_face:
That said, loading system fonts without including them in the PCK could be nice for GUI applications. In this case, you'll have to deal with various inconsistencies across system fonts. (Luckily, modern system fonts are fairly close to each other, but they're still not quite identical.)
As for getting font oversampling to work out of the box, we could replace the default BitmapFont with a DynamicFont. This will likely be done in 4.0 as part of the default project theme redesign.
yes. allowing load system font will be great so that game can show any character not embedded.
It is a best practice to have an asset be part of the project and not part of the operating system it is running on. Relying on a system font (or any file) could lead to confusion when moving or sharing a project on Windows and Mac for example. I will be down voting this.
Relying on a system font (or any file) could lead to confusion when moving or sharing a project on Windows and Mac for example. I will be down voting this.
lol, but I mean copying the font for the project, so it becomes an asset. It's great for prototyping and stuff.
I see -- sorry I missed that in the original post. Changing my mind to up vote.
@paulhocker This is actually even worse when you're distributing the project publicly, as you'll most likely be violating the font author's EULA when doing so.
@paulhocker This is actually even worse when you're distributing the project publicly, as you'll most likely be violating the font author's EULA when doing so.
And it will be confusing for many. Users will select their legitimately bought fonts, like they usually do in their graphic design tools, without even thinking that text won't be rendered to image on export, and they actually need separate embedding licences.
@paulhocker This is actually even worse when you're distributing the project publicly, as you'll most likely be violating the font author's EULA when doing so.
And it will be confusing for many. Users will select their legitimately bought fonts, like they usually do in their graphic design tools, without even thinking that text won't be rendered to image on export, and they actually need separate embedding licences.
That is already a problem today, so I don't see how this request makes it worse. It is the responsibility of the developer to make sure they are following the license for assets in their final build. That said, I think this idea would be a nice to have, as there are so many other things to work on.
If you bought your OS, you also bought the licensing to use the fonts that come with it for whatever purpose other than redistribution. As long as you are just redistributing a project that is _using_ the font, not the font itself, there is absolutely no problem using the system fonts of an OS you own in your project.
The problem is, if the font is simply copied into the project, it gets very easy for people not to notice that they're redistributing (and if the font is in the project, it is redistributing, plain and simple)
Well of course it needs to be embedded, not just added to the zip the user has to unpack to play the game.
I have never tried to dismantle a pck file. But since you also can extract textures models sounds and other resources from other game engines without too much difficulty, I would assume there would not be much difference to being able to extract a font from a pck, legally. I would think saying "You are not allowed to dismantle those files" in your EULA like any game does it, and you should be good. I'm not a lawyer though.
To be honest, I cannot recall an engine that would do what the original requester said ("fonts are seemingly built-in") without also redistributing them. Unreal and Unity's default font are obviously bundled with the engine :)
And redistributing is not about whether the pck can be dismantled or not, if the font file is there, you are redistributing it. The only reasonable alternative is for the engine to somehow detect the use of system fonts and automatically attempt to use system font on the end-user's computer. Again, I can't recall an engine that would do this.
It's always possible to reconstruct or reverse engineer a font, even from a analog book. The questions is what the law considers enough reasonable effort to prevent that from happening.
@golddotasksquestions Font files are widely considered to be copyrightable by now. Either way, this is getting off-topic.
Hmmm, another option could be putting some free fonts in the AssetLib and making them easily accessible. That way we get good font support and avoid copyright issues.
@KoBeWi That can be done, but I don't see much point since downloadable font repositories are readily available (such as google/fonts). You don't need to do any preparation work before importing them, which further reduces the value of uploading them to the asset library.
Well, it could be any source. It just should be easy to get from within the editor, while avoiding embedding it with the engine (which reminds me that the engine itself has a nice font that could be optionally saved as resource within the project...).
@Calinou of course fonts are copyrighted. If they were not, you would not need to obtain a license to use them. In case of system fonts you obtain this license along with your OS license. Why do you say my comments are off topic? We are discussing the legality of shipping the fonts within the pck files.
In case anyone is interested on working on this, note that Windows 10 1809 onwards installs custom fonts into an user-specific folder. See https://gitlab.com/inkscape/inkscape/issues/50 for more information.
another option could be putting some free fonts in the AssetLib
I discovered sometime last year that someone has actually already done that:
It includes a selection of fonts including Droid Sans, Source Code Pro & some more novelty ones.
Repository here: https://github.com/dalton5000/Godot-Fontpack/
It notes the following which I think is why having a Godot-specific solution is helpful--particularly for beginners who may not even be aware of other font sources:
"Each font folder contains the .tres file for Godot, additional font versions if they available and its license file."
@follower The font size is defined in the .tres file, so newcomers would still have to edit the font resource to suit their needs.
allowing use the system built-in fonts will be great and necessary for CJK application .
A lot of Chinese fonts are almost 20M (file size) . it enlarge the game distribution size .
Most helpful comment
I'm not sure about this, as Windows' and macOS' system fonts are under proprietary licenses. Redistributing the font files isn't allowed per the respective EULAs. You definitely don't want to include them in your exported PCK :slightly_smiling_face:
That said, loading system fonts without including them in the PCK could be nice for GUI applications. In this case, you'll have to deal with various inconsistencies across system fonts. (Luckily, modern system fonts are fairly close to each other, but they're still not quite identical.)
As for getting font oversampling to work out of the box, we could replace the default BitmapFont with a DynamicFont. This will likely be done in 4.0 as part of the default project theme redesign.