TTF: actually use CID as GID when CID-to-GID mapping is absent.

This commit is contained in:
whitequark 2016-11-02 08:40:38 +00:00
parent b8bec35a0c
commit 7bd6adefd8

View File

@ -247,11 +247,12 @@ void TtfFont::PlotString(const std::string &str,
outlineFuncs.delta = 0;
FT_Pos dx = 0;
for(char32_t chr : ReadUTF8(str)) {
uint32_t gid = FT_Get_Char_Index(fontFace, chr);
for(char32_t cid : ReadUTF8(str)) {
uint32_t gid = FT_Get_Char_Index(fontFace, cid);
if (gid == 0) {
dbp("freetype: CID-to-GID mapping for CID 0x%04x failed: %s; using CID as GID",
chr, ft_error_string(gid));
cid, ft_error_string(gid));
gid = cid;
}
/*