From 1b6f421917c12a8f97e22149d8baa6df1c3d5794 Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Mon, 14 Jan 2008 06:38:33 +0000 Subject: [PATCH] Worthless attempt to fix stuff Originally committed to SVN as r1715. --- aegisub/font_file_lister_freetype.cpp | 37 ++++++++++++++++----------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/aegisub/font_file_lister_freetype.cpp b/aegisub/font_file_lister_freetype.cpp index 516e50ae8..f16ae4ea1 100644 --- a/aegisub/font_file_lister_freetype.cpp +++ b/aegisub/font_file_lister_freetype.cpp @@ -66,15 +66,23 @@ FreetypeFontFileLister::~FreetypeFontFileLister() { ////////////////////// // Get name from face -wxString GetName(FT_Face &face,int i) { +wxArrayString GetName(FT_Face &face,int id) { // Get name - FT_SfntName name; - FT_Get_Sfnt_Name(face,i,&name); - char *str = new char[name.string_len+1]; - memcpy(str,name.string,name.string_len); - str[name.string_len] = 0; - wxString final(str, wxConvLocal); - delete [] str; + wxArrayString final; + int count = FT_Get_Sfnt_Name_Count(face); + + for (int i=0;i= 5) { - wxString family = GetName(face,1); - wxString subFamily = GetName(face,2); - wxString fullName = GetName(face,4); + if (nameCount > 0) { + wxArrayString family = GetName(face,1); + wxArrayString subFamily = GetName(face,2); + wxArrayString fullName = GetName(face,4); //AddFont(fontfiles[i],family); - AddFont(fontfiles[i],family + _T(" ") + subFamily);; - AddFont(fontfiles[i],fullName); - AddFont(fontfiles[i],GetName(face,11)); + for (size_t j=0;j