[evince] pdf: include substitute font name and file in font list



commit c8b3fd2c717d418ab6d26e44751ad1a6af545273
Author: Adrian Johnson <ajohnson redneon com>
Date:   Sat May 12 16:46:06 2012 +0930

    pdf: include substitute font name and file in font list

 backend/pdf/ev-poppler.cc |   21 ++++++++++++++++++++-
 configure.ac              |    2 +-
 2 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc
index fcd408b..6a72fbb 100644
--- a/backend/pdf/ev-poppler.cc
+++ b/backend/pdf/ev-poppler.cc
@@ -1029,6 +1029,11 @@ pdf_document_fonts_fill_model (EvDocumentFonts *document_fonts,
 		const char *name;
 		const char *type;
 		const char *embedded;
+		const gchar *substitute;
+		const gchar *substitute_text;
+		const gchar *filename;
+		const gchar *encoding;
+		const gchar *encoding_text;
 		char *details;
 		
 		name = poppler_fonts_iter_get_name (iter);
@@ -1037,6 +1042,10 @@ pdf_document_fonts_fill_model (EvDocumentFonts *document_fonts,
 			name = _("No name");
 		}
 
+		encoding = poppler_fonts_iter_get_encoding (iter);
+		if (!encoding)
+			encoding = _("None");
+
 		type = font_type_to_string (
 			poppler_fonts_iter_get_font_type (iter));
 
@@ -1049,7 +1058,17 @@ pdf_document_fonts_fill_model (EvDocumentFonts *document_fonts,
 			embedded = _("Not embedded");
 		}
 
-		details = g_markup_printf_escaped ("%s\n%s", type, embedded);
+		substitute = poppler_fonts_iter_get_substitute_name (iter);
+		filename = poppler_fonts_iter_get_file_name (iter);
+		encoding_text = _("Encoding");
+		substitute_text = _("substituting with");
+
+		if (substitute && filename)
+			details = g_markup_printf_escaped ("%s\n%s: %s\n%s, %s <b>%s</b>\n(%s)",
+							   type, encoding_text, encoding, embedded,
+							   substitute_text, substitute, filename);
+		else
+			details = g_markup_printf_escaped ("%s\n%s: %s\n%s", type, encoding_text, encoding, embedded);
 
 		gtk_list_store_append (GTK_LIST_STORE (model), &list_iter);
 		gtk_list_store_set (GTK_LIST_STORE (model), &list_iter,
diff --git a/configure.ac b/configure.ac
index 2ef6e50..50abc0e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -470,7 +470,7 @@ AC_ARG_ENABLE([pdf],
   [enable_pdf=yes])
 
 if test "x$enable_pdf" = "xyes"; then
-    POPPLER_REQUIRED=0.18.0
+    POPPLER_REQUIRED=0.20.0
     PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED,enable_pdf=yes,enable_pdf=no)
 
     if test "x$enable_pdf" = "xyes"; then



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]