mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 00:09:26 +02:00
o another linux console patch by Nikolay Nikolov:
* disabled linux VCSA output in UTF-8 mode, because it does not do any translation and assumes that the font is cp437, or similar, which looks horrible on fonts (like fedora's default latarcyrheb-sun16), which are designed only for unicode support and have no similarity at all to cp437. We already can display all the cp437 characters in UTF-8 mode (including the low 32 characters), in case the font is cp437, and the UTF-8 translation provides better approximation (e.g. for the line drawing characters) if the font is not cp437. * do not "restore" the linux system font in SysDoneVideo in UTF-8 mode, since we didn't change the font on startup * added try_grab_vcsa to try harder to open VCSA in the linux IDE user screen restore code. While VCSA is no longer needed in the video unit on UTF-8 systems, the IDE still needs it, because it's the only way to provide the "restore user screen" functionality on the linux virtual console. git-svn-id: trunk@13726 -
This commit is contained in:
parent
24889df6ed
commit
07ef0c33df
@ -24,6 +24,9 @@ uses
|
|||||||
{$ifdef Unix}
|
{$ifdef Unix}
|
||||||
baseunix,
|
baseunix,
|
||||||
termio,
|
termio,
|
||||||
|
{$ifdef linux}
|
||||||
|
linuxvcs,
|
||||||
|
{$endif}
|
||||||
{$endif}
|
{$endif}
|
||||||
video,Objects;
|
video,Objects;
|
||||||
|
|
||||||
@ -755,10 +758,17 @@ begin
|
|||||||
Case ThisTTY[9] of
|
Case ThisTTY[9] of
|
||||||
'0'..'9' :
|
'0'..'9' :
|
||||||
begin { running Linux on native console or native-emulation }
|
begin { running Linux on native console or native-emulation }
|
||||||
|
{$ifdef linux}
|
||||||
FName:='/dev/vcsa' + ThisTTY[9];
|
FName:='/dev/vcsa' + ThisTTY[9];
|
||||||
TTYFd:=fpOpen(FName, &666, O_RdWr); { open console }
|
TTYFd:=fpOpen(FName, &666, O_RdWr); { open console }
|
||||||
|
if TTYFd = -1 then
|
||||||
|
begin
|
||||||
|
if try_grab_vcsa then
|
||||||
|
TTYFd:=fpOpen(FName, &666, O_RdWr); { try again }
|
||||||
|
end;
|
||||||
If TTYFd <>-1 Then
|
If TTYFd <>-1 Then
|
||||||
Console:=ttyLinux;
|
Console:=ttyLinux;
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
'v' : { check for (Free?)BSD native}
|
'v' : { check for (Free?)BSD native}
|
||||||
If (ThisTTY[10]>='0') and (ThisTTY[10]<='9') Then
|
If (ThisTTY[10]>='0') and (ThisTTY[10]<='9') Then
|
||||||
|
@ -1078,7 +1078,7 @@ begin
|
|||||||
if UTF8Enabled then
|
if UTF8Enabled then
|
||||||
external_codepage:=utf8;
|
external_codepage:=utf8;
|
||||||
{$ifdef linux}
|
{$ifdef linux}
|
||||||
if vcs_device>=0 then
|
if (vcs_device>=0) and (external_codepage<>utf8) then
|
||||||
begin
|
begin
|
||||||
str(vcs_device,s);
|
str(vcs_device,s);
|
||||||
fname:='/dev/vcsa'+s;
|
fname:='/dev/vcsa'+s;
|
||||||
@ -1231,8 +1231,14 @@ begin
|
|||||||
begin
|
begin
|
||||||
{Executed in case ttylinux is false (i.e. no vcsa), but
|
{Executed in case ttylinux is false (i.e. no vcsa), but
|
||||||
TERM=linux.}
|
TERM=linux.}
|
||||||
{Enable the character set set through setfont}
|
|
||||||
fpwrite(stdoutputhandle,font_custom,3);
|
{ if we're in utf8 mode, we didn't change the font, so
|
||||||
|
no need to restore anything }
|
||||||
|
if external_codepage<>utf8 then
|
||||||
|
begin
|
||||||
|
{Enable the character set set through setfont}
|
||||||
|
fpwrite(stdoutputhandle,font_custom,3);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
{$ifdef linux}
|
{$ifdef linux}
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user