PixcomFontEngine.h 73.2 KB
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
/*****************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2005
*
*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
*
*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/

/*******************************************************************************
 * Filename:
 * ---------
 *  PixcomFontEngine.h
 *
 * Project:
 * --------
 *  MAUI
 *
 * Description:
 * ------------
 *  
 *
 * Author:
 * -------
 *  
 *
 *==============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
 *------------------------------------------------------------------------------
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
 *==============================================================================
 *******************************************************************************/

#include "MMIDataType.h"
#include "FontRes.h"

#ifndef _PIXCOMFONTENGINE_H
#define _PIXCOMFONTENGINE_H

#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */ 

#include "MMI_features.h"

#include "lcd_sw_inc.h"
#include "kal_general_types.h"

#ifdef __MMI_VECTOR_FONT_MEMORY_CARD_SUPPORT__
#include "Fs_gprot.h"
#endif

#define ZWNJ     0x200C
#define ZWJ       0x200D   

/* to check the control chars
   add 0x0A,0x0D~0x0F for displaying control characters as space
   add 0xA0 for NBSP in Vietnamese as space */
#define FONT_TEST_CONTROL_CHAR(c)      \
(     (c=='\t'/* 0x09 */)                \
   || (c==0x08)                        \
   || (c==0x0A)                        \
   || (c==0x0D)                        \
   || (c==0x0E)                        \
   || (c==0x0F)                        \
   || (c==0xA0)                        \
   || (c== 0x2028)                    \
   || (c == 0x2029)                   \
)

#define FONT_TEST_FORMATTING_CHARS(c)   (((c) >= 0x200C && (c)<= 0x200f) || ((c) >= 0x202a && (c)<= 0x202f))
#define FONT_TEST_DATE_CHARS(c)   ((c) >= 0x87 && (c)<= 0x94)    
#define FONT_TEST_CRLF_ANF_SPACE_PROPRIETARY_SYMBOL(c) ((c) >= 133 & (c)<=134) /* for new line and space symbol used in symbol table */
#define FONT_TEST_SPACE_CHAR(c) (((c) >= 0x2000 && (c)<= 0x200A) || ((c) == 0xfeff)) /* 0x200B is zero space but we treat it as null character. */
#define FONT_TEST_ZERO_WIDTH_SPACE(c) ((c) == 0x200B)
#define FONT_TEST_ZERO_WIDTH_CHAR(c) (((c)<= 0x1F) || (((c)>= 0x80) && ((c)<= 0x84)) || (((c)>= 0x95) && ((c)<= 0x9f)))

/* for R2L characters */
#define MAX_SHOW_STRING_TEXT_LENGTH          700

#ifdef __SLIM_PROJECT_128_32__
#define MAX_NUM_OF_CHAR_FOR_EACH_LINE         (UI_DEVICE_WIDTH/2)     // in slim project, to save memory size
#else
#define MAX_NUM_OF_CHAR_FOR_EACH_LINE         ((UI_DEVICE_WIDTH/2)*2) /*(in bytes).  assume LCD width fill with 1 pixel text and 1 pixel gap */
#endif

#define FONT_TEST_BIDI_CONTROL_CHAR(c) ((c==0x06)||(c==0x07)||(c==0x08)||(c==0x09)||(c==0x0A)||(c==0x0D))
#define FONT_TEST_WORD_WRAPPING_BREAK_CHARACTER(c) (c == 0x20 ? 1:0)
#define FONT_TEST_NEW_LINE_CHAR(c) (((c) == 0x0a || (c) == 0x0d || (c) == 0x2028 || (c) == 0x2029) ? (1) : (0))
#define FONT_TEST_ASCII_CHARACTER(c)   (((UI_character_type)(c)<=(UI_character_type)0xFF)?(1):(0))

// test if operator character like '+', '-', '*', '/'
#define FONT_TEST_OPERATOR_CHAR(c) (((c) == 0x002B) || ((c) == 0x002D) || ((c) == 0x002F) || ((c) == 0x00D7))

// convert the size to pixel
#define FONT_PIXEL_SIZE(size)  (((size)|(0x80)))

#ifdef  __MMI_VECTOR_FONT_SUPPORT__
#define __MMI_FONT_EFFECTS__
#if defined(FONT_ENGINE_FREETYPE) || defined(FONT_ENGINE_FREETYPE_DEMO)
#define __MMI_VECTOR_FONT_KERNING__
#endif
#define __MMI_FE_RICH_TEXT_SUPPORT__
#endif

#if defined(__MMI_FONT_EFFECTS__)
#define MMI_FE_FONT_EFFECT_DIM_SIZE MMI_MENUITEM_HEIGHT
#define MMI_FE_FONT_EFFECT_POOL_SIZE (MMI_FE_FONT_EFFECT_DIM_SIZE * MMI_FE_FONT_EFFECT_DIM_SIZE)

#define GAUSS_WIDTH_DROP_SHADOW 7
#define GAUSS_WIDTH_OUTER_GLOW 5
#define GAUSS_WIDTH_BORDERE_MAX 11
#define GAUSS_WIDTH_BORDERED 5


#define ANGLE_ROTATION 45
#define MAX_GRAY_LEVEL 255
#define FONTS_EFFECT_NODE_START 3

#define  HLSMAX   255  
#define  RGBMAX   255  
#define UNDEFINED (HLSMAX*2/3)

#endif /* __MMI_FONT_EFFECTS__ */


#define FONT_TYPE_FIXED_WIDTH                0x80

#define FONT_FAMILY_NORMAL                  0
#define FONT_FAMILY_FIXED_WIDTH             1

/*****************************************************************************
*  Typedef
*****************************************************************************/
typedef struct
{
    U16 normal_data_size;
    U16 border_data_size;
    U8  data[1];
    U8  padding[3];
} mmi_fe_render_data_struct;

/* Font engine color type */
typedef struct mmi_fe_color
{
    U8 a;    /* alpha */
    U8 r;    /* red   */
    U8 g;    /* green */
    U8 b;    /* blue  */
} mmi_fe_color;

#if defined(__MMI_FONT_EFFECTS__)
/* Color group for font effect */
typedef struct stFontColor
{
    //mmi_fe_color text_color;                /* The text color */
    mmi_fe_color bordered_color;        /* The bordered color */
    mmi_fe_color first_gradient_color;        /* The text color for gradient effect. It works with existing text color to present the gradient effect */
    mmi_fe_color second_gradient_color;        /* The text color for gradient effect. It works with existing text color to present the gradient effect */
    mmi_fe_color shadow_color;          /* The shadow color */
    mmi_fe_color outerglow_color;   /* The shadow color */
    mmi_fe_color upper_engraved_color;  /* The engraved color  */
    mmi_fe_color lower_engraved_color;  /* The engraved color  */
} stFontColor;

/* Advace font attribute */
typedef struct stAdvanceFontAttribute
{
    S16 shadow_degree;  /* The degree of change of shadow color. It presents the direction of the light. The degree is limited to 0¢X, 45¢X, 90¢X, 135¢X, 180¢X, 225¢X, 270¢X, 315¢X */
    S16 engraved_degree;    /* The degree of change of shadow */
    U8 shadow_distant;  /* The distant between the shadow original to the text original */
    U8 shadow_range;    /* The shadow range */
    U8 shadow_transparency;    /* The shadow intensity */
    U8 border_size; /* The size of the border */
    U8 gradient_direction;  /* The direction of gradient */
    U8 gradient_transparency;  /* The direction of gradient */
    U8 outerglow_range; /* The outer glow range */
    U8 outerglow_transparency;    /* The shadow intensity */
    U8 engraved_transparency;    /* The shadow intensity */
    U8 border_transparency;    /* The shadow intensity */
} stAdvanceFontAttribute;

