summaryrefslogtreecommitdiff
path: root/libview/ev-jobs.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <[email protected]>2013-06-11 14:22:41 +0200
committerraveit65 <[email protected]>2017-09-06 18:25:34 +0200
commit33889b3eddebef1251e70a882b72a1710ba20083 (patch)
tree195fe268f0bad17bff2e673845df603d0d97249e /libview/ev-jobs.c
parentcd36f3b5e3cd9ee377d3431b51fa3814043f52ef (diff)
downloadatril-33889b3eddebef1251e70a882b72a1710ba20083.tar.bz2
atril-33889b3eddebef1251e70a882b72a1710ba20083.tar.xz
libview: Add a way to get the text logical attributes from the page cache
It returns an array of PangoLogAttr with the logical attributes of the text for the given page. taken from: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=6870279
Diffstat (limited to 'libview/ev-jobs.c')
-rw-r--r--libview/ev-jobs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libview/ev-jobs.c b/libview/ev-jobs.c
index a2ba309a..c82ac6b5 100644
--- a/libview/ev-jobs.c
+++ b/libview/ev-jobs.c
@@ -760,6 +760,13 @@ ev_job_page_data_run (EvJob *job)
ev_page,
&(job_pd->text_layout),
&(job_pd->text_layout_length));
+ if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_TEXT_LOG_ATTRS) && job_pd->text) {
+ job_pd->text_log_attrs_length = g_utf8_strlen (job_pd->text, -1);
+ job_pd->text_log_attrs = g_new0 (PangoLogAttr, job_pd->text_log_attrs_length + 1);
+
+ /* FIXME: We need API to get the language of the document */
+ pango_get_log_attrs (job_pd->text, -1, -1, NULL, job_pd->text_log_attrs, job_pd->text_log_attrs_length + 1);
+ }
if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_LINKS) && EV_IS_DOCUMENT_LINKS (job->document))
job_pd->link_mapping =
ev_document_links_get_links (EV_DOCUMENT_LINKS (job->document), ev_page);