diff options
Diffstat (limited to 'include/mupdf/fitz/text.h')
-rw-r--r-- | include/mupdf/fitz/text.h | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/include/mupdf/fitz/text.h b/include/mupdf/fitz/text.h index 16c019b7..ceca3336 100644 --- a/include/mupdf/fitz/text.h +++ b/include/mupdf/fitz/text.h @@ -63,14 +63,109 @@ struct fz_text_s fz_text_span *head, *tail; }; +/* + fz_new_text: Create a new empty fz_text object. + + Throws exception on failure to allocate. +*/ fz_text *fz_new_text(fz_context *ctx); + +/* + fz_keep_text: Add a reference to an fz_text. + + text: text object to keep a reference to. + + Return the same text pointer. +*/ fz_text *fz_keep_text(fz_context *ctx, const fz_text *text); + +/* + fz_drop_text: Drop a reference to the object, freeing + if if is the last one. + + text: Object to drop the reference to. +*/ void fz_drop_text(fz_context *ctx, const fz_text *text); +/* + fz_show_glyph: Add a glyph/unicode value to a text object. + + text: Text object to add to. + + font: The font the glyph should be added in. + + trm: The transform to use for the glyph. + + glyph: The glyph id to add. + + unicode: The unicode character for the glyph. + + wmode: 1 for vertical mode, 0 for horizontal. + + bidi_level: The bidirectional level for this glyph. + + markup_dir: The direction of the text as specified in the + markup. + + language: The language in use (if known, 0 otherwise) + (e.g. FZ_LANG_zh_Hans). + + Throws exception on failure to allocate. +*/ void fz_show_glyph(fz_context *ctx, fz_text *text, fz_font *font, const fz_matrix *trm, int glyph, int unicode, int wmode, int bidi_level, fz_bidi_direction markup_dir, fz_text_language language); + +/* + fz_show_string: Add a UTF8 string to a text object. + + text: Text object to add to. + + font: The font the string should be added in. + + trm: The transform to use. Will be updated according + to the advance of the string on exit. + + glyph: The glyph id to add. + + s: The utf-8 string to add. + + wmode: 1 for vertical mode, 0 for horizontal. + + bidi_level: The bidirectional level for this glyph. + + markup_dir: The direction of the text as specified in the + markup. + + language: The language in use (if known, 0 otherwise) + (e.g. FZ_LANG_zh_Hans). + + Throws exception on failure to allocate. +*/ void fz_show_string(fz_context *ctx, fz_text *text, fz_font *font, fz_matrix *trm, const char *s, int wmode, int bidi_level, fz_bidi_direction markup_dir, fz_text_language language); + +/* + fz_bound_text: Find the bounds of a given text object. + + text: The text object to find the bounds of. + + stroke: Pointer to the stroke attributes (for stroked + text), or NULL (for filled text). + + ctm: The matrix in use. + + r: pointer to storage for the bounds. + + Returns a pointer to r, which is updated to contain the + bounding box for the text object. +*/ fz_rect *fz_bound_text(fz_context *ctx, const fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm, fz_rect *r); +/* + fz_clone_text: Clone a text object. + + text: The text object to clone. + + Throws an exception on allocation failure. +*/ fz_text *fz_clone_text(fz_context *ctx, const fz_text *text); /* |