| 655 | } |
| 656 | |
| 657 | void MemberObsolete<FontManager>::loadOldFontFormat( |
| 658 | xml::ElementPtr _node2, |
| 659 | std::string_view _file, |
| 660 | Version _version, |
| 661 | std::string_view _tag) |
| 662 | { |
| 663 | xml::ElementEnumerator _node = _node2->getElementEnumerator(); |
| 664 | while (_node.next()) |
| 665 | { |
| 666 | if (_node->getName() == _tag) |
| 667 | { |
| 668 | std::string name; |
| 669 | if (!_node->findAttribute("name", name)) |
| 670 | return; |
| 671 | |
| 672 | std::string_view type; |
| 673 | if (_node->findAttribute("resolution").empty()) |
| 674 | type = "ResourceManualFont"; |
| 675 | else |
| 676 | type = "ResourceTrueTypeFont"; |
| 677 | |
| 678 | xml::Document doc; |
| 679 | xml::ElementPtr root = doc.createRoot("MyGUI"); |
| 680 | xml::ElementPtr node = root->createChild("Resource"); |
| 681 | node->addAttribute("type", type); |
| 682 | node->addAttribute("name", name); |
| 683 | |
| 684 | std::string tmp; |
| 685 | if (_node->findAttribute("source", tmp)) |
| 686 | { |
| 687 | xml::ElementPtr prop = node->createChild("Property"); |
| 688 | prop->addAttribute("key", "Source"); |
| 689 | prop->addAttribute("value", tmp); |
| 690 | } |
| 691 | |
| 692 | if (_node->findAttribute("size", tmp)) |
| 693 | { |
| 694 | xml::ElementPtr prop = node->createChild("Property"); |
| 695 | prop->addAttribute("key", "Size"); |
| 696 | prop->addAttribute("value", tmp); |
| 697 | } |
| 698 | |
| 699 | if (_node->findAttribute("resolution", tmp)) |
| 700 | { |
| 701 | xml::ElementPtr prop = node->createChild("Property"); |
| 702 | prop->addAttribute("key", "Resolution"); |
| 703 | prop->addAttribute("value", tmp); |
| 704 | } |
| 705 | |
| 706 | if (_node->findAttribute("antialias_colour", tmp)) |
| 707 | { |
| 708 | xml::ElementPtr prop = node->createChild("Property"); |
| 709 | prop->addAttribute("key", "Antialias"); |
| 710 | prop->addAttribute("value", tmp); |
| 711 | } |
| 712 | |
| 713 | if (_node->findAttribute("space_width", tmp)) |
| 714 | { |
nothing calls this directly
no test coverage detected