diff --git a/src/conio/cterm.c b/src/conio/cterm.c index 62dfbcc1bd4d2dbf4708a73ffe533d431bb10e24..a29fa997f30e5cd6863379bc1e85684fee223ddc 100644 --- a/src/conio/cterm.c +++ b/src/conio/cterm.c @@ -527,14 +527,31 @@ void do_ansi(char *retbuf, size_t retsize, int *speed) i=cterm.width; gotoxy(i,wherey()); break; - case 'D': /* Cursor Left */ - i=atoi(cterm.escbuf+1); - if(i==0) - i=1; - i=wherex()-i; - if(i<1) - i=1; - gotoxy(i,wherey()); + case 'D': /* Cursor Left and Font Select */ + if(*(p-1)==' ') { /* Font Select */ + i=0; + j=0; + if(strlen(cterm.escbuf)>2) { + if((p=strtok(cterm.escbuf+1,";"))!=NULL) { + i=atoi(p); + if((p=strtok(NULL,";"))!=NULL) { + j=atoi(p); + } + } + if(i==0) { /* Only the primary font is currently supported */ + setfont(j,FALSE); + } + } + } + else { + i=atoi(cterm.escbuf+1); + if(i==0) + i=1; + i=wherex()-i; + if(i<1) + i=1; + gotoxy(i,wherey()); + } break; case 'E': i=atoi(cterm.escbuf+1); diff --git a/src/conio/cterm.txt b/src/conio/cterm.txt index e087f55f35c8b2ab5a7a1e43cd4a2b4fb6f32a9e..278fbc394a9611cfb17aba1380cb18280cd626e8 100644 --- a/src/conio/cterm.txt +++ b/src/conio/cterm.txt @@ -160,6 +160,48 @@ CSI [ p1 ] D SOURCE: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf +CSI [ p1 [ ; p2 ] ] sp D + Font Selection + Defaults: p1 = 0 p2 = 0 + Sets font p1 to be the one indicated bu p2. Currently only the primary font + (Font zero) is supported. p2 must be between 0 and 255. Not all output types + support font selection. Only X11 and SDL currently do. + Currently included fonts are: + 0 - Codepage 437 English + 1 - Codepage 1251 Cyrillic, (swiss) + 2 - Russian koi8-r + 3 - ISO-8859-2 Central European + 4 - ISO-8859-4 Baltic wide (VGA 9bit mapped) + 5 - Codepage 866 (c) Russian + 6 - ISO-8859-9 Turkish + 7 - haik8 codepage (use only with armscii8 screenmap) + 8 - ISO-8859-8 Hebrew + 9 - Ukrainian font koi8-u + 10 - ISO-8859-15 West European, (thin) + 11 - ISO-8859-4 Baltic (VGA 9bit mapped) + 12 - Russian koi8-r (b) + 13 - ISO-8859-4 Baltic wide + 14 - ISO-8859-5 Cyrillic + 15 - ARMSCII-8 Character set + 16 - ISO-8859-15 West European + 17 - Codepage 850 Multilingual Latin I, (thin) + 18 - Codepage 850 Multilingual Latin I + 19 - Codepage 885 Norwegian, (thin) + 20 - Codepage 1251 Cyrillic + 21 - ISO-8859-7 Greek + 22 - Russian koi8-r (c) + 23 - ISO-8859-4 Baltic + 24 - ISO-8859-1 West European + 25 - Codepage 866 Russian + 26 - Codepage 437 English, (thin) + 27 - Codepage 866 (b) Russian + 28 - Codepage 885 Norwegian + 29 - Ukrainian font cp866u + 30 - ISO-8859-1 West European, (thin) + 31 - Codepage 1131 Belarusian, (swiss) + Not all fonts are supported in all modes. If a font is not supported in the + current mode, no action is taken. + CSI [ p1 ] E Cursor Next Line Defaults: p1 = 1