private IntPtr GetFontByCodePointNonCached(int codePoint) { foreach (IntPtr font in fonts) { if (LibXft.XftCharExists(display, font, (uint)codePoint) != 0) { return(font); } } if (fonts.Count >= MaxFontsCount) { return(MainFont); } IntPtr fontPtr = LibXft.XftFontOpenName(display, screen, GetXftFontConfig(fontConfig, codePoint)); if (fontPtr == IntPtr.Zero) { return(MainFont); } if (LibXft.XftCharExists(display, fontPtr, (uint)codePoint) == 0) { LibXft.XftFontClose(display, fontPtr); return(MainFont); } fonts.Add(fontPtr); return(fontPtr); }
public static XftFontExt Create(FontConfig fontConfig, IntPtr display, int screen) { IntPtr fontPtr = LibXft.XftFontOpenName(display, screen, GetXftFontConfig(fontConfig, -1)); return(new XftFontExt(fontConfig, display, screen, fontPtr)); }