Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-07

video unit and pseudo-graphic characters on Windows

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Calinov Valentin

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.

Reply by email

Howard Page-Clark
to Calinov Valentin
Calinov Valentin wrote 10 lines
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 ?

Many fonts lack graphics for certain code points, particularly code points that are not not normally used for text. Points lacking in a font are substituted by Windows with squares or ?? if you force display of a character the font lacks. "Raster Fonts" is one of the few, as you discovered, that supplies graphs for unusual code points.

Reply by email

Valentin Calinov
to Howard Page-Clark
Howard Page-Clark wrote 12 lines
On 04/7/11 7:16, Calinov Valentin wrote: Many fonts lack graphics for certain code points, particularly code points that are not not normally used for text. Points lacking in a font are substituted by Windows with squares or ?? if you force display of a character the font lacks. "Raster Fonts" is one of the few, as you discovered, that supplies graphs for unusual code points. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

But this program, that does not use video unit, correctly displays pseudo-graphic characters even for "Lucida Console" font, so I think my problem has something to do with InitVideo procedure.

program test2;
var
   i: Integer;
   S: String;
begin
   S := 'Some pseudo-graphic chars: ';
   for i := 10 to 20 do
     S := S + chr(i);
   Writeln(S);
   readln;
end.

Reply by email