typedef struct stFontAttributeNode
{
    stAdvanceFontAttribute advance_font_attribute;
    stFontColor font_color;
    U8 attribute_id;
    U8 effect_type;
    U8 node_type;   /* 0: static node, 1: dynamic node */
    struct stFontAttributeNode *next;
}stFontAttributeNode;

typedef enum
{
    MMI_FE_GRADIENT_DIRECTION_NONE = 0,
    MMI_FE_GRADIENT_DIRECTION_VERTICAL,
    MMI_FE_GRADIENT_DIRECTION_HORIZONTAL,
	MMI_FE_GRADIENT_DIRECTION_MAX,
} mmi_fe_gradient_direction_enum;

#if 0//defined(__MMI_FONT_EFFECTS__)		//move to pixcomfontengine.c
/* under construction !*/
#endif

#endif /* __MMI_FONT_EFFECTS__ */

/* Font attribute */
typedef struct stFontAttribute
{
    U8 bold;       /* bold style */
    U8 italic;     /* italic style */
    U8 underline;  /* underline style */
    U8 size;       /* font size */
    U8 color;      /* font color */
    U8 type;       /* font type */
    U8 oblique;    /* oblique style */
    U8 smallCaps;  /* smallCaps style */
} stFontAttribute;

/* font engine show string struct */
typedef struct
{
    S32 x;               /* Top left x coordinate */
    S32 y;               /* Top left y coordinate */ 
    S32 char_gap;        /* Gap between each character */
    U8 *String;          /* string point */
    S32 len;             /* string length */
    U32 BaseLineHeight;  /* string base line */
    U32 Bordered;        /* show border or not */
    MMI_BOOL enable_truncated; /* truncate or not */
    U8 *truncated_symbol;      /* truncate symbol, like "..."*/
    S32 truncated_width; /* truncated width */
    U8 assign_direction; /* assign direction */
    U32 render_flag;     /* render flag */
}mmi_fe_showstring_info_struct, *mmi_fe_showstring_info_struct_p;

typedef struct mmi_fe_text_format_struct
{
    S32 start, end;
    stFontAttribute font;
    mmi_fe_color c;
    struct mmi_fe_text_format_struct *next;
}mmi_fe_text_format_struct, *mmi_fe_text_format_struct_p;

/* font engine get string info param struct */
typedef struct
{
    U8 *String;   /* String pointer */
    S32 w;        /* gap between character */
    S32 n;        /* character counter to query */
    S32 pWidth;   /* string width */
    S32 pHeight;  /* string height */
    MMI_BOOL enableTruncated; /* truncate or not */
    S32 targetWidth;          /* target width */
    U8 checklinebreak;        /* if need to check new line symbol */
    U8 checkCompleteWord;     /* word wrap or not*/
    S32 baseline;             /* base line */
    S32 maxAscent;            /* max ascent */
    S32 maxDescent;           /* max descent */
    S32 adv_w;                /* advance width */
    S32 adv_h;                /* advance height */
    U8 assign_direction; /* assign direction */
    mmi_fe_text_format_struct_p format;
}mmi_fe_get_string_info_param_struct, *mmi_fe_get_string_info_param_struct_p;

typedef struct
{
    PU8 string;    /* string buffer */
    S32 len;       /* len of the string */
    S32 subarray_start : 16; /* the start index of the string */
    S32 subarray_len : 16;   /* the lenght of the show segment */
    S32 x;                   /* x position */     
    S32 y;                   /* y position */
    S32 baseline;            /* baseline */
    U8 bordered;             /* bordered or not */
    U8 langid;               /* language id */
} mmi_fe_show_one_cluster_param_struct, *mmi_fe_show_one_cluster_param_struct_p;

typedef struct
{
    S16 ascent;   /* glyph ascent */
    S16 descent;  /* glyph descent */
    S16 adv_x;    /* glyph DWidth */
    U16 width;    /* the font image width. It is considered with font attribute. */
    U16 height;   /* the font imag height. It is considered with font attribute. */
}mmi_fe_glyph_metrics_struct, *mmi_fe_glyph_metrics_struct_p;

typedef struct
{
    U32 index;    /* cluster index in text buffer */
    S32 x;        /* cluster x position */
    U8 len;       /* Cluster length */
    U8 width;     /* cluster width. */
    U8 adv_w;     /* cluster adv_w. */
    U8 bidi_type;  /* is arabic char */
}mmi_fe_cluster_metrics_struct, *mmi_fe_cluster_metrics_struct_p;

typedef void (*fe_save_cluster_info_cb) (mmi_fe_cluster_metrics_struct metric, void *user_data);

/* for R2L characters */
typedef struct stL2RLangSSC
{
    S8 *sscString;    /* SSC string */
} L2RLangSSC;

typedef enum
{
    MMI_FE_ALIGN_BOTTOM,
    MMI_FE_ALIGN_CENTER,
    MMI_FE_ALIGN_TOP
} mmi_fe_align_type;

typedef enum
{
    MMI_FE_ELLIPSIS_TAIL,     /* ellipsis from tail, ex: ABCDEFG  -> ABCD... */
    MMI_FE_ELLIPSIS_MIDDLE,   /* ellipsis from tail, ex: ABCDEFG  -> AB...FG */
    MMI_FE_ELLIPSIS_END
} mmi_fe_ellipsis_type;

typedef enum
{
    MMI_FONT_ENGINE_NO_ERROR = 0,
    MMI_FONT_ENGINE_NO_TRUNCATION,
    MMI_FONT_ENGINE_TRUNCATION,
    MMI_FONT_ENGINE_ERROR_NULL_STRING,
    MMI_FONT_ENGINE_ZERO_LENGTH,
    MMI_FONT_ENGINE_ERROR_NO_TRUNCATION_AVAILABLE,
    MMI_FONT_ENGINE_END_OF_ENUM
} mmi_font_engine_error_message_enum;


#if defined(__MMI_LANG_ZAWGYI_MYANMAR__) && defined(__MMI_LANG_MYANMAR__)
typedef enum
{
    MMI_FONT_ENGINE_READ_LANG_NONE,
    MMI_FONT_ENGINE_READ_LANG_MYANMAR,
    MMI_FONT_ENGINE_READ_LANG_ZAWGYI,
    MMI_FONT_ENGINE_READ_LANG_MAX,
} mmi_font_engine_read_lang_enum;
#endif


#ifndef LOW_COST_SUPPORT
#define __MMI_FONT_CACHE_SUPPORT__
#else
#define __FONT_ENGINE_SLIM__
#endif

#ifdef __MMI_FONT_CACHE_SUPPORT__
#define LATIN_CHAR_HT_SIZE 		128
#define LATIN_CHAR_HT_MASK		0x007f
#define OTHERS_CHAR_HT_SIZE 	256
#define OTHERS_CHAR_HT_MASK		0x00ff
#else
#define LATIN_CHAR_HT_SIZE 		2
#define LATIN_CHAR_HT_MASK		0x0001
#define OTHERS_CHAR_HT_SIZE 	2
#define OTHERS_CHAR_HT_MASK		0x0001
#endif

