Documentation Project 1
ContentsIndexHome
PreviousUpNext
sack::containers::text::format_info_tag Structure
C++
struct format_info_tag {
  struct {
    _32 prior_foreground : 1;
    _32 prior_background : 1;
    _32 default_foreground : 1;
    _32 default_background : 1;
    _32 foreground : 4;
    _32 background : 4;
    _32 blink : 1;
    _32 reverse : 1;
    _32 highlight : 1;
    _32 tall : 1;
    _32 bold : 1;
    _32 underline : 1;
    _32 strike : 1;
    _32 wide : 1;
    _32 italic : 1;
    _32 bVertical : 1;
    _32 bInvert : 1;
    _32 bAlign : 2;
    _32 format_op : 7;
  } flags;
  union {
    struct {
      S_16 x;
      S_16 y;
    } coords;
    struct {
      _16 tabs;
      _16 spaces;
    }
  } position;
};
Members 
Description 
struct {
_32 prior_foreground : 1;
_32 prior_background : 1;
_32 default_foreground : 1;
_32 default_background : 1;
_32 foreground : 4;
_32 background : 4;
_32 blink : 1;
_32 reverse : 1;
_32 highlight : 1;
_32 tall : 1;
_32 bold : 1;
_32 underline : 1;
_32 strike : 1;
_32 wide : 1;
_32 italic : 1;
_32 bVertical : 1;
_32 bInvert : 1;
_32 bAlign : 2;
_32 format_op : 7;
} flags; 
bit-packed flags indicating the type of format information that is applied to this segment. 
_32 prior_foreground : 1; 
extended operation from enumeration above... might shrink if more attributes are desired... if many more are needed, one might consider adding FONT! this segment uses the prior foreground, not its own. 
_32 prior_background : 1; 
this segment uses the prior background, not its own. 
_32 default_foreground : 1; 
this segment uses the default foreground, not its own. 
_32 default_background : 1; 
this segment uses the default background, not its own. 
_32 foreground : 4; 
the foreground color of this segment (0-16 standard console text [ANSI text]) 
_32 background : 4; 
the background color of this segment (0-16 standard console text [ANSI text]) 
_32 blink : 1; 
a bit indicating the text should blink if supported 
_32 reverse : 1; 
a bit indicating the foreground and background color should be reversed 
_32 highlight : 1; 
usually highly is bolder, perhaps it's a highlighter effect and changes the background 
_32 tall : 1; 
this is double height modifications to the font... 
_32 bold : 1; 
this is thicker characters... 
_32 underline : 1; 
draw a line under the text... 
_32 strike : 1; 
strike through - if able, draw a line right through the middle of the text... maybe it's a wiggly scribble line? maybe that could be extended again? 
_32 wide : 1; 
text is drawn wide (printer kinda font?) 
_32 italic : 1; 
this is pretty common...... 
_32 bVertical : 1; 
these flags are free, but since we already have text segments and I'm bringing in consoles, perhaps we should consider using this to describe captions, but provide the api layer for CTEXTSTRposition data remains constant. text is mounted at the top/left of the first character... (unless center, then the position specifies the middle of the text draw vertical instead of horizontal 
_32 bInvert : 1; 
draw opposite/upside down from normal vertical/down, right/left upside down if not centered if centered, the text pivots around position. 
_32 bAlign : 2; 
0 = default alignment 1 = left, 2 = center 3 = right 0 is not set, the flag set in the lower 32 bit flags is not needed any longer.... anything non zero is that operation to apply. 
_32 format_op : 7; 
format op indicates one of the enum FORMAT_OPS applies to this segment 
union {
struct {
S_16 x;
S_16 y;
} coords;
struct {
_16 tabs;
_16 spaces;
}
} position; 
if x,y are valid segment will have TF_POSFORMAT set... 
struct {
S_16 x;
S_16 y;
} coords; 
Coordinate information attached to a text segment. Positioning specification of this text segment. with basically 0 format options, position is used.
Position represents the distance from this segment to the prior segment in count of tabs and spaces.
coords specifies an x,y coordinate location for the segment.

Usage of this union is dependant on format_op
S_16 x; 
Signed coordinate of this segment on a text display. May be relative depending on format_op. 
S_16 y; 
Signed coordinate of this segment on a text display. May be relative depending on format_op. 
_16 tabs; 
tabs preceed spaces.... 
_16 spaces; 
not sure what else to put with this... 

extended position, added more information reduced color, 16 colors is really all that there are... 4 bits... added bits for extended formatting like blink, bold, wide, high foreground/background values will be sufficient... they retain full informaiton

Copyright (c) 2010. All rights reserved.
What do you think about this topic? Send feedback!