3 #ifndef OUTPUT_BUFFER_SIZE
4 #define OUTPUT_BUFFER_SIZE 1024
15 static const FB_TCHAR achTabSpaces[8] = { 32, 32, 32, 32, 32, 32, 32, 32 };
17 size_t OutputBufferLength = 0, OutputBufferChars = 0;
23 int fGotNewCoordinate =
FALSE;
24 int BorderWidth = pBorder->
Right - pBorder->
Left + 1;
28 memcpy( &dwCurrentCoord, pCoord,
sizeof(
fb_Coord ) );
31 for( IndexText=0; IndexText!=TextLength; ++IndexText )
33 const FB_TCHAR *pachOutputData = pachText;
34 size_t OutputDataLength = 0, OutputDataChars = 0;
36 int fSetNewCoord =
FALSE;
49 if( dwCurrentCoord.
X > pBorder->
Left ) {
61 dwMoveCoord.
X = pBorder->
Left - dwCurrentCoord.
X;
72 dwMoveCoord.
X = pBorder->
Left - dwCurrentCoord.
X;
78 pachOutputData = achTabSpaces;
81 ((dwCurrentCoord.
X - pBorder->
Left + 8) & ~7) -
82 (dwCurrentCoord.
X - pBorder->
Left);
93 }
else if( fSetNewCoord ) {
99 if( OutputBufferLength!=0 ) {
103 OutputBufferLength = OutputBufferChars = 0;
104 fGotNewCoordinate =
FALSE;
109 fSetNewCoord =
FALSE;
110 pCoord->
X += dwMoveCoord.
X;
111 pCoord->
Y += dwMoveCoord.
Y;
112 memcpy( &dwCurrentCoord, pCoord,
sizeof(
fb_Coord ) );
113 fGotNewCoordinate =
TRUE;
116 if( OutputDataLength!=0 ) {
117 dwCurrentCoord.
X += OutputDataChars;
118 if( dwCurrentCoord.
X > pBorder->
Right ) {
119 int NormalX = dwCurrentCoord.
X - pBorder->
Left;
120 dwCurrentCoord.
X = (NormalX % BorderWidth) + pBorder->
Left;
121 dwCurrentCoord.
Y += NormalX / BorderWidth;
123 while( OutputDataLength-- ) {
124 OutputBuffer[OutputBufferLength++] = *pachOutputData++;
126 OutputBufferChars += OutputDataChars;
132 if( OutputBufferLength!=0 )
136 else if( fGotNewCoordinate )