/* Char cache hash table */
typedef struct
{
    U32 gnCurrentFont; /* current font */
    U32 unicode;   /* char unicode */
    U16 Width;     /* char width */
    U16 Height;    /* char height */
    U16 Ascent;    /* char ascent */
    U16 Descent;   /* char descent */
    U8 *CharData;  /* char raw data */
    U32 NumChar;   /* char data bytes */
    S32 index;     /* char index */
    U16 DWidth;    /* char DWidth */
    U8 count;      /* char count */
} CharHashTable;

#if defined(__MMI_VECTOR_FONT_MEMORY_CARD_SUPPORT__)
typedef struct
{
    FS_HANDLE handle;
    U16 res_id;
}mmi_preload_font_struct;
#endif

    /* --------------------------- Public Functions and Variables ------------------------- */

    /* DOM-NOT_FOR_SDK-BEGIN */
  
    /*****************************************************************************
     * FUNCTION
     *  TestDiffFonts
     * DESCRIPTION
     *  To test the different fonts with diferent sizes.
     *  This is used to test the different fonts with diferent sizes.
     * PARAMETERS
     *  void
     * RETURNS
     *  void
     *****************************************************************************/
    extern void TestDiffFonts(void);

    /* -------------------------- Private Functions and Variables ------------------------- */

    /* Public functions                                        */

     /*****************************************************************************
     * FUNCTION
     *  mmi_fe_init
     * DESCRIPTION
     *  Init font engine.
     *  Internal use
     * PARAMETERS
     *  void
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_init(void);

/* DOM-NOT_FOR_SDK-END */

    /**************************************************************
    * FUNCTION 
    *  Get_CharBoundingBox()
    * Description
    *  To get the bounding box of "drawn area" of a character.
    *     1. It does not handle Hindi properly.
    *     2. The function is slow because it process internal font data.
    *     3. This function can be used to align a character in a better way because the "drawn area" is aligned
    *         differently for different font database.
    * PARAMETERS
    *  Ch              : [IN] The character ucs2 code.
    *  pCharWidth      : [OUT] Width of character.
    *  pCharHeight     : [OUT] Height of character.
    *  pBoxXoffset     : [OUT] X offset of the bounding box of drawn area relative to the top-left corner.
    *  pBoxYoffset     : [OUT] Y offset of the bounding box of drawn area  relative to the top-left corner.
    *  pBoxWidth       : [OUT] Width of the bounding box of drawn area. 
    *  pBoxHeight      : [OUT] Height of the bounding box of drawn area. 
    * RETURNS
    *  void
    **************************************************************/
    extern void Get_CharBoundingBox(
                    U32 Ch,
                    S32 *pCharWidth,
                    S32 *pCharHeight,
                    S32 *pBoxXoffset,
                    S32 *pBoxYoffset,
                    S32 *pBoxWidth,
                    S32 *pBoxHeight);

    /*****************************************************************************
     * FUNCTION
     *  Get_CharNumInWidth
     * DESCRIPTION
     *  To get char number in specified width.
     *  This function only works for non-complicated language.
     *  Complicated language is include Arabic series, Indic series, Thai and Vietnamese language.
     *  It means that the language process is not processed in the function.
     * PARAMETERS
     *  String             : [IN] The string content.        
     *  width              : [IN] The specifed width to display the string.       
     *  checklinebreak     : [IN] To check line break or not.       
     * RETURNS
     *  The number of character could be displayed in the specified width.
     *****************************************************************************/
    extern U32 Get_CharNumInWidth(U8 *String, U32 width, U8 checklinebreak);

    /*****************************************************************************
     * FUNCTION
     *  Get_CharNumInWidth_w
     * DESCRIPTION
     *  To get char number in specified width, gap and font effect feature.
     *  This function only work for non-complicated language. 
     *  Complicated language is include Arabic series, Indic series, Thai and Vietnamese language.
     *  It means that the language process is not processed in the function.
     * PARAMETERS
     *  String            : [IN] The string content.        
     *  width             : [IN] The specifed width to display the string.       
     *  checklinebreak    : [IN] To check line break or not.       
     *  gap               : [IN] The gap between each character.  
     * RETURNS
     *  The number of character could be displayed in the specified width.
     *****************************************************************************/
    extern U32 Get_CharNumInWidth_w(U8 *String, U32 width, U8 checklinebreak, U32 gap);

    /*****************************************************************************
     * FUNCTION
     *  Get_CharNumInWidth_internal
     * DESCRIPTION
     *  To get char number in specified width and gap.
     *  This function only work for non-complicated language. 
     *  Complicated language is include Arabic series, Indic series, Thai and Vietnamese language.
     *  It means that the language process is not processed in the function.
     * PARAMETERS
     *  String             : [IN] The string content.        
     *  width              : [IN] The specifed width to display the string.       
     *  checklinebreak     : [IN] To check line break or not.       
     *  gap                : [IN] The gap between each character.  
     * RETURNS
     *  The number of character could be displayed in the specified width.
     *****************************************************************************/
    extern U32 Get_CharNumInWidth_internal(U8 *String, U32 width, U8 checklinebreak, U32 gap);

    /*****************************************************************************
     * FUNCTION
     *  Get_CharWidthHeight
     * DESCRIPTION
     *  To get char width and height. 
     *  The font attribute is not considered as the propriety to influence the return value.
     *  Before using the API, please setup font.
     * PARAMETERS
     *  Ch              : [IN]     The character.
     *  pWidth          : [OUT]    The character width. If the character is non-India character, the width would be returned. 
     *                             Othrewise, the dwidth (advance width) would be returned.  
     *  pHeight         : [OUT]    The height of the character.
     * RETURNS
     *  void
    *****************************************************************************/
    extern void Get_CharWidthHeight(U32 Ch, S32 *pWidth, S32 *pHeight);

    /*****************************************************************************
     * FUNCTION
     *  Get_CharHeight
     * DESCRIPTION
     *  To get char height with current selected Font and font size.
     *  Font means a collection of char glyph that can be used to display or print text.
     * PARAMETERS
     *  void
     * RETURNS
     *  S32    the char height.
     *****************************************************************************/
    extern S32 Get_CharHeight(void);

    /*****************************************************************************
     * FUNCTION
     *  Get_CharAscent
     * DESCRIPTION
     *  To get char ascent with current selected Font and font size.
     *  Font means a collection of char glyph that can be used to display or print text.
     * PARAMETERS
     *  void
     * RETURNS
     *  S32  the ascent for the char.
     *****************************************************************************/
    extern S32 Get_CharAscent(void);

    /*****************************************************************************
     * FUNCTION
     *  Get_CharDescent
     * DESCRIPTION
     *  To get char descent with current selected Font and font size.
     *  Font means a collection of char glyph that can be used to display or print text.
     * PARAMETERS
     *  void
     * RETURNS
     *  S32  the descent for the char.
     *****************************************************************************/
    extern S32 Get_CharDescent(void);
    
    
    /*****************************************************************************
     * FUNCTION
     *  Get_CharHeightOfAllLang
     * DESCRIPTION
     *  To get maximum char height in all languages supported by current system with font size.
     *  This function is not include with font attributes except for font effect features.
     * PARAMETERS
     *  size        : [IN]        The font size.
     * RETURNS
     *  S32  the char height.
     *****************************************************************************/
    extern S32 Get_CharHeightOfAllLang(U8 size);

    /*****************************************************************************
     * FUNCTION
     *  Get_StringWidthHeight
     * DESCRIPTION
     *  To get string width and height. 
     *  The bordered attribute is not considered as an attribute to influence the string width & height.
     * PARAMETERS
     *  String      : [IN]         The string content.
     *  pWidth      : [OUT]        The string width.         
     *  pHeight     : [OUT]        The string height.    
     * RETURNS
     *  void
     *****************************************************************************/
    extern void Get_StringWidthHeight(U8 *String, S32 *pWidth, S32 *pHeight);


    /*****************************************************************************
     * FUNCTION
     *  Get_StringWidthHeight_n
     * DESCRIPTION
     *  To get string width and height with a given number of characters.
     * PARAMETERS
     *  String       : [IN]   The string content.        
     *  n            : [IN]   The given number of characters.     
     *  pWidth       : [OUT]  The string width.      
     *  pHeight      : [OUT]  The string height.      
     * RETURNS
     *  void
     *****************************************************************************/
    extern void Get_StringWidthHeight_n(U8 *String, S32 n, S32 *pWidth, S32 *pHeight);

    /*****************************************************************************
     * FUNCTION
     *  Get_StringWidthHeight_w
     * DESCRIPTION
     *  To get string width and height with the given gap.
     * PARAMETERS
     *  String       : [IN]   The string content.        
     *  w            : [IN]   The gap between each character.     
     *  pWidth       : [OUT]  The string width.      
     *  pHeight      : [OUT]  The string height.      
     * RETURNS
     *  void
     *****************************************************************************/
    extern void Get_StringWidthHeight_w(U8 *String, S32 w, S32 *pWidth, S32 *pHeight);

    /*****************************************************************************
     * FUNCTION
     *  Get_Current_Lang_CountryCode
     * DESCRIPTION
     *  To get current language's country code.
     *  This is used to get current language's country code.
     * PARAMETERS
     *  void
     * RETURNS
     *  Current language country code.
     *****************************************************************************/
    extern U8 *Get_Current_Lang_CountryCode(void);

    /*****************************************************************************
     * FUNCTION
     *  Get_CharDisplayHeightOfAllLangAndType
     * DESCRIPTION
     *  To get maximum char height in all languages with font size.
     *  This function assumes that all font attributes is set. 
     *  All languages means the languages which supported by current system.
     * PARAMETERS
     *  size       : [IN]   The font size.     
     * RETURNS
     *  S32  the height.
     *****************************************************************************/
    extern S32 Get_CharDisplayHeightOfAllLangAndType(U8 size);

    /*****************************************************************************
     * FUNCTION
     *  Get_CharDisplayHeightOfAllLangAndType
     * DESCRIPTION
     *  To get maximum char ascent in all languages and all font attributes with current font size.
     *  This function assumes that all font attributes is set, except that font effect feature.
     * PARAMETERS
     *  void
     * RETURNS
     *  S32  the ascent.
     *****************************************************************************/
    extern S32 Get_CharDisplayAscentOfAllType(void);

    /*****************************************************************************
     * FUNCTION
     *  Get_CharDisplayHeightOfAllLangAndType
     * DESCRIPTION
     *  To get maximum char descent in all languages and all font attributes with current font size. 
     *  This function assumes that all font attributes is set, except the font effect feature. 
     * PARAMETERS
     *  void
     * RETURNS
     *  S32  the descent.
     *****************************************************************************/
    extern S32 Get_CharDisplayDescentOfAllType(void);

    /*****************************************************************************
     * FUNCTION
     *  Get_CharDisplayHeightofAllType
     * DESCRIPTION
     *  To get char height of current selected Font with all font attributes with current font size.
     *  This function assumes that all font attributes is set.
     * PARAMETERS
     *  void
     * RETURNS
     *  S32 the height.
     *****************************************************************************/
    extern S32 Get_CharDisplayHeightofAllType(void);

    /*****************************************************************************
     * FUNCTION
     *  Get_StringWidthHeight_multitap
     * DESCRIPTION
     *  To get the multitap string width and height.
     *  The language process would not applied in the string. 
     *  We consider each character as a separate character to query its parameters.
     * PARAMETERS
     *  String      : [IN]      The string content.    
     *  w           : [IN]      The gap between each character.  
     *  pWidth      : [OUT]     The string width.       
     *  pHeight     : [OUT]     The string height.       
     * RETURNS
     *  void
     *****************************************************************************/
    extern void Get_StringWidthHeight_multitap(U8 *String, S32 w, S32 *pWidth, S32 *pHeight);

    /*****************************************************************************
     * FUNCTION
     *  Get_StringWidthHeight_variant
     * DESCRIPTION
     *  To get string width, height and how many character could be displayed in the spefied width with a given number of characters and the given gap between each character.
     * PARAMETERS
     *  string                    : [IN]    The string content.     
     *  w                         : [IN]    The gap between each character.     
     *  n                         : [IN]    The given number of characters.     
     *  pWidth                    : [OUT]   The string width.      
     *  pHeight                   : [OUT]   The string height. 
     *  max_width                 : [IN]    The specified width to display the string.
     *  checkLineBreak            : [IN]    To indicate if the line break character should be considered as an end.
     *  checkCompleteWord         : [IN]    To indicate if the complete word should be considered.
     * RETURNS
     *  U32 how many characters is counted.
     *****************************************************************************/
    extern U32 Get_StringWidthHeight_variant(U8 *string, S32 w, S32 n, S32 *pWidth, S32 *pHeight, S32 max_width, U8 checkLineBreak, U8 checkCompleteWord);

    /*****************************************************************************
     * FUNCTION
     *  Get_StringWidthHeight_wn
     * DESCRIPTION
     *  To get string widths and height with a given number of characters and the given gap between each character.
     * PARAMETERS
     *  String       : [IN]      The string content.     
     *  w            : [IN]      The gap between each character.     
     *  n            : [IN]      The given number of characters.     
     *  pWidth       : [OUT]     The string width.      
     *  pHeight      : [OUT]     The string height.      
     * RETURNS
     *  void
     *****************************************************************************/
    extern void Get_StringWidthHeight_wn(U8 *String, S32 w, S32 n, S32 *pWidth, S32 *pHeight);

    /*****************************************************************************
     * FUNCTION
     *  Get_StringHeight
     * DESCRIPTION
     *  To get Font max height  with current selected font size.
     * PARAMETERS
     *  void
     * RETURNS
     *  S32  the string height.
     *****************************************************************************/
    extern S32 Get_StringHeight(void);

    

    /*****************************************************************************
     * FUNCTION
     *  SetFont
     * DESCRIPTION
     *  To set the font.  
     *  This is used to set all different type of font and different sizes.
     * PARAMETERS
     *  Font           : [IN] The font attribute.        
     *  arrCount       : [IN] The font family.       
     * RETURNS
     *  Not used, always 0.
     *****************************************************************************/
    extern U8 SetFont(stFontAttribute Font, U8 arrCount);

    /*****************************************************************************
     * FUNCTION
     *  GetFont
     * DESCRIPTION
     *  To get the current font.
     *  This is used to get current font attributes.
     * PARAMETERS
     *  Font           : [IN/OUT]        Font attribute.
     *  arrCount       : [IN/OUT]        Fhe font family.
     * RETURNS
     *  void
     *****************************************************************************/
    extern void GetFont(stFontAttribute *Font, U8* arrCount);

    #define ShowString(X,Y,DUMMY_FONT,BACKGROUND,STRING,LINEHEIGHT)                                         mmi_fe_show_string_ext(X,Y,STRING)
    #define ShowString_n(X,Y,DUMMY_FONT,BACKGROUND,STRING,LEN,LINEHEIGHT)                                   mmi_fe_show_string_n(X,Y,STRING,LEN)
    #define ShowStringBordered(X,Y,DUMMY_FONT,BACKGROUND,STRING,LINEHEIGHT)                                            mmi_fe_show_string_bordered(X,Y,STRING)        
    #define ShowStringBordered_n(X,Y,DUMMY_FONT,BACKGROUND,STRING,LEN,LINEHEIGHT)                                      mmi_fe_show_string_bordered_n(X,Y,STRING,LEN)        
    #define ShowString_baseline(X,Y,DUMMY_FONT,BACKGROUND,STRING,BASELINE,DEFAULT_DIR,LINEHEIGHT)           mmi_fe_show_string_baseline(X,Y,STRING,BASELINE,DEFAULT_DIR)
    #define ShowStringBordered_baseline(X,Y,DUMMY_FONT,BACKGROUND,STRING,BASELINE,DEFAULT_DIR,LINEHEIGHT)   mmi_fe_show_string_bordered_baseline(X,Y,STRING,BASELINE,DEFAULT_DIR)
    #define ShowString_by_direction(X,Y,DUMMY_FONT,BACKGROUND,STRING,LINEHEIGHT,DEFAULT_DIR)                mmi_fe_show_string_by_direction(X,Y,STRING,DEFAULT_DIR)
    #define ShowStringBordered_by_direction(X,Y,DUMMY_FONT,BACKGROUND,STRING,LINEHEIGHT,DEFAULT_DIR)        mmi_fe_show_string_bordered_by_direction(X,Y,STRING,DEFAULT_DIR)
    #define ShowString_n_baseline(X, Y, DUMMY_FONT, BACKGROUND, STRING, LEN, BASELINE) mmi_fe_show_string_n_baseline((X), (Y), (STRING), (LEN), (BASELINE))


    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_show_string_ext
     * DESCRIPTION
     *  To display a string by x,y position. The simplest version of show string.
     * PARAMETERS
     *  x              : [IN]      X coordinate.  
     *  y              : [IN]      Y coordinate.
     *  String         : [IN]      String.
     * RETURNS
     *  The number of character been showed.
     *****************************************************************************/
    extern U32 mmi_fe_show_string_ext(S32 x, S32 y, U8 *String);


    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_show_char_at_xy
     * DESCRIPTION
     *  To display the character at a specifed position. 
     *  Rendering rule would not be considered to adjuest the x, y position.
     * PARAMETERS
     *  x:       [IN]  The x position.
     *  y:       [IN]  The y position.
     *  ch:      [IN]  The specified character.
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_show_char_at_xy(S32 x, S32 y, U16 ch);


    

    /*****************************************************************************
    * FUNCTION
    *  mmi_fe_show_string
    * DESCRIPTION
    *  To display string in the screen.
    * PARAMETERS
    *  param                  : [IN]        The input parameter for string display.
    * RETURNS
    *  UNIT32  how many character is diaplyed.
    *****************************************************************************/
    extern U32 mmi_fe_show_string(mmi_fe_showstring_info_struct_p param);
    

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_show_string_n_baseline
     * DESCRIPTION
     *  To display a string by the assigned baseline and assigned string length.
     * PARAMETERS
     *  x_unsigned        : [IN]         X coordinate.   
     *  y_unsigned        : [IN]         Y coordinate.     
     *  String            : [IN]         String.
     *  Len               : [IN]         String length to show. You can set this argument to -1 if you wish to show the whole string.
     *  baseline          : [IN]         String baseline.
     * RETURNS
     *  U32 The number of character been showed.
     *****************************************************************************/
    extern U32  mmi_fe_show_string_n_baseline(
            U32 x_unsigned,
            U32 y_unsigned,
            U8 *String,
            S32 Len,
            S32 baseline);

    
    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_show_string_bordered_n_baseline
     * DESCRIPTION
     *  To display a string with border by the assigned baseline and assigned string length.
     * PARAMETERS
     *  x_unsigned        : [IN]         X coordinate.   
     *  y_unsigned        : [IN]         Y coordinate.     
     *  String            : [IN]         String.
     *  Len               : [IN]         String length to show.
     *  baseline          : [IN]         String baseline.
     * RETURNS
     *  S32 The number of character been showed.
     *****************************************************************************/
    extern U32  mmi_fe_show_string_bordered_n_baseline(
            U32 x_unsigned,
            U32 y_unsigned,
            U8 *String,
            S32 Len,
            S32 baseline);


    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_show_string_n
     * DESCRIPTION
     *  To display a string by the assigned baseline and assigned string length.
     * PARAMETERS
     *  x_unsigned        : [IN]         X coordinate.   
     *  y_unsigned        : [IN]         Y coordinate.     
     *  String            : [IN]         String.
     *  Len               : [IN]         String length to show.      
     * RETURNS
     *  The number of character been showed.
     *****************************************************************************/
    extern U32 mmi_fe_show_string_n(
                U32 x_unsigned,
                U32 y_unsigned,
                U8 *String,
                int Len);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_show_string_bordered
     * DESCRIPTION
     *  To display string with  bordered attribute.
     * PARAMETERS
     *  x              : [IN]      X coordinate.  
     *  y              : [IN]      Y coordinate.
     *  String         : [IN]      String.
     * RETURNS
     *  The number of character been showed.
     *****************************************************************************/
    extern U32 mmi_fe_show_string_bordered(S32 x, S32 y, U8 *String);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_show_string_bordered_n
     * DESCRIPTION
     *  To display a bordered string by assigned string length.  
     * PARAMETERS
     *  x_unsigned        : [IN]         X coordinate.   
     *  y_unsigned        : [IN]         Y coordinate.     
     *  String            : [IN]         String.
     *  Len               : [IN]         String length to show.      
     * RETURNS
     *  The number of character been showed.
     *****************************************************************************/
    extern U32 mmi_fe_show_string_bordered_n(
                U32 x_unsigned,
                U32 y_unsigned,
                U8 *String,
                int Len);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_show_string_baseline
     * DESCRIPTION
     *  To display a string by the assigned baseline.
     * PARAMETERS
     *  x                 : [IN]         X coordinate.   
     *  y                 : [IN]         Y coordinate.     
     *  String            : [IN]         String.
     *  baseline          : [IN]         String baseline.
     *  default_direction : [IN]         The direction to read the string (R2L or L2R)
     * RETURNS
     *  The number of character been showed.
     *****************************************************************************/
    extern U32 mmi_fe_show_string_baseline(S32 x, S32 y, U8 *String, S32 baseline, U8 default_direction);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_show_string_bordered_baseline
     * DESCRIPTION
     *  To display a bordered string by the assigned baseline.
     * PARAMETERS
     *  x                 : [IN]         X coordinate.   
     *  y                 : [IN]         Y coordinate.     
     *  String            : [IN]         String.
     *  baseline          : [IN]         String baseline.
     *  default_direction : [IN]         The direction to read the string (R2L or L2R)
     * RETURNS
     *  The number of character been showed.
     *****************************************************************************/
    extern U32 mmi_fe_show_string_bordered_baseline(S32 x, S32 y, U8 *String, S32 baseline, U8 default_direction);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_show_string_by_direction
     * DESCRIPTION
     *  To display a string by the assigned direction.
     * PARAMETERS
     *  x                 : [IN]         X coordinate.   
     *  y                 : [IN]         Y coordinate.     
     *  String            : [IN]         String.
     *  default_direction : [IN]         The direction to read the string (R2L or L2R)
     * RETURNS
     *  The number of character been showed.
     *****************************************************************************/
    extern U32 mmi_fe_show_string_by_direction(S32 x, S32 y, U8 *String, U8 default_direction);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_show_string_bordered_by_direction
     * DESCRIPTION
     *  To display a bordered string by the assigned direction.
     * PARAMETERS
     *  x                 : [IN]         X coordinate.   
     *  y                 : [IN]         Y coordinate.     
     *  String            : [IN]         String.
     *  default_direction : [IN]         The direction to read the string (R2L or L2R)
     * RETURNS
     *  The number of character been showed. 
     *****************************************************************************/
    extern U32 mmi_fe_show_string_bordered_by_direction(S32 x, S32 y, U8 *String, U8 default_direction);

    /*****************************************************************************
     * FUNCTION
     *  Get_FontHeight
     * DESCRIPTION
     *  Get font height by assigned font and current language index.
     *  Not used
     * PARAMETERS
     *  Font              : [IN]        Font.
     *  arrCount          : [IN]        Current language index.    
     * RETURNS
     *  Font height.
     *****************************************************************************/
    extern S32 Get_FontHeight(stFontAttribute Font, U8 arrCount);

    /*****************************************************************************
     * FUNCTION
     *  Get_StringLength_InCluster
     * DESCRIPTION
     *  Get the string length in cluster. 
     * PARAMETERS
     *  input_str       : [IN]   String to mesure length.     
     *  len             : [IN]   The character length of string.     
     *  base_len        : [IN]   The base length of string.     
     * RETURNS
     *  The string length according the clusters.
     *****************************************************************************/
    extern U32 Get_StringLength_InCluster(U8* input_str, U32 len, U32 base_len);

    /*****************************************************************************
     * FUNCTION
     *  IsL2RMMIStyle
     * DESCRIPTION
     *  To check if current language should be rendered from R2L or L2R.
     * PARAMETERS
     *  void
     * RETURNS
     *  TRUE or FALSE.
     *****************************************************************************/
    extern BOOL IsL2RMMIStyle(void);

    /*****************************************************************************
     * FUNCTION
     *  mmi_font_engine_show_truncated_text
     * DESCRIPTION
     *  Print truncated text.
     *  If length of text is greater  than screen width then the text is truncated. 
     *  The assign truncated symbol are shown at end of text.
     * PARAMETERS
     *  x                      : [IN]        Start x positoin.
     *  y                      : [IN]        Start Y position.
     *  xwidth                 : [IN]        Width of text in pixels to display. The border width is not included.
     *  st                     : [IN]        Text to display.
     *  truncated_symbol       : [IN]        The truncated symbol, it would be show at the end of text if truncation is necessary.
     *  bordered               : [IN]        To indicate if it is border or not.
     * RETURNS
     *  For checking if the string has been truncated.
     *****************************************************************************/
    extern mmi_font_engine_error_message_enum mmi_font_engine_show_truncated_text(
                S32 x, 
                S32 y,
                S32 xwidth, 
                U8* st, 
                U8* truncated_symbol,
                MMI_BOOL bordered);

