summaryrefslogtreecommitdiff
path: root/sys/src/cmd/unix/drawterm/libmemdraw/defont.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2013-11-23 01:05:33 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2013-11-23 01:05:33 +0100
commit2f9ae0f8ac8610e13ced184847b57b87fe5db580 (patch)
treef9ad2223d518585a2cfe9ea1c73e1e37d07bf637 /sys/src/cmd/unix/drawterm/libmemdraw/defont.c
parentea5797c0731203c09ec5fb7172e77eab2750f1a9 (diff)
removing (outdated) drawterm
drawterm is much better maintained by russ cox, so removing this outdated copy. for a more recent version, go to: http://swtch.com/drawterm/
Diffstat (limited to 'sys/src/cmd/unix/drawterm/libmemdraw/defont.c')
-rw-r--r--sys/src/cmd/unix/drawterm/libmemdraw/defont.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/sys/src/cmd/unix/drawterm/libmemdraw/defont.c b/sys/src/cmd/unix/drawterm/libmemdraw/defont.c
deleted file mode 100644
index 3b0805c46..000000000
--- a/sys/src/cmd/unix/drawterm/libmemdraw/defont.c
+++ /dev/null
@@ -1,68 +0,0 @@
-#include <u.h>
-#include <libc.h>
-#include <draw.h>
-#include <memdraw.h>
-
-Memsubfont*
-getmemdefont(void)
-{
- char *hdr, *p;
- int n;
- Fontchar *fc;
- Memsubfont *f;
- int ld;
- Rectangle r;
- Memdata *md;
- Memimage *i;
-
- /*
- * make sure data is word-aligned. this is true with Plan 9 compilers
- * but not in general. the byte order is right because the data is
- * declared as char*, not ulong*.
- */
- p = (char*)defontdata;
- n = (uintptr)p & 3;
- if(n != 0){
- memmove(p+(4-n), p, sizeofdefont-n);
- p += 4-n;
- }
- ld = atoi(p+0*12);
- r.min.x = atoi(p+1*12);
- r.min.y = atoi(p+2*12);
- r.max.x = atoi(p+3*12);
- r.max.y = atoi(p+4*12);
-
- md = mallocz(sizeof(Memdata), 1);
- if(md == nil)
- return nil;
-
- p += 5*12;
-
- md->base = nil; /* so freememimage doesn't free p */
- md->bdata = (uchar*)p; /* ick */
- md->ref = 1;
- md->allocd = 1; /* so freememimage does free md */
-
- i = allocmemimaged(r, drawld2chan[ld], md, nil);
- if(i == nil){
- free(md);
- return nil;
- }
-
- hdr = p+Dy(r)*i->width*sizeof(ulong);
- n = atoi(hdr);
- p = hdr+3*12;
- fc = malloc(sizeof(Fontchar)*(n+1));
- if(fc == 0){
- freememimage(i);
- return 0;
- }
- _unpackinfo(fc, (uchar*)p, n);
- f = allocmemsubfont("*default*", n, atoi(hdr+12), atoi(hdr+24), fc, i);
- if(f == 0){
- freememimage(i);
- free(fc);
- return 0;
- }
- return f;
-}