XftFontDescription.st
changeset 6631 b54e8a89dbdc
parent 6587 c1790bb9af59
child 6636 2603da69ccf0
child 6656 830e1f335aca
equal deleted inserted replaced
6630:81c3e5842617 6631:b54e8a89dbdc
  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
  2063 ! !
  2063 ! !
  2064 
  2064 
  2065 !XftFontDescription class methodsFor:'documentation'!
  2065 !XftFontDescription class methodsFor:'documentation'!
  2066 
  2066 
  2067 version
  2067 version
  2068     ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.61 2014-11-12 12:14:33 ab Exp $'
  2068     ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.62 2014-11-27 00:12:23 cg Exp $'
  2069 !
  2069 !
  2070 
  2070 
  2071 version_CVS
  2071 version_CVS
  2072     ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.61 2014-11-12 12:14:33 ab Exp $'
  2072     ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.62 2014-11-27 00:12:23 cg Exp $'
  2073 ! !
  2073 ! !
  2074 
  2074 
  2075 
  2075 
  2076 XftFontDescription initialize!
  2076 XftFontDescription initialize!