Bug 78450 - FcConfigAppFontAddFile equivalent that takes memory or FT_Face
Summary: FcConfigAppFontAddFile equivalent that takes memory or FT_Face
Alias: None
Product: fontconfig
Classification: Unclassified
Component: library (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: fontconfig-bugs
QA Contact: Behdad Esfahbod
Depends on:
Reported: 2014-05-08 18:25 UTC by Behdad Esfahbod
Modified: 2018-08-20 21:44 UTC (History)
2 users (show)

See Also:
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:
Comment 4 GitLab Migration User 2018-08-20 21:44:03 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/12.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.