More formatting. About previous commitment: Added latest versions of (still unused) config.guess and config.sub files.
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 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144
diff --git a/src/renderer/ftgrays.c b/src/renderer/ftgrays.c
index d7ef210..2818332 100644
--- a/src/renderer/ftgrays.c
+++ b/src/renderer/ftgrays.c
@@ -50,7 +50,7 @@
/* It is based on ideas that I initially found in Raph Levien's */
/* excellent LibArt graphics library (see http://www.levien.com/libart */
/* for more information, though the web pages do not tell anything */
- /* about the renderer; you'll have to dive into the source code to */
+ /* about the renderer; you will have to dive into the source code to */
/* understand how it works). */
/* */
/* Note, however, that this is a _very_ different implementation */
@@ -103,6 +103,7 @@
#include "ftimage.h"
#include "ftgrays.h"
+
/* This macro is used to indicate that a function parameter is unused. */
/* Its purpose is simply to reduce compiler warnings. Note also that */
/* simply defining it as `(void)x' doesn't avoid warnings with certain */
@@ -135,6 +136,7 @@
/* define this to dump debugging information */
#define xxxDEBUG_GRAYS
+
/* as usual, for the speed hungry :-) */
#ifndef FT_STATIC_RASTER
@@ -225,7 +227,7 @@
#endif /* GRAYS_COMPACT */
- typedef struct TRaster_
+ typedef struct TRaster_
{
PCell cells;
int max_cells;
@@ -965,8 +967,8 @@
#ifdef SHELL_SORT
- /* A simple shell sort algorithm that works directly on our */
- /* cells table.. */
+ /* a simple shell sort algorithm that works directly on our */
+ /* cells table */
static
void shell_sort ( PCell cells,
int count )
@@ -1440,7 +1442,7 @@
/*************************************************************************/
/* */
/* The following function should only compile in stand_alone mode, */
- /* i.e., when building this component without the rest of FreeType. */
+ /* i.e., if building this component without the rest of FreeType. */
/* */
/*************************************************************************/
@@ -1684,8 +1686,8 @@
static
FT_Outline_Funcs interface =
{
- (FT_Outline_MoveTo_Func)Move_To,
- (FT_Outline_LineTo_Func)Line_To,
+ (FT_Outline_MoveTo_Func) Move_To,
+ (FT_Outline_LineTo_Func) Line_To,
(FT_Outline_ConicTo_Func)Conic_To,
(FT_Outline_CubicTo_Func)Cubic_To,
0,
@@ -1840,7 +1842,7 @@
return -1;
/* XXXX: this version does not support monochrome rendering yet! */
- if ( !(params->flags & ft_raster_flag_aa) )
+ if ( !( params->flags & ft_raster_flag_aa ) )
return -1;
ras.outline = *outline;
diff --git a/src/renderer/ftgrays.h b/src/renderer/ftgrays.h
index feb7484..2e6ff17 100644
--- a/src/renderer/ftgrays.h
+++ b/src/renderer/ftgrays.h
@@ -15,35 +15,44 @@
/* */
/***************************************************************************/
+
#ifndef FTGRAYS_H
#define FTGRAYS_H
+
#ifdef __cplusplus
extern "C" {
#endif
+
#ifdef _STANDALONE_
#include "ftimage.h"
#else
#include <freetype/ftimage.h>
#endif
+
/*************************************************************************/
/* */
/* To make ftgrays.h independent from configuration files we check */
- /* whether FT_EXPORT_DEF has been defined already. */
+ /* whether FT_EXPORT_VAR has been defined already. */
/* */
/* On some systems and compilers (Win32 mostly), an extra keyword is */
/* necessary to compile the library as a DLL. */
/* */
#ifndef FT_EXPORT_VAR
-#define FT_EXPORT_VAR(x) extern x
+#define FT_EXPORT_VAR( x ) extern x
#endif
- FT_EXPORT_VAR(FT_Raster_Funcs) ft_grays_raster;
+ FT_EXPORT_VAR( FT_Raster_Funcs ) ft_grays_raster;
- #ifdef __cplusplus
- }
- #endif
+#ifdef __cplusplus
+}
#endif
+
+
+#endif /* FTGRAYS_H */
+
+
+/* END */
diff --git a/src/renderer/ftraster.c b/src/renderer/ftraster.c
index 4b2baae..19beb94 100644
--- a/src/renderer/ftraster.c
+++ b/src/renderer/ftraster.c
@@ -60,7 +60,7 @@
/* */
/* ^ ^ */
/* | | */
- /* start of render pool top */
+ /* start of render pool top */
/* */
/* The top of the profile stack is kept in the `top' variable. */
/* */
@@ -236,6 +236,7 @@
typedef unsigned char Byte, *PByte;
typedef char Bool;
+
typedef struct TPoint_
{
Long x;
@@ -303,6 +304,7 @@
#ifdef TT_STATIC_RASTER
+
#define RAS_ARGS /* void */
#define RAS_ARG /* void */
@@ -311,8 +313,10 @@
#define UNUSED_RASTER do ; while ( 0 )
+
#else /* TT_STATIC_RASTER */
+
#define RAS_ARGS TRaster_Instance* raster,
#define RAS_ARG TRaster_Instance* raster
@@ -321,6 +325,7 @@
#define UNUSED_RASTER UNUSED( raster )
+
#endif /* TT_STATIC_RASTER */
diff --git a/src/renderer/module.mk b/src/renderer/module.mk
index be7d80d..a54ed57 100644
--- a/src/renderer/module.mk
+++ b/src/renderer/module.mk
@@ -1,6 +1,6 @@
make_module_list: add_renderer_module
-# XXX: important, the standard renderer *MUST* be first on this list..
+# XXX: important, the standard renderer *MUST* be first on this list!
#
add_renderer_module:
$(OPEN_DRIVER)ft_standard_renderer_class$(CLOSE_DRIVER)
diff --git a/src/renderer/renderer.c b/src/renderer/renderer.c
index 9971933..8fab2fb 100644
--- a/src/renderer/renderer.c
+++ b/src/renderer/renderer.c
@@ -1,69 +1,98 @@
+/***************************************************************************/
+/* */
+/* renderer.c */
+/* */
+/* FreeType renderer module (body). */
+/* */
+/* Copyright 2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
#include <freetype/internal/ftobjs.h>
- /* initialise renderer - init its raster */
- static FT_Error ft_renderer_init( FT_Renderer render )
+
+ /* initialize renderer - init its raster */
+ static
+ FT_Error ft_renderer_init( FT_Renderer render )
{
- FT_Library library = FT_MODULE_LIBRARY(render);
+ FT_Library library = FT_MODULE_LIBRARY( render );
+
render->clazz->raster_class->raster_reset( render->raster,
- library->raster_pool, library->raster_pool_size );
+ library->raster_pool,
+ library->raster_pool_size );
return 0;
}
-
- /* sets render-specific mode */
- static FT_Error ft_renderer_set_mode( FT_Renderer render,
- FT_ULong mode_tag,
- FT_Pointer data )
+ /* set render-specific mode */
+ static
+ FT_Error ft_renderer_set_mode( FT_Renderer render,
+ FT_ULong mode_tag,
+ FT_Pointer data )
{
/* we simply pass it to the raster */
- return render->clazz->raster_class->raster_set_mode(
- render->raster, mode_tag, data );
+ return render->clazz->raster_class->raster_set_mode( render->raster,
+ mode_tag,
+ data );
}
- /* transform a given glyph image */
- static FT_Error ft_renderer_transform( FT_Renderer render,
- FT_GlyphSlot slot,
- FT_Matrix* matrix,
- FT_Vector* delta )
+
+ /* transform a given glyph image */
+ static
+ FT_Error ft_renderer_transform( FT_Renderer render,
+ FT_GlyphSlot slot,
+ FT_Matrix* matrix,
+ FT_Vector* delta )
{
FT_Error error = FT_Err_Ok;
- if (slot->format != render->glyph_format)
+
+ if ( slot->format != render->glyph_format )
{
error = FT_Err_Invalid_Argument;
goto Exit;
}
- if (matrix)
+ if ( matrix )
FT_Outline_Transform( &slot->outline, matrix );
- if (delta)
+ if ( delta )
FT_Outline_Translate( &slot->outline, delta->x, delta->y );
Exit:
return error;
}
- /* return the glyph's control box */
- static void ft_renderer_get_cbox( FT_Renderer render,
- FT_GlyphSlot slot,
- FT_BBox *cbox )
+
+ /* return the glyph's control box */
+ static
+ void ft_renderer_get_cbox( FT_Renderer render,
+ FT_GlyphSlot slot,
+ FT_BBox* cbox )
{
- MEM_Set( cbox, 0, sizeof(*cbox) );
+ MEM_Set( cbox, 0, sizeof ( *cbox ) );
- if (slot->format == render->glyph_format)
+ if ( slot->format == render->glyph_format )
FT_Outline_Get_CBox( &slot->outline, cbox );
}
- /* convert a slot's glyph image into a bitmap */
- static FT_Error ft_renderer_render( FT_Renderer render,
- FT_GlyphSlot slot,
- FT_UInt mode,
- FT_Vector* origin )
+ /* convert a slot's glyph image into a bitmap */
+ static
+ FT_Error ft_renderer_render( FT_Renderer render,
+ FT_GlyphSlot slot,
+ FT_UInt mode,
+ FT_Vector* origin )
{
FT_Error error;
FT_Outline* outline;
@@ -74,8 +103,9 @@
FT_Raster_Params params;
+
/* check glyph image format */
- if (slot->format != render->glyph_format)
+ if ( slot->format != render->glyph_format )
{
error = FT_Err_Invalid_Argument;
goto Exit;
@@ -84,7 +114,7 @@
outline = &slot->outline;
/* translate the outline to the new origin if needed */
- if (origin)
+ if ( origin )
FT_Outline_Translate( outline, origin->x, origin->y );
/* compute the control box, and grid fit it */
@@ -92,18 +122,18 @@
cbox.xMin &= -64;
cbox.yMin &= -64;
- cbox.xMax = (cbox.xMax+63) & -64;
- cbox.yMax = (cbox.yMax+63) & -64;
+ cbox.xMax = ( cbox.xMax + 63 ) & -64;
+ cbox.yMax = ( cbox.yMax + 63 ) & -64;
- width = (cbox.xMax - cbox.xMin) >> 6;
- height = (cbox.yMax - cbox.yMin) >> 6;
+ width = ( cbox.xMax - cbox.xMin ) >> 6;
+ height = ( cbox.yMax - cbox.yMin ) >> 6;
bitmap = &slot->bitmap;
memory = slot->face->memory;
/* release old bitmap buffer */
- if ((slot->flags & ft_glyph_own_bitmap))
+ if ( ( slot->flags & ft_glyph_own_bitmap ) )
{
- FREE(bitmap->buffer);
+ FREE( bitmap->buffer );
slot->flags &= ~ft_glyph_own_bitmap;
}
@@ -116,7 +146,7 @@
}
else
{
- pitch = (width+7) >> 3;
+ pitch = ( width + 7 ) >> 3;
bitmap->pixel_mode = ft_pixel_mode_mono;
}
@@ -124,7 +154,7 @@
bitmap->rows = height;
bitmap->pitch = pitch;
- if (ALLOC( bitmap->buffer, (FT_ULong)pitch * height ))
+ if ( ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) )
goto Exit;
slot->flags |= ft_glyph_own_bitmap;
@@ -142,7 +172,8 @@
/* render outline into the bitmap */
error = render->raster_render( render->raster, ¶ms );
- if (error) goto Exit;
+ if ( error )
+ goto Exit;
slot->format = ft_glyph_format_bitmap;
slot->bitmap_left = cbox.xMin >> 6;
@@ -152,68 +183,79 @@
return error;
}
+
#ifndef FT_CONFIG_OPTION_NO_STD_RASTER
+
#include <ftraster.h>
- const FT_Renderer_Class ft_standard_renderer_class =
+
+ const FT_Renderer_Class ft_standard_renderer_class =
{
{
ft_module_renderer,
- sizeof( FT_RendererRec ),
+ sizeof ( FT_RendererRec ),
"standard renderer",
- 0x10000,
- 0x20000,
+ 0x10000L,
+ 0x20000L,
0, /* module specific interface */
- (FT_Module_Constructor) ft_renderer_init,
- (FT_Module_Destructor) 0,
- (FT_Module_Requester) 0
+ (FT_Module_Constructor)ft_renderer_init,
+ (FT_Module_Destructor) 0,
+ (FT_Module_Requester) 0
},
ft_glyph_format_outline,
- (FTRenderer_render) ft_renderer_render,
- (FTRenderer_transform) ft_renderer_transform,
- (FTRenderer_getCBox) ft_renderer_get_cbox,
- (FTRenderer_setMode) ft_renderer_set_mode,
+ (FTRenderer_render) ft_renderer_render,
+ (FTRenderer_transform)ft_renderer_transform,
+ (FTRenderer_getCBox) ft_renderer_get_cbox,
+ (FTRenderer_setMode) ft_renderer_set_mode,
- (FT_Raster_Funcs*) &ft_standard_raster
+ (FT_Raster_Funcs*) &ft_standard_raster
};
+
#endif /* !FT_CONFIG_OPTION_NO_STD_RASTER */
+
#ifndef FT_CONFIG_OPTION_NO_SMOOTH_RASTER
+
#include <ftgrays.h>
+
const FT_Renderer_Class ft_smooth_renderer_class =
{
{
ft_module_renderer,
- sizeof( FT_RendererRec ),
+ sizeof ( FT_RendererRec ),
"smooth renderer",
- 0x10000,
- 0x20000,
+ 0x10000L,
+ 0x20000L,
0, /* module specific interface */
- (FT_Module_Constructor) ft_renderer_init,
- (FT_Module_Destructor) 0,
- (FT_Module_Requester) 0
+ (FT_Module_Constructor)ft_renderer_init,
+ (FT_Module_Destructor) 0,
+ (FT_Module_Requester) 0
},
ft_glyph_format_outline,
- (FTRenderer_render) ft_renderer_render,
- (FTRenderer_transform) ft_renderer_transform,
- (FTRenderer_getCBox) ft_renderer_get_cbox,
- (FTRenderer_setMode) ft_renderer_set_mode,
+ (FTRenderer_render) ft_renderer_render,
+ (FTRenderer_transform)ft_renderer_transform,
+ (FTRenderer_getCBox) ft_renderer_get_cbox,
+ (FTRenderer_setMode) ft_renderer_set_mode,
- (FT_Raster_Funcs*) &ft_grays_raster
+ (FT_Raster_Funcs*) &ft_grays_raster
};
+
#endif /* !FT_CONFIG_OPTION_NO_SMOOTH_RASTER */
+
+
+/* END */
diff --git a/src/renderer/renderer.h b/src/renderer/renderer.h
index 091d1ec..5a760b8 100644
--- a/src/renderer/renderer.h
+++ b/src/renderer/renderer.h
@@ -1,14 +1,38 @@
+/***************************************************************************/
+/* */
+/* renderer.h */
+/* */
+/* FreeType renderer module (specification). */
+/* */
+/* Copyright 2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
#ifndef RENDERER_H
#define RENDERER_H
+
#include <freetype/ftrender.h>
+
#ifndef FT_CONFIG_OPTION_NO_STD_RASTER
- FT_EXPORT_VAR(const FT_Renderer_Class) ft_std_renderer_class;
+ FT_EXPORT_VAR( const FT_Renderer_Class ) ft_std_renderer_class;
#endif
#ifndef FT_CONFIG_OPTION_NO_SMOOTH_RASTER
- FT_EXPORT_VAR(const FT_Renderer_Class) ft_smooth_renderer_class;
+ FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_renderer_class;
#endif
+
#endif /* RENDERER_H */
+
+
+/* END */
diff --git a/src/renderer/rules.mk b/src/renderer/rules.mk
index 5cdfd14..600fc56 100644
--- a/src/renderer/rules.mk
+++ b/src/renderer/rules.mk
@@ -29,18 +29,18 @@ REND_CFLAGS := $(REND_INCLUDE:%=$I%)
REND_COMPILE := $(FT_COMPILE) $(REND_CFLAGS)
-# REND driver sources (i.e., C files)
+# renderer driver sources (i.e., C files)
#
-REND_DRV_SRC := $(REND_DIR_)ftraster.c \
- $(REND_DIR_)ftgrays.c \
+REND_DRV_SRC := $(REND_DIR_)ftraster.c \
+ $(REND_DIR_)ftgrays.c \
$(REND_DIR_)renderer.c
-# REND driver headers
+# renderer driver headers
#
REND_DRV_H := $(REND_DRV_SRC:%c=%h)
-# REND driver object(s)
+# renderer driver object(s)
#
# REND_DRV_OBJ_M is used during `multi' builds.
# REND_DRV_OBJ_S is used during `single' builds.
@@ -48,19 +48,19 @@ REND_DRV_H := $(REND_DRV_SRC:%c=%h)
REND_DRV_OBJ_M := $(REND_DRV_SRC:$(REND_DIR_)%.c=$(OBJ_)%.$O)
REND_DRV_OBJ_S := $(REND_DRV_OBJ_M)
-# REND driver source file for single build
+# renderer driver source file for single build
#
#REND_DRV_SRC_S := $(REND_DIR_)renderer.c
-# REND driver - single object
+# renderer driver - single object
#
#$(REND_DRV_OBJ_S): $(REND_DRV_SRC_S) $(REND_DRV_SRC) \
# $(FREETYPE_H) $(REND_DRV_H)
# $(REND_COMPILE) $T$@ $(REND_DRV_SRC_S)
-# REND driver - multiple objects
+# renderer driver - multiple objects
#
$(OBJ_)%.$O: $(REND_DIR_)%.c $(FREETYPE_H) $(REND_DRV_H)
$(REND_COMPILE) $T$@ $<
diff --git a/src/type1/t1hinter.h b/src/type1/t1hinter.h
index dcc9bce..86739df 100644
--- a/src/type1/t1hinter.h
+++ b/src/type1/t1hinter.h
@@ -1,24 +1,20 @@
-/*******************************************************************
- *
- * t1hinter.h 1.2
- *
- * Type1 hinter.
- *
- * Copyright 1996-1999 by
- * David Turner, Robert Wilhelm, and Werner Lemberg.
- *
- * This file is part of the FreeType project, and may only be used
- * modified and distributed under the terms of the FreeType project
- * license, LICENSE.TXT. By continuing to use, modify, or distribute
- * this file you indicate that you have read the license and
- * understand and accept it fully.
- *
- *
- * The Hinter is in charge of fitting th scaled outline to the
- * pixel grid in order to considerably improve the quality of
- * the Type 1 font driver's output..
- *
- ******************************************************************/
+/***************************************************************************/
+/* */
+/* t1hinter.h */
+/* */
+/* Type 1 hinter (body). */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
#ifndef T1HINTER_H
#define T1HINTER_H
@@ -31,29 +27,30 @@
#endif
-/************************************************************************
- *
- * <Struct>
- * T1_Snap_Zone
- *
- * <Description>
- * A "snap zone" is used to model either a blue zone or a stem width
- * at a given character size. It is made of a minimum and maximum
- * edge, defined in 26.6 pixels, as well as one "original" and
- * "scaled" position.
- *
- * the position corresponds to the stem width (for stem snap zones)
- * or to the blue position (for blue zones)
- *
- * <Fields>
- * orus :: original position in font units
- * pix :: current position in sub-pixel units
- * min :: minimum boundary in sub-pixel units
- * max :: maximim boundary in sub-pixel units
- *
- ************************************************************************/
-
- typedef struct T1_Snap_Zone_
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* T1_Snap_Zone */
+ /* */
+ /* <Description> */
+ /* A `snap zone' is used to model either a blue zone or a stem width */
+ /* at a given character size. It is made of a minimum and maximum */
+ /* edge, defined in 26.6 pixels, as well as an `original' and */
+ /* `scaled' position. */
+ /* */
+ /* The position corresponds to the stem width (for stem snap zones) */
+ /* or to the blue position (for blue zones). */
+ /* */
+ /* <Fields> */
+ /* orus :: The original position in font units. */
+ /* */
+ /* pix :: The current position in sub-pixel units. */
+ /* */
+ /* min :: The minimum boundary in sub-pixel units. */
+ /* */
+ /* max :: The maximum boundary in sub-pixel units. */
+ /* */
+ typedef struct T1_Snap_Zone_
{
FT_Pos orus;
FT_Pos pix;
@@ -63,21 +60,20 @@
} T1_Snap_Zone;
-/************************************************************************
- *
- * <Struct>
- * T1_Edge
- *
- * <Description>
- * A very simply structure used to model an stem edge
- *
- * <Fields>
- * orus :: original edge position in font units
- * pix :: scaled edge position in sub-pixel units
- *
- ************************************************************************/
-
- typedef struct T1_Edge_
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* T1_Edge */
+ /* */
+ /* <Description> */
+ /* A very simple structure used to model a stem edge. */
+ /* */
+ /* <Fields> */
+ /* orus :: The original edge position in font units. */
+ /* */
+ /* pix :: The scaled edge position in sub-pixel units. */
+ /* */
+ typedef struct T1_Edge_
{
FT_Pos orus;
FT_Pos pix;
@@ -85,26 +81,26 @@
} T1_Edge;
-/************************************************************************
- *
- * <Struct>
- * T1_Stem_Hint
- *
- * <Description>
- * A simple structure used to model a stem hint
- *
- * <Fields>
- * min_edge :: the hint's minimum edge
- * max_edge :: the hint's maximum edge
- * hint_flags :: some flags describing the stem properties
- *
- * <Note>
- * the min and max edges of a ghost stem have the same position,
- * even if they're coded in a weird way in the charstrings
- *
- ************************************************************************/
-
- typedef struct T1_Stem_Hint_
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* T1_Stem_Hint */
+ /* */
+ /* <Description> */
+ /* A simple structure used to model a stem hint. */
+ /* */
+ /* <Fields> */
+ /* min_edge :: The hint's minimum edge. */
+ /* */
+ /* max_edge :: The hint's maximum edge. */
+ /* */
+ /* hint_flags :: Some flags describing the stem properties. */
+ /* */
+ /* <Note> */
+ /* The min and max edges of a ghost stem have the same position, */
+ /* even if they are coded in a weird way in the charstrings. */
+ /* */
+ typedef struct T1_Stem_Hint_
{
T1_Edge min_edge;
T1_Edge max_edge;
@@ -114,109 +110,105 @@
#define T1_HINT_FLAG_ACTIVE 1 /* indicates an active stem */
-#define T1_HINT_FLAG_MIN_BORDER 2 /* unused for now.. */
-#define T1_HINT_FLAG_MAX_BORDER 4 /* unused for now.. */
-
-
-/* hinter's configuration constants */
-#define T1_HINTER_MAX_BLUES 24 /* maximum number of blue zones */
-#define T1_HINTER_MAX_SNAPS 16 /* maximum number of stem snap zones */
-#define T1_HINTER_MAX_EDGES 64 /* maximum number of stem hints */
-
-
-/************************************************************************
- *
- * <Struct>
- * T1_Size_Hints
- *
- * <Description>
- * A structure used to model the hinting information related to
- * a size object
- *
- * <Fields>
- * supress_overshoots :: a boolean flag to tell when overshoot
- * supression should occur.
- *
- * num_blue_zones :: the total number of blue zones (top+bottom)
- * num_bottom_zones :: the number of bottom zones
- *
- * blue_zones :: the blue zones table. bottom zones are
- * stored first in the table, followed by
- * all top zones
- *
- * num_stem_snapH :: number of horizontal stem snap zones
- * stem_snapH :: horizontal stem snap zones
- *
- * num_stem_snapV :: number of vertical stem snap zones
- * stem_snapV :: vertical stem snap zones
- *
- ************************************************************************/
-
- struct T1_Size_Hints_
+#define T1_HINT_FLAG_MIN_BORDER 2 /* unused for now */
+#define T1_HINT_FLAG_MAX_BORDER 4 /* unused for now */
+
+ /* hinter's configuration constants */
+#define T1_HINTER_MAX_BLUES 24 /* maximum number of blue zones */
+#define T1_HINTER_MAX_SNAPS 16 /* maximum number of stem snap zones */
+#define T1_HINTER_MAX_EDGES 64 /* maximum number of stem hints */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* T1_Size_Hints */
+ /* */
+ /* <Description> */
+ /* A structure used to model the hinting information related to a size */
+ /* object. */
+ /* */
+ /* <Fields> */
+ /* supress_overshoots :: A boolean flag to tell whether overshoot */
+ /* supression should occur. */
+ /* */
+ /* num_blue_zones :: The total number of blue zones (top+bottom). */
+ /* */
+ /* num_bottom_zones :: The number of bottom zones. */
+ /* */
+ /* blue_zones :: The blue zones table. Bottom zones are */
+ /* stored first in the table, followed by all */
+ /* top zones. */
+ /* */
+ /* num_snap_widths :: The number of horizontal stem snap zones. */
+ /* */
+ /* snap_widths :: An array of horizontal stem snap zones. */
+ /* */
+ /* num_snap_heights :: The number of vertical stem snap zones. */
+ /* */
+ /* snap_heights :: An array of vertical stem snap zones. */
+ /* */
+ struct T1_Size_Hints_
{
FT_Bool supress_overshoots;
FT_Int num_blue_zones;
FT_Int num_bottom_zones;
- T1_Snap_Zone blue_zones[ T1_HINTER_MAX_BLUES ];
+ T1_Snap_Zone blue_zones[T1_HINTER_MAX_BLUES];
FT_Int num_snap_widths;
- T1_Snap_Zone snap_widths[ T1_HINTER_MAX_SNAPS ];
+ T1_Snap_Zone snap_widths[T1_HINTER_MAX_SNAPS];
FT_Int num_snap_heights;
- T1_Snap_Zone snap_heights[ T1_HINTER_MAX_SNAPS ];
+ T1_Snap_Zone snap_heights[T1_HINTER_MAX_SNAPS];
};
-
-/************************************************************************
- *
- * <Struct>
- * T1_Stem_Table
- *
- * <Description>
- * A simple structure used to model a set of stem hints in a
- * single direction during the loading of a given glyph outline.
- * Not all stem hints are active at a time. Moreover, stems must
- * be sorted regularly
- *
- * <Fields>
- * num_stems :: total number of stems in table
- * num_active :: number of active stems in table
- *
- * stems :: the table of all stems
- * sort :: a table of indices into the stems table, used
- * to keep a sorted list of the active stems
- *
- ************************************************************************/
-
- typedef struct T1_Stem_Table_
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* T1_Stem_Table */
+ /* */
+ /* <Description> */
+ /* A simple structure used to model a set of stem hints in a single */
+ /* direction during the loading of a given glyph outline. Not all */
+ /* stem hints are active at a time. Moreover, stems must be sorted */
+ /* regularly. */
+ /* */
+ /* <Fields> */
+ /* num_stems :: The total number of stems in the table. */
+ /* */
+ /* num_active :: The number of active stems in the table. */
+ /* */
+ /* stems :: A table of all stems. */
+ /* */
+ /* sort :: A table of indices into the stems table, used to */
+ /* keep a sorted list of the active stems. */
+ /* */
+ typedef struct T1_Stem_Table_
{
FT_Int num_stems;
FT_Int num_active;
- T1_Stem_Hint stems[ T1_HINTER_MAX_EDGES ];
- FT_Int sort [ T1_HINTER_MAX_EDGES ];
+ T1_Stem_Hint stems[T1_HINTER_MAX_EDGES];
+ FT_Int sort [T1_HINTER_MAX_EDGES];
} T1_Stem_Table;
-
-/************************************************************************
- *
- * <Struct>
- * T1_Glyph_Hints
- *
- * <Description>
- * A structure used to model the stem hints of a given glyph outline
- * during glyph loading.
- *
- * <Fields>
- * hori_stems :: horizontal stem hints table
- * vert_stems :: vertical stem hints table
- *
- ************************************************************************/
-
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* T1_Glyph_Hints */
+ /* */
+ /* <Description> */
+ /* A structure used to model the stem hints of a given glyph outline */
+ /* during glyph loading. */
+ /* */
+ /* <Fields> */
+ /* hori_stems :: The horizontal stem hints table. */
+ /* vert_stems :: The vertical stem hints table. */
+ /* */
struct T1_Glyph_Hints_
{
T1_Stem_Table hori_stems;
@@ -224,157 +216,48 @@
};
-
-/************************************************************************
- *
- * <Data>
- * t1_hinter_funcs
- *
- * <Description>
- * A table containing the address of various functions used during
- * the loading of an hinted scaled outline
- *
- ************************************************************************/
-
+ /*************************************************************************/
+ /* */
+ /* <Data> */
+ /* t1_hinter_funcs */
+ /* */
+ /* <Description> */
+ /* A table containing the address of various functions used during */
+ /* the loading of an hinted scaled outline. */
+ /* */
LOCAL_DEF
const T1_Hinter_Funcs t1_hinter_funcs;
-/************************************************************************
- *
- * <Function>
- * T1_New_Size_Hinter
- *
- * <Description>
- * Allocates a new hinter structure for a given size object
- *
- * <Input>
- * size :: handle to target size object
- *
- * <Return>
- * Error code. 0 means success
- *
- ************************************************************************/
-
LOCAL_DEF
FT_Error T1_New_Size_Hinter( T1_Size size );
-
-/************************************************************************
- *
- * <Function>
- * T1_Done_Size_Hinter
- *
- * <Description>
- * Releases a given size object's hinter structure
- *
- * <Input>
- * size :: handle to target size object
- *
- ************************************************************************/
-
LOCAL_DEF
- void T1_Done_Size_Hinter( T1_Size size );
-
-
-/************************************************************************
- *
- * <Function>
- * T1_Reset_Size_Hinter
- *
- * <Description>
- * Recomputes hinting information when a given size object has
- * changed its resolutions/char sizes/pixel sizes
- *
- * <Input>
- * size :: handle to size object
- *
- * <Return>
- * Error code. 0 means success
- *
- ************************************************************************/
+ void T1_Done_Size_Hinter( T1_Size size );
LOCAL_DEF
FT_Error T1_Reset_Size_Hinter( T1_Size size );
-
-/************************************************************************
- *
- * <Function>
- * T1_New_Glyph_Hinter
- *
- * <Description>
- * Allocates a new hinter structure for a given glyph slot
- *
- * <Input>
- * glyph :: handle to target glyph slot
- *
- * <Return>
- * Error code. 0 means success
- *
- ************************************************************************/
-
LOCAL_DEF
FT_Error T1_New_Glyph_Hinter( T1_GlyphSlot glyph );
-
-/************************************************************************
- *
- * <Function>
- * T1_Done_Glyph_Hinter
- *
- * <Description>
- * Releases a given glyph slot's hinter structure
- *
- * <Input>
- * glyph :: handle to glyph slot
- *
- ************************************************************************/
-
LOCAL_DEF
- void T1_Done_Glyph_Hinter( T1_GlyphSlot glyph );
-
+ void T1_Done_Glyph_Hinter( T1_GlyphSlot glyph );
-
-/************************************************************************
- *
- * <Function>
- * T1_Hint_Points
- *
- * <Description>
- * this function grid-fits several points in a given Type 1 builder
- * at once.
- *
- * <Input>
- * builder :: handle to target Type 1 builder
- *
- ************************************************************************/
-
LOCAL_DEF
void T1_Hint_Points( T1_Builder* builder );
-
-/************************************************************************
- *
- * <Function>
- * T1_Hint_Stems
- *
- * <Description>
- * This function is used to compute the location of each stem hint
- * between the first and second passes of the glyph loader on the
- * charstring.
- *
- * <Input>
- * builder :: handle to target builder
- *
- ************************************************************************/
-
LOCAL_DEF
void T1_Hint_Stems( T1_Builder* builder );
+
#ifdef __cplusplus
}
#endif
+
#endif /* T1HINTER_H */
+
+
+/* END */