[poppler] poppler/CairoFontEngine.cc

Chris Wilson ickle at kemper.freedesktop.org
Thu Aug 6 03:26:43 PDT 2009


 poppler/CairoFontEngine.cc |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 7194f59a18e4f6997ae560af3db1bd101d6f726e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Aug 6 11:24:22 2009 +0100

    [cairo] Use FT_New_Memory_Face() for mmapped  fonts
    
    If we hold a mapping for the font, then we can pass that memory to
    FreeType for it to use as well. This saves on FreeType having to read the
    file into a fresh block of memory.

diff --git a/poppler/CairoFontEngine.cc b/poppler/CairoFontEngine.cc
index f6fb260..6490235 100644
--- a/poppler/CairoFontEngine.cc
+++ b/poppler/CairoFontEngine.cc
@@ -305,7 +305,10 @@ _ft_new_face (FT_Library lib,
   }
 
   /* not a dup, open and insert into list */
-  if (FT_New_Face (lib, filename, 0, &tmpl.face)) {
+  if (FT_New_Memory_Face (lib,
+			  (FT_Byte *) tmpl.bytes, tmpl.size,
+			  0, &tmpl.face))
+  {
 #if defined(__SUNPRO_CC) && defined(__sun) && defined(__SVR4)
     munmap ((char*)tmpl.bytes, tmpl.size);
 #else


More information about the poppler mailing list