示例#1
0
// Loads a font from disk
bool wloadfont_size(int fontNumber, int fsize, const FontRenderParams *params)
{
  if (ttfRenderer.LoadFromDiskEx(fontNumber, fsize, params))
  {
    fontRenderers[fontNumber] = &ttfRenderer;
    fontRenderers2[fontNumber] = &ttfRenderer;
    return true;
  }
  else if (wfnRenderer.LoadFromDiskEx(fontNumber, fsize, params))
  {
    fontRenderers[fontNumber] = &wfnRenderer;
    fontRenderers2[fontNumber] = &wfnRenderer;
    return true;
  }
  return false;
}
示例#2
0
文件: fonts.cpp 项目: CisBetter/ags
// Loads a font from disk
bool wloadfont_size(size_t fontNumber, const FontInfo &font_info, const FontRenderParams *params)
{
  fonts.resize(fontNumber + 1);
  if (ttfRenderer.LoadFromDiskEx(fontNumber, font_info.SizePt, params))
  {
    fonts[fontNumber].Renderer  = &ttfRenderer;
    fonts[fontNumber].Renderer2 = &ttfRenderer;
  }
  else if (wfnRenderer.LoadFromDiskEx(fontNumber, font_info.SizePt, params))
  {
    fonts[fontNumber].Renderer  = &wfnRenderer;
    fonts[fontNumber].Renderer2 = &wfnRenderer;
  }

  if (fonts[fontNumber].Renderer)
  {
      fonts[fontNumber].Info = font_info;
      return true;
  }
  return false;
}