Closed zacii7 closed 11 months ago
Hmm, will consider this for a future feature release after 1.0. There is still a lot of work to do with text support...
Fair enough
I figured the implementation should be fairly straight forward given the routines you already have in place, so it shouldn't add too much maintenance burden. And they can't really be added externally, because they rely on the internal write_string
function.
bool pdfioContentTextNewLineShow(pdfio_stream_t *st,bool unicode,char *s) {
bool newline = false;
if (!write_string(st, unicode, s, &newline))
return (false);
return(pdfioStreamPuts(st, "'\n"));
}
bool pdfioContentTextNewLineShowSpaced(pdfio_stream_t *st,double ws,double cs,bool unicode,char *s) {
bool newline = false;
if (!pdfioStreamPrintf(st, "%g %g", ws,cs)) {
return (false);
}
if (!write_string(st, unicode, s, &newline))
return (false);
return(pdfioStreamPuts(st, "\"\n"));
}
Opted to add a single set of APIs to cover both operators:
extern bool pdfioContentTextNewLineShow(pdfio_stream_t *st, double ws, double cs, bool unicode, const char *s) _PDFIO_PUBLIC;
extern bool pdfioContentTextNewLineShowf(pdfio_stream_t *st, double ws, double cs, bool unicode, const char *format, ...) _PDFIO_PUBLIC _PDFIO_FORMAT(5,6);
[master 7ff051f] Add pdfioContentTextNewLineShow/f functions (Issue #24)
Single- and double quote operators are currently missing in pdfio
as per pdf specs,
(sometext)'
is equivalent toT* (sometext)Tj
and
2 1 (sometext)"
is equivalent to2 Tw 1 Tc (sometext)'