Commit 61c8fa4
committed
Fix potential CoreText font rendering infinite recursion
The function `recurseDraw` is actually a misnomer. It uses recursion in
a way that is unnecessary as it's a simple while loop that keeps drawing
as many characters as possible until all are drawn. The recursion is
just a convenience to invoke the CoreText rendering code. If the API for
`CTFontGetGlyphsForCharacters` works as expected, in theory we shouldn't
get infinite recursion since `lookupFont` calls the same function, but
just for safety and to avoid potential subtle interactions, just kill
the recursion and directly draw the texts in the loop to make it easier
to reason through.
Fix #983.1 parent 1fedb06 commit 61c8fa4
1 file changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1710 | 1710 | | |
1711 | 1711 | | |
1712 | 1712 | | |
1713 | | - | |
| 1713 | + | |
1714 | 1714 | | |
1715 | 1715 | | |
1716 | 1716 | | |
| |||
1720 | 1720 | | |
1721 | 1721 | | |
1722 | 1722 | | |
| 1723 | + | |
| 1724 | + | |
1723 | 1725 | | |
| 1726 | + | |
1724 | 1727 | | |
1725 | 1728 | | |
1726 | 1729 | | |
| |||
1737 | 1740 | | |
1738 | 1741 | | |
1739 | 1742 | | |
| 1743 | + | |
1740 | 1744 | | |
1741 | 1745 | | |
1742 | 1746 | | |
| |||
1840 | 1844 | | |
1841 | 1845 | | |
1842 | 1846 | | |
| 1847 | + | |
| 1848 | + | |
1843 | 1849 | | |
1844 | 1850 | | |
1845 | 1851 | | |
| |||
1897 | 1903 | | |
1898 | 1904 | | |
1899 | 1905 | | |
1900 | | - | |
| 1906 | + | |
1901 | 1907 | | |
1902 | 1908 | | |
1903 | 1909 | | |
1904 | 1910 | | |
1905 | 1911 | | |
1906 | 1912 | | |
1907 | 1913 | | |
1908 | | - | |
1909 | | - | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
1910 | 1919 | | |
| 1920 | + | |
1911 | 1921 | | |
1912 | 1922 | | |
1913 | 1923 | | |
| |||
0 commit comments