Skip to content

Commit

Permalink
Revert "Handle name table with different encodings"
Browse files Browse the repository at this point in the history
This reverts commit 96b9d73.
  • Loading branch information
kv01 committed Jul 29, 2021
1 parent 96b9d73 commit e6190a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ttfParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,12 @@ int8_t TTFFontParser::parse_data(const char* data, TTFFontParser::FontData* font

//iterate through all name table platform, encoding and language combinations
for (const auto& name_table_iterator : font_data->name_table) {
auto utf16_to_utf8 = [](const std::u16string& _utf16_string) {
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> _utf16_to_utf8_;
std::string _utf8_string_ = _utf16_to_utf8_.to_bytes(_utf16_string);
return _utf8_string_;
};

FontData::FontNameData font_name_data;
font_name_data.from_uint64(name_table_iterator.first);
font_name_data.font_family = name_table_iterator.second[1];
Expand Down

0 comments on commit e6190a0

Please sign in to comment.