This is based on `fig_string`, `mp_string`, and `pic_string`, but outputting
data directly into the output file rather than a temporary buffer.
Related to #2051.
- hard-coded lookup tables for fallback font metrics for more fonts and font
variants
+- a new `gvputs_nonascii` API function has been implemented for GVC I/O with C
+ escaping
### Changed
gvprintpointflist
gvputc
gvputs
+gvputs_nonascii
gvputs_xml
gvRender
gvRenderData
return xml_escape(s, flags, (int (*)(void *, const char *))gvputs, job);
}
+void gvputs_nonascii(GVJ_t *job, const char *s) {
+ for (; *s != '\0'; ++s) {
+ if (*s == '\\') {
+ gvputs(job, "\\\\");
+ } else if (isascii((int)*s)) {
+ gvputc(job, *s);
+ } else {
+ gvprintf(job, "%03o", (unsigned)*s);
+ }
+ }
+}
+
int gvputc(GVJ_t * job, int c)
{
const char cc = c;
// `gvputs`, but XML-escape the input string
GVIO_API int gvputs_xml(GVJ_t* job, const char *s);
+ // `gvputs`, C-escaping '\' and non-ASCII bytes
+ GVIO_API void gvputs_nonascii(GVJ_t* job, const char *s);
+
GVIO_API int gvflush (GVJ_t * job);
GVIO_API void gvprintf(GVJ_t * job, const char *format, ...);
GVIO_API void gvprintdouble(GVJ_t * job, double num);