Function mupdf_sys::fz_encode_character_with_fallback
source · pub unsafe extern "C" fn fz_encode_character_with_fallback(
ctx: *mut fz_context,
font: *mut fz_font,
unicode: c_int,
script: c_int,
language: c_int,
out_font: *mut *mut fz_font
) -> c_int
Expand description
Find the glyph id for a given unicode character within a font, falling back to an alternative if not found.
font: The font to look for the unicode character in.
unicode: The unicode character to encode.
script: The script in use.
language: The language in use.
out_font: The font handle in which the given glyph represents the requested unicode character. The caller does not own the reference it is passed, so should call fz_keep_font if it is not simply to be used immediately.
Returns the glyph id for the given unicode value in the supplied font (and sets *out_font to font) if it is present. Otherwise an alternative fallback font (based on script/language) is searched for. If the glyph is found therein, *out_font is set to this reference, and the glyph reference is returned. If it cannot be found anywhere, the function returns 0.