public Face GetFallbackFace(Library library, uint cp) { string file = null; using (var pat = FcPattern.FromFamilyName("sans")) { using (var cs = new FcCharSet()) { pat.ConfigSubstitute(fcconfig, FcMatchKind.Pattern); pat.DefaultSubstitute(); cs.AddCharacter(cp); pat.AddCharSet("charset", cs); FcResult result; using (var font = pat.Match(fcconfig, out result)) { if (font.GetString(Fc.FC_FILE, 0, ref file) == FcResult.Match) { if (!fallbacks.ContainsKey(file)) { fallbacks.Add(file, new Face(library, file)); } return(fallbacks[file]); } } } } if (sans != null) { return(sans); } var style = FontStyles.Regular; sans = LoadSystemFace(library, "sans", ref style); return(sans); }
public void AddCharSet(string name, FcCharSet fcs) { Native.FcPatternAddCharSet(Handle, name, fcs.Handle); }