mirror of
https://github.com/rricharz/Tek4010.git
synced 2026-04-13 23:44:51 +00:00
version 1.3.3, see versions.txt
This commit is contained in:
@@ -265,6 +265,10 @@ directory, type
|
||||
cd apl
|
||||
sudo install_apl
|
||||
|
||||
You should see the following line displayed:
|
||||
|
||||
/usr/share/fonts/truetype/apl385/Apl385.ttf: APL385 Unicode:style=Regular
|
||||
|
||||
While still being in the apl directory, you can test the APL character set using
|
||||
|
||||
../tek4010 -APL -noexit ./apltest
|
||||
|
||||
BIN
apl/apltest
BIN
apl/apltest
Binary file not shown.
@@ -26,7 +26,7 @@ int main (int argc, char *argv[])
|
||||
}
|
||||
printf("%c", ch);
|
||||
}
|
||||
printf("\noverstrike test");
|
||||
printf("\n\noverstrike test");
|
||||
putchar(62); putchar(32);
|
||||
putchar(79); putchar(8); putchar(63); putchar(32);
|
||||
putchar(76); putchar(8); putchar(43);
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
mkdir /usr/share/fonts/truetype/apl385
|
||||
cp Apl385.ttf /usr/share/fonts/truetype/apl385
|
||||
|
||||
fc-cache /usr/share/fonts
|
||||
fc-cache /usr/share/fonts
|
||||
fc-list 'APL385 Unicode'
|
||||
6
main.c
6
main.c
@@ -181,12 +181,12 @@ static void on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer user_da
|
||||
}
|
||||
else if (argAPL && (event->keyval == 0x006E)) { // "<ctrl>n" switch to alternative character set
|
||||
aplMode = 1;
|
||||
printf("Setting APL mode to 1 from keyboard\n");
|
||||
// printf("Setting APL mode to 1 from keyboard\n");
|
||||
return;
|
||||
}
|
||||
else if (argAPL && (event->keyval == 0x006F)) { // "<ctrl>o" switch to normalcharacter set
|
||||
aplMode = 0;
|
||||
printf("Setting APL mode to 0 from keyboard\n");
|
||||
// printf("Setting APL mode to 0 from keyboard\n");
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -207,7 +207,7 @@ static void on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer user_da
|
||||
}
|
||||
|
||||
else if (putKeys) {
|
||||
if (aplMode) printf("sending character %d to host\n", ch);
|
||||
// if (aplMode) printf("sending character %d to host\n", ch);
|
||||
putc(ch,putKeys); // pipe key to child process, if stream open
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ void tek4010_escapeCodeHandler(cairo_t *cr, cairo_t *cr2, int ch)
|
||||
case 14: // SO activate alternative char set
|
||||
if (argAPL) { // switch only of argAPL is set
|
||||
aplMode = 1;
|
||||
printf("Setting APL mode to 1 from computer\n");
|
||||
// printf("Setting APL mode to 1 from computer\n");
|
||||
}
|
||||
mode = 0;
|
||||
todo = 0;
|
||||
@@ -214,7 +214,7 @@ void tek4010_escapeCodeHandler(cairo_t *cr, cairo_t *cr2, int ch)
|
||||
aplMode = 0;
|
||||
mode = 0;
|
||||
todo = 0;
|
||||
printf("Setting APL mode to 0 from computer\n");
|
||||
// printf("Setting APL mode to 0 from computer\n");
|
||||
break;
|
||||
|
||||
case 23: system("scrot --focussed"); mode= 0; break;
|
||||
@@ -358,7 +358,7 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int first)
|
||||
if (mode != 60) return; // no char available, need to allow for updates
|
||||
}
|
||||
|
||||
if (aplMode) printf("Receiving character %d from host\n", ch);
|
||||
// if (aplMode) printf("Receiving character %d from host\n", ch);
|
||||
|
||||
if (DEBUG) {
|
||||
printf("mode=%d, ch code %02X",mode,ch);
|
||||
|
||||
31
tube.c
31
tube.c
@@ -177,13 +177,41 @@ int tube_getInputChar()
|
||||
return -1;
|
||||
}
|
||||
|
||||
void checkFont(char *fontName)
|
||||
// check whether font has been installed
|
||||
{
|
||||
#define MAXL 255
|
||||
FILE *f;
|
||||
int i, ch;
|
||||
char line[MAXL];
|
||||
sprintf(line,"fc-list \'%s\'", fontName); // prepare system call
|
||||
f = popen(line, "r");
|
||||
if (f != NULL) {
|
||||
i = 0;
|
||||
line[0] = 0;
|
||||
while (((ch=fgetc(f))!=EOF) && (i<MAXL-1)) {
|
||||
line[i++] = ch;
|
||||
}
|
||||
line[i-1]=0;
|
||||
// printf("%s\n",line);
|
||||
if (strstr(line, fontName) > 0) {
|
||||
pclose(f);
|
||||
return;
|
||||
}
|
||||
}
|
||||
pclose(f);
|
||||
printf("Error: APL font \'%s\' not installed. This font is required for the APL mode.\n", fontName);
|
||||
printf("See github.com/rricharz/tek4010 paragraph \'APL mode\'\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void tube_init(int argc, char* argv[])
|
||||
// put any code here to initialize the tek4010
|
||||
{
|
||||
char *argv2[20];
|
||||
size_t bufsize = 127;
|
||||
int firstArg = 1;
|
||||
printf("tek4010 version 1.3.2\n");
|
||||
printf("tek4010 version 1.3.3\n");
|
||||
windowName = "Tektronix 4010/4014 emulator";
|
||||
if ((argc<2) || (argc>19)) {
|
||||
printf("Error:number of arguments\n");
|
||||
@@ -220,6 +248,7 @@ void tube_init(int argc, char* argv[])
|
||||
else if (strcmp(argv[firstArg],"-APL") == 0) {
|
||||
argAPL = 1;
|
||||
windowName = "Tektronix 4013/4015 emulator (APL)";
|
||||
checkFont(APL_FONT);
|
||||
}
|
||||
else if (strcmp(argv[firstArg],"-ARDS") == 0) {
|
||||
argARDS = 1;
|
||||
|
||||
2
tube.h
2
tube.h
@@ -2,7 +2,7 @@
|
||||
|
||||
// fonts
|
||||
#define STANDARD_FONT "Monospace"
|
||||
#define APL_FONT "APL385 Unicode"
|
||||
#define APL_FONT "APL385 Unicode"
|
||||
|
||||
enum LineType {SOLID,DOTTED,DOTDASH,SHORTDASH,LONGDASH};
|
||||
extern enum LineType ltype;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
Version 1.3.3 May 12, 2019
|
||||
=========================
|
||||
New features
|
||||
- APL mode with APL character set added
|
||||
|
||||
Version 1.3.1 May 4, 2019
|
||||
=========================
|
||||
Bug fixes
|
||||
|
||||
Reference in New Issue
Block a user