Godot-proposals: Allow font outline anti-aliasing to be disabled

Created on 28 May 2020  路  2Comments  路  Source: godotengine/godot-proposals

Describe the project you are working on:
Pixel art based platformer

Describe the problem or limitation you are having in your project:
It's currently not possible to turn off aliasing for the outline of dynamic fonts, this results fonts looking like this:
Current implementation

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
We already have support for turning off aliasing for the font in general with this UI
alias_off_example

So I propose a checkbox in the font settings section called "Outline Antialiased" to keep the naming convention, in order to turn off the outline anti-aliasing seen above.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
This would ideally result in the font outline looking more like this:
ideal

If this enhancement will not be used often, can it be worked around with a few lines of script?:
It's typical to not use aliasing when working with small pixel art i've noticed, the solution to this problem currently (that i've been using) is to duplicate the font 4 times, and offset each duplicate by 1 pixel in each direction, although I anticipate there are other solutions with shaders for example, this is a bit painful though, as each text field needs to be updated simultaneously, resulting in some pretty ugly code.

Is there a reason why this should be core and not an add-on in the asset library?:
We support turning off anti-aliasing for the dynamic font, so it makes sense that a feature like this should be included in the core project.

core

Most helpful comment

I don't think this issue is about antialiasing, but rather changing how FreeType grows the font outline. I'm not sure if we have control over this.

I think antialiasing is already disabled on both the main font and the outline when you disable it in DynamicFontData. If it's not, it's more of a bug than a feature proposal :slightly_smiling_face:

Edit: I can confirm the FreeType-based outline is still being antialiased when the DynamicFontData has its Antialiasing property disabled:

image

test_font_outline.zip

All 2 comments

I don't think this issue is about antialiasing, but rather changing how FreeType grows the font outline. I'm not sure if we have control over this.

I think antialiasing is already disabled on both the main font and the outline when you disable it in DynamicFontData. If it's not, it's more of a bug than a feature proposal :slightly_smiling_face:

Edit: I can confirm the FreeType-based outline is still being antialiased when the DynamicFontData has its Antialiasing property disabled:

image

test_font_outline.zip

Awesome, thanks for looking into this :)

Was this page helpful?
0 / 5 - 0 ratings