/*****************************************************************************
 * FUNCTION
 *  mmi_fe_show_ellipsis_text
 * DESCRIPTION
 *  Print truncated text.
 *  If length of text is greater than screen width then the text is truncated. 
 *  Current we support truncated from middle and from tail according to ellipsis_type.
 * PARAMETERS
 *  x:                       [IN]        Start x positoin.
 *  y:                       [IN]        Start Y position.
 *  xwidth:                  [IN]        Width of text in pixels to display. The border width is not included.
 *  st:                      [IN]        Text to display.
 *  truncated_symbol:        [IN]        The truncated symbol, it would be show at the end of text if truncation is necessary.
 *  bordered:                [IN]        To indicate if it is border or not.
 *  mmi_fe_ellipsis_type:    [IN]        Ellipsis_type.
 * RETURNS
 *  S32                      [OUT]   for checking if the string has been truncated.
 *****************************************************************************/
mmi_font_engine_error_message_enum mmi_fe_show_ellipsis_text(
                                        S32 x, 
                                        S32 y,
                                        S32 xwidth, 
                                        U8 *st, 
                                        U8 *truncated_symbol, 
                                        MMI_BOOL bordered, 
                                        mmi_fe_ellipsis_type ellipsis_type);

    /* DOM-NOT_FOR_SDK-BEGIN */

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_show_ellipsis_text_ext
     * DESCRIPTION
     *  Print ellipsis text
     *  If length of text is greater than screen width then the text is truncated.
     *  Current we support ellipsis from middle and from tail according to ellipsis_type
     * PARAMETERS
     *  x                           [IN]        Start x positoin
     *  y                           [IN]        Start Y position
     *  xwidth                      [IN]        Width of text in pixels to display. The border width is not included.
     *  st                          [IN]        Text to display
     *  truncated_symbol            [IN]        The truncated symbol, it would be show at the end of text if truncation is necessary
     *  bordered                    [IN]        To indicate if it is border or not
     *  ellipsis_type               [IN]        ellipsis type
     *  assigned_baseline           [IN]        assigned baseline, -1 mean use string default base line
     * RETURNS
     *  S32                     [OUT]   for checking if the string has been truncated
     *****************************************************************************/
    extern mmi_font_engine_error_message_enum mmi_fe_show_ellipsis_text_ext(
                                        S32 x,
                                        S32 y,
                                        S32 xwidth,
                                        U8 *st,
                                        U8 *truncated_symbol,
                                        MMI_BOOL bordered,
                                        mmi_fe_ellipsis_type ellipsis_type,
                                        S32 assigned_baseline);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_enable_date_char_display
     * DESCRIPTION
     *  To enable special date character (133~147 0x85~0x93) display. 
     * PARAMETERS
     *  void
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_enable_date_char_display(void);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_disable_date_char_display
     * DESCRIPTION
     *  To disable special date character (133~147 0x85~0x93) display. 
     * PARAMETERS
     *  void
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_disable_date_char_display(void);
    

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_enable_proprietary_symbol_display
     * DESCRIPTION
     *  To enable special CR-LF and SPACE symbol used in symbol table (133~134 0x85~0x86) display. 
     * PARAMETERS
     *  void
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_enable_proprietary_symbol_display(void);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_disable_proprietary_symbol_display
     * DESCRIPTION
     *  To disable special CR-LF and SPACE symbol used in symbol table (133~134 0x85~0x86) display. 
     * PARAMETERS
     *  void
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_disable_proprietary_symbol_display(void);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_enable_ucs2_proprietary_display
     * DESCRIPTION
     *  To enable UCS2 proprietary range (0xE000 - 0xF8FF) 
     * PARAMETERS
     *  void
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_enable_ucs2_proprietary_display(void);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_disable_ucs2_proprietary__display
     * DESCRIPTION
     *  To disable UCS2 proprietary range (0xE000 - 0xF8FF) 
     * PARAMETERS
     *  void
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_disable_ucs2_proprietary_display(void);

    /* DOM-NOT_FOR_SDK-END */

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_measure_string_by_char_num
     * DESCRIPTION
     *  To get string width by the fixed char width.
     *  the fixed char width is count by the max width of the character.
     *  And the string width is the max char width multiple the numofchar.
     *  The characte of Arabic series, Indic series, Thai and Vietnamese language is not allowed
     *  to be the input. 
     * PARAMETERS
     *  numofchar   : [IN]     The number of character of the string.
     *  st          : [IN]     All the character would be displayed as a char in the string. 
     *  width       : [OUT]    The width.
     *  height      : [OUT]    The height.
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_measure_string_by_char_num(U8* st, S32 numofchar, S32* width, S32* height);


    /*****************************************************************************
    * FUNCTION
    *  mmi_fe_get_char_info_of_lang
    * DESCRIPTION
    *  To get maximum char height, ascent and descent for a specifed size and specifed language.
    * PARAMETERS
    *  size       : [IN]       The specified size.
    *  pheight     : [OUT]      The height.
    *  pascent     : [OUT]      The ascent.
    *  pdescent    : [OUT]      The descent.
    * RETURNS
    *  void
    *****************************************************************************/
    MMI_BOOL mmi_fe_get_char_info_of_lang(char *lang_ssc, U8 size, S32* pheight, S32* pascent, S32* pdescent);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_get_char_info_of_all_lang
     * DESCRIPTION
     *  To get maximum char height, ascent and descent for a specifed size regardless of language.
     * PARAMETERS
     *  size       : [IN]       The specified size.
     *  pheight     : [OUT]      The height.
     *  pascent     : [OUT]      The ascent.
     *  pdescent    : [OUT]      The descent.
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_get_char_info_of_all_lang(U8 size, S32* pheight, S32* pascent, S32* pdescent);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_get_char_info_of_simply_lang
     * DESCRIPTION
     *  To get maximum char height, ascent and descent for a simply language (English, SC) with specific font size.
     * PARAMETERS
     *  size            : [IN]    The specified size.
     *  pHeight         : [IN]    Height.         
     *  pAscent         : [IN]    Ascent. 
     *  pDescent        : [IN]    Descent. 
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_get_char_info_of_simply_lang(U8 size, S32 *pHeight, S32 *pAscent, S32 *pDescent);


