1774 |readEntry list l fcListProg| |
1774 |readEntry list l fcListProg| |
1775 |
1775 |
1776 list := OrderedCollection new. |
1776 list := OrderedCollection new. |
1777 |
1777 |
1778 readEntry := |
1778 readEntry := |
1779 [ |
1779 [ |
1780 |key| |
1780 |key| |
1781 |
1781 |
1782 [l startsWith:'Pattern has'] whileFalse:[ |
1782 [l startsWith:'Pattern has'] whileFalse:[ |
1783 l := pipeStream nextLine. Transcript showCR:l. |
1783 l := pipeStream nextLine. Transcript showCR:l. |
1784 ]. |
1784 ]. |
1785 |
1785 |
1786 currentDescription := XftFontDescription new. |
1786 currentDescription := XftFontDescription new. |
1787 [ l := pipeStream nextLine. l notEmptyOrNil ] whileTrue:[ |
1787 [ l := pipeStream nextLine. l notEmptyOrNil ] whileTrue:[ |
1788 "/ Transcript showCR:l. |
1788 "/ Transcript showCR:l. |
1789 lineStream := l readStream. lineStream skipSeparators. |
1789 lineStream := l readStream. lineStream skipSeparators. |
1790 key := lineStream upToSeparator. |
1790 key := lineStream upToSeparator. |
1791 ( |
1791 ( |
1792 #('family:' 'style:' 'slant:' 'weight:' 'width:' |
1792 #('family:' 'style:' 'slant:' 'weight:' 'width:' |
1793 'pixelsize:' 'spacing:' 'foundry:' 'antialias:' |
1793 'pixelsize:' 'spacing:' 'foundry:' 'antialias:' |
1794 'file:' 'outline' 'scalable:' 'charset:' 'lang:' |
1794 'file:' 'outline' 'scalable:' 'charset:' 'lang:' |
1795 'fontversion:' 'fontformat:' 'decorative:' 'index:' |
1795 'fontversion:' 'fontformat:' 'decorative:' 'index:' |
1796 'outline:' 'familylang:' 'stylelang:' 'fullname:' |
1796 'outline:' 'familylang:' 'stylelang:' 'fullname:' |
1797 'fullnamelang:' 'capability:' 'hash:' 'postscriptname:' |
1797 'fullnamelang:' 'capability:' 'hash:' 'postscriptname:' |
1798 ) includes:key |
1798 ) includes:key |
1799 ) ifTrue:[ |
1799 ) ifTrue:[ |
1800 self perform:('fc_',(key allButLast)) asSymbol |
1800 self perform:('fc_',(key allButLast)) asSymbol |
1801 ] ifFalse:[ |
1801 ] ifFalse:[ |
1802 Transcript show:'Xft ignored line: '; showCR:l. |
1802 Transcript show:'Xft ignored line: '; showCR:l. |
1803 self breakPoint:#cg. |
1803 self breakPoint:#cg. |
1804 ]. |
1804 ]. |
1805 ]. |
1805 ]. |
1806 list add:currentDescription |
1806 list add:currentDescription |
1807 ]. |
1807 ]. |
1808 |
1808 |
1809 fcListProg := #('/usr/bin/fc-list' '/usr/X11/bin/fc-list') detect:[:eachProg| |
1809 fcListProg := #('/usr/bin/fc-list' '/usr/X11/bin/fc-list') detect:[:eachProg| |
1810 eachProg asFilename isExecutableProgram |
1810 eachProg asFilename isExecutableProgram |
1811 ] ifNone:[ |
1811 ] ifNone:[ |
1812 'fc-list program not found - no XFT fonts' infoPrintCR. |
1812 'XftFontDescription [warning]: fc-list program not found - no XFT fonts' errorPrintCR. |
1813 ^ list. |
1813 ^ list. |
1814 ]. |
1814 ]. |
1815 |
1815 |
1816 pipeStream := PipeStream readingFrom:fcListProg, ' -v'. |
1816 pipeStream := PipeStream readingFrom:fcListProg, ' -v'. |
1817 [ |
1817 [ |
1818 [pipeStream atEnd] whileFalse:[ |
1818 [pipeStream atEnd] whileFalse:[ |
1819 l := pipeStream nextLine. |
1819 l := pipeStream nextLine. |
1820 readEntry value. |
1820 readEntry value. |
1821 ] |
1821 ] |
1822 ] ensure:[ |
1822 ] ensure:[ |
1823 pipeStream close |
1823 pipeStream close |
1824 ]. |
1824 ]. |
1825 ^ list |
1825 ^ list |
1826 |
1826 |
1827 " |
1827 " |
1828 FCFontListParser new listOfAvailableFonts |
1828 FCFontListParser new listOfAvailableFonts |