godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.58k stars 20.3k forks source link

Script with hardcoded multiple language glyphs causes many errors on open #97536

Open AdriaandeJongh opened 2 days ago

AdriaandeJongh commented 2 days ago

Tested versions

Godot v4.3.stable

System information

Godot v4.3.stable - macOS 15.0.0 - Vulkan (Mobile) - integrated Apple M3 Max - Apple M3 Max (14 Threads)

Issue description

The following piece of code consistently leads to 504 errors every time I open the script:

class_name UISettings
extends Control

class LanguageCodes:
    var code: String
    var label: String

    func _init(_code: String, _label: String) -> void:
        code = _code
        label = _label

var _all_languages: Array[LanguageCodes] = [
        LanguageCodes.new("en_US", "English (US)"),
        LanguageCodes.new("de_DE", "Deutsch"),
        LanguageCodes.new("es_ES", "Español"),
        LanguageCodes.new("fr_FR", "Français"),
        LanguageCodes.new("ja_JP", "日本語"),
        LanguageCodes.new("ko_KR", "한국어"),
        LanguageCodes.new("nl_NL", "Nederlands"),
        LanguageCodes.new("pl_PL", "Polski"),
        LanguageCodes.new("pt_BR", "Português (Brasil)"),
        LanguageCodes.new("ru_RU", "Русский"),
        LanguageCodes.new("tr_TR", "Türkçe"),
        LanguageCodes.new("zh_CN", "简体中文"),
        LanguageCodes.new("zh_TW", "繁體中文"),
    ]

This is the error I'm getting 504 times:

 FreeType: Error loading font: ''.
  modules/text_server_adv/text_server_adv.cpp:3486 - Condition "!_ensure_cache_for_size(fd, fd->msdf ? Vector2i(fd->msdf_source_size, 0) : Vector2i(16, 0))" is true. Returning: false

Steps to reproduce

Put the above code in a script and open it. If it doesn't immediately result in errors, restart the editor.

Minimal reproduction project (MRP)

n/a

matheusmdx commented 1 day ago

I wasn't able to reproduce this issue.

Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Mobile) - dedicated AMD Radeon RX 580 2048SP (Advanced Micro Devices, Inc.; 31.0.21916.2) - AMD Ryzen 5 3600 6-Core Processor (12 Threads)

AdriaandeJongh commented 1 day ago

Ah, sorry, indeed: i forgot to add the detail that this code was added by my colleague on a Windows machine who doesn't see the error. So i suspect this is a macOS only issue?