summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2018-02-04 00:16:35 -0600
committerepoch <epoch@hacking.allowed.org>2018-02-04 00:16:35 -0600
commite4aef14badad692612dd369e3bd35976009e11d8 (patch)
tree6749a81c38abcab6b7ecb477d4508dcb742277b5
parentff335e7cdb4b334ca63db9f534da34896cabdeec (diff)
downloadhackvr-e4aef14badad692612dd369e3bd35976009e11d8.tar.gz
hackvr-e4aef14badad692612dd369e3bd35976009e11d8.zip
hackvr_term.c now uses defined font width and height
-rw-r--r--hackvr_term/hackvr_term.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/hackvr_term/hackvr_term.c b/hackvr_term/hackvr_term.c
index b7a5b40..175680f 100644
--- a/hackvr_term/hackvr_term.c
+++ b/hackvr_term/hackvr_term.c
@@ -5,6 +5,15 @@
#include <errno.h>
#include "libtmt/tmt.h"
+//these numbers include the space between characters
+//apple401 font is this wide:
+//#define FONTW 14
+//#define FONTH 16
+
+//epoch font is this wide:
+#define FONTW 6
+#define FONTH 10
+
void hackvr_draw_character(int c,int r,const TMTCHAR *ch) {
int i;
FILE *fp;
@@ -19,13 +28,13 @@ void hackvr_draw_character(int c,int r,const TMTCHAR *ch) {
printf("# fail to open font\n");
return;
}
- printf("term_%02d_%02d addshape %d 4 -1 -3 0 5 -3 0 5 7 0 -1 7 0\n",c,r,ch->a.bg+15);
+ //printf("term_%02d_%02d addshape %d 4 -1 -3 0 5 -3 0 5 7 0 -1 7 0\n",c,r,ch->a.bg+15);
for(i=0;fgets(line,sizeof(line)-1,fp) != 0;i++) {
if(!strncmp(str,line,2)) {
printf("term_%02d_%02d addshape %d %s",c,r,ch->a.fg==-1?2:ch->a.fg+15,line+strlen("XX addshape X "));
}
}
- if(i) printf("term_%02d_%02d move %d %d 0\n",c,r,c*6,-r*10);
+ if(i) printf("term_%02d_%02d move %d %d 0\n",c,r,c*FONTW,-r*FONTH);
fclose(fp);
}