[fpc-pascal] video unit and pseudo-graphic characters on Windows
Calinov Valentin
valentin.calinov at yahoo.com
Mon Jul 4 20:16:25 CEST 2011
Hi,
I need to display pseudo-graphic characters on Windows XP (English version) using video unit
from fpc-2.4.4 .
When I use "Raster Fonts" they are displayed correctly
but when I use "Lucida Console" font, small squares are displayed instead.
The current code page displayed by chcp command is 437.
Is there any workaround for "Lucida Console" font ?
To demonstrate the problem I wrote a small test program using TextOut procedure from rtl documentation:
program vid_test;
uses video;
procedure TextOut(X, Y: Word ; Const S: String);
var
W,P,I,M : Word;
begin
P := ((X - 1) + (Y - 1) * ScreenWidth);
M := Length(S) ;
If P + M > ScreenWidth * ScreenHeight then
M:= ScreenWidth * ScreenHeight - P;
for I := 1 to M do
VideoBuf^[P + I - 1] := Ord(S[i]) + ($07 shl 8);
UpdateScreen(False);
end;
var
i: Integer;
S: String;
begin
InitVideo;
S := 'Some pseudo-graphic chars: ';
for i := 10 to 20 do
S := S + chr(i);
TextOut(5, 5, S);
DoneVideo;
readln;
end.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110704/198e9598/attachment.html>
More information about the fpc-pascal
mailing list