summaryrefslogtreecommitdiff
path: root/include/mupdf/fitz/font.h
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-01-20 16:21:17 +0100
committerTor Andersson <tor.andersson@artifex.com>2017-01-20 16:28:41 +0100
commitad6807ba2a3fbd1c276ad5797a27ec771aeaf59b (patch)
tree684137a635e4d3a3812d53daf10f29e1ef8652ac /include/mupdf/fitz/font.h
parent065036c63146c85c45253e48137612ede9451958 (diff)
downloadmupdf-ad6807ba2a3fbd1c276ad5797a27ec771aeaf59b.tar.xz
Add system fallback font callback.
Diffstat (limited to 'include/mupdf/fitz/font.h')
-rw-r--r--include/mupdf/fitz/font.h46
1 files changed, 24 insertions, 22 deletions
diff --git a/include/mupdf/fitz/font.h b/include/mupdf/fitz/font.h
index c453e085..7bd36629 100644
--- a/include/mupdf/fitz/font.h
+++ b/include/mupdf/fitz/font.h
@@ -136,48 +136,50 @@ const char *fz_font_name(fz_context *ctx, fz_font *font);
fz_rect *fz_font_bbox(fz_context *ctx, fz_font *font);
/*
- fz_load_system_font_func: Type for user supplied system
- font loading hook.
+ fz_load_system_font_fn: Type for user supplied system font loading hook.
name: The name of the font to load.
-
bold: 1 if a bold font desired, 0 otherwise.
-
italic: 1 if an italic font desired, 0 otherwise.
+ needs_exact_metrics: 1 if an exact metric match is required for the font requested.
- needs_exact_metrics: 1 if an exact metric match is required
- for the font requested.
-
- Returns a new font handle, or NULL if no font found (or on
- error).
+ Returns a new font handle, or NULL if no font found (or on error).
*/
-typedef fz_font *(*fz_load_system_font_func)(fz_context *ctx, const char *name, int bold, int italic, int needs_exact_metrics);
+typedef fz_font *(*fz_load_system_font_fn)(fz_context *ctx, const char *name, int bold, int italic, int needs_exact_metrics);
/*
- fz_load_system_cjk_font_func: Type for user supplied cjk
- font loading hook.
+ fz_load_system_cjk_font_fn: Type for user supplied cjk font loading hook.
name: The name of the font to load.
+ ros: The registry from which to load the font (e.g. FZ_ADOBE_KOREA_1)
+ serif: 1 if a serif font is desired, 0 otherwise.
- ros: The registry from which to load the font (e.g.
- FZ_ADOBE_KOREA_1)
+ Returns a new font handle, or NULL if no font found (or on error).
+*/
+typedef fz_font *(*fz_load_system_cjk_font_fn)(fz_context *ctx, const char *name, int ros, int serif);
- serif: 1 if a serif font is desired, 0 otherwise.
+/*
+ fz_load_system_fallback_font_fn: Type for user supplied fallback font loading hook.
- Returns a new font handle, or NULL if no font found (or on
- error).
+ name: The name of the font to load.
+ script: UCDN script enum.
+ language: FZ_LANG enum.
+ serif, bold, italic: boolean style flags.
+
+ Returns a new font handle, or NULL if no font found (or on error).
*/
-typedef fz_font *(*fz_load_system_cjk_font_func)(fz_context *ctx, const char *name, int ros, int serif);
+typedef fz_font *(*fz_load_system_fallback_font_fn)(fz_context *ctx, int script, int language, int serif, int bold, int italic);
/*
- fz_install_load_system_font_funcs: Install functions to allow
+ fz_install_load_system_font_fn: Install functions to allow
MuPDF to request fonts from the system.
- f, f_cjk: The hooks to use.
-
Only one set of hooks can be in use at a time.
*/
-void fz_install_load_system_font_funcs(fz_context *ctx, fz_load_system_font_func f, fz_load_system_cjk_font_func f_cjk);
+void fz_install_load_system_font_funcs(fz_context *ctx,
+ fz_load_system_font_fn f,
+ fz_load_system_cjk_font_fn f_cjk,
+ fz_load_system_fallback_font_fn f_fallback);
/* fz_load_*_font returns NULL if no font could be loaded (also on error) */
/*