improved docmaker slightly (better indexing, support for "<order>" marker in section blocks, see "fttypes.h")
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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
diff --git a/ChangeLog b/ChangeLog
index 6df5fa0..145fda3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-02-01 David Turner <david.turner@freetype.org>
+
+ * docs/docmaker.py: improved the index sorting routine to place capital
+ letters before small ones. added the "<order>" marker to section blocks
+ in order to give the order of blocks
+
2001-01-24 Tom Kacvinsky <tjk@ams.org>
* src/cff/t1load.c (parse_font_matrix): Added heuristic to get
diff --git a/docs/docmaker.py b/docs/docmaker.py
index ac1c2d7..f02bdc0 100644
--- a/docs/docmaker.py
+++ b/docs/docmaker.py
@@ -42,8 +42,8 @@ code_footer = "</pre></font>"
para_header = "<p>"
para_footer = "</p>"
-block_header = "<center><hr width=75%><table width=75%><tr><td>"
-block_footer = "</td></tr></table></center>"
+block_header = "<center><table width=75%><tr><td>"
+block_footer = "</td></tr></table><hr width=75%></center>"
description_header = "<center><table width=87%><tr><td>"
description_footer = "</td></tr></table></center><br>"
@@ -59,6 +59,41 @@ source_footer = "</pre></table></center><br>"
current_section = None
+# this function is used to sort the index. it's a simple lexicographical
+# sort, except that it places capital letters before small ones
+#
+def index_sort( s1, s2 ):
+
+ if not s1:
+ return -1
+
+ if not s2:
+ return 1
+
+ l1 = len(s1)
+ l2 = len(s2)
+ m1 = string.lower(s1)
+ m2 = string.lower(s2)
+
+ for i in range(l1):
+ if i >= l2 or m1[i] > m2[i]:
+ return 1
+
+ if m1[i] < m2[i]:
+ return -1
+
+ if s1[i] < s2[i]:
+ return -1
+
+ if s1[i] > s2[i]:
+ return 1
+
+ if l2 > l1:
+ return -1
+
+ return 0
+
+
# The FreeType 2 reference is extracted from the source files. These contain
# various comment blocks that follow one of the following formats:
#
@@ -239,6 +274,10 @@ class DocParagraph:
return "UNKNOWN_PARA_IDENTIFIER!"
+ def get_words( self ):
+ return self.words[:]
+
+
def dump( self, identifiers = None ):
max_width = 50
cursor = 0
@@ -882,6 +921,50 @@ class DocSectionList:
else:
section.title = "UNKNOWN_SECTION_TITLE!"
+ # sort section elements according to the <order> marker when
+ # available
+ for section in self.sections.values():
+ order = section.block.find_content( "order" )
+ if order:
+ #sys.stderr.write( "<order> found at "+section.block.location()+'\n' )
+ order_list = []
+ for item in order.items:
+ for element in item[1]:
+ words = None
+ try:
+ words = element.get_words()
+ except:
+ sys.stderr.write( "WARNING:" +
+ section.block.location() +
+ ": invalid content in <order> marker\n" )
+ if words:
+ for word in words:
+ block = self.identifiers.get( word )
+ if block:
+ if block.section == section:
+ order_list.append( word )
+ else:
+ sys.stderr.write( "WARNING:" +
+ section.block.location() +
+ ": invalid reference to '"+word+"' defined in other section\n" )
+ else:
+ sys.stderr.write( "WARNING:" +
+ section.block.location() +
+ ": invalid reference to '"+word+"'\n" )
+
+ # now sort the list of blocks according to the order list
+ #
+ new_list = []
+ old_list = section.list
+ for id in order_list:
+ new_list.append( section.elements[id] )
+
+ for block in old_list:
+ if not block.name in order_list:
+ new_list.append( block )
+
+ section.list = new_list
+
# compute section filenames
#
for section in self.sections.values():
@@ -893,7 +976,7 @@ class DocSectionList:
# compute the sorted list of identifiers for the index
#
self.index = self.identifiers.keys()
- self.index.sort()
+ self.index.sort( index_sort )
def dump_html_toc( self ):
@@ -972,6 +1055,8 @@ class DocSectionList:
sys.stdout = old_stdout
+
+
# Filter a given list of DocBlocks. Returns a new list
# of DocBlock objects that only contains element whose
# "type" (i.e. first marker) is in the "types" parameter.
@@ -1046,7 +1131,7 @@ def make_block_list():
"""parse a file and extract comments blocks from it"""
file_list = []
- sys.stderr.write( repr( sys.argv[1:] ) + '\n' )
+ #sys.stderr.write( repr( sys.argv[1:] ) + '\n' )
for pathname in sys.argv[1:]:
if string.find( pathname, '*' ) >= 0:
diff --git a/include/freetype/fttypes.h b/include/freetype/fttypes.h
index a31c00f..9dbf338 100644
--- a/include/freetype/fttypes.h
+++ b/include/freetype/fttypes.h
@@ -45,6 +45,23 @@ FT_BEGIN_HEADER
/* This section contains the basic data types defined by FreeType 2, */
/* ranging from simple scalar types to font specific ones. */
/* */
+ /* <Order> */
+ /* FT_Byte FT_Char FT_Int FT_UInt FT_Short FT_UShort FT_Long */
+ /* FT_ULong FT_Fixed FT_Pointer FT_Vector FT_Matrix FT_BBox */
+ /* */
+ /* */
+ /* */
+ /* */
+ /* */
+ /* */
+ /* */
+ /* */
+ /* */
+ /* */
+ /* */
+ /* */
+ /* */
+ /* */
/*************************************************************************/