/* DOM-NOT_FOR_SDK-BEGIN */

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_get_char_info_of_common_lang
     * DESCRIPTION
     *  To get maximum char height, ascent and descent for a specifed size of common language.
     * PARAMETERS
     *  size       : [IN]       The specified size.
     *  pheight     : [OUT]      The height.
     *  pascent     : [OUT]      The ascent.
     *  pdescent    : [OUT]      The descent.
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_get_char_info_of_common_lang(U8 size, S32* pheight, S32* pascent, S32* pdescent);

/* DOM-NOT_FOR_SDK-END */


    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_check_string
     * DESCRIPTION
     *  To check the input string if the first character is supported in current font configuration.
     * PARAMETERS
     *  font                   : [IN]       Font.    
     *  string                 : [IN]       The desired string.
     *  len                    : [IN]       The first len character should be checked.
     * RETURNS
     *  MMI_BOOL           the validness of the string.
     *****************************************************************************/
    extern MMI_BOOL mmi_fe_check_string(stFontAttribute font, U8* string, S32 len);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_get_string_widthheight
     * DESCRIPTION
     *  To get string width height.
     * PARAMETERS
     *  query      : [IN/OUT]    The query parameter to indicate the input and output.
     * RETURNS
     *  U32   how many characters is counted.
     *****************************************************************************/
    extern U32 mmi_fe_get_string_widthheight(mmi_fe_get_string_info_param_struct_p query);


    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_get_glyph_metrics
     * DESCRIPTION
     *  This is used to get the glyph metrics for a sepcified character. 
     *  The font metrics is considered with font attribute.
     *  The caller to use this API should get GDI lock first for thread safe in font engine.
     * PARAMETERS
     *  ch                  : [IN]      The ucs2 code for the character.      
     *  matrix              : [OUT]     The metrics of the char.        
     * RETURNS
     *  MMI_BOOL to indicate if the character is valid or not. If it is invalid character, the metrics info is the info for nil character.
     *****************************************************************************/
    extern MMI_BOOL mmi_fe_get_glyph_metrics(U16 ch, mmi_fe_glyph_metrics_struct_p matrix);


    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_show_char_with_bounding_box
     * DESCRIPTION
     *  Show character inside the bounding box with the specified font size.
     * PARAMETERS
     *  x           : [IN]      The x position.
     *  y           : [IN]      The y position.
     *  width       : [IN]      The bounding box width.
     *  height      : [IN]      The bounding box height.
     *  ch          : [IN]      The specified character.
     *  type        : [IN]      Aligh type.
     *  Font        : [IN]      The max font size.
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_show_char_with_bounding_box(S32 x, S32 y, S32 width, S32 height, U16 ch, mmi_fe_align_type type, stFontAttribute Font);

    

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_set_text_color
     * DESCRIPTION
     *  To set text color.
     * PARAMETERS
     *  c         : [IN]      Color.
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_set_text_color(mmi_fe_color c);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_set_text_border_color
     * DESCRIPTION
     *  To set text border color.
     * PARAMETERS
     *  c        : [IN]         Color.
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_set_text_border_color(mmi_fe_color c);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_get_text_color
     * DESCRIPTION
     *  To get text color.
     * PARAMETERS
     *  void
     * RETURNS
     *  Text color.
     *****************************************************************************/
    extern mmi_fe_color mmi_fe_get_text_color(void);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_get_text_border_color
     * DESCRIPTION
     *  To get text border color.
     * PARAMETERS
     *  void
     * RETURNS
     *  Text border color.
     *****************************************************************************/
    extern mmi_fe_color mmi_fe_get_text_border_color(void);


    

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_show_single_cluster
     * DESCRIPTION
     *  To display one cluster. The content should be in its display form.
     * PARAMETERS
     *  param    : [IN]        The parameter for one cluster.
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_show_single_cluster(mmi_fe_show_one_cluster_param_struct_p param);

