English 中文(简体)
具有自由类型(C)的统一编码问题
原标题:Unicode issue with freetype (C)
  • 时间:2009-10-06 10:50:18
  •  标签:

I currently working on a library for the NekoVM to create a binding to Freetype 2. It is written in plain c and it all works really nice, except when the user enters some unicode chars like "ü", "Ä" or "ß" they will be transformed into to some ugly square-like letters.
When I recieve the data from the NekoVM you use val_string which returns a char*. The function (FT_Load_Char) where you push the data into freetype expects a unsigned long as char code. (Every letter is processed on its own.)

如何正确对待这些特性? 我也可以选择将其转换成任何ISO-8859-XX代码网页,然后将其输入书面图书馆。

最佳回答

解决办法非常简单:

for (i=0;i<l;i++) {
    unsigned long c = FT_Get_Char_Index(face,r[i]);
    FT_Load_Glyph(face,uc,FT_LOAD_RENDER);
    ....
}

这使得免费处理所有“编码-装饰”。

问题回答

一点的方框意味着,你的特性载于字体中。 这可能意味着两点:

  1. 含有这些特性的字体

  2. 使用正确的编码。 见FT_CharMap.FT_Encoding





相关问题
热门标签