pub unsafe extern "C" fn fz_format_string(
ctx: *mut fz_context,
user: *mut c_void,
emit: Option<unsafe extern "C" fn(ctx: *mut fz_context, user: *mut c_void, c: c_int)>,
fmt: *const c_char,
args: *mut __va_list_tag,
)Expand description
Our customised ‘printf’-like string formatter.
Takes %c, %d, %s, %u, %x, %X as usual.
The only modifiers supported are:
1) zero-padding ints (e.g. %02d, %03u, %04x, etc).
2) ’ to indicate that ’ should be inserted into
integers as thousands separators.
3) , to indicate that , should be inserted into
integers as thousands separators.
4) _ to indicate that , should be inserted into
integers as thousands separators.
Posix chooses the thousand separator in a locale
specific way - we do not. We always apply it every
3 characters for the positive part of integers, so
other styles, such as Indian (123,456,78) are not
supported.
%g output in “as short as possible hopefully lossless
non-exponent” form, see [fz_ftoa] for specifics.
%f and %e output as usual.
%C outputs a utf8 encoded int.
%M outputs a fz_matrix*.
%R outputs a fz_rect*.
%P outputs a fz_point*.
%n outputs a PDF name (with appropriate escaping).
%q and %( output escaped strings in C/PDF syntax.
%l{d,u,x,X} indicates that the values are int64_t.
%z{d,u,x,X} indicates that the value is a size_t.
%< outputs a quoted (utf8) string (for XML).
user: An opaque pointer that is passed to the emit function.
emit: A function pointer called to emit output bytes as the
string is being formatted.