| 79 | } |
| 80 | |
| 81 | bool Font::_is_cyclic(const Ref<Font>& p_f, int p_depth) const |
| 82 | { |
| 83 | ERR_FAIL_COND_V(p_depth > MAX_FALLBACK_DEPTH, true); |
| 84 | if (p_f.is_null()) |
| 85 | { |
| 86 | return false; |
| 87 | } |
| 88 | if (p_f.get() == this) |
| 89 | { |
| 90 | return true; |
| 91 | } |
| 92 | for (int i = 0; i < p_f->fallbacks.size(); i++) |
| 93 | { |
| 94 | const Ref<Font>& f = p_f->fallbacks[i]; |
| 95 | if (_is_cyclic(f, p_depth + 1)) |
| 96 | { |
| 97 | return true; |
| 98 | } |
| 99 | } |
| 100 | return false; |
| 101 | } |
| 102 | |
| 103 | void Font::reset_state() |
| 104 | { |