godot icon indicating copy to clipboard operation
godot copied to clipboard

Script with hardcoded multiple language glyphs causes many errors on open

Open AdriaandeJongh opened this issue 4 months ago • 3 comments

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

AdriaandeJongh avatar Sep 27 '24 11:09 AdriaandeJongh