diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/fitz/base.h | 6 | ||||
-rw-r--r-- | include/mupdf/content.h | 3 | ||||
-rw-r--r-- | include/mupdf/page.h | 21 | ||||
-rw-r--r-- | include/mupdf/rsrc.h | 3 |
4 files changed, 33 insertions, 0 deletions
diff --git a/include/fitz/base.h b/include/fitz/base.h index da0132d4..562bb1df 100644 --- a/include/fitz/base.h +++ b/include/fitz/base.h @@ -21,6 +21,12 @@ #define STRIDE(n, bcp) (((bpc) * (n) + 7) / 8) +int chartorune(int *rune, char *str); +int runetochar(char *str, int *rune); +int runelen(long c); +int runenlen(int *r, int nrune); +int fullrune(char *str, int n); + typedef struct fz_error_s fz_error; struct fz_error_s diff --git a/include/mupdf/content.h b/include/mupdf/content.h index 6dae61da..f891c3c7 100644 --- a/include/mupdf/content.h +++ b/include/mupdf/content.h @@ -66,15 +66,18 @@ struct pdf_csi_s fz_obj *stack[32]; int top; int xbalance; + fz_obj *array; /* path object state */ fz_pathnode *path; fz_pathnode *clip; /* text object state */ + fz_node *textclip; fz_textnode *text; fz_matrix tlm; fz_matrix tm; + int textmode; fz_tree *tree; }; diff --git a/include/mupdf/page.h b/include/mupdf/page.h index 0dd1001b..3bb27db6 100644 --- a/include/mupdf/page.h +++ b/include/mupdf/page.h @@ -7,6 +7,8 @@ typedef struct pdf_outline_s pdf_outline; typedef struct pdf_nametree_s pdf_nametree; typedef struct pdf_pagetree_s pdf_pagetree; typedef struct pdf_page_s pdf_page; +typedef struct pdf_textline_s pdf_textline; +typedef struct pdf_textchar_s pdf_textchar; struct pdf_outlinetree_s { @@ -48,6 +50,19 @@ struct pdf_page_s int rotate; fz_obj *resources; fz_tree *tree; + pdf_textline *text; +}; + +struct pdf_textchar_s +{ + int x, y, c; +}; + +struct pdf_textline_s +{ + int len, cap; + pdf_textchar *text; + pdf_textline *next; }; /* outline.c */ @@ -73,3 +88,9 @@ void pdf_droppagetree(pdf_pagetree *pages); fz_error *pdf_loadpage(pdf_page **pagep, pdf_xref *xref, fz_obj *ref); void pdf_droppage(pdf_page *page); +/* unicode.c */ +fz_error *pdf_loadtextfromtree(pdf_textline **linep, fz_tree *tree); +void pdf_debugtextline(pdf_textline *line); +fz_error *pdf_newtextline(pdf_textline **linep); +void pdf_droptextline(pdf_textline *line); + diff --git a/include/mupdf/rsrc.h b/include/mupdf/rsrc.h index bb29dc8a..eaf20fb2 100644 --- a/include/mupdf/rsrc.h +++ b/include/mupdf/rsrc.h @@ -161,6 +161,9 @@ fz_error *pdf_loadembeddedcmap(fz_cmap **cmapp, pdf_xref *xref, fz_obj *stmref); fz_error *pdf_loadsystemcmap(fz_cmap **cmapp, char *name); fz_error *pdf_makeidentitycmap(fz_cmap **cmapp, int wmode, int bytes); +/* unicode.c */ +fz_error *pdf_loadtounicode(pdf_font *font, pdf_xref *xref, char **strings, char *collection, fz_obj *cmapstm); + /* fontfile.c */ fz_error *pdf_loadbuiltinfont(pdf_font *font, char *basefont); fz_error *pdf_loadembeddedfont(pdf_font *font, pdf_xref *xref, fz_obj *stmref); |