disable loading of CMAPS
authorandy
Tue, 23 May 2006 14:49:28 +0000
changeset 2633 9877f90e0ad9
parent 2632 b138d15f7c40
child 2634 1cfe7901ae99
disable loading of CMAPS
reportlab/pdfbase/cidfonts.py
--- a/reportlab/pdfbase/cidfonts.py	Tue May 23 14:19:54 2006 +0000
+++ b/reportlab/pdfbase/cidfonts.py	Tue May 23 14:49:28 2006 +0000
@@ -25,6 +25,11 @@
 from reportlab.rl_config import CMapSearchPath
 
 
+#quick hackery for 2.0 release.  Now we always do unicode, and have built in
+#the CMAP data, any code to load CMap files is not needed.
+DISABLE_CMAP = True
+
+
 def findCMapFile(name):
     "Returns full filename, or raises error"
     for dirname in CMapSearchPath:
@@ -68,18 +73,19 @@
         self._notDefRanges = []
         self._cmap = {}
         self.source = None
-        if useCache:
-            from reportlab.lib.utils import get_rl_tempdir
-            fontmapdir = get_rl_tempdir('FastCMAPS')
-            if os.path.isfile(fontmapdir + os.sep + name + '.fastmap'):
-                self.fastLoad(fontmapdir)
-                self.source = fontmapdir + os.sep + name + '.fastmap'
+        if not DISABLE_CMAP:
+            if useCache:
+                from reportlab.lib.utils import get_rl_tempdir
+                fontmapdir = get_rl_tempdir('FastCMAPS')
+                if os.path.isfile(fontmapdir + os.sep + name + '.fastmap'):
+                    self.fastLoad(fontmapdir)
+                    self.source = fontmapdir + os.sep + name + '.fastmap'
+                else:
+                    self.parseCMAPFile(name)
+                    self.source = 'CMAP: ' + name
+                    self.fastSave(fontmapdir)
             else:
                 self.parseCMAPFile(name)
-                self.source = 'CMAP: ' + name
-                self.fastSave(fontmapdir)
-        else:
-            self.parseCMAPFile(name)
 
     def _hash(self, text):
         hasher = md5.new()