Squeak Class Documentation category index | class index  
 
CharacterScanner
  category: Graphics-Text
  superclass: Object
  subclasses: CharacterBlockScanner CompositionScanner DisplayScanner CanvasCharacterScanner

My instances hold the state associated with scanning text. My subclasses scan characters for specified purposes, such as computing a CharacterBlock or placing characters into Forms.

instance methods
  as yet unclassified
  setYFor:

  initialize
  initialize
wantsColumnBreaks:

  private
  addEmphasis:
addKern:
initializeFromParagraph:clippedBy:
setActualFont:
setFont
setFont:
text:textStyle:
textColor:

  scanning
  characterNotInFont
columnBreak
handleIndentation
indentationLevel
indentationLevel:
leadingTab
placeEmbeddedObject:
plainTab
primScanCharactersFrom:to:in:rightX:stopConditions:kern:
scanCharactersFrom:to:in:rightX:stopConditions:kern:

class methods
  class initialization
  initialize

  instance creation
  new

instance methods
  as yet unclassified top  
 

setYFor:


  initialize top  
 

initialize


 

wantsColumnBreaks:


  private top  
 

addEmphasis:

Set the bold-ital-under-strike emphasis.


 

addKern:

Set the current kern amount.


 

initializeFromParagraph:clippedBy:


 

setActualFont:

Set the basal font to an isolated font reference.


 

setFont

Set the font and other emphasis.


 

setFont:

Set the font by number from the textStyle.


 

text:textStyle:


 

textColor:

Overridden in DisplayScanner


  scanning top  
 

characterNotInFont

Note: All fonts should have some sort of a character to glyph mapping.
If a character is not in the font it should be mapped to the appropriate
glyph (that is the glyph describing a non-existing character). If done
correctly, this method should never be called. It is mainly provided
for backward compatibility (and I'd really like to get rid of it - ar).

All fonts have an illegal character to be used when a character is not
within the font's legal range. When characters out of ranged are
encountered in scanning text, then this special character indicates the
appropriate behavior. The character is usually treated as a unary
message understood by a subclass of CharacterScanner.


 

columnBreak


 

handleIndentation


 

indentationLevel

return the number of tabs that are currently being placed at the beginning of each line


 

indentationLevel:

set the number of tabs to put at the beginning of each line


 

leadingTab

return true if only tabs lie to the left


 

placeEmbeddedObject:

Place the anchoredMorph or return false if it cannot be placed.
In any event, advance destX by its width.


 

plainTab

This is the basic method of adjusting destX for a tab.


 

primScanCharactersFrom:to:in:rightX:stopConditions:kern:

Primitive. This is the inner loop of text display--but see
scanCharactersFrom: to:rightX: which would get the string,
stopConditions and displaying from the instance. March through source
String from startIndex to stopIndex. If any character is flagged with a
non-nil entry in stops, then return the corresponding value. Determine
width of each character from xTable, indexed by map.
If dextX would exceed rightX, then return stops at: 258.
Advance destX by the width of the character. If stopIndex has been
reached, then return stops at: 257. Optional.
See Object documentation whatIsAPrimitive.


 

scanCharactersFrom:to:in:rightX:stopConditions:kern:

Primitive. This is the inner loop of text display--but see
scanCharactersFrom: to:rightX: which would get the string,
stopConditions and displaying from the instance. March through source
String from startIndex to stopIndex. If any character is flagged with a
non-nil entry in stops, then return the corresponding value. Determine
width of each character from xTable, indexed by map.
If dextX would exceed rightX, then return stops at: 258.
Advance destX by the width of the character. If stopIndex has been
reached, then return stops at: 257. Optional.
See Object documentation whatIsAPrimitive.


class methods
  class initialization top  
 

initialize

CharacterScanner initialize


  instance creation top  
 

new

Answer a new instance of the receiver (which is a class) with no indexable variables. Fail if the class is indexable.