Revised.
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
diff --git a/docs/glyphs/glyphs-6.html b/docs/glyphs/glyphs-6.html
index 9a63e88..7534468 100644
--- a/docs/glyphs/glyphs-6.html
+++ b/docs/glyphs/glyphs-6.html
@@ -199,12 +199,15 @@
b. Outline descriptor
</h4>
- <p>A FreeType outline is described through a simple structure, called
- <tt>FT_Outline</tt>, which fields are:</p>
+ <p>A FreeType outline is described through a simple structure:</p>
<center>
<table cellspacing=3
cellpadding=3>
+ <caption>
+ <b><tt>FT_Outline</tt></b>
+ </caption>
+
<tr>
<td>
<tt>n_points</tt>
@@ -267,7 +270,7 @@
<a name="section-2">
- <hr3>
+ <h3>
2. Bounding and control box computations
</h3>
diff --git a/docs/glyphs/glyphs-7.html b/docs/glyphs/glyphs-7.html
index d1dacee..e1ae854 100644
--- a/docs/glyphs/glyphs-7.html
+++ b/docs/glyphs/glyphs-7.html
@@ -1,12 +1,13 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en"
+ "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="blob">
- <meta name="GENERATOR" content="Mozilla/4.5 [fr] (Win98; I) [Netscape]">
- <title>FreeType Glyph Conventions</title>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="Author"
+ content="David Turner">
+ <title>FreeType Glyph Conventions</title>
</head>
-<body>
<body text="#000000"
bgcolor="#FFFFFF"
@@ -14,278 +15,342 @@
vlink="#51188E"
alink="#FF0000">
-<center>
-<h1>
-FreeType Glyph Conventions</h1></center>
-
-<center>
-<h2>
-version 2.1</h2></center>
-
-<center>
-<h3>
-Copyright 1998-2000 David Turner (<a href="mailto:david@freetype.org">david@freetype.org</a>)<br>
-Copyright 2000 The FreeType Development Team (<a href="devel@freetype.org">devel@freetype.org</a>)</h3></center>
-
-<center><table width=650><tr><td>
-
-<center><table width="100%" border=0 cellpadding=5><tr bgcolor="#CCFFCC" valign=center>
-<td align=center width="30%">
-<a href="glyphs-6.html">Previous</a>
-</td>
-<td align=center width="30%">
-<a href="index.html">Contents</a>
-</td>
-<td align=center width="30%">
-
-</td>
-</tr></table></center>
-
-
-<table width="100%"><tr valign=center bgcolor="#CCCCFF"><td><h2>
-VII. FreeType Bitmaps
-</h2></td></tr></table>
-
-
-<p>The purpose of this section is to present the way FreeType
-manages bitmaps and pixmaps, and how they relate to the concepts previously
-defined. The relationships between vectorial and pixel coordinates is
-explained.
-</p>
-
-<h3><a name="section-1">
-1. Vectorial versus pixel coordinates :
-</h3><blockquote>
+<h1 align=center>
+ FreeType Glyph Conventions
+</h1>
-<p>This sub-section explains the differences between vectorial
-and pixel coordinates. To make things clear, brackets will be used to describe
-pixel coordinates, e.g. [3,5], while parentheses will be used for vectorial
-ones, e.g. (-2,3.5).
-<p>In the pixel case, as we use the <i>Y upwards</i> convention, the coordinate
-[0,0] always refers to the <i>lower left pixel</i> of a bitmap, while coordinate
-[width-1, rows-1] to its <i>upper right pixel</i>.
-<p>In the vectorial case, point coordinates are expressed in floating units,
-like (1.25, -2.3). Such a position doesn't refer to a given pixel, but
-simply to an immaterial point in the 2D plane
-<p>The pixels themselves are indeed <i>square boxes</i> of the 2D plane,
-which centers lie in half pixel coordinates. For example, the <i>lower
-left pixel</i> of a bitmap is delimited by the <i>square</i> (0,0)-(1,1),
-its center being at location (0.5,0.5).
-<p>This introduces some differences when computing distances. For example,
-the "<i>length</i>" in pixels of the line [0,0]-[10,0] is 11. However,
-the vectorial distance between (0,0)-(10,0) covers exactly 10 pixel centers,
-hence its length if 10.
-<center><img SRC="grid_1.png" height=390 width=402></center>
+<h2 align=center>
+ Version 2.1
+</h2>
+<h3 align=center>
+ Copyright 1998-2000 David Turner (<a
+ href="mailto:david@freetype.org">david@freetype.org</a>)<br>
+ Copyright 2000 The FreeType Development Team (<a
+ href="mailto:devel@freetype.org">devel@freetype.org</a>)
+</h3>
-</blockquote><h3><a name="section-2">
-2. FreeType bitmap and pixmap descriptor :
-</h3><blockquote>
-
-<p>A bitmap or pixmap is described through a single structure,
-called <tt>FT_Bitmap</tt>, defined in the file
-<tt><freetype/ftimage.h></tt>. It is a simple descriptor whose fields are:</p>
-
-<center><table CELLSPACING=3 CELLPADDING=5 BGCOLOR="#CCCCCC" width="80%" >
-<caption><tt>FT_Bitmap</tt></caption>
-
-<tr>
-<td><b>rows</b></td>
-
-<td>the number of rows, i.e. lines, in the bitmap</td>
-</tr>
-
-<tr>
-<td><b>width</b></td>
-
-<td>the number of horizontal pixels in the bitmap</td>
-</tr>
-
-<tr>
-<td><b>pitch</b></td>
-
-<td>its absolute value is the number of bytes per bitmap line.
-it can be either positive or negative depending on the bitmap's
-vertical orientation</td>
-</tr>
-
-<tr>
-<td><b>buffer</b></td>
-
-<td>a typeless pointer to the bitmap pixel bufer</td>
-</tr>
-
-<tr>
-<td><b>pixel_mode</b></td>
-
-<td>an enumeration used to describe the pixel format of the bitmap.
-Examples are: <tt>ft_pixel_mode_mono</tt> for 1-bit monochrome bitmaps
-and <tt>ft_pixel_mode_grays</tt> for 8-bit anti-aliased "gray" values
-</td>
-
-<tr>
-<td><b>num_grays</b></td>
-
-<td>this is only used for "gray" pixel modes, it gives the
-number of gray levels used to describe the anti-aliased gray levels.
-256 by default with FreeType 2.
-</td>
-</tr>
-
-</table></center>
-
-
-<p>Note that the sign of the <b><tt>pitch</tt></b> fields determines wether
-the rows in the pixel buffer are stored in ascending or descending order.
-</p>
-
-<p>Remember that FreeType uses the <i>Y upwards</i> convention in the 2D
-plane. Which means that a coordinate of (0,0) always refer to the
-<i>lower-left corner</i> of a bitmap.
-</p>
-
-<p>When the pitch is positive, the rows are stored in decreasing vertical
-position, which means that the first bytes of the pixel buffer are part
-of the <i>upper</i> bitmap row.
-</p>
-
-<p>On the opposite, when the pitch is negative, the first bytes of the
-pixel buffer are part of the <i>lower</i> bitmap row.</p>
-
-<p>In all cases, one can see the pitch as the byte increment needed
-to skip to the <em>next lower scanline</em> in a given bitmap buffer.</p>
-
-<p>The two conventions are detailed by this graphics:</p>
-
-<center><table>
-<tr>
-<td><img SRC="up_flow.png" height=261 width=275></td>
-
-<td><img SRC="down_flow.png" height=263 width=273></td>
-</tr>
-</table></center>
-
-<p>The <em>positive pitch</em> convention is very often used, though
-some systems might need otherwise.</p>
-
-
-</blockquote><h3><a name="section-3">
-3. Converting outlines into bitmaps and pixmaps :
-</h3><blockquote>
-
-<p>Generating a bitmap or pixmap image from a vectorial image
-is easy with FreeType. However, one must understand a few points regarding
-the positioning of the outline in the 2D plane before converting it to
-a bitmap. These are :</p>
-
-<ul>
-
-<li><p>
-The glyph loader and hinter always places the outline in the 2D plane so
-that (0,0) matches its character origin. This means that the glyph’s outline,
-and corresponding bounding box, can be placed anywhere in the 2D plane
-(see the graphics in section III).
-</p></li>
-
-<li><p>
-The target bitmap’s area is mapped to the 2D plane, with its lower left
-corner at (0,0). This means that a bitmap or pixmap of dimensions
-[<tt>w,h</tt>] will be mapped to a 2D rectangle window delimited by
-(0,0)-(<tt>w,h</tt>).
-</p></li>
-
-<li><p>
-When scan-converting the outline, everything that falls
-within the bitmap window is rendered, the rest is ignored.
-</p></li>
-
-<p>A common mistake made by many developers when they begin using FreeType
-is believing that a loaded outline can be directly rendered in a bitmap
-of adequate dimensions. The following images illustrate why this is a problem:
-</p>
-
-<p>
-<ul>
-
-<li>
-the first image shows a loaded outline in the 2D plane.
-</li>
-
-<li>
-the second one shows the target window for a bitmap of arbitrary dimensions
-[w,h]
-</li>
-
-<li>
-the third one shows the juxtaposition of the outline and window in the
-2D plane
-</li>
-
-<li>
-the last image shows what will really be rendered in the bitmap.
-</li>
-</ul>
-</p>
-
-</ul>
-<center><img SRC="clipping.png" height=151 width=539></center>
-
-<p><br>
-<br>
-<br>
-<p>Indeed, in nearly all cases, the loaded or transformed outline must
-be translated before it is rendered into a target bitmap, in order to adjust
-its position relative to the target window.
-</p>
-
-<p>For example, the correct way of creating a <i>standalone</i> glyph bitmap
-is thus to :
-</p>
-
-<ul>
-<li><p>
-Compute the size of the glyph bitmap. It can be computed directly from
-the glyph metrics, or by computing its bounding box (this is useful when
-a transform has been applied to the outline after the load, as the glyph
-metrics are not valid anymore).
-</p></li>
-
-<li><p>
-Create the bitmap with the computed dimensions. Don't forget to fill the
-pixel buffer with the background color.
-</p></li>
-
-<li><p>
-Translate the outline so that its lower left corner matches (0,0). Don’t
-forget that in order to preserve hinting, one should use integer, i.e.
-rounded distances (of course, this isn’t required if preserving hinting
-information doesn’t matter, like with rotated text). Usually, this means
-translating with a vector <tt>( -ROUND(xMin), -ROUND(yMin) )</tt>.
-</p></li>
-
-<li><p>
-Call the rendering function (it can be <tt>FT_Outline_Render</tt> for
-example).
-</p></li>
-
-<p><br>In the case where one wants to write glyph images directly into
-a large bitmap, the outlines must be translated so that their vectorial
-position correspond to the current text cursor/character origin.</blockquote>
-</blockquote>
-
-<center><table width="100%" border=0 cellpadding=5><tr bgcolor="#CCFFCC" valign=center>
-<td align=center width="30%">
-<a href="glyphs-6.html">Previous</a>
-</td>
-<td align=center width="30%">
-<a href="index.html">Contents</a>
-</td>
-<td align=center width="30%">
-
-</td>
-</tr></table></center>
-
-</td></tr></table></center>
+<center>
+<table width="65%">
+<tr><td>
+
+ <center>
+ <table width="100%"
+ border=0
+ cellpadding=5>
+ <tr bgcolor="#CCFFCC"
+ valign=center>
+ <td align=center
+ width="30%">
+ <a href="glyphs-6.html">Previous</a>
+ </td>
+ <td align=center
+ width="30%">
+ <a href="index.html">Contents</a>
+ </td>
+ <td align=center
+ width="30%">
+
+ </td>
+ </tr>
+ </table>
+ </center>
+
+ <p><hr></p>
+
+ <table width="100%">
+ <tr bgcolor="#CCCCFF"
+ valign=center><td>
+ <h2>
+ VII. FreeType bitmaps
+ </h2>
+ </td></tr>
+ </table>
+
+ <p>The purpose of this section is to present the way FreeType manages
+ bitmaps and pixmaps, and how they relate to the concepts previously
+ defined. The relationships between vectorial and pixel coordinates is
+ explained.</p>
+
+
+ <a name="section-1">
+ <h3>
+ 1. Vectorial versus pixel coordinates
+ </h3>
+
+ <p>This sub-section explains the differences between vectorial and pixel
+ coordinates. To make things clear, brackets will be used to describe
+ pixel coordinates, e.g. [3,5], while parentheses will be used for
+ vectorial ones, e.g. (-2,3.5).</p>
+
+ <p>In the pixel case, as we use the <em>Y upwards</em> convention;
+ the coordinate [0,0] always refers to the <em>lower left pixel</em> of a
+ bitmap, while coordinate [width-1, rows-1] to its <em>upper right
+ pixel</em>.</p>
+
+ <p>In the vectorial case, point coordinates are expressed in floating
+ units, like (1.25, -2.3). Such a position doesn't refer to a given
+ pixel, but simply to an immaterial point in the 2D plane.</p>
+
+ <p>The pixels themselves are indeed <em>square boxes</em> of the 2D
+ plane, whose centers lie in half pixel coordinates. For example, the
+ lower left pixel of a bitmap is delimited by the square (0,0)-(1,1), its
+ center being at location (0.5,0.5).</p>
+
+ <p>This introduces some differences when computing distances. For
+ example, the <em>length</em> in pixels of the line [0,0]-[10,0] is 11.
+ However, the vectorial distance between (0,0)-(10,0) covers exactly
+ 10 pixel centers, hence its length is 10.</p>
+
+ <center>
+ <img src="grid_1.png"
+ height=390 width=402
+ alt="bitmap and vector grid">
+ </center>
+
+
+ <a name="section-2">
+ <h3>
+ 2. FreeType bitmap and pixmap descriptor
+ </h3>
+
+ <p>A bitmap or pixmap is described through a single structure, called
+ <tt>FT_Bitmap</tt>, defined in the file
+ <tt><freetype/ftimage.h></tt>. It is a simple descriptor whose
+ fields are:</p>
+
+ <center>
+ <table cellspacing=3
+ cellpadding=5
+ width="80%">
+ <caption>
+ <b><tt>FT_Bitmap</tt></b>
+ </caption>
+
+ <tr>
+ <td valign=top>
+ <tt>rows</tt>
+ </td>
+ <td valign=top>
+ the number of rows, i.e. lines, in the bitmap
+ </td>
+ </tr>
+
+ <tr>
+ <td valign=top>
+ <tt>width</tt>
+ </td>
+ <td valign=top>
+ the number of horizontal pixels in the bitmap
+ </td>
+ </tr>
+
+ <tr>
+ <td valign=top>
+ <tt>pitch</tt>
+ </td>
+ <td valign=top>
+ its absolute value is the number of bytes per bitmap line; it can
+ be either positive or negative depending on the bitmap's vertical
+ orientation
+ </td>
+ </tr>
+
+ <tr>
+ <td valign=top>
+ <tt>buffer</tt>
+ </td>
+ <td valign=top>
+ a typeless pointer to the bitmap pixel bufer
+ </td>
+ </tr>
+
+ <tr>
+ <td valign=top>
+ <tt>pixel_mode</tt>
+ </td>
+ <td valign=top>
+ an enumeration used to describe the pixel format of the bitmap;
+ examples are <tt>ft_pixel_mode_mono</tt> for 1-bit monochrome
+ bitmaps and <tt>ft_pixel_mode_grays</tt> for 8-bit anti-aliased
+ "gray" values
+ </td>
+ </tr>
+
+ <tr>
+ <td valign=top>
+ <tt>num_grays</tt>
+ </td>
+ <td valign=top>
+ this is only used for "gray" pixel modes, it gives the number of
+ gray levels used to describe the anti-aliased gray levels --
+ 256 by default with FreeType 2
+ </td>
+ </tr>
+ </table>
+ </center>
+
+
+ <p>Note that the sign of the <tt>pitch</tt> fields determines whether
+ the rows in the pixel buffer are stored in ascending or descending
+ order.</p>
+
+ <p>Remember that FreeType uses the <em>Y upwards</em> convention in
+ the 2D plane, which means that a coordinate of (0,0) always refer to the
+ <em>lower-left corner</em> of a bitmap.</p>
+
+ <p>If the pitch is positive, the rows are stored in decreasing vertical
+ position; the first bytes of the pixel buffer are part of the
+ <em>upper</em> bitmap row.</p>
+
+ <p>On the opposite, if the pitch is negative, the first bytes of the
+ pixel buffer are part of the <em>lower</em> bitmap row.</p>
+
+ <p>In all cases, one can see the pitch as the byte increment needed to
+ skip to the <em>next lower scanline</em> in a given bitmap buffer.</p>
+
+ <center>
+ <table>
+ <tr>
+ <td>
+ <img src="up_flow.png"
+ height=261 width=275
+ alt="negative 'pitch'">
+ </td>
+ <td>
+ <img src="down_flow.png"
+ height=263 width=273
+ alt="positive 'pitch'">
+ </td>
+ </tr>
+ </table>
+ </center>
+
+ <p>The "positive pitch" convention is very often used, though
+ some systems might need the other.</p>
+
+
+ <a name="section-3">
+ <h3>
+ 3. Converting outlines into bitmaps and pixmaps
+ </h3>
+
+ <p>Generating a bitmap or pixmap image from a vectorial image is easy
+ with FreeType. However, one must understand a few points regarding the
+ positioning of the outline in the 2D plane before converting it to a
+ bitmap:</p>
+
+ <ul>
+ <li>
+ <p>The glyph loader and hinter always places the outline in the 2D
+ plane so that (0,0) matches its character origin. This means that
+ the glyph's outline, and corresponding bounding box, can be placed
+ anywhere in the 2D plane (see the graphics in section III).</p>
+ </li>
+ <li>
+ <p>The target bitmap's area is mapped to the 2D plane, with its
+ lower left corner at (0,0). This means that a bitmap or pixmap of
+ dimensions [<tt>w,h</tt>] will be mapped to a 2D rectangle window
+ delimited by (0,0)-(<tt>w,h</tt>).</p>
+ </li>
+ <li>
+ <p>When scan-converting the outline, everything that falls within
+ the bitmap window is rendered, the rest is ignored.</p>
+ </li>
+
+ <p>A common mistake made by many developers when they begin using
+ FreeType is believing that a loaded outline can be directly rendered
+ in a bitmap of adequate dimensions. The following images illustrate
+ why this is a problem.</p>
+
+ <ul>
+ <li>
+ The first image shows a loaded outline in the 2D plane.
+ </li>
+ <li>
+ The second one shows the target window for a bitmap of arbitrary
+ dimensions [w,h].
+ </li>
+ <li>
+ The third one shows the juxtaposition of the outline and window in
+ the 2D plane.
+ </li>
+ <li>
+ The last image shows what will really be rendered in the bitmap.
+ </li>
+ </ul>
+
+ <center>
+ <img src="clipping.png"
+ height=151 width=539
+ alt="clipping algorithm">
+ </center>
+ </ul>
+
+ <p>Indeed, in nearly all cases, the loaded or transformed outline must
+ be translated before it is rendered into a target bitmap, in order to
+ adjust its position relative to the target window.</p>
+
+ <p>For example, the correct way of creating a <em>standalone</em> glyph
+ bitmap is as follows</p>
+
+ <ul>
+ <li>
+ <p>Compute the size of the glyph bitmap. It can be computed
+ directly from the glyph metrics, or by computing its bounding box
+ (this is useful when a transformation has been applied to the
+ outline after the load, as the glyph metrics are not valid
+ anymore).</p>
+ </li>
+ <li>
+ <p>Create the bitmap with the computed dimensions. Don't forget to
+ fill the pixel buffer with the background color.</p>
+ </li>
+ <li>
+ <p>Translate the outline so that its lower left corner matches
+ (0,0). Don't forget that in order to preserve hinting, one should
+ use integer, i.e. rounded distances (of course, this isn't required
+ if preserving hinting information doesn't matter, like with rotated
+ text). Usually, this means translating with a vector
+ <tt>(-ROUND(xMin), -ROUND(yMin))</tt>.</p>
+ </li>
+ <li>
+ <p>Call the rendering function (it can be
+ <tt>FT_Outline_Render()</tt> for example).</p>
+ </li>
+ </ul>
+
+ <p>In the case where one wants to write glyph images directly into a
+ large bitmap, the outlines must be translated so that their vectorial
+ position correspond to the current text cursor/character origin.</p>
+
+ <p><hr></p>
+
+ <center>
+ <table width="100%"
+ border=0
+ cellpadding=5>
+ <tr bgcolor="#CCFFCC"
+ valign=center>
+ <td align=center
+ width="30%">
+ <a href="glyphs-6.html">Previous</a>
+ </td>
+ <td align=center
+ width="30%">
+ <a href="index.html">Contents</a>
+ </td>
+ <td align=center
+ width="30%">
+
+ </td>
+ </tr>
+ </table>
+ </center>
+
+</td></tr>
+</table>
+</center>
</body>
</html>
diff --git a/docs/glyphs/index.html b/docs/glyphs/index.html
index 65704d1..8ee2fa5 100644
--- a/docs/glyphs/index.html
+++ b/docs/glyphs/index.html
@@ -1,12 +1,13 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en"
+ "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="blob">
- <meta name="GENERATOR" content="Mozilla/4.5 [fr] (Win98; I) [Netscape]">
- <title>FreeType Glyph Conventions</title>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="Author"
+ content="David Turner">
+ <title>FreeType Glyph Conventions</title>
</head>
-<body>
<body text="#000000"
bgcolor="#FFFFFF"
@@ -14,218 +15,186 @@
vlink="#51188E"
alink="#FF0000">
-<center>
-<h1>
-FreeType Glyph Conventions</h1></center>
-
-<center>
-<h2>
-version 2.1</h2></center>
-
-<center>
-<h3>
-Copyright 1998-2000 David Turner (<a href="mailto:david@freetype.org">david@freetype.org</a>)<br>
-Copyright 2000 The FreeType Development Team (<a href="devel@freetype.org">devel@freetype.org</a>)</h3></center>
-
-<center><table width=650><tr><td>
+<h1 align=center>
+ FreeType Glyph Conventions
+</h1>
+<h2 align=center>
+ Version 2.1
+</h2>
-<table width="100%"><tr valign=center bgcolor="#CCCCFF"><td align=center><h2>
-Introduction
-</h2></td></tr></table>
+<h3 align=center>
+ Copyright 1998-2000 David Turner (<a
+ href="mailto:david@freetype.org">david@freetype.org</a>)<br>
+ Copyright 2000 The FreeType Development Team (<a
+ href="mailto:devel@freetype.org">devel@freetype.org</a>)
+</h3>
-<p>This document presents the core conventions used within the FreeType
- library to manage font and glyph data. It is a <em>must-read</em> for
- any people that needs to understand digital typography, especially
- if you want to use the FreeType 2 library in your projects.</p>
-<table width="100%"><tr valign=center bgcolor="#CCCCFF"><td align=center><h2>
-Table of Contents
-</h2></td></tr></table>
-
-<center><table width="80%"><tr><td>
-
-
- <a href="glyphs-1.html">
- <h2>I. Basic Typographic Concepts:</h2>
- </a>
- <ul>
+<center>
+<table width="70%">
+<tr><td>
+
+ <p>This document presents the core conventions used within the FreeType
+ library to manage font and glyph data. It is a <em>must-read</em> for all
+ developers who need to understand digital typography, especially if you
+ want to use the FreeType 2 library in your projects.</p>
+
+ <table width="100%">
+ <tr valign=center
+ bgcolor="#CCCCFF">
+ <td align=center>
+ <h2>
+ Table of Contents
+ </h2>
+ </td>
+ </tr>
+ </table>
+
+ <center>
+ <table width="80%">
+ <tr><td>
+
+ <h2>
+ <a href="glyphs-1.html">I. Basic Typographic Concepts</a>
+ </h2>
+ <blockquote>
<h3>
- <a href="glyphs-1.html#section-1">
- 1. Font files, format and information
- </a>
- <br>
-
- <a href="glyphs-1.html#section-2">
- 2. Character images and mappings
- </a>
- <br>
-
- <a href="glyphs-1.html#section-3">
- 3. Character and font metrics
- </a>
- <br>
- </ul>
-
-
-
- <a href="glyphs-2.html">
- <h2>II. Glyph Outlines:</h2>
- </a>
- <ul>
+ <a href="glyphs-1.html#section-1">1. Font files, format and
+ information</a>
+ <br>
+
+ <a href="glyphs-1.html#section-2">2. Character images and mappings</a>
+ <br>
+
+ <a href="glyphs-1.html#section-3">3. Character and font metrics</a>
+ <br>
+ </h3>
+ </blockquote>
+
+ <h2>
+ <a href="glyphs-2.html">II. Glyph outlines</a>
+ </h2>
+ <blockquote>
+ <h3>
+ <a href="glyphs-2.html#section-1">1. Pixels, points and device
+ resolutions</a>
+ <br>
+
+ <a href="glyphs-2.html#section-2">2. Vectorial representation</a>
+ <br>
+
+ <a href="glyphs-2.html#section-3">3. Hinting and bitmap rendering</a>
+ <br>
+ </h3>
+ </blockquote>
+
+ <h2>
+ <a href="glyphs-3.html">III. Glyph metrics</a>
+ </h2>
+ <blockquote>
<h3>
- <a href="glyphs-2.html#section-1">
- 1. Pixels, Points and Device Resolutions
- </a>
- <br>
+ <a href="glyphs-3.html#section-1">1. Baseline, pens and layouts</a>
+ <br>
- <a href="glyphs-2.html#section-2">
- 2. Vectorial representation
- </a>
- <br>
+ <a href="glyphs-3.html#section-2">2. Typographic metrics and
+ bounding boxes</a>
+ <br>
- <a href="glyphs-2.html#section-3">
- 3. Hinting and bitmap rendering
- </a>
- <br>
- </ul>
+ <a href="glyphs-3.html#section-3">3. Bearings and advances</a>
+ <br>
+ <a href="glyphs-3.html#section-4">4. The effects of grid-fitting</a>
+ <br>
+ <a href="glyphs-3.html#section-5">5. Text widths and bounding box</a>
+ <br>
+ </h3>
+ </blockquote>
- <a href="glyphs-3.html">
- <h2>III. Glyph Metrics:</h2>
- </a>
- <ul>
- <h3>
- <a href="glyphs-3.html#section-1">
- 1. Baseline, Pens and Layouts
- </a>
- <br>
-
- <a href="glyphs-3.html#section-2">
- 2. Typographic metrics
- </a>
- <br>
-
- <a href="glyphs-3.html#section-3">
- 3. Bearings and Advances
- </a>
- <br>
-
- <a href="glyphs-3.html#section-4">
- 4. The effects of grid-fitting
- </a>
- <br>
-
- <a href="glyphs-3.html#section-5">
- 5. Text widths and bounding box
- </a>
- <br>
- </ul>
-
-
- <a href="glyphs-4.html">
- <h2>IV. Kerning:</h2>
- </a>
- <ul>
+ <h2>
+ <a href="glyphs-4.html">IV. Kerning</a>
+ </h2>
+ <blockquote>
<h3>
- <a href="glyphs-4.html#section-1">
- 1. Kerning pairs
- </a>
- <br>
-
- <a href="glyphs-4.html#section-2">
- 2. Applying kerning
- </a>
- <br>
- </ul>
-
-
- <a href="glyphs-5.html">
- <h2>V. Text Processing:</h2>
- </a>
- <ul>
+ <a href="glyphs-4.html#section-1">1. Kerning pairs</a>
+ <br>
+
+ <a href="glyphs-4.html#section-2">2. Applying kerning</a>
+ <br>
+ </h3>
+ </blockquote>
+
+ <h2>
+ <a href="glyphs-5.html">V. Text processing</a>
+ </h2>
+ <blockquote>
<h3>
- <a href="glyphs-5.html#section-1">
- 1. Writing simple text strings
- </a>
- <br>
-
- <a href="glyphs-5.html#section-2">
- 2. Sub-pixel positioning
- </a>
- <br>
-
- <a href="glyphs-5.html#section-3">
- 3. Simple kerning
- </a>
- <br>
-
- <a href="glyphs-5.html#section-4">
- 4. Right-to-left layouts
- </a>
- <br>
-
- <a href="glyphs-5.html#section-5">
- 5. Vertical layouts
- </a>
- <br>
-
- <a href="glyphs-5.html#section-6">
- 6. WYSIWYG text layouts
- </a>
- <br>
- </ul>
-
-
- <a href="glyphs-6.html">
- <h2>VI. FreeType Outlins:</h2>
- </a>
- <ul>
- <h3>
- <a href="glyphs-6.html#section-1">
- 1. FreeType outline description and structure
- </a>
- <br>
-
- <a href="glyphs-6.html#section-2">
- 2. Bounding and control box computations
- </a>
- <br>
-
- <a href="glyphs-6.html#section-3">
- 3. Coordinates, scaling and grid-fitting
- </a>
- <br>
- </ul>
-
-
- <a href="glyphs-7.html">
- <h2>VII. FreeType Bitmaps:</h2>
- </a>
- <ul>
- <h3>
- <a href="glyphs-7.html#section-1">
- 1. Vectorial versus pixel coordinates
- </a>
- <br>
+ <a href="glyphs-5.html#section-1">1. Writing simple text strings</a>
+ <br>
+
+ <a href="glyphs-5.html#section-2">2. Sub-pixel positioning</a>
+ <br>
- <a href="glyphs-7.html#section-2">
- 2. FreeType bitmap descriptor
- </a>
- <br>
+ <a href="glyphs-5.html#section-3">3. Simple kerning</a>
+ <br>
- <a href="glyphs-7.html#section-3">
- 3. Converting outlines into bitmaps
- </a>
- <br>
- </ul>
+ <a href="glyphs-5.html#section-4">4. Right-to-left layouts</a>
+ <br>
-</p>
+ <a href="glyphs-5.html#section-5">5. Vertical layouts</a>
+ <br>
-</td></tr></table></center>
+ <a href="glyphs-5.html#section-6">6. WYSIWYG text layouts</a>
+ <br>
+ </h3>
+ </blockquote>
-</td></tr></table></center>
+ <h2>
+ <a href="glyphs-6.html">VI. FreeType Outlines</a>
+ </h2>
+ <blockquote>
+ <h3>
+ <a href="glyphs-6.html#section-1">1. FreeType outline description
+ and structure</a>
+ <br>
+
+ <a href="glyphs-6.html#section-2">2. Bounding and control box
+ computations</a>
+ <br>
+
+ <a href="glyphs-6.html#section-3">3. Coordinates, scaling, and
+ grid-fitting</a>
+ <br>
+ </h3>
+ </blockquote>
+
+ <h2>
+ <a href="glyphs-7.html">VII. FreeType bitmaps</a>
+ </h2>
+ <blockquote>
+ <h3>
+ <a href="glyphs-7.html#section-1">1. Vectorial versus pixel
+ coordinates</a>
+ <br>
+
+ <a href="glyphs-7.html#section-2">2. FreeType bitmap and pixmap
+ descriptor</a>
+ <br>
+
+ <a href="glyphs-7.html#section-3">3. Converting outlines into
+ bitmaps and pixmaps</a>
+ <br>
+ </h3>
+ </blockquote>
+
+ </td></tr>
+ </table>
+ </center>
+
+</td></tr>
+</table>
+</center>
</body>
</html>