diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8d8cf83..f144ddf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,15 +45,20 @@ set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)")
 
 if(WIN32)
   set(_default_fontconfiguration "win32")
+elseif(APPLE)
+  set(_default_fontconfiguration "mac")
 else(WIN32)
   set(_default_fontconfiguration "fontconfig")
 endif(WIN32)
-set(FONT_CONFIGURATION "${_default_fontconfiguration}" CACHE STRING "The font configuration backend (win32|fontconfig).")
+set(FONT_CONFIGURATION "${_default_fontconfiguration}" CACHE STRING "The font configuration backend (win32|mac|fontconfig).")
 string(TOLOWER "${FONT_CONFIGURATION}" font_configuration)
 set(WITH_FONTCONFIGURATION_WIN32 OFF)
+set(WITH_FONTCONFIGURATION_MAC OFF)
 set(WITH_FONTCONFIGURATION_FONTCONFIG OFF)
 if(font_configuration STREQUAL "win32")
   set(WITH_FONTCONFIGURATION_WIN32 ON)
+elseif(font_configuration STREQUAL "mac")
+  set(WITH_FONTCONFIGURATION_MAC ON)
 elseif(font_configuration STREQUAL "fontconfig")
   set(WITH_FONTCONFIGURATION_FONTCONFIG ON)
 else(font_configuration STREQUAL "win32")
@@ -153,6 +158,11 @@ if(WITH_FONTCONFIGURATION_WIN32)
     add_definitions(-D_WIN32_IE=0x0500)
   endif(MINGW)
 endif(WITH_FONTCONFIGURATION_WIN32)
+
+if(WITH_FONTCONFIGURATION_MAC)
+  set(CMAKE_SHARED_LINKER_FLAGS "-framework ApplicationServices ${CMAKE_SHARED_LINKER_FLAGS}")
+endif(WITH_FONTCONFIGURATION_MAC)
+
 include_directories(
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}/fofi
diff --git a/config.h.cmake b/config.h.cmake
index 5d27156..3a65771 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -189,6 +189,9 @@
 /* Use win32 font configuration backend */
 #cmakedefine WITH_FONTCONFIGURATION_WIN32 1
 
+/* Use Mac font configuration backend */
+#cmakedefine WITH_FONTCONFIGURATION_MAC 1
+
 /* Define to 1 if the X Window System is missing or not being used. */
 /* #undef X_DISPLAY_MISSING */
 
diff --git a/configure.ac b/configure.ac
index 471f909..f7a9783 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,6 +59,9 @@ case "$host_os" in
     create_shared_lib="-no-undefined"
     auto_import_flags="-Wl,--enable-auto-import"
   ;;
+  darwin*)
+    os_mac=yes
+  ;;
 esac
 
 AC_SUBST(win32_libs)
