diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-12-10 18:45:54 +0100 |
---|---|---|
committer | Grigori Goronzy <greg@chown.ath.cx> | 2015-07-10 10:42:40 +0200 |
commit | bc743feb07cffe7a81e07411a484e499377deb50 (patch) | |
tree | 1d5bd66659bbef67c0a1145a4bbcd4b109c06230 /libass/ass.h | |
parent | e95626628eab9a892047c60e4b9926ab50ce1bd4 (diff) | |
download | libass-bc743feb07cffe7a81e07411a484e499377deb50.tar.bz2 libass-bc743feb07cffe7a81e07411a484e499377deb50.tar.xz |
fontselect: expose a fontprovider selection API
Allow the user of libass to select the font provider from ass_set_fonts. This
API change actually doesn't break client code which was passing `fc=1`; now
the same value will autodetect a usable font provider.
Also add an api to list available font providers as that is useful for client
code to show drop down menus with a font provider to choose from.
Diffstat (limited to 'libass/ass.h')
-rw-r--r-- | libass/ass.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/libass/ass.h b/libass/ass.h index 1f8a506..a3feb0b 100644 --- a/libass/ass.h +++ b/libass/ass.h @@ -176,6 +176,23 @@ typedef enum { int ass_library_version(void); /** + * \brief Default Font provider to load fonts in libass' database + * + * NONE don't use any default font provider for font lookup + * AUTODETECT use the first available font provider + * CORETEXT force a CoreText based font provider (OS X only) + * FONTCONFIG force a Fontconfig based font provider + * + * libass uses the best shaper available by default. + */ +typedef enum { + ASS_FONTPROVIDER_NONE = 0, + ASS_FONTPROVIDER_AUTODETECT = 1, + ASS_FONTPROVIDER_CORETEXT, + ASS_FONTPROVIDER_FONTCONFIG, +} ASS_DefaultFontProvider; + +/** * \brief Initialize the library. * \return library handle or NULL if failed */ @@ -397,8 +414,8 @@ void ass_set_line_position(ASS_Renderer *priv, double line_position); * NOTE: font lookup must be configured before an ASS_Renderer can be used. */ void ass_set_fonts(ASS_Renderer *priv, const char *default_font, - const char *default_family, int fc, const char *config, - int update); + const char *default_family, ASS_DefaultFontProvider dfp, + const char *config, int update); /** * \brief Set selective style override mode. |