* include/freetype/internal/sfnt.h (SFNT_Interface): New method `load_strike_metrics' used to load the strike's metrics. * src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h, src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'. * src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly. * src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for nominal size unless it is obviously incorrect. * include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on FNT driver. Introduce new size selection interface. * include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec_): Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and `select_size'. * include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type, FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c (FT_Select_Size, FT_Request_Size): API additions to export the new size selection interface. * src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use `FT_Request_Size'. * include/freetype/internal/ftobjs.h (FT_Match_Size), src/base/ftobjs.c (FT_Match_Size): New function to match a size request against `available_sizes'. Drivers supporting bitmap strikes can use this function to implement `request_size'. * src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h, src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c, src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c, src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c: Update to new size selection interface. * src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c, src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c, src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size selection interface. Make `strike_index' FT_ULong and always defined. Use `load_strike_metrics' provided by SFNT interface.
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 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398
diff --git a/ChangeLog b/ChangeLog
index 54dc6cf..3d0c667 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,53 @@
+2006-01-13 Chia-I Wu <b90201047@ntu.edu.tw>
+
+ Introduce new size selection interface.
+
+ * include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec_):
+ Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
+ `select_size'.
+
+ * include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
+ FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
+ (FT_Select_Size, FT_Request_Size): API additions to export the new
+ size selection interface.
+
+ * src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
+ `FT_Request_Size'.
+
+ * include/freetype/internal/ftobjs.h (FT_Match_Size),
+ src/base/ftobjs.c (FT_Match_Size): New function to match a size
+ request against `available_sizes'. Drivers supporting bitmap strikes
+ can use this function to implement `request_size'.
+
+ * src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
+ src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
+ src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
+ src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
+ Update to new size selection interface.
+
+ * src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
+ src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
+ src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
+ selection interface.
+ Make `strike_index' FT_ULong and always defined.
+ Use `load_strike_metrics' provided by SFNT interface.
+
+2006-01-13 Chia-I Wu <b90201047@ntu.edu.tw>
+
+ * include/freetype/internal/sfnt.h (SFNT_Interface): New method
+ `load_strike_metrics' used to load the strike's metrics.
+
+ * src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
+ src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.
+
+ * src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.
+
+ * src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
+ nominal size unless it is obviously incorrect.
+
+ * include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
+ FNT driver.
+
2006-01-12 Werner Lemberg <wl@gnu.org>
Prepare use of pscmap service within CFF module.
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 120b98b..709b8b3 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -147,6 +147,11 @@ FT_BEGIN_HEADER
/* FT_Attach_File */
/* FT_Attach_Stream */
/* */
+ /* FT_Select_Size */
+ /* FT_Size_Request_Type */
+ /* FT_Size_Request */
+ /* FT_Request_Size */
+ /* FT_Select_Size */
/* FT_Set_Char_Size */
/* FT_Set_Pixel_Sizes */
/* FT_Set_Transform */
@@ -293,10 +298,10 @@ FT_BEGIN_HEADER
/* where `size' is in points. */
/* */
/* Windows FNT: */
- /* The `size' parameter is not reliable: There exist fonts (e.g., */
- /* app850.fon) which have a wrong size for some subfonts; x_ppem */
- /* and y_ppem are thus set equal to pixel width and height given in */
- /* in the Windows FNT header. */
+ /* The nominal size given in a FNT font is not reliable. Thus when */
+ /* the driver finds it incorrect, it sets `size' to some calculated */
+ /* values and set `x_ppem' and `y_ppem' to pixel width and height */
+ /* given in the font, respectively. */
/* */
/* TrueType embedded bitmaps: */
/* `size', `width', and `height' values are not contained in the */
@@ -2071,25 +2076,145 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Function> */
- /* FT_Set_Char_Size */
+ /* FT_Select_Size */
+ /* */
+ /* <Description> */
+ /* Selects a fixed size. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to a target face object. */
+ /* */
+ /* <Input> */
+ /* index :: The index of the fixed size in the `available_sizes' */
+ /* field of @FT_FaceRec structure. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Select_Size( FT_Face face,
+ FT_Int index );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Size_Request_Type */
+ /* */
+ /* <Description> */
+ /* An enumeration type that lists the size request types supported. */
+ /* */
+ /* <Values> */
+ /* FT_SIZE_REQUEST_TYPE_NOMINAL :: */
+ /* The nominal size. That is, the units_per_EM field of */
+ /* @FT_FaceRec. */
+ /* */
+ /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
+ /* The real dimension. That is, the sum of the Ascender and */
+ /* (minus of) Descender fields of @FT_FaceRec. */
+ /* */
+ /* FT_SIZE_REQUEST_TYPE_BBOX :: */
+ /* The font bounding box. That is, the bbox field of @FT_FaceRec. */
+ /* */
+ /* FT_SIZE_REQUEST_TYPE_CELL :: */
+ /* The horizontal scale is determined by the max_advance_width */
+ /* field of @FT_FaceRec and the vertical scale is determined the */
+ /* same way as @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both */
+ /* scales are set to the smaller one. This type is useful when */
+ /* you want to specify the font size for, for example, a window of */
+ /* 80x24 cells. */
+ /* */
+ /* <Note> */
+ /* See the note section of @FT_Size_Metrics if you wonder how does */
+ /* size requesting relate to scales. */
+ /* */
+ typedef enum FT_Size_Request_Type_
+ {
+ FT_SIZE_REQUEST_TYPE_NOMINAL,
+ FT_SIZE_REQUEST_TYPE_REAL_DIM,
+ FT_SIZE_REQUEST_TYPE_BBOX,
+ FT_SIZE_REQUEST_TYPE_CELL
+
+ } FT_Size_Request_Type;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Size_RequestRec */
/* */
/* <Description> */
- /* Sets the character dimensions of a given face object. The */
- /* `char_width' and `char_height' values are used for the width and */
- /* height, respectively, expressed in 26.6 fractional points. */
+ /* A structure used to model a size request. */
+ /* */
+ /* <Fields> */
+ /* type :: See @FT_Size_Request_Type. */
/* */
- /* If the horizontal or vertical resolution values are zero, a */
- /* default value of 72dpi is used. Similarly, if one of the */
- /* character dimensions is zero, its value is set equal to the other. */
+ /* width :: The desired width. */
+ /* */
+ /* height :: The desired height. */
+ /* */
+ /* horiResolution :: The horizontal resolution. If set to zero, then */
+ /* the width is treated as 26.6 fractional pixels. */
+ /* */
+ /* vertResolution :: The vertical resolution. If set to zero, then */
+ /* the height is treated as 26.6 fractional pixels. */
+ /* */
+ /* <Note> */
+ /* width and height cannot both be zero. If either of them is zero, */
+ /* its value is chosen so that the horizontal and vertical scales are */
+ /* equal. */
+ /* */
+ /* You should use @FT_Select_Size if you are intended to select some */
+ /* fixed size from the `available_sizes' field of @FT_FaceRec. */
+ /* */
+ typedef struct FT_Size_RequestRec_
+ {
+ FT_Size_Request_Type type;
+ FT_F26Dot6 width;
+ FT_F26Dot6 height;
+ FT_UInt horiResolution;
+ FT_UInt vertResolution;
+ } FT_Size_RequestRec, *FT_Size_Request;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Request_Size */
+ /* */
+ /* <Description> */
+ /* Request the size of the active size object of a given face object. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to a target face object. */
+ /* */
+ /* <Input> */
+ /* req :: A pointer to a @FT_Size_RequestRec. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Request_Size( FT_Face face,
+ FT_Size_Request req );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Char_Size */
+ /* */
+ /* <Description> */
+ /* This funcion calls @FT_Request_Size to request the nominal size, */
+ /* in points. */
/* */
/* <InOut> */
/* face :: A handle to a target face object. */
/* */
/* <Input> */
- /* char_width :: The character width, in 26.6 fractional points. */
+ /* char_width :: The nominal width, in 26.6 fractional points. */
/* */
- /* char_height :: The character height, in 26.6 fractional */
- /* points. */
+ /* char_height :: The nominal height, in 26.6 fractional points. */
/* */
/* horz_resolution :: The horizontal resolution. */
/* */
@@ -2099,9 +2224,8 @@ FT_BEGIN_HEADER
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
- /* For BDF and PCF formats, this function uses the `PIXEL_SIZE' */
- /* property of the bitmap font; the `char_width' parameter is */
- /* ignored. */
+ /* If either the horizontal or vertical resolution is zero, it is set */
+ /* to a default value of 72dpi. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Char_Size( FT_Face face,
@@ -2117,45 +2241,20 @@ FT_BEGIN_HEADER
/* FT_Set_Pixel_Sizes */
/* */
/* <Description> */
- /* Sets the character dimensions of a given face object. The width */
- /* and height are expressed in integer pixels. */
- /* */
- /* If one of the character dimensions is zero, its value is set equal */
- /* to the other. */
+ /* This funcion calls @FT_Request_Size to request the nominal size, */
+ /* in pixels. */
/* */
/* <InOut> */
/* face :: A handle to the target face object. */
/* */
/* <Input> */
- /* pixel_width :: The character width, in integer pixels. */
+ /* pixel_width :: The nominal width, in pixels. */
/* */
- /* pixel_height :: The character height, in integer pixels. */
+ /* pixel_height :: The nominal height, in pixels. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
- /* <Note> */
- /* The values of `pixel_width' and `pixel_height' correspond to the */
- /* pixel values of the _typographic_ character size, which are NOT */
- /* necessarily the same as the dimensions of the glyph `bitmap */
- /* cells'. */
- /* */
- /* The `character size' is really the size of an abstract square */
- /* called the `EM', used to design the font. However, depending */
- /* on the font design, glyphs is smaller or greater than the EM. */
- /* */
- /* This means that setting the pixel size to, say, 8x8 doesn't */
- /* guarantee in any way that you get glyph bitmaps that all fit */
- /* within an 8x8 cell (sometimes even far from it). */
- /* */
- /* For bitmap fonts, `pixel_height' usually is a reliable value for */
- /* the height of the bitmap cell. Drivers for bitmap font formats */
- /* which contain a single bitmap strike only (BDF, PCF, FNT) ignore */
- /* `pixel_width'. */
- /* */
- /* For BDF and PCF formats, this function uses the sum of the */
- /* `FONT_ASCENT' and `FONT_DESCENT' properties of the bitmap font. */
- /* */
FT_EXPORT( FT_Error )
FT_Set_Pixel_Sizes( FT_Face face,
FT_UInt pixel_width,
diff --git a/include/freetype/internal/ftdriver.h b/include/freetype/internal/ftdriver.h
index 02f585d..62fc701 100644
--- a/include/freetype/internal/ftdriver.h
+++ b/include/freetype/internal/ftdriver.h
@@ -53,16 +53,12 @@ FT_BEGIN_HEADER
typedef FT_Error
- (*FT_Size_ResetPointsFunc)( FT_Size size,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution );
+ (*FT_Size_RequestFunc)( FT_Size size,
+ FT_Size_Request req );
typedef FT_Error
- (*FT_Size_ResetPixelsFunc)( FT_Size size,
- FT_UInt pixel_width,
- FT_UInt pixel_height );
+ (*FT_Size_SelectFunc)( FT_Size size,
+ FT_ULong index );
typedef FT_Error
(*FT_Slot_LoadFunc)( FT_GlyphSlot slot,
@@ -129,16 +125,18 @@ FT_BEGIN_HEADER
/* */
/* done_slot :: The format-specific slot destructor. */
/* */
- /* set_char_sizes :: A handle to a function used to set the new */
- /* character size in points + resolution. Can be */
- /* set to 0 to indicate default behaviour. */
+ /* request_size :: A handle to a function used to request the new */
+ /* character size. Can be set to 0 if the */
+ /* scaling done in the base layer suffices. */
/* */
- /* set_pixel_sizes :: A handle to a function used to set the new */
- /* character size in pixels. Can be set to 0 to */
- /* indicate default behaviour. */
+ /* select_size :: A handle to a function used to select a new */
+ /* fixed size. It is used only when */
+ /* @FT_FACE_FLAG_FIXED_SIZES is set. Can be set */
+ /* to 0 if the scaling done in the base layer */
+ /* suffices. */
/* */
- /* load_glyph :: A function handle to load a given glyph image */
- /* in a slot. This field is mandatory! */
+ /* load_glyph :: A function handle to load a glyph to a slot. */
+ /* This field is mandatory! */
/* */
/* get_char_index :: A function handle to return the glyph index of */
/* a given character for a given charmap. This */
@@ -186,8 +184,8 @@ FT_BEGIN_HEADER
FT_Slot_InitFunc init_slot;
FT_Slot_DoneFunc done_slot;
- FT_Size_ResetPointsFunc set_char_sizes;
- FT_Size_ResetPixelsFunc set_pixel_sizes;
+ FT_Size_RequestFunc request_size;
+ FT_Size_SelectFunc select_size;
FT_Slot_LoadFunc load_glyph;
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index 49f6800..1142dfd 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -451,6 +451,16 @@ FT_BEGIN_HEADER
/* */
+ /*
+ * Match a size request against `available_sizes'.
+ */
+ FT_BASE( FT_Error )
+ FT_Match_Size( FT_Face face,
+ FT_Size_Request req,
+ FT_Bool ignore_width,
+ FT_ULong* index );
+
+
/*
* Free the bitmap of a given glyphslot when needed
* (i.e., only when it was allocated with ft_glyphslot_alloc_bitmap).
diff --git a/include/freetype/internal/sfnt.h b/include/freetype/internal/sfnt.h
index 7b58263..b622270 100644
--- a/include/freetype/internal/sfnt.h
+++ b/include/freetype/internal/sfnt.h
@@ -365,15 +365,12 @@ FT_BEGIN_HEADER
/* TT_Set_SBit_Strike_Func */
/* */
/* <Description> */
- /* Selects an sbit strike for given horizontal and vertical ppem */
- /* values. */
+ /* Selects an sbit strike for a given size request. */
/* */
/* <Input> */
/* face :: The target face object. */
/* */
- /* x_ppem :: The horizontal resolution in points per EM. */
- /* */
- /* y_ppem :: The vertical resolution in points per EM. */
+ /* req :: The size request. */
/* */
/* <Output> */
/* astrike_index :: The index of the sbit strike. */
@@ -383,10 +380,35 @@ FT_BEGIN_HEADER
/* sbit strike exists for the selected ppem values. */
/* */
typedef FT_Error
- (*TT_Set_SBit_Strike_Func)( TT_Face face,
- FT_UInt x_ppem,
- FT_UInt y_ppem,
- FT_ULong *astrike_index );
+ (*TT_Set_SBit_Strike_Func)( TT_Face face,
+ FT_Size_Request req,
+ FT_ULong* astrike_index );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Load_Strike_Metrics_Func */
+ /* */
+ /* <Description> */
+ /* Loads the metrics of a given strike. */
+ /* */
+ /* <Input> */
+ /* face :: The target face object. */
+ /* */
+ /* strike_index :: The strike index. */
+ /* */
+ /* <Output> */
+ /* metrics :: the metrics of the strike. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. Returns an error if no */
+ /* such sbit strike exists. */
+ /* */
+ typedef FT_Error
+ (*TT_Load_Strike_Metrics_Func)( TT_Face face,
+ FT_ULong strike_index,
+ FT_Size_Metrics* metrics );
/*************************************************************************/
@@ -549,6 +571,7 @@ FT_BEGIN_HEADER
/* see `ttsbit.h' */
TT_Set_SBit_Strike_Func set_sbit_strike;
+ TT_Load_Strike_Metrics_Func load_strike_metrics;
TT_Load_Table_Func load_sbits;
TT_Find_SBit_Image_Func find_sbit_image;
TT_Load_SBit_Metrics_Func load_sbit_metrics;
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 19d2c54..6511302 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1960,6 +1960,59 @@
}
+ /* documentation is in ftobjs.h */
+
+ FT_BASE_DEF( FT_Error )
+ FT_Match_Size( FT_Face face,
+ FT_Size_Request req,
+ FT_Bool ignore_width,
+ FT_ULong* index )
+ {
+ FT_Int i;
+ FT_Long w, h;
+
+
+ if ( !FT_HAS_FIXED_SIZES( face ) )
+ return FT_Err_Invalid_Face_Handle;
+
+ /* FT_Bitmap_Size doesn't provide enough info... */
+ if ( req->type != FT_SIZE_REQUEST_TYPE_NOMINAL )
+ return FT_Err_Unimplemented_Feature;
+
+ if ( req->horiResolution )
+ w = ( req->width * req->horiResolution + 36 ) / 72;
+ else
+ w = req->width;
+
+ if ( req->vertResolution )
+ h = ( req->height * req->vertResolution + 36 ) / 72;
+ else
+ h = req->height;
+
+ if ( req->width && !req->height )
+ h = w;
+ else if ( !req->width && req->height )
+ w = h;
+
+ for ( i = 0; i < face->num_fixed_sizes; i++ )
+ {
+ if ( h != face->available_sizes[i].y_ppem )
+ continue;
+
+ if ( w == face->available_sizes[i].x_ppem ||
+ ignore_width )
+ {
+ if ( index )
+ *index = (FT_ULong)i;
+
+ return FT_Err_Ok;
+ }
+ }
+
+ return FT_Err_Invalid_Pixel_Size;
+ }
+
+
static void
ft_recompute_scaled_metrics( FT_Face face,
FT_Size_Metrics* metrics )
@@ -1983,143 +2036,205 @@
/* documentation is in freetype.h */
FT_EXPORT_DEF( FT_Error )
- FT_Set_Char_Size( FT_Face face,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution )
+ FT_Select_Size( FT_Face face,
+ FT_Int index )
{
- FT_Error error = FT_Err_Ok;
- FT_Driver driver;
FT_Driver_Class clazz;
FT_Size_Metrics* metrics;
- FT_Long dim_x, dim_y;
+ FT_Bitmap_Size* bsize;
- if ( !face || !face->size || !face->driver )
+ if ( !face || !FT_HAS_FIXED_SIZES( face ) )
return FT_Err_Invalid_Face_Handle;
- driver = face->driver;
- metrics = &face->size->metrics;
- clazz = driver->clazz;
-
- if ( !char_width )
- char_width = char_height;
-
- else if ( !char_height )
- char_height = char_width;
-
- if ( !horz_resolution )
- horz_resolution = 72;
+ if ( index < 0 || index >= face->num_fixed_sizes )
+ return FT_Err_Invalid_Argument;
- if ( !vert_resolution )
- vert_resolution = 72;
+ clazz = face->driver->clazz;
+ metrics = &face->size->metrics;
- /* default processing -- this can be overridden by the driver */
- if ( char_width < 1 * 64 )
- char_width = 1 * 64;
- if ( char_height < 1 * 64 )
- char_height = 1 * 64;
+ bsize = face->available_sizes + index;
- /* Compute pixel sizes in 26.6 units */
- dim_x = ( char_width * horz_resolution + 36 ) / 72;
- dim_y = ( char_height * vert_resolution + 36 ) / 72;
+ metrics->x_ppem = ( bsize->x_ppem + 32 ) >> 6;
+ metrics->y_ppem = ( bsize->y_ppem + 32 ) >> 6;
+ if ( FT_IS_SCALABLE( face ) )
{
- FT_UShort x_ppem = (FT_UShort)( ( dim_x + 32 ) >> 6 );
- FT_UShort y_ppem = (FT_UShort)( ( dim_y + 32 ) >> 6 );
-
-
- /* Don't take, say, 12.5x12.5 equal to 13x13. If working with */
- /* fractional font sizes this would hide slightly different */
- /* font metrics. Consequently, the next two lines are */
- /* disabled. */
-#if 0
- if ( x_ppem == metrics->x_ppem && y_ppem == metrics->y_ppem )
- return FT_Err_Ok;
-#endif
+ metrics->x_scale = FT_DivFix( bsize->x_ppem,
+ face->units_per_EM );
+ metrics->y_scale = FT_DivFix( bsize->y_ppem,
+ face->units_per_EM );
- metrics->x_ppem = x_ppem;
- metrics->y_ppem = y_ppem;
+ ft_recompute_scaled_metrics( face, metrics );
}
-
- metrics->x_scale = 0x10000L;
- metrics->y_scale = 0x10000L;
-
- if ( face->face_flags & FT_FACE_FLAG_SCALABLE )
+ else
{
- metrics->x_scale = FT_DivFix( dim_x, face->units_per_EM );
- metrics->y_scale = FT_DivFix( dim_y, face->units_per_EM );
-
- ft_recompute_scaled_metrics( face, metrics );
+ metrics->x_scale = 0x10000;
+ metrics->y_scale = 0x10000;
+ metrics->ascender = bsize->y_ppem;
+ metrics->descender = 0;
+ metrics->height = bsize->height << 6;
+ metrics->max_advance = bsize->x_ppem;
}
- if ( clazz->set_char_sizes )
- error = clazz->set_char_sizes( face->size,
- char_width,
- char_height,
- horz_resolution,
- vert_resolution );
- return error;
+ if ( clazz->select_size )
+ return clazz->select_size( face->size, (FT_ULong)index );
+ else
+ return FT_Err_Ok;
}
/* documentation is in freetype.h */
FT_EXPORT_DEF( FT_Error )
- FT_Set_Pixel_Sizes( FT_Face face,
- FT_UInt pixel_width,
- FT_UInt pixel_height )
+ FT_Request_Size( FT_Face face,
+ FT_Size_Request req )
{
- FT_Error error = FT_Err_Ok;
- FT_Driver driver;
FT_Driver_Class clazz;
FT_Size_Metrics* metrics;
+ FT_Error error;
- if ( !face || !face->size || !face->driver )
+ if ( !face )
return FT_Err_Invalid_Face_Handle;
- driver = face->driver;
+ if ( !req )
+ return FT_Err_Invalid_Argument;
+
+ clazz = face->driver->clazz;
metrics = &face->size->metrics;
- clazz = driver->clazz;
- if ( pixel_width == 0 )
- pixel_width = pixel_height;
+ if ( FT_IS_SCALABLE( face ) )
+ {
+ FT_Long w, h, scaled_w, scaled_h;
+
- else if ( pixel_height == 0 )
- pixel_height = pixel_width;
+ switch ( req->type )
+ {
+ case FT_SIZE_REQUEST_TYPE_NOMINAL:
+ w = h = face->units_per_EM;
+ break;
+ case FT_SIZE_REQUEST_TYPE_REAL_DIM:
+ w = h = face->ascender - face->descender;
+ break;
+ case FT_SIZE_REQUEST_TYPE_CELL:
+ w = face->max_advance_width;
+ h = face->ascender - face->descender;
+ break;
+ case FT_SIZE_REQUEST_TYPE_BBOX:
+ w = face->bbox.xMax - face->bbox.xMin;
+ h = face->bbox.yMax - face->bbox.yMin;
+ break;
+ default:
+ return FT_Err_Unimplemented_Feature;
+ break;
+ }
- if ( pixel_width < 1 )
- pixel_width = 1;
- if ( pixel_height < 1 )
- pixel_height = 1;
+ if ( req->horiResolution )
+ scaled_w = ( req->width * req->horiResolution + 36 ) / 72;
+ else
+ scaled_w = req->width;
- /* use `>=' to avoid potential compiler warnings on 16bit platforms */
- if ( pixel_width >= 0xFFFFU )
- pixel_width = 0xFFFFU;
- if ( pixel_height >= 0xFFFFU )
- pixel_height = 0xFFFFU;
+ if ( req->vertResolution )
+ scaled_h = ( req->height * req->vertResolution + 36 ) / 72;
+ else
+ scaled_h = req->height;
- metrics->x_ppem = (FT_UShort)pixel_width;
- metrics->y_ppem = (FT_UShort)pixel_height;
+ /* determine scales */
+ if ( req->width )
+ {
+ metrics->x_scale = FT_DivFix( scaled_w, w );
- if ( face->face_flags & FT_FACE_FLAG_SCALABLE )
- {
- metrics->x_scale = FT_DivFix( metrics->x_ppem << 6,
- face->units_per_EM );
+ if ( req->height )
+ {
+ metrics->y_scale = FT_DivFix( scaled_h, h );
- metrics->y_scale = FT_DivFix( metrics->y_ppem << 6,
- face->units_per_EM );
+ if ( req->type == FT_SIZE_REQUEST_TYPE_CELL )
+ {
+ if ( metrics->y_scale > metrics->x_scale )
+ metrics->y_scale = metrics->x_scale;
+ else
+ metrics->x_scale = metrics->y_scale;
+ }
+ }
+ else
+ {
+ metrics->y_scale = metrics->x_scale;
+ scaled_h = FT_MulDiv( scaled_w, h, w );
+ }
+ }
+ else
+ {
+ metrics->x_scale = metrics->y_scale = FT_DivFix( scaled_h, h );
+ scaled_w = FT_MulDiv( scaled_h, w, h );
+ }
+
+ /* calculate ppem */
+ if ( req->type != FT_SIZE_REQUEST_TYPE_NOMINAL )
+ {
+ scaled_w = FT_MulFix( face->units_per_EM, metrics->x_scale );
+ scaled_h = FT_MulFix( face->units_per_EM, metrics->y_scale );
+ }
+
+ metrics->x_ppem = ( scaled_w + 32 ) >> 6;
+ metrics->y_ppem = ( scaled_h + 32 ) >> 6;
ft_recompute_scaled_metrics( face, metrics );
+
+ error = FT_Err_Ok;
+ }
+ else
+ {
+ FT_ZERO( metrics );
+ error = FT_Err_Invalid_Pixel_Size;
}
- if ( clazz->set_pixel_sizes )
- error = clazz->set_pixel_sizes( face->size,
- pixel_width,
- pixel_height );
- return error;
+ if ( clazz->request_size )
+ return clazz->request_size( face->size, req );
+ else
+ return error;
+ }
+
+
+ /* documentation is in freetype.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Set_Char_Size( FT_Face face,
+ FT_F26Dot6 char_width,
+ FT_F26Dot6 char_height,
+ FT_UInt horz_resolution,
+ FT_UInt vert_resolution )
+ {
+ FT_Size_RequestRec req;
+
+
+ req.type = FT_SIZE_REQUEST_TYPE_NOMINAL;
+ req.width = char_width;
+ req.height = char_height;
+ req.horiResolution = ( horz_resolution ) ? horz_resolution : 72;
+ req.vertResolution = ( vert_resolution ) ? vert_resolution : 72;
+
+ return FT_Request_Size( face, &req );
+ }
+
+
+ /* documentation is in freetype.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Set_Pixel_Sizes( FT_Face face,
+ FT_UInt pixel_width,
+ FT_UInt pixel_height )
+ {
+ FT_Size_RequestRec req;
+
+
+ req.type = FT_SIZE_REQUEST_TYPE_NOMINAL;
+ req.width = pixel_width << 6;
+ req.height = pixel_height << 6;
+ req.horiResolution = 0;
+ req.vertResolution = 0;
+
+ return FT_Request_Size( face, &req );
}
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index 20f8554..4be2411 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -582,62 +582,40 @@ THE SOFTWARE.
FT_CALLBACK_DEF( FT_Error )
- BDF_Set_Pixel_Size( FT_Size size,
- FT_UInt char_width,
- FT_UInt char_height )
+ BDF_Size_Select( FT_Size size,
+ FT_ULong index )
{
- BDF_Face face = (BDF_Face)FT_SIZE_FACE( size );
- FT_Face root = FT_FACE( face );
+ bdf_font_t* bdffont = ( (BDF_Face)size->face )->bdffont;
- FT_UNUSED( char_width );
+ FT_UNUSED( index );
- if ( char_height == (FT_UInt)root->available_sizes->height )
- {
- size->metrics.ascender = face->bdffont->font_ascent << 6;
- size->metrics.descender = -face->bdffont->font_descent << 6;
- size->metrics.height = ( face->bdffont->font_ascent +
- face->bdffont->font_descent ) << 6;
- size->metrics.max_advance = face->bdffont->bbx.width << 6;
+ size->metrics.ascender = bdffont->font_ascent << 6;
+ size->metrics.descender = -bdffont->font_descent << 6;
+ size->metrics.max_advance = bdffont->bbx.width << 6;
- return BDF_Err_Ok;
- }
- else
- return BDF_Err_Invalid_Pixel_Size;
+ return BDF_Err_Ok;
}
FT_CALLBACK_DEF( FT_Error )
- BDF_Set_Point_Size( FT_Size size,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution )
+ BDF_Size_Request( FT_Size size,
+ FT_Size_Request req )
{
- BDF_Face face = (BDF_Face)FT_SIZE_FACE( size );
- FT_Face root = FT_FACE( face );
+ FT_Face face = size->face;
+ FT_Error error;
- FT_UNUSED( char_width );
- FT_UNUSED( char_height );
- FT_UNUSED( horz_resolution );
- FT_UNUSED( vert_resolution );
+ error = FT_Match_Size( face, req, 1, NULL );
- FT_TRACE4(( "rec %d - pres %d\n",
- size->metrics.y_ppem, root->available_sizes->y_ppem ));
-
- if ( size->metrics.y_ppem == root->available_sizes->y_ppem >> 6 )
+ if ( error )
+ return error;
+ else
{
- size->metrics.ascender = face->bdffont->font_ascent << 6;
- size->metrics.descender = -face->bdffont->font_descent << 6;
- size->metrics.height = ( face->bdffont->font_ascent +
- face->bdffont->font_descent ) << 6;
- size->metrics.max_advance = face->bdffont->bbx.width << 6;
+ size->metrics.height = face->available_sizes->height << 6;
- return BDF_Err_Ok;
+ return BDF_Size_Select( size, 0 );
}
- else
- return BDF_Err_Invalid_Pixel_Size;
}
@@ -835,8 +813,8 @@ THE SOFTWARE.
0, /* FT_Slot_InitFunc */
0, /* FT_Slot_DoneFunc */
- BDF_Set_Point_Size,
- BDF_Set_Pixel_Size,
+ BDF_Size_Request,
+ BDF_Size_Select,
BDF_Glyph_Load,
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index 8298e41..dd32e39 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -433,8 +433,13 @@
cff_slot_init,
cff_slot_done,
- cff_point_size_reset,
- cff_size_reset,
+ cff_size_request,
+
+#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+ cff_size_select,
+#else
+ 0, /* FT_Size_SelectFunc */
+#endif
Load_Glyph,
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index ef67835..91eb60a 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -2420,7 +2420,7 @@
FT_Stream stream = cff_face->root.stream;
- if ( size->strike_index != 0xFFFFU &&
+ if ( size->strike_index != 0xFFFFFFFFU &&
sfnt->load_sbits &&
( load_flags & FT_LOAD_NO_BITMAP ) == 0 )
{
@@ -2428,7 +2428,7 @@
error = sfnt->load_sbit_image( face,
- (FT_ULong)size->strike_index,
+ size->strike_index,
(FT_UInt)glyph_index,
(FT_Int)load_flags,
stream,
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 19ea482..b94d60d 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -52,90 +52,6 @@
/*************************************************************************/
-#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-
- static FT_Error
- sbit_size_reset( CFF_Size size )
- {
- CFF_Face face;
- FT_Error error = CFF_Err_Ok;
-
- FT_ULong strike_index;
- FT_Size_Metrics* metrics;
- FT_Size_Metrics* sbit_metrics;
- SFNT_Service sfnt;
-
-
- metrics = &size->root.metrics;
-
- face = (CFF_Face)size->root.face;
- sfnt = (SFNT_Service)face->sfnt;
-
- sbit_metrics = &size->strike_metrics;
-
- error = sfnt->set_sbit_strike( face,
- metrics->x_ppem,
- metrics->y_ppem,
- &strike_index );
-
- if ( !error )
- {
- /* XXX: TODO: move this code to the SFNT module where it belongs */
-
-#ifdef FT_OPTIMIZE_MEMORY
-
- FT_Byte* strike = face->sbit_table + 8 + strike_index*48;
-
- sbit_metrics->ascender = (FT_Char)strike[16] << 6; /* hori.ascender */
- sbit_metrics->descender = (FT_Char)strike[17] << 6; /* hori.descender */
-
- /* XXX: Is this correct? */
- sbit_metrics->max_advance = ( (FT_Char)strike[22] + /* min_origin_SB */
- strike[18] + /* max_width */
- (FT_Char)strike[23] /* min_advance_SB */
- ) << 6;
-
-#else /* !OPTIMIZE_MEMORY */
-
- TT_SBit_Strike strike = face->sbit_strikes + strike_index;
-
-
- sbit_metrics->ascender = strike->hori.ascender << 6;
- sbit_metrics->descender = strike->hori.descender << 6;
-
- /* XXX: Is this correct? */
- sbit_metrics->max_advance = ( strike->hori.min_origin_SB +
- strike->hori.max_width +
- strike->hori.min_advance_SB ) << 6;
-
-#endif /* !OPTIMIZE_MEMORY */
-
- /* XXX: Is this correct? */
- sbit_metrics->height = sbit_metrics->ascender -
- sbit_metrics->descender;
-
- sbit_metrics->x_ppem = metrics->x_ppem;
- sbit_metrics->y_ppem = metrics->y_ppem;
- size->strike_index = (FT_UInt)strike_index;
- }
- else
- {
- size->strike_index = 0xFFFFU;
-
- sbit_metrics->x_ppem = 0;
- sbit_metrics->y_ppem = 0;
- sbit_metrics->ascender = 0;
- sbit_metrics->descender = 0;
- sbit_metrics->height = 0;
- sbit_metrics->max_advance = 0;
- }
-
- return error;
- }
-
-#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
-
-
static PSH_Globals_Funcs
cff_size_get_globals_funcs( CFF_Size size )
{
@@ -243,64 +159,90 @@
cffsize->internal = (FT_Size_Internal)(void*)globals;
}
+ size->strike_index = 0xFFFFFFFFU;
+
return error;
}
FT_LOCAL_DEF( FT_Error )
- cff_size_reset( FT_Size cffsize, /* CFF_Size */
- FT_UInt char_width,
- FT_UInt char_height )
+ cff_size_request( FT_Size size,
+ FT_Size_Request req )
{
- CFF_Size size = (CFF_Size)cffsize;
- PSH_Globals_Funcs funcs = cff_size_get_globals_funcs( size );
- FT_Error error = CFF_Err_Ok;
- FT_Face face = cffsize->face;
-
- FT_UNUSED( char_width );
- FT_UNUSED( char_height );
-
-
- if ( funcs )
- error = funcs->set_scale( (PSH_Globals)cffsize->internal,
- cffsize->metrics.x_scale,
- cffsize->metrics.y_scale,
- 0, 0 );
-
+ CFF_Size cffsize = (CFF_Size)size;
+ PSH_Globals_Funcs funcs;
+
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
- if ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
+ if ( FT_HAS_FIXED_SIZES( size->face ) )
{
- error = sbit_size_reset( size );
-
- if ( !error && !( face->face_flags & FT_FACE_FLAG_SCALABLE ) )
- cffsize->metrics = size->strike_metrics;
+ CFF_Face cffface = (CFF_Face)size->face;
+ SFNT_Service sfnt = cffface->sfnt;
+ FT_Size_Metrics* metrics = &size->metrics;
+ FT_ULong index;
+ FT_Error error;
+
+
+ if ( !( error = sfnt->set_sbit_strike( cffface,
+ req,
+ &index ) ) &&
+ !( error = sfnt->load_strike_metrics( cffface,
+ index,
+ metrics ) ) )
+ cffsize->strike_index = index;
+ else
+ cffsize->strike_index = 0xFFFFFFFFU;
}
#endif
- if ( face->face_flags & FT_FACE_FLAG_SCALABLE )
- return CFF_Err_Ok;
- else
- return error;
+ FT_UNUSED( req );
+
+ funcs = cff_size_get_globals_funcs( cffsize );
+
+ if ( funcs )
+ funcs->set_scale( (PSH_Globals)size->internal,
+ size->metrics.x_scale,
+ size->metrics.y_scale,
+ 0, 0 );
+
+ return CFF_Err_Ok;
}
+#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+
FT_LOCAL_DEF( FT_Error )
- cff_point_size_reset( FT_Size cffsize,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution )
+ cff_size_select( FT_Size size,
+ FT_ULong index )
{
- FT_UNUSED( char_width );
- FT_UNUSED( char_height );
- FT_UNUSED( horz_resolution );
- FT_UNUSED( vert_resolution );
+ CFF_Face cffface = (CFF_Face)size->face;
+ CFF_Size cffsize = (CFF_Size)size;
+ FT_Size_Metrics* metrics = &size->metrics;
+ SFNT_Interface* sfnt = cffface->sfnt;
+ FT_Error error;
+ PSH_Globals_Funcs funcs;
+
- return cff_size_reset( cffsize, 0, 0 );
+ funcs = cff_size_get_globals_funcs( cffsize );
+
+ if ( funcs )
+ funcs->set_scale( (PSH_Globals)size->internal,
+ size->metrics.x_scale,
+ size->metrics.y_scale,
+ 0, 0 );
+
+ error = sfnt->load_strike_metrics( cffface, index, metrics );
+ if ( error )
+ cffsize->strike_index = 0xFFFFFFFFU;
+ else
+ cffsize->strike_index = index;
+
+ return error;
}
+#endif
+
/*************************************************************************/
/* */
diff --git a/src/cff/cffobjs.h b/src/cff/cffobjs.h
index 338ec74..904e36a 100644
--- a/src/cff/cffobjs.h
+++ b/src/cff/cffobjs.h
@@ -54,13 +54,7 @@ FT_BEGIN_HEADER
typedef struct CFF_SizeRec_
{
FT_SizeRec root;
-
-#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-
- FT_UInt strike_index; /* 0xFFFF to indicate invalid */
- FT_Size_Metrics strike_metrics; /* current strike's metrics */
-
-#endif
+ FT_ULong strike_index; /* 0xFFFFFFFFU to indicate invalid */
} CFF_SizeRec, *CFF_Size;
@@ -119,16 +113,12 @@ FT_BEGIN_HEADER
cff_size_done( FT_Size size ); /* CFF_Size */
FT_LOCAL( FT_Error )
- cff_size_reset( FT_Size size, /* CFF_Size */
- FT_UInt char_width,
- FT_UInt char_height );
+ cff_size_request( FT_Size size,
+ FT_Size_Request req );
FT_LOCAL( FT_Error )
- cff_point_size_reset( FT_Size cffsize,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution );
+ cff_size_select( FT_Size size,
+ FT_ULong index );
FT_LOCAL( void )
cff_slot_done( FT_GlyphSlot slot );
diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c
index efeb47e..e1a91d7 100644
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -152,41 +152,24 @@
}
- FT_LOCAL_DEF( FT_Error )
- cid_size_reset( FT_Size cidsize, /* CID_Size */
- FT_UInt char_width,
- FT_UInt char_height )
+ FT_LOCAL( FT_Error )
+ cid_size_request( FT_Size size,
+ FT_Size_Request req )
{
- CID_Size size = (CID_Size)cidsize;
- PSH_Globals_Funcs funcs = cid_size_get_globals_funcs( size );
- FT_Error error = 0;
-
- FT_UNUSED( char_width );
- FT_UNUSED( char_height );
+ PSH_Globals_Funcs funcs;
- if ( funcs )
- error = funcs->set_scale( (PSH_Globals)cidsize->internal,
- cidsize->metrics.x_scale,
- cidsize->metrics.y_scale,
- 0, 0 );
- return error;
- }
+ FT_UNUSED( req );
+ funcs = cid_size_get_globals_funcs( (CID_Size)size );
- FT_LOCAL_DEF( FT_Error )
- cid_point_size_reset( FT_Size size,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution )
- {
- FT_UNUSED( char_width );
- FT_UNUSED( char_height );
- FT_UNUSED( horz_resolution );
- FT_UNUSED( vert_resolution );
+ if ( funcs )
+ funcs->set_scale( (PSH_Globals)size->internal,
+ size->metrics.x_scale,
+ size->metrics.y_scale,
+ 0, 0 );
- return cid_size_reset( size, 0, 0 );
+ return CID_Err_Ok;
}
diff --git a/src/cid/cidobjs.h b/src/cid/cidobjs.h
index 9d230ba..05fbaef 100644
--- a/src/cid/cidobjs.h
+++ b/src/cid/cidobjs.h
@@ -125,17 +125,8 @@ FT_BEGIN_HEADER
cid_size_init( FT_Size size ); /* CID_Size */
FT_LOCAL( FT_Error )
- cid_size_reset( FT_Size size, /* CID_Size */
- FT_UInt char_width,
- FT_UInt char_height );
-
- FT_LOCAL( FT_Error )
- cid_point_size_reset( FT_Size size,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution );
-
+ cid_size_request( FT_Size size, /* CID_Size */
+ FT_Size_Request req );
FT_LOCAL( FT_Error )
cid_face_init( FT_Stream stream,
diff --git a/src/cid/cidriver.c b/src/cid/cidriver.c
index 377835b..9b8774c 100644
--- a/src/cid/cidriver.c
+++ b/src/cid/cidriver.c
@@ -143,8 +143,8 @@
cid_slot_init,
cid_slot_done,
- cid_point_size_reset,
- cid_size_reset,
+ cid_size_request,
+ 0, /* FT_Size_SelectFunc */
cid_slot_load_glyph,
diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c
index e47a684..f017381 100644
--- a/src/pcf/pcfdrivr.c
+++ b/src/pcf/pcfdrivr.c
@@ -363,74 +363,42 @@ THE SOFTWARE.
FT_CALLBACK_DEF( FT_Error )
- PCF_Set_Pixel_Size( FT_Size size,
- FT_UInt pixel_width,
- FT_UInt pixel_height )
+ PCF_Size_Select( FT_Size size,
+ FT_ULong index )
{
- PCF_Face face = (PCF_Face)FT_SIZE_FACE( size );
+ PCF_Face face = (PCF_Face)size->face;
- FT_UNUSED( pixel_width );
+ FT_UNUSED( index );
- if ( pixel_height == (FT_UInt)face->root.available_sizes->height )
- {
- size->metrics.ascender = face->accel.fontAscent << 6;
- size->metrics.descender = face->accel.fontDescent * (-64);
+ size->metrics.ascender = face->accel.fontAscent << 6;
+ size->metrics.descender = -face->accel.fontDescent << 6;
#if 0
- size->metrics.height = face->accel.maxbounds.ascent << 6;
+ size->metrics.height = face->accel.maxbounds.ascent << 6;
#endif
- size->metrics.height = size->metrics.ascender -
- size->metrics.descender;
-
- size->metrics.max_advance = face->accel.maxbounds.characterWidth << 6;
+ size->metrics.max_advance = face->accel.maxbounds.characterWidth << 6;
- return PCF_Err_Ok;
- }
- else
- {
- FT_TRACE4(( "pixel size WRONG\n" ));
- return PCF_Err_Invalid_Pixel_Size;
- }
+ return PCF_Err_Ok;
}
FT_CALLBACK_DEF( FT_Error )
- PCF_Set_Point_Size( FT_Size size,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution )
+ PCF_Size_Request( FT_Size size,
+ FT_Size_Request req )
{
- PCF_Face face = (PCF_Face)FT_SIZE_FACE( size );
-
- FT_UNUSED( char_width );
- FT_UNUSED( char_height );
- FT_UNUSED( horz_resolution );
- FT_UNUSED( vert_resolution );
+ FT_Face face = size->face;
+ FT_Error error;
- FT_TRACE4(( "rec %d - pres %d\n",
- size->metrics.y_ppem,
- face->root.available_sizes->y_ppem >> 6 ));
+ error = FT_Match_Size( face, req, 1, NULL );
- if ( size->metrics.y_ppem == face->root.available_sizes->y_ppem >> 6 )
- {
- size->metrics.ascender = face->accel.fontAscent << 6;
- size->metrics.descender = face->accel.fontDescent * (-64);
-#if 0
- size->metrics.height = face->accel.maxbounds.ascent << 6;
-#endif
- size->metrics.height = size->metrics.ascender -
- size->metrics.descender;
-
- size->metrics.max_advance = face->accel.maxbounds.characterWidth << 6;
-
- return PCF_Err_Ok;
- }
+ if ( error )
+ return error;
else
{
- FT_TRACE4(( "size WRONG\n" ));
- return PCF_Err_Invalid_Pixel_Size;
+ size->metrics.height = face->available_sizes->height << 6;
+
+ return PCF_Size_Select( size, 0 );
}
}
@@ -659,8 +627,8 @@ THE SOFTWARE.
0, /* FT_Slot_InitFunc */
0, /* FT_Slot_DoneFunc */
- PCF_Set_Point_Size,
- PCF_Set_Pixel_Size,
+ PCF_Size_Request,
+ PCF_Size_Select,
PCF_Glyph_Load,
diff --git a/src/pfr/pfrdrivr.c b/src/pfr/pfrdrivr.c
index 55752a5..ae8e353 100644
--- a/src/pfr/pfrdrivr.c
+++ b/src/pfr/pfrdrivr.c
@@ -190,8 +190,8 @@
pfr_slot_init,
pfr_slot_done,
- 0, /* FT_Size_ResetPointsFunc */
- 0, /* FT_Size_ResetPixelsFunc */
+ 0, /* FT_Size_RequestFunc */
+ 0, /* FT_Size_SelectFunc */
pfr_slot_load,
pfr_get_kerning,
diff --git a/src/pfr/pfrobjs.c b/src/pfr/pfrobjs.c
index 124291c..3cadd5c 100644
--- a/src/pfr/pfrobjs.c
+++ b/src/pfr/pfrobjs.c
@@ -185,6 +185,9 @@
{
size->height = (FT_UShort)strike->y_ppm;
size->width = (FT_UShort)strike->x_ppm;
+ size->size = strike->y_ppm << 6;
+ size->x_ppem = strike->x_ppm << 6;
+ size->y_ppem = strike->y_ppm << 6;
}
pfrface->num_fixed_sizes = count;
}
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index feb767e..b61ba15 100644
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -413,6 +413,7 @@
/* see `ttsbit.h' and `sfnt.h' */
tt_face_set_sbit_strike,
+ tt_face_load_strike_metrics,
tt_face_load_sbit_strikes,
#ifdef FT_OPTIMIZE_MEMORY
0,
diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c
index 94c04af..89bc8bb 100644
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -671,30 +671,40 @@
FT_LOCAL_DEF( FT_Error )
- tt_face_set_sbit_strike( TT_Face face,
- FT_UInt x_ppem,
- FT_UInt y_ppem,
- FT_ULong *astrike_index )
+ tt_face_set_sbit_strike( TT_Face face,
+ FT_Size_Request req,
+ FT_ULong* astrike_index )
{
- FT_ULong i;
+ return FT_Match_Size( (FT_Face)face, req, 0, astrike_index );
+ }
- if ( x_ppem > 255 ||
- y_ppem < 1 || y_ppem > 255 )
- return SFNT_Err_Invalid_PPem;
+ FT_LOCAL_DEF( FT_Error )
+ tt_face_load_strike_metrics( TT_Face face,
+ FT_ULong strike_index,
+ FT_Size_Metrics* metrics )
+ {
+ TT_SBit_Strike strike;
- for ( i = 0; i < face->num_sbit_strikes; i++ )
- {
- if ( ( (FT_UInt)face->sbit_strikes[i].y_ppem == y_ppem ) &&
- ( ( x_ppem == 0 ) ||
- ( (FT_UInt)face->sbit_strikes[i].x_ppem == x_ppem ) ) )
- {
- *astrike_index = i;
- return SFNT_Err_Ok;
- }
- }
- return SFNT_Err_Invalid_PPem;
+ if ( strike_index >= face->num_sbit_strikes )
+ return SFNT_Err_Invalid_Argument;
+
+ strike = face->sbit_strikes + strike_index;
+
+
+ metrics->ascender = strike->hori.ascender << 6;
+ metrics->descender = strike->hori.descender << 6;
+
+ /* XXX: Is this correct? */
+ metrics->max_advance = ( strike->hori.min_origin_SB +
+ strike->hori.max_width +
+ strike->hori.min_advance_SB ) << 6;
+
+ /* XXX: Is this correct? */
+ metrics->height = metrics->ascender - metrics->descender;
+
+ return SFNT_Err_Ok;
}
diff --git a/src/sfnt/ttsbit.h b/src/sfnt/ttsbit.h
index d2734dd..c5cb60d 100644
--- a/src/sfnt/ttsbit.h
+++ b/src/sfnt/ttsbit.h
@@ -36,10 +36,14 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
- tt_face_set_sbit_strike( TT_Face face,
- FT_UInt x_ppem,
- FT_UInt y_ppem,
- FT_ULong *astrike_index );
+ tt_face_set_sbit_strike( TT_Face face,
+ FT_Size_Request req,
+ FT_ULong* astrike_index );
+
+ FT_LOCAL( FT_Error )
+ tt_face_load_strike_metrics( TT_Face face,
+ FT_ULong strike_index,
+ FT_Size_Metrics* metrics );
#ifndef FT_OPTIMIZE_MEMORY
FT_LOCAL( FT_Error )
diff --git a/src/sfnt/ttsbit0.c b/src/sfnt/ttsbit0.c
index 990dfcf..b2fa183 100644
--- a/src/sfnt/ttsbit0.c
+++ b/src/sfnt/ttsbit0.c
@@ -206,35 +206,40 @@
FT_LOCAL_DEF( FT_Error )
- tt_face_set_sbit_strike( TT_Face face,
- FT_UInt x_ppem,
- FT_UInt y_ppem,
- FT_ULong *astrike_index )
+ tt_face_set_sbit_strike( TT_Face face,
+ FT_Size_Request req,
+ FT_ULong* astrike_index )
{
- FT_UInt nn, count;
- FT_Byte* p;
- FT_Byte* p_limit;
+ return FT_Match_Size( (FT_Face)face, req, 0, astrike_index );
+ }
- if ( x_ppem > 255 ||
- y_ppem < 1 || y_ppem > 255 )
- return SFNT_Err_Invalid_PPem;
+ FT_LOCAL_DEF( FT_Error )
+ tt_face_load_strike_metrics( TT_Face face,
+ FT_ULong strike_index,
+ FT_Size_Metrics* metrics )
+ {
+ FT_Byte* strike;
+
- p = face->sbit_table + 8;
- p_limit = p + face->sbit_table_size;
- count = face->sbit_num_strikes;
+ if ( strike_index >= (FT_ULong)face->num_sbit_strikes )
+ return SFNT_Err_Invalid_Argument;
- for ( nn = 0; nn < count; nn++ )
- {
- if ( x_ppem == (FT_UInt)p[44] && y_ppem == (FT_UInt)p[45] )
- {
- *astrike_index = (FT_ULong)nn;
- return SFNT_Err_Ok;
- }
- p += 48;
- }
+ strike = face->sbit_table + 8 + strike_index * 48;
+
+ metrics->ascender = (FT_Char)strike[16] << 6; /* hori.ascender */
+ metrics->descender = (FT_Char)strike[17] << 6; /* hori.descender */
+
+ /* XXX: Is this correct? */
+ metrics->max_advance = ( (FT_Char)strike[22] + /* min_origin_SB */
+ strike[18] + /* max_width */
+ (FT_Char)strike[23] /* min_advance_SB */
+ ) << 6;
+
+ /* XXX: Is this correct? */
+ metrics->height = metrics->ascender - metrics->descender;
- return SFNT_Err_Invalid_PPem;
+ return SFNT_Err_Ok;
}
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index 71463ff..94d9a82 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -134,114 +134,69 @@
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Set_Char_Sizes */
- /* */
- /* <Description> */
- /* A driver method used to reset a size's character sizes (horizontal */
- /* and vertical) expressed in fractional points. */
- /* */
- /* <Input> */
- /* char_width :: The character width expressed in 26.6 */
- /* fractional points. */
- /* */
- /* char_height :: The character height expressed in 26.6 */
- /* fractional points. */
- /* */
- /* horz_resolution :: The horizontal resolution of the output device. */
- /* */
- /* vert_resolution :: The vertical resolution of the output device. */
- /* */
- /* <InOut> */
- /* size :: A handle to the target size object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
static FT_Error
- Set_Char_Sizes( FT_Size ttsize, /* TT_Size */
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution )
+ tt_size_request( FT_Size size,
+ FT_Size_Request req )
{
- TT_Size size = (TT_Size)ttsize;
- FT_Size_Metrics* metrics = &size->metrics;
- TT_Face face = (TT_Face)size->root.face;
-
+ TT_Face ttface = (TT_Face)size->face;
+ TT_Size ttsize = (TT_Size)size;
+ FT_Error error = TT_Err_Ok;
- /* copy the result from base layer */
- *metrics = size->root.metrics;
+#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
- /* This bit flag, when set, indicates that the pixel size must be */
- /* rounded to integer. Nearly all TrueType fonts have this bit */
- /* set, as hinting won't work really well otherwise. */
- /* */
- if ( ( face->header.Flags & 8 ) != 0 )
+ if ( FT_HAS_FIXED_SIZES( size->face ) )
{
- FT_Long dim_x, dim_y;
-
-
- dim_x = ( char_width * horz_resolution + 36 ) / 72;
- dim_y = ( char_height * vert_resolution + 36 ) / 72;
-
- dim_x = FT_PIX_ROUND( dim_x );
- dim_y = FT_PIX_ROUND( dim_y );
-
- metrics->x_ppem = (FT_UShort)( dim_x >> 6 );
- metrics->y_ppem = (FT_UShort)( dim_y >> 6 );
- metrics->x_scale = FT_DivFix( dim_x, face->root.units_per_EM );
- metrics->y_scale = FT_DivFix( dim_y, face->root.units_per_EM );
+ SFNT_Service sfnt = ttface->sfnt;
+ FT_Size_Metrics* metrics = &size->metrics;
+ FT_ULong index;
+
+ if ( !( error = sfnt->set_sbit_strike( ttface,
+ req,
+ &index ) ) &&
+ !( error = sfnt->load_strike_metrics( ttface,
+ index,
+ metrics ) ) )
+ ttsize->strike_index = index;
+ else
+ ttsize->strike_index = 0xFFFFFFFFU;
}
- size->ttmetrics.valid = FALSE;
-#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
- size->strike_index = 0xFFFFU;
#endif
- return tt_size_reset( size );
+ if ( FT_IS_SCALABLE( size->face ) )
+ error = tt_size_reset( ttsize );
+
+ return error;
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Set_Pixel_Sizes */
- /* */
- /* <Description> */
- /* A driver method used to reset a size's character sizes (horizontal */
- /* and vertical) expressed in integer pixels. */
- /* */
- /* <InOut> */
- /* size :: A handle to the target size object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+
static FT_Error
- Set_Pixel_Sizes( FT_Size ttsize, /* TT_Size */
- FT_UInt pixel_width,
- FT_UInt pixel_height )
+ tt_size_select( FT_Size size,
+ FT_ULong index )
{
- TT_Size size = (TT_Size)ttsize;
-
- FT_UNUSED( pixel_width );
- FT_UNUSED( pixel_height );
+ TT_Face ttface = (TT_Face)size->face;
+ TT_Size ttsize = (TT_Size)size;
+ FT_Size_Metrics* metrics = &size->metrics;
+ SFNT_Service sfnt = ttface->sfnt;
+ FT_Error error;
- /* many things have been pre-computed by the base layer */
+ if ( FT_IS_SCALABLE( size->face ) )
+ tt_size_reset( ttsize );
- size->metrics = size->root.metrics;
- size->ttmetrics.valid = FALSE;
-#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
- size->strike_index = 0xFFFFU;
-#endif
+ error = sfnt->load_strike_metrics( ttface, index, metrics );
+ if ( error )
+ ttsize->strike_index = 0xFFFFFFFFU;
+ else
+ ttsize->strike_index = index;
- return tt_size_reset( size );
+ return error;
}
+#endif
+
/*************************************************************************/
/* */
@@ -401,8 +356,13 @@
tt_slot_init,
0, /* FT_Slot_DoneFunc */
- Set_Char_Sizes,
- Set_Pixel_Sizes,
+ tt_size_request,
+#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+ tt_size_select,
+#else
+ 0, /* FT_Size_SelectFunc */
+#endif
+
Load_Glyph,
tt_get_kerning,
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index ebbd7a0..4744433 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1825,7 +1825,7 @@
stream = face->root.stream;
error = sfnt->load_sbit_image( face,
- (FT_ULong)size->strike_index,
+ size->strike_index,
glyph_index,
(FT_Int)load_flags,
stream,
@@ -2007,7 +2007,7 @@
/* */
/* XXX: The convention should be emphasized in */
/* the documents because it can be confusing. */
- if ( size->strike_index != 0xFFFFU &&
+ if ( size->strike_index != 0xFFFFFFFFU &&
( load_flags & FT_LOAD_NO_BITMAP ) == 0 )
{
error = load_sbit_image( size, glyph, glyph_index, load_flags );
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index ab18160..391e26c 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -585,7 +585,7 @@
#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
size->ttmetrics.valid = FALSE;
- size->strike_index = 0xFFFFU;
+ size->strike_index = 0xFFFFFFFFU;
return error;
}
@@ -649,34 +649,57 @@
/*************************************************************************/
/* */
/* <Function> */
- /* Reset_Outline_Size */
+ /* tt_size_reset */
/* */
/* <Description> */
- /* Resets a TrueType outline size when resolutions and character */
- /* dimensions have been changed. */
+ /* Resets a TrueType size when resolutions and character dimensions */
+ /* have been changed. */
/* */
/* <Input> */
/* size :: A handle to the target size object. */
/* */
- static FT_Error
- Reset_Outline_Size( TT_Size size )
+ FT_LOCAL_DEF( FT_Error )
+ tt_size_reset( TT_Size size )
{
TT_Face face;
FT_Error error = TT_Err_Ok;
-
FT_Size_Metrics* metrics;
- if ( size->ttmetrics.valid )
- return TT_Err_Ok;
+ size->ttmetrics.valid = FALSE;
face = (TT_Face)size->root.face;
metrics = &size->metrics;
+ /* copy the result from base layer */
+ *metrics = size->root.metrics;
+
if ( metrics->x_ppem < 1 || metrics->y_ppem < 1 )
return TT_Err_Invalid_PPem;
+ /* This bit flag, when set, indicates that the ppems must be */
+ /* rounded to integer. Nearly all TrueType fonts have this bit */
+ /* set, as hinting won't work really well otherwise. */
+ /* */
+ if ( face->header.Flags & 8 )
+ {
+ metrics->x_scale = FT_DivFix( metrics->x_ppem << 6,
+ face->root.units_per_EM );
+ metrics->y_scale = FT_DivFix( metrics->y_ppem << 6,
+ face->root.units_per_EM );
+
+ metrics->ascender =
+ FT_PIX_ROUND( FT_MulFix( face->root.ascender, metrics->y_scale ) );
+ metrics->descender =
+ FT_PIX_ROUND( FT_MulFix( face->root.descender, metrics->y_scale ) );
+ metrics->height =
+ FT_PIX_ROUND( FT_MulFix( face->root.height, metrics->y_scale ) );
+ metrics->max_advance =
+ FT_PIX_ROUND( FT_MulFix( face->root.max_advance_width,
+ metrics->x_scale ) );
+ }
+
/* compute new transformation */
if ( metrics->x_ppem >= metrics->y_ppem )
{
@@ -697,22 +720,6 @@
size->ttmetrics.y_ratio = 0x10000L;
}
- /* Compute root ascender, descender, text height, and max_advance */
- metrics->ascender =
- FT_PIX_ROUND( FT_MulFix( face->root.ascender, metrics->y_scale ) );
- metrics->descender =
- FT_PIX_ROUND( FT_MulFix( face->root.descender, metrics->y_scale ) );
- metrics->height =
- FT_PIX_ROUND( FT_MulFix( face->root.height, metrics->y_scale ) );
- metrics->max_advance =
- FT_PIX_ROUND( FT_MulFix( face->root.max_advance_width,
- metrics->x_scale ) );
-
-
-#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
- /* set to `invalid' by default */
- size->strike_index = 0xFFFFU;
-#endif
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
@@ -752,153 +759,6 @@
}
-#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Reset_SBit_Size */
- /* */
- /* <Description> */
- /* Resets a TrueType sbit size when resolutions and character */
- /* dimensions have been changed. */
- /* */
- /* <Input> */
- /* size :: A handle to the target size object. */
- /* */
- static FT_Error
- Reset_SBit_Size( TT_Size size )
- {
- TT_Face face;
- FT_Error error = TT_Err_Ok;
-
- FT_ULong strike_index;
- FT_Size_Metrics* metrics;
- FT_Size_Metrics* sbit_metrics;
- SFNT_Service sfnt;
-
-
- metrics = &size->metrics;
-
- if ( size->strike_index != 0xFFFFU )
- return TT_Err_Ok;
-
- face = (TT_Face)size->root.face;
- sfnt = (SFNT_Service)face->sfnt;
-
- sbit_metrics = &size->strike_metrics;
-
- error = sfnt->set_sbit_strike( face,
- metrics->x_ppem, metrics->y_ppem,
- &strike_index );
-
- if ( !error )
- {
- /* XXX: TODO: move this code to the SFNT module where it belongs */
-
-#ifdef FT_OPTIMIZE_MEMORY
- FT_Byte* strike = face->sbit_table + 8 + strike_index*48;
-
- sbit_metrics->ascender = (FT_Char)strike[16] << 6; /* hori.ascender */
- sbit_metrics->descender = (FT_Char)strike[17] << 6; /* hori.descender */
-
- /* XXX: Is this correct? */
- sbit_metrics->max_advance = ( (FT_Char)strike[22] + /* min_origin_SB */
- strike[18] + /* max_width */
- (FT_Char)strike[23] /* min_advance_SB */
- ) << 6;
-
-#else /* !FT_OPTIMIZE_MEMORY */
-
- TT_SBit_Strike strike = face->sbit_strikes + strike_index;
-
-
- sbit_metrics->ascender = strike->hori.ascender << 6;
- sbit_metrics->descender = strike->hori.descender << 6;
-
- /* XXX: Is this correct? */
- sbit_metrics->max_advance = ( strike->hori.min_origin_SB +
- strike->hori.max_width +
- strike->hori.min_advance_SB ) << 6;
-
-#endif /* !FT_OPTIMIZE_MEMORY */
-
- /* XXX: Is this correct? */
- sbit_metrics->height = sbit_metrics->ascender -
- sbit_metrics->descender;
-
- sbit_metrics->x_ppem = metrics->x_ppem;
- sbit_metrics->y_ppem = metrics->y_ppem;
- size->strike_index = (FT_UInt)strike_index;
- }
- else
- {
- size->strike_index = 0xFFFFU;
-
- sbit_metrics->x_ppem = 0;
- sbit_metrics->y_ppem = 0;
- sbit_metrics->ascender = 0;
- sbit_metrics->descender = 0;
- sbit_metrics->height = 0;
- sbit_metrics->max_advance = 0;
- }
-
- return error;
- }
-
-#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_size_reset */
- /* */
- /* <Description> */
- /* Resets a TrueType size when resolutions and character dimensions */
- /* have been changed. */
- /* */
- /* <Input> */
- /* size :: A handle to the target size object. */
- /* */
- FT_LOCAL_DEF( FT_Error )
- tt_size_reset( TT_Size size )
- {
- FT_Face face;
- FT_Error error = TT_Err_Ok;
-
-
- face = size->root.face;
-
- if ( face->face_flags & FT_FACE_FLAG_SCALABLE )
- {
- if ( !size->ttmetrics.valid )
- error = Reset_Outline_Size( size );
-
- if ( error )
- return error;
- }
-
-#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-
- if ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
- {
- if ( size->strike_index == 0xFFFFU )
- error = Reset_SBit_Size( size );
-
- if ( !error && !( face->face_flags & FT_FACE_FLAG_SCALABLE ) )
- size->root.metrics = size->strike_metrics;
- }
-
-#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
-
- if ( face->face_flags & FT_FACE_FLAG_SCALABLE )
- return TT_Err_Ok;
- else
- return error;
- }
-
-
/*************************************************************************/
/* */
/* <Function> */
diff --git a/src/truetype/ttobjs.h b/src/truetype/ttobjs.h
index 71ed88e..c140439 100644
--- a/src/truetype/ttobjs.h
+++ b/src/truetype/ttobjs.h
@@ -322,12 +322,7 @@ FT_BEGIN_HEADER
TT_Size_Metrics ttmetrics;
-#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-
- FT_UInt strike_index; /* 0xFFFF to indicate invalid */
- FT_Size_Metrics strike_metrics; /* current strike's metrics */
-
-#endif
+ FT_ULong strike_index; /* 0xFFFFFFFFU to indicate invalid */
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c
index dbcdb2a..ecaf4c0 100644
--- a/src/type1/t1driver.c
+++ b/src/type1/t1driver.c
@@ -295,8 +295,8 @@
(FT_Slot_InitFunc) T1_GlyphSlot_Init,
(FT_Slot_DoneFunc) T1_GlyphSlot_Done,
- (FT_Size_ResetPointsFunc) T1_Size_Reset,
- (FT_Size_ResetPixelsFunc) T1_Size_Reset,
+ (FT_Size_RequestFunc) T1_Size_Request,
+ (FT_Size_SelectFunc) 0,
(FT_Slot_LoadFunc) T1_Load_Glyph,
#ifdef T1_CONFIG_OPTION_NO_AFM
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index 0e56590..794d392 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -111,18 +111,18 @@
FT_LOCAL_DEF( FT_Error )
- T1_Size_Reset( T1_Size size )
+ T1_Size_Request( T1_Size size )
{
PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size );
- FT_Error error = 0;
if ( funcs )
- error = funcs->set_scale( (PSH_Globals)size->root.internal,
- size->root.metrics.x_scale,
- size->root.metrics.y_scale,
- 0, 0 );
- return error;
+ funcs->set_scale( (PSH_Globals)size->root.internal,
+ size->root.metrics.x_scale,
+ size->root.metrics.y_scale,
+ 0, 0 );
+
+ return T1_Err_Ok;
}
diff --git a/src/type1/t1objs.h b/src/type1/t1objs.h
index 9aeb10d..81a4b5f 100644
--- a/src/type1/t1objs.h
+++ b/src/type1/t1objs.h
@@ -109,7 +109,7 @@ FT_BEGIN_HEADER
T1_Size_Done( T1_Size size );
FT_LOCAL( FT_Error )
- T1_Size_Reset( T1_Size size );
+ T1_Size_Request( T1_Size size );
FT_LOCAL( FT_Error )
T1_Size_Init( T1_Size size );
diff --git a/src/type42/t42drivr.c b/src/type42/t42drivr.c
index c87c3f2..79614ba 100644
--- a/src/type42/t42drivr.c
+++ b/src/type42/t42drivr.c
@@ -229,8 +229,8 @@
(FT_Slot_InitFunc) T42_GlyphSlot_Init,
(FT_Slot_DoneFunc) T42_GlyphSlot_Done,
- (FT_Size_ResetPointsFunc) T42_Size_SetChars,
- (FT_Size_ResetPixelsFunc) T42_Size_SetPixels,
+ (FT_Size_RequestFunc) T42_Size_Request,
+ (FT_Size_SelectFunc) T42_Size_Select,
(FT_Slot_LoadFunc) T42_GlyphSlot_Load,
(FT_Face_GetKerningFunc) 0,
diff --git a/src/type42/t42objs.c b/src/type42/t42objs.c
index f3f8406..1aa8429 100644
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -489,6 +489,32 @@
}
+ FT_LOCAL_DEF( FT_Error )
+ T42_Size_Request( T42_Size size,
+ FT_Size_Request req )
+ {
+ T42_Face face = (T42_Face)size->root.face;
+
+
+ FT_Activate_Size( size->ttsize );
+
+ return FT_Request_Size( face->ttf_face, req );
+ }
+
+
+ FT_LOCAL_DEF( FT_Error )
+ T42_Size_Select( T42_Size size,
+ FT_ULong index )
+ {
+ T42_Face face = (T42_Face)size->root.face;
+
+
+ FT_Activate_Size( size->ttsize );
+
+ return FT_Select_Size( face->ttf_face, index );
+ }
+
+
FT_LOCAL_DEF( void )
T42_Size_Done( T42_Size size )
{
@@ -537,45 +563,6 @@
}
-
- FT_LOCAL_DEF( FT_Error )
- T42_Size_SetChars( T42_Size size,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution )
- {
- FT_Face face = size->root.face;
- T42_Face t42face = (T42_Face)face;
-
-
- FT_Activate_Size( size->ttsize );
-
- return FT_Set_Char_Size( t42face->ttf_face,
- char_width,
- char_height,
- horz_resolution,
- vert_resolution );
- }
-
-
- FT_LOCAL_DEF( FT_Error )
- T42_Size_SetPixels( T42_Size size,
- FT_UInt pixel_width,
- FT_UInt pixel_height )
- {
- FT_Face face = size->root.face;
- T42_Face t42face = (T42_Face)face;
-
-
- FT_Activate_Size( size->ttsize );
-
- return FT_Set_Pixel_Sizes( t42face->ttf_face,
- pixel_width,
- pixel_height );
- }
-
-
static void
t42_glyphslot_clear( FT_GlyphSlot slot )
{
diff --git a/src/type42/t42objs.h b/src/type42/t42objs.h
index 6238095..c893bb4 100644
--- a/src/type42/t42objs.h
+++ b/src/type42/t42objs.h
@@ -80,16 +80,14 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
- T42_Size_SetChars( T42_Size size,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution );
+ T42_Size_Request( T42_Size size,
+ FT_Size_Request req );
+
FT_LOCAL( FT_Error )
- T42_Size_SetPixels( T42_Size size,
- FT_UInt pixel_width,
- FT_UInt pixel_height );
+ T42_Size_Select( T42_Size size,
+ FT_ULong index );
+
FT_LOCAL( void )
T42_Size_Done( T42_Size size );
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index 92174ae..0847a8f 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -460,14 +460,41 @@
{
FT_Bitmap_Size* bsize = root->available_sizes;
+ FT_UShort x_res, y_res;
bsize->width = font->header.avg_width;
bsize->height = (FT_Short)(
font->header.pixel_height + font->header.external_leading );
bsize->size = font->header.nominal_point_size << 6;
- bsize->x_ppem = font->header.pixel_width << 6;
- bsize->y_ppem = font->header.pixel_height << 6;
+
+ x_res = font->header.horizontal_resolution;
+ if ( !x_res )
+ x_res = 72;
+
+ y_res = font->header.vertical_resolution;
+ if ( !y_res )
+ y_res = 72;
+
+ bsize->y_ppem = FT_MulDiv( bsize->size, y_res, 72 );
+ bsize->y_ppem = FT_PIX_ROUND( bsize->y_ppem );
+
+ /*
+ * this reads:
+ *
+ * the nominal height is larger than the bbox's height
+ *
+ * => nominal_point_size contains incorrect value;
+ * use pixel_height as the nominal height
+ */
+ if ( bsize->y_ppem > font->header.pixel_height << 6 )
+ {
+ bsize->y_ppem = font->header.pixel_height << 6;
+ bsize->size = FT_MulDiv( bsize->y_ppem, 72, y_res );
+ }
+
+ bsize->x_ppem = FT_MulDiv( bsize->size, x_res, 72 );
+ bsize->x_ppem = FT_PIX_ROUND( bsize->x_ppem );
}
{
@@ -543,27 +570,38 @@
static FT_Error
- FNT_Size_Set_Pixels( FT_Size size )
+ FNT_Size_Select( FT_Size size )
{
- FNT_Face face = (FNT_Face)FT_SIZE_FACE( size );
- FT_Face root = FT_FACE( face );
+ FNT_Face face = (FNT_Face)size->face;
+ FT_WinFNT_Header header = &face->font->header;
- if ( size->metrics.y_ppem == root->available_sizes->y_ppem >> 6 )
- {
- FNT_Font font = face->font;
+ size->metrics.ascender = header->ascent * 64;
+ size->metrics.descender = -( header->pixel_height -
+ header->ascent ) * 64;
+ size->metrics.max_advance = header->max_width * 64;
+ return FNT_Err_Ok;
+ }
- size->metrics.ascender = font->header.ascent * 64;
- size->metrics.descender = -( font->header.pixel_height -
- font->header.ascent ) * 64;
- size->metrics.height = font->header.pixel_height * 64;
- size->metrics.max_advance = font->header.max_width * 64;
- return FNT_Err_Ok;
- }
+ static FT_Error
+ FNT_Size_Request( FT_Size size,
+ FT_Size_Request req )
+ {
+ FT_Face face = size->face;
+ FT_Error error;
+
+ error = FT_Match_Size( face, req, 1, NULL );
+
+ if ( error )
+ return error;
else
- return FNT_Err_Invalid_Pixel_Size;
+ {
+ size->metrics.height = face->available_sizes->height << 6;
+
+ return FNT_Size_Select( size );
+ }
}
@@ -741,8 +779,8 @@
(FT_Slot_InitFunc) 0,
(FT_Slot_DoneFunc) 0,
- (FT_Size_ResetPointsFunc) FNT_Size_Set_Pixels,
- (FT_Size_ResetPixelsFunc) FNT_Size_Set_Pixels,
+ (FT_Size_RequestFunc) FNT_Size_Request,
+ (FT_Size_SelectFunc) FNT_Size_Select,
(FT_Slot_LoadFunc) FNT_Load_Glyph,
(FT_Face_GetKerningFunc) 0,