|Summary:||FcConfigAppFontAddFile equivalent that takes memory or FT_Face|
|Product:||fontconfig||Reporter:||Behdad Esfahbod <freedesktop>|
|Status:||NEW ---||QA Contact:||Behdad Esfahbod <freedesktop>|
|i915 platform:||i915 features:|
Description Behdad Esfahbod 2014-05-08 18:25:30 UTC
One common request is to use Pango with a custom font. The way I recommend doing that is by creating a custom FcConfig and adding custom fonts to it and using pango against that config. However, currently only fonts on disk can be added to a config. Lets fix that to either get a memory buffer, or a FT_Face, similar to FcFreeTypeQueryFace. We probably need to add a FcFileScan() variant too. Perhaps better to add Memory() version to avoid FreeType dependency in non fcfreetype.h API.
Comment 1 Behdad Esfahbod 2014-05-08 18:32:50 UTC
Humm. A version that takes FT_Face is useful regardless. So perhaps we can add FcFreeTypeConfigAppFontAddFace() as well as FcConfigAppFontAddMemory().
Comment 2 Behdad Esfahbod 2015-05-12 19:23:22 UTC
This might be tricky. Clients of fontconfig currently only expect FC_FILE/FC_INDEX. We would need to update them all to check for the FC_FT_FACE as well... Taking FT_Face might not be a good idea. Taking memory and creating a FT_FACE every time works. Alternatively, we can use modern Linux APIs to assign to a piece of memory a file name. That might be the least portable but most useful.
Comment 3 Behdad Esfahbod 2015-05-12 19:23:26 UTC
For reference, I discussed using custom fonts with pango in detail here: http://mces.blogspot.ca/2015/05/how-to-use-custom-application-fonts.html