Repository: godot
Issue: Error on stylebox + theme overrides
Labels: bug,confirmed,topic:gui

### Godot version

4.1.1

### System information

Godot v4.1.1.stable - Debian GNU/Linux bookworm/sid bookworm - Vulkan (Forward+) - dedicated AMD Radeon RX 5600 XT (RADV NAVI10) () - AMD Ryzen 5 2600X Six-Core Processor (12 Threads)

### Issue description

Related to #80130 but doesn't involve locales, and the error is at a slightly different place in the code.

This is extracted from code ported from 3.3 (and I have no idea how it originally worked or why it was done this way; it's not my code).  

When I run the sample project, I get:
```
E 0:00:00:0280   my_button.gd:13 @ _ready(): Condition "!fd" is true.
  <C++ Source>   modules/text_server_adv/text_server_adv.cpp:5531 @ _shape_run()
  <Stack Trace>  my_button.gd:13 @ _ready()
```

I tried to debug this with the latest on the `main` branch, 549fcce5f8f7, but I quickly got in over my head. FWIW, the stack trace is:
```
#0  _err_print_error (p_function=p_function@entry=0x555559da0b29 "_shape_run", 
    p_file=p_file@entry=0x555559d9c778 "modules/text_server_adv/text_server_adv.cpp", p_line=p_line@entry=5637, 
    p_error=p_error@entry=0x555559d9ec10 "Condition \"!fd\" is true.", 
    p_editor_notify=p_editor_notify@entry=false, 
    p_type=p_type@entry=ERR_HANDLER_ERROR) at core/error/error_macros.cpp:77
#1  0x0000555556880cf5 in TextServerAdvanced::_shape_run (
    this=this@entry=0x55555c7b3d40, p_sd=p_sd@entry=0x55555eb3da40, p_start=0, 
    p_end=13, p_script=HB_SCRIPT_LATIN, 
    p_direction=p_direction@entry=HB_DIRECTION_LTR, p_fonts=..., p_span=0, 
    p_fb_index=0, p_prev_start=0, p_prev_end=0)
    at modules/text_server_adv/text_server_adv.cpp:5637
#2  0x000055555688838a in TextServerAdvanced::_shaped_text_shape (
    this=0x55555c7b3d40, p_shaped=...)
    at modules/text_server_adv/text_server_adv.cpp:6037
#3  0x00005555566ec244 in TextServerAdvanced::_shaped_text_update_breaks (
    this=0x55555c7b3d40, p_shaped=...)
    at modules/text_server_adv/text_server_adv.cpp:4935
#4  0x0000555558aaff8a in TextServer::shaped_text_get_line_breaks (
    this=this@entry=0x55555c7b3d40, p_shaped=..., p_width=p_width@entry=-1, 
    p_start=p_start@entry=0, p_break_flags=..., p_break_flags@entry=...)
    at servers/text_server.cpp:853
#5  0x0000555558ead6cc in TextServerExtension::shaped_text_get_line_breaks (
--Type <RET> for more, q to quit, c to continue without paging--
    this=0x55555c7b3d40, p_shaped=..., p_width=-1, p_start=0, 
    p_break_flags=...) at servers/text/text_server_extension.cpp:1190
#6  0x00005555586d016e in TextParagraph::_shape_lines (
    this=this@entry=0x55555f0ba5f0) at scene/resources/text_paragraph.cpp:192
#7  0x00005555586d0f75 in TextParagraph::get_size (
    this=this@entry=0x55555f0ba5f0) at scene/resources/text_paragraph.cpp:534
#8  0x0000555557bb0473 in Button::get_minimum_size_for_text_and_icon (
    this=this@entry=0x55555f1482f0, p_text=..., p_icon=...)
    at scene/gui/button.cpp:420
#9  0x0000555557bb088c in Button::get_minimum_size (this=0x55555f1482f0)
    at scene/gui/button.cpp:42
#10 0x0000555557c18e04 in Control::_update_minimum_size_cache (
    this=0x55555f1482f0) at scene/gui/control.cpp:1664
#11 Control::get_combined_minimum_size (this=0x55555f1482f0)
    at scene/gui/control.cpp:1675
#12 0x0000555557c1bcc2 in Control::_size_changed (this=0x55555f1482f0)
    at scene/gui/control.cpp:1693
#13 0x0000555557bb73c4 in Control::_notificationv (p_reversed=false, 
    p_notification=45, this=0x55555f1482f0) at ./scene/gui/control.h:47
#14 BaseButton::_notificationv (p_reversed=false, p_notification=45, 
    this=0x55555f1482f0) at ./scene/gui/base_button.h:40
#15 Button::_notificationv (this=0x55555f1482f0, p_notification=45, 
    p_reversed=<optimized out>) at scene/gui/button.h:38
```



### Steps to reproduce

I think this requires: (a) a control with a font override set in the scene, (b) a stylebox override and (c) a font override.

The attached file is pretty minimal; deleting either function call from the `my_button.gd` file, or removing the font override from the scene, removes the failure.



### Minimal reproduction project

[embedded-font-bad.zip](https://github.com/godotengine/godot/files/12492273/embedded-font-bad.zip)