• Godot Help
  • How can I modify a font's outline size with GDScript?

I have a dynamic font on a label and I need to be able to change the outline size from the script. Any suggestions?

  • If the font is in Theme Overrides, try this.

    	var lb = get_node('Flabel')
    	var fn = lb.get('custom_fonts/font')
    	fn.outline_size = 1

    You can hover the mouse over the labels in the editor to see their internal names for use with get().

If the font is in Theme Overrides, try this.

	var lb = get_node('Flabel')
	var fn = lb.get('custom_fonts/font')
	fn.outline_size = 1

You can hover the mouse over the labels in the editor to see their internal names for use with get().

    duane this works for just a single label node, but I already have numerous label nodes assigned to an array variable and use math to determine the array position. This works fine for setting text like this,

    label_array[math to determine array position].set_text(string_variable)

    but using the array like this isn't working in your suggested solution.

      wormclaw

      duane oh nevermind about that last comment, it works by skipping your first line of code and just doing,

      var fn = label_array.[math].get('custom_fonts/font')
      fn.outline_size = 1

      Thanks.