FreeType字体路径Windows

FreeType font path Windows

本文关键字:Windows 路径 字体 FreeType      更新时间:2023-10-16

我正在与Windows和FreeType2作斗争。我正在遵循教程,下面显示为示例代码:

  FT_Library  library;   /* handle to library     */
  FT_Face     face;      /* handle to face object */

  error = FT_Init_FreeType( &library );
  if ( error ) { ... }
  error = FT_New_Face(library, "/usr/share/fonts/truetype/arial.ttf", 0, &face ); // <-- this does not exist...
  if ( error == FT_Err_Unknown_File_Format )
  {
    ... the font file could be opened and read, but it appears
    ... that its font format is unsupported
  }
  else if ( error )
  {
    ... another error code means that the font file could not
    ... be opened or read, or simply that it is broken...
  }

这个/usr/share/fonts/truetype/arial.ttf根本不存在,我怎么能用Arial字体来处理它呢。

它因系统而异。检查FOLDRID_Fonts。