#ifdef __MMI_VECTOR_FONT_SUPPORT__
    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_set_antialias
     * DESCRIPTION
     *  Set font antialias attributes.
     * PARAMETERS
     *  value         : [IN]     The parameter for one cluster.
     * RETURNS
     *  void
     *****************************************************************************/
    extern void mmi_fe_set_antialias(MMI_BOOL value);
#endif

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_pixel_to_size
     * DESCRIPTION
     *  Convert font pixel count to font size enum. 
     * PARAMETERS
     *  pixel            : [IN]     Pixel.
     * RETURNS
     *  U8 pixel size.
     *****************************************************************************/
    extern U8 mmi_fe_pixel_to_size(U8 pixel);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_is_vector_font_support
     * DESCRIPTION
     *  To check if vector font is supported on the platform.
     * PARAMETERS
     *  void
     * RETURNS
     *  MMI_BOOL. 
     *****************************************************************************/
    extern MMI_BOOL mmi_fe_is_vector_font_support(void);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_is_r2l_state
     * DESCRIPTION
     *  To check if it is on r2l state under current system language.
     * PARAMETERS
     *  void
     * RETURNS
     *  MMI_BOOL. 
     *****************************************************************************/
    extern MMI_BOOL mmi_fe_is_r2l_state(void);
    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_get_r2l_state
     * DESCRIPTION
     *  To get r2l state under current system language
     * PARAMETERS
     *  void
     * RETURNS
     *  MMI_BOOL
     *****************************************************************************/ 
