| 1608 | } |
| 1609 | |
| 1610 | void CodeTextEditor::_update_font_ligatures() { |
| 1611 | int ot_mode = EDITOR_GET("interface/editor/code_font_contextual_ligatures"); |
| 1612 | |
| 1613 | Ref<FontVariation> fc = text_editor->get_theme_font(SceneStringName(font)); |
| 1614 | if (fc.is_valid()) { |
| 1615 | switch (ot_mode) { |
| 1616 | case 1: { // Disable ligatures. |
| 1617 | Dictionary ftrs; |
| 1618 | ftrs[TS->name_to_tag("calt")] = 0; |
| 1619 | fc->set_opentype_features(ftrs); |
| 1620 | } break; |
| 1621 | case 2: { // Custom. |
| 1622 | Vector<String> subtag = String(EDITOR_GET("interface/editor/code_font_custom_opentype_features")).split(","); |
| 1623 | Dictionary ftrs; |
| 1624 | for (int i = 0; i < subtag.size(); i++) { |
| 1625 | Vector<String> subtag_a = subtag[i].split("="); |
| 1626 | if (subtag_a.size() == 2) { |
| 1627 | ftrs[TS->name_to_tag(subtag_a[0])] = subtag_a[1].to_int(); |
| 1628 | } else if (subtag_a.size() == 1) { |
| 1629 | ftrs[TS->name_to_tag(subtag_a[0])] = 1; |
| 1630 | } |
| 1631 | } |
| 1632 | fc->set_opentype_features(ftrs); |
| 1633 | } break; |
| 1634 | default: { // Enabled. |
| 1635 | Dictionary ftrs; |
| 1636 | ftrs[TS->name_to_tag("calt")] = 1; |
| 1637 | fc->set_opentype_features(ftrs); |
| 1638 | } break; |
| 1639 | } |
| 1640 | } |
| 1641 | } |
| 1642 | |
| 1643 | void CodeTextEditor::_text_changed_idle_timeout() { |
| 1644 | _validate_script(); |
nothing calls this directly
no test coverage detected