Make reference valid HTML 4.01 transitional. * src/tools/docmaker/tohtml.py (html_header_1): Add doctype and charset. (html_header_2): Fix style elements and add some more. Fix syntax. (block_header, block_footer, description_header, description_footer, marker_header, marker_footer, source_header, source_footer, chapter_header, chapter_footer): Don't use <center>...</center> but `align=center' table attribute. Use double quotes around table widths given in percent. (keyword_prefix, keyword_suffix): Don't change font colour directly but use a new <span> class. (section_synopsis_header, section_synopsis_footer): Don't change colour. (print_html_field): <tr> gets the `valign' attribute, not <table>. (print_html_field_list): Ditto. (index_exit): Don't use <center>...</center> but `align=center' table attribute. (toc_exit, section_enter): Ditto. (block_enter): Use <h4><a>, not <a><h4>. This change reimplements fix from 2003-05-30 without breaking binary compatibility. * include/freetype/t1tables.h (PS_FontInfoRec): `italic_angle', `is_fixed_pitch', `underline_position', `underline_thickness' are reverted to be normal values. * include/freetype/internal/psaux.h (T1_FieldType): Remove `T1_FIELD_TYPE_BOOL_P', `T1_FIELD_TYPE_INTEGER_P', `T1_FIELD_TYPE_FIXED_P', `T1_FIELD_TYPE_FIXED_1000_P'. (T1_FIELD_TYPE_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P, T1_FIELD_FIXED_1000_P): Removed. (T1_FIELD_TYPE_BOOL): Renamed to... (T1_FIELD_BOOL): New macro. Updated all callers. * src/type42/t42parse.c: `italic_angle', `is_fixed_pitch', `underline_position', `underline_thickness', `paint_type', `stroke_width' are reverted to be normal values. (T42_KEYWORD_COUNT): New macro. (t42_parse_dict): New array `keyword_flags' to mark that a value has already been assigned to a dictionary entry. * src/type42/t42objs.c (T42_Face_Init, T42_Face_Done): Updated. * src/cid/cidtoken.h: `italic_angle', `is_fixed_pitch', `underline_position', `underline_thickness' are reverted to be normal values. * src/cid/cidobjs.c (cid_face_done, cid_face_init): Updated. * src/psaux/psobjs.c (ps_parser_load_field): Updated. * src/type1/t1tokens.h: `italic_angle', `is_fixed_pitch', `underline_position', `underline_thickness', `paint_type', `stroke_width' are reverted to be normal values. * src/type1/t1objs.c (T1_Face_Done, T1_Face_Init): Updated. * src/type1/t1load.c (T1_FIELD_COUNT): New macro. (parse_dict): Add parameter for keyword flags. Record only first instance of a field. (T1_Open_Face): New array `keyword_flags'.
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 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894
diff --git a/ChangeLog b/ChangeLog
index d1a65c8..cf1b97b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,68 @@
+2003-07-25 Werner Lemberg <wl@gnu.org>
+
+ Make reference valid HTML 4.01 transitional.
+
+ * src/tools/docmaker/tohtml.py (html_header_1): Add doctype
+ and charset.
+ (html_header_2): Fix style elements and add some more.
+ Fix syntax.
+ (block_header, block_footer, description_header, description_footer,
+ marker_header, marker_footer, source_header, source_footer,
+ chapter_header, chapter_footer): Don't use <center>...</center> but
+ `align=center' table attribute.
+ Use double quotes around table widths given in percent.
+ (keyword_prefix, keyword_suffix): Don't change font colour directly
+ but use a new <span> class.
+ (section_synopsis_header, section_synopsis_footer): Don't change
+ colour.
+ (print_html_field): <tr> gets the `valign' attribute, not <table>.
+ (print_html_field_list): Ditto.
+ (index_exit): Don't use <center>...</center> but `align=center'
+ table attribute.
+ (toc_exit, section_enter): Ditto.
+ (block_enter): Use <h4><a>, not <a><h4>.
+
+2003-07-25 David Turner <david@freetype.org>
+
+ This change reimplements fix from 2003-05-30 without breaking
+ binary compatibility.
+
+ * include/freetype/t1tables.h (PS_FontInfoRec): `italic_angle',
+ `is_fixed_pitch', `underline_position', `underline_thickness' are
+ reverted to be normal values.
+
+ * include/freetype/internal/psaux.h (T1_FieldType): Remove
+ `T1_FIELD_TYPE_BOOL_P', `T1_FIELD_TYPE_INTEGER_P',
+ `T1_FIELD_TYPE_FIXED_P', `T1_FIELD_TYPE_FIXED_1000_P'.
+ (T1_FIELD_TYPE_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P,
+ T1_FIELD_FIXED_1000_P): Removed.
+ (T1_FIELD_TYPE_BOOL): Renamed to...
+ (T1_FIELD_BOOL): New macro. Updated all callers.
+
+ * src/type42/t42parse.c: `italic_angle', `is_fixed_pitch',
+ `underline_position', `underline_thickness', `paint_type',
+ `stroke_width' are reverted to be normal values.
+ (T42_KEYWORD_COUNT): New macro.
+ (t42_parse_dict): New array `keyword_flags' to mark that a value has
+ already been assigned to a dictionary entry.
+ * src/type42/t42objs.c (T42_Face_Init, T42_Face_Done): Updated.
+
+ * src/cid/cidtoken.h: `italic_angle', `is_fixed_pitch',
+ `underline_position', `underline_thickness' are reverted to be
+ normal values.
+ * src/cid/cidobjs.c (cid_face_done, cid_face_init): Updated.
+
+ * src/psaux/psobjs.c (ps_parser_load_field): Updated.
+
+ * src/type1/t1tokens.h: `italic_angle', `is_fixed_pitch',
+ `underline_position', `underline_thickness', `paint_type',
+ `stroke_width' are reverted to be normal values.
+ * src/type1/t1objs.c (T1_Face_Done, T1_Face_Init): Updated.
+ * src/type1/t1load.c (T1_FIELD_COUNT): New macro.
+ (parse_dict): Add parameter for keyword flags.
+ Record only first instance of a field.
+ (T1_Open_Face): New array `keyword_flags'.
+
2003-07-24 Werner Lemberg <wl@gnu.org>
* include/freetype/freetype.h (FREETYPE_PATCH): Set to 5.
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 17b4013..7f1b0b8 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -920,7 +920,7 @@ FT_BEGIN_HEADER
/* FT_FACE_FLAG_SCALABLE :: */
/* Indicates that the face provides vectorial outlines. This */
/* doesn't prevent embedded bitmaps, i.e., a face can have both */
- /* this bit and @FT_FACE_FLAG_FIXED_SIZES set */
+ /* this bit and @FT_FACE_FLAG_FIXED_SIZES set. */
/* */
/* FT_FACE_FLAG_FIXED_SIZES :: */
/* Indicates that the face contains `fixed sizes', i.e., bitmap */
diff --git a/include/freetype/ftbdf.h b/include/freetype/ftbdf.h
index f16c075..3d2d04b 100644
--- a/include/freetype/ftbdf.h
+++ b/include/freetype/ftbdf.h
@@ -95,12 +95,17 @@ FT_BEGIN_HEADER
* This structure models a given BDF/PCF property.
*
* @fields:
- * type :: The property type.
+ * type ::
+ * The property type.
*
- * u.atom :: The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
- * u.integer :: A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
- * u.cardinal :: An unsigned integer, if type is
- * @BDF_PROPERTY_TYPE_CARDINAL.
+ * u.atom ::
+ * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
+ *
+ * u.integer ::
+ * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
+ *
+ * u.cardinal ::
+ * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
*/
typedef struct BDF_PropertyRec_
{
diff --git a/include/freetype/internal/psaux.h b/include/freetype/internal/psaux.h
index 71e0331..c7093fe 100644
--- a/include/freetype/internal/psaux.h
+++ b/include/freetype/internal/psaux.h
@@ -175,13 +175,9 @@ FT_BEGIN_HEADER
{
T1_FIELD_TYPE_NONE = 0,
T1_FIELD_TYPE_BOOL,
- T1_FIELD_TYPE_BOOL_P,
T1_FIELD_TYPE_INTEGER,
- T1_FIELD_TYPE_INTEGER_P,
T1_FIELD_TYPE_FIXED,
- T1_FIELD_TYPE_FIXED_P,
T1_FIELD_TYPE_FIXED_1000,
- T1_FIELD_TYPE_FIXED_1000_P,
T1_FIELD_TYPE_STRING,
T1_FIELD_TYPE_KEY,
T1_FIELD_TYPE_BBOX,
@@ -267,30 +263,18 @@ FT_BEGIN_HEADER
},
-#define T1_FIELD_TYPE_BOOL( _ident, _fname ) \
+#define T1_FIELD_BOOL( _ident, _fname ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BOOL, _fname )
-#define T1_FIELD_TYPE_BOOL_P( _ident, _fname ) \
- T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BOOL_P, _fname )
-
#define T1_FIELD_NUM( _ident, _fname ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER, _fname )
-#define T1_FIELD_NUM_P( _ident, _fname ) \
- T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER_P, _fname )
-
#define T1_FIELD_FIXED( _ident, _fname ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED, _fname )
-#define T1_FIELD_FIXED_P( _ident, _fname ) \
- T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_P, _fname )
-
#define T1_FIELD_FIXED_1000( _ident, _fname ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_1000, _fname )
-#define T1_FIELD_FIXED_1000_P( _ident, _fname ) \
- T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_1000_P, _fname )
-
#define T1_FIELD_STRING( _ident, _fname ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname )
diff --git a/include/freetype/t1tables.h b/include/freetype/t1tables.h
index dd971c7..daf3e88 100644
--- a/include/freetype/t1tables.h
+++ b/include/freetype/t1tables.h
@@ -67,10 +67,10 @@ FT_BEGIN_HEADER
FT_String* full_name;
FT_String* family_name;
FT_String* weight;
- FT_Fixed* italic_angle;
- FT_Bool* is_fixed_pitch;
- FT_Fixed* underline_position;
- FT_Fixed* underline_thickness;
+ FT_Fixed italic_angle;
+ FT_Bool is_fixed_pitch;
+ FT_Fixed underline_position;
+ FT_Fixed underline_thickness;
} PS_FontInfoRec, *PS_FontInfo;
diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c
index 784107f..313d315 100644
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -223,11 +223,6 @@
FT_FREE( info->family_name );
FT_FREE( info->weight );
- FT_FREE( info->italic_angle );
- FT_FREE( info->underline_position );
- FT_FREE( info->underline_thickness );
- FT_FREE( info->is_fixed_pitch );
-
/* release font dictionaries */
FT_FREE( cid->font_dicts );
cid->num_dicts = 0;
@@ -352,7 +347,7 @@
root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
- if ( info->is_fixed_pitch && *info->is_fixed_pitch )
+ if ( info->is_fixed_pitch )
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
/* XXX: TODO: add kerning with .afm support */
@@ -402,7 +397,7 @@
/* compute style flags */
root->style_flags = 0;
- if ( info->italic_angle && *info->italic_angle )
+ if ( info->italic_angle )
root->style_flags |= FT_STYLE_FLAG_ITALIC;
if ( info->weight )
{
@@ -428,10 +423,8 @@
root->height = (FT_Short)(
( ( root->ascender - root->descender ) * 12 ) / 10 );
- if ( info->underline_position )
- root->underline_position = *info->underline_position >> 16;
- if ( info->underline_thickness )
- root->underline_thickness = *info->underline_thickness >> 16;
+ root->underline_position = info->underline_position >> 16;
+ root->underline_thickness = info->underline_thickness >> 16;
root->internal->max_points = 0;
root->internal->max_contours = 0;
diff --git a/src/cid/cidtoken.h b/src/cid/cidtoken.h
index ff2a89d..05434c5 100644
--- a/src/cid/cidtoken.h
+++ b/src/cid/cidtoken.h
@@ -39,15 +39,15 @@
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_INFO
- T1_FIELD_STRING ( "version", version )
- T1_FIELD_STRING ( "Notice", notice )
- T1_FIELD_STRING ( "FullName", full_name )
- T1_FIELD_STRING ( "FamilyName", family_name )
- T1_FIELD_STRING ( "Weight", weight )
- T1_FIELD_FIXED_P ( "ItalicAngle", italic_angle )
- T1_FIELD_TYPE_BOOL_P( "isFixedPitch", is_fixed_pitch )
- T1_FIELD_FIXED_P ( "UnderlinePosition", underline_position )
- T1_FIELD_FIXED_P ( "UnderlineThickness", underline_thickness )
+ T1_FIELD_STRING( "version", version )
+ T1_FIELD_STRING( "Notice", notice )
+ T1_FIELD_STRING( "FullName", full_name )
+ T1_FIELD_STRING( "FamilyName", family_name )
+ T1_FIELD_STRING( "Weight", weight )
+ T1_FIELD_FIXED ( "ItalicAngle", italic_angle )
+ T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch )
+ T1_FIELD_FIXED ( "UnderlinePosition", underline_position )
+ T1_FIELD_FIXED ( "UnderlineThickness", underline_thickness )
#undef FT_STRUCTURE
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index c88e3e4..fca38ba 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -987,34 +987,18 @@
val = t1_tobool( &cur, limit );
goto Store_Integer;
- case T1_FIELD_TYPE_BOOL_P:
- val = t1_tobool( &cur, limit );
- goto Store_Integer_P;
-
case T1_FIELD_TYPE_FIXED:
val = t1_tofixed( &cur, limit, 0 );
goto Store_Integer;
- case T1_FIELD_TYPE_FIXED_P:
- val = t1_tofixed( &cur, limit, 0 );
- goto Store_Integer_P;
-
case T1_FIELD_TYPE_FIXED_1000:
val = t1_tofixed( &cur, limit, 3 );
goto Store_Integer;
- case T1_FIELD_TYPE_FIXED_1000_P:
- val = t1_tofixed( &cur, limit, 3 );
- goto Store_Integer_P;
-
case T1_FIELD_TYPE_INTEGER:
val = t1_toint( &cur, limit );
goto Store_Integer;
- case T1_FIELD_TYPE_INTEGER_P:
- val = t1_toint( &cur, limit );
- goto Store_Integer_P;
-
Store_Integer:
switch ( field->size )
{
@@ -1035,83 +1019,6 @@
}
break;
- Store_Integer_P:
- switch ( field->size )
- {
- case 1:
- {
- FT_Memory memory = parser->memory;
- FT_Byte* p;
-
-
- /* with synthetic fonts, it's possible to find a field twice */
- if ( *(FT_Byte**)q )
- break;
-
- if ( FT_ALLOC( p, 1 ) )
- goto Exit;
-
- *p = val;
- *(FT_Byte**)q = p;
- break;
- }
-
- case 2:
- {
- FT_Memory memory = parser->memory;
- FT_UShort* p;
-
-
- /* with synthetic fonts, it's possible to find a field twice */
- if ( *(FT_UShort**)q )
- break;
-
- if ( FT_ALLOC( p, 2 ) )
- goto Exit;
-
- *p = val;
- *(FT_UShort**)q = p;
- break;
- }
-
- case 4:
- {
- FT_Memory memory = parser->memory;
- FT_UInt32* p;
-
-
- /* with synthetic fonts, it's possible to find a field twice */
- if ( *(FT_UInt32**)q )
- break;
-
- if ( FT_ALLOC( p, 4 ) )
- goto Exit;
-
- *p = val;
- *(FT_UInt32**)q = p;
- break;
- }
-
- default:
- {
- FT_Memory memory = parser->memory;
- FT_Long* p;
-
-
- /* with synthetic fonts, it's possible to find a field twice */
- if ( *(FT_Long**)q )
- break;
-
- if ( FT_ALLOC( p, 8 ) )
- goto Exit;
-
- *p = val;
- *(FT_Long**)q = p;
- break;
- }
- }
- break;
-
case T1_FIELD_TYPE_STRING:
case T1_FIELD_TYPE_KEY:
{
diff --git a/src/tools/docmaker/tohtml.py b/src/tools/docmaker/tohtml.py
index 4bc11d8..7f08e8d 100644
--- a/src/tools/docmaker/tohtml.py
+++ b/src/tools/docmaker/tohtml.py
@@ -7,23 +7,34 @@ import time
# The following defines the HTML header used by all generated pages.
#
html_header_1 = """\
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
<html>
-<header>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>"""
html_header_2= """ API Reference</title>
-<basefont face="Verdana,Geneva,Arial,Helvetica">
-<style content="text/css">
- P { text-align=justify }
- H1 { text-align=center }
- LI { text-align=justify }
+<style type="text/css">
+ body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
+ color: #000000;
+ background: #FFFFFF; }
+
+ p { text-align: justify; }
+ h1 { text-align: center; }
+ li { text-align: justify; }
+
+ a:link { color: #0000EF; }
+ a:visited { color: #51188E; }
+ a:hover { color: #FF0000; }
+
+ span.keyword { font-family: monospace;
+ text-align: left;
+ white-space: pre;
+ color: darkblue; }
</style>
-</header>
-<body text=#000000
- bgcolor=#FFFFFF
- link=#0000EF
- vlink=#51188E
- alink=#FF0000>
+</head>
+<body>
<center><h1>"""
html_header_3=""" API Reference</h1></center>
@@ -54,39 +65,39 @@ para_footer = "</p>"
# Block header and footer.
#
-block_header = "<center><table width=75%><tr><td>"
-block_footer = "</td></tr></table><hr width=75%></center>"
+block_header = '<table align=center width="75%"><tr><td>'
+block_footer = '</td></tr></table><hr width="75%">'
# Description header/footer.
#
-description_header = "<center><table width=87%><tr><td>"
-description_footer = "</td></tr></table></center><br>"
+description_header = '<table align=center width="87%"><tr><td>'
+description_footer = "</td></tr></table><br>"
# Marker header/inter/footer combination.
#
-marker_header = "<center><table width=87% cellpadding=5><tr bgcolor=#EEEEFF><td><em><b>"
+marker_header = '<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>'
marker_inter = "</b></em></td></tr><tr><td>"
-marker_footer = "</td></tr></table></center>"
+marker_footer = "</td></tr></table>"
# Source code extracts header/footer.
#
-source_header = "<center><table width=87%><tr bgcolor=#D6E8FF width=100%><td><pre>\n"
-source_footer = "\n</pre></table></center><br>"
+source_header = '<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>\n'
+source_footer = "\n</pre></table><br>"
# Chapter header/inter/footer.
#
-chapter_header = "<br><center><table width=75%><tr><td><h2>"
+chapter_header = '<br><table align=center width="75%"><tr><td><h2>'
chapter_inter = "</h2><ul>"
-chapter_footer = "</ul></td></tr></table></center>"
+chapter_footer = "</ul></td></tr></table>"
# source language keyword coloration/styling
#
-keyword_prefix = '<font color="darkblue">'
-keyword_suffix = '</font>'
+keyword_prefix = '<span class="keyword">'
+keyword_suffix = '</span>'
-section_synopsis_header = '<h2>Synopsis</h2><font color="cyan">'
-section_synopsis_footer = '</font>'
+section_synopsis_header = '<h2>Synopsis</h2>'
+section_synopsis_footer = ''
# Translate a single line of source to HTML. This will convert
# a "<" into "<.", ">" into ">.", etc.
@@ -231,7 +242,7 @@ class HtmlFormatter(Formatter):
def print_html_field( self, field ):
if field.name:
- print "<table valign=top><tr><td><b>"+field.name+"</b></td><td>"
+ print "<table><tr valign=top><td><b>"+field.name+"</b></td><td>"
print self.make_html_items( field.items )
@@ -273,7 +284,7 @@ class HtmlFormatter(Formatter):
def print_html_field_list( self, fields ):
- print "<table valign=top cellpadding=3>"
+ print "<table cellpadding=3>"
for field in fields:
print "<tr valign=top><td><b>" + field.name + "</b></td><td>"
self.print_html_items( field.items )
@@ -320,7 +331,7 @@ class HtmlFormatter(Formatter):
count = len( self.block_index )
rows = (count + self.columns - 1)/self.columns
- print "<center><table border=0 cellpadding=0 cellspacing=0>"
+ print "<table align=center border=0 cellpadding=0 cellspacing=0>"
for r in range(rows):
line = "<tr>"
for c in range(self.columns):
@@ -334,7 +345,7 @@ class HtmlFormatter(Formatter):
line = line + "</tr>"
print line
- print "</table></center>"
+ print "</table>"
print self.html_footer
self.index_items = {}
@@ -374,7 +385,7 @@ class HtmlFormatter(Formatter):
print chapter_header + '<a href="' + index_filename + '">Global Index</a>' + chapter_inter + chapter_footer
def toc_exit( self ):
- print "</table></center>"
+ print "</table>"
print self.html_footer
def toc_dump( self, toc_filename = None, index_filename = None ):
@@ -398,7 +409,7 @@ class HtmlFormatter(Formatter):
# print section synopsys
print section_synopsis_header
- print "<center><table cellspacing=5 cellpadding=0 border=0>"
+ print "<table align=center cellspacing=5 cellpadding=0 border=0>"
maxwidth = 0
for b in section.blocks.values():
@@ -425,7 +436,7 @@ class HtmlFormatter(Formatter):
line = line + "</tr>"
print line
- print "</table></center><br><br>"
+ print "</table><br><br>"
print section_synopsis_footer
print description_header
@@ -437,9 +448,7 @@ class HtmlFormatter(Formatter):
# place html anchor if needed
if block.name:
- print '<a name="' + block.name + '">'
- print "<h4>" + block.name + "</h4>"
- print "</a>"
+ print '<h4><a name="' + block.name + '">' + block.name + '</a></h4>'
# dump the block C source lines now
if block.code:
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index 3e3850e..6bc7b92 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -1450,11 +1450,16 @@
};
+#define T1_FIELD_COUNT \
+ ( sizeof ( t1_keywords ) / sizeof ( t1_keywords[0] ) )
+
+
static FT_Error
parse_dict( T1_Face face,
T1_Loader loader,
FT_Byte* base,
- FT_Long size )
+ FT_Long size,
+ FT_Byte* keyword_flags )
{
T1_Parser parser = &loader->parser;
@@ -1519,7 +1524,8 @@
{
{
/* now, compare the immediate name to the keyword table */
- T1_Field keyword = (T1_Field)t1_keywords;
+ T1_Field keyword = (T1_Field)t1_keywords;
+ FT_Byte* keyword_flag = keyword_flags;
for (;;)
@@ -1546,17 +1552,25 @@
/* we found it -- run the parsing callback! */
parser->root.cursor = cur2;
T1_Skip_Spaces( parser );
- parser->root.error = t1_load_keyword( face,
- loader,
- keyword );
- if ( parser->root.error )
- return parser->root.error;
+
+ /* we only record the first instance of any */
+ /* field to deal adequately with synthetic fonts */
+ if ( keyword_flag[0] == 0 )
+ {
+ parser->root.error = t1_load_keyword( face,
+ loader,
+ keyword );
+ if ( parser->root.error )
+ return parser->root.error;
+ }
+ keyword_flag[0] = 1;
cur = parser->root.cursor;
break;
}
}
keyword++;
+ keyword_flag++;
}
}
}
@@ -1612,6 +1626,7 @@
T1_Parser parser;
T1_Font type1 = &face->type1;
FT_Error error;
+ FT_Byte keyword_flags[T1_FIELD_COUNT];
PSAux_Service psaux = (PSAux_Service)face->psaux;
@@ -1632,7 +1647,16 @@
if ( error )
goto Exit;
- error = parse_dict( face, &loader, parser->base_dict, parser->base_len );
+ {
+ FT_UInt n;
+
+
+ for ( n = 0; n < T1_FIELD_COUNT; n++ )
+ keyword_flags[n] = 0;
+ }
+
+ error = parse_dict( face, &loader, parser->base_dict, parser->base_len,
+ keyword_flags );
if ( error )
goto Exit;
@@ -1641,7 +1665,8 @@
goto Exit;
error = parse_dict( face, &loader, parser->private_dict,
- parser->private_len );
+ parser->private_len,
+ keyword_flags );
if ( error )
goto Exit;
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index 547af26..c62e72b 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -211,11 +211,6 @@
FT_FREE( info->full_name );
FT_FREE( info->family_name );
FT_FREE( info->weight );
-
- FT_FREE( info->italic_angle );
- FT_FREE( info->underline_position );
- FT_FREE( info->underline_thickness );
- FT_FREE( info->is_fixed_pitch );
}
/* release top dictionary */
@@ -341,7 +336,7 @@
root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
- if ( info->is_fixed_pitch && *info->is_fixed_pitch )
+ if ( info->is_fixed_pitch )
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
if ( face->blend )
@@ -394,7 +389,7 @@
/* compute style flags */
root->style_flags = 0;
- if ( info->italic_angle && *info->italic_angle )
+ if ( info->italic_angle )
root->style_flags |= FT_STYLE_FLAG_ITALIC;
if ( info->weight )
{
@@ -439,10 +434,8 @@
root->max_advance_height = root->height;
- if ( info->underline_position )
- root->underline_position = *info->underline_position >> 16;
- if ( info->underline_thickness )
- root->underline_thickness = *info->underline_thickness >> 16;
+ root->underline_position = info->underline_position >> 16;
+ root->underline_thickness = info->underline_thickness >> 16;
root->internal->max_points = 0;
root->internal->max_contours = 0;
diff --git a/src/type1/t1tokens.h b/src/type1/t1tokens.h
index 5308df1..b09f4b9 100644
--- a/src/type1/t1tokens.h
+++ b/src/type1/t1tokens.h
@@ -21,17 +21,17 @@
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_INFO
- T1_FIELD_STRING ( "version", version )
- T1_FIELD_STRING ( "Notice", notice )
- T1_FIELD_STRING ( "FullName", full_name )
- T1_FIELD_STRING ( "FamilyName", family_name )
- T1_FIELD_STRING ( "Weight", weight )
+ T1_FIELD_STRING( "version", version )
+ T1_FIELD_STRING( "Notice", notice )
+ T1_FIELD_STRING( "FullName", full_name )
+ T1_FIELD_STRING( "FamilyName", family_name )
+ T1_FIELD_STRING( "Weight", weight )
/* we use pointers to detect modifications made by synthetic fonts */
- T1_FIELD_FIXED_P ( "ItalicAngle", italic_angle )
- T1_FIELD_TYPE_BOOL_P( "isFixedPitch", is_fixed_pitch )
- T1_FIELD_FIXED_P ( "UnderlinePosition", underline_position )
- T1_FIELD_FIXED_P ( "UnderlineThickness", underline_thickness )
+ T1_FIELD_FIXED ( "ItalicAngle", italic_angle )
+ T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch )
+ T1_FIELD_FIXED ( "UnderlinePosition", underline_position )
+ T1_FIELD_FIXED ( "UnderlineThickness", underline_thickness )
#undef FT_STRUCTURE
@@ -66,10 +66,10 @@
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_DICT
- T1_FIELD_KEY ( "FontName", font_name )
- T1_FIELD_NUM_P ( "PaintType", paint_type )
- T1_FIELD_NUM ( "FontType", font_type )
- T1_FIELD_FIXED_P( "StrokeWidth", stroke_width )
+ T1_FIELD_KEY ( "FontName", font_name )
+ T1_FIELD_NUM ( "PaintType", paint_type )
+ T1_FIELD_NUM ( "FontType", font_type )
+ T1_FIELD_FIXED( "StrokeWidth", stroke_width )
#undef FT_STRUCTURE
#define FT_STRUCTURE FT_BBox
diff --git a/src/type42/t42objs.c b/src/type42/t42objs.c
index 44da0e5..bb41205 100644
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -203,7 +203,7 @@
root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
- if ( info->is_fixed_pitch && *info->is_fixed_pitch )
+ if ( info->is_fixed_pitch )
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
/* XXX: TODO -- add kerning with .afm support */
@@ -278,17 +278,15 @@
root->max_advance_width = face->ttf_face->max_advance_width;
root->max_advance_height = face->ttf_face->max_advance_height;
- if ( info->underline_position )
- root->underline_position = *info->underline_position >> 16;
- if ( info->underline_thickness )
- root->underline_thickness = *info->underline_thickness >> 16;
+ root->underline_position = info->underline_position >> 16;
+ root->underline_thickness = info->underline_thickness >> 16;
root->internal->max_points = 0;
root->internal->max_contours = 0;
/* compute style flags */
root->style_flags = 0;
- if ( info->italic_angle && *info->italic_angle )
+ if ( info->italic_angle )
root->style_flags |= FT_STYLE_FLAG_ITALIC;
if ( face->ttf_face->style_flags & FT_STYLE_FLAG_BOLD )
@@ -388,11 +386,6 @@
FT_FREE( info->family_name );
FT_FREE( info->weight );
- FT_FREE( info->italic_angle );
- FT_FREE( info->underline_position );
- FT_FREE( info->underline_thickness );
- FT_FREE( info->is_fixed_pitch );
-
/* release top dictionary */
FT_FREE( type1->charstrings_len );
FT_FREE( type1->charstrings );
diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c
index 66d4635..8e4bbea 100644
--- a/src/type42/t42parse.c
+++ b/src/type42/t42parse.c
@@ -57,25 +57,25 @@
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_INFO
- T1_FIELD_STRING ( "version", version )
- T1_FIELD_STRING ( "Notice", notice )
- T1_FIELD_STRING ( "FullName", full_name )
- T1_FIELD_STRING ( "FamilyName", family_name )
- T1_FIELD_STRING ( "Weight", weight )
- T1_FIELD_FIXED_P ( "ItalicAngle", italic_angle )
- T1_FIELD_TYPE_BOOL_P( "isFixedPitch", is_fixed_pitch )
- T1_FIELD_FIXED_P ( "UnderlinePosition", underline_position )
- T1_FIELD_FIXED_P ( "UnderlineThickness", underline_thickness )
+ T1_FIELD_STRING( "version", version )
+ T1_FIELD_STRING( "Notice", notice )
+ T1_FIELD_STRING( "FullName", full_name )
+ T1_FIELD_STRING( "FamilyName", family_name )
+ T1_FIELD_STRING( "Weight", weight )
+ T1_FIELD_FIXED ( "ItalicAngle", italic_angle )
+ T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch )
+ T1_FIELD_FIXED ( "UnderlinePosition", underline_position )
+ T1_FIELD_FIXED ( "UnderlineThickness", underline_thickness )
#undef FT_STRUCTURE
#define FT_STRUCTURE T1_FontRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_DICT
- T1_FIELD_KEY ( "FontName", font_name )
- T1_FIELD_NUM_P ( "PaintType", paint_type )
- T1_FIELD_NUM ( "FontType", font_type )
- T1_FIELD_FIXED_P( "StrokeWidth", stroke_width )
+ T1_FIELD_KEY ( "FontName", font_name )
+ T1_FIELD_NUM ( "PaintType", paint_type )
+ T1_FIELD_NUM ( "FontType", font_type )
+ T1_FIELD_FIXED( "StrokeWidth", stroke_width )
#undef FT_STRUCTURE
#define FT_STRUCTURE FT_BBox
@@ -93,6 +93,10 @@
};
+#define T42_KEYWORD_COUNT \
+ ( sizeof ( t42_keywords ) / sizeof ( t42_keywords[0] ) )
+
+
#define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l )
#define T1_Done_Table( p ) \
do \
@@ -814,7 +818,16 @@
FT_Byte* limit = cur + size;
FT_UInt n_keywords = (FT_UInt)( sizeof ( t42_keywords ) /
sizeof ( t42_keywords[0] ) );
+
+ FT_Byte keyword_flags[T42_KEYWORD_COUNT];
+
+ {
+ FT_UInt n;
+
+ for ( n = 0; n < T42_KEYWORD_COUNT; n++ )
+ keyword_flags[n] = 0;
+ }
parser->root.cursor = base;
parser->root.limit = base + size;
@@ -887,11 +900,19 @@
/* we found it -- run the parsing callback! */
parser->root.cursor = cur2;
T1_Skip_Spaces( parser );
- parser->root.error = t42_load_keyword(face,
- loader,
- keyword );
- if ( parser->root.error )
- return parser->root.error;
+
+ /* only record the first instance of each field/keyword */
+ /* to deal with synthetic fonts correctly */
+ if ( keyword_flags[i] == 0 )
+ {
+ parser->root.error = t42_load_keyword(face,
+ loader,
+ keyword );
+ if ( parser->root.error )
+ return parser->root.error;
+ }
+ keyword_flags[i] = 1;
+
cur = parser->root.cursor;
break;
}