TextView.st
changeset 4569 f2d3ecfde0ff
parent 4567 33be833bfcbf
child 4571 71dcd3c025bc
equal deleted inserted replaced
4568:cf9f6fd6d174 4569:f2d3ecfde0ff
  2569     "get some info of the used font. They are cached since we use them often ..
  2569     "get some info of the used font. They are cached since we use them often ..
  2570      This is redefined here, to use the fonts maxHeight/maxAscent for
  2570      This is redefined here, to use the fonts maxHeight/maxAscent for
  2571      line separation. This is required, to allow for proper handling of
  2571      line separation. This is required, to allow for proper handling of
  2572      national characters, such as A-dieresis ..."
  2572      national characters, such as A-dieresis ..."
  2573 
  2573 
  2574     |italicFont boldFont|
  2574     |italicFont boldFont fA iA bA|
  2575 
  2575 
  2576     font := font onDevice:device.
  2576     font := font onDevice:device.
  2577     italicFont := font asItalic onDevice:device.
  2577     italicFont := font asItalic onDevice:device.
  2578     boldFont := font asBold onDevice:device.
  2578     boldFont := font asBold onDevice:device.
  2579 
  2579 
  2580     includesNonStrings == true ifTrue:[
  2580     includesNonStrings == true ifTrue:[
  2581 	"/ for now, we do not support variable height entries ...
  2581         "/ for now, we do not support variable height entries ...
  2582 	fontHeight := list first heightOn:self
  2582         fontHeight := list first heightOn:self
  2583     ] ifFalse:[
  2583     ] ifFalse:[
  2584 	fontHeight := font maxHeight max:(italicFont maxHeight max:(boldFont maxHeight)).
  2584         fontHeight := font maxHeight max:(italicFont maxHeight max:(boldFont maxHeight)).
       
  2585         "/ fontHeight := font height "maxHeight" max:(italicFont height "maxHeight" max:(boldFont height "maxHeight")).
  2585     ].
  2586     ].
  2586     fontHeight := fontHeight + lineSpacing.
  2587     fontHeight := fontHeight + lineSpacing.
  2587     fontAscent := font maxAscent max:(italicFont maxAscent max:(boldFont maxAscent)).
  2588     "/ fontAscent := font ascent "maxAscent" max:(italicFont ascent "maxAscent" max:(boldFont ascent "maxAscent")).
       
  2589     fA := font ascent. "/ (font maxAscent + font ascent) // 2. 
       
  2590     iA := italicFont ascent. "/ (italicFont maxAscent + italicFont ascent) // 2. 
       
  2591     bA := boldFont ascent. "/ (boldFont maxAscent + boldFont ascent) // 2. 
       
  2592     fontAscent := fA max:(iA max:bA).
  2588     fontWidth := font width.
  2593     fontWidth := font width.
  2589     fontIsFixedWidth := font isFixedWidth and:[ italicFont isFixedWidth and:[ boldFont isFixedWidth ]].
  2594     fontIsFixedWidth := font isFixedWidth and:[ italicFont isFixedWidth and:[ boldFont isFixedWidth ]].
  2590 
  2595 
  2591     "Modified: 22.5.1996 / 12:02:47 / cg"
  2596     "Modified: 22.5.1996 / 12:02:47 / cg"
  2592     "Created: 22.5.1996 / 12:18:34 / cg"
  2597     "Created: 22.5.1996 / 12:18:34 / cg"
  4828 ! !
  4833 ! !
  4829 
  4834 
  4830 !TextView class methodsFor:'documentation'!
  4835 !TextView class methodsFor:'documentation'!
  4831 
  4836 
  4832 version
  4837 version
  4833     ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.350 2013-04-25 13:11:43 stefan Exp $'
  4838     ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.351 2013-04-26 09:46:46 cg Exp $'
  4834 !
  4839 !
  4835 
  4840 
  4836 version_CVS
  4841 version_CVS
  4837     ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.350 2013-04-25 13:11:43 stefan Exp $'
  4842     ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.351 2013-04-26 09:46:46 cg Exp $'
  4838 ! !
  4843 ! !
  4839 
  4844 
  4840 
  4845 
  4841 TextView initialize!
  4846 TextView initialize!