unit attribute_coders;
{
Text attributes can (and should?) be encoded within the normal data stream.
For some kinds of text attributes, multiple attributes can apply to one character.
Some kinds of attributes cancel override each other.
Therefore, the buffer (view!) should keep track of where the attribute changes are (using text marks) and what kind of changes they are so that the view can ask "which attributes apply to position " with some kind of speed (neccessary for scrolling and nice-to-have anyhow).
Because the number of attributes that a human can distinguish in a single screen is limited anyhow, there is no need for a "full-color" attribute scheme but rather a "palette" attribute storage scheme is both sufficient and more practical.
The codes used within the data stream to encode an attribute reference should be short, however, in order to conserve RAM.
= Kinds of Attributes =
Font size
Font set
Foreground color
underline (multiple ones possible)
strike-through
italic
bold(ness)
set tab stop
box drawing
start table
start table row
start table column
end table column
end table row
end table
(Insert image)
= Representation =
attribute_definition := pair(attribute_type_and_kind, attribute_parameters)
attribute_reference := ??? backreference (as in " attribute definitions back", possibly encoded in as few bits as possible?) or something more sophisticated?
}
interface
type
IAttributeProxy = interface
end;
TAttributeProxy = class(TInterfacedObject, ITextBuffer, IAttributeProxy, IInterface)
end;
TAttributeMark = class(TTextMark, ITextMark, ICloneable, IInterface)
// TAttribute
end;
implementation
end.