@@ -294,12 +297,15 @@ AC_SUBST(FREETYPE_LIBS)
 
 AC_MSG_CHECKING([which font configuration to use])
 AC_ARG_WITH([font_configuration],
-   [AS_HELP_STRING([--with-font-configuration=fontconfig|win32],
+   [AS_HELP_STRING([--with-font-configuration=fontconfig|win32|mac],
                    [Select font configuration backend])],
    [],
    [if test x$os_win32 = xyes; then
         # default to win32 on native Windows.
         with_font_configuration=win32
+    elif test x$os_mac = xyes; then
+        # default to mac on native Mac.
+        with_font_configuration=mac
     else
         # default to fontconig everywhere else.
         with_font_configuration=fontconfig
@@ -315,6 +321,17 @@ case $with_font_configuration in
      # Set the minimum required Internet Explorer version to 5.0
      CPPFLAGS="$CPPFLAGS -D_WIN32_IE=0x0500"
      ;;
+  mac)
+     AC_DEFINE([WITH_FONTCONFIGURATION_MAC],
+               [1],[Use Mac OS X font configuration backend])
+     KPSE_CHECK_FRAMEWORK([ApplicationServices], [ATSFontRef fontRef])
+     if test x$kpse_cv_have_ApplicationServices != xyes; then
+        AC_MSG_ERROR([invalid font configuration setting: mac
+           You do not seem to have the ApplicationServices framework
+           Please install it or set the font configuration method manually
+           (e.g., --with-font-configuration=fontconfig).])
+     fi
+  ;;
   fontconfig)
      AC_DEFINE([WITH_FONTCONFIGURATION_FONTCONFIG],
                [1],[Use fontconfig font configuration backend])
diff --git a/m4/mac-framework.m4 b/m4/mac-framework.m4
index e69de29..8a060ee 100644
--- a/m4/mac-framework.m4
+++ b/m4/mac-framework.m4
@@ -0,0 +1,30 @@
+# based on kpse-macos-framework.m4 from the TeX Live source tree
+# -------------------------------------------------------------------
+# Original copyright notice:
+#
+# Public macros for the TeX Live (TL) tree.
+# Copyright (C) 2005 - 2008 Jonathan Kew <jfkthame@gmail.com>
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holders
+# give unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+# -------------------------------------------------------------------
+#
+# serial 0
+
+# KPSE_CHECK_FRAMEWORK(FRAMEWORK, BODY)
+# -------------------------------------
+# Check for the Mac OS X framework FRAMEWORK (using BODY) and if found,
+# set kpse_cv_have_FRAMEWORK to yes and define HAVE_FRAMEWORK.
+AC_DEFUN([KPSE_CHECK_FRAMEWORK],
+[AC_CACHE_CHECK([for Mac OS X $1 framework],
+                [kpse_cv_have_$1],
+                [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <$1/$1.h>]],
+                                                    [[$2]])],
+                                   [kpse_cv_have_$1=yes],
+                                   [kpse_cv_have_$1=no])])
+AS_IF([test "x$kpse_cv_have_$1" = xyes],
+      [AC_DEFINE([HAVE_]AS_TR_CPP([$1]), 1,
+                 [Define to 1 if you have the Mac OS X $1 framework.])])[]dnl
+]) # KPSE_CHECK_FRAMEWORK
diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index 4657c07..e2c7172 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -702,6 +702,10 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
   baseFontsInitialized = gFalse;
   winFontList = NULL;
 #endif
+#if WITH_FONTCONFIGURATION_MAC
+  tempFontFiles = NULL;
+  numTempFontFiles = 0;
+#endif
 
 #ifdef ENABLE_PLUGINS
   plugins = new GooList();
