TextStyle
Last updated at 1:54 pm UTC on 16 January 2006
Contains an array (fontArray) with instances of StrikeFont.
From the class comment: A textStyle comprises the formatting information for composing and displaying a unit (usually a paragraph) of text. Typically one makes a copy of a master textStyle (such as TextStyle default), and then that copy may get altered in the process of editing. Bad things can happen if you do not copy first.
Each of my instances consists of...
- fontArray
- An array of StrikeFonts
- fontFamilySize
- unused
- lineGrid
- An integer; default line spacing for paragraphs
- baseline
- An integer; default baseline (dist from line top to bottom of an 'a')
- alignment
- An integer; text alignment, see TextStyle alignment:
- firstIndent
- An integer; indent of first line in pixels
- restIndent
- An integer; indent of remaining lines in pixels
- rightIndent
- An integer; indent of right margin rel to section
- tabsArray
- An array of integers giving tab offsets in pixels
- marginTabsArray
- An array of margin tabs
- leading
- An integer giving default vertical line separation
For a concrete example, look at
TextStyle default copy inspect
Question February 20, 2004: I wanted to know something about a method you implemented in the past. I was implementing this method:
knownTextStylesWithoutDefault
"Answer the names of the known text styles, sorted in
alphabetical order without default"
"TextStyle knownTextStylesWithoutDefault"
| result |
result := self knownTextStyles asOrderedCollection.
result remove: #DefaultFixedTextStyle.
result remove: #DefaultTextStyle.
^ result
so that I can query all the styles and after I saw that you defined
actualTextStyles
| aDict |
"TextStyle actualTextStyles"
"Answer dictionary whose keys are the names of styles in the
system and whose values are the actual styles"
aDict _ TextConstants select: [:thang | thang isKindOf: self ].
aDict removeKey: #DefaultTextStyle.
aDict removeKey: #DefaultFixedTextStyle.
^ aDict
And now I'm confused because the dictionary that you return only contains one font (for example Accuat12 but not the ones that are possible for example Accuat18). So can you let me know the differences?
Answer Ned Konz You're getting confused between TextStyle and Font: TextStyles have one or more fonts in them.
see also TextConstants, TextStream