Skip to content
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

Font import: "subpixel positioning is selected" warning when it has been auto-disabled for pixel fonts #102509

Closed
mgiuca opened this issue Feb 7, 2025 · 1 comment · Fixed by #102519

Comments

@mgiuca
Copy link

mgiuca commented Feb 7, 2025

Tested versions

  • Reproducible in: 4.4.beta2, 4.4.dev3, 4.4.dev1
  • Not reproducible in: 4.3

Note: This is a bug in the "Detect pixel fonts and disable subpixel positioning" feature introduced in 4.4.dev1 (#94609). The bug is reproducible in all 4.4 dev builds, and is not applicable in 4.3.

System information

Godot v4.4.beta2 - Ubuntu 24.04.1 LTS 24.04 on X11 - X11 display driver, Multi-window, 2 monitors - OpenGL 3 (Compatibility) - NVIDIA GeForce GTX 1060 6GB (nvidia; 535.183.01) - Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz (4 threads)

Issue description

When importing a pixel font, Godot disables subpixel positioning. However, the import dialog still shows a warning that subpixel positioning is enabled. It is unclear if the consequences of the warning (pre-rendering glyphs for multiple offsets) actually happens or if it's just a spurious warning, but it is confusing nonetheless.

Steps to reproduce

  1. Create a new project.
  2. Get a pixel font, e.g. Kenney Mini found in https://kenney.nl/assets/kenney-fonts
  3. Copy the font into the project directory and have Godot import it. Godot prints a message "res://Kenney Mini.ttf: Pixel font detected, disabling subpixel positioning."
  4. Double-click the font to see its import dialog. The dialog shows that "Subpixel positioning" is set to "Disabled" (as the import message suggests), but underneath is a yellow warning: "Note: Subpixel positioning is selected, each of the glyphs might be pre-rendered for multiple subpixel offsets (up to 4x)."

Note that clicking Reimport does not fix the warning. However, changing Subpixel Positioning to Auto, then clicking Reimport, then changing Subpixel Positioning back to Disabled, then clicking Reimport again, makes the message go away.

Minimal reproduction project (MRP)

subpixel-repro.zip

@mgiuca
Copy link
Author

mgiuca commented Feb 7, 2025

The diff of the import file after changing to Auto and back to Disabled is as follows:

--- a/Kenney Mini.ttf.import      
+++ b/Kenney Mini.ttf.import      
@@ -22,7 +22,7 @@ msdf_size=48
 allow_system_fallback=true
 force_autohinter=false
 hinting=1
-subpixel_positioning=4
+subpixel_positioning=0
 keep_rounding_remainders=true
 oversampling=0.0
 Fallbacks=null
@@ -33,7 +33,8 @@ preload=[{
 "chars": [],
 "glyphs": [],
 "name": "New Configuration",
-"size": Vector2i(16, 0)
+"size": Vector2i(16, 0),
+&"variation_embolden": 0.0
 }]
 language_support={}
 script_support={}

So the default import state is setting subpixel_positioning to 4 which is a value that is inaccessible from the drop-down. Manually changing it to Auto then Disabled (reimporting in between each change) explicitly sets it to 0 which means Disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants