Something is still broken with unicode conversion but I'll figure that out tomorrow

Originally committed to SVN as r1716.
This commit is contained in:
Rodrigo Braz Monteiro 2008-01-14 07:06:43 +00:00
parent 1b6f421917
commit 67df761c51

View file

@ -75,10 +75,15 @@ wxArrayString GetName(FT_Face &face,int id) {
FT_SfntName name; FT_SfntName name;
FT_Get_Sfnt_Name(face,i,&name); FT_Get_Sfnt_Name(face,i,&name);
if (name.name_id == id) { if (name.name_id == id) {
char *str = new char[name.string_len+1]; char *str = new char[name.string_len+2];
memcpy(str,name.string,name.string_len); memcpy(str,name.string,name.string_len);
str[name.string_len] = 0; str[name.string_len] = 0;
final.Add(wxString(str, wxConvLocal)); str[name.string_len+1] = 0;
if (name.encoding_id == 0) final.Add(wxString(str, wxConvLocal));
else if (name.encoding_id == 1) {
wxMBConvUTF16LE conv;
final.Add(wxString((wxChar*)str,conv));
}
delete [] str; delete [] str;
} }
} }