Formatting; minor improvements.
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 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336
diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h
index cd598d8..ab19663 100644
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -98,7 +98,7 @@
/* UNUSED is a macro used to indicate that a given parameter is not used */
/* this is only used to get rid of unpleasant compiler warnings.. */
#ifndef UNUSED
-#define UNUSED( arg ) ( (arg)=(arg) )
+#define UNUSED( arg ) ( (void)(arg)=(arg) )
#endif
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index d516695..b370a8a 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -260,7 +260,7 @@
/* bytecode interpreter. */
/* */
/* <Input> */
- /* l :: 64-bit integer */
+ /* l :: A 64-bit integer. */
/* */
/* <Return> */
/* The 32-bit square-root. */
diff --git a/src/base/ftextend.c b/src/base/ftextend.c
index 46198c3..14e9087 100644
--- a/src/base/ftextend.c
+++ b/src/base/ftextend.c
@@ -24,6 +24,7 @@
/* */
/*************************************************************************/
+
#include <freetype/internal/ftextend.h>
/* required by the tracing mode */
@@ -114,8 +115,9 @@
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
- FT_EXPORT_FUNC(FT_Error) FT_Register_Extension( FT_Driver driver,
- FT_Extension_Class* class )
+ FT_EXPORT_FUNC( FT_Error ) FT_Register_Extension(
+ FT_Driver driver,
+ FT_Extension_Class* class )
{
FT_Extension_Registry* registry;
@@ -162,9 +164,10 @@
/* <Return> */
/* A pointer to the extension block. */
/* */
- FT_EXPORT_FUNC(void*) FT_Get_Extension( FT_Face face,
- const char* extension_id,
- void* *extension_interface )
+ FT_EXPORT_FUNC( void* ) FT_Get_Extension(
+ FT_Face face,
+ const char* extension_id,
+ void* *extension_interface )
{
FT_Extension_Registry* registry;
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index 877d36d..c21c84a 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -2,9 +2,9 @@
/* */
/* ftglyph.c */
/* */
-/* FreeType convenience functions to handle glyphs.. */
+/* FreeType convenience functions to handle glyphs (body). */
/* */
-/* Copyright 1996-1999 by */
+/* Copyright 1996-2000 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -13,31 +13,38 @@
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
-/* This file contains the definition of several convenience functions */
-/* that can be used by client applications to easily retrieve glyph */
-/* bitmaps and outlines from a given face. */
-/* */
-/* These functions should be optional if you're writing a font server */
-/* or text layout engine on top of FreeType. However, they are pretty */
-/* handy for many other simple uses of the library.. */
-/* */
/***************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* This file contains the definition of several convenience functions */
+ /* that can be used by client applications to easily retrieve glyph */
+ /* bitmaps and outlines from a given face. */
+ /* */
+ /* These functions should be optional if you are writing a font server */
+ /* or text layout engine on top of FreeType. However, they are pretty */
+ /* handy for many other simple uses of the library. */
+ /* */
+ /*************************************************************************/
+
+
#include <freetype/ftglyph.h>
#include <freetype/internal/ftobjs.h>
+
static
- void ft_prepare_glyph( FT_Glyph glyph,
- FT_Face face,
- FT_Bool vertical )
+ void ft_prepare_glyph( FT_Glyph glyph,
+ FT_Face face,
+ FT_Bool vertical )
{
FT_Glyph_Metrics* metrics = &face->glyph->metrics;
- glyph->memory = face->memory;
- glyph->width = metrics->width;
- glyph->height = metrics->height;
- if (vertical)
+ glyph->memory = face->memory;
+ glyph->width = metrics->width;
+ glyph->height = metrics->height;
+
+ if ( vertical )
{
glyph->bearingX = metrics->vertBearingX;
glyph->bearingY = metrics->vertBearingY;
@@ -51,74 +58,80 @@
}
}
- /***********************************************************************
- *
- * <Function>
- * FT_Get_Glyph_Bitmap
- *
- * <Description>
- * A function used to directly return a monochrome bitmap glyph image
- * from a face.
- *
- * <Input>
- * face :: handle to source face object
- * glyph_index :: glyph index in face
- * load_flags :: load flags, see FT_LOAD_FLAG_XXXX constants..
- * grays :: number of gray levels for anti-aliased bitmaps,
- * set to 0 if you want to render a monochrome bitmap
- * origin :: a pointer to the origin's position. Set to 0
- * if the current transform is the identity..
- *
- * <Output>
- * bitglyph :: pointer to the new bitmap glyph
- *
- * <Return>
- * Error code. 0 means success.
- *
- * <Note>
- * If the font contains glyph outlines, these will be automatically
- * converted to a bitmap according to the value of "grays"
- *
- * If "grays" is set to 0, the result is a 1-bit monochrome bitmap
- * otherwise, it is an 8-bit gray-level bitmap
- *
- * The number of gray levels in the result anti-aliased bitmap might
- * not be "grays", depending on the current scan-converter implementation
- *
- * Note that it is not possible to generate 8-bit monochrome bitmaps
- * with this function. Rather, use FT_Get_Glyph_Outline, then
- * FT_Glyph_Render_Outline and provide your own span callbacks..
- *
- * When the face doesn't contain scalable outlines, this function will
- * fail if the current transform is not the identity, or if the glyph
- * origin's phase to the pixel grid is not 0 in both directions !!
- *
- ***********************************************************************/
-
- FT_EXPORT_FUNC(FT_Error) FT_Get_Glyph_Bitmap( FT_Face face,
- FT_UInt glyph_index,
- FT_UInt load_flags,
- FT_Int grays,
- FT_Vector* origin,
- FT_BitmapGlyph *abitglyph )
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Glyph_Bitmap */
+ /* */
+ /* <Description> */
+ /* A function used to directly return a monochrome bitmap glyph image */
+ /* from a face. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to source face object. */
+ /* glyph_index :: A glyph index into the face. */
+ /* load_flags :: Load flags (see FT_LOAD_FLAG_XXXX constants). */
+ /* grays :: The number of gray levels for anti-aliased bitmaps. */
+ /* Set it to 0 if you want to render a monochrome */
+ /* bitmap. */
+ /* origin :: A pointer to the origin's position. Set it to 0 */
+ /* if the current transform is the identity. */
+ /* */
+ /* <Output> */
+ /* abitglyph :: A pointer to the new bitmap glyph. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* If the font contains glyph outlines, these will be automatically */
+ /* converted to a bitmap according to the value of `grays' */
+ /* */
+ /* If `grays' is set to 0, the result is a 1-bit monochrome bitmap */
+ /* otherwise, it is an 8-bit gray-level bitmap. */
+ /* */
+ /* The number of gray levels in the result anti-aliased bitmap might */
+ /* not be `grays', depending on the current scan-converter */
+ /* implementation. */
+ /* */
+ /* Note that it is not possible to generate 8-bit monochrome bitmaps */
+ /* with this function. Rather, use FT_Get_Glyph_Outline(), then */
+ /* FT_Glyph_Render_Outline(), and provide your own span callbacks. */
+ /* */
+ /* If the face doesn't contain scalable outlines, this function will */
+ /* fail if the current transformation is not the identity, or if the */
+ /* glyph origin's phase to the pixel grid is not 0 in both */
+ /* directions! */
+ /* */
+ FT_EXPORT_FUNC( FT_Error ) FT_Get_Glyph_Bitmap(
+ FT_Face face,
+ FT_UInt glyph_index,
+ FT_UInt load_flags,
+ FT_Int grays,
+ FT_Vector* origin,
+ FT_BitmapGlyph* abitglyph )
{
FT_Error error;
FT_Memory memory;
+
FT_BitmapGlyph bitglyph;
FT_Glyph glyph;
FT_Pos origin_x = 0;
FT_Pos origin_y = 0;
+
*abitglyph = 0;
- if (origin)
+ if ( origin )
{
origin_x = origin->x & 63;
origin_y = origin->y & 63;
}
- /* check arguments if the face's format is not scalable */
- if ( !(face->face_flags & FT_FACE_FLAG_SCALABLE) && face->transform_flags )
+ /* check arguments whether the face's format is not scalable */
+ if ( !( face->face_flags & FT_FACE_FLAG_SCALABLE ) &&
+ face->transform_flags )
{
/* we can't transform bitmaps, so return an error */
error = FT_Err_Unimplemented_Feature;
@@ -126,7 +139,7 @@
}
/* check that NO_SCALE and NO_RECURSE are not set */
- if (load_flags & (FT_LOAD_NO_SCALE|FT_LOAD_NO_RECURSE))
+ if ( load_flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_RECURSE ) )
{
error = FT_Err_Invalid_Argument;
goto Exit;
@@ -137,104 +150,115 @@
load_flags |= FT_LOAD_NO_BITMAP;
error = FT_Load_Glyph( face, glyph_index, load_flags );
- if (error) goto Exit;
+ if ( error )
+ goto Exit;
/* now, handle bitmap and outline glyph images */
memory = face->memory;
switch ( face->glyph->format )
{
- case ft_glyph_format_bitmap:
- {
- FT_Long size;
- FT_Bitmap* source;
+ case ft_glyph_format_bitmap:
+ {
+ FT_Long size;
+ FT_Bitmap* source;
- if ( ALLOC( bitglyph, sizeof(*bitglyph) ) )
- goto Exit;
- glyph = (FT_Glyph)bitglyph;
- glyph->glyph_type = ft_glyph_type_bitmap;
- ft_prepare_glyph( glyph, face, 0 );
+ if ( ALLOC( bitglyph, sizeof ( *bitglyph ) ) )
+ goto Exit;
- source = &face->glyph->bitmap;
- size = source->rows * source->pitch;
- if (size < 0) size = -size;
+ glyph = (FT_Glyph)bitglyph;
+ glyph->glyph_type = ft_glyph_type_bitmap;
+ ft_prepare_glyph( glyph, face, 0 );
- bitglyph->bitmap = *source;
- if ( ALLOC( bitglyph->bitmap.buffer, size ) )
- goto Fail;
+ source = &face->glyph->bitmap;
+ size = source->rows * source->pitch;
+ if ( size < 0 )
+ size = -size;
- /* copy the content of the source glyph */
- MEM_Copy( bitglyph->bitmap.buffer, source->buffer, size );
- }
- break;
+ bitglyph->bitmap = *source;
+ if ( ALLOC( bitglyph->bitmap.buffer, size ) )
+ goto Fail;
- case ft_glyph_format_outline:
+ /* copy the content of the source glyph */
+ MEM_Copy( bitglyph->bitmap.buffer, source->buffer, size );
+ }
+ break;
+
+ case ft_glyph_format_outline:
+ {
+ FT_BBox cbox;
+ FT_Int width, height, pitch;
+ FT_Long size;
+
+
+ /* transform the outline -- note that the original metrics are NOT */
+ /* transformed by this, only the outline points themselves... */
+ FT_Outline_Transform( &face->glyph->outline,
+ &face->transform_matrix );
+ FT_Outline_Translate( &face->glyph->outline,
+ face->transform_delta.x + origin_x,
+ face->transform_delta.y + origin_y );
+
+ /* compute the size in pixels of the outline */
+ FT_Outline_Get_CBox( &face->glyph->outline, &cbox );
+ cbox.xMin &= -64;
+ cbox.yMin &= -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;
+
+ /* allocate the pixel buffer for the glyph bitmap */
+ if ( grays )
+ /* some raster implementation need this */
+ pitch = ( width + 3 ) & -4;
+ else
+ pitch = ( width + 7 ) >> 3;
+
+ size = pitch * height;
+ if ( ALLOC( bitglyph, sizeof ( *bitglyph ) ) )
+ goto Exit;
+
+ glyph = (FT_Glyph)bitglyph;
+ glyph->glyph_type = ft_glyph_type_bitmap;
+ ft_prepare_glyph( glyph, face, 0 );
+
+ if ( ALLOC( bitglyph->bitmap.buffer, size ) )
+ goto Fail;
+
+ bitglyph->bitmap.width = width;
+ bitglyph->bitmap.rows = height;
+ bitglyph->bitmap.pitch = pitch;
+ bitglyph->bitmap.pixel_mode = grays ? ft_pixel_mode_grays
+ : ft_pixel_mode_mono;
+ bitglyph->bitmap.num_grays = (short)grays;
+
+ bitglyph->left = cbox.xMin >> 6;
+ bitglyph->top = cbox.yMax >> 6;
+
+ /* render the monochrome outline into the target buffer */
+ FT_Outline_Translate( &face->glyph->outline,
+ -cbox.xMin,
+ -cbox.yMin );
+ error = FT_Outline_Get_Bitmap( face->driver->library,
+ &face->glyph->outline,
+ &bitglyph->bitmap );
+ if ( error )
{
- FT_BBox cbox;
- FT_Int width, height, pitch;
- FT_Long size;
-
- /* transform the outline - note that the original metrics are NOT */
- /* transformed by this.. only the outline points themselves.. */
- FT_Outline_Transform( &face->glyph->outline, &face->transform_matrix );
- FT_Outline_Translate( &face->glyph->outline,
- face->transform_delta.x + origin_x,
- face->transform_delta.y + origin_y );
-
- /* compute the size in pixels of the outline */
- FT_Outline_Get_CBox( &face->glyph->outline, &cbox );
- cbox.xMin &= -64;
- cbox.yMin &= -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;
-
- /* allocate the pixel buffer for the glyph bitmap */
- if (grays) pitch = (width+3) & -4; /* some raster implementation need this */
- else pitch = (width+7) >> 3;
-
- size = pitch * height;
- if ( ALLOC( bitglyph, sizeof(*bitglyph) ) )
- goto Exit;
-
- glyph = (FT_Glyph)bitglyph;
- glyph->glyph_type = ft_glyph_type_bitmap;
- ft_prepare_glyph( glyph, face, 0 );
-
- if ( ALLOC( bitglyph->bitmap.buffer, size ) )
- goto Fail;
-
- bitglyph->bitmap.width = width;
- bitglyph->bitmap.rows = height;
- bitglyph->bitmap.pitch = pitch;
- bitglyph->bitmap.pixel_mode = grays ? ft_pixel_mode_grays
- : ft_pixel_mode_mono;
- bitglyph->bitmap.num_grays = (short)grays;
-
- bitglyph->left = (cbox.xMin >> 6);
- bitglyph->top = (cbox.yMax >> 6);
-
- /* render the monochrome outline into the target buffer */
- FT_Outline_Translate( &face->glyph->outline, -cbox.xMin, -cbox.yMin );
- error = FT_Outline_Get_Bitmap( face->driver->library,
- &face->glyph->outline,
- &bitglyph->bitmap );
- if (error)
- {
- FREE( bitglyph->bitmap.buffer );
- goto Fail;
- }
+ FREE( bitglyph->bitmap.buffer );
+ goto Fail;
}
- break;
+ }
+ break;
- default:
- error = FT_Err_Invalid_Glyph_Index;
- goto Exit;
+ default:
+ error = FT_Err_Invalid_Glyph_Index;
+ goto Exit;
}
*abitglyph = bitglyph;
+
Exit:
return error;
@@ -244,45 +268,46 @@
}
- /***********************************************************************
- *
- * <Function>
- * FT_Get_Glyph_Outline
- *
- * <Description>
- * A function used to directly return a bitmap glyph image from a
- * face. This is faster than calling FT_Load_Glyph+FT_Get_Outline_Bitmap..
- *
- * <Input>
- * face :: handle to source face object
- * glyph_index :: glyph index in face
- * load_flags :: load flags, see FT_LOAD_FLAG_XXXX constants..
- *
- * <Output>
- * vecglyph :: pointer to the new outline glyph
- *
- * <Return>
- * Error code. 0 means success.
- *
- * <Note>
- * This function will fail if the load flags FT_LOAD_NO_OUTLINE and
- * FT_LOAD_NO_RECURSE are set..
- *
- ***********************************************************************/
-
- FT_EXPORT_FUNC(FT_Error) FT_Get_Glyph_Outline( FT_Face face,
- FT_UInt glyph_index,
- FT_UInt load_flags,
- FT_OutlineGlyph *vecglyph )
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Glyph_Outline */
+ /* */
+ /* <Description> */
+ /* A function used to directly return a bitmap glyph image from a */
+ /* face. This is faster than calling FT_Load_Glyph() + */
+ /* FT_Get_Outline_Bitmap(). */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* glyph_index :: A glyph index into face */
+ /* load_flags :: Load flags (see FT_LOAD_FLAG_XXXX constants). */
+ /* */
+ /* <Output> */
+ /* vecglyph :: A pointer to the new outline glyph. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* This function will fail if the load flags FT_LOAD_NO_OUTLINE and */
+ /* FT_LOAD_NO_RECURSE are set. */
+ /* */
+ FT_EXPORT_FUNC( FT_Error ) FT_Get_Glyph_Outline(
+ FT_Face face,
+ FT_UInt glyph_index,
+ FT_UInt load_flags,
+ FT_OutlineGlyph* vecglyph )
{
FT_Error error;
FT_Memory memory;
FT_OutlineGlyph glyph;
+
*vecglyph = 0;
/* check that NO_OUTLINE and NO_RECURSE are not set */
- if (load_flags & (FT_LOAD_NO_OUTLINE|FT_LOAD_NO_RECURSE))
+ if ( load_flags & ( FT_LOAD_NO_OUTLINE | FT_LOAD_NO_RECURSE ) )
{
error = FT_Err_Invalid_Argument;
goto Exit;
@@ -292,7 +317,8 @@
load_flags |= FT_LOAD_NO_BITMAP;
error = FT_Load_Glyph( face, glyph_index, load_flags );
- if (error) goto Exit;
+ if ( error )
+ goto Exit;
/* check that we really loaded an outline */
if ( face->glyph->format != ft_glyph_format_outline )
@@ -301,8 +327,8 @@
goto Exit;
}
- /* transform the outline - note that the original metrics are NOT */
- /* transformed by this.. only the outline points themselves.. */
+ /* transform the outline -- note that the original metrics are NOT */
+ /* transformed by this, only the outline points themselves... */
if ( face->transform_flags )
{
FT_Outline_Transform( &face->glyph->outline, &face->transform_matrix );
@@ -311,9 +337,9 @@
face->transform_delta.y );
}
- /* now, create a new outline glyph and copy everything there */
+ /* now, create a new outline glyph and copy everything */
memory = face->memory;
- if ( ALLOC( glyph, sizeof(*glyph) ) )
+ if ( ALLOC( glyph, sizeof ( *glyph ) ) )
goto Exit;
ft_prepare_glyph( (FT_Glyph)glyph, face, 0 );
@@ -323,12 +349,13 @@
face->glyph->outline.n_points,
face->glyph->outline.n_contours,
&glyph->outline );
- if (!error)
+ if ( !error )
error = FT_Outline_Copy( &face->glyph->outline, &glyph->outline );
-
- if (error) goto Fail;
+ if ( error )
+ goto Fail;
*vecglyph = glyph;
+
Exit:
return error;
@@ -337,37 +364,42 @@
goto Exit;
}
- /***********************************************************************
- *
- * <Function>
- * FT_Set_Transform
- *
- * <Description>
- * A function used to set the transform that is applied to glyph images
- * just after they're loaded in the face's glyph slot, and before they're
- * returned by either FT_Get_Glyph_Bitmap or FT_Get_Glyph_Outline
- *
- * <Input>
- * face :: handle to source face object
- * matrix :: pointer to the transform's 2x2 matrix. 0 for identity
- * delta :: pointer to the transform's translation. 0 for null vector
- *
- * <Note>
- * The transform is only applied to glyph outlines when they are found
- * in a font face. It is unable to transform embedded glyph bitmaps
- *
- ***********************************************************************/
-
- FT_EXPORT_FUNC(void) FT_Set_Transform( FT_Face face,
- FT_Matrix* matrix,
- FT_Vector* delta )
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Transform */
+ /* */
+ /* <Description> */
+ /* A function used to set the transformation that is applied to glyph */
+ /* images just after they are loaded in the face's glyph slot, and */
+ /* before they are returned by either FT_Get_Glyph_Bitmap() or */
+ /* FT_Get_Glyph_Outline(). */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Input> */
+ /* matrix :: A pointer to the transformation's 2x2 matrix. Use 0 for */
+ /* the identity matrix. */
+ /* delta :: A pointer to the translation vector. Use 0 for the null */
+ /* vector. */
+ /* */
+ /* <Note> */
+ /* The transformation is only applied to glyph outlines if they are */
+ /* found in a font face. It is unable to transform embedded glyph */
+ /* bitmaps. */
+ /* */
+ FT_EXPORT_FUNC( void ) FT_Set_Transform( FT_Face face,
+ FT_Matrix* matrix,
+ FT_Vector* delta )
{
face->transform_flags = 0;
- if (!matrix)
+ if ( !matrix )
{
face->transform_matrix.xx = 0x10000L;
- face->transform_matrix.xy = 0;
+ face->transform_matrix.xy = 0L;
face->transform_matrix.yx = 0L;
face->transform_matrix.yy = 0x10000L;
matrix = &face->transform_matrix;
@@ -375,13 +407,13 @@
else
face->transform_matrix = *matrix;
- /* set transform_flags bit flag 0 if delta isn't the null vector */
- if ( (matrix->xy | matrix->yx) ||
- matrix->xx != 0x10000L ||
- matrix->yy != 0x10000L )
+ /* set transform_flags bit flag 0 if `matrix' isn't the identity */
+ if ( ( matrix->xy | matrix->yx ) ||
+ matrix->xx != 0x10000L ||
+ matrix->yy != 0x10000L )
face->transform_flags |= 1;
- if (!delta)
+ if ( !delta )
{
face->transform_delta.x = 0;
face->transform_delta.y = 0;
@@ -390,39 +422,43 @@
else
face->transform_delta = *delta;
- /* set transform_flags bit flag 1 if delta isn't the null vector */
+ /* set transform_flags bit flag 1 if `delta' isn't the null vector */
if ( delta->x | delta->y )
face->transform_flags |= 2;
}
- /***********************************************************************
- *
- * <Function>
- * FT_Done_Glyph
- *
- * <Description>
- * Destroys a given glyph..
- *
- * <Input>
- * glyph :: handle to target glyph object
- *
- ***********************************************************************/
-
- FT_EXPORT_FUNC(void) FT_Done_Glyph( FT_Glyph glyph )
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_Glyph */
+ /* */
+ /* <Description> */
+ /* Destroys a given glyph. */
+ /* */
+ /* <Input> */
+ /* glyph :: A handle to the target glyph object. */
+ /* */
+ FT_EXPORT_FUNC( void ) FT_Done_Glyph( FT_Glyph glyph )
{
- if (glyph)
+ if ( glyph )
{
FT_Memory memory = glyph->memory;
+
if ( glyph->glyph_type == ft_glyph_type_bitmap )
{
FT_BitmapGlyph bit = (FT_BitmapGlyph)glyph;
+
+
FREE( bit->bitmap.buffer );
}
else if ( glyph->glyph_type == ft_glyph_type_outline )
{
FT_OutlineGlyph out = (FT_OutlineGlyph)glyph;
- if (out->outline.flags & ft_outline_owner)
+
+
+ if ( out->outline.flags & ft_outline_owner )
{
FREE( out->outline.points );
FREE( out->outline.contours );
@@ -435,41 +471,42 @@
}
- /***********************************************************************
- *
- * <Function>
- * FT_Glyph_Get_Box
- *
- * <Description>
- * Returns the glyph image's bounding box in pixels.
- *
- * <Input>
- * glyph :: handle to target glyph object
- *
- * <Output>
- * box :: the glyph bounding box. Coordinates are expressed in
- * _integer_ pixels, with exclusive max bounds
- *
- * <Note>
- * Coordinates are relative to the glyph origin, using the Y-upwards
- * convention..
- *
- * The width of the box in pixels is box.xMax-box.xMin
- * The height is box.yMax - box.yMin
- *
- ***********************************************************************/
-
- FT_EXPORT_FUNC(void) FT_Glyph_Get_Box( FT_Glyph glyph,
- FT_BBox *box )
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Glyph_Get_Box */
+ /* */
+ /* <Description> */
+ /* Returns the glyph image's bounding box in pixels. */
+ /* */
+ /* <Input> */
+ /* glyph :: A handle to the target glyph object. */
+ /* */
+ /* <Output> */
+ /* box :: The glyph bounding box. Coordinates are expressed in */
+ /* _integer_ pixels, with exclusive maximal bounding values. */
+ /* */
+ /* <Note> */
+ /* Coordinates are relative to the glyph origin, using the Y-upwards */
+ /* convention. */
+ /* */
+ /* The width of the box in pixels is `box.xMax-box.xMin'; the height */
+ /* is `box.yMax-box.yMin'. */
+ /* */
+ FT_EXPORT_FUNC( void ) FT_Glyph_Get_Box( FT_Glyph glyph,
+ FT_BBox* box )
{
box->xMin = box->xMax = 0;
box->yMin = box->yMax = 0;
- if (glyph) switch (glyph->glyph_type)
- {
+ if ( glyph )
+ switch ( glyph->glyph_type )
+ {
case ft_glyph_type_bitmap:
{
FT_BitmapGlyph bit = (FT_BitmapGlyph)glyph;
+
+
box->xMin = bit->left;
box->xMax = box->xMin + bit->bitmap.width;
box->yMax = bit->top;
@@ -481,11 +518,12 @@
{
FT_OutlineGlyph out = (FT_OutlineGlyph)glyph;
+
FT_Outline_Get_CBox( &out->outline, box );
box->xMin >>= 6;
box->yMin >>= 6;
- box->xMax = (box->xMax+63) >> 6;
- box->yMax = (box->yMax+63) >> 6;
+ box->xMax = ( box->xMax + 63 ) >> 6;
+ box->yMax = ( box->yMax + 63 ) >> 6;
}
break;
@@ -495,29 +533,35 @@
}
- /***************************************************************************/
- /***************************************************************************/
- /**** ****/
- /**** EXPERIMENTAL EMBOLDENING/OUTLINING SUPPORT ****/
- /**** ****/
- /***************************************************************************/
- /***************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** EXPERIMENTAL EMBOLDENING/OUTLINING SUPPORT ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
#if 0
-/* Compute the norm of a vector */
+ /* Compute the norm of a vector */
+
#ifdef FT_CONFIG_OPTION_OLD_CALCS
+
static
- FT_Pos ft_norm( FT_Vector* vec )
+ FT_Pos ft_norm( FT_Vector* vec )
{
- FT_Int64 t1, t2;
+ FT_Int64 t1, t2;
+
- MUL_64( vec->x, vec->x, t1 );
- MUL_64( vec->y, vec->y, t2 );
- ADD_64( t1, t2, t1 );
- return (FT_Pos)SQRT_64(t1);
+ MUL_64( vec->x, vec->x, t1 );
+ MUL_64( vec->y, vec->y, t2 );
+ ADD_64( t1, t2, t1 );
+
+ return (FT_Pos)SQRT_64( t1 );
}
-#else
+
+#else /* FT_CONFIG_OPTION_OLD_CALCS */
+
static
FT_Pos ft_norm( FT_Vector* vec )
{
@@ -525,76 +569,84 @@
FT_Int shift;
FT_ULong H, L, L2, hi, lo, med;
- u = vec->x; if (u < 0) u = -u;
- v = vec->y; if (v < 0) v = -v;
- if (u < v)
+ u = vec->x; if ( u < 0 ) u = -u;
+ v = vec->y; if ( v < 0 ) v = -v;
+
+ if ( u < v )
{
d = u;
u = v;
v = d;
}
- /* check that we're not trying to normalise zero !! */
- if (u==0) return 0;
+ /* check that we're not trying to normalize zero! */
+ if ( u == 0 )
+ return 0;
- /* compute (u*u+v*v) on 64 bits with two 32-bit registers [H:L] */
+ /* compute (u*u + v*v) on 64 bits with two 32-bit registers [H:L] */
hi = (FT_ULong)u >> 16;
lo = (FT_ULong)u & 0xFFFF;
- med = hi*lo;
+ med = hi * lo;
- H = hi*hi + (med >> 15);
+ H = hi * hi + ( med >> 15 );
med <<= 17;
- L = lo*lo + med;
- if (L < med) H++;
+ L = lo * lo + med;
+ if ( L < med )
+ H++;
hi = (FT_ULong)v >> 16;
lo = (FT_ULong)v & 0xFFFF;
- med = hi*lo;
+ med = hi * lo;
- H += hi*hi + (med >> 15);
+ H += hi * hi + ( med >> 15 );
med <<= 17;
- L2 = lo*lo + med;
- if (L2 < med) H++;
+ L2 = lo * lo + med;
+ if ( L2 < med )
+ H++;
L += L2;
- if (L < L2) H++;
+ if ( L < L2 )
+ H++;
- /* if the value is smaller than 32-bits */
+ /* if the value is smaller than 32 bits */
shift = 0;
- if (H == 0)
+ if ( H == 0 )
{
- while ((L & 0xC0000000) == 0)
+ while ( ( L & 0xC0000000UL ) == 0 )
{
L <<= 2;
shift++;
}
- return (FT_Sqrt32(L) >> shift);
+ return ( FT_Sqrt32( L ) >> shift );
}
else
{
- while (H)
+ while ( H )
{
- L = (L >> 2) | (H << 30);
+ L = ( L >> 2 ) | ( H << 30 );
H >>= 2;
shift++;
}
- return (FT_Sqrt32(L) << shift);
+ return ( FT_Sqrt32( L ) << shift );
}
}
-#endif
+
+#endif /* FT_CONFIG_OPTION_OLD_CALCS */
+
static
int ft_test_extrema( FT_Outline* outline,
int n )
{
- FT_Vector *prev, *cur, *next;
- FT_Pos product;
+ FT_Vector *prev, *cur, *next;
+ FT_Pos product;
FT_Int first, last;
- /* we need to compute the "previous" and "next" point */
- /* for this extrema.. */
- cur = outline->points + n;
+
+ /* we need to compute the `previous' and `next' point */
+ /* for these extrema. */
+ cur = outline->points + n;
prev = cur - 1;
next = cur + 1;
@@ -612,186 +664,194 @@
first = last + 1;
}
- product = FT_MulDiv( cur->x - prev->x, /* in.x */
+ product = FT_MulDiv( cur->x - prev->x, /* in.x */
next->y - cur->y, /* out.y */
- 0x40 ) -
-
+ 0x40 )
+ -
FT_MulDiv( cur->y - prev->y, /* in.y */
next->x - cur->x, /* out.x */
0x40 );
- if (product)
- product = ( product > 0 ? 1 : -1 );
+ if ( product )
+ product = product > 0 ? 1 : -1;
- return product;
+ return product;
}
-/* Compute the orientation of path filling. It differs between TrueType */
-/* and Type1 formats. We could use the 'ft_outline_reverse_fill' flag, */
-/* but it's better to re-compute it directly (it seems that this flag */
-/* isn't correctly set for some weird composite glyphs for now).. */
-/* */
-/* We do this by computing bounding box points, and computing their */
-/* curvature.. the function returns either 1 or -1 */
-/* */
+ /* Compute the orientation of path filling. It differs between TrueType */
+ /* and Type1 formats. We could use the `ft_outline_reverse_fill' flag, */
+ /* but it's better to re-compute it directly (it seems that this flag */
+ /* isn't correctly set for some weird composite glyphs for now). */
+ /* */
+ /* We do this by computing bounding box points, and computing their */
+ /* curvature. */
+ /* */
+ /* The function returns either 1 or -1. */
+ /* */
static
int ft_get_orientation( FT_Outline* outline )
{
- FT_BBox box;
- FT_BBox indexes;
- int n, last;
-
- indexes.xMin = -1;
- indexes.yMin = -1;
- indexes.xMax = -1;
- indexes.yMax = -1;
-
- box.xMin = box.yMin = 32767;
- box.xMax = box.yMax = -32768;
-
- /* is it empty ? */
- if ( outline->n_contours < 1 )
- return 1;
-
- last = outline->contours[outline->n_contours-1];
-
- for ( n = 0; n <= last; n++ )
- {
- FT_Pos x, y;
-
- x = outline->points[n].x;
- if ( x < box.xMin )
- {
- box.xMin = x;
- indexes.xMin = n;
- }
-
- if ( x > box.xMax )
- {
- box.xMax = x;
- indexes.xMax = n;
- }
-
- y = outline->points[n].y;
- if ( y < box.yMin )
- {
- box.yMin = y;
- indexes.yMin = n;
- }
-
- if ( y > box.yMax )
- {
- box.yMax = y;
- indexes.yMax = n;
- }
- }
-
- /* test orientation of the xmin */
- return ft_test_extrema( outline, indexes.xMin ) ||
- ft_test_extrema( outline, indexes.yMin ) ||
- ft_test_extrema( outline, indexes.xMax ) ||
- ft_test_extrema( outline, indexes.yMax ) ||
- 1; /* this is an empty glyph ?? */
+ FT_BBox box;
+ FT_BBox indices;
+ int n, last;
+
+ indices.xMin = -1;
+ indices.yMin = -1;
+ indices.xMax = -1;
+ indices.yMax = -1;
+
+ box.xMin = box.yMin = 32767;
+ box.xMax = box.yMax = -32768;
+
+ /* is it empty ? */
+ if ( outline->n_contours < 1 )
+ return 1;
+
+ last = outline->contours[outline->n_contours - 1];
+
+ for ( n = 0; n <= last; n++ )
+ {
+ FT_Pos x, y;
+
+
+ x = outline->points[n].x;
+ if ( x < box.xMin )
+ {
+ box.xMin = x;
+ indices.xMin = n;
+ }
+ if ( x > box.xMax )
+ {
+ box.xMax = x;
+ indices.xMax = n;
+ }
+
+ y = outline->points[n].y;
+ if ( y < box.yMin )
+ {
+ box.yMin = y;
+ indices.yMin = n;
+ }
+ if ( y > box.yMax )
+ {
+ box.yMax = y;
+ indices.yMax = n;
+ }
+ }
+
+ /* test orientation of the xmin */
+ return ft_test_extrema( outline, indices.xMin ) ||
+ ft_test_extrema( outline, indices.yMin ) ||
+ ft_test_extrema( outline, indices.xMax ) ||
+ ft_test_extrema( outline, indices.yMax ) ||
+ 1; /* this is an empty glyph? */
}
static
- FT_Error ft_embolden( FT_Face original,
- FT_Outline* outline,
- FT_Pos* advance )
+ FT_Error ft_embolden( FT_Face original,
+ FT_Outline* outline,
+ FT_Pos* advance )
{
- FT_Vector u, v;
- FT_Vector* points;
- FT_Vector cur, prev, next;
- FT_Pos distance;
- int c, n, first, orientation;
+ FT_Vector u, v;
+ FT_Vector* points;
+ FT_Vector cur, prev, next;
+ FT_Pos distance;
+ int c, n, first, orientation;
- (void)advance;
+ UNUSED( advance );
- /* compute control distance */
- distance = FT_MulFix( original->em_size/60,
- original->size->metrics.y_scale );
- orientation = ft_get_orientation( &original->glyph->outline );
+ /* compute control distance */
+ distance = FT_MulFix( original->em_size / 60,
+ original->size->metrics.y_scale );
- points = original->glyph->outline.points;
+ orientation = ft_get_orientation( &original->glyph->outline );
- first = 0;
- for ( c = 0; c < outline->n_contours; c++ )
- {
- int last = outline->contours[c];
+ points = original->glyph->outline.points;
- prev = points[last];
+ first = 0;
+ for ( c = 0; c < outline->n_contours; c++ )
+ {
+ int last = outline->contours[c];
- for ( n = first; n <= last; n++ )
- {
- FT_Pos norme, delta, d;
- FT_Vector in, out;
- cur = points[n];
- if ( n < last ) next = points[n+1];
- else next = points[first];
+ prev = points[last];
- /* compute the in and out vectors */
- in.x = cur.x - prev.x;
- in.y = cur.y - prev.y;
+ for ( n = first; n <= last; n++ )
+ {
+ FT_Pos norm, delta, d;
+ FT_Vector in, out;
- out.x = next.x - cur.x;
- out.y = next.y - cur.y;
- /* compute U and V */
- norme = ft_norm( &in );
- u.x = orientation * FT_DivFix( in.y, norme );
- u.y = orientation * - FT_DivFix( in.x, norme );
+ cur = points[n];
+ if ( n < last ) next = points[n + 1];
+ else next = points[first];
- norme = ft_norm( &out );
- v.x = orientation * FT_DivFix( out.y, norme );
- v.y = orientation * - FT_DivFix( out.x, norme );
+ /* compute the in and out vectors */
+ in.x = cur.x - prev.x;
+ in.y = cur.y - prev.y;
- d = distance;
+ out.x = next.x - cur.x;
+ out.y = next.y - cur.y;
- if ( (outline->flags[n] & FT_Curve_Tag_On) == 0 )
- d *= 2;
+ /* compute U and V */
+ norm = ft_norm( &in );
+ u.x = orientation * FT_DivFix( in.y, norm );
+ u.y = orientation * -FT_DivFix( in.x, norm );
- /* Check discriminant for parallel vectors */
- delta = FT_MulFix( u.x, v.y ) - FT_MulFix( u.y, v.x );
- if ( delta > FT_BOLD_THRESHOLD || delta < - FT_BOLD_THRESHOLD )
- {
- /* Move point - compute A and B */
- FT_Pos x, y, A, B;
+ norm = ft_norm( &out );
+ v.x = orientation * FT_DivFix( out.y, norm );
+ v.y = orientation * -FT_DivFix( out.x, norm );
- A = d + FT_MulFix( cur.x, u.x ) + FT_MulFix( cur.y, u.y );
- B = d + FT_MulFix( cur.x, v.x ) + FT_MulFix( cur.y, v.y );
+ d = distance;
- x = FT_MulFix( A, v.y ) - FT_MulFix( B, u.y );
- y = FT_MulFix( B, u.x ) - FT_MulFix( A, v.x );
+ if ( (outline->flags[n] & FT_Curve_Tag_On) == 0 )
+ d *= 2;
- outline->points[n].x = distance + FT_DivFix( x, delta );
- outline->points[n].y = distance + FT_DivFix( y, delta );
- }
- else
- {
- /* Vectors are nearly parallel */
- FT_Pos x, y;
+ /* Check discriminant for parallel vectors */
+ delta = FT_MulFix( u.x, v.y ) - FT_MulFix( u.y, v.x );
+ if ( delta > FT_BOLD_THRESHOLD || delta < -FT_BOLD_THRESHOLD )
+ {
+ /* Move point -- compute A and B */
+ FT_Pos x, y, A, B;
- x = distance + cur.x + FT_MulFix( d, u.x + v.x )/2;
- y = distance + cur.y + FT_MulFix( d, u.y + v.y )/2;
- outline->points[n].x = x;
- outline->points[n].y = y;
- }
+ A = d + FT_MulFix( cur.x, u.x ) + FT_MulFix( cur.y, u.y );
+ B = d + FT_MulFix( cur.x, v.x ) + FT_MulFix( cur.y, v.y );
- prev = cur;
- }
+ x = FT_MulFix( A, v.y ) - FT_MulFix( B, u.y );
+ y = FT_MulFix( B, u.x ) - FT_MulFix( A, v.x );
- first = last+1;
- }
+ outline->points[n].x = distance + FT_DivFix( x, delta );
+ outline->points[n].y = distance + FT_DivFix( y, delta );
+ }
+ else
+ {
+ /* Vectors are nearly parallel */
+ FT_Pos x, y;
- if (advance)
- *advance = (*advance + distance*4) & -64;
+ x = distance + cur.x + FT_MulFix( d, u.x + v.x ) / 2;
+ y = distance + cur.y + FT_MulFix( d, u.y + v.y ) / 2;
- return 0;
+ outline->points[n].x = x;
+ outline->points[n].y = y;
+ }
+
+ prev = cur;
+ }
+
+ first = last + 1;
+ }
+
+ if ( advance )
+ *advance = ( *advance + distance * 4 ) & -64;
+
+ return 0;
}
-#endif /* 0 - EXPERIMENTAL STUFF !! */
+#endif /* 0 -- EXPERIMENTAL STUFF! */
+
+
+/* END */