1557 {
1567
1569
1570
1572 seg0.score = 32000;
1574
1576 segment_dir = major_dir;
1577
1578 axis->num_segments = 0;
1579
1580
1582 {
1585
1586
1588 {
1591 }
1592 }
1593 else
1594 {
1597
1598
1600 {
1603 }
1604 }
1605
1606
1607 for ( ; contour < contour_limit; contour++ )
1608 {
1611 int on_edge = 0;
1612
1613
1614
1615
1618 FT_Pos min_coord = 32000;
1619 FT_Pos max_coord = -32000;
1622 FT_Pos min_on_coord = 32000;
1623 FT_Pos max_on_coord = -32000;
1624
1626
1628
1629 FT_Pos prev_min_pos = min_pos;
1630 FT_Pos prev_max_pos = max_pos;
1631 FT_Pos prev_min_coord = min_coord;
1632 FT_Pos prev_max_coord = max_coord;
1635 FT_Pos prev_min_on_coord = min_on_coord;
1636 FT_Pos prev_max_on_coord = max_on_coord;
1637
1638
1641 {
1642
1644
1645 for (;;)
1646 {
1649 {
1651 break;
1652 }
1654 break;
1655 }
1656 }
1657
1659 passed = 0;
1660
1661 for (;;)
1662 {
1664
1665
1666 if ( on_edge )
1667 {
1668
1674
1675
1677 if (
v < min_coord )
1678 {
1680 min_flags =
point->flags;
1681 }
1682 if (
v > max_coord )
1683 {
1685 max_flags =
point->flags;
1686 }
1687
1688
1690 {
1692 if (
v < min_on_coord )
1694 if (
v > max_on_coord )
1696 }
1697
1699 {
1700
1701
1702
1703
1704 if ( !prev_segment || segment->first != prev_segment->
last )
1705 {
1706
1707
1708
1709 segment->last =
point;
1710 segment->pos = (
FT_Short)( ( min_pos + max_pos ) >> 1 );
1711 segment->delta = (
FT_Short)( ( max_pos - min_pos ) >> 1 );
1712
1713
1714
1715
1717 ( max_on_coord - min_on_coord ) < flat_threshold )
1719
1720 segment->min_coord = (
FT_Short)min_coord;
1721 segment->max_coord = (
FT_Short)max_coord;
1722 segment->height = segment->max_coord - segment->min_coord;
1723
1724 prev_segment = segment;
1725 prev_min_pos = min_pos;
1726 prev_max_pos = max_pos;
1727 prev_min_coord = min_coord;
1728 prev_max_coord = max_coord;
1729 prev_min_flags = min_flags;
1730 prev_max_flags = max_flags;
1731 prev_min_on_coord = min_on_coord;
1732 prev_max_on_coord = max_on_coord;
1733 }
1734 else
1735 {
1736
1737
1738
1740 {
1741
1742
1743
1744
1745
1746
1747
1748
1749 if ( prev_min_pos < min_pos )
1750 min_pos = prev_min_pos;
1751 if ( prev_max_pos > max_pos )
1752 max_pos = prev_max_pos;
1753
1754 if ( prev_min_coord < min_coord )
1755 {
1756 min_coord = prev_min_coord;
1757 min_flags = prev_min_flags;
1758 }
1759 if ( prev_max_coord > max_coord )
1760 {
1761 max_coord = prev_max_coord;
1762 max_flags = prev_max_flags;
1763 }
1764
1765 if ( prev_min_on_coord < min_on_coord )
1766 min_on_coord = prev_min_on_coord;
1767 if ( prev_max_on_coord > max_on_coord )
1768 max_on_coord = prev_max_on_coord;
1769
1772 max_pos ) >> 1 );
1774 min_pos ) >> 1 );
1775
1777 ( max_on_coord - min_on_coord ) < flat_threshold )
1779 else
1780 prev_segment->
flags &= ~AF_EDGE_ROUND;
1781
1786 }
1787 else
1788 {
1789
1790
1791
1792 if (
FT_ABS( prev_max_coord - prev_min_coord ) >
1793 FT_ABS( max_coord - min_coord ) )
1794 {
1795
1796
1797 if ( min_pos < prev_min_pos )
1798 prev_min_pos = min_pos;
1799 if ( max_pos > prev_max_pos )
1800 prev_max_pos = max_pos;
1801
1804 prev_max_pos ) >> 1 );
1806 prev_min_pos ) >> 1 );
1807 }
1808 else
1809 {
1810
1811
1812 if ( prev_min_pos < min_pos )
1813 min_pos = prev_min_pos;
1814 if ( prev_max_pos > max_pos )
1815 max_pos = prev_max_pos;
1816
1817 segment->last =
point;
1818 segment->pos = (
FT_Short)( ( min_pos + max_pos ) >> 1 );
1819 segment->delta = (
FT_Short)( ( max_pos - min_pos ) >> 1 );
1820
1822 ( max_on_coord - min_on_coord ) < flat_threshold )
1824
1825 segment->min_coord = (
FT_Short)min_coord;
1826 segment->max_coord = (
FT_Short)max_coord;
1827 segment->height = segment->max_coord -
1828 segment->min_coord;
1829
1830 *prev_segment = *segment;
1831
1832 prev_min_pos = min_pos;
1833 prev_max_pos = max_pos;
1834 prev_min_coord = min_coord;
1835 prev_max_coord = max_coord;
1836 prev_min_flags = min_flags;
1837 prev_max_flags = max_flags;
1838 prev_min_on_coord = min_on_coord;
1839 prev_max_on_coord = max_on_coord;
1840 }
1841 }
1842
1843 axis->num_segments--;
1844 }
1845
1846 on_edge = 0;
1848
1849
1850 }
1851 }
1852
1853
1855 {
1856 if ( passed )
1857 break;
1858 passed = 1;
1859 }
1860
1861
1862
1863
1864 if ( !on_edge &&
1867 {
1868
1870
1874
1875
1876 segment[0] = seg0;
1877
1878 segment->dir = (
FT_Char)segment_dir;
1879 segment->first =
point;
1880 segment->last =
point;
1881
1882
1883
1884 if ( prev_segment )
1885 prev_segment = segment - 1;
1886
1887 min_pos = max_pos =
point->u;
1888 min_coord = max_coord =
point->v;
1889 min_flags = max_flags =
point->flags;
1890
1892 {
1893 min_on_coord = 32000;
1894 max_on_coord = -32000;
1895 }
1896 else
1897 min_on_coord = max_on_coord =
point->v;
1898
1899 on_edge = 1;
1900
1902 {
1903
1904
1905
1907
1910
1913 segment->height = 0;
1914
1915 on_edge = 0;
1917 }
1918 }
1919
1921 }
1922
1923 }
1924
1925
1926
1927
1928 {
1931
1932
1933 for ( segment = segments; segment < segments_end; segment++ )
1934 {
1939
1940
1941 if ( first_v < last_v )
1942 {
1944
1945
1947 if (
p->v < first_v )
1948 segment->height = (
FT_Short)( segment->height +
1949 ( ( first_v -
p->v ) >> 1 ) );
1950
1952 if (
p->v > last_v )
1953 segment->height = (
FT_Short)( segment->height +
1954 ( (
p->v - last_v ) >> 1 ) );
1955 }
1956 else
1957 {
1959
1960
1962 if (
p->v > first_v )
1963 segment->height = (
FT_Short)( segment->height +
1964 ( (
p->v - first_v ) >> 1 ) );
1965
1967 if (
p->v < last_v )
1968 segment->height = (
FT_Short)( segment->height +
1969 ( ( last_v -
p->v ) >> 1 ) );
1970 }
1971 }
1972 }
1973
1976 }
af_axis_hints_new_segment(AF_AxisHints axis, FT_Memory memory, AF_Segment *asegment)
#define FLAT_THRESHOLD(x)
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u