#if defined (__MMI_BIDI_ALG__) 
    extern MMI_BOOL mmi_fe_get_r2l_state(void);
#else
    #define mmi_fe_get_r2l_state()   0
#endif
    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_set_r2l_state
     * DESCRIPTION
     *  To get r2l state under current system language
     * PARAMETERS
     *  void
     * RETURNS
     *  MMI_BOOL
     *****************************************************************************/
    
    extern void mmi_fe_set_r2l_state(MMI_BOOL state);
    
    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_get_char_info
     * DESCRIPTION
     *  To get the font info of the desired character.
     * PARAMETERS
     *  Ch          : [IN]             The unicode of desired character.
     *  pWidth      : [OUT]            The dwidth of the character. If the character is not Indic character. The dwidth is equal to width.
     *  pDwidth     : [OUT]            The width of the ch.
     *  pHeight         :[OUT]            The height of the ch.
     *  Ascent      : [OUT]            The ascent of the ch. You can pass NULL to it if you don't with to use it.
     *  Descent     : [OUT]            The descent of the ch.You can pass NULL to it if you don't with to use it.
     * RETURNS
    *  FE_GLYPH_ATTR_USING_FONT_ENGINE or 0.
    ****************************************************************************/
	extern U32 mmi_fe_get_char_info (U32 Ch, S32 *pWidth, S32 *pDwidth,S32*pHeight, S32 *Ascent, S32 *Descent);

    
    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_get_string_widthheight_ext
     * DESCRIPTION
     *  To get string width height and call callback function to save all cluster information.
     * PARAMETERS
     *  query           : [IN/OUT] The query parameter to indicate the input and output.
     *  direction       : [OUT]    String direction.
     *  f_save_info     : [IN]     Save cluster information function.
     *  user_data       : [OUT]    user defined data passed by application.
     * RETURNS
     *  U32   how many characters is counted.
     *****************************************************************************/
    extern U32 mmi_fe_get_string_widthheight_ext(mmi_fe_get_string_info_param_struct_p query, U8 *direction, fe_save_cluster_info_cb f_save_info, void *user_data);

    /*****************************************************************************
     * FUNCTION
     *  mmi_fe_get_string_direction
     * DESCRIPTION
     *  To get display direction by the content.
     * PARAMETERS
     *  string            : [IN]     The string input.   
     *  len               : [IN]     String length.
     * RETURNS
     *  PMT_BIDI_TYPES.
     *****************************************************************************/
    extern U8 mmi_fe_get_string_direction(U8* string, S32 len);

