/// <summary> /// 获取字体 /// </summary> /// <param name="name">字体名称</param> /// <param name="fontSize">字体大小</param> /// <param name="cachTexSize">文字缓存纹理大小,多个文字公用一张纹理</param> /// <param name="texSize">文字纹理大小,特殊文字使用</param> /// <returns></returns> public CFTFont GetFont(RName name, int fontSize, int cachTexSize, int texSize) { foreach (var i in Fonts) { if (i.Name == name && i.FontSize == fontSize) { return(i); } } lock (this) { var ptr = SDK_FTFontManager_GetFont(CoreObject, name.Address, fontSize, cachTexSize, texSize); var font = new CFTFont(ptr); font.Name = name; Fonts.Add(font); return(font); } }
public void RebuildContext(CFTFont font) { SDK_FTTextDrawContext_RebuildContext(CoreObject, font.CoreObject); }
public bool IsValidVersion(CFTFont font) { return((bool)SDK_FTTextDrawContext_IsValidVersion(CoreObject, font.CoreObject)); }