<div dir="ltr">Matching with an FC_CHARSET works for me. No idea if what I'm doing is right, but roughly what I do is:<div>- Identify script for each character (using <a href="http://unicode.org/Public/UNIDATA/Scripts.txt">http://unicode.org/Public/UNIDATA/Scripts.txt</a>)</div><div>- Split runs based on script (so that no run has two different scripts)</div><div>- Build an FC_CHARSET for the run.</div><div>- Match and use the resulting font.</div><div><br></div><div>So if a font didn't define all the characters in a script, I might still get some missing glyphs. But it seems to work reasonably well. If I wanted to make sure all characters had glyphs, I could probably so a second round of splitting where adjacent characters for which no glyphs was found were broken off into a separate text run and rematched. So far I haven't bothered.</div><div><br></div><div>Hope that helps.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 January 2015 at 22:51, Sam Varshavchik <span dir="ltr"><<a href="mailto:mrsam@courier-mta.com" target="_blank">mrsam@courier-mta.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Akira TAGOH writes:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That way is what Pango do to figure out the glyph coverage in fonts. they convert the result into their own structure so that it's not that easy to find out a font that have the certain coverage in fontconfig only.<br>
</blockquote>
<br></span>
You mean match by FC_CHARSET? That was the first part of what I'm trying to figure out, whether creating an FcCharset containing the unicode characters in the text, and then trying to match a font using it, will work.<div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Mon, Jan 19, 2015 at 12:51 PM, Sam Varshavchik <<URL:mailto:<a href="mailto:mrsam@courier-mta.com" target="_blank">mrsam@courier-<u></u>mta.com</a>><a href="mailto:mrsam@courier-mta.com" target="_blank">mrsam@courier-mta.com</a>> wrote:<br>
<br>
   I'm learning the fontconfig API, and I'm trying to figure out how to do<br>
   the following.<br>
<br>
   I have arbitrary Unicode text, and I would like to match a reasonable font<br>
   to use for displaying it. It's possible that I might need more than one<br>
   font if, say, the text is a mixture of Latin characters and Asian<br>
   ideographs.<br>
<br>
   I see that FC_CHARSET is an option to FcPattern. Does this sound like I'm<br>
   on the right track:<br>
<br>
   A) Construct an FcCharset and add all unicode characters in the text to<br>
   display<br>
<br>
   B) Add it as a FC_CHARSET value to an FcPattern.<br>
<br>
   C) Use FcFontList() to search for the matching font.<br>
<br>
   The developer reference contains the following statement: "Fontconfig uses<br>
   some of these properties for font matching and font completion. Others are<br>
   provided as a convenience for the application's rendering mechanism."<br>
<br>
   So, I guess I'm trying to clarify whether I can use the FC_CHARSET<br>
   property to search for fonts that have coverage for my unicode text, or if<br>
   this a non-searchable property, only.<br>
</blockquote>
<br>
</div></div><br>_______________________________________________<br>
Fontconfig mailing list<br>
<a href="mailto:Fontconfig@lists.freedesktop.org">Fontconfig@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/fontconfig" target="_blank">http://lists.freedesktop.org/mailman/listinfo/fontconfig</a><br>
<br></blockquote></div><br></div>