@@ -867,6 +871,12 @@ GlobalParams::~GlobalParams() {
 #ifdef _WIN32
   delete winFontList;
 #endif
+#if WITH_FONTCONFIGURATION_MAC
+  while (numTempFontFiles > 0) {
+    --numTempFontFiles;
+    unlink(tempFontFiles[numTempFontFiles]);
+  }
+#endif
   deleteGooHash(psFonts, PSFontParam);
   deleteGooList(psNamedFonts16, PSFontParam);
   deleteGooList(psFonts16, PSFontParam);
@@ -1231,6 +1241,9 @@ fin:
 #if WITH_FONTCONFIGURATION_WIN32
 #include "GlobalParamsWin.cc"
 #endif
+#if WITH_FONTCONFIGURATION_MAC
+#include "GlobalParamsMac.cc"
+#endif
 
 GBool GlobalParams::getPSExpandSmaller() {
   GBool f;
diff --git a/poppler/GlobalParams.h b/poppler/GlobalParams.h
index 941a536..e7bc266 100644
--- a/poppler/GlobalParams.h
+++ b/poppler/GlobalParams.h
@@ -173,6 +173,9 @@ public:
 #if WITH_FONTCONFIGURATION_WIN32
   void setupBaseFonts(char *dir);
 #endif
+#if WITH_FONTCONFIGURATION_MAC
+  GBool loadPlatformFont(char * fontName);
+#endif
 
   //----- accessors
 
@@ -308,6 +311,10 @@ private:
   GBool baseFontsInitialized;
   WinFontList *winFontList;	// system TrueType fonts
 #endif
+#if WITH_FONTCONFIGURATION_MAC
+  char **tempFontFiles;
+  int numTempFontFiles;
+#endif
   GBool psExpandSmaller;	// expand smaller pages to fill paper
   GBool psShrinkLarger;		// shrink larger pages to fit paper
   GBool psCenter;		// center pages on the paper
diff --git a/poppler/GlobalParamsMac.cc b/poppler/GlobalParamsMac.cc
index e69de29..ce3cf81 100644
--- a/poppler/GlobalParamsMac.cc
+++ b/poppler/GlobalParamsMac.cc
@@ -0,0 +1,297 @@
+//========================================================================
+//
+// GlobalParamsMac.cc
+//
+//========================================================================
+
+//========================================================================
+//
+// Contributed to the Poppler project - http://poppler.freedesktop.org
+//
+// Copyright (c) 2009 Jonathan Kew
+//
+//========================================================================
+
+#ifndef PACKAGE_NAME
+#include <config.h>
+#endif
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <string.h>
+#include <stdio.h>
+
+#include "goo/gmem.h"
+#include "goo/GooString.h"
+#include "goo/GooList.h"
+#include "goo/GooHash.h"
+#include "goo/gfile.h"
+#include "Error.h"
+
+#include "GlobalParams.h"
+#include "GfxFont.h"
+
+#if MULTITHREADED
+#  define lockGlobalParams            gLockMutex(&mutex)
+#  define lockUnicodeMapCache         gLockMutex(&unicodeMapCacheMutex)
+#  define lockCMapCache               gLockMutex(&cMapCacheMutex)
+#  define unlockGlobalParams          gUnlockMutex(&mutex)
+#  define unlockUnicodeMapCache       gUnlockMutex(&unicodeMapCacheMutex)
+#  define unlockCMapCache             gUnlockMutex(&cMapCacheMutex)
+#else
+#  define lockGlobalParams
+#  define lockUnicodeMapCache
+#  define lockCMapCache
+#  define unlockGlobalParams
+#  define unlockUnicodeMapCache
+#  define unlockCMapCache
+#endif
+
+/* Mac implementation of external font matching code */
+
+#include <ApplicationServices/ApplicationServices.h>
+
+GBool GlobalParams::loadPlatformFont(char * fontName) {
+
+  char * myName = copyString(fontName);
+  ATSFontRef fontRef = kATSUInvalidFontID;
+  while (1) {
+    CFStringRef psName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault,
+							 myName,
+							 kCFStringEncodingASCII,
+							 kCFAllocatorNull);
+    fontRef = ATSFontFindFromPostScriptName(psName, kATSOptionFlagsDefault);
+    CFRelease(psName);
+    if (fontRef != kATSUInvalidFontID)
+      break;
+    char * cp = strrchr(myName, ',');
+    if (cp) {
+      *cp = '\0';
+      continue;
+    }
+    cp = strrchr(myName, '-');
+    if (cp) {
+      *cp = '\0';
+      continue;
+    }
+    if ( strcmp(myName, "ZapfDingbats") == 0 ) {
+      // On OS X 10.5.0 -- 10.6.7 (plus or minus a few versions?) the
+      // PostScript name of ZapfDingbats is ZapfDingbatsITC
+      gfree(myName);
+      myName = copyString("ZapfDingbatsITC");
+      continue;
+    }
+    break;
+  }
+  gfree(myName);
+  if (fontRef == kATSUInvalidFontID)
+    return gFalse;
+
+  // Currently support only TrueType fonts: check for presence of 'glyf' table
+  // TODO: what about OpenType/CFF? DisplayFontParam doesn't seem to allow for this
+#define TAG(a,b,c,d) ( (UInt32)((a)<<24) | (UInt32)((b)<<16) | (UInt32)((c)<<8) | (UInt32)(d) )
+
+  ByteCount tableSize;
+  if (ATSFontGetTable(fontRef, TAG('g','l','y','f'), 0, 0, NULL, &tableSize) != noErr ||
+      tableSize == 0)
+    return gFalse;
+
+  do { // if the font comes from a .ttf file, we can use that directly
+    FSRef fsRef;
+    if (ATSFontGetFileReference(fontRef, &fsRef) != noErr)
+      break;
+
+    UInt8 fontPath[PATH_MAX + 1];
+    if (FSRefMakePath(&fsRef, fontPath, PATH_MAX) != noErr)
+      break;
+
+    int pathLen = strlen((const char *) fontPath);
+    if (pathLen > 4 && fontPath[pathLen - 4] == '.') {
+      const char * ext = (const char *) fontPath + pathLen - 3;
+
+      // accept either .ttf or .otf extension; .otf could contain TrueType-format glyphs
+      if (strcmp(ext, "ttf") == 0 || strcmp(ext, "TTF") == 0 ||
+          strcmp(ext, "otf") == 0 || strcmp(ext, "OTF") == 0) {
+        DisplayFontParam *dfp = new DisplayFontParam(new GooString(fontName), displayFontTT);
+        dfp->setFileName(new GooString((const char *) fontPath));
+        displayFonts->add(dfp->name, dfp);
+        return gTrue;
+      }
+    }
+  } while (0);
+
+  // for .dfont or suitcase files, FoFiTrueType can't handle them, so we extract
+  // the required font to a temporary .ttf file and then use that
+
+  struct sfntHeader {
+    UInt32 version;
+    UInt16 numTables;
+    UInt16 searchRange;
+    UInt16 entrySelector;
+    UInt16 rangeShift;
+    struct {
+      UInt32 tag;
+      UInt32 checkSum;
+      UInt32 offset;
+      UInt32 length;
+    } dir[1];
+  };
+
+  ByteCount headerSize;
+  if (ATSFontGetTableDirectory(fontRef, 0, NULL, &headerSize) != noErr)
+    return gFalse;
+  struct sfntHeader * header = (struct sfntHeader *) new Byte[headerSize];
+  ATSFontGetTableDirectory(fontRef, headerSize, (Byte *) header, &headerSize);
+
+#define READ16(x) ( (UInt16)(((UInt8*)&(x))[0]<<8) + (UInt16)((UInt8*)&(x))[1] )
+#define READ32(x) ( (UInt32)(((UInt8*)&(x))[0]<<24) + (UInt32)(((UInt8*)&(x))[1]<<16) + (UInt32)(((UInt8*)&(x))[2]<<8) + (UInt32)((UInt8*)&(x))[3] )
+
+  UInt32 version = READ32(header->version);
+  if (version != 0x00010000 &&
+// TODO: figure out whether we can support OpenType/CFF fonts here
+//      version != TAG('O','T','T','0') &&
+      version != TAG('t','r','u','e')) {
+    delete [] (Byte *) header;
+    return gFalse;
+  }
+
+  UInt16 numTables = READ16(header->numTables);
+  UInt32 maxOffset = 0;
+  for (UInt16 i = 0; i < numTables; ++i) {
+    UInt32 end = READ32(header->dir[i].offset) + READ32(header->dir[i].length);
+    if (end > maxOffset)
+      maxOffset = end;
+  }
+
+  char * ttfData = new char[maxOffset];
+  struct sfntHeader * newFont = (struct sfntHeader *) ttfData;
+
+  newFont->version = header->version;
+
+  UInt16 realTables = 0, tableIndex;
+  for (tableIndex = 0; tableIndex < numTables; ++tableIndex) {
+    ByteCount tableLoc = READ32(header->dir[tableIndex].offset);
+    if (tableLoc == 0) // ATS synthetic table, do not copy
+      continue;
+    tableSize = READ32(header->dir[tableIndex].length);
+    if (ATSFontGetTable(fontRef, READ32(header->dir[tableIndex].tag),
+                        0, tableSize, ttfData + tableLoc, &tableSize) != noErr)
+      break;
+    newFont->dir[realTables] = header->dir[tableIndex];
+    realTables++;
+  }
+  delete [] (Byte*) header;
+  if (tableIndex < numTables) {
+    delete [] ttfData;
+    return gFalse;
+  }
+
+  newFont->numTables = READ16(realTables);
+  UInt16 searchRange = realTables;
+  searchRange |= searchRange >> 1;
+  searchRange |= searchRange >> 2;
+  searchRange |= searchRange >> 4;
+  searchRange |= searchRange >> 8;
+  searchRange &= ~searchRange >> 1;
+  searchRange *= 16;
+  newFont->searchRange = READ16(searchRange);
+  UInt16 rangeShift = realTables * 16 - searchRange;
+  UInt16 entrySelector = 0;
+  while (searchRange > 16) {
+    ++entrySelector;
+    searchRange >>= 1;
+  }
+  newFont->entrySelector = READ16(entrySelector);
+  newFont->rangeShift = READ16(rangeShift);
+
+  char * fontPath = copyString("/tmp/XXXXXXXX.ttf");
+  if (mkstemps(fontPath, 4) == -1) {
+    delete [] ttfData;
+    gfree(fontPath);
+    return gFalse;
+  }
+
+  GBool writtenOk = gFalse;
+  FILE * ttfFile = fopen(fontPath, "wb");
+  if (ttfFile) {
+    writtenOk = (fwrite(ttfData, 1, maxOffset, ttfFile) == maxOffset);
+    fclose(ttfFile);
+  }
+  delete [] ttfData;
+  if (!writtenOk) {
+    unlink(fontPath);
+    gfree(fontPath);
+    return gFalse;
+  }
+
+  void * p = realloc(tempFontFiles, (numTempFontFiles + 1) * sizeof(char *));
+  if (!p) {
+    unlink(fontPath);
+    gfree(fontPath);
+    return gFalse;
+  }
+  tempFontFiles = (char **) p;
+  tempFontFiles[numTempFontFiles] = fontPath;
+  ++numTempFontFiles;
+
+  DisplayFontParam * dfp = new DisplayFontParam(new GooString(fontName), displayFontTT);
+  dfp->setFileName(new GooString(fontPath));
+  displayFonts->add(dfp->name, dfp);
+
+  return gTrue;
+}
+
+static const char *
+findSubstituteName(char * fontName) {
+  GBool bold = (strstr(fontName, "Bold") != NULL ||
+                strstr(fontName, "bold") != NULL || // to catch "Semibold", "Demibold", etc
+                strstr(fontName, "Ultra") != NULL ||
+                strstr(fontName, "Heavy") != NULL ||
+                strstr(fontName, "Black") != NULL);
+  GBool ital = (strstr(fontName, "Italic") != NULL ||
+                strstr(fontName, "Oblique") != NULL);
+  if (bold) {
+    return ital ? "Helvetica-BoldOblique" : "Helvetica-Bold";
+  } else {
+    return ital ? "Helvetica-Oblique" : "Helvetica";
+  }
+}
+
+DisplayFontParam *GlobalParams::getDisplayFont(GfxFont *font) {
+  DisplayFontParam *  dfp;
+  GooString *         fontName = font->getName();
+  char *              substFontName = NULL;
+
+  if (!fontName) return NULL;
+  lockGlobalParams;
+
+  dfp = (DisplayFontParam *)displayFonts->lookup(fontName);
+  if (!dfp) {
+    if (loadPlatformFont(fontName->getCString()))
+      dfp = (DisplayFontParam *)displayFonts->lookup(fontName);
+    if (!dfp) {
+      substFontName = (char *) findSubstituteName(fontName->getCString());
+      error(-1, "Couldn't find a font for '%s', subst is '%s'", fontName->getCString(), substFontName);
+      DisplayFontParam * subst = (DisplayFontParam *)displayFonts->lookup(substFontName);
+      if (!subst) {
+        if (loadPlatformFont(substFontName))
+          subst = (DisplayFontParam *)displayFonts->lookup(substFontName);
+      }
+      if (subst) {
+        dfp = new DisplayFontParam(new GooString(fontName), subst->kind);
+        if (subst->kind == displayFontT1)
+          dfp->setFileName(new GooString(subst->t1.fileName));
+        else
+          dfp->setFileName(new GooString(subst->tt.fileName));
+      }
+    }
+  }
+  // this isn't supposed to fail, because the substitutes are system fonts
+  // that should always be available
+  assert(dfp);
+
+  unlockGlobalParams;
+  return dfp;
+}
diff --git a/poppler/poppler-config.h.cmake b/poppler/poppler-config.h.cmake
index 2c47ab3..05eb474 100644
--- a/poppler/poppler-config.h.cmake
+++ b/poppler/poppler-config.h.cmake
@@ -44,6 +44,11 @@
 #cmakedefine WITH_FONTCONFIGURATION_WIN32 1
 #endif
 
+/* Use Mac font configuration backend */
+#ifndef WITH_FONTCONFIGURATION_MAC
+#cmakedefine WITH_FONTCONFIGURATION_MAC 1
+#endif
+
 /* Support for curl is compiled in. */
 #ifndef POPPLER_HAS_CURL_SUPPORT
 #cmakedefine POPPLER_HAS_CURL_SUPPORT 1
diff --git a/poppler/poppler-config.h.in b/poppler/poppler-config.h.in
index f2b70cc..d93bb13 100644
--- a/poppler/poppler-config.h.in
+++ b/poppler/poppler-config.h.in
@@ -44,6 +44,11 @@
 #undef WITH_FONTCONFIGURATION_WIN32
 #endif
 
+/* Use mac font configuration backend */
+#ifndef WITH_FONTCONFIGURATION_MAC
+#undef WITH_FONTCONFIGURATION_MAC
+#endif
+
 /* Support for curl is compiled in. */
 #ifndef POPPLER_HAS_CURL_SUPPORT
 #undef POPPLER_HAS_CURL_SUPPORT