/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
     * FUNCTION
     *  IsChineseSet
     * DESCRIPTION
     *  This function checks whether the current language is set as Chinese or not.
     * PARAMETERS
     *  void
     * RETURNS
     *  On yes, return MMI_TRUE; otherwise, return MMI_FALSE.
     *****************************************************************************/
    extern pBOOL IsChineseSet(void);

    /*****************************************************************************
     * FUNCTION
     *  IsEnglishSet
     * DESCRIPTION
     *  This function checks whether the current language is set as English or not.
     * PARAMETERS
     *  void
     * RETURNS
     *  On yes, return MMI_TRUE; otherwise, return MMI_FALSE.
     *****************************************************************************/
    extern pBOOL IsEnglishSet(void);

    /*****************************************************************************
     * FUNCTION
     *  IsTrChineseSet
     * DESCRIPTION
     *  This function checks whether the current language is set as traditional.
     *  Chinese or not.
     * PARAMETERS
     *  void
     * RETURNS
     *  On yes, return MMI_TRUE; otherwise, return MMI_FALSE.
     *****************************************************************************/
    extern pBOOL IsTrChineseSet(void);

    /*****************************************************************************
     * FUNCTION
     *  IsSmChineseSet
     * DESCRIPTION
     *  This function checks whether the current language is set as simplified.
     *  Chinese or not.
     * PARAMETERS
     *  void
     * RETURNS
     *  On yes, return MMI_TRUE; otherwise, return MMI_FALSE.
     *****************************************************************************/
    extern pBOOL IsSmChineseSet(void);

#ifdef __MMI_VECTOR_FONT_SUPPORT__
extern void mmi_fe_cache_print_all(void);
#endif


#if defined(__MMI_FONT_EFFECTS__)

/*****************************************************************************
 * FUNCTION
 *  addFontEffectAttributeNode
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void        
 * RETURNS
 *  void
 *****************************************************************************/
extern U8 addFontEffectAttributeNode(stFontAttributeNode *attribute_node);


/*****************************************************************************
 * FUNCTION
 *  searchFontEffectAttribute
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void        
 * RETURNS
 *  void
 *****************************************************************************/
extern MMI_BOOL removeFontEffectAttributeNode(U8 node_id);

/*****************************************************************************
 * FUNCTION
 *  mmi_fe_init
 * DESCRIPTION
 *  To initalize font engine
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
extern void mmi_fe_init_font_effect_theme(void);

/*****************************************************************************
 * FUNCTION
 *  mmi_fe_init
 * DESCRIPTION
 *  To initalize font engine
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
extern void mmi_fe_init_font_effect_theme_ext(void);

#endif /* __MMI_FONT_EFFECTS__ */

/*****************************************************************************
 * FUNCTION
 *  mmi_fe_size_to_pixel
 * DESCRIPTION
 *  Convert the size to pixel
 * PARAMETERS
 *  size        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
extern S32 mmi_fe_size_to_pixel(U8 size);


/*****************************************************************************
 * FUNCTION
 *  mmi_fe_get_string_widthheight_varient
 * DESCRIPTION
 *  To get string width height
 * PARAMETERS
 *  query       [IN/OUT]        The query parameter to indicate the input and output
 * RETURNS
 *  U32   how many characters is counted.
 *****************************************************************************/
extern U32 mmi_fe_get_string_widthheight_varient(mmi_fe_get_string_info_param_struct_p query);

/*****************************************************************************
 * FUNCTION
 *  mmi_fe_check_single_color_buffer_can_create
 * DESCRIPTION
 *  To check single color buffer can cteate
 * PARAMETERS
 *  border       [IN]        The font is border or not
 * RETURNS
 *  BOOL   buffer can be created or not.
 *****************************************************************************/
extern BOOL mmi_fe_check_single_color_buffer_can_create(BOOL border);

extern void mmi_fe_reset_font_boot_mode(void);

/* DOM-NOT_FOR_SDK-END */


#ifdef __cplusplus
}
#endif 

#endif /* _PIXCOMFONTENGINE_H */