diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mupdf/fitz/text.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/include/mupdf/fitz/text.h b/include/mupdf/fitz/text.h index 682517c4..84f72957 100644 --- a/include/mupdf/fitz/text.h +++ b/include/mupdf/fitz/text.h @@ -39,7 +39,7 @@ typedef enum fz_text_direction_e typedef enum fz_text_language_e { - fz_lang_unset = 0 + FZ_LANG_UNSET = 0 /* FIXME: Fill in more */ } fz_text_language; @@ -50,7 +50,7 @@ struct fz_text_span_s int wmode : 1; /* 0 horizontal, 1 vertical */ int bidi_level : 7; /* The bidirectional level of text */ int markup_dir : 2; /* The direction of text as marked in the original document */ - int language : 8; /* The language as marked in the original document */ + int language : 15; /* The language as marked in the original document */ int len, cap; fz_text_item *items; fz_text_span *next; @@ -72,4 +72,23 @@ fz_rect *fz_bound_text(fz_context *ctx, const fz_text *text, const fz_stroke_sta fz_text *fz_clone_text(fz_context *ctx, const fz_text *text); +/* + Convert ISO 639 (639-{1,2,3,5}) language specification + strings losslessly to a 15 bit fz_text_language code. + + No validation is carried out. Obviously invalid (out + of spec) codes will be mapped to FZ_LANG_UNSET, but + well-formed (but undefined) codes will be blithely + accepted. +*/ +fz_text_language fz_text_language_from_string(const char *str); + +/* + Recover ISO 639 (639-{1,2,3,5}) language specification + strings losslessly from a 15 bit fz_text_language code. + + No validation is carried out. See note above. +*/ +char *fz_string_from_text_language(char str[4], fz_text_language lang); + #endif |