* src/tools/docmaker/docmaker.py, src/tools/docmaker/utils.py, src/tools/docmaker/tohtml.py: updating the DocMaker tool
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
diff --git a/ChangeLog b/ChangeLog
index 8e5a7bb..c51a093 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2002-08-21 David Turner <david@freetype.org>
+
+ * src/pshinter/pshalgo3.c, src/autohint/ahangles.c,
+ src/autohint/ahangles.h, src/autohint/ahglyph.c, src/autohint/ahhint.c,
+ src/autohint/ahtypes.h: the automatic and Postscript hinter now
+ automatically detect inflection points in glyph outlines and treats
+ them specially. This is very useful to prevent nasty effect like the
+ disappearing diagonals of "S" and "s" in many, many fonts..
+
+ * src/tools/docmaker/docmaker.py, src/tools/docmaker/utils.py,
+ src/tools/docmaker/tohtml.py: updating the DocMaker tool
+
+
2002-08-20 Werner Lemberg <wl@gnu.org>
* src/truetype/ttgload.c (TT_Get_Metrics): Add guard for k = 0.
diff --git a/src/tools/docmaker/docmaker.py b/src/tools/docmaker/docmaker.py
index a502c9c..285bcd6 100644
--- a/src/tools/docmaker/docmaker.py
+++ b/src/tools/docmaker/docmaker.py
@@ -13,9 +13,13 @@
# to speed things significantly
#
-from sources import *
-from content import *
-from tohtml import *
+from sources import *
+from content import *
+from utils import *
+from formatter import *
+from tohtml import *
+
+import utils
import sys, os, time, string, glob, getopt
@@ -28,7 +32,7 @@ def file_exists( pathname ):
file.close()
except:
result = None
- sys.err.write( pathname + " couldn't be accessed\n" )
+ sys.stderr.write( pathname + " couldn't be accessed\n" )
return result
@@ -50,8 +54,7 @@ def make_file_list( args = None ):
else:
newpath = [pathname]
- last = len( file_list )
- file_list[last : last] = newpath
+ file_list.extend( newpath )
if len( file_list ) == 0:
file_list = None
@@ -68,13 +71,24 @@ def usage():
print " docmaker [options] file1 [ file2 ... ]\n"
print "using the following options:\n"
print " -h : print this page"
+ print " -t : set project title, as in '-t \"My Project\"'"
+ print " -o : set output directory, as in '-o mydir'"
+ print " -p : set documentation prefix, as in '-p ft2'"
+ print ""
+ print " --title : same as -t, as in '--title=\"My Project\"'"
+ print " --output : same as -o, as in '--output=mydir'"
+ print " --prefix : same as -p, as in '--prefix=ft2'"
def main( argv ):
"""main program loop"""
+ global output_dir
+
try:
- opts, args = getopt.getopt( argv[1:],"h", [ "help" ] )
+ opts, args = getopt.getopt( sys.argv[1:],
+ "ht:o:p:",
+ [ "help", "title=", "output=", "prefix=" ] )
except getopt.GetoptError:
usage()
@@ -86,17 +100,32 @@ def main( argv ):
# process options
#
+ project_title = "Project"
+ project_prefix = None
+ output_dir = None
+
for opt in opts:
if opt[0] in ( "-h", "--help" ):
usage()
sys.exit( 0 )
+ if opt[0] in ( "-t", "--title" ):
+ project_title = opt[1]
+
+ if opt[0] in ( "-o", "--output" ):
+ utils.output_dir = opt[1]
+
+ if opt[0] in ( "-p", "--prefix" ):
+ project_prefix = opt[1]
+
+ check_output( )
+
# create context and processor
source_processor = SourceProcessor()
content_processor = ContentProcessor()
# retrieve the list of files to process
- file_list = make_file_list()
+ file_list = make_file_list( args )
for filename in file_list:
source_processor.parse_file( filename )
content_processor.parse_sources( source_processor )
@@ -104,7 +133,7 @@ def main( argv ):
# process sections
content_processor.finish()
- formatter = HtmlFormatter( content_processor, "Example", "zz" )
+ formatter = HtmlFormatter( content_processor, project_title, project_prefix )
formatter.toc_dump()
formatter.index_dump()
diff --git a/src/tools/docmaker/tohtml.py b/src/tools/docmaker/tohtml.py
index 1067d34..fcc0e6d 100644
--- a/src/tools/docmaker/tohtml.py
+++ b/src/tools/docmaker/tohtml.py
@@ -1,6 +1,7 @@
from sources import *
from content import *
from formatter import *
+
import time
# The following defines the HTML header used by all generated pages.
diff --git a/src/tools/docmaker/utils.py b/src/tools/docmaker/utils.py
index f27353e..6d4653d 100644
--- a/src/tools/docmaker/utils.py
+++ b/src/tools/docmaker/utils.py
@@ -1,4 +1,9 @@
-import string, sys
+import string, sys, os
+
+# current output directory
+#
+output_dir = None
+
# This function is used to sort the index. It is a simple lexicographical
# sort, except that it places capital letters before lowercase ones.
@@ -43,10 +48,6 @@ def sort_order_list( input_list, order_list ):
return new_list
-# current output directory
-#
-output_dir = None
-
# Open the standard output to a given project documentation file. Use
# "output_dir" to determine the filename location if necessary and save the