| 786 | } |
| 787 | |
| 788 | bool CUIXmlInit::InitFont(CUIXml& xml_doc, LPCSTR path, int index, u32& color, CGameFont*& pFnt) |
| 789 | { |
| 790 | color = GetColor(xml_doc, path, index, 0xff); |
| 791 | |
| 792 | shared_str font_name = xml_doc.ReadAttrib(path, index, "font", NULL); |
| 793 | if (*font_name == NULL || xr_strlen(*font_name) < 1) |
| 794 | { |
| 795 | pFnt = NULL; |
| 796 | return false; |
| 797 | } |
| 798 | |
| 799 | if (*font_name) |
| 800 | { |
| 801 | if (!xr_strcmp(*font_name, GRAFFITI19_FONT_NAME)) |
| 802 | { |
| 803 | pFnt = UI()->Font()->pFontGraffiti19Russian; |
| 804 | } |
| 805 | else if (!xr_strcmp(*font_name, GRAFFITI22_FONT_NAME)) |
| 806 | { |
| 807 | pFnt = UI()->Font()->pFontGraffiti22Russian; |
| 808 | } |
| 809 | else if (!xr_strcmp(*font_name, GRAFFITI32_FONT_NAME)) |
| 810 | { |
| 811 | pFnt = UI()->Font()->pFontGraffiti32Russian; |
| 812 | } |
| 813 | else if (!xr_strcmp(*font_name, GRAFFITI40_FONT_NAME)) |
| 814 | { |
| 815 | pFnt = UI()->Font()->pFontGraffiti40Russian; |
| 816 | } |
| 817 | else if (!xr_strcmp(*font_name, GRAFFITI50_FONT_NAME)) |
| 818 | { |
| 819 | pFnt = UI()->Font()->pFontGraffiti50Russian; |
| 820 | } |
| 821 | else if (!xr_strcmp(*font_name, ARIAL14_FONT_NAME)) |
| 822 | { |
| 823 | pFnt = UI()->Font()->pFontArial14; |
| 824 | } |
| 825 | else if (!xr_strcmp(*font_name, ARIAL21_FONT_NAME)) |
| 826 | { |
| 827 | pFnt = UI()->Font()->pFontArial21; |
| 828 | } |
| 829 | else if (!xr_strcmp(*font_name, MEDIUM_FONT_NAME)) |
| 830 | { |
| 831 | pFnt = UI()->Font()->pFontMedium; |
| 832 | } |
| 833 | else if (!xr_strcmp(*font_name, SMALL_FONT_NAME)) |
| 834 | { |
| 835 | pFnt = UI()->Font()->pFontSmall; |
| 836 | } |
| 837 | else if (!xr_strcmp(*font_name, LETTERICA16_FONT_NAME)) |
| 838 | { |
| 839 | pFnt = UI()->Font()->pFontLetterica16Russian; |
| 840 | } |
| 841 | else if (!xr_strcmp(*font_name, LETTERICA18_FONT_NAME)) |
| 842 | { |
| 843 | pFnt = UI()->Font()->pFontLetterica18Russian; |
| 844 | } |
| 845 | else if (!xr_strcmp(*font_name, LETTERICA25_FONT_NAME)) |
no test coverage detected