SourceForge logo
SourceForge logo
Menu

matplotlib-checkins

From: <jo...@us...> - 2007年09月15日 04:01:58
Revision: 3853
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3853&view=rev
Author: jouni
Date: 2007年09月14日 21:01:56 -0700 (2007年9月14日)
Log Message:
-----------
Bugfix and doc fixes in type1font.py
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/type1font.py
Modified: trunk/matplotlib/lib/matplotlib/type1font.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/type1font.py	2007年09月14日 17:57:52 UTC (rev 3852)
+++ trunk/matplotlib/lib/matplotlib/type1font.py	2007年09月15日 04:01:56 UTC (rev 3853)
@@ -1,15 +1,15 @@
 """
 A class representing a Type 1 font.
 
-This version merely allows reading in pfa and pfb files, stores the
-data in pfa format, and allows reading the parts of the data in a
-format suitable for embedding in pdf files. A more complete class
-might support subsetting.
+This version merely reads pfa and pfb files and splits them for
+embedding in pdf files. There is no support yet for subsetting or
+anything like that.
 
-Usage: font = Type1Font(filename)
- somefile.write(font.data) # writes out font in pfa format
- len1, len2, len3 = font.lengths() # needed for pdf embedding
+Usage (subject to change):
 
+ font = Type1Font(filename)
+ clear_part, encrypted_part, finale = font.parts
+
 Source: Adobe Technical Note #5040, Supporting Downloadable PostScript
 Language Fonts.
 
@@ -32,8 +32,7 @@
 def _read(self, file):
 rawdata = file.read()
 if not rawdata.startswith(chr(128)):
- self.data = rawdata
- return
+ return rawdata
 
 data = ''
 while len(rawdata) > 0:
@@ -101,4 +100,6 @@
 if __name__ == '__main__':
 import sys
 font = Type1Font(sys.argv[1])
- sys.stdout.write(font.data)
+ parts = font.parts
+ print len(parts[0]), len(parts[1]), len(parts[2])
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /