bogl-0.1.18/0000755000000000000000000000000011410000266007400 5ustar bogl-0.1.18/boml.c0000644000000000000000000007673411407777275010551 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #define _GNU_SOURCE 1 #include #include #include #include #include #include #include #include #include #include #include #include #include "bogl.h" #include "boml.h" #define M_GPM #define M_INPUT #ifdef M_GPM #include #include #endif #if defined __alpha__ #define M_SERIAL #define M_PS2 #elif defined __i386__ #define M_SERIAL #define M_PS2 #define M_MSBUS #elif defined __mc68000__ #define M_ADB #elif defined __powerpc__ #define M_SERIAL #define M_ADB #define M_PS2 #elif defined __sparc__ #define M_SUN #endif struct mouse; /* Packet drivers and detection routines. */ #define N_SERIAL 0 #define N_PS2 0 #define N_MSBUS 0 #define N_ADB 0 #define N_SUN 0 #ifdef M_GPM static int detect_gpm (void); # ifndef M_SERIAL # define M_SERIAL_MS static void ms_driver (struct mouse *); # endif #endif #ifdef M_INPUT # ifndef M_PS2 # define M_PS2_DRIVER static void ps2_driver (struct mouse *); # endif static int input_mouse_found = 0; static void detect_input (void); #endif #ifdef M_SERIAL #undef N_SERIAL #define N_SERIAL 8 #define M_SERIAL_MS static void detect_serial (void); static void ms_driver (struct mouse *); static void msc_driver (struct mouse *); static void mman_driver (struct mouse *); #endif /* These next three are actually the same protocol, but bind to different files in /dev. Thus they use bm_driver. */ #if defined(M_MSBUS) || defined(M_ADB) || defined(M_SUN) static void bm_driver (struct mouse *); #endif #ifdef M_MSBUS #undef N_MSBUS #define N_MSBUS 1 static void detect_msbus (void); #endif #ifdef M_ADB #undef N_ADB #define N_ADB 1 static void detect_adb (void); #endif #ifdef M_SUN #undef N_SUN #define N_SUN 1 static void detect_sun (void); #endif #ifdef M_PS2 #undef N_PS2 #define N_PS2 1 #define M_PS2_DRIVER static void detect_ps2 (void); static void ps2_driver (struct mouse *); #endif #define N_DETECT (N_SERIAL + N_MSBUS + N_PS2 + N_ADB + N_SUN) /* Detection progress. */ static void inc (void); static void (*detect_callback) (int); static int detect_count; /* Mouse types. */ enum { #ifdef M_SERIAL_MS /* Serial mice using the MS protocol */ T_MS_SERIAL, /* Microsoft. */ T_MS3_SERIAL, /* Microsoft Intellimouse. */ #endif #ifdef M_SERIAL /* Other serial mice. */ T_MSC_SERIAL, /* Mouse Systems. */ T_MMAN_SERIAL, /* Logitech Mouseman. */ #endif #ifdef M_MSBUS /* Bus mice. */ T_MS_BUS, /* Microsoft/Logitech. */ #endif #ifdef M_ADB T_ADB, /* Apple ADB */ #endif #ifdef M_SUN T_SUN, /* Sun */ #endif #ifdef M_PS2_DRIVER /* PS/2 mice. */ T_PS2, /* Generic. */ #endif }; /* Mouse attributes description. */ struct mouse_info { char *name; /* Name. */ int packet_size; /* (Initial) bytes per packet. */ unsigned char id[4]; /* Packet identification info. */ void (*driver) (struct mouse *); /* Packet driver. */ }; /* Some of the information below is borrowed from gpm. */ static struct mouse_info mouse_info[] = { #ifdef M_SERIAL_MS {"Microsoft serial", 3, {0x40,0x40,0x40,0x00}, ms_driver}, {"Microsoft Intellimouse serial", 4, {0xc0,0x40,0xc0,0x00}, ms_driver}, #endif #ifdef M_SERIAL {"Mouse Systems serial", 5, {0xf8,0x80,0x00,0x00}, msc_driver}, {"Mouseman serial", 3, {0xe0,0x80,0x80,0x00}, mman_driver}, #endif #ifdef M_MSBUS {"Microsoft bus", 3, {0xf8,0x80,0x00,0x00}, bm_driver}, #endif #ifdef M_ADB {"Apple Desktop Bus", 3, {0xf8,0x80,0x00,0x00}, bm_driver}, #endif #ifdef M_SUN {"Sun", 3, {0xf8,0x80,0x00,0x00}, bm_driver}, #endif #ifdef M_PS2_DRIVER {"Generic PS/2", 3, {0xc0,0x00,0x00,0x00}, ps2_driver}, #endif }; /* A mouse. */ struct mouse { struct mouse *next; /* Linked list. */ int type; /* Type of mouse, one of T_*. */ int fd; /* File descriptor. */ unsigned char pbuf[8]; /* Protocol buffer. */ int ppos; /* Number of bytes in buffer. */ int packet_size; /* Bytes per packet. */ }; /* All detected mice. */ static struct mouse *mice; /* Current mouse state. */ static int x, y; /* Pointer location. */ static int show; /* >0: Show the pointer. */ static int drawn; /* !=0: Pointer is currently drawn. */ static int button; /* Button down? */ /* Event queue. */ struct event { int type; /* One of BOML_E_*. */ int x; int y; int btn; }; /* Next or previous item in the queue after INDEX. */ #define q_next(INDEX) \ ((INDEX) + 1 < QUEUE_SIZE ? (INDEX) + 1 : 0) #define q_prev(INDEX) \ ((INDEX) > 0 ? (INDEX) - 1 : QUEUE_SIZE - 1) #define QUEUE_SIZE 8 static struct event queue[QUEUE_SIZE]; static int qh, qt; #ifdef M_SERIAL static int probe_com (char *port, int pnp); #endif static void state (int dx, int dy, int button); /* Mouse pointer. */ static const struct bogl_pointer *pointer; static int pointer_colors[2]; /* Public code. */ int boml_quick_init (void) { static int inited = 0; if (inited) return inited - 1; inited = 1; #ifdef M_GPM if(detect_gpm ()) { inited++; return (inited - 1); } #endif #ifdef M_INPUT detect_input (); if (input_mouse_found) { inited++; return (inited - 1); } #endif return (inited - 1); } /* Detects mice and initializes the mouse library. */ void boml_init (void (*callback) (int)) { /* Assure idempotence. */ static int inited = 0; if (inited) return; inited = 1; detect_callback = callback; detect_count = 0; #ifdef M_PS2 detect_ps2 (); inc (); #endif #ifdef M_MSBUS detect_msbus (); inc (); #endif #ifdef M_ADB detect_adb (); inc (); #endif #ifdef M_SUN detect_sun (); inc (); #endif #ifdef M_SERIAL detect_serial (); #endif } /* Calls the callback, if any, with a report of the progress of mouse detection in percent, incremented to the next mark (out of N_DETECT marks total). */ static void inc (void) { detect_count++; if (detect_callback) detect_callback (100 * detect_count / N_DETECT); } /* Reads mouse activities from the proper port and update the screen pointer position. */ void boml_refresh (void) { int sx = x; int sy = y; /* How many bytes to read at once */ int howmany = 1; struct mouse *mouse; for (mouse = mice; mouse; mouse = mouse->next) { struct mouse_info *minfo = &mouse_info[mouse->type]; fcntl (mouse->fd, F_SETFL, O_NONBLOCK); /* On bus mice (which means also all m68k mice) we have to read three bytes instead of one... This might be true of other mice as well. */ #if defined(M_ADB) if (mouse->type == T_ADB) howmany = 3; #endif /* M_ADB */ #if defined (M_MSBUS) if (mouse->type == T_MS_BUS) howmany = 3; #endif /* M_MSBUS */ while (read (mouse->fd, &mouse->pbuf[mouse->ppos], howmany) == howmany) { #ifdef M_SERIAL /* The MouseMan protocol is extremely fscked up. Packets can have 3 or 4 bytes. Attempt to detect changing from 3 byte to 4 byte packets. */ if (mouse->type == T_MMAN_SERIAL && mouse->ppos == 0 && (mouse->pbuf[0] & minfo->id[0]) != minfo->id[1] && (mouse->pbuf[0] >> 4) <= 3) { int b = mouse->pbuf[0] >> 4; mouse->packet_size = 4; state (0, 0, b & 0x20); mouse->ppos = 0; continue; } #endif if ((mouse->ppos == 0 && (mouse->pbuf[0] & minfo->id[0]) != minfo->id[1]) || (mouse->ppos == 1 && (mouse->pbuf[1] & minfo->id[2]) != minfo->id[3])) { /* Nope, not a packet */ mouse->ppos = 0; continue; } mouse->ppos += howmany; if (mouse->ppos >= mouse->packet_size) { minfo->driver (mouse); mouse->ppos = 0; } } } if ((sx != x || sy != y || !drawn) && show) { if (drawn) bogl_pointer (0, sx, sy, pointer, pointer_colors); bogl_pointer (1, x, y, pointer, pointer_colors); drawn = 1; } } /* Tells the library whether the mouse cursor is drawn. This is different from whether it is *supposed* to be drawn. For instance, if the screen got cleared by a VT switch, the mouse cursor may have been erased inadvertently. */ void boml_drawn (int is_drawn) { drawn = is_drawn; } /* Draw the mouse cursor if it's not drawn but it should be. */ void boml_redraw (void) { if (show > 0 && !drawn) { bogl_pointer (1, x, y, pointer, pointer_colors); drawn = 1; } } /* Show the mouse cursor. The mouse cursor being `shown' is a recursive property: if you call boml_show() N times to show the cursor, then you must call boml_hide() N times in order to hide it. */ void boml_show (void) { if (!mice) return; show++; if (show == 1 && !drawn) { bogl_pointer (1, x, y, pointer, pointer_colors); drawn = 1; } } /* Hide the mouse cursor. See comment above boml_show() for more details. */ void boml_hide (void) { if (!mice) return; show--; if (show == 0 && drawn) { bogl_pointer (0, x, y, pointer, pointer_colors); drawn = 0; } } /* Change the mouse cursor to pointer P. The cursor is drawn in the colors specified by COLORS. */ void boml_pointer (const struct bogl_pointer *p, int colors[2]) { boml_hide (); pointer = p; pointer_colors[0] = colors[0]; pointer_colors[1] = colors[1]; boml_show (); } /* If TEST == 0, sets all the mice' file descriptors into FDS. If TEST != 0, returns if at least one file descriptor is set in FDS. */ int boml_fds (int test, fd_set *fds) { struct mouse *mouse; for (mouse = mice; mouse; mouse = mouse->next) if (test) { if (FD_ISSET (mouse->fd, fds)) return 1; } else FD_SET (mouse->fd, fds); return 0; } /* Check for mouse activity. Returns the mouse event type. Stores the mouse location into (X,Y) and the button status into BTN, where nonzero indicates the button is pressed. */ int boml_event (int *x, int *y, int *btn) { int type; if (qt == qh) return BOML_E_NONE; type = queue[qt].type; if (x) *x = queue[qt].x; if (y) *y = queue[qt].y; if (btn) *btn = queue[qt].btn; qt = q_next (qt); return type; } /* Bookkeeping. */ /* Add an event of the specified type to the event queue. */ static void event (int type) { /* Merge multiple movement events into a single events. */ if (type == BOML_E_MOVE && qh != qt && queue[q_prev (qh)].type == BOML_E_MOVE) { queue[q_prev (qh)].x = x; queue[q_prev (qh)].y = y; return; } queue[qh].type = type; queue[qh].x = x; queue[qh].y = y; queue[qh].btn = button; qh = q_next (qh); if (qt == qh) qt = q_next (qt); } /* The mouse moved (DX,DY) units, and the button is in state BTN (!=0: pressed). Record that fact. */ static void state (int dx, int dy, int btn) { if (dx || dy) { x += dx; y += dy; if (x < 0) x = 0; if (x >= bogl_xres) x = bogl_xres - 1; if (y < 0) y = 0; if (y >= bogl_yres) y = bogl_yres - 1; } if (btn != button) { button = btn; if (button) event (BOML_E_PRESS); else event (BOML_E_RELEASE); } else if (button) event (BOML_E_MOVE); } /* Add a mouse of type TYPE to the list of mice. The mouse is open on file descriptor FD. */ static void add_mouse (int type, int fd) { struct mouse *mouse = malloc (sizeof (struct mouse)); mouse->next = mice; mouse->type = type; mouse->fd = fd; mouse->ppos = 0; mouse->packet_size = mouse_info[type].packet_size; mice = mouse; } #ifdef M_GPM /* If we have a gpm repeater, assume ms3. */ static int detect_gpm (void) { int ret; int fd; struct sockaddr_un sock; ret = 1; /* Make sure GPM is answering requests... */ fd = socket (PF_UNIX, SOCK_STREAM, 0); if(fd < 0) ret = 0; else { sock.sun_family = AF_UNIX; strcpy(sock.sun_path, "/dev/gpmctl"); if(connect (fd, &sock, SUN_LEN(&sock)) < 0) ret = 0; close (fd); } fd = open ("/dev/gpmdata", O_RDONLY | O_NONBLOCK); if (fd < 0) return 0; if (bogl_cloexec (fd) < 0) { close (fd); return 0; } /* Poll the mouse whether or not we could find gpm, in case it starts up later; but keep searching in that case. */ add_mouse (T_MS3_SERIAL, fd); return ret; } #endif #ifdef M_INPUT /* Check for /dev/input/mice, by opening mouse0 instead - i.e. check that there's really a mouse there right now. Keep it open anyway, but set the mouse found flag accordingly. */ static void detect_input (void) { int fd; fd = open("/dev/input/mouse0", O_RDONLY | O_NONBLOCK); if (fd >= 0) { input_mouse_found = 1; close(fd); } fd = open("/dev/input/mice", O_RDONLY | O_NONBLOCK); if(fd < 0) return; if (bogl_cloexec(fd) < 0) { close(fd); return; } add_mouse(T_PS2, fd); } #endif /* PS/2 mouse code. */ #ifdef M_PS2 /* Attempt to detect presence of a PS/2 mouse. If successful, sets `type' to indicate mouse type. */ static void detect_ps2 (void) { static const unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; int fd; fd = open ("/dev/psaux", O_RDWR | O_NONBLOCK); if (fd < 0) return; if (bogl_cloexec (fd) < 0) { close (fd); return; } write (fd, s2, sizeof s2); usleep (30000); tcflush (fd, TCIFLUSH); add_mouse (T_PS2, fd); } #endif /* M_PS2 */ #ifdef M_PS2_DRIVER static void ps2_driver (struct mouse *m) { int x, y; x = y = 0; if (m->pbuf[1]) x = (m->pbuf[0] & 0x10) ? m->pbuf[1] - 256 : m->pbuf[1]; if (m->pbuf[2]) y = (m->pbuf[0] & 0x20) ? 256 - m->pbuf[2] : -m->pbuf[2]; state (x, y, m->pbuf[0] & 1); } #endif /* M_PS2_DRIVER */ /* Microsoft/Apple Busmouse and Sun mouse code. */ #ifdef M_MSBUS /* Attempt to detect presence of a Microsoft bus mouse. If successful, sets `type' to indicate mouse type. */ static void detect_msbus (void) { int fd = open ("/dev/inportbm", O_RDONLY | O_NONBLOCK); if (fd < 0) return; if (bogl_cloexec (fd) < 0) { close (fd); return; } add_mouse (T_MS_BUS, fd); } #endif /* M_MSBUS */ #ifdef M_ADB static void detect_adb (void) { int fd = open ("/dev/adbmouse", O_RDONLY | O_NONBLOCK); if (fd < 0) return; if (bogl_cloexec (fd) < 0) { close (fd); return; } add_mouse (T_ADB, fd); } #endif /* M_ADB */ #ifdef M_SUN /* FIXME: Reading the GPM code tells me that this is almost certainly wrong. Some Sparc person will have to fix it. */ static void detect_sun (void) { int fd = open ("/dev/sunmouse", O_RDONLY | O_NONBLOCK); if (fd < 0) return; if (bogl_cloexec (fd) < 0) { close (fd); return; } add_mouse (T_SUN, fd); } #endif /* M_SUN */ /* The decoder is definitely the same for all three though */ #if defined(M_ADB) || defined(M_SUN) || defined(M_MSBUS) static void bm_driver (struct mouse *m) { signed char *p = (signed char *) (m->pbuf); state (p[1], -p[2], !(p[0] & 0x04)); } #endif /* M_ADB || M_SUN || M_MSBUS */ /* Serial mice. */ #ifdef M_SERIAL /* Attempt to detect presence of a serial mouse. If successful, sets `type' to indicate mouse type. */ static void detect_serial (void) { static char device[] = "/dev/ttySx"; for (device[9] = '0'; device[9] <= '3'; device[9]++) { int success; success = probe_com (device, 1); inc (); if (!success) probe_com (device, 0); inc (); } } #endif /* M_SERIAL */ #ifdef M_SERIAL_MS /* ms and ms3 protocols are the same except that ms3 has an extra byte in each packet. */ static void ms_driver (struct mouse *m) { state ((signed char) ((m->pbuf[0] & 0x03) << 6) | (m->pbuf[1] & 0x3f), (signed char) ((m->pbuf[0] & 0x0c) << 4) | (m->pbuf[2] & 0x3f), m->pbuf[0] & 0x20); } #endif #ifdef M_SERIAL static void msc_driver (struct mouse *m) { signed char *p = (signed char *) (m->pbuf); state (p[3] + p[1], p[4] - p[2], !(m->pbuf[0] & 0x04)); } static void mman_driver (struct mouse *m) { if (m->packet_size == 4 && (m->pbuf[3] >> 4) == 0) m->packet_size = 3; state ((signed char) (((m->pbuf[0] & 0x03) << 6) | (m->pbuf[1] & 0x3f)), (signed char) (((m->pbuf[0] & 0x0c) << 4) | (m->pbuf[2] & 0xef)), m->pbuf[0] & 0x20); } #if 0 static void logi_driver (struct mouse *m) { state (m->pbuf[0] & 0x10 ? m->pbuf[1] : -m->pbuf[1], m->pbuf[0] & 0x08 ? -m->pbuf[2] : m->pbuf[2], m->pbuf[0] & 0x04); } #endif /* 0*/ #endif /* M_SERIAL_DRIVER */ #if 0 /* Test routine. */ int main (void) { boml_init (); return 0; } #endif #ifdef M_SERIAL /* The following code comes from mice.c in gpm-1.13, although it is heavily modified. The original copyright notice is reproduced in full below. */ /* * mice.c - mouse definitions for gpm-Linux * * Copyright 1993 ajh@gec-mrc.co.uk (Andrew Haylett) * Copyright 1994-1998 rubini@linux.it (Alessandro Rubini) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ********/ static void set_speed (int fd, int old, unsigned short flags) { struct termios tty; tcgetattr(fd, &tty); tty.c_iflag = IGNBRK | IGNPAR; tty.c_oflag = 0; tty.c_lflag = 0; tty.c_line = 0; tty.c_cc[VTIME] = 0; tty.c_cc[VMIN] = 1; tty.c_cflag = flags | old; tcsetattr(fd, TCSAFLUSH, &tty); write(fd, "*n", 2); usleep(100000); tty.c_cflag = flags | B1200; tcsetattr(fd, TCSAFLUSH, &tty); } static void init_serial (int fd) { const int flags = CS7 | CREAD | CLOCAL | HUPCL; /* Change to 1200 baud from any baud rate. */ set_speed (fd, B9600, flags); set_speed (fd, B4800, flags); set_speed (fd, B2400, flags); set_speed (fd, B1200, flags); /* Flush pending input. */ { struct timeval timeout = {0, 0}; unsigned char c; fd_set set; FD_ZERO (&set); for (;;) { FD_SET (fd, &set); switch (select (fd+1, &set, NULL, NULL, &timeout)) { case 1: if (read(fd,&c,1)==0) break; case -1: continue; } break; } } } /* The code below is taken from the following files in the Red Hat 5.2 mouseconfig-3.1.3 distribution. It's been essentially rewritten. pnp_probe_com.c pnp_probe_com.h The original copyright notice is reproduced in full below. All modifications are subject to the license at the top of this file. */ /* probe serial port for PnP/Legacy devices * * * Michael Fulbright (msf@redhat.com) * * Copyright 1997 Red Hat Software * * This software may be freely redistributed under the terms of the GNU * public license. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ struct pnp_com_id { unsigned char other_id[17]; /* For pre-PNP compatibility. */ unsigned char other_len; /* Length of the other_id. */ unsigned char pnp_rev_major; /* PnP major revision number. */ unsigned char pnp_rev_minor; /* PnP minor revision number. */ unsigned char manufacturer[4]; /* EISA manufacturer (string). */ unsigned char product_id[5]; /* Mfr determined product ID (string) */ unsigned char serial_number[9]; /* Optional dev serial number (string) */ unsigned char class_name[33]; /* Optional PnP Class name (string) */ unsigned char driver_id[42]; /* Optional compat device IDs (string) */ unsigned char user_name[42]; /* Optional verbose product descr (string) */ }; /* There are two possible bytes to signify the start of a PnP ID string. */ #define BeginPnP1 0x28 #define BeginPnP2 0x08 /* Likewise, two possible stop bytes. */ #define EndPnP1 0x29 #define EndPnP2 0x09 /* These chars indicate extensions to the base dev id exist. */ #define ExtendPnP1 0x5c #define ExtendPnP2 0x3c #define PNP_COM_MAXLEN 256 /* Wait until there is data available on fd, for up to TIMEOUT microseconds. */ static int wait_for_input (int fd, long timeout) { struct timeval tv; fd_set ready; int n; tv.tv_sec = 0; tv.tv_usec = timeout; FD_ZERO (&ready); FD_SET (fd, &ready); n = select (fd + 1, &ready, NULL, &ready, &tv); return n; } static int open_serial_port (char *port) { int fd; fd = open (port, O_RDWR | O_NONBLOCK); if (fd < 0) return fd; if (bogl_cloexec (fd) < 0) { close (fd); return -1; } /* Reset file so it is no longer in non-blocking mode. */ if (fcntl (fd, F_SETFL, 0) < 0) { close (fd); return -1; } return fd; } /* <0 means ioctl error occurred. */ static int get_serial_lines (int fd) { int modem_lines; ioctl (fd, TIOCMGET, &modem_lines); return modem_lines; } /* <0 means ioctl error occurred */ static int set_serial_lines (int fd, int modem_lines) { return ioctl (fd, TIOCMSET, &modem_lines); } static int get_serial_attr (int fd, struct termios *attr) { return tcgetattr (fd, attr); } static int set_serial_attr (int fd, struct termios *attr) { return tcsetattr (fd, TCSANOW, attr); } /* Set serial port to 1200 baud, 'nbits' bits, 1 stop, no parity. */ static int setup_serial_port (int fd, int nbits) { struct termios attr; if (get_serial_attr (fd, &attr) < 0) return 0; attr.c_iflag = IGNBRK | IGNPAR; attr.c_cflag = 0; attr.c_cflag &= ~(CSIZE | CSTOPB | PARENB | PARODD | PARENB); attr.c_cflag |= CREAD | CLOCAL; /*| CRTSCTS ; */ if (nbits == 7) attr.c_cflag |= CS7 | CSTOPB; else attr.c_cflag |= CS8; attr.c_oflag = 0; attr.c_lflag = 0; attr.c_cc[VMIN] = 1; attr.c_cc[VTIME] = 5; cfsetospeed (&attr, B1200); cfsetispeed (&attr, B1200); return set_serial_attr (fd, &attr) >= 0; } /* Request for PnP info from serial device. See page 6 of the pnpcom doc from Microsoft. Returns nonzero only if successful. */ static int init_pnp_com_seq1 (int fd) { int modem_lines = get_serial_lines (fd); /* Turn off RTS and wait 200 ms for DSR to come up. */ set_serial_lines (fd, modem_lines & ~(TIOCM_RTS)); usleep (200000); /* See if DSR came up. */ modem_lines = get_serial_lines(fd); if (!(modem_lines & TIOCM_DSR)) { set_serial_lines (fd, modem_lines | TIOCM_DTR | TIOCM_RTS); return 0; } /* Com port setup, 1st phase. Now we set port to be 1200 baud, 7 bits, no parity, 1 stop bit. */ if (!setup_serial_port (fd, 7)) return 0; /* Drop DTR and RTS. */ modem_lines &= ~(TIOCM_RTS | TIOCM_DTR); set_serial_lines (fd, modem_lines); usleep (200000); /* Bring DTR back up. */ modem_lines |= TIOCM_DTR; set_serial_lines (fd, modem_lines); usleep (200000); /* Enter next phase. */ modem_lines |= TIOCM_RTS; set_serial_lines (fd, modem_lines); usleep (200000); return 1; } /* See if this is a legacy mouse device. Only called if the PnP probe above failed. We turn off the mouse via RS232 lines, then turn it on. If it spits out an 'M' character (at 1200 baud, 7N1) it could be a mouse. Returns nonzero only if successful. */ static int legacy_probe_com (int fd) { /* Now we set port to be 1200 baud, 7 bits, no parity, 1 stop bit. */ if (!setup_serial_port (fd, 7)) return 0; /* Drop DTR and RTS, then bring them back up. */ { int modem_lines = get_serial_lines (fd); set_serial_lines (fd, modem_lines & ~(TIOCM_RTS | TIOCM_DTR)); usleep (200000); set_serial_lines (fd, modem_lines | TIOCM_DTR | TIOCM_RTS); } /* Start reading - quit after first character. */ { int starttime = (int) time (NULL); for (;;) { if (wait_for_input (fd, 250000) <= 0) return 0; /* Read a character. */ { unsigned char resp; if (read (fd, &resp, 1) > 0) return resp == 'M'; if (errno != EAGAIN) return 0; } /* Shouldn't run more than 2 seconds. */ if (time (NULL) - starttime > 2) return 0; } } } /* Retrieve the PnP ID string. Timeout after 3 seconds. Should probably set a 200 msec timeout per char, as spec says. If no char received, we're done. Returns number of characters retrieved. */ static int read_pnp_string (int fd, unsigned char *pnp_string, int *pnp_len) { int pnp_index; time_t starttime; int end_char; pnp_index = 0; end_char = -1; starttime = time (NULL); for (;;) { unsigned char c; /* Don't wait more than 3 seconds. */ if (time (NULL) - starttime > 4) break; /* Wait for a character to arrive. */ if (wait_for_input (fd, 250000) <= 0) break; /* Read a byte. */ { ssize_t nbytes = read (fd, &c, 1); if (nbytes < 0 && errno != EAGAIN) break; if (nbytes == 0) continue; } /* Store the byte. */ if (pnp_index < 99) pnp_string[pnp_index++] = c; /* Check for end of string. */ if (end_char != -1) { if (c == end_char) break; } else if (c == BeginPnP1) end_char = EndPnP1; else if (c == BeginPnP2) end_char = EndPnP2; } pnp_string[pnp_index] = 0; *pnp_len = pnp_index; return pnp_index; } /* Parse the PnP ID string into components. Returns nonzero only if successful. */ static int parse_pnp_string (unsigned char *pnp_id_string, int pnp_len, struct pnp_com_id *pnp_id) { unsigned char pnp_string[100]; unsigned char *p1, *p2; unsigned char *start; unsigned char *curpos; int xlate_6bit; int stage; /* Clear out pnp_id and make a local copy of pnp_id_string. */ memset (pnp_id, 0, sizeof (*pnp_id)); memcpy (pnp_string, pnp_id_string, pnp_len + 1); /* First find the start of the PnP part of string. Use the marker which points nearest to start of the string and is actually defined. The length of the initial part cannot be more than 17 bytes. */ { p1 = memchr (pnp_string, BeginPnP1, pnp_len); p2 = memchr (pnp_string, BeginPnP2, pnp_len); start = p1; if (!start || (p2 && p2 < start)) start = p2; if (!start || start - pnp_string > 17) return 0; } /* Copy everything before the start of the PnP block. */ memcpy (pnp_id->other_id, pnp_string, start - pnp_string); pnp_id->other_len = start - pnp_string; /* Translate data in PnP fields if necessary. */ if (start == p2) { unsigned char *cp; for (cp = start; ; cp++) { /* Skip the revision fields (bytes 1 and 2 after start). */ if (cp != start + 1 && cp != start + 2) *cp += 0x20; putchar (*cp); if (*cp == EndPnP1) break; } xlate_6bit = 1; } else xlate_6bit = 0; /* Now we get the PnP fields - all were zeroed out above. */ curpos = start + 1; { int rev_tmp = ((curpos[0] & 0x3f) << 6) + (curpos[1] & 0x3f); pnp_id->pnp_rev_major = rev_tmp / 100; pnp_id->pnp_rev_minor = rev_tmp % 100; } curpos += 2; memcpy (pnp_id->manufacturer, curpos, 3); curpos += 3; memcpy (pnp_id->product_id, curpos, 4); curpos += 4; /* Now read extension fields, if any. */ for (stage = 0; *curpos == ExtendPnP1 || *curpos == ExtendPnP2; stage++) { static const char extension_delims[] = {EndPnP1, ExtendPnP1, ExtendPnP2, 0}; int len; unsigned char *endfield = strpbrk (++curpos, extension_delims); if (!endfield) return 0; /* If we reached the end of all PnP data, back off since there is a checksum at the end of extension data. */ len = endfield - curpos; if (*endfield == EndPnP1) len -= 2; switch (stage) { case 0: if (len != 8 && len != 0) return 0; memcpy (pnp_id->serial_number, curpos, len); break; case 1: if (len > 33) return 0; memcpy (pnp_id->class_name, curpos, len); break; case 2: if (len > 41) return 0; memcpy (pnp_id->driver_id, curpos, len); break; case 3: if (len > 41) return 0; memcpy (pnp_id->user_name, curpos, len); break; default: /* Ignore additional extension fields. */ break; } curpos += len; if (*endfield == EndPnP1) break; } /* If we had any extensions, we expect and check a checksum. */ if (stage) { unsigned int checksum; const unsigned char *cp; char hex_checksum[3]; checksum = curpos[2]; for (cp = start; cp < curpos; cp++) checksum += *cp; if (xlate_6bit) checksum -= 0x20 * (curpos - start + 1 - 2); sprintf (hex_checksum, "%.2X", checksum & 0xff); if (strncmp (hex_checksum, curpos, 2)) return 0; } return 1; } static int guess_mouse_type (struct pnp_com_id *pnp_id) { int type; /* First, figure out whether it's a mouse or not. */ if (pnp_id->class_name[0] == 0) { char *model; model = strstr (pnp_id->driver_id, "PNP"); if (model) model += 3; else model = pnp_id->product_id; if (strncmp (model, "0F", 2)) return -1; } else if (strcmp (pnp_id->class_name, "MOUSE")) return -1; /* It's a mouse. Default to Microsoft protocol--most common. */ type = T_MS_SERIAL; /* Test for some common mouse types. Send me more! */ { const char *mfg = pnp_id->manufacturer; const char *model = pnp_id->product_id; if (!strcmp (mfg, "MSH") && !strcmp (model, "0001")) type = T_MS3_SERIAL; else if (!strcmp (mfg, "LGI") && !strncmp (model, "80", 2)) type = T_MMAN_SERIAL; else if (!strcmp (mfg, "KYE") && !strcmp (model, "0003")) type = T_MS3_SERIAL; } return type; } /* If PNP != 0, checks for a plug-n-play mouse on device PORT; if PNP == 0, checks for a legacy mouse on that device. Returns nonzero if a device is found. */ static int probe_com (char *port, int pnp) { struct termios origattr; /* Open serial port. */ int fd = open_serial_port (port); if (fd < 0) return 0; /* Save port attributes. */ if (get_serial_attr (fd, &origattr) < 0) { close (fd); return 0; } /* Retrieve PnP string or check for legacy mouse. */ if (pnp) { struct pnp_com_id pnp_id; unsigned char pnp_string[100]; int pnp_strlen; if (init_pnp_com_seq1 (fd) && read_pnp_string (fd, pnp_string, &pnp_strlen) && parse_pnp_string (pnp_string, pnp_strlen, &pnp_id)) { int type = guess_mouse_type (&pnp_id); if (type != -1) { add_mouse (type, fd); return 1; } } } else if (legacy_probe_com (fd)) { init_serial (fd); /* FIXME: Must detect MS, MSC, LOGI. */ add_mouse (T_MS_SERIAL, fd); return 1; } else { /* Restore port attributes. */ set_serial_attr (fd, &origattr); close (fd); } return 0; } #endif /* M_SERIAL */ bogl-0.1.18/bogl-pcfb.h0000644000000000000000000000277311407777275011450 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef bogl_pcfb_h #define bogl_pcfb_h #include size_t bogl_pcfb_init (); void bogl_pcfb_pixel (int x, int y, int c); void bogl_pcfb_hline (int x1, int x2, int y, int c); void bogl_pcfb_vline (int x, int y1, int y2, int c); void bogl_pcfb_text (int x, int y, const char *s, int n, int fg, int bg, int ul, const struct bogl_font *font); void bogl_pcfb_clear (int x1, int y1, int x2, int y2, int c); void bogl_pcfb_move (int sx, int sy, int dx, int dy, int w, int h); void bogl_pcfb_put (int x, int y, const struct bogl_pixmap *pixmap, const int color_map[16]); void bogl_pcfb_pointer (int visible, int x1, int y1, const struct bogl_pointer *pointer, int colors[2]); #endif /* bogl_cfb_h */ bogl-0.1.18/bowl-boxes.c0000644000000000000000000002603611407777275011667 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include #include #include #include #include #include #include #include #include #include "boxes.h" #include "bogl-font.h" #include "bogl.h" #include "bowl.h" #ifdef _TESTING_ # define _(String) String #else # include # define _(String) gettext(String) #endif /* #include "dbootstrap.h" #include "lang.h" */ #ifndef unused #define unused __attribute__((unused)) #endif extern struct bogl_font *title_font; extern struct bogl_font *text_font; extern struct bogl_font *button_font; extern struct bogl_font *input_font; extern struct bogl_font *menu_font; void chvt (int vt_no) { int fd = open ("/dev/tty0", O_RDWR); if (fd < 0) return; if (!ioctl (fd, VT_ACTIVATE, vt_no)) ioctl (fd, VT_WAITACTIVE, vt_no); close (fd); } int setTitleFont (char *fontname) { struct bogl_font *new_font = bogl_read_bdf(fontname); if (new_font == NULL) { fprintf (stderr, "Error loading fonts: %s\n", bogl_error ()); return 1; } title_font = new_font; bogl_refresh = 1; return 0; } int setInputFont (char *fontname) { struct bogl_font *new_font = bogl_read_bdf(fontname); if (new_font == NULL) { fprintf (stderr, "Error loading fonts: %s\n", bogl_error ()); return 1; } input_font = new_font; bogl_refresh = 1; return 0; } int setTextFont (char *fontname) { struct bogl_font *new_font = bogl_read_bdf(fontname); if (new_font == NULL) { fprintf (stderr, "Error loading fonts: %s\n", bogl_error ()); return 1; } text_font = new_font; bogl_refresh = 1; return 0; } int setButtonFont (char *fontname) { struct bogl_font *new_font = bogl_read_bdf(fontname); if (new_font == NULL) { fprintf (stderr, "Error loading fonts: %s\n", bogl_error ()); return 1; } button_font = new_font; bogl_refresh = 1; return 0; } int setMenuFont (char *fontname) { struct bogl_font *new_font = bogl_read_bdf(fontname); if (new_font == NULL) { fprintf (stderr, "Error loading fonts: %s\n", bogl_error ()); return 1; } menu_font = new_font; bogl_refresh = 1; return 0; } #if 0 int setFont(struct boxFonts *fonts) { if (!setMenuFont(fonts->menuFont)) return 1; if (!setInputFont(fonts->inputFont)) return 1; if (!setButtonFont(fonts->buttonFont)) return 1; if (!setTitleFont(fonts->titleFont)) return 1; if (!setTextFont(fonts->textFont)) return 1; return 0; } #else int setFont (const char *fontname, const char *acm) { return 0; } #endif void setMono(void) { #warning FIXME: mono detection /* bogl_gray_scale (bootargs.ismono); */ bogl_gray_scale (0); bogl_refresh = 1; } int stderrToTTY (int tty) { static int fd = -1; char dev[10]; /* stderr redirect only works on 2.0 kernels */ /* FIXME: we need to figure out why it fails on 2.2 kernels. * In the meantime skip it. */ #ifndef STANDALONE_TEST #warning FIXME: kver test in stderrToTTY #if 0 /* REALLY FIXME */ if (strncmp (kver, "2.0", 3)) #endif #endif return 0; if (fd > 0) close (fd); snprintf (dev, 10, "/dev/tty%d", tty); if ((fd = open (dev, O_RDWR | O_NOCTTY)) < 0) return 1; if (-1 == dup2 (fd, 2)) return 1; return 0; } void boxResume (void) { stderrToTTY (3); bowl_init (); } void boxSuspend (void) { bowl_done (); stderrToTTY (1); } void boxPopWindow (void) { /* Not yet implemented. */ } void boxFinished (void) { bowl_done (); stderrToTTY (1); } void boxInit (void) { chvt (1); bowl_init (); stderrToTTY(3); } int pleaseWaitBox (const char *text) { bowl_flush (); bowl_title (_("Please wait")); bowl_new_text (text); bowl_layout (); return 0; } int vaproblemBox(const char *title, const char *fmt, ...) { char *p; va_list ap; if ((p = malloc(128)) == NULL) return -1; va_start(ap, fmt); (void) vsnprintf(p, 128, fmt, ap); va_end(ap); problemBox(p, title); return 0; } int problemBox (const char *text, const char *title) { bowl_flush (); bowl_title (title); bowl_new_text (text); bowl_new_button (_("Continue"), 0); bowl_layout (); bowl_run (); return 0; } int wideMessageBox (const char *text, const char *title) { bowl_flush (); bowl_title (title); bowl_new_text (text); bowl_new_button (_("Continue"), 0); bowl_layout (); bowl_run (); return 0; } int perrorBox (const char *text) { char buf[1024]; snprintf (buf, 1024, "%s: %s", text, strerror (errno)); problemBox (buf, _("Error")); return 0; } int twoButtonBox (const char *text, const char *title, const char *button1, const char *button2) { bowl_flush (); bowl_title (title); bowl_new_text (text); bowl_new_button (button1, 1); bowl_new_button (button2, 0); bowl_layout (); return bowl_run (); } int yesNoBox (const char *text, const char *title) { return twoButtonBox (text, title, _("Yes"), _("No")); } char * inputBox (const char *text, const char *title, const char *proto) { char *s; bowl_flush (); bowl_title (title); bowl_new_text (text); bowl_new_input (&s, proto); bowl_new_button (_("Ok"), 1); bowl_new_button (_("Cancel"), 0); bowl_layout (); bowl_default (1); if (bowl_run ()) return s; free (s); return NULL; } /* int enterDirBox (const char *title, const char *prompt, const char *dir, char *buf, size_t bufsize) { char *s; int result; bowl_flush (); bowl_title (title); bowl_new_text (prompt); bowl_new_input (&s, dir); bowl_new_button (_("Ok"), 1); bowl_new_button (_("Cancel"), 0); bowl_layout (); bowl_default (1); if (bowl_run ()) { strcpy (buf, s); */ /* Actually, I must check whether the length of buf allows to hold a whole s */ /* result = DLG_OKAY; } else result = DLG_CANCEL; free (s); return result; } */ int menuBox (const char *text, const char *title, struct d_choices *choices, int nchoices, int cancel) { int i; for (i = 0; i < nchoices; i++) if (choices[i].tag || choices[i].string) choices[i].state = i; else choices[i].state = -1; bowl_flush (); bowl_title (title); bowl_new_text (text); bowl_new_menu ((struct bowl_menu_item *) choices, nchoices, 15); if (cancel) bowl_new_button (_("Cancel"), DLG_CANCEL); bowl_layout (); return bowl_run (); } int scaleBox (const char *text, const char *title, long long value, int action) { static struct widget *scale; switch (action) { case SCALE_CREATE: bowl_flush (); bowl_title (title); bowl_new_text (text); scale = bowl_new_scale (value); bowl_layout (); bowl_refresh (); break; case SCALE_REFRESH: bowl_set_scale (scale, value); break; case SCALE_DELETE: bowl_flush (); bowl_refresh (); break; } return 0; } int checkBox (const char *text, const char *title, int height unused, int width unused, char **choices, char **values, int nchoices) { char *result; result = malloc (nchoices); memcpy (result, *values, nchoices); bowl_flush (); bowl_title (title); bowl_new_text (text); bowl_new_checkbox (choices, result, nchoices, 15); bowl_new_button (_("Ok"), 1); bowl_new_button (_("Cancel"), 0); bowl_default (1); bowl_layout (); if (bowl_run ()) { memcpy (*values, result, nchoices); return DLG_CANCEL; } else return DLG_OKAY; } /* * tz_dialogBox * Dialog box for timezone selection and setting: * char *text - Introductory info. * char *title - Title in the dialog box * int height - Height of the box * int width - Width of the box. * struct list* files - List of the file options. * struct list* dirs - List of the directory options. */ int tz_dialogBox(const char* text, const char* title, int height, int width, struct list* files, struct list* dirs) { const int count = 1 + dirs->nelem + 2 + files->nelem; struct bowl_menu_item menu[count]; int i, j; for (i = 0; i < count; i++) { menu[i].tag = NULL; menu[i].command = -1; } i = 0; menu[i++].item = _("Directories:"); for (j = 0; j < dirs->nelem; j++) { menu[i].item = dirs->data[j]; menu[i].command = OPT_D + j; i++; } i++; /* Blank line. */ menu[i++].item = _("Timezones:"); for (j = 0; j < files->nelem; j++) { menu[i].item = files->data[j]; menu[i].command = OPT_F + j; i++; } return menuBox (text, title, (struct d_choices *) menu, count, 1); } #ifdef STANDALONE_TEST int main (void) { bowl_init (); #if 0 twoButtonBox ("some sample text", "confirmation", "yes", "no"); #elif 0 problemBox (MSG_SILO_PROBLEM, MSG_PROBLEM); #elif 0 for (;;) { pleaseWaitBox (MSG_RUNNING_LILO); sleep (2); } #elif 0 inputBox (MSG_LINUX_AND_SWAP, MSG_NO_SWAP_PARTITION, "/dev/sda1"); #elif 1 { char buf[128]; enterDirBox ("Enter a directory", "Here you must type the directory name", "/debian", buf, 128); } #elif 1 { struct d_choices opt[30]; int i; for (i = 0; i < 30; i++) { opt[i].tag = malloc (16); sprintf (opt[i].tag, " %d", i); opt[i].string = malloc (128); sprintf (opt[i].string, "item %d", i); opt[i].state = i; } menuBox ("This is a little text", "I'm the title", opt, 30, 1); } #elif 1 { char *choices[30]; char values[30]; char *valuesp; int i; for (i = 0; i < 30; i++) { choices[i] = malloc (128); sprintf (choices[i], "item %d", i); values[i] = i % 2 ? '*' : ' '; } valuesp = values; checkBox ("This is a little text", "I'm the title", 10, 50, choices, &valuesp, 30); } #elif 0 { int i; scaleBox ("Installing rescue floppy...", "Please wait", 10, SCALE_CREATE); for (i = 0; i <= 10; i++) { scaleBox (NULL, NULL, i, SCALE_REFRESH); sleep (1); } } #elif 1 bowl_new_text (MSG_BAD_FLOPPY MSG_LINUX_AND_SWAP); bowl_title (MSG_NO_SWAP_PARTITION); bowl_new_button (MSG_YES, 0); bowl_new_button (MSG_NO, 0); bowl_new_button (_("Cancel"), 0); bowl_new_button ("Quit", 0); bowl_new_button ("Help", 0); bowl_layout (); bowl_run (); #endif return 0; } #endif bogl-0.1.18/bogl-term.c0000644000000000000000000005725111407777275011501 0ustar /* BOGL - Ben's Own Graphics Library. This file is by Edmund GRIMLEY EVANS . Rendering optimisation and delay code (c) Copyright Red Hat Inc 2002 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* * This implements a simple text console whose capatilities are * described by the terminfo source in "bterm.ti". */ #include "bogl.h" #include "bogl-term.h" struct bogl_term *bogl_term_new(struct bogl_font *font) { struct bogl_term *term; int i; term = calloc(sizeof(struct bogl_term), 1); if (!term) return 0; term->font = font; term->xbase = term->ybase = 0; term->xstep = bogl_font_glyph(font, ' ', 0); term->ystep = bogl_font_height(font); if (term->xstep <= 0 || term->ystep <= 0) { free(term); return 0; } term->xsize = bogl_xres / term->xstep; term->ysize = bogl_yres / term->ystep; term->xpos = 0, term->ypos = 0; term->fg = term->def_fg = 0; term->bg = term->def_bg = 7; term->rev = 0; term->bold = 0; term->state = 0; term->cur_visible = 1; memset(&term->ps, 0, sizeof(&term->ps)); term->screen = malloc(term->xsize * term->ysize * sizeof(wchar_t)); term->dirty = malloc(term->xsize * term->ysize); term->screenfg = malloc(term->xsize * term->ysize * sizeof(int)); term->screenbg = malloc(term->xsize * term->ysize * sizeof(int)); term->screenul = malloc(term->xsize * term->ysize * sizeof(int)); term->screenbd = malloc(term->xsize * term->ysize * sizeof(int)); term->cchars = malloc(term->xsize * term->ysize * sizeof(wchar_t *)); if (!term->screen || !term->screenfg || !term->screenbg || !term->screenul || !term->screenbd || !term->cchars || !term->dirty) { free(term->screen); free(term->screenfg); free(term->screenbg); free(term->screenul); free(term->screenbd); free(term->cchars); free(term->dirty); free(term); return 0; } for (i = 0; i < term->xsize * term->ysize; i++) { term->screen[i] = ' '; term->screenfg[i] = term->def_fg; term->screenbg[i] = term->def_bg; term->screenul[i] = 0; term->screenbd[i] = 0; term->cchars[i] = 0; term->dirty[i] = 1; } term->yorig = 0; return term; } #define XPOS(x) (term->xbase + term->xstep * (x)) #define YPOS(y) (term->ybase + term->ystep * (y)) #define SCR(x, y) \ ((x) + (((y) + term->yorig) % term->ysize) * term->xsize) static int term_match(struct bogl_term *term, int p1, int p2) { if(term->screen[p1] != term->screen[p2]) return 0; if(term->screenfg[p1] != term->screenfg[p2]) return 0; if(term->screenbg[p1] != term->screenbg[p2]) return 0; if(term->screenul[p1] != term->screenul[p2]) return 0; if(term->screenbd[p1] != term->screenbd[p2]) return 0; return 1; } static int term_is_clear(struct bogl_term *term, int p1) { if(term->screen[p1] != ' ') return 0; if(term->screenfg[p1] != term->fg) return 0; if(term->screenbg[p1] != term->bg) return 0; if(term->screenul[p1] != 0) return 0; if(term->screenbd[p1] != 0) return 0; return 1; } void bogl_term_dirty (struct bogl_term *term) { int x,y; for(y = 0; y < term->ysize; y++) for(x=0; x < term->xsize; x++) term->dirty[SCR(x,y)]=1; } /* We are scrolling so anything which isn't the same as the spot below is deemed dirty. If this seems to be off by one, then it is, sort of. When this function is called yorig is set such that (0,0) is the former left corner of the screen. Right after we return yorig will be incremented, causing both the screen contents and the dirty array to be "scrolled". So we have to mark the _lower_ spot dirty here. */ static void dirty_scroll(struct bogl_term *term) { int x,y; for(y = 0; y < term->ysize-1; y++) for(x=0; x < term->xsize; x++) { int this_point = SCR(x,y); int next_point = SCR(x,y+1); if (term->dirty[this_point] || !term_match (term, this_point, next_point)) term->dirty[next_point] = 1; } } /* We are backscrolling so anything which isn't the same as the spot above is deemed dirty. Same caveat as above, in reverse. */ static void dirty_backscroll(struct bogl_term *term) { int x,y; for(y = 1; y < term->ysize; y++) for(x=0; x < term->xsize; x++) { int this_point = SCR(x,y); int next_point = SCR(x,y-1); if (term->dirty[this_point] || !term_match (term, this_point, next_point)) term->dirty[next_point] = 1; } } static void cursor_down (struct bogl_term *term) { int i; if (term->ypos < term->ysize - 1) { ++term->ypos; return; } dirty_scroll(term); ++term->yorig; for (i = 0; i < term->xsize; i++) { int p = SCR(i, term->ypos); term->screen[p] = ' '; term->screenfg[p] = term->fg; term->screenbg[p] = term->bg; term->screenul[p] = 0; term->screenbd[p] = 0; term->dirty[p] = 1; free (term->cchars[p]); term->cchars[p] = 0; } } static void put_char (struct bogl_term *term, int x, int y, wchar_t wc, wchar_t *cchars, int fg, int bg, int ul, int bd) { char buf[MB_LEN_MAX]; int j, k, r, w; if (bd) fg += 8; wctomb(0, 0); if ((k = wctomb(buf, wc)) == -1) return; if (bogl_in_font (term->font, wc)) { bogl_text (XPOS(x), YPOS(y), buf, k, fg, bg, ul, term->font); if (cchars) for (j = 0; cchars[j]; j++) { wctomb(0, 0); if ((k = wctomb(buf, cchars[j])) != -1) bogl_text(XPOS(x), YPOS(y), buf, k, fg, -1, ul, term->font); } } else { /* repeat the default char w times */ w = wcwidth(wc); for (r = 0; r < w; r++) bogl_text (XPOS(x + r), YPOS(y), buf, k, fg, bg, ul, term->font); } } static void show_cursor (struct bogl_term *term, int show) { int i, x, fg, bg; if ((x = term->xpos) == term->xsize) x = term->xsize - 1; i = SCR(x, term->ypos); while (!term->screen[i]) --i, --x; if (term->screen[i]) { if ((show && !term->rev) || (!show && term->rev)) fg = term->screenbg[i], bg = term->screenfg[i]; else fg = term->screenfg[i], bg = term->screenbg[i]; put_char(term, x, term->ypos, term->screen[i], term->cchars[i], fg, bg, term->screenul[i], term->screenbd[i]); term->dirty[SCR(x, term->ypos)] = 1; } } static void clear_left (struct bogl_term *term) { int j, i = SCR(term->xpos, term->ypos); if (!term->screen[i]) { for (j = i - 1; !term->screen[j]; j--) { if(term->screen[j] != ' ') term->dirty[j] = 1; term->screen[j] = ' '; } term->screen[j] = ' '; term->dirty[j] = 1; } } static void clear_right (struct bogl_term *term) { int j, i = SCR(term->xpos, term->ypos); for (j = 0; term->xpos + j < term->xsize && !term->screen[i + j]; j++) { if(term->screen[i + j] != ' ') { term->dirty[i + j] = 1; term->screen[i + j] = ' '; } } } static void term_clear_one (struct bogl_term *term, int i) { if(!term_is_clear(term, i)) { term->dirty[i] = 1; term->screen[i] = ' '; term->screenfg[i] = term->fg; term->screenbg[i] = term->bg; term->screenul[i] = 0; term->screenbd[i] = 0; } free (term->cchars[i]); term->cchars[i] = 0; } void bogl_term_out (struct bogl_term *term, char *s, int n) { wchar_t wc; size_t k, kk; int i, j, w, txp, f, b, use_acs, x, y; char buf[MB_LEN_MAX]; k = 0; while (1) { s += k; n -= k; /* The n <= 0 check was originally only necessary because of a bug (?) in glibc 2.2.3, as opposed to libiconv. glibc will successfully convert a zero-length string. It is also the only exit point from this loop when we run out of characters, whether we successfully decode a zero-length string or error out. The exception is an incomplete multibyte sequence, just below. */ if (n <= 0) break; k = mbrtowc (&wc, s, n, &term->ps); /* If we fail to write a character, skip forward one byte and continue. There's not much we can do to recover, but it's better than discarding the whole line. */ if (k == (size_t) -1) { k = 1; /* The mbrtowc documentation suggests that we could use mbrtowc to reset term->ps, but that doesn't work in practice; ps is in an undefined state which appears to be the illegal state to make the reset call in. Use memset. */ memset (&term->ps, 0, sizeof (term->ps)); continue; } else if (k == (size_t) -2) { /* Incomplete character, so we exit and wait for more to arrive. */ break; } if (!k) k = 1; txp = term->xp; term->xp = -1; if (wc == 0) /* 0 has a special meaning in term->screen[] */ continue; if (wc == 8) { /* cub1=^H */ if (term->xpos) --term->xpos; term->state = 0; continue; } if (wc == 9) { /* ht=^I */ int target; /* I'm not sure whether this way of going over the right margin is correct, so I don't declare this capability in terminfo. */ target = (term->xpos / 8) * 8 + 8; while(term->xpos < target) { if (term->xpos >= term->xsize) { term->xpos = 0; cursor_down (term); break; } bogl_term_out(term, " ", 1); } term->state = 0; continue; } if (wc == 10) { /* ind=^J */ cursor_down (term); term->state = 0; continue; } if (wc == 13) { /* cr=^M */ term->xpos = 0; term->state = 0; continue; } if (wc == 14) { term->acs = 1; continue; } if (wc == 15) { term->acs = 0; continue; } if (wc == 27) { /* ESC = \E */ term->state = -1; continue; } if (term->state == -1) { if (wc == '[') { term->state = 1; term->arg[0] = 0; continue; } /* `ri' capability: Scroll up one line. */ if (wc == 'M') { if (term->ypos > 0) term->ypos--; else { /* Delete the bottom line. */ for (i = SCR (0, term->ysize - 1); i < SCR (term->xsize, term->ysize - 1); i++) free (term->cchars[i]); /* Move all other lines down. Fortunately, this is easy. */ dirty_backscroll(term); term->yorig--; /* Clear the top line. */ for (i = SCR (0, 0); i < SCR (term->xsize, 0); i++) { term->screen[i] = ' '; term->screenfg[i] = term->fg; term->screenbg[i] = term->bg; term->screenul[i] = 0; term->screenbd[i] = 0; term->cchars[i] = 0; term->dirty[i] = 1; } } } term->state = 0; continue; } if (term->state > 0) { if ('0' <= wc && wc <= '9') { if (term->state > sizeof (term->arg) / sizeof (int)) continue; term->arg[term->state - 1] *= 10; term->arg[term->state - 1] += wc - '0'; continue; } if (wc == ';') { if (term->state > sizeof (term->arg) / sizeof (int)) continue; if (term->state < sizeof (term->arg) / sizeof (int)) term->arg[term->state] = 0; ++term->state; continue; } if (wc == '?') { if (term->state == 1 && term->arg[0] == 0) ++term->state, term->arg[0] = -1, term->arg[1] = 0; else term->state = 0; continue; } if (wc == 'H') { /* home=\E[H, cup=\E[%i%p1%d;%p2%dH */ if (term->state < 3) { if (term->state == 2) { if (term->arg[1] <= term->xsize) term->xpos = term->arg[1] ? term->arg[1] - 1 : 0; } else term->xpos = 0; if (term->arg[0] <= term->ysize) term->ypos = term->arg[0] ? term->arg[0] - 1 : 0; } term->state = 0; continue; } if (wc == 'J') { /* clear=\E[H\E[2J */ /* arg[0]: 0 means clear cursor to end, 1 should mean clear until cursor, 2 means clear whole screen. */ if (term->state == 1 && term->arg[0] == 2) { for (i = 0; i < term->xsize * term->ysize; i++) { if(!term_is_clear(term, i)) { term->dirty[i] = 1; term->screen[i] = ' '; term->screenfg[i] = term->fg; term->screenbg[i] = term->bg; term->screenul[i] = 0; term->screenbd[i] = 0; } free (term->cchars[i]); term->cchars[i] = 0; } } else if (term->state == 1 && term->arg[0] == 0) { for (x = term->xpos; x < term->xsize; x++) term_clear_one (term, SCR (x, term->ypos)); for (y = term->ypos + 1; y < term->ysize; y++) for (x = 0; x < term->xsize; x++) term_clear_one (term, SCR (x, y)); term->state = 0; continue; } } if (wc == 'K') { /* el=\E[K */ if (term->state == 1 && !term->arg[0]) { clear_left (term); for (i = SCR (term->xpos, term->ypos); i < SCR (term->xsize, term->ypos); i++) { if(!term_is_clear(term, i)) { term->dirty[i] = 1; term->screen[i] = ' '; term->screenfg[i] = term->fg; term->screenbg[i] = term->bg; term->screenul[i] = 0; term->screenbd[i] = 0; } free (term->cchars[i]); term->cchars[i] = 0; } } term->state = 0; continue; } if (wc == 'h') { /* cnorm=\E[?25h */ if (term->arg[0] == -1 && term->arg[1] == 25) term->cur_visible = 1; term->state = 0; continue; } if (wc == 'l') { /* civis=\E[?25l */ if (term->arg[0] == -1 && term->arg[1] == 25) term->cur_visible = 0; term->state = 0; continue; } if (wc == 'm') { /* setab=\E[4%p1%dm, setaf=\E[3%p1%dm */ if (term->arg[0] == 4 || term->arg[0] == 24) term->ul = term->arg[0] == 4; else if (30 <= term->arg[0] && term->arg[0] < 38) term->fg = term->arg[0] - 30; else if (40 <= term->arg[0] && term->arg[0] < 48) term->bg = term->arg[0] - 40; else if (term->arg[0] == 39) term->fg = term->def_fg; else if (term->arg[0] == 49) term->bg = term->def_bg; else if (term->arg[0] == 7) term->rev = 1; else if (term->arg[0] == 27) term->rev = 0; else if (term->arg[0] == 1) term->bold = 1; else if (term->arg[0] == 0) { term->rev = 0; term->bold = 0; term->fg = term->def_fg; term->bg = term->def_bg; } term->state = 0; continue; } term->state = 0; continue; } use_acs = 0; if (term->acs) { /* FIXME: If we are using a non-UTF-8 locale, the wcwidth call below will almost certainly fail. We should have hardcoded results to fall back on in that case. This will probably be fixed when I make this code drastically less dependent on mbrtowc and wctomb, which I really haven't figured out how to do yet. They aren't really appropriate for a terminal emulator to be using! */ switch (wc) { case 'q': wc = 0x2500; use_acs = 1; break; case 'j': wc = 0x2518; use_acs = 1; break; case 'x': wc = 0x2502; use_acs = 1; break; case 'a': wc = 0x2591; use_acs = 1; break; case 'm': wc = 0x2514; use_acs = 1; break; case 'l': wc = 0x250c; use_acs = 1; break; case 'k': wc = 0x2510; use_acs = 1; break; case 'u': wc = 0x2524; use_acs = 1; break; case 't': wc = 0x251c; use_acs = 1; break; } } /* At this point, if we can not decode a character because of ACS, replace it with a space to minimize graphical corruption. */ if ((w = wcwidth (wc)) < 0) { if (use_acs) { wc = 0x20; w = wcwidth (wc); } else continue; } wctomb (0, 0); kk = wctomb (buf, wc); if (kk == -1) /* impossible */ continue; #if 0 { write (2, "p", 1); } #endif f = term->rev ? term->bg : term->fg; b = term->rev ? term->fg : term->bg; if (w > 0) { if (w <= term->xsize) { if (term->xpos + w > term->xsize) { clear_left (term); for (i = SCR (term->xpos, term->ypos); i < SCR (term->xsize, term->ypos); i++) { if(!term_is_clear(term,i)) { term->dirty[i] = 1; term->screen[i] = ' '; /* Use term->fg and term->bg rather than f and b - this is not affected by reverse video. */ term->screenfg[i] = term->fg; term->screenbg[i] = term->bg; term->screenul[i] = 0; term->screenbd[i] = 0; } free (term->cchars[i]); term->cchars[i] = NULL; } term->xpos = 0; cursor_down (term); } clear_left (term); i = SCR (term->xpos, term->ypos); term->dirty[i] = 1; term->screen[i] = wc; term->screenfg[i] = f; term->screenbg[i] = b; term->screenul[i] = term->ul; term->screenbd[i] = term->bold; free (term->cchars[i]); term->cchars[i] = NULL; for (j = 1; j < w; j++) { term->dirty[i + j] = 1; term->screen[i + j] = 0; term->screenfg[i + j] = f; term->screenbg[i + j] = b; term->screenul[i + j] = 0; term->screenbd[i + j] = 0; } if (bogl_in_font (term->font, wc)) { term->xp = term->xpos, term->yp = term->ypos; term->xpos += w; } else { /* repeat the default char w times */ int r; for (r = 0; r < w; r++) { term->xp = term->xpos, term->yp = term->ypos; ++term->xpos; } } clear_right (term); } } else { /* w == 0 */ if (txp >= 0) { term->xp = txp; // bogl_text (XPOS (term->xp), YPOS (term->yp), buf, kk, f + (term->bd ? 8 : 0), -1, term->ul, term->font); } else { clear_left (term); // bogl_text (XPOS (term->xpos), YPOS (term->ypos), buf, kk, f + (term->bd ? 8 : 0), b, term->ul, term->font); term->xp = term->xpos, term->yp = term->ypos; term->xpos += 1; clear_right (term); } i = SCR (term->xp, term->yp); if (bogl_in_font(term->font, wc)) { if (term->cchars[i]) { int ccw = wcslen(term->cchars[i]); wchar_t *newcchars; newcchars = realloc(term->cchars[i], (ccw+2) * sizeof(wchar_t)); if (newcchars) { term->cchars[i] = newcchars; term->cchars[i][ccw] = wc; term->cchars[i][ccw+1] = 0; } } else { term->cchars[i] = malloc(2 * sizeof(wchar_t)); if (term->cchars[i]) { term->cchars[i][0] = wc; term->cchars[i][1] = 0; } } term->dirty[i] = 1; } } } } void bogl_term_redraw (struct bogl_term *term) { int x, y, i; /* We should move these and distinguish redraw/refresh I guess -- AC */ bogl_clear(0, YPOS(term->ysize), bogl_xres, bogl_yres, 0); bogl_clear(XPOS(term->xsize), 0, bogl_xres, YPOS(term->ysize), 0); for (y = 0; y < term->ysize; y++) for (x = 0; x < term->xsize; x++) { i = SCR(x, y); if (term->screen[i] && term->dirty[i]) { put_char(term, x, y, term->screen[i], term->cchars[i], term->screenfg[i], term->screenbg[i], term->screenul[i], term->screenbd[i]); term->dirty[i] = 0; } } if (term->cur_visible) { show_cursor(term, 1); } } bogl-0.1.18/boml.h0000644000000000000000000000257011407777275010541 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef boml_h #define boml_h /* Mouse event types. */ enum { BOML_E_NONE, /* Nothing to report. */ BOML_E_MOVE, /* Movement. */ BOML_E_PRESS, /* Button pressed. */ BOML_E_RELEASE, /* Button released. */ }; int boml_quick_init (void); void boml_init (void (*callback) (int)); void boml_show (void); void boml_hide (void); void boml_refresh (void); void boml_drawn (int is_drawn); void boml_draw (void); void boml_pointer (const struct bogl_pointer *, int colors[2]); int boml_fds (int test, fd_set *); int boml_event (int *x, int *y, int *btn); #endif /* boml_h */ bogl-0.1.18/README0000644000000000000000000000647211407777275010324 0ustar This distribution consists of a few different libraries (BOGL, BOML, BOWL), a Linux 2.2.x kernel patch, and a couple of test programs. BOGL stands for Ben's Own Graphics Library. It is a tiny graphics library for kernel 2.2.x framebuffers. It supports only very simple graphics. For instance, it lacks clipping, nonorthogonal lines, multiple brushes/pens, and so on. It does, however, support the following: - Horizontal and vertical lines - Rectangles - Solid rectangular fill - Proportional fonts - Pixmap drawing - Palette setting - Redraw notification on console switch Though meager, this is plenty to implement a simple graphical user interface, which is what BOWL (Ben's Own Window Library) does. BOWL supports the following: - A single, modal, fixed-width on-screen window - Text boxes contained auto-flowed proportional text - Command buttons - Input boxes - Menus - Check boxes - Completion bars BOML, Ben's Own Mouse Library, provides mouse support for BOGL. It is experimental; its mouse detection algorithms may be fragile. Please report success/failure. Somewhat unsurprisingly, this is exactly the list of features needed to install Debian GNU/Linux. Source files: Makefile: Makefile to compile the library and test programs. bdftobogl: A Perl program to translate any X Window System .bdf font file into a .c file that, when compiled and linked to a program using the BOGL library, can be used for text output. bogl-test.c: A simple test program for the BOGL library. Run it for a usage message. bogl-vga16.c, bogl-vga16.h: An implementation of BOGL device-specific functions for EGA/VGA 16-color modes, for use with the included 2.2 kernel framebuffer driver. bogl-cfb.h: private header, contains inline functions used by the packed-pixel drivers. bogl-pcfb.c, bogl-pcfb.h: BOGL driver for pseudocolor packed pixel modes. bogl-tcfb.c, bogl-tcfb.h: BOGL driver for true/directcolor packed pixel modes. bogl.c: BOGL main library implementation. bogl.h: BOGL public header. boglP.h: BOGL private header, for internal library use only. boml.h, boml.c: Ben's Own Mouse Library. bowl.h, bowl.c: Ben's Own Window Library. bowl-boxes.c: The beginnings of a compatible replacement for Debian boot-floppies boxes.c, using BOWL instead of newt. Currently a BOWL test program; see the source for details. boxes.c, boxes.h: From Debian boot-floppies. giftobogl.c: A program to translate any .gif pixmap with 16 colors or fewer into a .c run-length encoded format that, when compiled and linked to a program using the BOGL library, can be displayed by BOGL. kernel.patch: A patch against Linux kernel 2.2.x that adds a 16-color EGA/VGA framebuffer driver. By Ben Pfaff and Petr Vandrovec. *.bdf: Some fonts from the X Window System distribution for use with BOGL programs. *.gif: Some pixmaps for testing. Miscellaneous info: * Source files are written in GNU C, not ANSI C, using Linux- and gcc-specific features. Since BOGL targets Linux framebuffers, this should not be a problem. * There are no plans to support non-framebuffer graphics setups. It would be much more complicated since this effectively forces putting the kernel framebuffer driver into the program. Yuck. I'm writing a graphics and window library, not an X server :-) * All comments and suggestions are welcome. Local Variables: mode: text End: bogl-0.1.18/pngtobogl.c0000644000000000000000000000763511407777275011605 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #define _GNU_SOURCE 1 #include #include #include #include #include #include /* Allocation routines. */ static void out_of_memory (void) { printf ("Virtual memory exhausted.\n"); exit (EXIT_FAILURE); } void * xmalloc (size_t size) { void *p; if (size == 0) return 0; p = malloc (size); if (!p) out_of_memory (); return p; } void * xrealloc (void *p, size_t size) { if (p == NULL) return xmalloc (size); if (size == 0) { free (p); return NULL; } p = realloc (p, size); if (!p) out_of_memory (); return p; } char * xstrdup (const char *s) { size_t size = strlen (s) + 1; char *p = xmalloc (size); memcpy (p, s, size); return p; } int main (int argc, char *argv[]) { char *name; FILE *pngfile; gdImagePtr png; int ncols; int w; int h; if (argc < 2) { printf ("usage: pngtobogl graphic.png > graphic.c\n"); exit (EXIT_FAILURE); } /* Compute name for internal structures. */ { char *cp; name = xstrdup (argv[1]); strcpy (name, argv[1]); for (cp = name; *cp; cp++) if (!isalnum ((unsigned char) *cp)) { if (!strcmp (cp, ".png")) { *cp = 0; break; } *cp = '_'; } } pngfile = fopen (argv[1], "rb"); if (!pngfile) { printf ("error opening %s: %s\n", argv[1], strerror (errno)); exit (EXIT_FAILURE); } png = gdImageCreateFromPng (pngfile); if (!png) exit (EXIT_FAILURE); w = png->sx; h = png->sy; ncols = gdImageColorsTotal (png); if (ncols > 16) { printf ("Image has too many colors (%d)\n", ncols); exit (EXIT_FAILURE); } printf ("/* Generated by pngtobogl. */\n" "#include \"bogl.h\"\n\n" "/* Image data with simple run-length encoding. Each byte\n" " contains a pixel value in its lower nibble, and a repeat\n" " count in its upper nibble. */\n\n" "static unsigned char %s_data[] = {\n\n", name); /* Image data. */ { int y; for (y = 0; y < h; y++) { int n, x1; printf ("/* Row %d. */", y); n = 0; for (x1 = 0; x1 < w; ) { int c = gdImageGetPixel (png, x1, y); int x2 = x1 + 1; while (x2 < w && c == gdImageGetPixel (png, x2, y) && x2 - x1 < 15) x2++; if (n++ % 12 == 0) putchar ('\n'); printf ("0x%x%x, ", x2 - x1, c); x1 = x2; } printf ("\n\n"); } } /* Palette data. */ { int i; printf ("};\n\n" "/* Palette data. */\n" "static unsigned char %s_palette[%d][3] = {\n", name, ncols); for (i = 0; i < ncols; i++) printf (" {0x%02x, 0x%02x, 0x%02x},\n", gdImageRed (png, i), gdImageGreen (png, i), gdImageBlue (png, i)); } printf ("};\n\n" "/* Pixmap structure. */\n" "struct bogl_pixmap pixmap_%s = {\n" " %d,\t\t/* Width. */\n" " %d,\t\t/* Height. */\n" " %d,\t\t/* Number of colors. */\n" " %d,\t\t/* Transparent color. */\n" " %s_palette,\t/* Palette. */\n" " %s_data,\t/* Data. */\n" "};\n", name, w, h, ncols, gdImageGetTransparent (png), name, name); return 0; } bogl-0.1.18/bterm.ti0000644000000000000000000000200111407777275011073 0ustar # Implementation is in bogl-term.c # Key capabilities from linux terminfo entry bterm|bogl virtual terminal, cols#80, lines#24, am, bce, cub1=^H, ind=^J, cr=^M, cud1=^J, nel=^M^J, home=\E[H, clear=\E[H\E[2J, cup=\E[%i%p1%d;%p2%dH, ed=\E[J, el=\E[K, colors#8, pairs#64, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, civis=\E[?25l, cnorm=\E[?25h, smul=\E[4m, rmul=\E[24m, rev=\E[7m, sgr0=\E[0m, smso=\E[7m, rmso=\E[27m, sgr=\E[0m%?%p1%t\E[7m%;%?%p2%t\E[4m%;, acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, rmacs=^O, smacs=^N, kb2=\E[G, kbs=\177, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, kspd=^Z, ri=\EM, bold=\E[1m, bogl-0.1.18/bterm.c0000644000000000000000000002256411407777275010721 0ustar /* BOGL - Ben's Own Graphics Library. This file is by Edmund GRIMLEY EVANS . Rendering design redone by Red Hat Inc, Alan Cox This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* * This provides a simple virtual terminal, with delayed refresh * so that it appears fast even when it isn't being fast. */ #define _XOPEN_SOURCE 500 #include #include #include #include #include #include #include #include #include #include #include #include #include #include "bogl.h" #include "bogl-bgf.h" #include "bogl-term.h" static const unsigned char palette[16][3] = { {0x00, 0x00, 0x00}, /* 0: Black. */ {0xaa, 0x00, 0x00}, /* 1: Red. */ {0x00, 0xaa, 0x00}, /* 2: Green. */ {0xaa, 0xaa, 0x00}, /* 3: Brown. */ {0x00, 0x00, 0xaa}, /* 4: Blue. */ {0xaa, 0x00, 0xaa}, /* 5: Magenta. */ {0x00, 0xaa, 0xaa}, /* 6: Cyan. */ {0xaa, 0xaa, 0xaa}, /* 7: Light gray. */ {0x55, 0x55, 0x55}, /* 0: Light Gray. */ {0xff, 0x00, 0x00}, /* 1: Light Red. */ {0x00, 0xff, 0x00}, /* 2: Light Green. */ {0xff, 0xff, 0x00}, /* 3: Yellow. */ {0x00, 0x00, 0xff}, /* 4: Light Blue. */ {0xff, 0x00, 0xff}, /* 5: Light Magenta. */ {0x00, 0xff, 0xff}, /* 6: Light Cyan. */ {0xff, 0xff, 0xff}, /* 7: White. */ }; static int child_pid = 0; static struct termios ttysave; static int quit = 0; /* Out of memory. Give up. */ static void out_of_memory (void) { fprintf (stderr, "virtual memory exhausted\n"); abort (); } /* Allocate AMT bytes of memory and make sure it succeeded. */ static void *xmalloc (size_t size) { void *p; if (size == 0) return 0; p = malloc (size); if (!p) out_of_memory (); return p; } /* This first tries the modern Unix98 way of getting a pty, followed by the * old-fashioned BSD way in case that fails. */ int get_ptytty(int *xptyfd, int *xttyfd) { char buf[16]; int i, ptyfd, ttyfd; ptyfd = open("/dev/ptmx", O_RDWR); if (ptyfd >= 0) { const char *slave = ptsname(ptyfd); if (slave) { if (grantpt(ptyfd) >= 0) { if (unlockpt(ptyfd) >= 0) { ttyfd = open(slave, O_RDWR); if (ttyfd >= 0) { *xptyfd = ptyfd, *xttyfd = ttyfd; return 0; } } } } close(ptyfd); } for (i = 0; i < 32; i++) { sprintf(buf, "/dev/pty%c%x", "pqrs"[i/16], i%16); ptyfd = open(buf, O_RDWR); if (ptyfd < 0) { sprintf(buf, "/dev/pty/m%d", i); ptyfd = open(buf, O_RDWR); } if (ptyfd >= 0) { sprintf(buf, "/dev/tty%c%x", "pqrs"[i/16], i%16); ttyfd = open(buf, O_RDWR); if (ttyfd < 0) { sprintf(buf, "/dev/pty/s%d", i); ttyfd = open(buf, O_RDWR); } if (ttyfd >= 0) { *xptyfd = ptyfd, *xttyfd = ttyfd; return 0; } close(ptyfd); return 1; } } return 1; } /* Probably I should use this as a signal handler */ void send_hangup(void) { if (child_pid) kill(child_pid, SIGHUP); } void sigchld(int sig) { int status; if (waitpid(child_pid, &status, WNOHANG) > 0) { child_pid = 0; /* Reset ownership and permissions of ttyfd device? */ tcsetattr(0, TCSAFLUSH, &ttysave); if (WIFEXITED (status)) exit(WEXITSTATUS (status)); if (WIFSIGNALED (status)) exit(128 + WTERMSIG (status)); if (WIFSTOPPED (status)) exit(128 + WSTOPSIG (status)); exit(status); } signal(SIGCHLD, sigchld); } void sigterm(int sig) { quit = 1; } void spawn_shell(int ptyfd, int ttyfd, char * const *command_args) { fflush(stdout); child_pid = fork(); if (child_pid) { /* Change ownership and permissions of ttyfd device! */ signal(SIGCHLD, sigchld); return; } setenv("TERM", "bterm", 1); close(ptyfd); setsid(); ioctl(ttyfd, TIOCSCTTY, (char *)0); dup2(ttyfd, 0); dup2(ttyfd, 1); dup2(ttyfd, 2); if (ttyfd > 2) close(ttyfd); tcsetattr(0, TCSANOW, &ttysave); setgid(getgid()); setuid(getuid()); execvp(command_args[0], command_args); exit(127); } void set_window_size(int ttyfd, int x, int y) { struct winsize win; win.ws_row = y; win.ws_col = x; win.ws_xpixel = 0; win.ws_xpixel = 0; ioctl(ttyfd, TIOCSWINSZ, &win); } static char *font_name; static struct bogl_term *term; void reload_font(int sig) { struct bogl_font *font; font = bogl_mmap_font (font_name); if (font == NULL) { fprintf(stderr, "Bad font\n"); return; } /* This leaks a mmap. Since the font reloading feature is only expected to be used once per session (for instance, in debian-installer, after the font is replaced with a larger version containing more characters), we don't worry about the leak. */ free(term->font); term->font = font; term->xstep = bogl_font_glyph(term->font, ' ', 0); term->ystep = bogl_font_height(term->font); } /* * The usage is very simple: * bterm -f font.bgf [ -l locale ] [ program ] */ int main(int argc, char *argv[]) { struct termios ntio; int ret; char buf[8192]; struct timeval tv; int ptyfd, ttyfd; struct bogl_font *font; char *locale = "", *command = NULL; char **command_args; int i; char o = ' '; int pending = 0; for (i = 1 ; i < argc ; ++i) { int done = 0; if (argv[i][0] == '-') switch (argv[i][1]) { case 'f': case 'l': o = argv[i][1]; break; case '-': done = 1; break; default: printf ("unknown option: %c\n", argv[i][1]); } else switch (o) { case ' ': command = argv[i]; break; case 'f': font_name = argv[i]; o = ' '; break; case 'l': locale = argv[i]; o = ' '; break; } if (done) break; } setlocale(LC_CTYPE, locale); if (font_name == NULL) { fprintf(stderr, "Usage: %s -f font.bgf [ -l locale ] [ program ]\n", argv[0]); return 1; } if ((font = bogl_mmap_font(font_name)) == NULL) { fprintf(stderr, "Bad font\n"); return 1; } tcgetattr(0, &ttysave); if (!bogl_init()) { fprintf(stderr, "bogl: %s\n", bogl_error()); return 1; } term = bogl_term_new(font); if (!term) exit(1); bogl_set_palette(0, 16, palette); bogl_term_redraw(term); if (get_ptytty(&ptyfd, &ttyfd)) { perror("can't get a pty"); exit(1); } if (command) { command_args = xmalloc(2 * sizeof *command_args); command_args[0] = command; command_args[1] = NULL; } else if (i < argc - 1) { int j; command_args = xmalloc((argc - i) * sizeof *command_args); for (j = i + 1; j < argc; ++j) command_args[j - (i + 1)] = argv[j]; command_args[argc - (i + 1)] = NULL; } else { command_args = xmalloc(2 * sizeof *command_args); command_args[0] = "/bin/sh"; command_args[1] = NULL; } spawn_shell(ptyfd, ttyfd, command_args); signal(SIGHUP, reload_font); signal(SIGTERM, sigterm); ntio = ttysave; ntio.c_lflag &= ~(ECHO|ISIG|ICANON|XCASE); ntio.c_iflag = 0; ntio.c_oflag &= ~OPOST; ntio.c_cc[VMIN] = 1; ntio.c_cc[VTIME] = 0; ntio.c_cflag |= CS8; ntio.c_line = 0; tcsetattr(0, TCSAFLUSH, &ntio); set_window_size(ttyfd, term->xsize, term->ysize); for (;;) { fd_set fds; int max = 0; if (quit) break; if(pending) { tv.tv_sec = 0; tv.tv_usec = 0; } else { tv.tv_sec = 10; tv.tv_usec = 100000; } FD_ZERO(&fds); FD_SET(0, &fds); FD_SET(ptyfd, &fds); if (ptyfd > max) max = ptyfd; ret = select(max+1, &fds, NULL, NULL, &tv); if (quit) break; if (bogl_refresh) { /* Handle VT switching. */ if (bogl_refresh == 2) { bogl_term_dirty (term); /* This should not be necessary, but is, due to 2.6 kernel bugs in the vga16fb driver. */ bogl_set_palette(0, 16, palette); } bogl_refresh = 0; bogl_term_redraw(term); } if (ret == 0 || (ret < 0 && errno == EINTR)) { if(pending) { pending = 0; bogl_term_redraw(term); } continue; } if (ret < 0) perror("select"); if (FD_ISSET(0, &fds)) { ret = read(0, buf, sizeof(buf)); if (ret > 0) write(ptyfd, buf, ret); } else if (FD_ISSET(ptyfd,&fds)) { ret = read(ptyfd, buf, sizeof(buf)); if (ret > 0) { bogl_term_out(term, buf, ret); pending = 1; } } } return 0; } bogl-0.1.18/bogl-term.h0000644000000000000000000000155411407777275011501 0ustar #ifndef bogl_term_h #define bogl_term_h #include struct bogl_term { const struct bogl_font *font; int xbase, ybase; int xsize, ysize; int xstep, ystep; int xpos, ypos; int def_fg, def_bg; int fg, bg, ul; int rev; int bold; int state; int cur_visible; int xp, yp; int arg[2]; mbstate_t ps; wchar_t *screen; /* character in cell, or 0 */ int *screenfg, *screenbg, *screenul, *screenbd; /* colours in cell */ char *dirty; /* bitmask of dirty chars */ wchar_t **cchars; /* combining chars in cell, or 0 */ int yorig; /* increment this to scroll */ int acs; }; struct bogl_term *bogl_term_new(struct bogl_font *font); void bogl_term_out(struct bogl_term *term, char *s, int n); void bogl_term_redraw(struct bogl_term *term); void bogl_term_delete(struct bogl_font *font); void bogl_term_dirty (struct bogl_term *term); #endif bogl-0.1.18/bogl-tcfb.c0000644000000000000000000002141411407777275011440 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* bogl-tcfb.h: directcolor/truecolor packed pixel driver for BOGL Written by David Huggins-Daines based on Ben's original cfb8 driver. */ /*#define NDEBUG*/ #include #include #include #include #include #include #include #include #include #include "bogl.h" #include "boglP.h" #include "bogl-cfb.h" #include "bogl-tcfb.h" static int bpp; static unsigned char* save; const static int cmap_size = 16; static unsigned int cmap[16]; /* for bitfield information */ static struct fb_var_screeninfo var; static inline unsigned int cmap_lookup (int entry) { if (entry >= cmap_size) return 0; return cmap[entry]; } void bogl_tcfb_set_palette (int c, int nc, const unsigned char palette[][3]) { int i; if (c+nc > cmap_size) nc = cmap_size - c; for (i = 0; i < nc; i++) cmap[c+i] = ((palette[i][0] >> (8-var.red.length) << var.red.offset) | (palette[i][1] >> (8-var.green.length) << var.green.offset) | (palette[i][2] >> (8-var.blue.length) << var.blue.offset)); } /* Set pixel (X,Y) to color C. */ void bogl_tcfb_pixel (int x, int y, int c) { bogl_drawing = 1; assert (x >= 0 && x < bogl_xres); assert (y >= 0 && y < bogl_yres); put_var (bogl_frame + y * bogl_line_len, x, cmap_lookup(c), bpp); bogl_drawing = 0; } /* Paint a horizontal line from (X1,Y) to (X2,Y) in color C, where X2 >= X1. The final point is not painted. */ void bogl_tcfb_hline (int x1, int x2, int y, int c) { assert (x1 >= 0 && x1 < bogl_xres); assert (x2 >= 0 && x2 <= bogl_xres); assert (x2 >= x1); assert (y >= 0 && y < bogl_yres); if (x1 == x2) return; bogl_drawing = 1; memset_var ((void*)bogl_frame + (y * bogl_line_len), cmap_lookup(c), x1, x2 - x1, bpp); bogl_drawing = 0; } /* Paints a vertical line from (X,Y1) to (X,Y2) in color C. The final point is not painted. */ void bogl_tcfb_vline (int x, int y1, int y2, int c) { assert (x >= 0 && x < bogl_xres); assert (y1 >= 0 && y1 < bogl_yres); assert (y2 >= 0 && y2 <= bogl_yres); assert (y2 >= y1); bogl_drawing = 1; for (; y1 < y2; y1++) put_var (bogl_frame + (y1 * bogl_line_len), x, cmap_lookup(c), bpp); bogl_drawing = 0; } /* Clear the region from (X1,Y1) to (X2,Y2) to color C, not including the last row or column. If C == -1 then the region's colors are inverted rather than set to a particular color. */ void bogl_tcfb_clear (int x1, int y1, int x2, int y2, int c) { unsigned char *dst; #if 0 assert (0 <= x1 && x1 <= x2 && x2 <= bogl_xres); assert (0 <= y1 && y1 <= y2 && y2 <= bogl_yres); #endif if (x1 == x2) return; bogl_drawing = 1; dst = (char *) bogl_frame + (y1 * bogl_line_len); for (; y1 < y2; y1++) { memset_var (dst, cmap_lookup(c), x1, x2 - x1, bpp); dst += bogl_line_len; } bogl_drawing = 0; } void bogl_tcfb_text (int xx, int yy, const char *s, int n, int fg, int bg, int ul, const struct bogl_font *font) { int h, k; wchar_t wc; assert (xx >= 0 && xx < bogl_xres); assert (yy >= 0 && yy < bogl_yres); bogl_drawing = 1; h = bogl_font_height (font); if (yy + h > bogl_yres) h = bogl_yres - yy; mbtowc (0, 0, 0); for (; (k = mbtowc (&wc, s, n)) > 0; s += k, n -= k) { char *dst = (char *) bogl_frame + (yy * bogl_line_len); u_int32_t *character = NULL; int w = bogl_font_glyph (font, wc, &character); int x, y, h1 = ul ? h - 1 : h; unsigned cfg = cmap_lookup (fg), cbg = cmap_lookup (bg); if (character == NULL) continue; if (xx + w > bogl_xres) w = bogl_xres - xx; for (y = 0; y < h1; y++) { u_int32_t c = *character++; for (x = 0; x < w; x++) { if (c & 0x80000000) put_var (dst, xx+x, cfg, bpp); else if (bg != -1) put_var (dst, xx+x, cbg, bpp); c <<= 1; } dst += bogl_line_len; } if (ul) for (x = 0 ; x < w ; x++) put_var (dst, xx + x, cfg, bpp); xx += w; if (xx >= bogl_xres) break; } bogl_drawing = 0; } /* Write PIXMAP at location (XX,YY) */ void bogl_tcfb_put (int xx, int yy, const struct bogl_pixmap *pixmap, const int color_map[16]) { char *dst; const unsigned char *src; int h; assert (xx + pixmap->width <= bogl_xres); assert (yy >= 0 && yy < bogl_yres); assert (yy + pixmap->width <= bogl_yres); src = pixmap->data; bogl_drawing = 1; h = pixmap->height; dst = (char *) bogl_frame + (yy * bogl_line_len); while (h--) { int w = pixmap->width; int offset = xx; while (w) { int color = *src & 0xf; int count = *src >> 4; src++; w -= count; if (color != pixmap->transparent) memset_var ((char *) dst, cmap_lookup(color_map[color]), offset, count, bpp); offset += count; } dst += bogl_line_len; } bogl_drawing = 0; } /* Draw mouse pointer POINTER with its hotspot at (X,Y), if VISIBLE != 0. Restores the previously saved background at that point, if VISIBLE == 0. COLORS[] gives the color indices to paint the cursor. This routine performs full clipping on all sides of the screen. */ void bogl_tcfb_pointer (int visible, int x1, int y1, const struct bogl_pointer *pointer, int colors[2]) { int y_count; /* Number of scanlines. */ int y_ofs; /* Number of scanlines to skip drawing. */ int x_ofs; /* Number of pixels to skip drawing on each line. */ assert (pointer != NULL); x1 -= pointer->hx; y1 -= pointer->hy; if (y1 + 16 > bogl_yres) { y_count = bogl_yres - y1; } else y_count = 16; if (x1 < 0) { x_ofs = -x1; x1 = 0; } else x_ofs = 0; if (y1 < 0) { y_ofs = -y1; y1 = 0; y_count -= y_ofs; } else y_ofs = 0; bogl_drawing = 1; /* Save or restore the framebuffer contents. */ { int sx_ofs = x1; int rowbytes = 16 * bpp / 8; if (sx_ofs + 16 > bogl_xres) { sx_ofs = bogl_xres - 16; } /* Avoid mouse droppings on <8-bit displays */ else if (bpp < 8 && sx_ofs % (8 / bpp)) rowbytes++; if (visible) { char *dst = save; char *src = (char *) bogl_frame + (sx_ofs * bpp / 8) + (y1 * bogl_line_len); int y; for (y = 0; y < y_count; y++) { memcpy (dst, src, rowbytes); dst += rowbytes; src += bogl_line_len; } } else { char *dst = (char *) bogl_frame + (sx_ofs * bpp / 8) + (y1 * bogl_line_len); char *src = save; int y; for (y = 0; y < y_count; y++) { memcpy (dst, src, rowbytes); dst += bogl_line_len; src += rowbytes; } } } /* Now draw it */ if (visible) { const unsigned short *mask_p, *color_p; int y; int x_count = 16; if (x1 + 16 > bogl_xres) x_count = bogl_xres - x1; mask_p = pointer->mask + y_ofs; color_p = pointer->color + y_ofs; for (y = 0; y < y_count; y++, mask_p++, color_p++) { unsigned char *dst; unsigned short bg_bits, fg_bits; int x; dst = (char *) bogl_frame + ((y1 + y) * bogl_line_len); bg_bits = *mask_p ^ *color_p; fg_bits = *mask_p & *color_p; for (x = 0; x < x_count; x++) { if (bg_bits & 0x8000) put_var (dst, x + x1, cmap_lookup(colors[0]), bpp); else if (fg_bits & 0x8000) put_var (dst, x + x1, cmap_lookup(colors[1]), bpp); else ; /* transparent (we hope) */ bg_bits <<= 1; fg_bits <<= 1; } } } bogl_drawing = 0; } /* Initialize TCFB mode. Returns the number of bytes to mmap for the framebuffer. */ size_t bogl_tcfb_init (int fb, int new_bpp) { bpp = new_bpp; /* Need an extra column for sub-8bpp displays */ save = malloc (((16*bpp/8) + 1) * 16); if (save == NULL) return bogl_fail ("allocating backing store: %s", strerror (errno)); if (-1 == ioctl (fb, FBIOGET_VSCREENINFO, &var)) return bogl_fail ("reading screen info: %", strerror (errno)); return bogl_xres * bogl_yres * bpp / 8; } /* * vim:ts=8 */ bogl-0.1.18/bogl-bgf.c0000644000000000000000000000164711407777275011266 0ustar #include #include #include #include #include #include #include "bogl.h" #include "bogl-font.h" struct bogl_font *bogl_mmap_font(char *file) { int fd; struct stat buf; void *f; struct bogl_font *font; fd = open(file, O_RDONLY); if (fd == -1) return 0; if (bogl_cloexec(fd) < 0) return 0; if (fstat(fd, &buf)) return 0; f = mmap(0, buf.st_size, PROT_READ, MAP_SHARED, fd, 0); if (f == (void *)-1) return 0; if (memcmp("BGF1", f, 4)) return 0; font = (struct bogl_font *)malloc(sizeof(struct bogl_font)); if (!font) return 0; memcpy(font, f + 4, sizeof(*font)); font->name = ((void *)font->name - (void *)0) + f; font->offset = ((void *)font->offset - (void *)0) + f; font->index = ((void *)font->index - (void *)0) + f; font->content = ((void *)font->content - (void *)0) + f; return font; } bogl-0.1.18/utils/0000755000000000000000000000000011407777275010573 5ustar bogl-0.1.18/utils/add_changelog_line0000755000000000000000000000041511407777275014267 0ustar #!/bin/sh if [ $# -eq 0 ]; then set -- "`pwd`" fi ( echo -n "`date` "; getent passwd $USER | awk -F: '{print $5}' | sed 's/,.*//' | \ sed "s/\$/ ($EMAIL)/" echo ) > $1/.ChangeLog.$$ cat $1/ChangeLog >> $1/.ChangeLog.$$ mv -f $1/.ChangeLog.$$ $1/ChangeLog bogl-0.1.18/bogl.c0000644000000000000000000003636211407777275010534 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #define _GNU_SOURCE 1 #include #include #include #include #include #include #include #include #include #include #include #include #if defined(__i386__) || defined(__alpha__) #include #endif #include #include #include #include #include #include #include #if 0 /* stopped being safe.. */ /* Yes, I know, we shouldn't be including headers from the kernel. But XFree86 also uses this one (to get PAGE_MASK) so it's probably safe. */ #include #endif #include "bogl.h" #include "boglP.h" #if BOGL_VGA16_FB #include "bogl-vga16.h" #endif #if BOGL_CFB_FB #include "bogl-pcfb.h" #include "bogl-tcfb.h" #endif /* BOGL main code. */ #ifndef unused #define unused __attribute__((unused)) #endif /* Global variables. */ int bogl_xres, bogl_yres, bogl_bpp; /* bogl.h */ int bogl_refresh; volatile char *bogl_frame; /* boglP.h */ int bogl_drawing; int bogl_line_len; /* Static variables. */ static int fb; /* Framebuffer file handle. */ static int tty; /* Tty file handle. */ static struct termios save_termios; /* Saved terminal state. */ static struct vt_mode mode; /* Terminal mode. */ static int tty_no; /* Tty that we own. */ static int type; /* Video type, one of FB_TYPE_*. */ static int visual; /* Visual type, one of FB_VISUAL_*. */ static int visible; /* Is our VT visible? */ static int status; /* 0=never initialized, 1=once initialized, 2=currently initialized. */ static char *error; /* Error message. */ /* Saved color palette. */ static __u16 saved_red[16]; static __u16 saved_green[16]; static __u16 saved_blue[16]; static int gray; /* Convert colors to grayscale? */ static char *bogl_frame_mapped; /* Page aligned, while bogl_frame might not be. */ /* Functions. */ static size_t init_fb (void); static int draw_enable (void); static void draw_disable (void); static void kbd_init (void); static void kbd_done (void); static void vt_switch (int); static struct fb_fix_screeninfo fb_fix; /* Initialize BOGL. */ int bogl_init (void) { unsigned long bogl_frame_offset, bogl_frame_len; struct fb_var_screeninfo fb_var; struct vt_stat vts; int PAGE_MASK = ~(sysconf(_SC_PAGESIZE) - 1); assert (status < 2); visible = 1; fb = open ("/dev/fb0", O_RDWR); if (fb < 0) fb = open ("/dev/fb/0", O_RDWR); if (fb < 0) return bogl_fail ("opening /dev/fb0: %s", strerror (errno)); if (bogl_cloexec (fb) < 0) return bogl_fail ("setting /dev/fb0 close-on-exec: %s", strerror (errno)); tty = open ("/dev/tty0", O_RDWR); if (tty < 0) tty = open ("/dev/vc/0", O_RDWR); if (tty < 0) return bogl_fail ("opening /dev/tty0: %s", strerror (errno)); if (bogl_cloexec (tty) < 0) return bogl_fail ("setting /dev/tty0 close-on-exec: %s", strerror (errno)); if (-1 == ioctl (tty, VT_GETSTATE, &vts)) return bogl_fail ("can't get VT state: %s", strerror (errno)); tty_no = vts.v_active; if (-1 == ioctl (fb, FBIOGET_FSCREENINFO, &fb_fix) || -1 == ioctl (fb, FBIOGET_VSCREENINFO, &fb_var)) return bogl_fail ("reading screen info: %s", strerror (errno)); bogl_xres = fb_var.xres; bogl_yres = fb_var.yres; bogl_bpp = fb_var.bits_per_pixel; bogl_line_len = fb_fix.line_length; type = fb_fix.type; visual = fb_fix.visual; /* Some broken framebuffers (2.4.x virgefb, 2.5 is OK) don't provide line_length. */ if (bogl_line_len == 0) bogl_line_len = fb_var.xres * fb_var.bits_per_pixel / 8; if (!draw_enable ()) return bogl_fail ("don't know screen type %d", type); if (ioctl (tty, VT_GETMODE, &mode) == -1) return bogl_fail ("can't get VT mode: %s", strerror (errno)); mode.mode = VT_PROCESS; mode.relsig = SIGUSR2; mode.acqsig = SIGUSR2; signal (SIGUSR2, vt_switch); if (-1 == ioctl (tty, VT_SETMODE, &mode)) return bogl_fail ("can't set VT mode: %s", strerror (errno)); if (-1 == ioctl (tty, KDSETMODE, KD_GRAPHICS)) return bogl_fail ("setting graphics mode: %s", strerror (errno)); if (!init_fb()) return 0; bogl_frame_offset = fb_fix.smem_start & ~PAGE_MASK; bogl_frame_len = ((bogl_frame_offset + fb_fix.smem_len + ~PAGE_MASK) & PAGE_MASK); bogl_frame_mapped = mmap (NULL, bogl_frame_len, PROT_READ | PROT_WRITE, MAP_SHARED, fb, 0); if (bogl_frame_mapped == NULL || bogl_frame_mapped == (char *) -1) return bogl_fail ("mmaping /dev/fb0: %s", strerror (errno)); bogl_frame = bogl_frame_mapped + bogl_frame_offset; kbd_init (); if (visual == FB_VISUAL_PSEUDOCOLOR || visual == FB_VISUAL_STATIC_PSEUDOCOLOR) { static struct fb_cmap cmap; cmap.start = 0; cmap.len = 16; cmap.red = saved_red; cmap.green = saved_green; cmap.blue = saved_blue; cmap.transp = NULL; ioctl (fb, FBIOGETCMAP, &cmap); } if (!status) atexit (bogl_done); status = 2; return 1; } static size_t init_fb (void) { #if BOGL_VGA16_FB #ifndef FB_TYPE_VGA_PLANES #define FB_TYPE_VGA_PLANES 4 #endif if (type == FB_TYPE_VGA_PLANES) { bogl_set_palette = bogl_fb_set_palette; return bogl_vga16_init (fb); } #endif #if BOGL_CFB_FB if (type == FB_TYPE_PACKED_PIXELS) { /* FIXME: what do we do about static pseudocolor visuals such as on losing m68k Macs? (Aside from hoping Apple will release programming info for their framebuffers, of course) */ if (visual == FB_VISUAL_PSEUDOCOLOR || visual == FB_VISUAL_STATIC_PSEUDOCOLOR) { bogl_set_palette = bogl_fb_set_palette; return bogl_pcfb_init (fb, bogl_bpp); } else if (visual == FB_VISUAL_TRUECOLOR || visual == FB_VISUAL_DIRECTCOLOR) { bogl_set_palette = bogl_tcfb_set_palette; return bogl_tcfb_init (fb, bogl_bpp); } } #endif return bogl_fail ("unknown or unsupported framebuffer: type %d, " "visual %d, %d bits per pixel", type, visual, bogl_bpp); } /* Close down BOGL. */ void bogl_done (void) { if (status != 2) return; status = 1; bogl_clear (0, 0, bogl_xres, bogl_yres, 0); if (visual == FB_VISUAL_PSEUDOCOLOR) { static struct fb_cmap cmap; cmap.start = 0; cmap.len = 16; cmap.red = saved_red; cmap.green = saved_green; cmap.blue = saved_blue; cmap.transp = NULL; ioctl (fb, FBIOPUTCMAP, &cmap); } kbd_done (); munmap ((void *) bogl_frame, fb_fix.smem_len); signal (SIGUSR2, SIG_DFL); ioctl (tty, KDSETMODE, KD_TEXT); mode.mode = VT_AUTO; mode.relsig = 0; mode.acqsig = 0; ioctl (tty, VT_SETMODE, &mode); close (tty); close (fb); } /* Keyboard interface. */ /* Put stdin in raw mode. */ static void kbd_init (void) { struct termios buf; int fd; fd = fileno (stdin); if (-1 == tcgetattr (fd, &save_termios)) return; /* If you uncomment ISIG and BRKINT below, then ^C will be ignored. At least for now, we want it to be processed. */ buf = save_termios; buf.c_lflag &= ~(ECHO | ICANON | IEXTEN/* | ISIG*/); buf.c_iflag &= ~(/*BRKINT | */ICRNL | INPCK | ISTRIP | IXON); buf.c_cflag &= ~(CSIZE | PARENB); buf.c_cflag |= CS8; buf.c_oflag &= ~OPOST; buf.c_cc[VMIN] = 1; buf.c_cc[VTIME] = 0; tcsetattr (fd, TCSAFLUSH, &buf); } /* Restore stdin to original modes. */ static void kbd_done (void) { int fd; fd = fileno (stdin); tcsetattr (fd, TCSAFLUSH, &save_termios); } /* Draw a hollow rectangle from (X1,Y1) to (X2,Y2) in color C. */ void bogl_rectangle (int x1, int y1, int x2, int y2, int c) { bogl_hline (x1, x2, y1, c); bogl_vline (x1, y1, y2, c); bogl_hline (x1, x2, y2 - 1, c); bogl_vline (x2 - 1, y1, y2, c); } /* Returns the width of character WC in font FONT and sets *BITMAP. */ int bogl_font_glyph (const struct bogl_font *font, wchar_t wc, u_int32_t **bitmap) { int mask = font->index_mask; int i; for (;;) { for (i = font->offset[wc & mask]; font->index[i]; i += 2) { if ((font->index[i] & ~mask) == (wc & ~mask)) { if (bitmap != NULL) *bitmap = &font->content[font->index[i+1]]; return font->index[i] & mask; } } if (wc != font->default_char) wc = font->default_char; else break; } return 0; } /* Returns whether there is a glyph for WC in font FONT. */ int bogl_in_font (const struct bogl_font *font, wchar_t wc) { int mask = font->index_mask; int i; for (i = font->offset[wc & mask]; font->index[i]; i += 2) { if ((font->index[i] & ~mask) == (wc & ~mask)) return 1; } return 0; } /* Returns the width of string S when output in font FONT. */ int bogl_metrics (const char *s, int n, const struct bogl_font *font) { int cx = 0; wchar_t wc; int k; mbtowc (0, 0, 0); for (; (k = mbtowc (&wc, s, n)) > 0; s += k, n -= k) cx += bogl_font_glyph (font, wc, NULL); return cx; } /* Set whether to convert colors to grayscale. You'll need to re-set the palette with bogl_set_palette() for this to take effect. */ void bogl_gray_scale (int make_gray) { gray = make_gray; } /* Set NC color palettes values starting at C to red-green-blue value specified in PALETTE. Use 8-bit color values as input. */ void bogl_fb_set_palette (int c, int nc, const unsigned char palette[][3]) { struct fb_cmap cmap; __u16 red[nc]; __u16 green[nc]; __u16 blue[nc]; int i; for (i = 0; i < nc; i++) { const unsigned char *e = palette[i]; if (gray) red[i] = green[i] = blue[i] = (e[0] * 77 + e[1] * 151 + e[2] * 28); else { red[i] = e[0] << 8; green[i] = e[1] << 8; blue[i] = e[2] << 8; } } cmap.start = c; cmap.len = nc; cmap.red = red; cmap.green = green; cmap.blue = blue; cmap.transp = NULL; ioctl (fb, FBIOPUTCMAP, &cmap); } /* Returns the oldest error message since this function was last called. Clears the error state. Returns a null pointer if no errors have occurred. The caller must free the returned pointer if memory leaks are to be prevented. */ const char * bogl_error (void) { char *msg = error; error = NULL; return msg; } /* Drawing function setup/disable. */ /* Dummy drawing functions to disable display. */ static void dummy_pixel (int x unused, int y unused, int c unused) {} static void dummy_hline (int x1 unused, int x2 unused, int y unused, int c unused) {} static void dummy_vline (int x unused, int y1 unused, int y2 unused, int c unused) {} static void dummy_text (int x unused, int y unused, const char *s unused, int n unused, int fg unused, int bg unused, int ul unused, const struct bogl_font *font unused) {} static void dummy_clear (int x1 unused, int y1 unused, int x2 unused, int y2 unused, int c unused) {} static void dummy_move (int sx unused, int sy unused, int dx unused, int dy unused, int w unused, int h unused) {} static void dummy_put (int x unused, int y unused, const struct bogl_pixmap *pixmap unused, const int color_map[] unused) {} static void dummy_pointer (int visible unused, int x unused, int y unused, const struct bogl_pointer *pointer unused, int colors[2] unused) {} /* Enable drawing by setting the bogl_* device-specific functions to their appropriate values for the detected device. */ static int draw_enable (void) { #if BOGL_VGA16_FB if (type == FB_TYPE_VGA_PLANES) { bogl_pixel = bogl_vga16_pixel; bogl_hline = bogl_vga16_hline; bogl_vline = bogl_vga16_vline; bogl_clear = bogl_vga16_clear; bogl_text = bogl_vga16_text; bogl_put = bogl_vga16_put; bogl_pointer = bogl_vga16_pointer; bogl_reinit = bogl_vga16_reinit; return 1; } #endif #if BOGL_CFB_FB if (type == FB_TYPE_PACKED_PIXELS) { if (visual == FB_VISUAL_PSEUDOCOLOR || visual == FB_VISUAL_STATIC_PSEUDOCOLOR) { bogl_pixel = bogl_pcfb_pixel; bogl_hline = bogl_pcfb_hline; bogl_vline = bogl_pcfb_vline; bogl_clear = bogl_pcfb_clear; bogl_text = bogl_pcfb_text; bogl_put = bogl_pcfb_put; bogl_pointer = bogl_pcfb_pointer; return 1; } else if (visual == FB_VISUAL_TRUECOLOR || visual == FB_VISUAL_DIRECTCOLOR) { bogl_pixel = bogl_tcfb_pixel; bogl_hline = bogl_tcfb_hline; bogl_vline = bogl_tcfb_vline; bogl_clear = bogl_tcfb_clear; bogl_text = bogl_tcfb_text; bogl_put = bogl_tcfb_put; bogl_pointer = bogl_tcfb_pointer; return 1; } } /* FIXME: what about directcolor? */ #endif return 0; } /* Disable drawing by setting all the bogl_* device-specific functions to dummy functions. */ static void draw_disable (void) { bogl_pixel = dummy_pixel; bogl_hline = dummy_hline; bogl_vline = dummy_vline; bogl_text = dummy_text; bogl_clear = dummy_clear; bogl_move = dummy_move; bogl_put = dummy_put; bogl_pointer = dummy_pointer; bogl_reinit = NULL; } /* Signal handler called whenever the kernel wants to switch to or from our tty. */ static void vt_switch (int sig unused) { signal (SIGUSR2, vt_switch); /* If a BOGL drawing function is in progress then we cannot mode switch right now because the drawing function would continue to scribble on the screen after the switch. So disable further drawing and schedule an alarm to try again in .1 second. */ if (bogl_drawing) { draw_disable (); signal (SIGALRM, vt_switch); { struct itimerval duration; duration.it_interval.tv_sec = 0; duration.it_interval.tv_usec = 0; duration.it_value.tv_sec = 0; duration.it_value.tv_usec = 100000; if (-1 == setitimer (ITIMER_REAL, &duration, NULL)) bogl_fail ("can't set timer: %s", strerror (errno)); } return; } if (visible) { visible = 0; draw_disable (); if (-1 == ioctl (tty, VT_RELDISP, 1)) bogl_fail ("can't switch away from VT: %s", strerror (errno)); } else { visible = 1; draw_enable (); if (-1 == ioctl (tty, VT_RELDISP, VT_ACKACQ)) bogl_fail ("can't acknowledge VT switch: %s", strerror (errno)); if (bogl_reinit != NULL) bogl_reinit (); bogl_refresh = 2; } } /* Sets the BOGL error message to MESSAGE if there is none already set. Returns 0. */ int bogl_fail (const char *format, ...) { va_list args; if (error) return 0; va_start (args, format); vasprintf (&error, format, args); va_end (args); return 0; } /* Set a file descriptor to close-on-exec. */ int bogl_cloexec(int fd) { int flags; flags = fcntl (fd, F_GETFD); if (flags < 0) return flags; if (fcntl (fd, F_SETFD, flags | FD_CLOEXEC) < 0) return -1; return 0; } bogl-0.1.18/bogl-bgf.h0000644000000000000000000000005711407777275011265 0ustar struct bogl_font *bogl_mmap_font(char *file); bogl-0.1.18/bogl-font.c0000644000000000000000000002542111407777275011472 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #define _GNU_SOURCE 1 #include #include #include #include #include #include #include "bogl.h" #include "boglP.h" #include "bogl-font.h" #define INDEX_BITS 8 #define INDEX_MASK ((1< 0 && isspace ((unsigned char) line[len - 1])) line[--len] = 0; return 1; } /* Attempt to malloc NBYTES bytes. Sets a BOGL error message on failure. Returns the result of the malloc() operation in any case. */ void * smalloc (size_t nbytes) { void *p = malloc (nbytes); if (p == NULL) bogl_fail ("%s:%d: virtual memory exhausted", filename, ln); return p; } /* Parse header information. Returns nonzero if successful, reports an error message using bogl_fail() if not. On success will always: set ascent, descent, default_char, font_height, and initialize font_glyphs. */ int read_bdf_header (void) { int bbx = 0, bby = 0, bbw = 0, bbh = 0; ascent = descent = 0; default_char = ' '; for (;;) { if (!read_line ()) return 0; if (matches_prefix (line, "FONT_ASCENT ")) ascent = atoi (line + strlen ("FONT_ASCENT ")); else if (matches_prefix (line, "FONT_DESCENT")) descent = atoi (line + strlen ("FONT_DESCENT")); else if (matches_prefix (line, "DEFAULT_CHAR ")) default_char = atoi (line + strlen ("DEFAULT_CHAR ")); else if (matches_prefix (line, "FONTBOUNDINGBOX ")) sscanf (line + strlen ("FONTBOUNDINGBOX "), "%d %d %d %d", &bbw, &bbh, &bbx, &bby); else if (matches_prefix (line, "CHARS ")) break; } n_chars = atoi (line + strlen ("CHARS ")); if (n_chars < 1) return bogl_fail ("%s:%d: font contains no characters", filename, ln); /* Adjust ascent and descent based on bounding box. */ if (-bby > descent) descent = -bby; if (bby + bbh > ascent) ascent = bby + bbh; font_height = ascent + descent; if (font_height <= 0) return bogl_fail ("%s:%d: font ascent (%d) + descent (%d) must be " "positive", filename, ln, ascent, descent); { int i; for (i = 0; i < (1<content, font->offset, and font->width as appropriate. Updates char_index. */ int read_character (void) { int encoding = -1; int width = INT_MIN; int bbx = 0, bby = 0, bbw = 0, bbh = 0; /* Read everything for this character up to the bitmap. */ for (;;) { if (!read_line ()) return 0; if (matches_prefix (line, "ENCODING ")) encoding = atoi (line + strlen ("ENCODING ")); else if (matches_prefix (line, "DWIDTH ")) width = atoi (line + strlen ("DWIDTH ")); else if (matches_prefix (line, "BBX ")) sscanf (line + strlen ("BBX "), "%d %d %d %d", &bbw, &bbh, &bbx, &bby); else if (matches_prefix (line, "BITMAP")) break; } /* Adjust width based on bounding box. */ if (width == INT_MIN) return bogl_fail ("%s:%d: character width not specified", filename, ln); if (bbx < 0) { width -= bbx; bbx = 0; } if (bbx + bbw > width) width = bbx + bbw; /* Put the character's encoding into the font table. */ if (encoding != -1 && width <= INDEX_MASK) { u_int32_t *content, *bm; int i; struct bogl_glyph **t; t = &font_glyphs[encoding & INDEX_MASK]; while (*t && (((*t)->char_width & ~INDEX_MASK) != (encoding & ~INDEX_MASK))) t = &((*t)->next); if (*t) return bogl_fail ("%s:%d: duplicate entry for character"); *t = smalloc (sizeof (struct bogl_glyph)); if (*t == NULL) return 0; content = smalloc (sizeof (u_int32_t) * font_height * ((width + 31)/32)); if (content == NULL) { free (*t); *t = NULL; return 0; } memset(content, 0, sizeof (u_int32_t) * font_height * ((width + 31)/32)); (*t)->char_width = (encoding & ~INDEX_MASK) | width; (*t)->next = NULL; (*t)->content = content; /* Read the glyph bitmap. */ /* FIXME: This won't work for glyphs wider than 32 pixels. */ bm = content; for (i = 0; ; i++) { int row; if (!read_line ()) return 0; if (matches_prefix (line, "ENDCHAR")) break; if (encoding == -1) continue; row = font_height - descent - bby - bbh + i; if (row < 0 || row >= font_height) continue; bm[row] = strtol (line, NULL, 16) << (32 - 4 * strlen (line) - bbx); } } /* Advance to next glyph. */ if (encoding != -1) char_index++; return 1; } void free_font_glyphs (void) { int i; struct bogl_glyph *t, *tnext; for (i = 0; i < (1<next; free (t); } } /* Open the file. */ file = fopen (filename, "r"); if (file == NULL) { bogl_fail ("opening %s: %s\n", filename, strerror (errno)); return NULL; } /* Make the font name based on the filename. This is probably not the best thing to do, but it seems to work okay for now. */ { unsigned char *cp; font_name = strdup (filename); if (font_name == NULL) { bogl_fail ("virtual memory exhausted"); goto lossage; } cp = strstr (font_name, ".bdf"); if (cp) *cp = 0; for (cp = (unsigned char *) font_name; *cp; cp++) if (!isalnum (*cp)) *cp = '_'; } line = NULL; line_size = 0; char_index = 0; /* Read the header. */ if (!read_bdf_header ()) goto lossage; /* Read all the glyphs. */ { for (;;) { if (!read_line ()) goto lossage; if (matches_prefix (line, "STARTCHAR ")) { #if 0 if (char_index >= n_chars) { bogl_fail ("%s:%d: font contains more characters than " "declared", filename, ln); goto lossage; } #endif if (!read_character ()) goto lossage; } else if (matches_prefix (line, "ENDFONT")) break; } /* Make sure that we found at least one encoded character. */ if (!char_index) { bogl_fail ("%s:%d: font contains no encoded characters", filename, ln); goto lossage; } } /* Build the bogl_font structure. */ { struct bogl_font *font = NULL; int *offset = NULL; int *index = NULL; u_int32_t *content = NULL; int index_size = 0, indexp = 0; int content_size = 0, contentp = 0; int i, j; for (i = 0; i < (1<next) { index_size += 2; content_size += font_height * (((t->char_width & INDEX_MASK) + 31) / 32); } ++index_size; } } font = smalloc (sizeof (struct bogl_font)); offset = smalloc (sizeof (int) * (1<next) { int n = font_height * (((t->char_width & INDEX_MASK) + 31) / 32); index[indexp++] = t->char_width; index[indexp++] = contentp; for (j = 0; j < n; j++) content[contentp++] = t->content[j]; } index[indexp++] = 0; } } #if 0 if (indexp != index_size || contentp != content_size) { bogl_fail ("Internal error"); return NULL; } #endif font->name = font_name; font->height = font_height; font->index_mask = INDEX_MASK; font->index = index; font->offset = offset; font->content = content; font->default_char = default_char; /* Clean up. */ free_font_glyphs (); fclose (file); free (line); return font; } lossage: /* Come here on error. */ free_font_glyphs (); free (line); fclose (file); return NULL; } /* Free FONT. */ void bogl_free_font (struct bogl_font *font) { free (font->name); free (font->offset); free (font->content); free (font); } bogl-0.1.18/helvR10.bdf0000644000000000000000000006233011407777275011335 0ustar STARTFONT 2.1 FONT -Adobe-Helvetica-Medium-R-Normal--10-100-75-75-P-56-ISO8859-1 SIZE 10 75 75 FONTBOUNDINGBOX 11 13 -1 -2 COMMENT $XConsortium: helvR10.bdf,v 1.13 95/01/26 18:02:53 gildea Exp $ COMMENT COMMENT + COMMENT Copyright 1984-1989, 1994 Adobe Systems Incorporated. COMMENT Copyright 1988, 1994 Digital Equipment Corporation. COMMENT COMMENT Adobe is a trademark of Adobe Systems Incorporated which may be COMMENT registered in certain jurisdictions. COMMENT Permission to use these trademarks is hereby granted only in COMMENT association with the images described in this file. COMMENT COMMENT Permission to use, copy, modify, distribute and sell this software COMMENT and its documentation for any purpose and without fee is hereby COMMENT granted, provided that the above copyright notices appear in all COMMENT copies and that both those copyright notices and this permission COMMENT notice appear in supporting documentation, and that the names of COMMENT Adobe Systems and Digital Equipment Corporation not be used in COMMENT advertising or publicity pertaining to distribution of the software COMMENT without specific, written prior permission. Adobe Systems and COMMENT Digital Equipment Corporation make no representations about the COMMENT suitability of this software for any purpose. It is provided "as COMMENT is" without express or implied warranty. COMMENT - STARTPROPERTIES 28 FOUNDRY "Adobe" FAMILY_NAME "Helvetica" WEIGHT_NAME "Medium" SLANT "R" SETWIDTH_NAME "Normal" ADD_STYLE_NAME "" PIXEL_SIZE 10 POINT_SIZE 100 RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "P" AVERAGE_WIDTH 56 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" CAP_HEIGHT 8 X_HEIGHT 6 FONT_ASCENT 10 FONT_DESCENT 2 FACE_NAME "Helvetica" COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved." NOTICE "Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries. " _DEC_DEVICE_FONTNAMES "PS=Helvetica" _DEC_PRODUCTINFO "DECwindows Fonts V2.2, 07-Nov-1991" DEFAULT_CHAR 32 RELATIVE_SETWIDTH 50 RELATIVE_WEIGHT 50 CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD" FULL_NAME "Helvetica" ENDPROPERTIES CHARS 229 STARTCHAR space ENCODING 32 SWIDTH 278 0 DWIDTH 3 0 BBX 1 1 0 0 BITMAP 00 ENDCHAR STARTCHAR exclam ENCODING 33 SWIDTH 278 0 DWIDTH 3 0 BBX 1 8 1 0 BITMAP 80 80 80 80 80 80 00 80 ENDCHAR STARTCHAR quotedbl ENCODING 34 SWIDTH 355 0 DWIDTH 4 0 BBX 3 2 1 6 BITMAP A0 A0 ENDCHAR STARTCHAR numbersign ENCODING 35 SWIDTH 556 0 DWIDTH 6 0 BBX 6 7 0 0 BITMAP 28 28 7C 28 F8 50 50 ENDCHAR STARTCHAR dollar ENCODING 36 SWIDTH 556 0 DWIDTH 6 0 BBX 5 9 0 -1 BITMAP 20 70 A8 A0 70 28 A8 70 20 ENDCHAR STARTCHAR percent ENCODING 37 SWIDTH 889 0 DWIDTH 9 0 BBX 8 8 0 0 BITMAP 64 94 68 08 10 16 29 26 ENDCHAR STARTCHAR ampersand ENCODING 38 SWIDTH 667 0 DWIDTH 8 0 BBX 6 8 1 0 BITMAP 20 50 50 60 A4 98 98 64 ENDCHAR STARTCHAR quoteright ENCODING 39 SWIDTH 222 0 DWIDTH 3 0 BBX 2 3 1 5 BITMAP 40 40 80 ENDCHAR STARTCHAR parenleft ENCODING 40 SWIDTH 333 0 DWIDTH 4 0 BBX 3 10 0 -2 BITMAP 20 40 40 80 80 80 80 40 40 20 ENDCHAR STARTCHAR parenright ENCODING 41 SWIDTH 333 0 DWIDTH 4 0 BBX 3 10 1 -2 BITMAP 80 40 40 20 20 20 20 40 40 80 ENDCHAR STARTCHAR asterisk ENCODING 42 SWIDTH 389 0 DWIDTH 4 0 BBX 3 3 0 5 BITMAP A0 40 A0 ENDCHAR STARTCHAR plus ENCODING 43 SWIDTH 584 0 DWIDTH 6 0 BBX 5 5 0 1 BITMAP 20 20 F8 20 20 ENDCHAR STARTCHAR comma ENCODING 44 SWIDTH 278 0 DWIDTH 3 0 BBX 2 3 0 -2 BITMAP 40 40 80 ENDCHAR STARTCHAR minus ENCODING 45 SWIDTH 584 0 DWIDTH 7 0 BBX 5 1 1 3 BITMAP F8 ENDCHAR STARTCHAR period ENCODING 46 SWIDTH 278 0 DWIDTH 3 0 BBX 1 1 1 0 BITMAP 80 ENDCHAR STARTCHAR slash ENCODING 47 SWIDTH 278 0 DWIDTH 3 0 BBX 3 8 0 0 BITMAP 20 20 40 40 40 40 80 80 ENDCHAR STARTCHAR zero ENCODING 48 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 70 88 88 88 88 88 88 70 ENDCHAR STARTCHAR one ENCODING 49 SWIDTH 556 0 DWIDTH 6 0 BBX 2 8 1 0 BITMAP 40 C0 40 40 40 40 40 40 ENDCHAR STARTCHAR two ENCODING 50 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 70 88 08 08 30 40 80 F8 ENDCHAR STARTCHAR three ENCODING 51 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 70 88 08 30 08 08 88 70 ENDCHAR STARTCHAR four ENCODING 52 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 10 30 50 50 90 F8 10 10 ENDCHAR STARTCHAR five ENCODING 53 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP F8 80 80 F0 08 08 88 70 ENDCHAR STARTCHAR six ENCODING 54 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 70 88 80 B0 C8 88 88 70 ENDCHAR STARTCHAR seven ENCODING 55 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP F8 08 10 10 20 20 40 40 ENDCHAR STARTCHAR eight ENCODING 56 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 70 88 88 70 88 88 88 70 ENDCHAR STARTCHAR nine ENCODING 57 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 70 88 88 98 68 08 88 70 ENDCHAR STARTCHAR colon ENCODING 58 SWIDTH 278 0 DWIDTH 3 0 BBX 1 6 1 0 BITMAP 80 00 00 00 00 80 ENDCHAR STARTCHAR semicolon ENCODING 59 SWIDTH 278 0 DWIDTH 3 0 BBX 2 8 0 -2 BITMAP 40 00 00 00 00 40 40 80 ENDCHAR STARTCHAR less ENCODING 60 SWIDTH 584 0 DWIDTH 6 0 BBX 3 5 1 1 BITMAP 20 40 80 40 20 ENDCHAR STARTCHAR equal ENCODING 61 SWIDTH 584 0 DWIDTH 5 0 BBX 4 3 0 2 BITMAP F0 00 F0 ENDCHAR STARTCHAR greater ENCODING 62 SWIDTH 584 0 DWIDTH 6 0 BBX 3 5 1 1 BITMAP 80 40 20 40 80 ENDCHAR STARTCHAR question ENCODING 63 SWIDTH 556 0 DWIDTH 6 0 BBX 4 8 1 0 BITMAP 60 90 10 20 40 40 00 40 ENDCHAR STARTCHAR at ENCODING 64 SWIDTH 1015 0 DWIDTH 11 0 BBX 10 10 0 -2 BITMAP 1F00 2080 4D40 9240 A240 A480 A480 9B00 4000 3E00 ENDCHAR STARTCHAR A ENCODING 65 SWIDTH 667 0 DWIDTH 7 0 BBX 7 8 0 0 BITMAP 10 10 28 28 44 7C 82 82 ENDCHAR STARTCHAR B ENCODING 66 SWIDTH 667 0 DWIDTH 7 0 BBX 5 8 1 0 BITMAP F0 88 88 F0 88 88 88 F0 ENDCHAR STARTCHAR C ENCODING 67 SWIDTH 722 0 DWIDTH 8 0 BBX 6 8 1 0 BITMAP 78 84 80 80 80 80 84 78 ENDCHAR STARTCHAR D ENCODING 68 SWIDTH 722 0 DWIDTH 8 0 BBX 6 8 1 0 BITMAP F0 88 84 84 84 84 88 F0 ENDCHAR STARTCHAR E ENCODING 69 SWIDTH 667 0 DWIDTH 7 0 BBX 5 8 1 0 BITMAP F8 80 80 F8 80 80 80 F8 ENDCHAR STARTCHAR F ENCODING 70 SWIDTH 611 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 80 80 F0 80 80 80 80 ENDCHAR STARTCHAR G ENCODING 71 SWIDTH 778 0 DWIDTH 8 0 BBX 6 8 1 0 BITMAP 78 84 80 80 8C 84 8C 74 ENDCHAR STARTCHAR H ENCODING 72 SWIDTH 722 0 DWIDTH 8 0 BBX 6 8 1 0 BITMAP 84 84 84 FC 84 84 84 84 ENDCHAR STARTCHAR I ENCODING 73 SWIDTH 278 0 DWIDTH 3 0 BBX 1 8 1 0 BITMAP 80 80 80 80 80 80 80 80 ENDCHAR STARTCHAR J ENCODING 74 SWIDTH 500 0 DWIDTH 5 0 BBX 4 8 0 0 BITMAP 10 10 10 10 10 10 90 60 ENDCHAR STARTCHAR K ENCODING 75 SWIDTH 667 0 DWIDTH 7 0 BBX 5 8 1 0 BITMAP 88 90 A0 E0 90 90 88 88 ENDCHAR STARTCHAR L ENCODING 76 SWIDTH 556 0 DWIDTH 6 0 BBX 4 8 1 0 BITMAP 80 80 80 80 80 80 80 F0 ENDCHAR STARTCHAR M ENCODING 77 SWIDTH 833 0 DWIDTH 9 0 BBX 7 8 1 0 BITMAP 82 C6 C6 AA AA 92 92 92 ENDCHAR STARTCHAR N ENCODING 78 SWIDTH 722 0 DWIDTH 8 0 BBX 6 8 1 0 BITMAP C4 C4 A4 A4 94 94 8C 8C ENDCHAR STARTCHAR O ENCODING 79 SWIDTH 778 0 DWIDTH 8 0 BBX 6 8 1 0 BITMAP 78 84 84 84 84 84 84 78 ENDCHAR STARTCHAR P ENCODING 80 SWIDTH 667 0 DWIDTH 7 0 BBX 5 8 1 0 BITMAP F0 88 88 F0 80 80 80 80 ENDCHAR STARTCHAR Q ENCODING 81 SWIDTH 778 0 DWIDTH 8 0 BBX 7 9 1 -1 BITMAP 78 84 84 84 84 94 8C 7C 02 ENDCHAR STARTCHAR R ENCODING 82 SWIDTH 722 0 DWIDTH 7 0 BBX 5 8 1 0 BITMAP F0 88 88 F0 88 88 88 88 ENDCHAR STARTCHAR S ENCODING 83 SWIDTH 667 0 DWIDTH 7 0 BBX 5 8 1 0 BITMAP 70 88 80 70 08 88 88 70 ENDCHAR STARTCHAR T ENCODING 84 SWIDTH 611 0 DWIDTH 5 0 BBX 5 8 0 0 BITMAP F8 20 20 20 20 20 20 20 ENDCHAR STARTCHAR U ENCODING 85 SWIDTH 722 0 DWIDTH 8 0 BBX 6 8 1 0 BITMAP 84 84 84 84 84 84 84 78 ENDCHAR STARTCHAR V ENCODING 86 SWIDTH 667 0 DWIDTH 7 0 BBX 7 8 0 0 BITMAP 82 82 44 44 44 28 28 10 ENDCHAR STARTCHAR W ENCODING 87 SWIDTH 944 0 DWIDTH 9 0 BBX 9 8 0 0 BITMAP 8880 8880 4900 4900 5500 2200 2200 2200 ENDCHAR STARTCHAR X ENCODING 88 SWIDTH 667 0 DWIDTH 7 0 BBX 5 8 1 0 BITMAP 88 88 50 20 50 50 88 88 ENDCHAR STARTCHAR Y ENCODING 89 SWIDTH 667 0 DWIDTH 7 0 BBX 7 8 0 0 BITMAP 82 44 44 28 28 10 10 10 ENDCHAR STARTCHAR Z ENCODING 90 SWIDTH 611 0 DWIDTH 7 0 BBX 5 8 1 0 BITMAP F8 08 10 20 20 40 80 F8 ENDCHAR STARTCHAR bracketleft ENCODING 91 SWIDTH 278 0 DWIDTH 3 0 BBX 2 10 1 -2 BITMAP C0 80 80 80 80 80 80 80 80 C0 ENDCHAR STARTCHAR backslash ENCODING 92 SWIDTH 278 0 DWIDTH 3 0 BBX 3 8 0 0 BITMAP 80 80 40 40 40 40 20 20 ENDCHAR STARTCHAR bracketright ENCODING 93 SWIDTH 278 0 DWIDTH 3 0 BBX 2 10 0 -2 BITMAP C0 40 40 40 40 40 40 40 40 C0 ENDCHAR STARTCHAR asciicircum ENCODING 94 SWIDTH 469 0 DWIDTH 6 0 BBX 5 5 0 3 BITMAP 20 20 50 50 88 ENDCHAR STARTCHAR underscore ENCODING 95 SWIDTH 556 0 DWIDTH 6 0 BBX 6 1 0 -2 BITMAP FC ENDCHAR STARTCHAR quoteleft ENCODING 96 SWIDTH 222 0 DWIDTH 3 0 BBX 2 3 0 5 BITMAP 40 80 80 ENDCHAR STARTCHAR a ENCODING 97 SWIDTH 556 0 DWIDTH 5 0 BBX 5 6 0 0 BITMAP E0 10 70 90 90 68 ENDCHAR STARTCHAR b ENCODING 98 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 80 80 B0 C8 88 88 C8 B0 ENDCHAR STARTCHAR c ENCODING 99 SWIDTH 500 0 DWIDTH 5 0 BBX 4 6 0 0 BITMAP 60 90 80 80 90 60 ENDCHAR STARTCHAR d ENCODING 100 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 08 08 68 98 88 88 98 68 ENDCHAR STARTCHAR e ENCODING 101 SWIDTH 556 0 DWIDTH 5 0 BBX 4 6 0 0 BITMAP 60 90 F0 80 90 60 ENDCHAR STARTCHAR f ENCODING 102 SWIDTH 278 0 DWIDTH 4 0 BBX 4 8 0 0 BITMAP 30 40 E0 40 40 40 40 40 ENDCHAR STARTCHAR g ENCODING 103 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 -2 BITMAP 68 98 88 88 98 68 08 70 ENDCHAR STARTCHAR h ENCODING 104 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 80 80 B0 C8 88 88 88 88 ENDCHAR STARTCHAR i ENCODING 105 SWIDTH 222 0 DWIDTH 2 0 BBX 1 8 0 0 BITMAP 80 00 80 80 80 80 80 80 ENDCHAR STARTCHAR j ENCODING 106 SWIDTH 222 0 DWIDTH 2 0 BBX 1 9 0 -1 BITMAP 80 00 80 80 80 80 80 80 80 ENDCHAR STARTCHAR k ENCODING 107 SWIDTH 500 0 DWIDTH 5 0 BBX 4 8 0 0 BITMAP 80 80 90 A0 C0 A0 90 90 ENDCHAR STARTCHAR l ENCODING 108 SWIDTH 222 0 DWIDTH 2 0 BBX 1 8 0 0 BITMAP 80 80 80 80 80 80 80 80 ENDCHAR STARTCHAR m ENCODING 109 SWIDTH 833 0 DWIDTH 8 0 BBX 7 6 0 0 BITMAP EC 92 92 92 92 92 ENDCHAR STARTCHAR n ENCODING 110 SWIDTH 556 0 DWIDTH 6 0 BBX 5 6 0 0 BITMAP B0 C8 88 88 88 88 ENDCHAR STARTCHAR o ENCODING 111 SWIDTH 556 0 DWIDTH 6 0 BBX 5 6 0 0 BITMAP 70 88 88 88 88 70 ENDCHAR STARTCHAR p ENCODING 112 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 -2 BITMAP B0 C8 88 88 C8 B0 80 80 ENDCHAR STARTCHAR q ENCODING 113 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 -2 BITMAP 68 98 88 88 98 68 08 08 ENDCHAR STARTCHAR r ENCODING 114 SWIDTH 333 0 DWIDTH 4 0 BBX 3 6 0 0 BITMAP A0 C0 80 80 80 80 ENDCHAR STARTCHAR s ENCODING 115 SWIDTH 500 0 DWIDTH 5 0 BBX 4 6 0 0 BITMAP 60 90 60 10 90 60 ENDCHAR STARTCHAR t ENCODING 116 SWIDTH 278 0 DWIDTH 4 0 BBX 3 8 0 0 BITMAP 40 40 E0 40 40 40 40 60 ENDCHAR STARTCHAR u ENCODING 117 SWIDTH 556 0 DWIDTH 5 0 BBX 4 6 0 0 BITMAP 90 90 90 90 90 70 ENDCHAR STARTCHAR v ENCODING 118 SWIDTH 500 0 DWIDTH 6 0 BBX 5 6 0 0 BITMAP 88 88 50 50 20 20 ENDCHAR STARTCHAR w ENCODING 119 SWIDTH 722 0 DWIDTH 8 0 BBX 7 6 0 0 BITMAP 92 92 54 54 28 28 ENDCHAR STARTCHAR x ENCODING 120 SWIDTH 500 0 DWIDTH 6 0 BBX 5 6 0 0 BITMAP 88 50 20 50 88 88 ENDCHAR STARTCHAR y ENCODING 121 SWIDTH 500 0 DWIDTH 5 0 BBX 4 8 0 -2 BITMAP 90 90 A0 A0 60 40 40 80 ENDCHAR STARTCHAR z ENCODING 122 SWIDTH 500 0 DWIDTH 5 0 BBX 4 6 0 0 BITMAP F0 10 20 40 80 F0 ENDCHAR STARTCHAR braceleft ENCODING 123 SWIDTH 334 0 DWIDTH 3 0 BBX 3 10 0 -2 BITMAP 20 40 40 40 80 40 40 40 40 20 ENDCHAR STARTCHAR bar ENCODING 124 SWIDTH 260 0 DWIDTH 3 0 BBX 1 10 1 -2 BITMAP 80 80 80 80 80 80 80 80 80 80 ENDCHAR STARTCHAR braceright ENCODING 125 SWIDTH 334 0 DWIDTH 3 0 BBX 3 10 0 -2 BITMAP 80 40 40 40 20 40 40 40 40 80 ENDCHAR STARTCHAR asciitilde ENCODING 126 SWIDTH 584 0 DWIDTH 7 0 BBX 6 2 0 3 BITMAP 64 98 ENDCHAR STARTCHAR space ENCODING 160 SWIDTH 278 0 DWIDTH 3 0 BBX 1 1 0 0 BITMAP 00 ENDCHAR STARTCHAR exclamdown ENCODING 161 SWIDTH 333 0 DWIDTH 3 0 BBX 1 8 1 -2 BITMAP 80 00 80 80 80 80 80 80 ENDCHAR STARTCHAR cent ENCODING 162 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 -1 BITMAP 10 70 A8 A0 A0 A8 70 40 ENDCHAR STARTCHAR sterling ENCODING 163 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 30 48 40 E0 40 40 48 B0 ENDCHAR STARTCHAR currency ENCODING 164 SWIDTH 556 0 DWIDTH 5 0 BBX 4 6 0 1 BITMAP 90 60 90 90 60 90 ENDCHAR STARTCHAR yen ENCODING 165 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 88 88 50 50 F8 20 F8 20 ENDCHAR STARTCHAR brokenbar ENCODING 166 SWIDTH 260 0 DWIDTH 3 0 BBX 1 10 1 -2 BITMAP 80 80 80 80 00 00 80 80 80 80 ENDCHAR STARTCHAR section ENCODING 167 SWIDTH 556 0 DWIDTH 6 0 BBX 5 10 0 -2 BITMAP 70 88 C0 70 98 C8 70 18 88 70 ENDCHAR STARTCHAR dieresis ENCODING 168 SWIDTH 333 0 DWIDTH 3 0 BBX 3 1 0 7 BITMAP A0 ENDCHAR STARTCHAR copyright ENCODING 169 SWIDTH 737 0 DWIDTH 9 0 BBX 7 7 1 0 BITMAP 38 44 9A A2 9A 44 38 ENDCHAR STARTCHAR ordfeminine ENCODING 170 SWIDTH 370 0 DWIDTH 4 0 BBX 3 5 0 3 BITMAP E0 20 A0 00 E0 ENDCHAR STARTCHAR guillemotleft ENCODING 171 SWIDTH 556 0 DWIDTH 6 0 BBX 5 5 0 0 BITMAP 28 50 A0 50 28 ENDCHAR STARTCHAR logicalnot ENCODING 172 SWIDTH 584 0 DWIDTH 7 0 BBX 5 3 1 2 BITMAP F8 08 08 ENDCHAR STARTCHAR hyphen ENCODING 173 SWIDTH 333 0 DWIDTH 4 0 BBX 3 1 0 3 BITMAP E0 ENDCHAR STARTCHAR registered ENCODING 174 SWIDTH 737 0 DWIDTH 9 0 BBX 7 7 1 0 BITMAP 38 44 BA B2 AA 44 38 ENDCHAR STARTCHAR macron ENCODING 175 SWIDTH 333 0 DWIDTH 3 0 BBX 3 1 0 7 BITMAP E0 ENDCHAR STARTCHAR degree ENCODING 176 SWIDTH 400 0 DWIDTH 4 0 BBX 4 4 0 3 BITMAP 60 90 90 60 ENDCHAR STARTCHAR plusminus ENCODING 177 SWIDTH 584 0 DWIDTH 6 0 BBX 5 7 0 0 BITMAP 20 20 F8 20 20 00 F8 ENDCHAR STARTCHAR twosuperior ENCODING 178 SWIDTH 333 0 DWIDTH 3 0 BBX 3 4 0 3 BITMAP 60 A0 40 E0 ENDCHAR STARTCHAR threesuperior ENCODING 179 SWIDTH 333 0 DWIDTH 3 0 BBX 3 4 0 3 BITMAP E0 40 20 C0 ENDCHAR STARTCHAR acute ENCODING 180 SWIDTH 333 0 DWIDTH 3 0 BBX 2 2 0 6 BITMAP 40 80 ENDCHAR STARTCHAR mu ENCODING 181 SWIDTH 556 0 DWIDTH 5 0 BBX 4 8 0 -2 BITMAP 90 90 90 90 90 F0 80 80 ENDCHAR STARTCHAR paragraph ENCODING 182 SWIDTH 537 0 DWIDTH 6 0 BBX 6 10 0 -2 BITMAP 7C E8 E8 E8 68 28 28 28 28 28 ENDCHAR STARTCHAR periodcentered ENCODING 183 SWIDTH 278 0 DWIDTH 3 0 BBX 2 1 0 3 BITMAP C0 ENDCHAR STARTCHAR cedilla ENCODING 184 SWIDTH 333 0 DWIDTH 3 0 BBX 2 2 0 -2 BITMAP 40 C0 ENDCHAR STARTCHAR onesuperior ENCODING 185 SWIDTH 333 0 DWIDTH 3 0 BBX 2 4 0 3 BITMAP 40 C0 40 40 ENDCHAR STARTCHAR ordmasculine ENCODING 186 SWIDTH 365 0 DWIDTH 4 0 BBX 3 5 0 3 BITMAP E0 A0 E0 00 E0 ENDCHAR STARTCHAR guillemotright ENCODING 187 SWIDTH 556 0 DWIDTH 6 0 BBX 5 5 0 0 BITMAP A0 50 28 50 A0 ENDCHAR STARTCHAR onequarter ENCODING 188 SWIDTH 834 0 DWIDTH 9 0 BBX 9 8 0 0 BITMAP 4200 C400 4400 4800 0900 1300 1780 2100 ENDCHAR STARTCHAR onehalf ENCODING 189 SWIDTH 834 0 DWIDTH 9 0 BBX 8 8 0 0 BITMAP 42 C4 44 48 0B 15 12 27 ENDCHAR STARTCHAR threequarters ENCODING 190 SWIDTH 834 0 DWIDTH 9 0 BBX 9 8 0 0 BITMAP E200 4400 2400 C800 0900 1300 1780 2100 ENDCHAR STARTCHAR questiondown ENCODING 191 SWIDTH 611 0 DWIDTH 6 0 BBX 4 8 1 -2 BITMAP 20 00 20 20 40 80 90 60 ENDCHAR STARTCHAR Agrave ENCODING 192 SWIDTH 667 0 DWIDTH 7 0 BBX 7 11 0 0 BITMAP 20 10 00 10 10 28 28 44 7C 82 82 ENDCHAR STARTCHAR Aacute ENCODING 193 SWIDTH 667 0 DWIDTH 7 0 BBX 7 11 0 0 BITMAP 08 10 00 10 10 28 28 44 7C 82 82 ENDCHAR STARTCHAR Acircumflex ENCODING 194 SWIDTH 667 0 DWIDTH 7 0 BBX 7 11 0 0 BITMAP 10 28 00 10 10 28 28 44 7C 82 82 ENDCHAR STARTCHAR Atilde ENCODING 195 SWIDTH 667 0 DWIDTH 7 0 BBX 7 11 0 0 BITMAP 14 28 00 10 10 28 28 44 7C 82 82 ENDCHAR STARTCHAR Adieresis ENCODING 196 SWIDTH 667 0 DWIDTH 7 0 BBX 7 10 0 0 BITMAP 28 00 10 10 28 28 44 7C 82 82 ENDCHAR STARTCHAR Aring ENCODING 197 SWIDTH 667 0 DWIDTH 7 0 BBX 7 11 0 0 BITMAP 10 28 10 10 10 28 28 44 7C 82 82 ENDCHAR STARTCHAR AE ENCODING 198 SWIDTH 1000 0 DWIDTH 10 0 BBX 9 8 0 0 BITMAP 1F80 1800 2800 2F80 4800 7800 8800 8F80 ENDCHAR STARTCHAR Ccedilla ENCODING 199 SWIDTH 722 0 DWIDTH 8 0 BBX 6 10 1 -2 BITMAP 78 84 80 80 80 80 84 78 10 30 ENDCHAR STARTCHAR Egrave ENCODING 200 SWIDTH 667 0 DWIDTH 7 0 BBX 5 11 1 0 BITMAP 40 20 00 F8 80 80 F8 80 80 80 F8 ENDCHAR STARTCHAR Eacute ENCODING 201 SWIDTH 667 0 DWIDTH 7 0 BBX 5 11 1 0 BITMAP 10 20 00 F8 80 80 F8 80 80 80 F8 ENDCHAR STARTCHAR Ecircumflex ENCODING 202 SWIDTH 667 0 DWIDTH 7 0 BBX 5 11 1 0 BITMAP 20 50 00 F8 80 80 80 F8 80 80 F8 ENDCHAR STARTCHAR Edieresis ENCODING 203 SWIDTH 667 0 DWIDTH 7 0 BBX 5 10 1 0 BITMAP 50 00 F8 80 80 F8 80 80 80 F8 ENDCHAR STARTCHAR Igrave ENCODING 204 SWIDTH 278 0 DWIDTH 3 0 BBX 2 11 0 0 BITMAP 80 40 00 40 40 40 40 40 40 40 40 ENDCHAR STARTCHAR Iacute ENCODING 205 SWIDTH 278 0 DWIDTH 3 0 BBX 2 11 1 0 BITMAP 40 80 00 80 80 80 80 80 80 80 80 ENDCHAR STARTCHAR Icircumflex ENCODING 206 SWIDTH 278 0 DWIDTH 3 0 BBX 3 11 0 0 BITMAP 40 A0 00 40 40 40 40 40 40 40 40 ENDCHAR STARTCHAR Idieresis ENCODING 207 SWIDTH 278 0 DWIDTH 3 0 BBX 3 10 0 0 BITMAP A0 00 40 40 40 40 40 40 40 40 ENDCHAR STARTCHAR Eth ENCODING 208 SWIDTH 722 0 DWIDTH 8 0 BBX 7 8 0 0 BITMAP 78 44 42 F2 42 42 44 78 ENDCHAR STARTCHAR Ntilde ENCODING 209 SWIDTH 722 0 DWIDTH 8 0 BBX 6 11 1 0 BITMAP 28 50 00 C4 C4 A4 A4 94 94 8C 8C ENDCHAR STARTCHAR Ograve ENCODING 210 SWIDTH 778 0 DWIDTH 8 0 BBX 6 11 1 0 BITMAP 20 10 00 78 84 84 84 84 84 84 78 ENDCHAR STARTCHAR Oacute ENCODING 211 SWIDTH 778 0 DWIDTH 8 0 BBX 6 11 1 0 BITMAP 08 10 00 78 84 84 84 84 84 84 78 ENDCHAR STARTCHAR Ocircumflex ENCODING 212 SWIDTH 778 0 DWIDTH 8 0 BBX 6 11 1 0 BITMAP 10 28 00 78 84 84 84 84 84 84 78 ENDCHAR STARTCHAR Otilde ENCODING 213 SWIDTH 778 0 DWIDTH 8 0 BBX 6 11 1 0 BITMAP 28 50 00 78 84 84 84 84 84 84 78 ENDCHAR STARTCHAR Odieresis ENCODING 214 SWIDTH 778 0 DWIDTH 8 0 BBX 6 10 1 0 BITMAP 48 00 78 84 84 84 84 84 84 78 ENDCHAR STARTCHAR multiply ENCODING 215 SWIDTH 584 0 DWIDTH 6 0 BBX 5 5 0 1 BITMAP 88 50 20 50 88 ENDCHAR STARTCHAR Oslash ENCODING 216 SWIDTH 778 0 DWIDTH 8 0 BBX 6 10 1 -1 BITMAP 04 78 8C 94 94 A4 A4 C4 78 80 ENDCHAR STARTCHAR Ugrave ENCODING 217 SWIDTH 722 0 DWIDTH 8 0 BBX 6 11 1 0 BITMAP 20 10 00 84 84 84 84 84 84 84 78 ENDCHAR STARTCHAR Uacute ENCODING 218 SWIDTH 722 0 DWIDTH 8 0 BBX 6 11 1 0 BITMAP 10 20 00 84 84 84 84 84 84 84 78 ENDCHAR STARTCHAR Ucircumflex ENCODING 219 SWIDTH 722 0 DWIDTH 8 0 BBX 6 11 1 0 BITMAP 10 28 00 84 84 84 84 84 84 84 78 ENDCHAR STARTCHAR Udieresis ENCODING 220 SWIDTH 722 0 DWIDTH 8 0 BBX 6 10 1 0 BITMAP 48 00 84 84 84 84 84 84 84 78 ENDCHAR STARTCHAR Yacute ENCODING 221 SWIDTH 667 0 DWIDTH 7 0 BBX 7 11 0 0 BITMAP 08 10 00 82 44 44 28 28 10 10 10 ENDCHAR STARTCHAR Thorn ENCODING 222 SWIDTH 667 0 DWIDTH 7 0 BBX 5 8 1 0 BITMAP 80 80 F0 88 88 F0 80 80 ENDCHAR STARTCHAR germandbls ENCODING 223 SWIDTH 611 0 DWIDTH 5 0 BBX 4 8 0 0 BITMAP 60 90 90 A0 90 90 90 A0 ENDCHAR STARTCHAR agrave ENCODING 224 SWIDTH 556 0 DWIDTH 5 0 BBX 5 9 0 0 BITMAP 40 20 00 E0 10 70 90 90 68 ENDCHAR STARTCHAR aacute ENCODING 225 SWIDTH 556 0 DWIDTH 5 0 BBX 5 9 0 0 BITMAP 10 20 00 E0 10 70 90 90 68 ENDCHAR STARTCHAR acircumflex ENCODING 226 SWIDTH 556 0 DWIDTH 5 0 BBX 5 9 0 0 BITMAP 20 50 00 E0 10 70 90 90 68 ENDCHAR STARTCHAR atilde ENCODING 227 SWIDTH 556 0 DWIDTH 5 0 BBX 5 9 0 0 BITMAP 50 A0 00 E0 10 70 90 90 68 ENDCHAR STARTCHAR adieresis ENCODING 228 SWIDTH 556 0 DWIDTH 5 0 BBX 5 8 0 0 BITMAP 50 00 E0 10 70 90 90 68 ENDCHAR STARTCHAR aring ENCODING 229 SWIDTH 556 0 DWIDTH 5 0 BBX 5 9 0 0 BITMAP 20 50 20 E0 10 70 90 90 68 ENDCHAR STARTCHAR ae ENCODING 230 SWIDTH 889 0 DWIDTH 8 0 BBX 7 6 0 0 BITMAP EC 12 7E 90 92 6C ENDCHAR STARTCHAR ccedilla ENCODING 231 SWIDTH 500 0 DWIDTH 5 0 BBX 4 8 0 -2 BITMAP 60 90 80 80 90 60 20 60 ENDCHAR STARTCHAR egrave ENCODING 232 SWIDTH 556 0 DWIDTH 5 0 BBX 4 9 0 0 BITMAP 40 20 00 60 90 F0 80 90 60 ENDCHAR STARTCHAR eacute ENCODING 233 SWIDTH 556 0 DWIDTH 5 0 BBX 4 9 0 0 BITMAP 20 40 00 60 90 F0 80 90 60 ENDCHAR STARTCHAR ecircumflex ENCODING 234 SWIDTH 556 0 DWIDTH 5 0 BBX 4 9 0 0 BITMAP 20 50 00 60 90 F0 80 90 60 ENDCHAR STARTCHAR edieresis ENCODING 235 SWIDTH 556 0 DWIDTH 5 0 BBX 4 8 0 0 BITMAP 50 00 60 90 F0 80 90 60 ENDCHAR STARTCHAR igrave ENCODING 236 SWIDTH 278 0 DWIDTH 2 0 BBX 2 9 -1 0 BITMAP 80 40 00 40 40 40 40 40 40 ENDCHAR STARTCHAR iacute ENCODING 237 SWIDTH 278 0 DWIDTH 2 0 BBX 2 9 0 0 BITMAP 40 80 00 80 80 80 80 80 80 ENDCHAR STARTCHAR icircumflex ENCODING 238 SWIDTH 278 0 DWIDTH 2 0 BBX 3 9 -1 0 BITMAP 40 A0 00 40 40 40 40 40 40 ENDCHAR STARTCHAR idieresis ENCODING 239 SWIDTH 278 0 DWIDTH 2 0 BBX 3 8 0 0 BITMAP A0 00 40 40 40 40 40 40 ENDCHAR STARTCHAR eth ENCODING 240 SWIDTH 556 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 50 60 90 78 88 88 88 88 70 ENDCHAR STARTCHAR ntilde ENCODING 241 SWIDTH 556 0 DWIDTH 5 0 BBX 4 9 0 0 BITMAP 50 A0 00 E0 90 90 90 90 90 ENDCHAR STARTCHAR ograve ENCODING 242 SWIDTH 556 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 40 20 00 70 88 88 88 88 70 ENDCHAR STARTCHAR oacute ENCODING 243 SWIDTH 556 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 10 20 00 70 88 88 88 88 70 ENDCHAR STARTCHAR ocircumflex ENCODING 244 SWIDTH 556 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 20 50 00 70 88 88 88 88 70 ENDCHAR STARTCHAR otilde ENCODING 245 SWIDTH 556 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 28 50 00 70 88 88 88 88 70 ENDCHAR STARTCHAR odieresis ENCODING 246 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 50 00 70 88 88 88 88 70 ENDCHAR STARTCHAR divide ENCODING 247 SWIDTH 584 0 DWIDTH 6 0 BBX 5 5 0 1 BITMAP 20 00 F8 00 20 ENDCHAR STARTCHAR oslash ENCODING 248 SWIDTH 611 0 DWIDTH 6 0 BBX 6 6 0 0 BITMAP 74 98 A8 C8 88 70 ENDCHAR STARTCHAR ugrave ENCODING 249 SWIDTH 556 0 DWIDTH 5 0 BBX 4 9 0 0 BITMAP 40 20 00 90 90 90 90 90 70 ENDCHAR STARTCHAR uacute ENCODING 250 SWIDTH 556 0 DWIDTH 5 0 BBX 4 9 0 0 BITMAP 20 40 00 90 90 90 90 90 70 ENDCHAR STARTCHAR ucircumflex ENCODING 251 SWIDTH 556 0 DWIDTH 5 0 BBX 4 9 0 0 BITMAP 20 50 00 90 90 90 90 90 70 ENDCHAR STARTCHAR udieresis ENCODING 252 SWIDTH 556 0 DWIDTH 5 0 BBX 4 8 0 0 BITMAP 50 00 90 90 90 90 90 70 ENDCHAR STARTCHAR yacute ENCODING 253 SWIDTH 500 0 DWIDTH 5 0 BBX 4 11 0 -2 BITMAP 10 20 00 90 90 A0 A0 60 40 40 80 ENDCHAR STARTCHAR thorn ENCODING 254 SWIDTH 556 0 DWIDTH 6 0 BBX 5 10 0 -2 BITMAP 80 80 B0 C8 88 88 C8 B0 80 80 ENDCHAR STARTCHAR ydieresis ENCODING 255 SWIDTH 500 0 DWIDTH 5 0 BBX 4 10 0 -2 BITMAP 50 00 90 90 A0 A0 60 40 40 80 ENDCHAR STARTCHAR Lslash ENCODING -1 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 40 40 40 60 C0 40 40 78 ENDCHAR STARTCHAR OE ENCODING -1 SWIDTH 1000 0 DWIDTH 11 0 BBX 9 8 1 0 BITMAP 7F80 8800 8800 8F80 8800 8800 8800 7F80 ENDCHAR STARTCHAR Scaron ENCODING -1 SWIDTH 667 0 DWIDTH 7 0 BBX 5 9 1 0 BITMAP 50 20 00 78 80 78 08 88 70 ENDCHAR STARTCHAR Ydieresis ENCODING -1 SWIDTH 667 0 DWIDTH 7 0 BBX 5 8 1 0 BITMAP 50 00 88 88 50 20 20 20 ENDCHAR STARTCHAR Zcaron ENCODING -1 SWIDTH 611 0 DWIDTH 7 0 BBX 5 9 1 0 BITMAP 50 20 00 F8 10 20 40 80 F8 ENDCHAR STARTCHAR breve ENCODING -1 SWIDTH 333 0 DWIDTH 4 0 BBX 4 2 0 6 BITMAP 90 60 ENDCHAR STARTCHAR bullet ENCODING -1 SWIDTH 350 0 DWIDTH 4 0 BBX 2 2 1 3 BITMAP C0 C0 ENDCHAR STARTCHAR caron ENCODING -1 SWIDTH 333 0 DWIDTH 3 0 BBX 3 2 0 6 BITMAP A0 40 ENDCHAR STARTCHAR circumflex ENCODING -1 SWIDTH 333 0 DWIDTH 3 0 BBX 3 2 0 6 BITMAP 40 A0 ENDCHAR STARTCHAR dagger ENCODING -1 SWIDTH 556 0 DWIDTH 6 0 BBX 5 10 0 -2 BITMAP 20 20 F8 20 20 20 20 20 20 20 ENDCHAR STARTCHAR daggerdbl ENCODING -1 SWIDTH 556 0 DWIDTH 6 0 BBX 5 10 0 -2 BITMAP 20 20 F8 20 20 20 20 F8 20 20 ENDCHAR STARTCHAR dotaccent ENCODING -1 SWIDTH 333 0 DWIDTH 3 0 BBX 1 1 1 7 BITMAP 80 ENDCHAR STARTCHAR dotlessi ENCODING -1 SWIDTH 278 0 DWIDTH 2 0 BBX 1 6 0 0 BITMAP 80 80 80 80 80 80 ENDCHAR STARTCHAR ellipsis ENCODING -1 SWIDTH 1000 0 DWIDTH 9 0 BBX 7 1 1 0 BITMAP 92 ENDCHAR STARTCHAR emdash ENCODING -1 SWIDTH 1000 0 DWIDTH 10 0 BBX 10 1 0 3 BITMAP FFC0 ENDCHAR STARTCHAR endash ENCODING -1 SWIDTH 556 0 DWIDTH 6 0 BBX 6 1 0 3 BITMAP FC ENDCHAR STARTCHAR fi ENCODING -1 SWIDTH 500 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 38 40 E8 48 48 48 48 48 ENDCHAR STARTCHAR fl ENCODING -1 SWIDTH 500 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 38 48 E8 48 48 48 48 48 ENDCHAR STARTCHAR florin ENCODING -1 SWIDTH 556 0 DWIDTH 5 0 BBX 4 9 0 -2 BITMAP 30 40 E0 40 40 40 40 40 80 ENDCHAR STARTCHAR fraction ENCODING -1 SWIDTH 167 0 DWIDTH 3 0 BBX 4 7 -1 0 BITMAP 10 10 20 20 40 40 80 ENDCHAR STARTCHAR grave ENCODING -1 SWIDTH 333 0 DWIDTH 3 0 BBX 2 2 0 6 BITMAP 80 40 ENDCHAR STARTCHAR guilsinglleft ENCODING -1 SWIDTH 333 0 DWIDTH 4 0 BBX 3 5 0 0 BITMAP 20 40 80 40 20 ENDCHAR STARTCHAR guilsinglright ENCODING -1 SWIDTH 333 0 DWIDTH 4 0 BBX 3 5 0 0 BITMAP 80 40 20 40 80 ENDCHAR STARTCHAR hungarumlaut ENCODING -1 SWIDTH 333 0 DWIDTH 5 0 BBX 5 2 0 6 BITMAP 48 90 ENDCHAR STARTCHAR lslash ENCODING -1 SWIDTH 222 0 DWIDTH 2 0 BBX 3 8 -1 0 BITMAP 40 40 40 60 C0 40 40 40 ENDCHAR STARTCHAR oe ENCODING -1 SWIDTH 944 0 DWIDTH 9 0 BBX 8 6 0 0 BITMAP 76 89 8F 88 89 76 ENDCHAR STARTCHAR ogonek ENCODING -1 SWIDTH 333 0 DWIDTH 3 0 BBX 2 2 1 -2 BITMAP 80 C0 ENDCHAR STARTCHAR perthousand ENCODING -1 SWIDTH 1000 0 DWIDTH 11 0 BBX 10 7 0 0 BITMAP 4800 A800 5000 3000 2880 5540 4880 ENDCHAR STARTCHAR quotedblbase ENCODING -1 SWIDTH 333 0 DWIDTH 4 0 BBX 4 2 0 -1 BITMAP 50 A0 ENDCHAR STARTCHAR quotedblleft ENCODING -1 SWIDTH 333 0 DWIDTH 4 0 BBX 4 2 0 6 BITMAP A0 50 ENDCHAR STARTCHAR quotedblright ENCODING -1 SWIDTH 333 0 DWIDTH 4 0 BBX 4 2 0 6 BITMAP 50 A0 ENDCHAR STARTCHAR quotesinglbase ENCODING -1 SWIDTH 222 0 DWIDTH 2 0 BBX 2 2 0 -1 BITMAP 40 80 ENDCHAR STARTCHAR quotesingle ENCODING -1 SWIDTH 191 0 DWIDTH 2 0 BBX 1 2 0 6 BITMAP 80 80 ENDCHAR STARTCHAR ring ENCODING -1 SWIDTH 333 0 DWIDTH 3 0 BBX 3 3 0 5 BITMAP 40 A0 40 ENDCHAR STARTCHAR scaron ENCODING -1 SWIDTH 500 0 DWIDTH 5 0 BBX 4 9 0 0 BITMAP A0 40 00 60 90 60 10 90 60 ENDCHAR STARTCHAR tilde ENCODING -1 SWIDTH 333 0 DWIDTH 4 0 BBX 4 2 0 6 BITMAP 50 A0 ENDCHAR STARTCHAR trademark ENCODING -1 SWIDTH 1000 0 DWIDTH 10 0 BBX 8 4 1 3 BITMAP F1 5B 55 55 ENDCHAR STARTCHAR zcaron ENCODING -1 SWIDTH 500 0 DWIDTH 5 0 BBX 4 9 0 0 BITMAP A0 40 00 F0 10 20 40 80 F0 ENDCHAR ENDFONT bogl-0.1.18/bogl-vga16.h0000644000000000000000000000305311407777275011452 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef bogl_vga16_h #define bogl_vga16_h #include size_t bogl_vga16_init (); void bogl_vga16_pixel (int x, int y, int c); void bogl_vga16_hline (int x1, int x2, int y, int c); void bogl_vga16_vline (int x, int y1, int y2, int c); void bogl_vga16_text (int x, int y, const char *s, int n, int fg, int bg, int ul, const struct bogl_font *font); void bogl_vga16_clear (int x1, int y1, int x2, int y2, int c); void bogl_vga16_move (int sx, int sy, int dx, int dy, int w, int h); void bogl_vga16_put (int x, int y, const struct bogl_pixmap *pixmap, const int color_map[16]); void bogl_vga16_pointer (int visible, int x1, int y1, const struct bogl_pointer *pointer, int colors[2]); void bogl_vga16_reinit (void); #endif /* bogl_vga16_h */ bogl-0.1.18/boglP.h0000644000000000000000000000207311407777275010651 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef boglP_h #define boglP_h extern volatile char *bogl_frame; /* Framebuffer. */ extern int bogl_drawing; /* Currently drawing? */ extern int bogl_line_len; /* Bytes per scanline. */ int bogl_fail (const char *, ...); int bogl_cloexec (int fd); #endif /* boglP_h */ bogl-0.1.18/arrow.c0000644000000000000000000000412311407777275010731 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include "bogl.h" /* 0000111122223333 0000111122223333 +----------------+ +----------------+ 0|*** |0 0|*** |0 1|* ** |1 1|***** |1 2|* ** |2 2|******* |2 3| * ** |3 3| ******** |3 4| * ** |4 4| ********** |4 5| * ** |5 5| *********** |5 6| * * |6 6| ************ |6 7| * ***** |7 7| *********** |7 8| * * |8 8| ******** |8 9| * * * |9 9| ******** |9 a| * ** * |a a| ********* |a b| * * * * |b b| *** ***** |b c| * * * * |c c| *** ***** |c d| * * *|d d| * *****|d e| * * |e e| *** |e f| * |f f| * |f +----------------+ +----------------+ 0000111122223333 0000111122223333 */ struct bogl_pointer pointer_arrow = { -1, -1, { 0xe000, 0xf800, 0xfe00, 0x7f80, 0x7fe0, 0x3ff8, 0x3ffc, 0x1ffc, 0x1fe0, 0x0ff0, 0x0ff8, 0x077c, 0x073e, 0x021f, 0x000e, 0x0004, }, { 0xe000, 0x9800, 0x8600, 0x4180, 0x4060, 0x2018, 0x2004, 0x107c, 0x1020, 0x0910, 0x0988, 0x0544, 0x0522, 0x0211, 0x000a, 0x0004, }, }; bogl-0.1.18/symbol.c0000644000000000000000000001000711407777275011102 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* Symbol font definition. */ #include "bogl.h" /* Offsets into index. */ static int symbol_offset[16] = { 11, 0, 3, 6, 9, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, }; /* Index into content data. */ static int symbol_index[] = { 0x8, 0, 0, 0x8, 12, 0, 0x5, 24, 0, 0x5, 36, 0, }; /* Font character content data. */ u_int32_t symbol_content[] = { /* Character 0x01: +--------------------------------+ | | | | |******* | |* * | |* * | |* * | |* * | |* * | |******* | | | | | | | +--------------------------------+ */ 0x00000000, 0x00000000, 0xfe000000, 0x82000000, 0x82000000, 0x82000000, 0x82000000, 0x82000000, 0xfe000000, 0x00000000, 0x00000000, 0x00000000, /* Character 0x02: +--------------------------------+ | | | | |******* | |* * | |* * * * | |* * * | |* * * * | |* * | |******* | | | | | | | +--------------------------------+ */ 0x00000000, 0x00000000, 0xfe000000, 0x82000000, 0xaa000000, 0x92000000, 0xaa000000, 0x82000000, 0xfe000000, 0x00000000, 0x00000000, 0x00000000, /* Character 0x03: +--------------------------------+ | | | | | * | | *** | |***** | | * | | * | | * | | * | | | | | | | +--------------------------------+ */ 0x00000000, 0x00000000, 0x20000000, 0x70000000, 0xf8000000, 0x20000000, 0x20000000, 0x20000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000, /* Character 0x04: +--------------------------------+ | | | | | * | | * | | * | | * | |***** | | *** | | * | | | | | | | +--------------------------------+ */ 0x00000000, 0x00000000, 0x20000000, 0x20000000, 0x20000000, 0x20000000, 0xf8000000, 0x70000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000, }; struct bogl_font font_symbol = { "symbol", 12, 0x0f, symbol_offset, symbol_index, symbol_content, }; bogl-0.1.18/giftobogl.c0000644000000000000000000000763511407777275011566 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #define _GNU_SOURCE 1 #include #include #include #include #include #include /* Allocation routines. */ static void out_of_memory (void) { printf ("Virtual memory exhausted.\n"); exit (EXIT_FAILURE); } void * xmalloc (size_t size) { void *p; if (size == 0) return 0; p = malloc (size); if (!p) out_of_memory (); return p; } void * xrealloc (void *p, size_t size) { if (p == NULL) return xmalloc (size); if (size == 0) { free (p); return NULL; } p = realloc (p, size); if (!p) out_of_memory (); return p; } char * xstrdup (const char *s) { size_t size = strlen (s) + 1; char *p = xmalloc (size); memcpy (p, s, size); return p; } int main (int argc, char *argv[]) { char *name; FILE *giffile; gdImagePtr gif; int ncols; int w; int h; if (argc < 2) { printf ("usage: giftobogl graphic.gif > graphic.c\n"); exit (EXIT_FAILURE); } /* Compute name for internal structures. */ { char *cp; name = xstrdup (argv[1]); strcpy (name, argv[1]); for (cp = name; *cp; cp++) if (!isalnum ((unsigned char) *cp)) { if (!strcmp (cp, ".gif")) { *cp = 0; break; } *cp = '_'; } } giffile = fopen (argv[1], "rb"); if (!giffile) { printf ("error opening %s: %s\n", argv[1], strerror (errno)); exit (EXIT_FAILURE); } gif = gdImageCreateFromGif (giffile); if (!gif) exit (EXIT_FAILURE); w = gif->sx; h = gif->sy; ncols = gdImageColorsTotal (gif); if (ncols > 16) { printf ("Image has too many colors (%d)\n", ncols); exit (EXIT_FAILURE); } printf ("/* Generated by giftobogl. */\n" "#include \"bogl.h\"\n\n" "/* Image data with simple run-length encoding. Each byte\n" " contains a pixel value in its lower nibble, and a repeat\n" " count in its upper nibble. */\n\n" "static unsigned char %s_data[] = {\n\n", name); /* Image data. */ { int y; for (y = 0; y < h; y++) { int n, x1; printf ("/* Row %d. */", y); n = 0; for (x1 = 0; x1 < w; ) { int c = gdImageGetPixel (gif, x1, y); int x2 = x1 + 1; while (x2 < w && c == gdImageGetPixel (gif, x2, y) && x2 - x1 < 15) x2++; if (n++ % 12 == 0) putchar ('\n'); printf ("0x%x%x, ", x2 - x1, c); x1 = x2; } printf ("\n\n"); } } /* Palette data. */ { int i; printf ("};\n\n" "/* Palette data. */\n" "static unsigned char %s_palette[%d][3] = {\n", name, ncols); for (i = 0; i < ncols; i++) printf (" {0x%02x, 0x%02x, 0x%02x},\n", gdImageRed (gif, i), gdImageGreen (gif, i), gdImageBlue (gif, i)); } printf ("};\n\n" "/* Pixmap structure. */\n" "struct bogl_pixmap pixmap_%s = {\n" " %d,\t\t/* Width. */\n" " %d,\t\t/* Height. */\n" " %d,\t\t/* Number of colors. */\n" " %d,\t\t/* Transparent color. */\n" " %s_palette,\t/* Palette. */\n" " %s_data,\t/* Data. */\n" "};\n", name, w, h, ncols, gdImageGetTransparent (gif), name, name); return 0; } bogl-0.1.18/bdftobogl.c0000644000000000000000000001561311407777275011547 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #define _GNU_SOURCE 1 #include #include #include #include #include #include #include #include "bogl.h" #include "bogl-font.h" static void print_glyph (u_int32_t *content, int height, int w); static int bogl_write_font(int fd, struct bogl_font *font); int main (int argc, char *argv[]) { struct bogl_font *font; int index_size = 0; int content_size = 0; int i, j, k, cp, n; char buf[MB_LEN_MAX+1]; setlocale (LC_ALL, ""); /* Check for proper usage. */ if (!((argc == 2) || (argc == 3 && !strcmp (argv[1], "-b")))) { fprintf (stderr, "Usage:\n%s font.bdf > font.c\n" "%s -b font.bdf > font.bgf\n", argv[0], argv[0]); return EXIT_FAILURE; } /* Read font file. */ font = bogl_read_bdf (argc == 2 ? argv[1] : argv[2]); if (!font) { fputs (bogl_error (), stderr); return EXIT_FAILURE; } /* Write BGF font if -b. */ if (argc == 3) { if (bogl_write_font (1, font)) { fputs ("bogl_write_font failed\n", stderr); return EXIT_FAILURE; } return EXIT_SUCCESS; } /* Output header. */ printf ("/* Generated by bdftobogl. Do not modify! */\n"); printf ("#include \"bogl.h\"\n"); /* Output offsets, and get index_size and content_size. */ printf ("\n/* Offsets into index. */\n"); printf ("static int _%s_offset[%d] = {\n", font->name, font->index_mask+1); for (i = 0; i <= font->index_mask; i++) { printf (" %d, /* (0x%x) */\n", font->offset[i], i); for (j = font->offset[i]; font->index[j] != 0; j += 2) { k = font->index[j+1] + font->height * (((font->index[j] & font->index_mask) + 31) / 32); if (k > content_size) content_size = k; } if (j > index_size) index_size = j; } ++index_size; printf ("};\n"); /* Output index. */ printf ("\n/* Index into content data. */\n"); printf ("static int _%s_index[%d] = {\n", font->name, index_size); i = 0; while (i < index_size) if (font->index[i] != 0 && i < index_size - 1) { printf (" 0x%x, %d,\n", font->index[i], font->index[i+1]); i += 2; } else if (font->index[i] == 0) printf (" %d,\n", font->index[i++]); else printf (" %d, /* Hm... */\n", font->index[i++]); printf ("};\n"); /* Print out each character's picture and data. */ printf ("\n/* Font character content data. */\n"); printf ("static u_int32_t _%s_content[] = {\n\n", font->name); cp = 0; while (cp < content_size) { int width = 0; for (i = 0; i <= font->index_mask; i++) for (j = font->offset[i]; font->index[j] != 0; j += 2) if (font->index[j+1] == cp) { wchar_t wc = (font->index[j] & ~font->index_mask) | i; int w = font->index[j] & font->index_mask; if (iswprint(wc)) { wctomb(0, 0); n = wctomb(buf, wc); buf[(n == -1) ? 0 : n] = '\0'; printf ("/* %d: character %s (0x%lx), width %d */\n", cp, buf, (long)wc, w); } else printf ("/* %d: unprintable character 0x%lx, width %d */\n", cp, (long)wc, w); if (w > width) width = w; } if (width && cp + font->height * ((width + 31) / 32) <= content_size) { print_glyph (&font->content[cp], font->height, width); printf ("\n"); cp += font->height * ((width + 31) / 32); } else printf ("0x%08x,\n", font->content[cp++]); } printf ("};\n\n"); /* Print the font structure definition. */ printf ("/* Exported structure definition. */\n"); printf ("const struct bogl_font font_%s = {\n", font->name); printf (" \"%s\",\n", font->name); printf (" %d,\n", font->height); printf (" 0x%x,\n", font->index_mask); printf (" _%s_offset,\n", font->name); printf (" _%s_index,\n", font->name); printf (" _%s_content,\n", font->name); printf ("};\n"); return EXIT_SUCCESS; } /* Print a picture of the glyph for human inspection, then the hex data for machine consumption. */ static void print_glyph (u_int32_t *content, int height, int width) { int i, j; printf ("/* +"); for (i = 0; i < width; i++) printf ("-"); printf ("+\n"); for (i = 0; i < height; i++) { printf (" |"); for (j = 0; j < width; j++) putchar (content[i+(j/32)*height] & (1 << (31-j%32)) ? '*' : ' '); printf ("|\n"); } printf (" +"); for (i = 0; i < width; i++) printf ("-"); printf ("+ */\n"); for (i = 0; i < height*((width+31)/32); i++) printf ("0x%08x,\n", content[i]); } /* Write with repeated attempts and return number of bytes not written. */ static size_t my_write(int fd, const void *buf, size_t count) { ssize_t n; while (count > 0 && (n = write(fd, buf, count)) != -1) buf += n, count -= n; return count; } const unsigned char zero_buf[16]; /* Write BGF font and return non-zero on failure. */ static int bogl_write_font(int fd, struct bogl_font *font) { struct bogl_font font1; int i, j, k, index_size, content_size, name_len, name_pad; if (my_write(fd, "BGF1", 4)) return 1; memcpy(&font1, font, sizeof(font1)); /* Get index_size and content_size. */ index_size = content_size = 0; for (i = 0; i <= font->index_mask; i++) { for (j = font->offset[i]; font->index[j] != 0; j += 2) { k = font->index[j+1] + font->height * (((font->index[j] & font->index_mask) + 31) / 32); if (k > content_size) content_size = k; } if (j > index_size) index_size = j; } ++index_size; name_len = strlen (font->name) + 1; name_pad = sizeof (long) - (name_len % sizeof (long)); if (name_pad == sizeof (long)) name_pad = 0; font1.name = (void *)0 + 4 + sizeof(font1); font1.offset = (void *)font1.name + name_len + name_pad; font1.index = (void *)font1.offset + (font->index_mask + 1) * sizeof(int); font1.content = (void *)font1.index + index_size * sizeof(int); if (my_write(fd, &font1, sizeof(font1)) || my_write(fd, font->name, name_len) || my_write(fd, zero_buf, name_pad) || my_write(fd, font->offset, (font->index_mask + 1) * sizeof(int)) || my_write(fd, font->index, index_size * sizeof(int)) || my_write(fd, font->content, content_size * sizeof(u_int32_t))) return 1; return 0; } bogl-0.1.18/timBI18.bdf0000644000000000000000000007734511407777275011305 0ustar STARTFONT 2.1 FONT -Adobe-Times-Bold-I-Normal--18-180-75-75-P-98-ISO8859-1 SIZE 18 75 75 FONTBOUNDINGBOX 22 21 -3 -4 COMMENT $XConsortium: timBI18.bdf,v 1.14 95/01/26 18:06:27 gildea Exp $ COMMENT COMMENT + COMMENT Copyright 1984-1989, 1994 Adobe Systems Incorporated. COMMENT Copyright 1988, 1994 Digital Equipment Corporation. COMMENT COMMENT Adobe is a trademark of Adobe Systems Incorporated which may be COMMENT registered in certain jurisdictions. COMMENT Permission to use these trademarks is hereby granted only in COMMENT association with the images described in this file. COMMENT COMMENT Permission to use, copy, modify, distribute and sell this software COMMENT and its documentation for any purpose and without fee is hereby COMMENT granted, provided that the above copyright notices appear in all COMMENT copies and that both those copyright notices and this permission COMMENT notice appear in supporting documentation, and that the names of COMMENT Adobe Systems and Digital Equipment Corporation not be used in COMMENT advertising or publicity pertaining to distribution of the software COMMENT without specific, written prior permission. Adobe Systems and COMMENT Digital Equipment Corporation make no representations about the COMMENT suitability of this software for any purpose. It is provided "as COMMENT is" without express or implied warranty. COMMENT - STARTPROPERTIES 28 FOUNDRY "Adobe" FAMILY_NAME "Times" WEIGHT_NAME "Bold" SLANT "I" SETWIDTH_NAME "Normal" ADD_STYLE_NAME "" PIXEL_SIZE 18 POINT_SIZE 180 RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "P" AVERAGE_WIDTH 98 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" CAP_HEIGHT 13 X_HEIGHT 8 FONT_ASCENT 15 FONT_DESCENT 4 FACE_NAME "Times Bold Italic" COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved." NOTICE "Times is a trademark of Linotype-Hell AG and/or its subsidiaries." _DEC_DEVICE_FONTNAMES "PS=Times-BoldItalic" _DEC_PRODUCTINFO "DECwindows Fonts V2.2, 07-Nov-1991" DEFAULT_CHAR 32 RELATIVE_SETWIDTH 50 RELATIVE_WEIGHT 70 CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD" FULL_NAME "Times Bold Italic" ENDPROPERTIES CHARS 229 STARTCHAR space ENCODING 32 SWIDTH 250 0 DWIDTH 4 0 BBX 1 1 0 0 BITMAP 00 ENDCHAR STARTCHAR exclam ENCODING 33 SWIDTH 389 0 DWIDTH 7 0 BBX 6 13 1 0 BITMAP 1C 1C 18 38 38 30 70 60 40 00 00 C0 C0 ENDCHAR STARTCHAR quotedbl ENCODING 34 SWIDTH 555 0 DWIDTH 9 0 BBX 7 5 1 8 BITMAP 66 66 CC CC 88 ENDCHAR STARTCHAR numbersign ENCODING 35 SWIDTH 500 0 DWIDTH 9 0 BBX 9 13 0 0 BITMAP 1B00 1B00 1B00 7F80 7F80 3600 3600 3600 FF00 FF00 6C00 6C00 6C00 ENDCHAR STARTCHAR dollar ENCODING 36 SWIDTH 500 0 DWIDTH 9 0 BBX 8 16 0 -2 BITMAP 02 1E 25 65 68 78 3C 1E 1F 17 13 A3 A6 7C 40 40 ENDCHAR STARTCHAR percent ENCODING 37 SWIDTH 833 0 DWIDTH 15 0 BBX 14 13 0 0 BITMAP 3C30 77F0 E460 C4C0 CCC0 D980 71B8 0374 02E4 06C4 0CCC 0CD8 1870 ENDCHAR STARTCHAR ampersand ENCODING 38 SWIDTH 778 0 DWIDTH 15 0 BBX 13 13 1 0 BITMAP 0780 0EC0 0E40 0EC0 0780 0E00 3E78 7730 E760 E3C0 E380 F7D8 7CF0 ENDCHAR STARTCHAR quoteright ENCODING 39 SWIDTH 333 0 DWIDTH 5 0 BBX 3 5 2 8 BITMAP E0 E0 60 40 80 ENDCHAR STARTCHAR parenleft ENCODING 40 SWIDTH 333 0 DWIDTH 6 0 BBX 6 16 0 -3 BITMAP 0C 18 30 30 60 60 C0 C0 C0 C0 C0 C0 C0 60 60 30 ENDCHAR STARTCHAR parenright ENCODING 41 SWIDTH 333 0 DWIDTH 7 0 BBX 6 16 0 -3 BITMAP 30 18 18 0C 0C 0C 0C 0C 0C 0C 18 18 30 30 60 C0 ENDCHAR STARTCHAR asterisk ENCODING 42 SWIDTH 500 0 DWIDTH 10 0 BBX 8 8 1 5 BITMAP 18 18 DB 7E 18 7E DB 18 ENDCHAR STARTCHAR plus ENCODING 43 SWIDTH 570 0 DWIDTH 10 0 BBX 8 8 1 1 BITMAP 18 18 18 FF FF 18 18 18 ENDCHAR STARTCHAR comma ENCODING 44 SWIDTH 250 0 DWIDTH 5 0 BBX 3 4 0 -2 BITMAP 60 60 20 C0 ENDCHAR STARTCHAR minus ENCODING 45 SWIDTH 606 0 DWIDTH 11 0 BBX 9 2 1 4 BITMAP FF80 FF80 ENDCHAR STARTCHAR period ENCODING 46 SWIDTH 250 0 DWIDTH 5 0 BBX 2 2 1 0 BITMAP C0 C0 ENDCHAR STARTCHAR slash ENCODING 47 SWIDTH 278 0 DWIDTH 6 0 BBX 6 13 0 0 BITMAP 0C 0C 18 18 18 30 30 60 60 60 C0 C0 C0 ENDCHAR STARTCHAR zero ENCODING 48 SWIDTH 500 0 DWIDTH 9 0 BBX 9 13 0 0 BITMAP 1E00 3B00 7180 7180 E380 E380 E380 C700 C700 C600 CE00 EC00 7800 ENDCHAR STARTCHAR one ENCODING 49 SWIDTH 500 0 DWIDTH 9 0 BBX 7 13 0 0 BITMAP 0E 3E 0E 0E 1C 1C 1C 1C 1C 38 38 38 FE ENDCHAR STARTCHAR two ENCODING 50 SWIDTH 500 0 DWIDTH 9 0 BBX 9 13 -1 0 BITMAP 1F00 3F80 4780 0380 0380 0700 0600 0C00 1800 3080 7F80 FF00 FE00 ENDCHAR STARTCHAR three ENCODING 51 SWIDTH 500 0 DWIDTH 9 0 BBX 9 13 -1 0 BITMAP 1F00 3780 0380 0380 0700 1C00 1F00 0780 0380 0380 6380 E700 7C00 ENDCHAR STARTCHAR four ENCODING 52 SWIDTH 500 0 DWIDTH 9 0 BBX 8 13 0 0 BITMAP 03 07 0F 1F 16 36 66 CE FF FF 0C 1C 1C ENDCHAR STARTCHAR five ENCODING 53 SWIDTH 500 0 DWIDTH 9 0 BBX 8 13 0 0 BITMAP 1F 3F 3E 20 78 7E 1E 07 07 07 CE DC 78 ENDCHAR STARTCHAR six ENCODING 54 SWIDTH 500 0 DWIDTH 9 0 BBX 8 13 0 0 BITMAP 03 0E 1C 38 70 6E FF E3 E3 C7 C7 6E 3C ENDCHAR STARTCHAR seven ENCODING 55 SWIDTH 500 0 DWIDTH 9 0 BBX 9 13 0 0 BITMAP 3F80 3F80 6380 4300 0600 0C00 0C00 1800 3000 3000 6000 C000 C000 ENDCHAR STARTCHAR eight ENCODING 56 SWIDTH 500 0 DWIDTH 9 0 BBX 9 13 0 0 BITMAP 1E00 7380 7180 7180 3B00 1E00 3E00 7700 C700 C380 C380 EF00 3C00 ENDCHAR STARTCHAR nine ENCODING 57 SWIDTH 500 0 DWIDTH 9 0 BBX 9 13 -1 0 BITMAP 1E00 3B80 7180 7180 7180 7380 3380 1F00 0700 0E00 1C00 3800 E000 ENDCHAR STARTCHAR colon ENCODING 58 SWIDTH 333 0 DWIDTH 6 0 BBX 4 8 1 0 BITMAP 30 30 00 00 00 00 C0 C0 ENDCHAR STARTCHAR semicolon ENCODING 59 SWIDTH 333 0 DWIDTH 7 0 BBX 5 10 0 -2 BITMAP 18 18 00 00 00 00 60 60 20 C0 ENDCHAR STARTCHAR less ENCODING 60 SWIDTH 570 0 DWIDTH 12 0 BBX 9 8 2 0 BITMAP 0380 0E00 3800 E000 E000 3800 0E00 0380 ENDCHAR STARTCHAR equal ENCODING 61 SWIDTH 570 0 DWIDTH 11 0 BBX 9 5 1 2 BITMAP FF80 FF80 0000 FF80 FF80 ENDCHAR STARTCHAR greater ENCODING 62 SWIDTH 570 0 DWIDTH 12 0 BBX 9 8 1 0 BITMAP E000 3800 0E00 0380 0380 0E00 3800 E000 ENDCHAR STARTCHAR question ENCODING 63 SWIDTH 500 0 DWIDTH 9 0 BBX 7 13 2 0 BITMAP 3C 66 66 0E 1E 3C 30 60 60 40 00 C0 C0 ENDCHAR STARTCHAR at ENCODING 64 SWIDTH 832 0 DWIDTH 17 0 BBX 15 15 1 -3 BITMAP 03E0 0F38 1C0C 3804 71D6 6372 E672 C462 CC66 CCE4 EFEC 6738 7000 3C30 0FC0 ENDCHAR STARTCHAR A ENCODING 65 SWIDTH 667 0 DWIDTH 13 0 BBX 14 13 -1 0 BITMAP 00C0 01C0 01C0 03E0 02E0 0660 0C70 0C70 1FF0 1870 3038 7038 F87C ENDCHAR STARTCHAR B ENCODING 66 SWIDTH 667 0 DWIDTH 13 0 BBX 12 13 0 0 BITMAP 3FE0 1CF0 1C70 1C70 1860 3FC0 38E0 3870 3070 7070 70F0 71E0 FF80 ENDCHAR STARTCHAR C ENCODING 67 SWIDTH 667 0 DWIDTH 13 0 BBX 12 13 1 0 BITMAP 07D0 1E70 3830 7030 7000 6000 E000 E000 E000 F000 7060 7DC0 1F00 ENDCHAR STARTCHAR D ENCODING 68 SWIDTH 722 0 DWIDTH 14 0 BBX 13 13 0 0 BITMAP 3F80 1DE0 1C70 1C70 3838 3838 3838 3838 7070 70F0 70E0 73C0 FF00 ENDCHAR STARTCHAR E ENCODING 69 SWIDTH 667 0 DWIDTH 12 0 BBX 12 13 0 0 BITMAP 3FF0 1C70 1C20 1C20 3880 3980 3F80 3980 3100 7020 7060 70E0 FFC0 ENDCHAR STARTCHAR F ENCODING 70 SWIDTH 667 0 DWIDTH 12 0 BBX 12 13 0 0 BITMAP 3FF0 1C70 1C20 1C20 1880 3980 3F80 3980 3100 7000 7000 7000 F800 ENDCHAR STARTCHAR G ENCODING 71 SWIDTH 722 0 DWIDTH 14 0 BBX 12 13 1 0 BITMAP 07D0 1E70 3830 7030 7000 6000 E000 E1F0 E0E0 F0E0 70C0 7DC0 1FC0 ENDCHAR STARTCHAR H ENCODING 72 SWIDTH 778 0 DWIDTH 15 0 BBX 15 13 0 0 BITMAP 3E3E 1C1C 1C1C 1C1C 3838 3838 3FF8 3838 3838 7070 7070 7070 F8F8 ENDCHAR STARTCHAR I ENCODING 73 SWIDTH 389 0 DWIDTH 7 0 BBX 7 13 0 0 BITMAP 3E 1C 1C 1C 38 38 38 38 70 70 70 70 F8 ENDCHAR STARTCHAR J ENCODING 74 SWIDTH 500 0 DWIDTH 9 0 BBX 10 14 -1 -1 BITMAP 07C0 0380 0380 0300 0700 0700 0700 0600 0E00 0E00 0E00 EC00 FC00 7000 ENDCHAR STARTCHAR K ENCODING 75 SWIDTH 667 0 DWIDTH 12 0 BBX 14 13 -1 0 BITMAP 3E7C 1C30 1C60 1CC0 3980 3F00 3F00 3B80 3B80 71C0 71C0 70E0 F9F0 ENDCHAR STARTCHAR L ENCODING 76 SWIDTH 611 0 DWIDTH 11 0 BBX 11 13 0 0 BITMAP 3E00 1C00 1C00 1C00 3800 3800 3800 3800 3000 7020 7060 70E0 FFC0 ENDCHAR STARTCHAR M ENCODING 77 SWIDTH 889 0 DWIDTH 17 0 BBX 18 13 0 0 BITMAP 3E07C0 1E0780 1E0F00 161300 373600 372600 276600 274C00 63CC00 638C00 638C00 631C00 F23E00 ENDCHAR STARTCHAR N ENCODING 78 SWIDTH 722 0 DWIDTH 13 0 BBX 16 13 -1 0 BITMAP 3C1F 1C0E 1E0C 1E0C 1B18 3398 3398 31D8 31D0 60F0 60F0 6060 F060 ENDCHAR STARTCHAR O ENCODING 79 SWIDTH 722 0 DWIDTH 14 0 BBX 12 13 1 0 BITMAP 07C0 1EE0 3870 7070 7070 E070 E070 E070 E0E0 E0E0 E1C0 7780 3E00 ENDCHAR STARTCHAR P ENCODING 80 SWIDTH 611 0 DWIDTH 11 0 BBX 12 13 0 0 BITMAP 3FE0 1CF0 1C70 1C70 3870 38E0 3FC0 3800 3000 7000 7000 7000 F800 ENDCHAR STARTCHAR Q ENCODING 81 SWIDTH 722 0 DWIDTH 14 0 BBX 12 16 1 -3 BITMAP 07C0 1EE0 3870 7070 7070 E070 E070 E070 E0E0 E0E0 E1C0 7780 3E00 1820 7FC0 DF80 ENDCHAR STARTCHAR R ENCODING 82 SWIDTH 667 0 DWIDTH 12 0 BBX 12 13 0 0 BITMAP 3FE0 1CF0 1C70 1870 3870 38E0 3FC0 3B80 39C0 71C0 70E0 70E0 F8F0 ENDCHAR STARTCHAR S ENCODING 83 SWIDTH 556 0 DWIDTH 11 0 BBX 10 13 0 0 BITMAP 0F40 1DC0 38C0 3840 3C00 1E00 0F00 0F80 0780 C380 C380 E700 FE00 ENDCHAR STARTCHAR T ENCODING 84 SWIDTH 611 0 DWIDTH 11 0 BBX 11 13 1 0 BITMAP FFE0 CE60 8E20 0E00 1C00 1C00 1C00 1C00 1800 3800 3800 3800 7C00 ENDCHAR STARTCHAR U ENCODING 85 SWIDTH 722 0 DWIDTH 14 0 BBX 14 13 1 0 BITMAP 7E7C 3838 3830 7830 7060 7060 7060 F060 E0C0 E0C0 E0C0 F180 7F00 ENDCHAR STARTCHAR V ENCODING 86 SWIDTH 667 0 DWIDTH 13 0 BBX 12 13 2 0 BITMAP F9F0 70E0 70C0 7180 7180 7300 7600 7600 7C00 7800 7800 7000 6000 ENDCHAR STARTCHAR W ENCODING 87 SWIDTH 889 0 DWIDTH 17 0 BBX 17 13 1 0 BITMAP F3E780 71C300 71C600 71C400 71CC00 73C800 73D800 75D000 3CF000 38E000 38E000 30C000 30C000 ENDCHAR STARTCHAR X ENCODING 88 SWIDTH 667 0 DWIDTH 13 0 BBX 15 13 -1 0 BITMAP 3F3E 0E18 0E30 0760 07C0 0380 0380 07C0 0DC0 19C0 30E0 60E0 F1F8 ENDCHAR STARTCHAR Y ENCODING 89 SWIDTH 611 0 DWIDTH 11 0 BBX 12 13 0 0 BITMAP F8F0 7060 70C0 3980 3B00 1E00 1C00 1C00 1C00 3800 3800 3800 FE00 ENDCHAR STARTCHAR Z ENCODING 90 SWIDTH 611 0 DWIDTH 11 0 BBX 13 13 -1 0 BITMAP 1FF8 38F0 20E0 01C0 0380 0700 0F00 0E00 1C00 3820 7060 F0E0 FFC0 ENDCHAR STARTCHAR bracketleft ENCODING 91 SWIDTH 333 0 DWIDTH 7 0 BBX 8 16 0 -3 BITMAP 0F 0C 18 18 18 18 30 30 30 30 60 60 60 60 C0 F0 ENDCHAR STARTCHAR backslash ENCODING 92 SWIDTH 278 0 DWIDTH 8 0 BBX 8 13 1 0 BITMAP C0 C0 60 60 30 30 18 18 0C 0C 06 06 03 ENDCHAR STARTCHAR bracketright ENCODING 93 SWIDTH 333 0 DWIDTH 6 0 BBX 8 16 -2 -3 BITMAP 0F 03 06 06 06 06 0C 0C 0C 0C 18 18 18 18 30 F0 ENDCHAR STARTCHAR asciicircum ENCODING 94 SWIDTH 570 0 DWIDTH 11 0 BBX 8 8 1 5 BITMAP 0C 1C 1C 36 66 66 C3 C3 ENDCHAR STARTCHAR underscore ENCODING 95 SWIDTH 500 0 DWIDTH 9 0 BBX 9 1 0 -3 BITMAP FF80 ENDCHAR STARTCHAR quoteleft ENCODING 96 SWIDTH 333 0 DWIDTH 5 0 BBX 3 5 1 8 BITMAP 20 40 C0 E0 E0 ENDCHAR STARTCHAR a ENCODING 97 SWIDTH 500 0 DWIDTH 10 0 BBX 10 8 0 0 BITMAP 1E80 7B80 7380 E300 E700 E700 EF40 3B80 ENDCHAR STARTCHAR b ENCODING 98 SWIDTH 500 0 DWIDTH 9 0 BBX 9 13 0 0 BITMAP 7800 3800 3800 3000 3000 7700 7B80 7380 7380 E380 E700 E600 7800 ENDCHAR STARTCHAR c ENCODING 99 SWIDTH 444 0 DWIDTH 8 0 BBX 8 8 0 0 BITMAP 1F 73 63 E0 E0 E0 F6 3C ENDCHAR STARTCHAR d ENCODING 100 SWIDTH 500 0 DWIDTH 9 0 BBX 10 13 0 0 BITMAP 03C0 01C0 01C0 0180 0380 1B80 7780 6300 E300 E300 E700 EF40 7B80 ENDCHAR STARTCHAR e ENCODING 101 SWIDTH 444 0 DWIDTH 9 0 BBX 8 8 0 0 BITMAP 1E 77 67 EE F8 E3 F6 7C ENDCHAR STARTCHAR f ENCODING 102 SWIDTH 333 0 DWIDTH 6 0 BBX 11 17 -2 -4 BITMAP 03C0 0760 0660 0E00 0E00 3F80 0E00 0E00 0C00 1C00 1C00 1C00 1C00 1800 D800 D800 7000 ENDCHAR STARTCHAR g ENCODING 103 SWIDTH 500 0 DWIDTH 8 0 BBX 10 12 -1 -4 BITMAP 1F40 3B80 7380 6380 7700 3E00 7000 3E00 EF80 C380 C380 7F00 ENDCHAR STARTCHAR h ENCODING 104 SWIDTH 556 0 DWIDTH 11 0 BBX 10 13 1 0 BITMAP 7800 3800 3800 3000 7000 7700 7F80 7380 6380 E300 E700 E740 E380 ENDCHAR STARTCHAR i ENCODING 105 SWIDTH 278 0 DWIDTH 5 0 BBX 5 13 0 0 BITMAP 38 38 00 00 00 F0 70 70 60 60 E0 E8 70 ENDCHAR STARTCHAR j ENCODING 106 SWIDTH 278 0 DWIDTH 4 0 BBX 8 17 -3 -4 BITMAP 07 07 00 00 00 1E 0E 0E 0C 0C 1C 1C 18 18 D8 F0 60 ENDCHAR STARTCHAR k ENCODING 107 SWIDTH 500 0 DWIDTH 9 0 BBX 10 13 -1 0 BITMAP 3C00 1C00 1C00 1800 3800 3BC0 3380 3600 3C00 7400 7600 E780 E700 ENDCHAR STARTCHAR l ENCODING 108 SWIDTH 278 0 DWIDTH 5 0 BBX 5 13 0 0 BITMAP 78 38 38 30 70 70 70 70 60 E0 E0 E8 70 ENDCHAR STARTCHAR m ENCODING 109 SWIDTH 778 0 DWIDTH 14 0 BBX 14 8 0 0 BITMAP F770 7BB8 7338 7338 7330 E670 E674 E678 ENDCHAR STARTCHAR n ENCODING 110 SWIDTH 556 0 DWIDTH 10 0 BBX 10 8 0 0 BITMAP F700 7B80 7380 7380 6300 E700 E740 E380 ENDCHAR STARTCHAR o ENCODING 111 SWIDTH 500 0 DWIDTH 10 0 BBX 9 8 0 0 BITMAP 1F00 7380 6380 E380 E380 E300 E700 7C00 ENDCHAR STARTCHAR p ENCODING 112 SWIDTH 500 0 DWIDTH 9 0 BBX 11 12 -2 -4 BITMAP 3BC0 1EE0 1CE0 1CE0 38E0 39C0 3980 3700 3000 7000 7000 F800 ENDCHAR STARTCHAR q ENCODING 113 SWIDTH 500 0 DWIDTH 9 0 BBX 9 12 0 -4 BITMAP 1D80 7780 6380 E300 E700 E700 FF00 3600 0600 0E00 0E00 1F00 ENDCHAR STARTCHAR r ENCODING 114 SWIDTH 389 0 DWIDTH 6 0 BBX 7 8 0 0 BITMAP EE 7E 70 70 60 E0 E0 E0 ENDCHAR STARTCHAR s ENCODING 115 SWIDTH 389 0 DWIDTH 7 0 BBX 8 8 -1 0 BITMAP 3E 77 72 38 1C 4E EE 7C ENDCHAR STARTCHAR t ENCODING 116 SWIDTH 278 0 DWIDTH 6 0 BBX 6 10 0 0 BITMAP 30 70 FC 70 70 60 E0 E0 E8 70 ENDCHAR STARTCHAR u ENCODING 117 SWIDTH 556 0 DWIDTH 10 0 BBX 10 8 0 0 BITMAP F380 7380 7300 6700 E700 EF00 FB40 7380 ENDCHAR STARTCHAR v ENCODING 118 SWIDTH 444 0 DWIDTH 7 0 BBX 8 8 -1 0 BITMAP F7 73 73 72 36 3C 38 30 ENDCHAR STARTCHAR w ENCODING 119 SWIDTH 667 0 DWIDTH 11 0 BBX 12 8 -1 0 BITMAP E270 7330 7330 77A0 37E0 3DC0 3980 1080 ENDCHAR STARTCHAR x ENCODING 120 SWIDTH 500 0 DWIDTH 9 0 BBX 9 8 0 0 BITMAP 7B80 3B00 1E00 1C00 3C00 6E00 CE80 E700 ENDCHAR STARTCHAR y ENCODING 121 SWIDTH 444 0 DWIDTH 7 0 BBX 9 12 -2 -4 BITMAP 7B80 3980 3980 3900 1B00 1E00 1E00 0C00 0C00 0800 D000 E000 ENDCHAR STARTCHAR z ENCODING 122 SWIDTH 389 0 DWIDTH 7 0 BBX 7 9 0 -1 BITMAP 3E 7E 4C 18 30 60 E6 F6 1C ENDCHAR STARTCHAR braceleft ENCODING 123 SWIDTH 348 0 DWIDTH 6 0 BBX 7 16 0 -3 BITMAP 0E 18 30 30 30 30 60 C0 60 60 60 C0 C0 C0 C0 70 ENDCHAR STARTCHAR bar ENCODING 124 SWIDTH 220 0 DWIDTH 6 0 BBX 2 13 2 0 BITMAP C0 C0 C0 C0 C0 C0 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR braceright ENCODING 125 SWIDTH 348 0 DWIDTH 7 0 BBX 6 16 -1 -3 BITMAP 38 0C 0C 0C 0C 18 18 18 0C 18 30 30 30 30 60 C0 ENDCHAR STARTCHAR asciitilde ENCODING 126 SWIDTH 570 0 DWIDTH 10 0 BBX 8 3 1 4 BITMAP 71 FF 8E ENDCHAR STARTCHAR space ENCODING 160 SWIDTH 250 0 DWIDTH 4 0 BBX 1 1 0 0 BITMAP 00 ENDCHAR STARTCHAR exclamdown ENCODING 161 SWIDTH 389 0 DWIDTH 6 0 BBX 6 13 -1 -4 BITMAP 0C 0C 00 00 08 18 38 30 70 70 60 E0 E0 ENDCHAR STARTCHAR cent ENCODING 162 SWIDTH 500 0 DWIDTH 9 0 BBX 8 12 0 -2 BITMAP 01 02 1F 77 64 E8 E8 F0 F6 7C 20 40 ENDCHAR STARTCHAR sterling ENCODING 163 SWIDTH 500 0 DWIDTH 9 0 BBX 10 13 -1 0 BITMAP 0380 06C0 0CC0 0C00 1C00 1800 7F00 1800 1800 3800 7C40 DF80 E700 ENDCHAR STARTCHAR currency ENCODING 164 SWIDTH 500 0 DWIDTH 9 0 BBX 9 9 0 2 BITMAP 9C80 FF80 6300 C180 C180 C180 6300 FF80 9C80 ENDCHAR STARTCHAR yen ENCODING 165 SWIDTH 500 0 DWIDTH 10 0 BBX 11 13 0 0 BITMAP F9E0 70C0 7180 3900 3B00 1E00 7F00 1C00 7F00 1800 3800 3800 7E00 ENDCHAR STARTCHAR brokenbar ENCODING 166 SWIDTH 220 0 DWIDTH 6 0 BBX 2 13 2 0 BITMAP C0 C0 C0 C0 C0 00 00 00 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR section ENCODING 167 SWIDTH 500 0 DWIDTH 9 0 BBX 9 16 0 -3 BITMAP 0F00 1B80 1300 1800 1C00 2E00 6700 6300 6300 7300 3A00 1C00 0C00 C400 EC00 7800 ENDCHAR STARTCHAR dieresis ENCODING 168 SWIDTH 333 0 DWIDTH 7 0 BBX 6 2 1 9 BITMAP CC CC ENDCHAR STARTCHAR copyright ENCODING 169 SWIDTH 747 0 DWIDTH 15 0 BBX 13 13 1 0 BITMAP 0F80 38E0 6030 4FD0 DCD8 9848 9808 9808 DCD8 4F90 6030 38E0 0F80 ENDCHAR STARTCHAR ordfeminine ENCODING 170 SWIDTH 266 0 DWIDTH 7 0 BBX 7 7 0 5 BITMAP 1E 36 6C 6E 74 00 F8 ENDCHAR STARTCHAR guillemotleft ENCODING 171 SWIDTH 500 0 DWIDTH 10 0 BBX 9 8 0 0 BITMAP 0880 1980 3300 6600 CC00 6600 3300 1100 ENDCHAR STARTCHAR logicalnot ENCODING 172 SWIDTH 606 0 DWIDTH 11 0 BBX 9 6 1 1 BITMAP FF80 FF80 0180 0180 0180 0180 ENDCHAR STARTCHAR hyphen ENCODING 173 SWIDTH 333 0 DWIDTH 6 0 BBX 5 2 0 3 BITMAP F8 F8 ENDCHAR STARTCHAR registered ENCODING 174 SWIDTH 747 0 DWIDTH 15 0 BBX 13 13 1 0 BITMAP 0F80 38E0 6030 5F90 CCD8 8CC8 8F88 8D88 CCD8 5EF0 6030 38E0 0F80 ENDCHAR STARTCHAR macron ENCODING 175 SWIDTH 333 0 DWIDTH 6 0 BBX 5 1 1 11 BITMAP F8 ENDCHAR STARTCHAR degree ENCODING 176 SWIDTH 400 0 DWIDTH 7 0 BBX 6 5 1 8 BITMAP 78 CC CC CC 78 ENDCHAR STARTCHAR plusminus ENCODING 177 SWIDTH 570 0 DWIDTH 10 0 BBX 8 11 1 0 BITMAP 18 18 18 FF FF 18 18 18 00 FF FF ENDCHAR STARTCHAR twosuperior ENCODING 178 SWIDTH 300 0 DWIDTH 5 0 BBX 6 8 -1 5 BITMAP 38 4C 0C 18 10 20 64 F8 ENDCHAR STARTCHAR threesuperior ENCODING 179 SWIDTH 300 0 DWIDTH 5 0 BBX 6 8 0 5 BITMAP 38 4C 18 30 18 18 B0 E0 ENDCHAR STARTCHAR acute ENCODING 180 SWIDTH 333 0 DWIDTH 6 0 BBX 5 3 1 10 BITMAP 38 70 C0 ENDCHAR STARTCHAR mu ENCODING 181 SWIDTH 576 0 DWIDTH 10 0 BBX 12 12 -2 -4 BITMAP 3CE0 1CE0 1CC0 19C0 39C0 3BC0 3ED0 7CE0 6000 4000 E000 6000 ENDCHAR STARTCHAR paragraph ENCODING 182 SWIDTH 500 0 DWIDTH 10 0 BBX 9 17 1 -4 BITMAP 0F80 3D00 7D00 FA00 FA00 FA00 FA00 7400 1400 1400 2800 2800 2800 2800 5000 5000 5000 ENDCHAR STARTCHAR periodcentered ENCODING 183 SWIDTH 250 0 DWIDTH 5 0 BBX 3 2 1 4 BITMAP E0 E0 ENDCHAR STARTCHAR cedilla ENCODING 184 SWIDTH 333 0 DWIDTH 6 0 BBX 5 4 -1 -4 BITMAP 30 38 98 70 ENDCHAR STARTCHAR onesuperior ENCODING 185 SWIDTH 300 0 DWIDTH 5 0 BBX 4 8 0 5 BITMAP 10 70 30 30 60 60 60 F0 ENDCHAR STARTCHAR ordmasculine ENCODING 186 SWIDTH 300 0 DWIDTH 7 0 BBX 7 7 0 5 BITMAP 1C 36 66 6C 38 00 F8 ENDCHAR STARTCHAR guillemotright ENCODING 187 SWIDTH 500 0 DWIDTH 11 0 BBX 9 8 1 0 BITMAP 4400 6600 3300 1980 3300 6600 CC00 8800 ENDCHAR STARTCHAR onequarter ENCODING 188 SWIDTH 750 0 DWIDTH 13 0 BBX 12 13 0 0 BITMAP 1060 70C0 30C0 3180 6180 6330 6270 F6E0 0CA0 0D60 1BF0 18C0 30C0 ENDCHAR STARTCHAR onehalf ENCODING 189 SWIDTH 750 0 DWIDTH 13 0 BBX 13 13 0 0 BITMAP 1060 70C0 30C0 3180 6180 6370 6298 F618 0C30 0C20 1840 18C8 31F0 ENDCHAR STARTCHAR threequarters ENCODING 190 SWIDTH 750 0 DWIDTH 13 0 BBX 12 13 0 0 BITMAP 3860 4CC0 18C0 3180 1980 1B30 B270 E6E0 0CA0 0D60 1BF0 18C0 30C0 ENDCHAR STARTCHAR questiondown ENCODING 191 SWIDTH 500 0 DWIDTH 9 0 BBX 7 13 0 -4 BITMAP 06 06 00 04 0C 0C 18 78 F0 E0 CC CC 78 ENDCHAR STARTCHAR Agrave ENCODING 192 SWIDTH 667 0 DWIDTH 13 0 BBX 14 17 -1 0 BITMAP 0700 0380 0040 0000 00C0 01C0 01C0 03E0 02E0 0660 0C70 0C70 1FF0 1870 3038 7038 F87C ENDCHAR STARTCHAR Aacute ENCODING 193 SWIDTH 667 0 DWIDTH 13 0 BBX 14 17 -1 0 BITMAP 0038 0070 0080 0000 00C0 01C0 01C0 03E0 02E0 0660 0C70 0C70 1FF0 1870 3038 7038 F87C ENDCHAR STARTCHAR Acircumflex ENCODING 194 SWIDTH 667 0 DWIDTH 13 0 BBX 14 17 -1 0 BITMAP 00C0 01E0 0210 0000 00C0 01C0 01C0 03E0 02E0 0660 0C70 0C70 1FF0 1870 3038 7038 F87C ENDCHAR STARTCHAR Atilde ENCODING 195 SWIDTH 667 0 DWIDTH 13 0 BBX 14 16 -1 0 BITMAP 01D0 02E0 0000 00C0 01C0 01C0 03E0 02E0 0660 0C70 0C70 1FF0 1870 3038 7038 F87C ENDCHAR STARTCHAR Adieresis ENCODING 196 SWIDTH 667 0 DWIDTH 13 0 BBX 14 16 -1 0 BITMAP 0330 0330 0000 00C0 01C0 01C0 03E0 02E0 0660 0C70 0C70 1FF0 1870 3038 7038 F87C ENDCHAR STARTCHAR Aring ENCODING 197 SWIDTH 667 0 DWIDTH 13 0 BBX 14 17 -1 0 BITMAP 00C0 0120 0120 00C0 00C0 01C0 01C0 03E0 02E0 0660 0C70 0C70 1FF0 1870 3038 7038 F87C ENDCHAR STARTCHAR AE ENCODING 198 SWIDTH 944 0 DWIDTH 18 0 BBX 19 13 -1 0 BITMAP 01FFE0 00F8E0 01B840 033840 033100 067300 0C7F00 0C7300 1FE200 18E040 30E0C0 70E1C0 F9FF80 ENDCHAR STARTCHAR Ccedilla ENCODING 199 SWIDTH 667 0 DWIDTH 13 0 BBX 12 17 1 -4 BITMAP 07D0 1E70 3830 7030 7000 6000 E000 E000 E000 F000 7060 7DC0 1F00 0600 0700 1300 0E00 ENDCHAR STARTCHAR Egrave ENCODING 200 SWIDTH 667 0 DWIDTH 12 0 BBX 12 17 0 0 BITMAP 1C00 0E00 0100 0000 3FF0 1C70 1C20 1C20 3880 3980 3F80 3980 3100 7020 7060 70E0 FFC0 ENDCHAR STARTCHAR Eacute ENCODING 201 SWIDTH 667 0 DWIDTH 12 0 BBX 12 17 0 0 BITMAP 00E0 01C0 0200 0000 3FF0 1C70 1C20 1C20 3880 3980 3F80 3980 3100 7020 7060 70E0 FFC0 ENDCHAR STARTCHAR Ecircumflex ENCODING 202 SWIDTH 667 0 DWIDTH 12 0 BBX 12 17 0 0 BITMAP 0180 03C0 0420 0000 3FF0 1C70 1C20 1C20 3880 3980 3F80 3980 3100 7020 7060 70E0 FFC0 ENDCHAR STARTCHAR Edieresis ENCODING 203 SWIDTH 667 0 DWIDTH 12 0 BBX 12 16 0 0 BITMAP 0660 0660 0000 3FF0 1C70 1C20 1C20 3880 3980 3F80 3980 3100 7020 7060 70E0 FFC0 ENDCHAR STARTCHAR Igrave ENCODING 204 SWIDTH 389 0 DWIDTH 7 0 BBX 7 17 0 0 BITMAP 70 38 04 00 3E 1C 1C 1C 38 38 38 38 70 70 70 70 F8 ENDCHAR STARTCHAR Iacute ENCODING 205 SWIDTH 389 0 DWIDTH 7 0 BBX 8 17 0 0 BITMAP 07 0E 10 00 3E 1C 1C 1C 38 38 38 38 70 70 70 70 F8 ENDCHAR STARTCHAR Icircumflex ENCODING 206 SWIDTH 389 0 DWIDTH 7 0 BBX 8 17 0 0 BITMAP 0C 1E 21 00 3E 1C 1C 1C 38 38 38 38 70 70 70 70 F8 ENDCHAR STARTCHAR Idieresis ENCODING 207 SWIDTH 389 0 DWIDTH 7 0 BBX 8 16 0 0 BITMAP 33 33 00 3E 1C 1C 1C 38 38 38 38 70 70 70 70 F8 ENDCHAR STARTCHAR Eth ENCODING 208 SWIDTH 722 0 DWIDTH 14 0 BBX 13 13 0 0 BITMAP 3F80 1DE0 1C70 1C70 3838 FF38 FF38 3838 7070 70F0 70E0 73C0 FF00 ENDCHAR STARTCHAR Ntilde ENCODING 209 SWIDTH 722 0 DWIDTH 13 0 BBX 16 16 -1 0 BITMAP 01D0 02E0 0000 3C1F 1C0E 1E0C 1E0C 1B18 3398 3398 31D8 31D0 60F0 60F0 6060 F060 ENDCHAR STARTCHAR Ograve ENCODING 210 SWIDTH 722 0 DWIDTH 14 0 BBX 12 17 1 0 BITMAP 0E00 0700 0080 0000 07C0 1EE0 3870 7070 7070 E070 E070 E070 E0E0 E0E0 E1C0 7780 3E00 ENDCHAR STARTCHAR Oacute ENCODING 211 SWIDTH 722 0 DWIDTH 14 0 BBX 12 17 1 0 BITMAP 0070 00E0 0100 0000 07C0 1EE0 3870 7070 7070 E070 E070 E070 E0E0 E0E0 E1C0 7780 3E00 ENDCHAR STARTCHAR Ocircumflex ENCODING 212 SWIDTH 722 0 DWIDTH 14 0 BBX 12 17 1 0 BITMAP 0180 03C0 0420 0000 07C0 1EE0 3870 7070 7070 E070 E070 E070 E0E0 E0E0 E1C0 7780 3E00 ENDCHAR STARTCHAR Otilde ENCODING 213 SWIDTH 722 0 DWIDTH 14 0 BBX 12 16 1 0 BITMAP 03A0 05C0 0000 07C0 1EE0 3870 7070 7070 E070 E070 E070 E0E0 E0E0 E1C0 7780 3E00 ENDCHAR STARTCHAR Odieresis ENCODING 214 SWIDTH 722 0 DWIDTH 14 0 BBX 12 16 1 0 BITMAP 0660 0660 0000 07C0 1EE0 3870 7070 7070 E070 E070 E070 E0E0 E0E0 E1C0 7780 3E00 ENDCHAR STARTCHAR multiply ENCODING 215 SWIDTH 570 0 DWIDTH 10 0 BBX 9 8 0 1 BITMAP C180 6300 3600 1C00 1C00 3600 6300 C180 ENDCHAR STARTCHAR Oslash ENCODING 216 SWIDTH 722 0 DWIDTH 14 0 BBX 13 15 1 -1 BITMAP 0018 07F0 1EE0 38F0 71F0 7170 E370 E670 EC70 E8E0 F8E0 F1C0 7780 7E00 C000 ENDCHAR STARTCHAR Ugrave ENCODING 217 SWIDTH 722 0 DWIDTH 14 0 BBX 14 17 1 0 BITMAP 0E00 0700 0080 0000 7E7C 3838 3830 7830 7060 7060 7060 F060 E0C0 E0C0 E0C0 F180 7F00 ENDCHAR STARTCHAR Uacute ENCODING 218 SWIDTH 722 0 DWIDTH 14 0 BBX 14 17 1 0 BITMAP 0070 00E0 0100 0000 7E7C 3838 3830 7830 7060 7060 7060 F060 E0C0 E0C0 E0C0 F180 7F00 ENDCHAR STARTCHAR Ucircumflex ENCODING 219 SWIDTH 722 0 DWIDTH 14 0 BBX 14 17 1 0 BITMAP 0180 03C0 0420 0000 7E7C 3838 3830 7830 7060 7060 7060 F060 E0C0 E0C0 E0C0 F180 7F00 ENDCHAR STARTCHAR Udieresis ENCODING 220 SWIDTH 722 0 DWIDTH 14 0 BBX 14 16 1 0 BITMAP 0660 0660 0000 7E7C 3838 3830 7830 7060 7060 7060 F060 E0C0 E0C0 E0C0 F180 7F00 ENDCHAR STARTCHAR Yacute ENCODING 221 SWIDTH 611 0 DWIDTH 11 0 BBX 12 17 0 0 BITMAP 01C0 0380 0400 0000 F8F0 7060 70C0 3980 3B00 1E00 1C00 1C00 1C00 3800 3800 3800 FE00 ENDCHAR STARTCHAR Thorn ENCODING 222 SWIDTH 611 0 DWIDTH 11 0 BBX 11 13 0 0 BITMAP 3E00 1C00 1C00 1FC0 39E0 38E0 38E0 38E0 31C0 7F80 7000 7000 F800 ENDCHAR STARTCHAR germandbls ENCODING 223 SWIDTH 500 0 DWIDTH 10 0 BBX 12 17 -2 -4 BITMAP 01E0 0370 0670 0670 06E0 0E80 0EC0 0CE0 0CE0 1CE0 1CE0 19C0 1B80 1800 D800 D800 7000 ENDCHAR STARTCHAR agrave ENCODING 224 SWIDTH 500 0 DWIDTH 10 0 BBX 10 12 0 0 BITMAP 3800 1C00 0200 0000 1E80 7B80 7380 E300 E700 E700 EF40 3B80 ENDCHAR STARTCHAR aacute ENCODING 225 SWIDTH 500 0 DWIDTH 10 0 BBX 10 12 0 0 BITMAP 0380 0700 0800 0000 1E80 7B80 7380 E300 E700 E700 EF40 3B80 ENDCHAR STARTCHAR acircumflex ENCODING 226 SWIDTH 500 0 DWIDTH 10 0 BBX 10 12 0 0 BITMAP 0600 0F00 1080 0000 1E80 7B80 7380 E300 E700 E700 EF40 3B80 ENDCHAR STARTCHAR atilde ENCODING 227 SWIDTH 500 0 DWIDTH 10 0 BBX 10 11 0 0 BITMAP 0E80 1700 0000 1E80 7B80 7380 E300 E700 E700 EF40 3B80 ENDCHAR STARTCHAR adieresis ENCODING 228 SWIDTH 500 0 DWIDTH 10 0 BBX 10 11 0 0 BITMAP 1980 1980 0000 1E80 7B80 7380 E300 E700 E700 EF40 3B80 ENDCHAR STARTCHAR aring ENCODING 229 SWIDTH 500 0 DWIDTH 10 0 BBX 10 13 0 0 BITMAP 0600 0900 0900 0600 0000 1E80 7B80 7380 E300 E700 E700 EF40 3B80 ENDCHAR STARTCHAR ae ENCODING 230 SWIDTH 722 0 DWIDTH 14 0 BBX 13 8 0 0 BITMAP 1D70 7BB8 7338 E370 E7C0 E718 EFB0 3BE0 ENDCHAR STARTCHAR ccedilla ENCODING 231 SWIDTH 444 0 DWIDTH 8 0 BBX 8 12 0 -4 BITMAP 1F 7B 60 E0 E0 E0 F6 3C 30 18 98 F0 ENDCHAR STARTCHAR egrave ENCODING 232 SWIDTH 444 0 DWIDTH 9 0 BBX 8 12 0 0 BITMAP 38 1C 02 00 1E 77 67 EE F8 E3 F6 7C ENDCHAR STARTCHAR eacute ENCODING 233 SWIDTH 444 0 DWIDTH 9 0 BBX 8 12 0 0 BITMAP 07 0E 10 00 1E 77 67 EE F8 E3 F6 7C ENDCHAR STARTCHAR ecircumflex ENCODING 234 SWIDTH 444 0 DWIDTH 9 0 BBX 8 12 0 0 BITMAP 0C 1E 21 00 1E 77 67 EE F8 E3 F6 7C ENDCHAR STARTCHAR edieresis ENCODING 235 SWIDTH 444 0 DWIDTH 9 0 BBX 8 11 0 0 BITMAP 33 33 00 1E 77 67 EE F8 E3 F6 7C ENDCHAR STARTCHAR igrave ENCODING 236 SWIDTH 278 0 DWIDTH 5 0 BBX 5 12 0 0 BITMAP E0 70 08 00 F0 70 70 60 60 E0 F0 60 ENDCHAR STARTCHAR iacute ENCODING 237 SWIDTH 278 0 DWIDTH 5 0 BBX 6 12 0 0 BITMAP 1C 38 40 00 F0 70 70 60 60 E0 F0 60 ENDCHAR STARTCHAR icircumflex ENCODING 238 SWIDTH 278 0 DWIDTH 5 0 BBX 6 12 0 0 BITMAP 30 78 84 00 F0 70 70 60 60 E0 F0 60 ENDCHAR STARTCHAR idieresis ENCODING 239 SWIDTH 278 0 DWIDTH 5 0 BBX 5 11 0 0 BITMAP D8 D8 00 F0 70 70 60 60 E0 F0 60 ENDCHAR STARTCHAR eth ENCODING 240 SWIDTH 500 0 DWIDTH 10 0 BBX 9 12 0 0 BITMAP 3000 1B00 1C00 2600 1F00 7380 6380 E380 E380 E300 E700 7C00 ENDCHAR STARTCHAR ntilde ENCODING 241 SWIDTH 556 0 DWIDTH 10 0 BBX 10 11 0 0 BITMAP 1D00 2E00 0000 F700 7B80 7380 7380 6300 E700 E740 E780 ENDCHAR STARTCHAR ograve ENCODING 242 SWIDTH 500 0 DWIDTH 10 0 BBX 9 12 0 0 BITMAP 3800 1C00 0200 0000 1F00 7380 6380 E380 E380 E300 E700 7C00 ENDCHAR STARTCHAR oacute ENCODING 243 SWIDTH 500 0 DWIDTH 10 0 BBX 9 12 0 0 BITMAP 0380 0700 0800 0000 1F00 7380 6380 E380 E380 E300 E700 7C00 ENDCHAR STARTCHAR ocircumflex ENCODING 244 SWIDTH 500 0 DWIDTH 10 0 BBX 9 12 0 0 BITMAP 0C00 1E00 2100 0000 1F00 7380 6380 E380 E380 E300 E700 7C00 ENDCHAR STARTCHAR otilde ENCODING 245 SWIDTH 500 0 DWIDTH 10 0 BBX 9 11 0 0 BITMAP 1D00 2E00 0000 1F00 7380 6380 E380 E380 E300 E700 7C00 ENDCHAR STARTCHAR odieresis ENCODING 246 SWIDTH 500 0 DWIDTH 10 0 BBX 9 11 0 0 BITMAP 3300 3300 0000 1F00 7380 6380 E380 E380 E300 E700 7C00 ENDCHAR STARTCHAR divide ENCODING 247 SWIDTH 570 0 DWIDTH 10 0 BBX 8 8 1 1 BITMAP 18 18 00 FF FF 00 18 18 ENDCHAR STARTCHAR oslash ENCODING 248 SWIDTH 500 0 DWIDTH 10 0 BBX 9 12 0 -2 BITMAP 0180 0300 1F00 7780 6D80 E980 CB80 D300 F700 7C00 6000 C000 ENDCHAR STARTCHAR ugrave ENCODING 249 SWIDTH 556 0 DWIDTH 10 0 BBX 10 12 0 0 BITMAP 7000 3800 0400 0000 F380 7380 7300 6700 E700 EF00 FB40 7380 ENDCHAR STARTCHAR uacute ENCODING 250 SWIDTH 556 0 DWIDTH 10 0 BBX 10 12 0 0 BITMAP 0380 0700 0800 0000 F380 7380 7300 6700 E700 EF00 FB40 7380 ENDCHAR STARTCHAR ucircumflex ENCODING 251 SWIDTH 556 0 DWIDTH 10 0 BBX 10 12 0 0 BITMAP 0C00 1E00 2100 0000 F380 7380 7300 6700 E700 EF00 FB40 7380 ENDCHAR STARTCHAR udieresis ENCODING 252 SWIDTH 556 0 DWIDTH 10 0 BBX 10 11 0 0 BITMAP 3300 3300 0000 F380 7380 7300 6700 E700 EF00 FB40 7380 ENDCHAR STARTCHAR yacute ENCODING 253 SWIDTH 444 0 DWIDTH 7 0 BBX 10 16 -2 -4 BITMAP 01C0 0380 0400 0000 7B80 3980 3980 3900 1B00 1E00 1E00 0C00 0C00 C800 D800 7000 ENDCHAR STARTCHAR thorn ENCODING 254 SWIDTH 500 0 DWIDTH 9 0 BBX 11 17 -2 -4 BITMAP 1E00 0E00 0E00 0C00 0C00 1DC0 1EE0 1CE0 1CE0 38E0 39C0 3980 3700 3000 7000 7000 F800 ENDCHAR STARTCHAR ydieresis ENCODING 255 SWIDTH 444 0 DWIDTH 7 0 BBX 9 15 -2 -4 BITMAP 3300 3300 0000 7B80 3980 3980 3900 1B00 1E00 1E00 0C00 0C00 C800 D800 7000 ENDCHAR STARTCHAR Lslash ENCODING -1 SWIDTH 611 0 DWIDTH 11 0 BBX 11 13 0 0 BITMAP 3E00 1C00 1C00 1800 3A00 3C00 3800 7000 B000 7060 7060 71C0 FFC0 ENDCHAR STARTCHAR OE ENCODING -1 SWIDTH 944 0 DWIDTH 18 0 BBX 18 13 0 0 BITMAP 07FFC0 1E71C0 387080 707080 706200 E0E600 E0FE00 E0E600 E0C400 E1C080 71C180 73C380 1FFF00 ENDCHAR STARTCHAR Scaron ENCODING -1 SWIDTH 556 0 DWIDTH 11 0 BBX 10 17 0 0 BITMAP 0840 0780 0300 0000 0F40 1DC0 38C0 3840 3C00 1E00 0F00 0F80 0780 C380 C380 E700 FE00 ENDCHAR STARTCHAR Ydieresis ENCODING -1 SWIDTH 611 0 DWIDTH 11 0 BBX 12 16 0 0 BITMAP 0CC0 0CC0 0000 F8F0 7060 70C0 3980 3B00 1E00 1C00 1C00 1C00 3800 3800 3800 FE00 ENDCHAR STARTCHAR Zcaron ENCODING -1 SWIDTH 611 0 DWIDTH 11 0 BBX 13 17 -1 0 BITMAP 0420 03C0 0180 0000 1FF8 38F0 20E0 01C0 0380 0700 0F00 0E00 1C00 3820 7060 F0E0 FFC0 ENDCHAR STARTCHAR breve ENCODING -1 SWIDTH 333 0 DWIDTH 6 0 BBX 5 3 1 9 BITMAP 88 F8 70 ENDCHAR STARTCHAR bullet ENCODING -1 SWIDTH 350 0 DWIDTH 7 0 BBX 5 5 1 3 BITMAP 70 F8 F8 F8 70 ENDCHAR STARTCHAR caron ENCODING -1 SWIDTH 333 0 DWIDTH 6 0 BBX 6 3 1 9 BITMAP 84 78 30 ENDCHAR STARTCHAR circumflex ENCODING -1 SWIDTH 333 0 DWIDTH 6 0 BBX 6 3 1 9 BITMAP 30 78 84 ENDCHAR STARTCHAR dagger ENCODING -1 SWIDTH 500 0 DWIDTH 9 0 BBX 8 16 0 -2 BITMAP 0C 0C 08 08 FF CB 08 18 18 18 10 30 30 20 20 20 ENDCHAR STARTCHAR daggerdbl ENCODING -1 SWIDTH 500 0 DWIDTH 10 0 BBX 9 16 0 -2 BITMAP 0600 0600 0400 0400 7F80 6580 0C00 0C00 0800 0800 FF00 D300 1000 1000 3000 3000 ENDCHAR STARTCHAR dotaccent ENCODING -1 SWIDTH 333 0 DWIDTH 6 0 BBX 2 2 2 9 BITMAP C0 C0 ENDCHAR STARTCHAR dotlessi ENCODING -1 SWIDTH 278 0 DWIDTH 5 0 BBX 5 8 0 0 BITMAP F0 70 70 60 60 E0 E8 70 ENDCHAR STARTCHAR ellipsis ENCODING -1 SWIDTH 1000 0 DWIDTH 18 0 BBX 15 2 1 0 BITMAP E38E E38E ENDCHAR STARTCHAR emdash ENCODING -1 SWIDTH 1000 0 DWIDTH 19 0 BBX 19 2 0 4 BITMAP FFFFE0 FFFFE0 ENDCHAR STARTCHAR endash ENCODING -1 SWIDTH 500 0 DWIDTH 9 0 BBX 9 2 0 4 BITMAP FF80 FF80 ENDCHAR STARTCHAR fi ENCODING -1 SWIDTH 556 0 DWIDTH 10 0 BBX 12 17 -2 -4 BITMAP 03F0 0730 0630 0E00 0E00 3FE0 0E60 0EE0 0CC0 1CC0 1DC0 1DE0 1CC0 1800 D800 D800 7000 ENDCHAR STARTCHAR fl ENCODING -1 SWIDTH 556 0 DWIDTH 10 0 BBX 12 17 -2 -4 BITMAP 03F0 0770 0670 0E60 0E60 3FE0 0EE0 0EE0 0CC0 1CC0 1DC0 1DE0 1CC0 1800 D800 D800 7000 ENDCHAR STARTCHAR florin ENCODING -1 SWIDTH 500 0 DWIDTH 9 0 BBX 10 17 -1 -4 BITMAP 03C0 06C0 0600 0600 0E00 3F80 0E00 0E00 0C00 0C00 1C00 1C00 1800 1800 D800 D800 7000 ENDCHAR STARTCHAR fraction ENCODING -1 SWIDTH 167 0 DWIDTH 7 0 BBX 9 13 -1 0 BITMAP 0180 0300 0300 0600 0600 0C00 1800 1800 3000 3000 6000 6000 C000 ENDCHAR STARTCHAR grave ENCODING -1 SWIDTH 333 0 DWIDTH 6 0 BBX 5 3 1 10 BITMAP E0 70 18 ENDCHAR STARTCHAR guilsinglleft ENCODING -1 SWIDTH 333 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 08 18 30 60 C0 60 30 10 ENDCHAR STARTCHAR guilsinglright ENCODING -1 SWIDTH 333 0 DWIDTH 7 0 BBX 5 8 1 0 BITMAP 40 60 30 18 30 60 C0 80 ENDCHAR STARTCHAR hungarumlaut ENCODING -1 SWIDTH 333 0 DWIDTH 8 0 BBX 8 3 1 10 BITMAP 77 66 CC ENDCHAR STARTCHAR lslash ENCODING -1 SWIDTH 278 0 DWIDTH 6 0 BBX 7 13 0 0 BITMAP 3C 1C 1C 18 3A 3C 78 B8 30 70 70 74 38 ENDCHAR STARTCHAR oe ENCODING -1 SWIDTH 722 0 DWIDTH 14 0 BBX 13 8 0 0 BITMAP 1EF0 73B8 6338 E370 E3C0 E318 E7B0 7DE0 ENDCHAR STARTCHAR ogonek ENCODING -1 SWIDTH 333 0 DWIDTH 6 0 BBX 5 4 0 -4 BITMAP 60 C0 D8 70 ENDCHAR STARTCHAR perthousand ENCODING -1 SWIDTH 1000 0 DWIDTH 20 0 BBX 19 13 0 0 BITMAP 3CC000 778000 E58000 CD0000 DB0000 720000 060000 04E1C0 0DD3A0 0B9720 1B3660 1366C0 31C380 ENDCHAR STARTCHAR quotedblbase ENCODING -1 SWIDTH 500 0 DWIDTH 9 0 BBX 7 5 0 -3 BITMAP EE EE 66 44 88 ENDCHAR STARTCHAR quotedblleft ENCODING -1 SWIDTH 500 0 DWIDTH 9 0 BBX 7 5 1 8 BITMAP 22 44 CC EE EE ENDCHAR STARTCHAR quotedblright ENCODING -1 SWIDTH 500 0 DWIDTH 9 0 BBX 7 5 2 8 BITMAP EE EE 66 44 88 ENDCHAR STARTCHAR quotesinglbase ENCODING -1 SWIDTH 333 0 DWIDTH 6 0 BBX 3 5 1 -3 BITMAP E0 E0 60 40 80 ENDCHAR STARTCHAR quotesingle ENCODING -1 SWIDTH 278 0 DWIDTH 5 0 BBX 4 5 1 8 BITMAP 70 60 C0 C0 80 ENDCHAR STARTCHAR ring ENCODING -1 SWIDTH 333 0 DWIDTH 6 0 BBX 4 4 1 9 BITMAP 60 90 90 60 ENDCHAR STARTCHAR scaron ENCODING -1 SWIDTH 389 0 DWIDTH 7 0 BBX 8 12 -1 0 BITMAP 21 1E 0C 00 3E 77 72 38 1C 4E EE 7C ENDCHAR STARTCHAR tilde ENCODING -1 SWIDTH 333 0 DWIDTH 6 0 BBX 6 2 1 9 BITMAP 74 B8 ENDCHAR STARTCHAR trademark ENCODING -1 SWIDTH 1000 0 DWIDTH 19 0 BBX 17 7 1 6 BITMAP FEC180 926300 106300 105500 105D00 104900 38C980 ENDCHAR STARTCHAR zcaron ENCODING -1 SWIDTH 389 0 DWIDTH 7 0 BBX 8 13 0 -1 BITMAP 21 1E 0C 00 3E 7E 4C 18 30 60 E6 F6 1C ENDCHAR ENDFONT bogl-0.1.18/bogl-vga16.c0000644000000000000000000003504611407777275011454 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . VGA optimisations (c) Copyright Red Hat Inc 2002, . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /*#define NDEBUG*/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "bogl.h" #include "boglP.h" #include "bogl-vga16.h" /* VGA16 support for BOGL. */ /* bits_set[X] is the number of nonzero bits in X. */ static unsigned char bits_set[256]; static int cached_color = -2; static int cached_sr_mask = -1; static int cached_op = -1; static int cached_write_mask = -1; static int cached_plane = -1; static int cached_mode = -1; /* Program the Set/Reset Register for drawing in color COLOR for write mode 0. */ static inline void set_color (int c) { if(cached_color != c) { outb (0, 0x3ce); outb (c, 0x3cf); cached_color = c; } } /* Set the Enable Set/Reset Register. */ static inline void set_enable_sr (int mask) { if(cached_sr_mask != mask) { outb (1, 0x3ce); outb (mask, 0x3cf); cached_sr_mask = mask; } } /* Select the Bit Mask Register on the Graphics Controller. */ static inline void select_mask (void) { outb (8, 0x3ce); } /* Program the Bit Mask Register to affect only the pixels selected in MASK. The Bit Mask Register must already have been selected with select_mask (). */ static inline void set_mask (int mask) { outb (mask, 0x3cf); } /* Set the Data Rotate Register. Bits 0-2 are rotate count, bits 3-4 are logical operation (0=NOP, 1=AND, 2=OR, 3=XOR). */ static inline void set_op (int op) { if(op != cached_op) { outb (3, 0x3ce); outb (op, 0x3cf); cached_op = op; } } /* Set the Memory Plane Write Enable register. */ static inline void set_write_planes (int mask) { if(mask != cached_write_mask) { outb (2, 0x3c4); outb (mask, 0x3c5); mask = cached_write_mask; } } /* Set the Read Map Select register. */ static inline void set_read_plane (int plane) { if(cached_plane != plane) { outb (4, 0x3ce); outb (plane, 0x3cf); cached_plane = plane; } } /* Set the Graphics Mode Register. The write mode is in bits 0-1, the read mode is in bit 3. */ static inline void set_mode (int mode) { if(cached_mode != mode) { outb (5, 0x3ce); outb (mode, 0x3cf); cached_mode = mode; } } /* Read-modify-write the specified memory byte. */ static inline void rmw (volatile char *p) { *p |= 1; } /* Set pixel (X,Y) to color C. */ void bogl_vga16_pixel (int x, int y, int c) { bogl_drawing = 1; assert (x >= 0 && x < bogl_xres); assert (y >= 0 && y < bogl_yres); set_color (c); select_mask (); set_mask (0x80 >> (x % 8)); rmw (bogl_frame + x / 8 + y * bogl_line_len); bogl_drawing = 0; } /* Paint a horizontal line from (X1,Y) to (X2,Y) in color C, where X2 >= X1. The final point is not painted. */ void bogl_vga16_hline (int x1, int x2, int y, int c) { volatile char *dst; assert (x1 >= 0 && x1 < bogl_xres); assert (x2 >= 0 && x2 <= bogl_xres); assert (x2 >= x1); assert (y >= 0 && y < bogl_yres); if (x1 == x2) return; x2--; bogl_drawing = 1; set_color (c); dst = bogl_frame + x1 / 8 + y * bogl_line_len; select_mask (); if (x1 / 8 == x2 / 8) { set_mask ((0xff >> (x1 % 8)) & (0xff << (7 - x2 % 8))); rmw (dst); } else { volatile char *last; set_mask (0xff >> (x1 % 8)); rmw (dst++); set_mask (0xff); last = bogl_frame + x2 / 8 + y * bogl_line_len; while (dst < last) { while(!((unsigned long)dst&3) && last-dst > 3) { *(unsigned int *)dst = 0x01010101; dst+=4; } if(dst < last) *dst++ = 1; } set_mask (0xff << (7 - x2 % 8)); rmw (dst); } bogl_drawing = 0; } /* Paints a vertical line from (X,Y1) to (X,Y2) in color C. The final point is not painted. */ void bogl_vga16_vline (int x, int y1, int y2, int c) { volatile char *dst, *last; assert (x >= 0 && x < bogl_xres); assert (y1 >= 0 && y1 < bogl_yres); assert (y2 >= 0 && y2 <= bogl_yres); assert (y2 >= y1); y2--; bogl_drawing = 1; set_color (c); select_mask (); set_mask (0x80 >> (x % 8)); dst = bogl_frame + x / 8 + y1 * bogl_line_len; last = bogl_frame + x / 8 + y2 * bogl_line_len; while (dst <= last) { rmw (dst); dst += bogl_line_len; } bogl_drawing = 0; } /* Clear the region from (X1,Y1) to (X2,Y2) to color C, not including the last row or column. If C == -1 then the region's colors are inverted rather than set to a particular color. */ void bogl_vga16_clear (int x1, int y1, int x2, int y2, int c) { volatile char *dst; /* A kludge to make dbootstrap work in a bterm assert (x1 >= 0 && x1 < bogl_xres); assert (x2 >= 0 && x2 <= bogl_xres); assert (x2 >= x1); assert (y1 >= 0 && y1 < bogl_yres); assert (y2 >= 0 && y2 <= bogl_yres); assert (y2 >= y1); */ if (x1 == x2) return; x2--; bogl_drawing = 1; set_color (c); if (c == -1) set_op (0x18); select_mask (); if (x1 / 8 == x2 / 8) { volatile char *last; dst = bogl_frame + x1 / 8 + y1 * bogl_line_len; last = bogl_frame + x2 / 8 + y2 * bogl_line_len; set_mask ((0xff >> (x1 % 8)) & (0xff << (7 - x2 % 8))); while (dst < last) { rmw (dst); dst += bogl_line_len; } } else { /* FIXME: the following code could admittedly be more efficient, but my first attempt at optimization was buggy. */ int y; for (y = y1; y < y2; y++) { volatile char *last; dst = bogl_frame + x1 / 8 + y * bogl_line_len; set_mask (0xff >> (x1 % 8)); rmw (dst++); set_mask (0xff); last = bogl_frame + x2 / 8 + y * bogl_line_len; while (dst < last) { while(!((unsigned long)dst&3) && last-dst > 3) { *(unsigned int *)dst = 0x01010101; dst+=4; } if(dst < last) *dst++ = 1; } set_mask (0xff << (7 - x2 % 8)); rmw (dst); } } set_op (0); bogl_drawing = 0; } /* FIXME: it would be faster to use write mode 3 to write the middle bytes (but also more complex). */ #define ul_size (sizeof (u_int32_t)) #define ul_bits (CHAR_BIT * ul_size) void bogl_vga16_text (int xx, int yy, const char *s, int n, int fg, int bg, int ul, const struct bogl_font *font) { /* Font height, or possibly less due to clipping. */ int h; int x, y; u_int32_t bits[font->height]; int k; wchar_t wc; void plot (int bg) { volatile char *dst = bogl_frame + xx / 8 + yy * bogl_line_len; int y, i; for (y = 0; y < h; y++) { u_int32_t b = bits[y]; for (i = ul_size - 1; i >= 0; i--) { if((b & 0xFF) || bg == -1) { set_mask (b); rmw (dst + i); } b >>= 8; } dst += bogl_line_len; } } assert (xx >= 0 && xx < bogl_xres); assert (yy >= 0 && yy < bogl_yres); h = font->height; if (yy + h > bogl_yres) h = bogl_yres - yy; if (bg != -1) { int x2 = xx + bogl_metrics (s, n, font); if (x2 >= bogl_xres) x2 = bogl_xres - 1; bogl_vga16_clear (xx, yy, x2, yy + h, bg); } bogl_drawing = 1; for (y = 0; y < h; y++) bits[y] = 0; set_color (fg); select_mask (); x = xx % ul_bits; xx = xx / ul_bits * ul_bits; mbtowc (0, 0, 0); for (; (k = mbtowc (&wc, s, n)) > 0; s += k, n -= k) { u_int32_t *character = NULL; int width = bogl_font_glyph (font, wc, &character); if (character == NULL) continue; for (y = 0; y < h; y++) bits[y] |= character[y] >> x; x += width; if (x >= (int) ul_bits) { plot (bg); x -= ul_bits; for (y = 0; y < h; y++) bits[y] = character[y] << (width - x); xx += ul_bits; if (xx >= bogl_xres) goto done; } } plot (bg); done: bogl_drawing = 0; } /* Write PIXMAP at location (XX,YY), with the pixmap's colors mapped according to COLOR_MAP. */ void bogl_vga16_put (int xx, int yy, const struct bogl_pixmap *pixmap, const int color_map[16]) { volatile char *dst; const unsigned char *src; int x, y; assert (xx >= 0 && xx < bogl_xres); assert (xx + pixmap->width <= bogl_xres); assert (yy >= 0 && yy < bogl_yres); assert (yy + pixmap->height <= bogl_yres); src = pixmap->data; bogl_drawing = 1; y = yy; while (y < yy + pixmap->height) { x = xx; dst = bogl_frame + x / 8 + y * bogl_line_len; while (x < xx + pixmap->width) { int color = *src & 0xf; int count = *src >> 4; src++; if (color == pixmap->transparent) { dst += (x + count) / 8 - x / 8; x += count; continue; } set_color (color_map[color]); select_mask (); if (count == 1) { set_mask (0x80 >> (x % 8)); *dst |= 1; if (++x % 8 == 0) dst++; continue; } for (;;) { /* Get a mask for COUNT bits starting at X, or at least as many as will fit in one byte. */ unsigned mask; mask = (0xffff00 >> count) & 0xff; mask >>= x % 8; set_mask (mask); /* Write the bits and bow out if we don't need to advance to the next byte. */ *dst |= 1; if ((mask & 1) == 0) { x += count; break; } /* Advance to the next byte. */ dst++; x += bits_set[mask]; count -= bits_set[mask]; if (!count) break; } } y++; } bogl_drawing = 0; } /* Draw mouse pointer POINTER with its hotspot at (X,Y), if VISIBLE != 0. Restores the previously saved background at that point, if VISIBLE == 0. COLORS[] gives the color indices to paint the cursor. This routine performs full clipping on all sides of the screen. */ void bogl_vga16_pointer (int visible, int x1, int y1, const struct bogl_pointer *pointer, int colors[2]) { int y_count; /* Number of scanlines. */ int y_ofs; /* Number of scanlines to skip drawing. */ int x_ofs; /* Number of pixels to skip drawing on each line. */ assert (pointer != NULL); x1 -= pointer->hx; y1 -= pointer->hy; if (y1 + 16 > bogl_yres) y_count = bogl_yres - y1; else y_count = 16; if (x1 < 0) { x_ofs = -x1; x1 = 0; } else x_ofs = 0; if (y1 < 0) { y_ofs = -y1; y1 = 0; y_count -= y_ofs; } else y_ofs = 0; bogl_drawing = 1; /* Save or restore the framebuffer contents. */ { /* Four planes of sixteen rows of four bytes each. */ static unsigned char saved[4 * 16 * 3]; int plane; /* Current plane. */ int sx_ofs; /* Byte offset within a scanline to save/restore. */ sx_ofs = x1 / 8; if (sx_ofs + 3 > bogl_line_len) sx_ofs = bogl_line_len - 3; if (visible) { for (plane = 0; plane < 4; plane++) { volatile char *dst = saved + plane * 16 * 3; volatile char *src = bogl_frame + sx_ofs + y1 * bogl_line_len; int y = y_count; set_read_plane (plane); while (y--) { *dst++ = *src++; *dst++ = *src++; *dst++ = *src++; src += bogl_line_len - 3; } } } else { set_enable_sr (0); select_mask (); set_mask (0xff); for (plane = 0; plane < 4; plane++) { volatile char *dst = bogl_frame + sx_ofs + y1 * bogl_line_len; volatile char *src = saved + plane * 16 * 3; int y = y_count; set_write_planes (1 << plane); while (y--) { *dst++ = *src++; *dst++ = *src++; *dst++ = *src++; dst += bogl_line_len - 3; } } set_write_planes (0xf); set_enable_sr (0xf); } } if (visible) { const unsigned short *mask_p, *color_p; int x_count; int y; int color; x_count = x1 % 8 ? 3 : 2; if (x1 / 8 + x_count > bogl_line_len) x_count = bogl_line_len - x1 / 8; for (color = 0; color < 2; color++) { set_color (colors[color]); select_mask (); mask_p = pointer->mask + y_ofs; color_p = pointer->color + y_ofs; for (y = 0; y < y_count; y++, mask_p++, color_p++) { volatile char *dst; u_int32_t bits; int x; dst = bogl_frame + x1 / 8 + (y1 + y) * bogl_line_len; if (color) bits = *mask_p ^ *color_p; else bits = *mask_p & *color_p; bits <<= (CHAR_BIT * (sizeof (u_int32_t) - sizeof (short))) + x_ofs; bits >>= x1 % 8; x = x_count; while (x--) { set_mask (bits >> 24); rmw (dst++); bits <<= 8; } } } } bogl_drawing = 0; } /* Initialize the VGA controller. Returns the number of bytes to memory map on success, or zero on failure. */ size_t bogl_vga16_init (void) { #ifdef __x86_64__ /* temp. workaround until ioperm works on hammer */ if (-1 == iopl(3)) { bogl_fail ("can't get IO permissions: %s", strerror (errno)); return 0; } #endif if (-1 == ioperm (0x3c0, 0x20, 1)) { bogl_fail ("can't get IO permissions: %s", strerror (errno)); return 0; } /* Set up some default values for the VGA Graphics Registers. */ set_enable_sr (0xf); set_op (0); set_mode (0); /* Initialize bits_set array. */ { int i; for (i = 0; i < 256; i++) { int c, j; for (c = j = 0; j < 8; j++) c += (i & (1 << j)) != 0; bits_set[i] = c; } } return 0x10000; } /* Clear cached values that may no longer be correct after a VT switch. */ void bogl_vga16_reinit (void) { cached_color = -1; cached_sr_mask = -1; cached_op = -1; cached_write_mask = -1; cached_plane = -1; cached_mode = -1; set_enable_sr (0xf); set_write_planes (0xf); set_op (0); set_mode (0); set_color (0); set_read_plane (0); } /* * vim:ts=8:sw=2 */ bogl-0.1.18/ChangeLog0000644000000000000000000002351411407777275011212 0ustar 2004-05-05 Daniel Jacobowitz * Version 0.1.18 released. 2004-05-05 Daniel Jacobowitz From Colin Watson : * bterm.c (get_ptytty): Support Unix98 PTYs. (main): Handle errors from get_ptytty. 2004-05-05 Daniel Jacobowitz * bogl-bterm.c (bogl_vga16_reinit): New function. (cached_color, cached_sr_mask, cached_op, cached_write_mask) (cached_plane, cached_mode): Move to file scope. (set_color, set_enable_sr, set_op, set_write_planes) (set_read_plane, set_mode): Update. * bogl-bterm.h (bogl_vga16_reinit): Add prototype. * bogl.c (draw_enable): Set bogl_reinit. (draw_disable): Likewise. (vt_switch): Call bogl_reinit. * bogl.h (bogl_reinit): Declare. * bterm.c (main): Call bogl_set_palette after VT switch. 2004-03-07 Daniel Jacobowitz * Version 0.1.17 released. 2004-03-07 Daniel Jacobowitz * bdftobogl.c (bogl_write_font): Fix a typo in last change. 2004-02-24 Daniel Jacobowitz * Version 0.1.16 released. 2004-02-24 Daniel Jacobowitz * bdftobogl.c (zero_buf): New. (bogl_write_font): Pad name to sizeof(long). 2004-01-20 Daniel Jacobowitz * Version 0.1.15 released. 2004-01-20 Matt Kraai * bterm.c (font_name, term): Make global. (reload_font): New function. (main): Set reload_font as the SIGHUP handler. 2003-11-04 Daniel Jacobowitz * Version 0.1.14 released. 2003-11-04 Daniel Jacobowitz * bogl-term.c (term_clear_one): New function. (bogl_term_out): Fix "\33[J" support. 2003-11-04 Daniel Jacobowitz * bogl-term.c (dirty_scroll, dirty_backscroll): Fix and enable logic. (cursor_down, bogl_term_out): Adjust yorig after calling dirty_scroll and dirty_backscroll. 2003-11-04 Daniel Jacobowitz * bogl-term.c (bogl_term_dirty): New function. * bogl-term.h (bogl_term_dirty): Add prototype. * bogl.c (vt_switch): Set bogl_refresh = 2 for VT switches. * bterm.c (main): Call bogl_term_dirty after a VT switch. 2003-10-05 Daniel Jacobowitz * Version 0.1.13 released. 2003-10-05 Daniel Jacobowitz Import some changes from Red Hat, Inc. (Alan Cox): * bogl-term.c (bogl_term_new): Initialize "dirty". (term_match, term_is_clear, dirty_scroll, dirty_backscroll): New. (cursor_down, show_cursor, clear_left, clear_right) (bogl_term_out, bogl_term_redraw): Use them. Use dirty member. Remove some immediate refreshes. (bogl_vga16_put): Fix a typo. * bogl-term.h (struct bogl_term): Add dirty member. * bterm.c (main): Delayed refresh. * bogl-vga16.c (set_color, set_enable_sr, set_op, set_write_planes) (set_read_plane, set_mode): Cache last value, update lazily. (bogl_vga16_hline, bogl_vga16_clear): Write word-sized pieces. (bogl_vga16_text): Optimize plot. 2003-10-05 Daniel Jacobowitz Import some changes from the Red Hat packaging of BOGL. * Makefile: Build vga16 support for ia64 and x86_64 also. * bogl-term.c (bogl_term_new): Use calloc. 2003-04-15 Daniel Jacobowitz * Version 0.1.12 released. 2003-04-15 Daniel Jacobowitz * bogl-vga16.c (bogl_vga16_init): Add a workaround for x86-64, from Matt Wilson . 2003-03-23 Daniel Jacobowitz * Version 0.1.11 released. 2003-03-23 Daniel Jacobowitz * Makefile: Enable vga16 mode for ARM. 2003-03-23 Daniel Jacobowitz From Martin Sjgren : * bogl.c (bogl_init): Check fb/0 and vc/0. * bterm.c (get_ptytty): Check /dev/pty/. 2002-08-17 Daniel Jacobowitz * Version 0.1.10 released. 2002-08-17 Daniel Jacobowitz * bdftobogl.1: New file. 2002-08-17 Daniel Jacobowitz * bogl.c (bogl_init): Provide a default for line length if the framebuffer doesn't tell us. 2002-08-17 Daniel Jacobowitz * bogl-term.c (bogl_term_out): Update comment to reflect incomplete character handling. 2002-08-17 Daniel Jacobowitz * bogl-term.c (bogl_term_out): Handle mbrtowc errors more gracefully. 2002-03-31 Daniel Jacobowitz * bterm.1: New file. 2002-03-17 Daniel Jacobowitz * Version 0.1.9 released. 2002-03-17 Daniel Jacobowitz * bogl-term.c (bogl_term_out): Add support for `ri' (scroll up). Remember to hide the cursor before moving it. * bterm.ti: Add `ri'. 2002-03-17 Daniel Jacobowitz * bogl-term.c (bogl_term_out): Add support for `ed' (clear to end of screen). * bterm.ti: Add `ed'. 2002-03-17 Daniel Jacobowitz * bogl-term.c (bogl_term_out): Handle non-UTF-8 locales with acsc a little better. 2002-03-17 Daniel Jacobowitz Patch from Philip Blundell. * bterm.ti: Add acsc, smacs, and rmacs. * bogl-term.h (struct bogl_term): Add acs flag. * bogl-term.c (bogl_term_out): Support acsc, smacs, and rmacs. 2002-03-17 Daniel Jacobowitz * bogl.c: Include . New variable bogl_frame_mapped. (bogl_init): Handle non-page-aligned framebuffers. 2002-01-27 Daniel Jacobowitz * bogl-term.c (bogl_term_out): Handle bad wide characters more robustly. 2001-12-01 Daniel Jacobowitz * Version 0.1.8 released. 2001-12-01 Daniel Jacobowitz * bterm.ti: Copy key capabalities from the ``linux'' terminfo entry, since we run on a Linux console. 2001-12-01 Daniel Jacobowitz * bogl-term.c (bogl_term_out): Reset xpos after receiving a Home (\e[H) sequence. 2001-12-01 Daniel Jacobowitz * bogl-term.c (put_char): Use arguments instead of term-> state, reported by Philip Blundell. (show_cursor): Pass properly inverted colors to put_char. 2001-12-01 Daniel Jacobowitz * bdftobogl.c, bogl-cfb8.c, bogl-font.c, bogl-pcfb.c, bogl-tcfb.c, bogl-vga16.c, bogl.c, bogl.h, symbol.c: Use u_int32_t instead of unsigned long. 2001-12-01 Daniel Jacobowitz * bterm.c (spawn_shell): Uncomment TIOCSTTY ioctl, from Philip Blundell. 2001-11-11 Daniel Jacobowitz * Version 0.1.7 released. 2001-11-11 Daniel Jacobowitz * reduce-font.c (main): Better error checking, from Philip Blundell. 2001-11-11 Daniel Jacobowitz * bogl-cfb.h (bits4): Add __attribute__ ((packed)). (bits24): Likewise. Sun May 27 18:25:58 PDT 2001 Daniel Jacobowitz (dan@debian.org) * Version 0.1.6 released. * Stop building, referencing, and including libutf8_plug. * Build and install reduce-font. Sun May 27 18:14:41 PDT 2001 Daniel Jacobowitz (dan@debian.org) * bowl-boxes.c: Include for va_* macros. Sun May 27 17:43:22 PDT 2001 Daniel Jacobowitz (dan@debian.org) * Version 0.1.5 released. * bogl.c (init_fb): Accept DIRECTCOLOR visuals as if they were TRUECOLOR. Seems to work. (draw_enable): Likewise. Sun May 27 17:41:50 PDT 2001 Daniel Jacobowitz (dan@debian.org) * bterm.ti: Fix my bterm.ti typo from reverse video patch. * Makefile: Install compiled bterm.ti. Sun May 27 17:15:10 PDT 2001 Daniel Jacobowitz (dan@debian.org) * bogl-term.c (bogl_term_out): Correct bterm fix, from Edmund GRIMLEY EVANS . Sun Mar 11 19:30:41 EST 2001 Daniel Jacobowitz (dan@debian.org) * bogl-term.c (bogl_term_out): Make wide character handling work with glibc 2.2. Sun Mar 11 18:55:12 EST 2001 Daniel Jacobowitz (dan@debian.org) * Makefile: Allow CFLAGS to be safely overridden. Sat Feb 24 16:20:43 EST 2001 Daniel Jacobowitz (dan@debian.org) * Version 0.1.4 released. * Makefile: Install libbogl.so symlink to link to the shared library. Sat Feb 24 16:13:40 EST 2001 Daniel Jacobowitz (dan@debian.org) * boml.c: Include for time(). * boml.c: Fix compilation without M_SERIAL. Sat Feb 24 15:47:19 EST 2001 Daniel Jacobowitz (dan@debian.org) * bogl-term.h (struct bogl_term): Add reverse video flag. * bogl-term.c (bogl_term_new): Initialize it. (put_char): Respect reverse video. (bogl_term_out): Likewise. * bterm.ti: Advertise reverse video, along with standout and sgr capabilities. Sat Feb 24 14:31:16 EST 2001 Daniel Jacobowitz (dan@debian.org) * bogl-cfb.c (memset_var): Modified fix from ha shao for 32 bpp. Tue Dec 26 23:25:35 EST 2000 Daniel Jacobowitz (dan@debian.org) * Version 0.1.3 released. Tue Dec 26 23:11:49 EST 2000 Daniel Jacobowitz (dan@debian.org) * symbol.c: Internationalization made bogl no longer display "\0" when told to, so bump the character numbers in font_symbol. * bowl.c: Change SYM_* likewise. Tue Dec 26 16:00:44 EST 2000 Daniel Jacobowitz (dan@debian.org) * bowl.c (bowl_init): Reshow the mouse if we are reinitialized. Mon Dec 25 22:20:05 EST 2000 Daniel Jacobowitz (dan@debian.org) * Version 0.1.2 released. * tux75.png: Make the background actually transparent. Mon Dec 25 21:41:41 EST 2000 Daniel Jacobowitz (dan@debian.org) * ChangeLog: Reformat. * boml.c: Add M_GPM and M_INPUT. (detect_gpm): New function. (detect_input): New function. * boml.c (boml_quick_init): Quick initialization function which may find "enough" mice to skip detection - gpm and 2.4's unified input layer. * boml.h: Prototype boml_quick_init (). * bowl.c (bowl_init): Use boml_quick_init () before putting up a detection dialog box. Sun Dec 24 22:01:20 EST 2000 Daniel Jacobowitz (dan@debian.org) * Version 0.1.1 released. * boml.c (detect_ps2): Open /dev/psaux O_RDWR instead of O_RDONLY, since we then write to it. * bowl.c: Use the colors provided in PNGs instead of guessing. (bowl_init): Likewise. (bowl_refresh): Likewise. * bogl-cfb.c (memset_var): Fix assertion failure in 24bit CFBs (the framebuffer itself is rarely 3-byte-aligned, and does not need to be). bogl-0.1.18/bogl-font.h0000644000000000000000000000171211407777275011474 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef bogl_font_h #define bogl_font_h struct bogl_font *bogl_read_bdf (char *filename); void bogl_free_font (struct bogl_font *font); #endif /* bogl_font_h */ bogl-0.1.18/bowl.h0000644000000000000000000000302611407777275010550 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef bowl_h #define bowl_h void bowl_init (void); void bowl_done (void); void bowl_layout (void); void bowl_refresh (void); void bowl_title (const char *); void bowl_default (int result); int bowl_run (void); /* Menu item. */ struct bowl_menu_item { char *tag; char *item; int command; }; void bowl_flush (void); void bowl_new_text (const char *); void bowl_new_button (const char *, int command); void bowl_new_input (char **, const char *proto); void bowl_new_menu (const struct bowl_menu_item *, int n_items, int height); void bowl_new_checkbox (char **choices, char *values, int n, int height); struct widget *bowl_new_scale (long long max); void bowl_set_scale (struct widget *w, long long value); #endif /* bowl_h */ bogl-0.1.18/boxes.h0000644000000000000000000000345411407777275010732 0ustar #ifndef _BOXES_H_ #define _BOXES_H_ #define DLG_ERROR -1 #define DLG_OKAY 0 #define DLG_CANCEL 10 #define DLG_YES -1 #define DLG_NO 0 int setFont(const char *, const char *); void boxResume(void); void boxSuspend(void); void boxPopWindow(void); void boxFinished(void); void boxInit(void); void setMono(void); int pleaseWaitBox(const char *text); int vaproblemBox(const char *title, const char *fmt, ...); int problemBox(const char *text, const char *title); int problemBoxEn (const char *, const char *); int wideMessageBox(const char *text, const char *title); int perrorBox(const char *text); int twoButtonBox(const char *text, const char *title, const char *button1, const char* button2); int yesNoBox(const char *text, const char *title); char *inputBox(const char *text, const char *title, const char *proto); int enterDirBox (const char *, const char *, const char *, const char *, char *, size_t); void pushHelpLine (const char *, int); void popHelpLine (void); /* * Internal representation of the list */ struct list { int nelem; char** data; }; /* * Option Constants for the lists */ #define OPT_F (10000) #define OPT_D (10000 + OPT_F) int tz_dialogBox(const char* text, const char* title, int height, int width, struct list* dirs, struct list* files); #define SCALE_CREATE 0 #define SCALE_REFRESH 1 #define SCALE_DELETE 2 int scaleBox(const char *text, const char *title, long long length, int action); struct d_choices { char* tag; char* string; int state; }; int menuBox(const char* text, const char* title, struct d_choices* choices, int nchoices, int cancel); int checkBox(const char* text, const char* title, int height, int width, char** choices, char** values, int nchoices); #endif bogl-0.1.18/tux75.png0000644000000000000000000000201111407777275011127 0ustar PNG  IHDRKXO"PLTE9m 8.aR9u6tRNS@fIDATxs6 =ݩΪ96cJzܽ&b'9fەc !peovʶtQ1t,@`ϰ TpNT玘-Roأ3{xa!E=cW 0'O!̦!Ͻ-ϡz9M}X0ٶT_cA[X6ujOO04Kucv Hp57{nVL]34|:[v1>{jLk--l'px1A]}|QLI19%ֆƏk R¢KmM9VRQvUzOafvcET+[: (c71b(am?o R?SME|KY%ʹ"# g4AuΛtQ"wg mh$MN=~wI9fW9KU^M \K3&֓u=Ft PKH}[Nk?Ԙ]OSďU55q & 41ylkڮ6ԓs3ij(a&](h1EfIENDB`bogl-0.1.18/bterm.10000644000000000000000000000347411407777275010636 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH bterm 1 "31 March 2002" "BOGL" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME bterm - framebuffer terminal emulator .SH SYNOPSIS .B bterm .B -f .RI font.bgf .RI "[-l " locale "]" .RI "[" program "]" .SH DESCRIPTION .B bterm is a terminal emulator for the Linux framebuffer. It supports multibyte locales and wide characters, in addition to basic terminal features such as cursor positioning. .SH OPTIONS .TP .B -f font.bgf Specify the font. BGF fonts are produced by .BR bdftobogl (1) from standard BDF font files. .TP .B -l locale Specify a locale for .B bterm and processes run within it. The locale may also be specified normally in the environment. If a locale, especially one with a different character set than the current locale, will be used inside of .B bterm, it should be specified on the command line. .SH EXIT STATUS The following exit values are returned: .TP 0 Successful completion. .TP 1-125 Exit code from executed program .TP 127 Failed to exec program .TP >=128 Program terminated by signal. .SH NOTES On Debian systems, one appropriate BDF font can be found in the .B bf-utf-source package. .SH SEE ALSO .BR bdftobogl (1) .SH AUTHOR This manual page was written by Daniel Jacobowitz . bogl-0.1.18/mergebdf0000755000000000000000000000101011407777275011124 0ustar #!/usr/bin/perl -w if ($#ARGV < 0) { die "Usage: mergebdf font1.bdf ... > newfont.bdf\n"; } foreach $font (@ARGV) { open(F, "<$font") || die; for (;;) { while (defined($_ = ) && !/^STARTCHAR /) { if (!$donehead) { print; } } if (!defined($_)) { last; } $donehead = 1; $c = $_; undef $e; while (($_ = ) !~ /^ENDCHAR/) { if (/^ENCODING (\d+)$/) { $e = $1; } $c .= $_; } $c .= $_; if (!$char{$e}) { $char{$e} = 1; print $c; } } close(F); } print "ENDFONT\n"; bogl-0.1.18/bogl-cfb.h0000644000000000000000000000743211407777275011265 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* bogl-cfb.h: Common inline functions and data structures used by the packed-pixel drivers. This should be considered an internal, private header file. Written by David Huggins-Daines */ #include #include #include struct bits4 { unsigned int p0:4 __attribute__ ((packed)); unsigned int p1:4 __attribute__ ((packed)); } __attribute__ ((packed)); struct bits24 { unsigned char bytes[3] __attribute__ ((packed)); } __attribute__ ((packed)); static inline void put_var (volatile void* dst, size_t off, unsigned int c, size_t b) { switch (b) { case 32: /* FIXME: probably has endianness problems */ ((u_int32_t*)(dst))[off] = c; break; case 24: /* FIXME: probably also has endianness problems */ ((struct bits24*)(dst))[off].bytes[2] = (c >> 16); ((struct bits24*)(dst))[off].bytes[1] = (c >> 8); ((struct bits24*)(dst))[off].bytes[0] = c; break; case 16: ((unsigned short*)(dst))[off] = c; break; case 8: ((unsigned char*)(dst))[off] = c; break; case 4: if (off % 2) ((struct bits4*)(dst))[off/2].p1 = c; else ((struct bits4*)(dst))[off/2].p0 = c; break; } } static inline void* memset_24(void* d, unsigned int c, size_t len, size_t b) { unsigned char* dst = d; if (len > 8) { /* We have to use a block of 3 regardless of the sizeof(int) */ unsigned int block[3]; const unsigned int bsiz = sizeof(unsigned int); ssize_t xlen; /* Yes we have to do it this way due to little-endian brain damage */ put_var (block, 0, c, 24); put_var (block, 1, c, 24); put_var (block, 2, c, 24); put_var (block, 3, c, 24); if (sizeof(unsigned int) == 8) { put_var (block, 4, c, 24); put_var (block, 5, c, 24); put_var (block, 6, c, 24); put_var (block, 7, c, 24); } /* Align to an int boundary */ while ((unsigned int)dst % sizeof(unsigned int)) { put_var(dst, 0, c, 24); dst += 3; len--; } xlen = len / bsiz; while (xlen) { ((unsigned int*)(dst))[0] = block[0]; ((unsigned int*)(dst))[1] = block[1]; ((unsigned int*)(dst))[2] = block[2]; dst += sizeof(block); xlen--; } len %= bsiz; } /* Plot individual pixels */ while (len--) { put_var(dst, 0, c, 24); dst += 3; } return dst; } static inline void* memset_sub8(void* d, unsigned int c, ssize_t offset, size_t len, size_t b) { unsigned char* dst = d; unsigned char fill; int i; /* Align to one byte */ while (offset % (8 / b)) { put_var (dst, offset, c, b); offset++; len--; } dst += offset * b / 8; /* Copy */ for (i = 0; i*b < 8; i++) put_var (&fill, i, c, b); memset (dst, fill, len * b / 8); dst += len * b / 8; /* Align again */ len %= 8 / b; for (i = 0; i < len; i++) { put_var (dst, i, c, b); } dst++; return dst; } void* memset_var(void* d, unsigned int c, ssize_t offset, size_t len, size_t b); bogl-0.1.18/bogl-tcfb.h0000644000000000000000000000311411407777275011442 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef bogl_tcfb_h #define bogl_tcfb_h #include size_t bogl_tcfb_init (); void bogl_tcfb_pixel (int x, int y, int c); void bogl_tcfb_hline (int x1, int x2, int y, int c); void bogl_tcfb_vline (int x, int y1, int y2, int c); void bogl_tcfb_text (int x, int y, const char *s, int n, int fg, int bg, int ul, const struct bogl_font *font); void bogl_tcfb_clear (int x1, int y1, int x2, int y2, int c); void bogl_tcfb_move (int sx, int sy, int dx, int dy, int w, int h); void bogl_tcfb_put (int x, int y, const struct bogl_pixmap *pixmap, const int color_map[16]); void bogl_tcfb_pointer (int visible, int x1, int y1, const struct bogl_pointer *pointer, int colors[2]); void bogl_tcfb_set_palette (int c, int nc, const unsigned char palette[][3]); #endif /* bogl_tcfb_h */ bogl-0.1.18/bogl-pcfb.c0000644000000000000000000002001711407777275011432 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* bogl-pcfb.c: pseudocolor packed pixel driver for BOGL Written by David Huggins-Daines based on Ben's original cfb8 driver. */ /*#define NDEBUG*/ #include #include #include #include #include #include #include #include #include "bogl.h" #include "boglP.h" #include "bogl-cfb.h" #include "bogl-pcfb.h" static int bpp; static unsigned char* save; static inline unsigned int cmap_lookup (int entry) { return entry; } /* Set pixel (X,Y) to color C. */ void bogl_pcfb_pixel (int x, int y, int c) { bogl_drawing = 1; assert (x >= 0 && x < bogl_xres); assert (y >= 0 && y < bogl_yres); put_var (bogl_frame + y * bogl_line_len, x, cmap_lookup(c), bpp); bogl_drawing = 0; } /* Paint a horizontal line from (X1,Y) to (X2,Y) in color C, where X2 >= X1. The final point is not painted. */ void bogl_pcfb_hline (int x1, int x2, int y, int c) { assert (x1 >= 0 && x1 < bogl_xres); assert (x2 >= 0 && x2 <= bogl_xres); assert (x2 >= x1); assert (y >= 0 && y < bogl_yres); if (x1 == x2) return; bogl_drawing = 1; memset_var ((void*)bogl_frame + (y * bogl_line_len), cmap_lookup(c), x1, x2 - x1, bpp); bogl_drawing = 0; } /* Paints a vertical line from (X,Y1) to (X,Y2) in color C. The final point is not painted. */ void bogl_pcfb_vline (int x, int y1, int y2, int c) { assert (x >= 0 && x < bogl_xres); assert (y1 >= 0 && y1 < bogl_yres); assert (y2 >= 0 && y2 <= bogl_yres); assert (y2 >= y1); bogl_drawing = 1; for (; y1 < y2; y1++) put_var (bogl_frame + (y1 * bogl_line_len), x, cmap_lookup(c), bpp); bogl_drawing = 0; } /* Clear the region from (X1,Y1) to (X2,Y2) to color C, not including the last row or column. If C == -1 then the region's colors are inverted rather than set to a particular color. */ void bogl_pcfb_clear (int x1, int y1, int x2, int y2, int c) { unsigned char *dst; assert (0 <= x1 && x1 <= x2 && x2 <= bogl_xres); assert (0 <= y1 && y1 <= y2 && y2 <= bogl_yres); if (x1 == x2) return; bogl_drawing = 1; dst = (char *) bogl_frame + (y1 * bogl_line_len); for (; y1 < y2; y1++) { memset_var (dst, cmap_lookup(c), x1, x2 - x1, bpp); dst += bogl_line_len; } bogl_drawing = 0; } void bogl_pcfb_text (int xx, int yy, const char *s, int n, int fg, int bg, int ul, const struct bogl_font *font) { int h, k; wchar_t wc; assert (xx >= 0 && xx < bogl_xres); assert (yy >= 0 && yy < bogl_yres); bogl_drawing = 1; h = bogl_font_height (font); if (yy + h > bogl_yres) h = bogl_yres - yy; mbtowc (0, 0, 0); for (; (k = mbtowc (&wc, s, n)) > 0; s += k, n -= k) { char *dst = (char *) bogl_frame + (yy * bogl_line_len); u_int32_t *character = NULL; int w = bogl_font_glyph (font, wc, &character); int x, y, h1 = ul ? h - 1 : h; if (character == NULL) continue; if (xx + w > bogl_xres) w = bogl_xres - xx; for (y = 0; y < h1; y++) { u_int32_t c = *character++; for (x = 0; x < w; x++) { if (c & 0x80000000) put_var (dst, xx+x, cmap_lookup(fg), bpp); else if (bg != -1) put_var (dst, xx+x, cmap_lookup(bg), bpp); c <<= 1; } dst += bogl_line_len; } if (ul) for (x = 0; x < w; x++) put_var (dst, xx+x, cmap_lookup(fg), bpp); xx += w; if (xx >= bogl_xres) break; } bogl_drawing = 0; } /* Write PIXMAP at location (XX,YY) */ void bogl_pcfb_put (int xx, int yy, const struct bogl_pixmap *pixmap, const int color_map[16]) { char *dst; const unsigned char *src; int h; assert (xx + pixmap->width <= bogl_xres); assert (yy >= 0 && yy < bogl_yres); assert (yy + pixmap->width <= bogl_yres); src = pixmap->data; bogl_drawing = 1; h = pixmap->height; dst = (char *) bogl_frame + (yy * bogl_line_len); while (h--) { int w = pixmap->width; int offset = xx; while (w) { int color = *src & 0xf; int count = *src >> 4; src++; w -= count; if (color != pixmap->transparent) memset_var ((char *) dst, cmap_lookup(color_map[color]), offset, count, bpp); offset += count; } dst += bogl_line_len; } bogl_drawing = 0; } /* Draw mouse pointer POINTER with its hotspot at (X,Y), if VISIBLE != 0. Restores the previously saved background at that point, if VISIBLE == 0. COLORS[] gives the color indices to paint the cursor. This routine performs full clipping on all sides of the screen. */ void bogl_pcfb_pointer (int visible, int x1, int y1, const struct bogl_pointer *pointer, int colors[2]) { int y_count; /* Number of scanlines. */ int y_ofs; /* Number of scanlines to skip drawing. */ int x_ofs; /* Number of pixels to skip drawing on each line. */ assert (pointer != NULL); x1 -= pointer->hx; y1 -= pointer->hy; if (y1 + 16 > bogl_yres) { y_count = bogl_yres - y1; } else y_count = 16; if (x1 < 0) { x_ofs = -x1; x1 = 0; } else x_ofs = 0; if (y1 < 0) { y_ofs = -y1; y1 = 0; y_count -= y_ofs; } else y_ofs = 0; bogl_drawing = 1; /* Save or restore the framebuffer contents. */ { int sx_ofs = x1; int rowbytes = 16 * bpp / 8; if (sx_ofs + 16 > bogl_xres) { sx_ofs = bogl_xres - 16; } /* Avoid mouse droppings on <8-bit displays */ else if (bpp < 8 && sx_ofs % (8 / bpp)) rowbytes++; if (visible) { char *dst = save; char *src = (char *) bogl_frame + (sx_ofs * bpp / 8) + (y1 * bogl_line_len); int y; for (y = 0; y < y_count; y++) { memcpy (dst, src, rowbytes); dst += rowbytes; src += bogl_line_len; } } else { char *dst = (char *) bogl_frame + (sx_ofs * bpp / 8) + (y1 * bogl_line_len); char *src = save; int y; for (y = 0; y < y_count; y++) { memcpy (dst, src, rowbytes); dst += bogl_line_len; src += rowbytes; } } } /* Now draw it */ if (visible) { const unsigned short *mask_p, *color_p; int y; int x_count = 16; if (x1 + 16 > bogl_xres) x_count = bogl_xres - x1; mask_p = pointer->mask + y_ofs; color_p = pointer->color + y_ofs; for (y = 0; y < y_count; y++, mask_p++, color_p++) { unsigned char *dst; unsigned short bg_bits, fg_bits; int x; dst = (char *) bogl_frame + ((y1 + y) * bogl_line_len); bg_bits = *mask_p ^ *color_p; fg_bits = *mask_p & *color_p; for (x = 0; x < x_count; x++) { if (bg_bits & 0x8000) put_var (dst, x + x1, cmap_lookup(colors[0]), bpp); else if (fg_bits & 0x8000) put_var (dst, x + x1, cmap_lookup(colors[1]), bpp); else ; /* transparent (we hope) */ bg_bits <<= 1; fg_bits <<= 1; } } } bogl_drawing = 0; } /* Initialize PCFB mode. Returns the number of bytes to mmap for the framebuffer. */ size_t bogl_pcfb_init (int fb, int new_bpp) { bpp = new_bpp; /* Need an extra column for sub-8bpp displays */ save = malloc (((16*bpp/8) + 1) * 16); if (save == NULL) return bogl_fail ("allocating backing store: %s", strerror (errno)); return bogl_xres * bogl_yres * bpp / 8; } /* * vim:ts=8:sw=2 */ bogl-0.1.18/bogl-test.c0000644000000000000000000001276011407777275011505 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include #include #include #include #include "bogl.h" extern struct bogl_font font_helvB10; extern struct bogl_font font_helvB12; extern struct bogl_font font_helvR10; extern struct bogl_font font_timBI18; extern struct bogl_pointer pointer_arrow; struct bogl_font *font_list[] = { &font_helvB10, &font_helvB12, &font_helvR10, &font_timBI18, NULL }; static const unsigned char palette[16][3] = { {0x00, 0x00, 0x00}, /* 0: Black. */ {0xaa, 0xaa, 0xaa}, /* 1: Gray 66%. */ {0xff, 0xff, 0xff}, /* 2: White. */ {0x00, 0x00, 0xff}, /* 3: Blue. */ {0xff, 0x00, 0x00}, /* 4: Red. */ {0x00, 0x00, 0x00}, /* 5: Unused #1. */ {0x00, 0x00, 0x00}, /* 6: Unused #2. */ {0x00, 0x00, 0x00}, /* 7: Unused #3. */ {0x00, 0x00, 0x00}, /* 8: Unused #4. */ {0x00, 0x00, 0x00}, /* 9: Unused #5. */ {0xa9, 0x99, 0x75}, /* A: Tux #1. */ {0xec, 0xc9, 0x39}, /* B: Tux #2. */ {0x61, 0x52, 0x39}, /* C: Tux #3. */ {0xe4, 0xa8, 0x10}, /* D: Tux #4. */ {0xa0, 0x6d, 0x0c}, /* E: Tux #5. */ {0x38, 0x2e, 0x1e}, /* F: Tux #6. */ }; extern struct bogl_pixmap pixmap_tux50; extern struct bogl_pixmap pixmap_tux75; struct bogl_pixmap *pixmap_list[] = { &pixmap_tux75, NULL }; #define n_pixmaps ((int) (sizeof (pixmap_list) \ / sizeof (struct bogl_pixmap *)) - 1) /* Print a helpful syntax message and terminate. */ void usage (void) { struct bogl_font **font; bogl_done (); printf ("usage:\t\"bogl-test test-type\"\n" "\twhere test-type may be one of the following:\n\n" "\thline\thorizontal lines\n" "\tvline\tvertical lines\n" "\tbox\tsolid boxes\n" "\ttext\ttext drawing (specify font from list below)\n" "\tpointer\ttest pointer drawing & erasing\n" "\tput\tpixmap drawing (specify pixmap from 0 to %d)\n\n" "available fonts:\n", n_pixmaps - 1); for (font = font_list; *font; font++) printf ("\t%s\n", (*font)->name); exit (0); } int main (int argc, char *argv[]) { if (argc < 2) usage (); setlocale (LC_ALL, ""); if (!bogl_init ()) { printf ("bogl: %s\n", bogl_error ()); return 0; } bogl_set_palette (0, 16, palette); if (!strcmp (argv[1], "hline")) for (;;) { int x1, x2, t; x1 = rand () % bogl_xres; x2 = rand () % bogl_xres; if (x1 > x2) t = x1, x1 = x2, x2 = t; bogl_hline (x1, x2, rand () % bogl_yres, rand () % 16); } if (!strcmp (argv[1], "vline")) for (;;) { int y1, y2, t; y1 = rand () % bogl_yres; y2 = rand () % bogl_yres; if (y1 > y2) t = y1, y1 = y2, y2 = t; bogl_vline (rand () % bogl_xres, y1, y2, rand () % 16); } if (!strcmp (argv[1], "box")) for (;;) { int x1, x2, y1, y2, t; x1 = rand () % bogl_xres; x2 = rand () % bogl_xres; if (x1 > x2) t = x1, x1 = x2, x2 = t; y1 = rand () % bogl_yres; y2 = rand () % bogl_yres; if (y1 > y2) t = y1, y1 = y2, y2 = t; bogl_clear (x1, y1, x2, y2, rand () % 16); } if (!strcmp (argv[1], "text")) { struct bogl_font **font; if (argc < 3) usage (); for (font = font_list; *font; font++) if (!strcmp ((*font)->name, argv[2])) break; if (!*font) usage (); for (;;) { char s[64 * MB_LEN_MAX]; char *p = s; wchar_t wc; int len; int fg, bg; int i, k; fg = rand () % 16; bg = rand () % 16; if (fg == bg) continue; len = rand () % 64; wctomb(0, 0); for (i = 0; i < len; i++) { for (;;) { /* There could be chars beyond 0xFFFF, but we want this to run at a reasonable speed. */ wc = rand () % 0x10000; if (bogl_in_font(*font, wc) && (k = wctomb(p, wc)) != -1) break; } p += k; } bogl_text (rand () % bogl_xres, rand () % bogl_yres, s, p - s, fg, bg, *font); } } if (!strcmp (argv[1], "put")) { struct bogl_pixmap *pixmap; int index; int color_map[] = {6, 7, 8, 9, 10, 11, 12, 13}; if (argc < 3 || (index = atoi (argv[2])) < 0 || index >= n_pixmaps) usage (); pixmap = pixmap_list[index]; bogl_set_palette (6, 8, pixmap->palette); bogl_refresh = 1; for (;;) { if (bogl_refresh) { bogl_refresh = 0; bogl_clear (0, 0, bogl_xres, bogl_yres, 1); bogl_put (0, 0, pixmap, color_map); } pause (); } exit (0); } if (!strcmp (argv[1], "pointer")) { bogl_clear (0, 0, bogl_xres, bogl_yres, 1); for (;;) { int x = rand () % bogl_xres; int y = rand () % bogl_yres; bogl_pointer (1, x, y, &pointer_arrow, (int []) {15, 0}); getchar (); bogl_pointer (0, x, y, &pointer_arrow, NULL); getchar (); } } usage (); } bogl-0.1.18/bogl-cfb8.c0000644000000000000000000001645311407777275011353 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /*#define NDEBUG*/ #include #include #include "bogl.h" #include "boglP.h" #include "bogl-cfb8.h" #define BYTES_PP 1 #define put_8(dst, off, c) (((unsigned char*)(dst))[off] = c) /* Set pixel (X,Y) to color C. */ void bogl_cfb8_pixel (int x, int y, int c) { bogl_drawing = 1; assert (x >= 0 && x < bogl_xres); assert (y >= 0 && y < bogl_yres); assert (c >= 0 && c < bogl_ncols); put_8 (bogl_frame + y * bogl_line_len, x, c); bogl_drawing = 0; } /* Paint a horizontal line from (X1,Y) to (X2,Y) in color C, where X2 >= X1. The final point is not painted. */ void bogl_cfb8_hline (int x1, int x2, int y, int c) { assert (x1 >= 0 && x1 < bogl_xres); assert (x2 >= 0 && x2 <= bogl_xres); assert (x2 >= x1); assert (y >= 0 && y < bogl_yres); assert (c >= 0 && c < bogl_ncols); if (x1 == x2) return; bogl_drawing = 1; memset ((char *) bogl_frame + x1 + y * bogl_line_len, c, x2 - x1); bogl_drawing = 0; } /* Paints a vertical line from (X,Y1) to (X,Y2) in color C. The final point is not painted. */ void bogl_cfb8_vline (int x, int y1, int y2, int c) { assert (x >= 0 && x < bogl_xres); assert (y1 >= 0 && y1 < bogl_yres); assert (y2 >= 0 && y2 <= bogl_yres); assert (y2 >= y1); assert (c >= 0 && c < bogl_ncols); bogl_drawing = 1; for (; y1 < y2; y1++) put_8 (bogl_frame + y1 * bogl_line_len, x, c); bogl_drawing = 0; } /* Clear the region from (X1,Y1) to (X2,Y2) to color C, not including the last row or column. If C == -1 then the region's colors are inverted rather than set to a particular color. */ void bogl_cfb8_clear (int x1, int y1, int x2, int y2, int c) { volatile char *dst; assert (0 <= x1 && x1 <= x2 && x2 <= bogl_xres); assert (0 <= y1 && y1 <= y2 && y2 <= bogl_yres); assert (c >= -1 && c < bogl_ncols); if (x1 == x2) return; bogl_drawing = 1; dst = bogl_frame + x1 + y1 * bogl_line_len; for (; y1 < y2; y1++) { memset ((char *) dst, c, x2 - x1); dst += bogl_line_len; } bogl_drawing = 0; } void bogl_cfb8_text (int xx, int yy, const char *s, int n, int fg, int bg, struct bogl_font *font) { int h; assert (xx >= 0 && xx < bogl_xres); assert (yy >= 0 && yy < bogl_yres); assert (fg >= 0 && fg < bogl_ncols); assert (bg >= -1 && bg < bogl_ncols); bogl_drawing = 1; h = font->height; if (yy + h > bogl_yres) h = bogl_yres - yy; for (; n--; s++) { volatile char *dst = bogl_frame + xx + yy * bogl_line_len; const unsigned char ch = *s; const u_int32_t *character = &font->content[font->offset[ch]]; int w = font->width[ch]; int x, y; if (xx + w > bogl_xres) w = bogl_xres - xx; for (y = 0; y < h; y++) { u_int32_t c = *character++; for (x = 0; x < w; x++) { if (c & 0x80000000) put_8 (dst, x, fg); else if (bg != -1) put_8 (dst, x, bg); c <<= 1; } dst += bogl_line_len; } xx += w; if (xx >= bogl_xres) break; } bogl_drawing = 0; } /* Write PIXMAP at location (XX,YY), with the pixmap's colors mapped according to COLOR_MAP. */ void bogl_cfb8_put (int xx, int yy, const struct bogl_pixmap *pixmap, const int color_map[16]) { volatile char *dst; const unsigned char *src; int h; assert (xx + pixmap->width <= bogl_xres); assert (yy >= 0 && yy < bogl_yres); assert (yy + pixmap->width <= bogl_yres); src = pixmap->data; bogl_drawing = 1; h = pixmap->height; dst = bogl_frame + (xx * BYTES_PP) + (yy * bogl_line_len); while (h--) { int w = pixmap->width; while (w) { int color = *src & 0xf; int count = *src >> 4; src++; w -= count; memset ((char *)dst, color_map[color], count); dst += count * BYTES_PP; } dst += bogl_line_len - (pixmap->width * BYTES_PP); } bogl_drawing = 0; } /* Draw mouse pointer POINTER with its hotspot at (X,Y), if VISIBLE != 0. Restores the previously saved background at that point, if VISIBLE == 0. COLORS[] gives the color indices to paint the cursor. This routine performs full clipping on all sides of the screen. */ void bogl_cfb8_pointer (int visible, int x1, int y1, const struct bogl_pointer *pointer, int colors[2]) { int y_count; /* Number of scanlines. */ int y_ofs; /* Number of scanlines to skip drawing. */ int x_ofs; /* Number of pixels to skip drawing on each line. */ assert (pointer != NULL); x1 -= pointer->hx; y1 -= pointer->hy; if (y1 + 16 > bogl_yres) { y_count = bogl_yres - y1; } else y_count = 16; if (x1 < 0) { x_ofs = -x1; x1 = 0; } else x_ofs = 0; if (y1 < 0) { y_ofs = -y1; y1 = 0; y_count -= y_ofs; } else y_ofs = 0; bogl_drawing = 1; /* Save or restore the framebuffer contents. */ { /* 16x16 packed pixels */ static unsigned char saved[16 * 16 * BYTES_PP]; int sx_ofs = x1; if (sx_ofs + 16 > bogl_xres) sx_ofs = bogl_xres - 16; if (visible) { volatile char *dst = saved; volatile char *src = bogl_frame + (sx_ofs * BYTES_PP) + (y1 * bogl_line_len); int y; for (y = 0; y < y_count; y++) { memcpy ((char *) dst, (char *) src, 16 * BYTES_PP); dst += 16 * BYTES_PP; src += bogl_line_len; } } else { volatile char *dst = bogl_frame + (sx_ofs * BYTES_PP) + (y1 * bogl_line_len); volatile char *src = saved; int y; for (y = 0; y < y_count; y++) { memcpy ((char *) dst, (char *) src, 16 * BYTES_PP); dst += bogl_line_len; src += 16 * BYTES_PP; } } } /* Now draw it */ if (visible) { const unsigned short *mask_p, *color_p; int y; int x_count = 16; if (x1 + 16 > bogl_xres) x_count = bogl_xres - x1; mask_p = pointer->mask + y_ofs; color_p = pointer->color + y_ofs; for (y = 0; y < y_count; y++, mask_p++, color_p++) { volatile char *dst; unsigned short bg_bits, fg_bits; int x; dst = bogl_frame + ((y1 + y) * bogl_line_len); bg_bits = *mask_p ^ *color_p; fg_bits = *mask_p & *color_p; for (x = 0; x < x_count; x++) { if (bg_bits & 0x8000) put_8 (dst, x + x1, colors[0]); else if (fg_bits & 0x8000) put_8 (dst, x + x1, colors[1]); else ; /* It's fine the way it is... */ bg_bits <<= 1; fg_bits <<= 1; } } } bogl_drawing = 0; } /* Initialize CFB8 mode. Returns the number of bytes to mmap for the framebuffer. */ size_t bogl_cfb8_init (void) { return bogl_xres * bogl_yres; } bogl-0.1.18/debian/0000755000000000000000000000000011410000266010622 5ustar bogl-0.1.18/debian/control0000644000000000000000000000345611410000217012231 0ustar Source: bogl Section: devel Priority: optional Maintainer: Debian QA Group Build-Depends: debhelper (>= 5.0.0), libgd2-noxpm-dev | libgd2-xpm-dev, libpng12-dev Standards-Version: 3.8.4 Package: libbogl-dev Section: libdevel Architecture: any Depends: libbogl0 (= ${binary:Version}), libc6-dev, ${shlibs:Depends}, ${misc:Depends} Description: Ben's Own Graphics Library - development files Ben's Own Graphics Library is a small framebuffer library, including basic widgets, support for text in multiple languages, and mouse handling. . This package contains the BOGL include files, static library, and development documentation. Package: libbogl0 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Ben's Own Graphics Library - shared library Ben's Own Graphics Library is a small framebuffer library, including basic widgets, support for text in multiple languages, and mouse handling. . This package contains the shared library version of BOGL. Package: bogl-bterm Section: utils Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Ben's Own Graphics Library - graphical terminal Ben's Own Graphics Library is a small framebuffer library, including basic widgets, support for text in multiple languages, and mouse handling. . This package contains bterm, a UTF-enabled framebuffer terminal. Package: bogl-bterm-udeb XC-Package-Type: udeb Section: debian-installer Architecture: any Priority: extra Depends: ${shlibs:Depends} Description: Ben's Own Graphics Library - graphical terminal Ben's Own Graphics Library is a small framebuffer library, including basic widgets, support for text in multiple languages, and mouse handling. . This package contains bterm, a UTF-enabled framebuffer terminal, for use in debian-installer. bogl-0.1.18/debian/libbogl-dev.files0000644000000000000000000000020111407777275014060 0ustar usr/bin/bdftobogl usr/bin/pngtobogl usr/bin/mergebdf usr/bin/reduce-font usr/lib/libbogl.a usr/lib/libbogl.so usr/include/bogl/* bogl-0.1.18/debian/copyright0000644000000000000000000000110411407777275012604 0ustar BOGL was written by Ben Pfaff , and packaged by Daniel Jacobowitz . Copyright: Copyright (C) 1991 Free Software Foundation, Inc. Copyright (C) 2002 Red Hat Inc Copyright (C) 1984-1989, 1994 Adobe Systems Incorporated. Copyright (C) 1988, 1994 Digital Equipment Corporation. License: BOGL is distributed under the terms of the GNU General Public License, version 2 (or later). The full text of the GPL may be found in /usr/share/common-licenses/GPL-2 on a Debian system, or obtained from the Free Software Foundation. bogl-0.1.18/debian/libbogl-dev.manpages0000644000000000000000000000001411407777275014553 0ustar bdftobogl.1 bogl-0.1.18/debian/libbogl0.files0000644000000000000000000000005411407777275013372 0ustar usr/lib/libbogl.so.0.1 usr/lib/libbogl.so.0 bogl-0.1.18/debian/rules0000755000000000000000000000315011407777275011734 0ustar #!/usr/bin/make -f # Based on debhelper sample rules file by Joey Hess # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # shared library versions, option 1 version=2.0.5 major=2 # option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so #version=`ls src/.libs/lib*.so.* | \ # awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` #major=`ls src/.libs/lib*.so.* | \ # awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` build: build-stamp build-stamp: dh_testdir # Add here commands to compile the package. $(MAKE) depend $(MAKE) touch build-stamp clean: dh_testdir rm -f build-stamp configure-stamp # Add here commands to clean up after the build process. $(MAKE) clean dh_clean # Build architecture-independent files here. binary-indep: @echo No architecture-independent packages. # Build architecture-dependent files here. binary-arch: build dh_testdir dh_testroot $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp dh_movefiles install -d debian/bogl-bterm-udeb/usr/bin install -m 755 debian/bogl-bterm/usr/bin/bterm debian/bogl-bterm-udeb/usr/bin/bterm install -d debian/bogl-bterm-udeb/usr/share/terminfo/b install -m 644 debian/bogl-bterm/usr/share/terminfo/b/bterm debian/bogl-bterm-udeb/usr/share/terminfo/b/bterm dh_installdocs dh_installexamples dh_installman dh_installinfo dh_installchangelogs dh_link dh_strip dh_compress dh_fixperms dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary configure bogl-0.1.18/debian/compat0000644000000000000000000000000211407777275012053 0ustar 5 bogl-0.1.18/debian/TODO0000644000000000000000000000067311407777275011353 0ustar Clean up makefiles Try on Sparc - Ben Collins said a simple fix was needed Figure out why we still need libutf8 Find out why bowl.lo causes a bad relocation to abort(). [Happens on PPC only] Figure out which headers need to be installed. Mention font licenses in copyright file. Include the *.bdf files somewhere in the packages. widgets: disabled buttons radio buttons improve multiselects - unintuitive - maybe enlarge the checkboxes? bogl-0.1.18/debian/changelog0000644000000000000000000002541611410000021012471 0ustar bogl (0.1.18-4) unstable; urgency=low * QA upload. * If a "--" argument is encountered on bterm's command line, terminate option processing there and accept arguments after the command name. Thanks to Colin Watson for the patch. Closes: #528783. * Drop gratuitous hardcoded ldconfig call in libbogl0 postinst. * Drop redundant debian/foo.dirs. * Update standards-version to 3.8.4, no changes required. -- Steve Langasek Tue, 22 Jun 2010 00:06:57 +0000 bogl (0.1.18-3.1) unstable; urgency=low * Non-maintainer upload. * Improve packaging of the udeb by using current debhelper functionality. Ensures correct versioned dependency on libc. Closes: #564488. * Drop the 'Provides: editor' for bogl-bterm-udeb. It's unused and most likely incorrect. * Avoid executable stack. Patch taken from Fedora. Closes: #539775. -- Frans Pop Sun, 10 Jan 2010 11:33:52 +0100 bogl (0.1.18-3) unstable; urgency=low * QA upload. * Close-on-exec internal fds. (Closes: #512657). + Thanks to Colin Watson for the patch. * Support enter_bold_mode. (Closes: #486933). + Thanks to Samuel Thibault for the patch. * Make SIGCHLD handler more robust. (Closes: #329164). + Thanks to Miloslav Trmac for the patch. * Display combined chars. (Closes: #279984). + Thanks to Eugeniy Meshcheryakov for the patch. * Make clean not ignore errors. * Replace pwd with $(CURDIR) in rules. * Replace ${Source-Version} with ${binary:Version} in Depends. * Add ${misc:Depends} for debhelper package. * Add appropriate copyright holders to debian/copyright. * Bump debhelper build-dep 5. + Move DH_COMPAT from rules to debian/compat and set to 5. * Bump Standards Version to 3.8.1. -- Barry deFreese Thu, 23 Apr 2009 11:41:11 -0400 bogl (0.1.18-2) unstable; urgency=low * Orphan package. * Acknowledge large collection of NMUs. -- Daniel Jacobowitz Sat, 08 Mar 2008 10:16:01 -0500 bogl (0.1.18-1.6) unstable; urgency=high * Non-maintainer upload. * High-urgency upload for RC bugfix. * Drop versioned build-dependency on linux-kernel-headers, which is build-essential in sarge and etch at the required version, and a virtual package in lenny and above. Closes: #433273. * Also build-depend on libpng12-dev instead of libpng3-dev. * Add a SIGTERM signal handler which allows for a graceful exit, restoring the vt state; thanks to Matt Zimmerman . Closes: #379708. -- Steve Langasek Sat, 08 Mar 2008 11:03:28 +0000 bogl (0.1.18-1.5) unstable; urgency=low * NMU * Fix FTBFS on some arches due to kernel-headers no longer defining PAGE_MASK on all arches. Closes: #393023 -- Joey Hess Fri, 20 Oct 2006 16:08:45 -0400 bogl (0.1.18-1.4) unstable; urgency=low * NMU * Fix arch fix or amd64. -- Joey Hess Sun, 25 Sep 2005 02:08:55 +0200 bogl (0.1.18-1.3) unstable; urgency=low * NMU * Fix Makefile to call dpkg-architecture in a way that will work with the new version, re-enables support for VGA16_FB. -- Joey Hess Thu, 22 Sep 2005 10:35:08 +0200 bogl (0.1.18-1.2) unstable; urgency=HIGH * NMU * Fix FTBFS with gcc 4.0. Closes: #284741 -- Joey Hess Wed, 21 Sep 2005 19:08:20 +0200 bogl (0.1.18-1.1) unstable; urgency=low * Non maintainer upload in favour of debian-boot. * Return exit code from process and update manpage. (closes: #258650) * Return 127 on exec errors. -- Bastian Blank Fri, 23 Jul 2004 17:48:55 +0200 bogl (0.1.18-1) unstable; urgency=low * Work around 2.6.x vga16fb bugs (Closes: #245207). * PTY fixes from Colin Watson (Closes: #244771). -- Daniel Jacobowitz Wed, 5 May 2004 22:44:29 -0400 bogl (0.1.17-1) unstable; urgency=low * Fix a typo which broke bdftobogl on LP64 targets like ia64. -- Daniel Jacobowitz Sun, 7 Mar 2004 23:41:12 -0500 bogl (0.1.16-1) unstable; urgency=low * Add padding to font names in BGF files (Closes: #225543, #232720). -- Daniel Jacobowitz Tue, 24 Feb 2004 15:56:22 -0500 bogl (0.1.15-1) unstable; urgency=low * Acknowledge Petter's NMU (Closes: #221538). * Add a patch from Matt Kraai to reload fonts on SIGHUP (Closes: #219333). -- Daniel Jacobowitz Tue, 20 Jan 2004 21:14:51 -0500 bogl (0.1.14-1.1) unstable; urgency=high * Non maintainer upload. * Remove md5sum file from udeb. It is only wasting space. Patch from Matt Kraai. (Closes: #221538) * Urgency high to try to get this package into testing in time for beta2 of debian-installer. -- Petter Reinholdtsen Sat, 10 Jan 2004 11:09:50 +0100 bogl (0.1.14-1) unstable; urgency=low * New "upstream" release. - Fix the speed optimizations to refresh after VT switch (Closes: #215160). - Enable faster scrolling code, with fixes. - Fix clear-to-end-of-screen escape. -- Daniel Jacobowitz Tue, 4 Nov 2003 23:39:07 -0500 bogl (0.1.13-1) unstable; urgency=low * New "upstream" release. - Speed optimizations for bterm, indirectly from Alan Cox. -- Daniel Jacobowitz Sun, 5 Oct 2003 14:55:54 -0400 bogl (0.1.12-2) unstable; urgency=low * Add bogl-bterm-udeb package (Closes: #185046). -- Daniel Jacobowitz Mon, 19 May 2003 11:14:10 -0400 bogl (0.1.12-1) unstable; urgency=low * New "upstream" release. - Add a workaround for x86-64, from Matt Wilson . * Update section for libbogl-dev. -- Daniel Jacobowitz Tue, 15 Apr 2003 20:04:19 -0400 bogl (0.1.11-1) unstable; urgency=low * New "upstream" release. - Support devfs (Closes: #182176). - Enable vga16 mode on ARM (See bug #182915). -- Daniel Jacobowitz Sun, 23 Mar 2003 14:33:58 -0500 bogl (0.1.10-4) unstable; urgency=low * Update build dependencies to use libgd2 instead of libgd1 (Closes: #180220). * Remove use of dh_undocumented. -- Daniel Jacobowitz Sat, 8 Feb 2003 12:40:57 -0500 bogl (0.1.10-3) unstable; urgency=low * Change build depends to libgd-noxpm-dev | libgd-xpm-dev to avoid the GIF version (Closes: #167195). -- Daniel Jacobowitz Wed, 20 Nov 2002 10:12:29 -0500 bogl (0.1.10-2) unstable; urgency=low * Build depend on libpng3-dev instead of libpng2-dev (Closes: #159045). -- Daniel Jacobowitz Sun, 1 Sep 2002 21:35:16 -0400 bogl (0.1.10-1) unstable; urgency=low * New "upstream" release. - Better handling for mbrtowc errors (Closes: #140809). - Workaround for virgefb (Closes: #141547). - bdftobogl manpage (Closes: #141788, #141796). -- Daniel Jacobowitz Sat, 17 Aug 2002 16:59:35 -0400 bogl (0.1.9-2) unstable; urgency=low * Add a manpage for bterm (Closes: #84208, #139713). -- Daniel Jacobowitz Sun, 31 Mar 2002 15:43:27 -0500 bogl (0.1.9-1) unstable; urgency=low * New "upstream" release. - Several new terminfo capabilities, including scrolling up. - "less" works under bterm now. - Still one visible bug in mutt (if you are looking at a long message and hit 'v', the screen may not be properly cleared when the menu displays). Probably we advertise some terminfo capability we don't actually support. * Support frame buffers whose start address is not page-aligned (Closes: #134014). * Add acsc, smacs, and rmacs capabilities to bterm. They only work with UTF-8 etc. locales for the moment. -- Daniel Jacobowitz Mon, 18 Mar 2002 01:47:49 -0500 bogl (0.1.8-1) unstable; urgency=low * New "upstream" release - the "mutt almost works in bterm now" release. * Set controlling TTY for processes run in bterm (Closes: #121186). * Use u_int32_t instead of unsigned long, and fix pointer sizeofs. * Draw the cursor and screen refresh correctly (Closes: #119360). -- Daniel Jacobowitz Sat, 1 Dec 2001 13:05:14 -0500 bogl (0.1.7-1) unstable; urgency=low * New "upstream" release. * Add __attribute__ ((packed)) to some structures for ARM (Closes: #119030). * Better error handling in reduce-font, from Philip Blundell (Closes: #119110). -- Daniel Jacobowitz Sun, 11 Nov 2001 11:21:43 -0500 bogl (0.1.6-2) unstable; urgency=low * Fix sections for libbogl0 and bogl-bterm. -- Daniel Jacobowitz Thu, 28 Jun 2001 12:19:34 -0700 bogl (0.1.6-1) unstable; urgency=low * New "upstream" release. That was quick. * Include in bowl-boxes.c so that va_* macros expand properly. * Install reduce-font for boot-floppies. * Finish killing libutf8. -- Daniel Jacobowitz Sun, 27 May 2001 18:15:08 -0700 bogl (0.1.5-2) unstable; urgency=low * Oops, add ${shlibs:Depends} to libbogl-dev (Closes: #84210). -- Daniel Jacobowitz Sun, 27 May 2001 17:55:16 -0700 bogl (0.1.5-1) unstable; urgency=low * New "upstream" release, fixing bterm's utf8 support. * Install bterm terminfo description. * Stop calling dh_testversion, we already had the right Build-Depends. -- Daniel Jacobowitz Sun, 27 May 2001 17:16:20 -0700 bogl (0.1.4-1) unstable; urgency=low * New "upstream" release (closes: #87034). * Include libbogl.so link in libbogl-dev. -- Daniel Jacobowitz Sat, 24 Feb 2001 16:16:14 -0500 bogl (0.1.3-1) unstable; urgency=low * New "upstream" release, with fixed multiselects and a mouse bug. -- Daniel Jacobowitz Tue, 26 Dec 2000 23:26:05 -0500 bogl (0.1.2-2) unstable; urgency=low * Oops, also build depend on libpng2-dev. -- Daniel Jacobowitz Mon, 25 Dec 2000 22:38:22 -0500 bogl (0.1.2-1) unstable; urgency=low * New "upstream" release, fixing mouse support a bit. -- Daniel Jacobowitz Mon, 25 Dec 2000 22:21:31 -0500 bogl (0.1.1-1) unstable; urgency=low * New "upstream" release (i.e. code changes, not just packaging changes). * Build depend on libgd-dev (for pngtobogl). -- Daniel Jacobowitz Mon, 25 Dec 2000 02:56:22 -0500 bogl (0.1-2) unstable; urgency=low * Remove ".depend" when building the package, oops. -- Daniel Jacobowitz Wed, 20 Dec 2000 14:46:22 -0500 bogl (0.1-1) unstable; urgency=low * Initial Release. * Include the utf8 library plugin, since it seems to still be necessary (even with glibc 2.2 installed, although glibc 2.2 should have the needed functions...). * Clean up the makefiles for building without the rest of the boot floppies. -- Daniel Jacobowitz Wed, 20 Dec 2000 13:29:38 -0500 Local variables: mode: debian-changelog add-log-mailing-address "dan@debian.org" End: bogl-0.1.18/debian/bogl-bterm.manpages0000644000000000000000000000001011407777275014413 0ustar bterm.1 bogl-0.1.18/debian/bogl-bterm.files0000644000000000000000000000005111407777275013727 0ustar usr/bin/bterm usr/share/terminfo/b/bterm bogl-0.1.18/helvB10.bdf0000644000000000000000000006236711407777275011327 0ustar STARTFONT 2.1 FONT -Adobe-Helvetica-Bold-R-Normal--10-100-75-75-P-60-ISO8859-1 SIZE 10 75 75 FONTBOUNDINGBOX 11 13 -1 -2 COMMENT $XConsortium: helvB10.bdf,v 1.13 95/01/26 18:01:30 gildea Exp $ COMMENT COMMENT + COMMENT Copyright 1984-1989, 1994 Adobe Systems Incorporated. COMMENT Copyright 1988, 1994 Digital Equipment Corporation. COMMENT COMMENT Adobe is a trademark of Adobe Systems Incorporated which may be COMMENT registered in certain jurisdictions. COMMENT Permission to use these trademarks is hereby granted only in COMMENT association with the images described in this file. COMMENT COMMENT Permission to use, copy, modify, distribute and sell this software COMMENT and its documentation for any purpose and without fee is hereby COMMENT granted, provided that the above copyright notices appear in all COMMENT copies and that both those copyright notices and this permission COMMENT notice appear in supporting documentation, and that the names of COMMENT Adobe Systems and Digital Equipment Corporation not be used in COMMENT advertising or publicity pertaining to distribution of the software COMMENT without specific, written prior permission. Adobe Systems and COMMENT Digital Equipment Corporation make no representations about the COMMENT suitability of this software for any purpose. It is provided "as COMMENT is" without express or implied warranty. COMMENT - STARTPROPERTIES 28 FOUNDRY "Adobe" FAMILY_NAME "Helvetica" WEIGHT_NAME "Bold" SLANT "R" SETWIDTH_NAME "Normal" ADD_STYLE_NAME "" PIXEL_SIZE 10 POINT_SIZE 100 RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "P" AVERAGE_WIDTH 60 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" CAP_HEIGHT 8 X_HEIGHT 6 FONT_ASCENT 10 FONT_DESCENT 2 FACE_NAME "Helvetica Bold" COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved." NOTICE "Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries. " _DEC_DEVICE_FONTNAMES "PS=Helvetica-Bold" _DEC_PRODUCTINFO "DECwindows Fonts V2.2, 07-Nov-1991" DEFAULT_CHAR 32 RELATIVE_SETWIDTH 50 RELATIVE_WEIGHT 70 CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD" FULL_NAME "Helvetica Bold" ENDPROPERTIES CHARS 229 STARTCHAR space ENCODING 32 SWIDTH 278 0 DWIDTH 3 0 BBX 1 1 0 0 BITMAP 00 ENDCHAR STARTCHAR exclam ENCODING 33 SWIDTH 333 0 DWIDTH 4 0 BBX 2 8 1 0 BITMAP C0 C0 C0 C0 80 80 00 C0 ENDCHAR STARTCHAR quotedbl ENCODING 34 SWIDTH 474 0 DWIDTH 5 0 BBX 3 3 1 5 BITMAP A0 A0 A0 ENDCHAR STARTCHAR numbersign ENCODING 35 SWIDTH 556 0 DWIDTH 6 0 BBX 6 7 0 0 BITMAP 50 50 FC 50 F8 A0 A0 ENDCHAR STARTCHAR dollar ENCODING 36 SWIDTH 556 0 DWIDTH 6 0 BBX 5 9 0 -1 BITMAP 20 70 A8 E0 70 38 A8 70 20 ENDCHAR STARTCHAR percent ENCODING 37 SWIDTH 889 0 DWIDTH 8 0 BBX 7 8 0 0 BITMAP 62 B4 68 10 10 2C 56 8C ENDCHAR STARTCHAR ampersand ENCODING 38 SWIDTH 722 0 DWIDTH 8 0 BBX 7 8 0 0 BITMAP 70 D8 D8 70 DE CC DC 76 ENDCHAR STARTCHAR quoteright ENCODING 39 SWIDTH 278 0 DWIDTH 3 0 BBX 2 3 0 5 BITMAP C0 40 80 ENDCHAR STARTCHAR parenleft ENCODING 40 SWIDTH 333 0 DWIDTH 4 0 BBX 3 10 0 -2 BITMAP 20 60 40 C0 C0 C0 C0 40 60 20 ENDCHAR STARTCHAR parenright ENCODING 41 SWIDTH 333 0 DWIDTH 4 0 BBX 3 10 0 -2 BITMAP 80 C0 40 60 60 60 60 40 C0 80 ENDCHAR STARTCHAR asterisk ENCODING 42 SWIDTH 389 0 DWIDTH 4 0 BBX 3 3 0 5 BITMAP A0 40 A0 ENDCHAR STARTCHAR plus ENCODING 43 SWIDTH 584 0 DWIDTH 6 0 BBX 6 5 0 1 BITMAP 30 30 FC 30 30 ENDCHAR STARTCHAR comma ENCODING 44 SWIDTH 278 0 DWIDTH 3 0 BBX 2 4 0 -2 BITMAP 40 40 40 80 ENDCHAR STARTCHAR minus ENCODING 45 SWIDTH 584 0 DWIDTH 7 0 BBX 5 1 1 3 BITMAP F8 ENDCHAR STARTCHAR period ENCODING 46 SWIDTH 278 0 DWIDTH 3 0 BBX 1 2 1 0 BITMAP 80 80 ENDCHAR STARTCHAR slash ENCODING 47 SWIDTH 278 0 DWIDTH 4 0 BBX 4 8 0 0 BITMAP 10 10 20 20 40 40 80 80 ENDCHAR STARTCHAR zero ENCODING 48 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 70 D8 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR one ENCODING 49 SWIDTH 556 0 DWIDTH 6 0 BBX 4 8 0 0 BITMAP 30 F0 30 30 30 30 30 30 ENDCHAR STARTCHAR two ENCODING 50 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 70 D8 18 18 30 60 C0 F8 ENDCHAR STARTCHAR three ENCODING 51 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 70 D8 18 30 18 18 D8 70 ENDCHAR STARTCHAR four ENCODING 52 SWIDTH 556 0 DWIDTH 6 0 BBX 6 8 0 0 BITMAP 18 38 58 58 98 FC 18 18 ENDCHAR STARTCHAR five ENCODING 53 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP F8 C0 C0 F0 18 98 D8 70 ENDCHAR STARTCHAR six ENCODING 54 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 70 D8 C0 F0 D8 D8 D8 70 ENDCHAR STARTCHAR seven ENCODING 55 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP F8 18 18 30 30 30 60 60 ENDCHAR STARTCHAR eight ENCODING 56 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 70 D8 D8 70 D8 D8 D8 70 ENDCHAR STARTCHAR nine ENCODING 57 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 70 D8 D8 D8 78 18 D8 70 ENDCHAR STARTCHAR colon ENCODING 58 SWIDTH 333 0 DWIDTH 3 0 BBX 1 6 1 0 BITMAP 80 80 00 00 80 80 ENDCHAR STARTCHAR semicolon ENCODING 59 SWIDTH 333 0 DWIDTH 3 0 BBX 2 8 0 -2 BITMAP 40 40 00 00 40 40 40 80 ENDCHAR STARTCHAR less ENCODING 60 SWIDTH 584 0 DWIDTH 5 0 BBX 4 5 0 1 BITMAP 30 60 C0 60 30 ENDCHAR STARTCHAR equal ENCODING 61 SWIDTH 584 0 DWIDTH 6 0 BBX 5 3 0 2 BITMAP F8 00 F8 ENDCHAR STARTCHAR greater ENCODING 62 SWIDTH 584 0 DWIDTH 5 0 BBX 4 5 0 1 BITMAP C0 60 30 60 C0 ENDCHAR STARTCHAR question ENCODING 63 SWIDTH 611 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 70 D8 18 30 60 60 00 60 ENDCHAR STARTCHAR at ENCODING 64 SWIDTH 975 0 DWIDTH 11 0 BBX 10 9 0 -2 BITMAP 1F00 6080 4D40 9240 A240 A480 9B00 4000 3E00 ENDCHAR STARTCHAR A ENCODING 65 SWIDTH 722 0 DWIDTH 8 0 BBX 7 8 0 0 BITMAP 38 38 6C 6C 6C FE C6 C6 ENDCHAR STARTCHAR B ENCODING 66 SWIDTH 722 0 DWIDTH 7 0 BBX 6 8 0 0 BITMAP F8 CC CC F8 CC CC CC F8 ENDCHAR STARTCHAR C ENCODING 67 SWIDTH 722 0 DWIDTH 8 0 BBX 7 8 0 0 BITMAP 3C 66 C2 C0 C0 C2 66 3C ENDCHAR STARTCHAR D ENCODING 68 SWIDTH 722 0 DWIDTH 7 0 BBX 6 8 0 0 BITMAP F0 D8 CC CC CC CC D8 F0 ENDCHAR STARTCHAR E ENCODING 69 SWIDTH 667 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP F8 C0 C0 F8 C0 C0 C0 F8 ENDCHAR STARTCHAR F ENCODING 70 SWIDTH 611 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP F8 C0 C0 F0 C0 C0 C0 C0 ENDCHAR STARTCHAR G ENCODING 71 SWIDTH 778 0 DWIDTH 8 0 BBX 7 8 0 0 BITMAP 3C 66 C2 C0 CE C6 66 3A ENDCHAR STARTCHAR H ENCODING 72 SWIDTH 722 0 DWIDTH 7 0 BBX 6 8 0 0 BITMAP CC CC CC FC CC CC CC CC ENDCHAR STARTCHAR I ENCODING 73 SWIDTH 278 0 DWIDTH 3 0 BBX 2 8 0 0 BITMAP C0 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR J ENCODING 74 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 18 18 18 18 18 18 D8 70 ENDCHAR STARTCHAR K ENCODING 75 SWIDTH 722 0 DWIDTH 7 0 BBX 7 8 0 0 BITMAP CC D8 F0 E0 F0 D8 CC C6 ENDCHAR STARTCHAR L ENCODING 76 SWIDTH 611 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP C0 C0 C0 C0 C0 C0 C0 F8 ENDCHAR STARTCHAR M ENCODING 77 SWIDTH 833 0 DWIDTH 10 0 BBX 9 8 0 0 BITMAP C180 E380 E380 F780 D580 DD80 C980 C980 ENDCHAR STARTCHAR N ENCODING 78 SWIDTH 722 0 DWIDTH 8 0 BBX 7 8 0 0 BITMAP C6 E6 E6 D6 D6 CE CE C6 ENDCHAR STARTCHAR O ENCODING 79 SWIDTH 778 0 DWIDTH 8 0 BBX 7 8 0 0 BITMAP 38 6C C6 C6 C6 C6 6C 38 ENDCHAR STARTCHAR P ENCODING 80 SWIDTH 667 0 DWIDTH 7 0 BBX 6 8 0 0 BITMAP F8 CC CC CC F8 C0 C0 C0 ENDCHAR STARTCHAR Q ENCODING 81 SWIDTH 778 0 DWIDTH 8 0 BBX 7 9 0 -1 BITMAP 38 6C C6 C6 C6 D6 6C 3C 02 ENDCHAR STARTCHAR R ENCODING 82 SWIDTH 722 0 DWIDTH 7 0 BBX 6 8 0 0 BITMAP F8 CC CC CC F8 CC CC CC ENDCHAR STARTCHAR S ENCODING 83 SWIDTH 667 0 DWIDTH 7 0 BBX 6 8 0 0 BITMAP 78 CC E0 78 1C 8C CC 78 ENDCHAR STARTCHAR T ENCODING 84 SWIDTH 611 0 DWIDTH 7 0 BBX 6 8 0 0 BITMAP FC 30 30 30 30 30 30 30 ENDCHAR STARTCHAR U ENCODING 85 SWIDTH 722 0 DWIDTH 7 0 BBX 6 8 0 0 BITMAP CC CC CC CC CC CC CC 78 ENDCHAR STARTCHAR V ENCODING 86 SWIDTH 667 0 DWIDTH 8 0 BBX 7 8 0 0 BITMAP C6 C6 6C 6C 6C 38 38 10 ENDCHAR STARTCHAR W ENCODING 87 SWIDTH 944 0 DWIDTH 11 0 BBX 10 8 0 0 BITMAP CCC0 CCC0 CCC0 6D80 6D80 7F80 3300 2100 ENDCHAR STARTCHAR X ENCODING 88 SWIDTH 667 0 DWIDTH 8 0 BBX 7 8 0 0 BITMAP C6 C6 6C 38 38 6C C6 C6 ENDCHAR STARTCHAR Y ENCODING 89 SWIDTH 667 0 DWIDTH 9 0 BBX 8 8 0 0 BITMAP C3 C3 66 66 3C 18 18 18 ENDCHAR STARTCHAR Z ENCODING 90 SWIDTH 611 0 DWIDTH 7 0 BBX 6 8 0 0 BITMAP FC 0C 18 30 70 60 C0 FC ENDCHAR STARTCHAR bracketleft ENCODING 91 SWIDTH 333 0 DWIDTH 4 0 BBX 3 10 0 -2 BITMAP E0 C0 C0 C0 C0 C0 C0 C0 C0 E0 ENDCHAR STARTCHAR backslash ENCODING 92 SWIDTH 278 0 DWIDTH 4 0 BBX 4 8 0 0 BITMAP 80 80 40 40 20 20 10 10 ENDCHAR STARTCHAR bracketright ENCODING 93 SWIDTH 333 0 DWIDTH 4 0 BBX 3 10 0 -2 BITMAP E0 60 60 60 60 60 60 60 60 E0 ENDCHAR STARTCHAR asciicircum ENCODING 94 SWIDTH 584 0 DWIDTH 5 0 BBX 5 4 0 4 BITMAP 20 70 D8 88 ENDCHAR STARTCHAR underscore ENCODING 95 SWIDTH 556 0 DWIDTH 6 0 BBX 6 1 0 -2 BITMAP FC ENDCHAR STARTCHAR quoteleft ENCODING 96 SWIDTH 278 0 DWIDTH 3 0 BBX 2 3 0 5 BITMAP 40 80 C0 ENDCHAR STARTCHAR a ENCODING 97 SWIDTH 556 0 DWIDTH 6 0 BBX 6 6 0 0 BITMAP 70 98 78 D8 D8 6C ENDCHAR STARTCHAR b ENCODING 98 SWIDTH 611 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP C0 C0 F0 D8 C8 C8 D8 F0 ENDCHAR STARTCHAR c ENCODING 99 SWIDTH 556 0 DWIDTH 5 0 BBX 4 6 0 0 BITMAP 70 D0 C0 C0 D0 70 ENDCHAR STARTCHAR d ENCODING 100 SWIDTH 611 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 18 18 78 D8 98 98 D8 78 ENDCHAR STARTCHAR e ENCODING 101 SWIDTH 556 0 DWIDTH 6 0 BBX 5 6 0 0 BITMAP 70 D8 F8 C0 D8 70 ENDCHAR STARTCHAR f ENCODING 102 SWIDTH 333 0 DWIDTH 4 0 BBX 4 8 0 0 BITMAP 70 C0 E0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR g ENCODING 103 SWIDTH 611 0 DWIDTH 6 0 BBX 5 8 0 -2 BITMAP 68 D8 98 98 D8 78 18 70 ENDCHAR STARTCHAR h ENCODING 104 SWIDTH 611 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP C0 C0 F0 D8 D8 D8 D8 D8 ENDCHAR STARTCHAR i ENCODING 105 SWIDTH 278 0 DWIDTH 3 0 BBX 2 8 0 0 BITMAP C0 00 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR j ENCODING 106 SWIDTH 278 0 DWIDTH 3 0 BBX 2 10 0 -2 BITMAP C0 00 C0 C0 C0 C0 C0 C0 C0 80 ENDCHAR STARTCHAR k ENCODING 107 SWIDTH 556 0 DWIDTH 6 0 BBX 6 8 0 0 BITMAP C0 C0 D8 F0 E0 F0 D8 CC ENDCHAR STARTCHAR l ENCODING 108 SWIDTH 278 0 DWIDTH 3 0 BBX 2 8 0 0 BITMAP C0 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR m ENCODING 109 SWIDTH 889 0 DWIDTH 9 0 BBX 8 6 0 0 BITMAP B6 DB DB DB DB DB ENDCHAR STARTCHAR n ENCODING 110 SWIDTH 611 0 DWIDTH 6 0 BBX 5 6 0 0 BITMAP B0 D8 D8 D8 D8 D8 ENDCHAR STARTCHAR o ENCODING 111 SWIDTH 611 0 DWIDTH 6 0 BBX 5 6 0 0 BITMAP 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR p ENCODING 112 SWIDTH 611 0 DWIDTH 6 0 BBX 5 8 0 -2 BITMAP B0 D8 C8 C8 D8 F0 C0 C0 ENDCHAR STARTCHAR q ENCODING 113 SWIDTH 611 0 DWIDTH 6 0 BBX 5 8 0 -2 BITMAP 68 D8 98 98 D8 78 18 18 ENDCHAR STARTCHAR r ENCODING 114 SWIDTH 389 0 DWIDTH 4 0 BBX 4 6 0 0 BITMAP B0 E0 C0 C0 C0 C0 ENDCHAR STARTCHAR s ENCODING 115 SWIDTH 556 0 DWIDTH 6 0 BBX 5 6 0 0 BITMAP 70 D8 70 18 D8 70 ENDCHAR STARTCHAR t ENCODING 116 SWIDTH 333 0 DWIDTH 4 0 BBX 3 8 0 0 BITMAP C0 C0 E0 C0 C0 C0 C0 60 ENDCHAR STARTCHAR u ENCODING 117 SWIDTH 611 0 DWIDTH 6 0 BBX 5 6 0 0 BITMAP D8 D8 D8 D8 D8 68 ENDCHAR STARTCHAR v ENCODING 118 SWIDTH 556 0 DWIDTH 6 0 BBX 5 6 0 0 BITMAP D8 D8 D8 50 70 20 ENDCHAR STARTCHAR w ENCODING 119 SWIDTH 778 0 DWIDTH 8 0 BBX 7 6 0 0 BITMAP D6 D6 D6 6C 6C 6C ENDCHAR STARTCHAR x ENCODING 120 SWIDTH 556 0 DWIDTH 7 0 BBX 6 6 0 0 BITMAP CC 78 30 78 CC CC ENDCHAR STARTCHAR y ENCODING 121 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 -2 BITMAP D8 D8 D8 D8 78 30 30 60 ENDCHAR STARTCHAR z ENCODING 122 SWIDTH 500 0 DWIDTH 6 0 BBX 5 6 0 0 BITMAP F8 18 30 60 C0 F8 ENDCHAR STARTCHAR braceleft ENCODING 123 SWIDTH 389 0 DWIDTH 5 0 BBX 4 10 0 -2 BITMAP 30 60 60 60 C0 60 60 60 60 30 ENDCHAR STARTCHAR bar ENCODING 124 SWIDTH 280 0 DWIDTH 3 0 BBX 1 10 1 -2 BITMAP 80 80 80 80 80 80 80 80 80 80 ENDCHAR STARTCHAR braceright ENCODING 125 SWIDTH 389 0 DWIDTH 5 0 BBX 4 10 0 -2 BITMAP C0 60 60 60 30 60 60 60 60 C0 ENDCHAR STARTCHAR asciitilde ENCODING 126 SWIDTH 584 0 DWIDTH 6 0 BBX 6 2 0 2 BITMAP 6C D8 ENDCHAR STARTCHAR space ENCODING 160 SWIDTH 278 0 DWIDTH 3 0 BBX 1 1 0 0 BITMAP 00 ENDCHAR STARTCHAR exclamdown ENCODING 161 SWIDTH 333 0 DWIDTH 4 0 BBX 2 8 1 -2 BITMAP C0 00 40 40 C0 C0 C0 C0 ENDCHAR STARTCHAR cent ENCODING 162 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 -1 BITMAP 10 70 D8 A0 A0 D8 70 40 ENDCHAR STARTCHAR sterling ENCODING 163 SWIDTH 556 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 38 68 60 F0 60 60 68 D8 ENDCHAR STARTCHAR currency ENCODING 164 SWIDTH 556 0 DWIDTH 6 0 BBX 5 6 0 1 BITMAP D8 70 D8 D8 70 D8 ENDCHAR STARTCHAR yen ENCODING 165 SWIDTH 556 0 DWIDTH 7 0 BBX 6 8 0 0 BITMAP 84 CC 48 78 FC 30 FC 30 ENDCHAR STARTCHAR brokenbar ENCODING 166 SWIDTH 280 0 DWIDTH 3 0 BBX 1 10 1 -2 BITMAP 80 80 80 80 00 00 80 80 80 80 ENDCHAR STARTCHAR section ENCODING 167 SWIDTH 556 0 DWIDTH 6 0 BBX 5 10 0 -2 BITMAP 70 C8 E0 70 98 C8 70 38 98 70 ENDCHAR STARTCHAR dieresis ENCODING 168 SWIDTH 333 0 DWIDTH 3 0 BBX 3 1 0 7 BITMAP A0 ENDCHAR STARTCHAR copyright ENCODING 169 SWIDTH 737 0 DWIDTH 10 0 BBX 8 8 1 0 BITMAP 3C 42 99 A5 A1 9D 42 3C ENDCHAR STARTCHAR ordfeminine ENCODING 170 SWIDTH 370 0 DWIDTH 5 0 BBX 3 5 1 3 BITMAP E0 20 A0 00 E0 ENDCHAR STARTCHAR guillemotleft ENCODING 171 SWIDTH 556 0 DWIDTH 7 0 BBX 6 3 0 1 BITMAP 6C D8 6C ENDCHAR STARTCHAR logicalnot ENCODING 172 SWIDTH 584 0 DWIDTH 7 0 BBX 5 3 1 2 BITMAP F8 08 08 ENDCHAR STARTCHAR hyphen ENCODING 173 SWIDTH 333 0 DWIDTH 5 0 BBX 4 1 0 3 BITMAP F0 ENDCHAR STARTCHAR registered ENCODING 174 SWIDTH 737 0 DWIDTH 10 0 BBX 8 8 1 0 BITMAP 3C 42 BD A5 B9 A5 42 3C ENDCHAR STARTCHAR macron ENCODING 175 SWIDTH 333 0 DWIDTH 3 0 BBX 3 1 0 7 BITMAP E0 ENDCHAR STARTCHAR degree ENCODING 176 SWIDTH 400 0 DWIDTH 4 0 BBX 3 3 1 4 BITMAP 60 A0 C0 ENDCHAR STARTCHAR plusminus ENCODING 177 SWIDTH 584 0 DWIDTH 6 0 BBX 6 7 0 0 BITMAP 30 30 FC 30 30 00 FC ENDCHAR STARTCHAR twosuperior ENCODING 178 SWIDTH 333 0 DWIDTH 3 0 BBX 3 4 0 3 BITMAP 60 A0 40 E0 ENDCHAR STARTCHAR threesuperior ENCODING 179 SWIDTH 333 0 DWIDTH 3 0 BBX 3 4 0 3 BITMAP E0 40 20 C0 ENDCHAR STARTCHAR acute ENCODING 180 SWIDTH 333 0 DWIDTH 3 0 BBX 2 2 0 7 BITMAP 40 80 ENDCHAR STARTCHAR mu ENCODING 181 SWIDTH 611 0 DWIDTH 6 0 BBX 5 8 0 -2 BITMAP D8 D8 D8 D8 D8 E8 C0 C0 ENDCHAR STARTCHAR paragraph ENCODING 182 SWIDTH 556 0 DWIDTH 6 0 BBX 6 10 0 -2 BITMAP 7C E8 E8 E8 68 28 28 28 28 28 ENDCHAR STARTCHAR periodcentered ENCODING 183 SWIDTH 278 0 DWIDTH 3 0 BBX 2 1 0 3 BITMAP C0 ENDCHAR STARTCHAR cedilla ENCODING 184 SWIDTH 333 0 DWIDTH 3 0 BBX 2 2 0 -2 BITMAP 40 C0 ENDCHAR STARTCHAR onesuperior ENCODING 185 SWIDTH 333 0 DWIDTH 3 0 BBX 2 4 0 3 BITMAP 40 C0 40 40 ENDCHAR STARTCHAR ordmasculine ENCODING 186 SWIDTH 365 0 DWIDTH 5 0 BBX 3 5 1 3 BITMAP E0 A0 E0 00 E0 ENDCHAR STARTCHAR guillemotright ENCODING 187 SWIDTH 556 0 DWIDTH 7 0 BBX 6 3 0 1 BITMAP D8 6C D8 ENDCHAR STARTCHAR onequarter ENCODING 188 SWIDTH 834 0 DWIDTH 9 0 BBX 8 8 0 0 BITMAP 42 C4 48 48 12 26 2F 42 ENDCHAR STARTCHAR onehalf ENCODING 189 SWIDTH 834 0 DWIDTH 9 0 BBX 7 8 0 0 BITMAP 42 C4 48 48 16 2A 24 4E ENDCHAR STARTCHAR threequarters ENCODING 190 SWIDTH 834 0 DWIDTH 9 0 BBX 8 8 0 0 BITMAP E2 44 28 C8 12 26 2F 42 ENDCHAR STARTCHAR questiondown ENCODING 191 SWIDTH 611 0 DWIDTH 6 0 BBX 5 8 0 -2 BITMAP 30 00 30 30 60 C0 D8 70 ENDCHAR STARTCHAR Agrave ENCODING 192 SWIDTH 722 0 DWIDTH 8 0 BBX 7 11 0 0 BITMAP 20 10 00 38 38 6C 6C 6C FE C6 C6 ENDCHAR STARTCHAR Aacute ENCODING 193 SWIDTH 722 0 DWIDTH 8 0 BBX 7 11 0 0 BITMAP 08 10 00 38 38 6C 6C 6C FE C6 C6 ENDCHAR STARTCHAR Acircumflex ENCODING 194 SWIDTH 722 0 DWIDTH 8 0 BBX 7 11 0 0 BITMAP 10 28 00 38 38 6C 6C 6C FE C6 C6 ENDCHAR STARTCHAR Atilde ENCODING 195 SWIDTH 722 0 DWIDTH 8 0 BBX 7 11 0 0 BITMAP 14 28 00 38 38 6C 6C 6C FE C6 C6 ENDCHAR STARTCHAR Adieresis ENCODING 196 SWIDTH 722 0 DWIDTH 8 0 BBX 7 10 0 0 BITMAP 28 00 38 38 6C 6C 6C FE C6 C6 ENDCHAR STARTCHAR Aring ENCODING 197 SWIDTH 722 0 DWIDTH 8 0 BBX 7 11 0 0 BITMAP 10 28 10 38 38 6C 6C 6C FE C6 C6 ENDCHAR STARTCHAR AE ENCODING 198 SWIDTH 1000 0 DWIDTH 10 0 BBX 9 8 0 0 BITMAP 3F80 3C00 6C00 6F80 6C00 FC00 CC00 CF80 ENDCHAR STARTCHAR Ccedilla ENCODING 199 SWIDTH 722 0 DWIDTH 8 0 BBX 7 10 0 -2 BITMAP 3C 66 C2 C0 C0 C2 66 3C 10 30 ENDCHAR STARTCHAR Egrave ENCODING 200 SWIDTH 667 0 DWIDTH 6 0 BBX 5 11 0 0 BITMAP 40 20 00 F8 C0 C0 F8 C0 C0 C0 F8 ENDCHAR STARTCHAR Eacute ENCODING 201 SWIDTH 667 0 DWIDTH 6 0 BBX 5 11 0 0 BITMAP 10 20 00 F8 C0 C0 F8 C0 C0 C0 F8 ENDCHAR STARTCHAR Ecircumflex ENCODING 202 SWIDTH 667 0 DWIDTH 6 0 BBX 5 11 0 0 BITMAP 20 50 00 F8 C0 C0 F8 C0 C0 C0 F8 ENDCHAR STARTCHAR Edieresis ENCODING 203 SWIDTH 667 0 DWIDTH 6 0 BBX 5 10 0 0 BITMAP 50 00 F8 C0 C0 F8 C0 C0 C0 F8 ENDCHAR STARTCHAR Igrave ENCODING 204 SWIDTH 278 0 DWIDTH 3 0 BBX 2 11 0 0 BITMAP 80 40 00 C0 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR Iacute ENCODING 205 SWIDTH 278 0 DWIDTH 3 0 BBX 2 11 0 0 BITMAP 40 80 00 C0 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR Icircumflex ENCODING 206 SWIDTH 278 0 DWIDTH 3 0 BBX 3 11 0 0 BITMAP 40 A0 00 C0 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR Idieresis ENCODING 207 SWIDTH 278 0 DWIDTH 3 0 BBX 3 10 0 0 BITMAP A0 00 C0 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR Eth ENCODING 208 SWIDTH 722 0 DWIDTH 7 0 BBX 6 8 0 0 BITMAP F0 D8 CC EC CC CC D8 F0 ENDCHAR STARTCHAR Ntilde ENCODING 209 SWIDTH 722 0 DWIDTH 8 0 BBX 7 11 0 0 BITMAP 14 28 00 C6 C6 E6 D6 D6 CE CE C6 ENDCHAR STARTCHAR Ograve ENCODING 210 SWIDTH 778 0 DWIDTH 8 0 BBX 7 11 0 0 BITMAP 20 10 00 38 6C C6 C6 C6 C6 6C 38 ENDCHAR STARTCHAR Oacute ENCODING 211 SWIDTH 778 0 DWIDTH 8 0 BBX 7 11 0 0 BITMAP 04 08 00 38 6C C6 C6 C6 C6 6C 38 ENDCHAR STARTCHAR Ocircumflex ENCODING 212 SWIDTH 778 0 DWIDTH 8 0 BBX 7 11 0 0 BITMAP 10 28 00 38 6C C6 C6 C6 C6 6C 38 ENDCHAR STARTCHAR Otilde ENCODING 213 SWIDTH 778 0 DWIDTH 8 0 BBX 7 11 0 0 BITMAP 14 28 00 38 6C C6 C6 C6 C6 6C 38 ENDCHAR STARTCHAR Odieresis ENCODING 214 SWIDTH 778 0 DWIDTH 8 0 BBX 7 10 0 0 BITMAP 28 00 38 6C C6 C6 C6 C6 6C 38 ENDCHAR STARTCHAR multiply ENCODING 215 SWIDTH 584 0 DWIDTH 6 0 BBX 6 5 0 1 BITMAP CC 78 30 78 CC ENDCHAR STARTCHAR Oslash ENCODING 216 SWIDTH 778 0 DWIDTH 8 0 BBX 7 8 0 0 BITMAP 3A 6C CE D6 D6 E6 6C B8 ENDCHAR STARTCHAR Ugrave ENCODING 217 SWIDTH 722 0 DWIDTH 7 0 BBX 6 11 0 0 BITMAP 20 10 00 CC CC CC CC CC CC CC 78 ENDCHAR STARTCHAR Uacute ENCODING 218 SWIDTH 722 0 DWIDTH 7 0 BBX 6 11 0 0 BITMAP 08 10 00 CC CC CC CC CC CC CC 78 ENDCHAR STARTCHAR Ucircumflex ENCODING 219 SWIDTH 722 0 DWIDTH 7 0 BBX 6 11 0 0 BITMAP 10 28 00 CC CC CC CC CC CC CC 78 ENDCHAR STARTCHAR Udieresis ENCODING 220 SWIDTH 722 0 DWIDTH 7 0 BBX 6 10 0 0 BITMAP 28 00 CC CC CC CC CC CC CC 78 ENDCHAR STARTCHAR Yacute ENCODING 221 SWIDTH 667 0 DWIDTH 9 0 BBX 8 11 0 0 BITMAP 04 08 00 C3 C3 66 66 3C 18 18 18 ENDCHAR STARTCHAR Thorn ENCODING 222 SWIDTH 667 0 DWIDTH 7 0 BBX 6 8 0 0 BITMAP C0 F8 CC CC CC F8 C0 C0 ENDCHAR STARTCHAR germandbls ENCODING 223 SWIDTH 611 0 DWIDTH 6 0 BBX 5 8 0 0 BITMAP 70 C8 C8 D0 C8 C8 C8 D0 ENDCHAR STARTCHAR agrave ENCODING 224 SWIDTH 556 0 DWIDTH 6 0 BBX 6 9 0 0 BITMAP 40 20 00 70 98 78 D8 D8 6C ENDCHAR STARTCHAR aacute ENCODING 225 SWIDTH 556 0 DWIDTH 6 0 BBX 6 9 0 0 BITMAP 08 10 00 70 98 78 D8 D8 6C ENDCHAR STARTCHAR acircumflex ENCODING 226 SWIDTH 556 0 DWIDTH 6 0 BBX 6 9 0 0 BITMAP 30 68 00 70 98 78 D8 D8 6C ENDCHAR STARTCHAR atilde ENCODING 227 SWIDTH 556 0 DWIDTH 6 0 BBX 6 9 0 0 BITMAP 28 50 00 70 98 78 D8 D8 6C ENDCHAR STARTCHAR adieresis ENCODING 228 SWIDTH 556 0 DWIDTH 6 0 BBX 6 9 0 0 BITMAP 50 50 00 70 98 78 D8 D8 6C ENDCHAR STARTCHAR aring ENCODING 229 SWIDTH 556 0 DWIDTH 6 0 BBX 6 9 0 0 BITMAP 20 50 20 70 98 78 D8 D8 6C ENDCHAR STARTCHAR ae ENCODING 230 SWIDTH 889 0 DWIDTH 9 0 BBX 8 6 0 0 BITMAP 7E 9B 7F D8 DB 6E ENDCHAR STARTCHAR ccedilla ENCODING 231 SWIDTH 556 0 DWIDTH 5 0 BBX 4 8 0 -2 BITMAP 70 D0 C0 C0 D0 70 20 60 ENDCHAR STARTCHAR egrave ENCODING 232 SWIDTH 556 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 40 20 00 70 D8 F8 C0 D8 70 ENDCHAR STARTCHAR eacute ENCODING 233 SWIDTH 556 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 10 20 00 70 D8 F8 C0 D8 70 ENDCHAR STARTCHAR ecircumflex ENCODING 234 SWIDTH 556 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 20 50 00 70 D8 F8 C0 D8 70 ENDCHAR STARTCHAR edieresis ENCODING 235 SWIDTH 556 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 50 50 00 70 D8 F8 C0 D8 70 ENDCHAR STARTCHAR igrave ENCODING 236 SWIDTH 278 0 DWIDTH 3 0 BBX 2 9 0 0 BITMAP 80 40 00 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR iacute ENCODING 237 SWIDTH 278 0 DWIDTH 3 0 BBX 3 9 0 0 BITMAP 20 40 00 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR icircumflex ENCODING 238 SWIDTH 278 0 DWIDTH 3 0 BBX 3 9 -1 0 BITMAP 40 A0 00 60 60 60 60 60 60 ENDCHAR STARTCHAR idieresis ENCODING 239 SWIDTH 278 0 DWIDTH 3 0 BBX 3 9 0 0 BITMAP A0 A0 00 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR eth ENCODING 240 SWIDTH 611 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 50 60 A0 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR ntilde ENCODING 241 SWIDTH 611 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 28 50 00 B0 D8 D8 D8 D8 D8 ENDCHAR STARTCHAR ograve ENCODING 242 SWIDTH 611 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 40 20 00 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR oacute ENCODING 243 SWIDTH 611 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 10 20 00 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR ocircumflex ENCODING 244 SWIDTH 611 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 20 50 00 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR otilde ENCODING 245 SWIDTH 611 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 50 A0 00 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR odieresis ENCODING 246 SWIDTH 611 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 50 50 00 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR divide ENCODING 247 SWIDTH 584 0 DWIDTH 6 0 BBX 6 5 0 1 BITMAP 30 00 FC 00 30 ENDCHAR STARTCHAR oslash ENCODING 248 SWIDTH 611 0 DWIDTH 6 0 BBX 6 6 0 0 BITMAP 74 D8 F8 D8 D8 70 ENDCHAR STARTCHAR ugrave ENCODING 249 SWIDTH 611 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 40 20 00 D8 D8 D8 D8 D8 68 ENDCHAR STARTCHAR uacute ENCODING 250 SWIDTH 611 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 10 20 00 D8 D8 D8 D8 D8 68 ENDCHAR STARTCHAR ucircumflex ENCODING 251 SWIDTH 611 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 20 50 00 D8 D8 D8 D8 D8 68 ENDCHAR STARTCHAR udieresis ENCODING 252 SWIDTH 611 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 50 50 00 D8 D8 D8 D8 D8 68 ENDCHAR STARTCHAR yacute ENCODING 253 SWIDTH 556 0 DWIDTH 6 0 BBX 5 11 0 -2 BITMAP 10 20 00 D8 D8 D8 D8 78 30 30 60 ENDCHAR STARTCHAR thorn ENCODING 254 SWIDTH 611 0 DWIDTH 6 0 BBX 5 10 0 -2 BITMAP C0 C0 F0 D8 C8 C8 D8 F0 C0 C0 ENDCHAR STARTCHAR ydieresis ENCODING 255 SWIDTH 556 0 DWIDTH 6 0 BBX 5 11 0 -2 BITMAP 50 50 00 D8 D8 D8 D8 78 30 30 60 ENDCHAR STARTCHAR Lslash ENCODING -1 SWIDTH 611 0 DWIDTH 6 0 BBX 6 8 -1 0 BITMAP 60 60 60 70 E0 60 60 7C ENDCHAR STARTCHAR OE ENCODING -1 SWIDTH 1000 0 DWIDTH 10 0 BBX 9 8 0 0 BITMAP 3F80 6C00 CC00 CF80 CC00 CC00 6C00 3F80 ENDCHAR STARTCHAR Scaron ENCODING -1 SWIDTH 667 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP 28 10 00 78 CC 70 3C CC 78 ENDCHAR STARTCHAR Ydieresis ENCODING -1 SWIDTH 667 0 DWIDTH 8 0 BBX 8 8 0 0 BITMAP 14 00 C3 66 3C 18 18 18 ENDCHAR STARTCHAR Zcaron ENCODING -1 SWIDTH 611 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP 28 10 00 FC 18 30 60 C0 FC ENDCHAR STARTCHAR breve ENCODING -1 SWIDTH 333 0 DWIDTH 4 0 BBX 4 2 0 6 BITMAP 90 60 ENDCHAR STARTCHAR bullet ENCODING -1 SWIDTH 350 0 DWIDTH 4 0 BBX 2 2 1 2 BITMAP C0 C0 ENDCHAR STARTCHAR caron ENCODING -1 SWIDTH 333 0 DWIDTH 4 0 BBX 3 2 0 6 BITMAP A0 40 ENDCHAR STARTCHAR circumflex ENCODING -1 SWIDTH 333 0 DWIDTH 4 0 BBX 3 2 0 6 BITMAP 40 A0 ENDCHAR STARTCHAR dagger ENCODING -1 SWIDTH 556 0 DWIDTH 7 0 BBX 6 10 0 -2 BITMAP 30 30 FC 30 30 30 30 30 30 30 ENDCHAR STARTCHAR daggerdbl ENCODING -1 SWIDTH 556 0 DWIDTH 7 0 BBX 6 10 0 -2 BITMAP 30 30 FC 30 30 30 FC 30 30 30 ENDCHAR STARTCHAR dotaccent ENCODING -1 SWIDTH 333 0 DWIDTH 2 0 BBX 1 1 0 7 BITMAP 80 ENDCHAR STARTCHAR dotlessi ENCODING -1 SWIDTH 278 0 DWIDTH 3 0 BBX 2 6 0 0 BITMAP C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR ellipsis ENCODING -1 SWIDTH 1000 0 DWIDTH 10 0 BBX 8 1 1 0 BITMAP DB ENDCHAR STARTCHAR emdash ENCODING -1 SWIDTH 1000 0 DWIDTH 10 0 BBX 10 1 0 3 BITMAP FFC0 ENDCHAR STARTCHAR endash ENCODING -1 SWIDTH 556 0 DWIDTH 6 0 BBX 6 1 0 3 BITMAP FC ENDCHAR STARTCHAR fi ENCODING -1 SWIDTH 611 0 DWIDTH 7 0 BBX 7 8 -1 0 BITMAP 36 60 F6 66 66 66 66 66 ENDCHAR STARTCHAR fl ENCODING -1 SWIDTH 611 0 DWIDTH 7 0 BBX 7 8 -1 0 BITMAP 36 66 F6 66 66 66 66 66 ENDCHAR STARTCHAR florin ENCODING -1 SWIDTH 556 0 DWIDTH 6 0 BBX 5 9 0 -2 BITMAP 38 60 F8 60 60 60 60 60 C0 ENDCHAR STARTCHAR fraction ENCODING -1 SWIDTH 167 0 DWIDTH 4 0 BBX 5 7 -1 0 BITMAP 08 10 10 20 40 40 80 ENDCHAR STARTCHAR grave ENCODING -1 SWIDTH 333 0 DWIDTH 3 0 BBX 2 2 0 6 BITMAP 80 40 ENDCHAR STARTCHAR guilsinglleft ENCODING -1 SWIDTH 333 0 DWIDTH 5 0 BBX 3 3 1 1 BITMAP 60 C0 60 ENDCHAR STARTCHAR guilsinglright ENCODING -1 SWIDTH 333 0 DWIDTH 5 0 BBX 3 3 1 1 BITMAP C0 60 C0 ENDCHAR STARTCHAR hungarumlaut ENCODING -1 SWIDTH 333 0 DWIDTH 5 0 BBX 4 2 0 6 BITMAP 50 A0 ENDCHAR STARTCHAR lslash ENCODING -1 SWIDTH 278 0 DWIDTH 3 0 BBX 4 8 -1 0 BITMAP 60 60 60 70 E0 60 60 60 ENDCHAR STARTCHAR oe ENCODING -1 SWIDTH 944 0 DWIDTH 10 0 BBX 9 6 0 0 BITMAP 7700 CD80 CF80 CC00 CD80 7700 ENDCHAR STARTCHAR ogonek ENCODING -1 SWIDTH 333 0 DWIDTH 3 0 BBX 2 2 0 -2 BITMAP 80 C0 ENDCHAR STARTCHAR perthousand ENCODING -1 SWIDTH 1000 0 DWIDTH 11 0 BBX 10 7 0 0 BITMAP 6200 B400 6800 1000 2D80 56C0 8D80 ENDCHAR STARTCHAR quotedblbase ENCODING -1 SWIDTH 500 0 DWIDTH 6 0 BBX 5 3 0 -2 BITMAP D8 48 90 ENDCHAR STARTCHAR quotedblleft ENCODING -1 SWIDTH 500 0 DWIDTH 6 0 BBX 5 3 0 5 BITMAP 48 90 D8 ENDCHAR STARTCHAR quotedblright ENCODING -1 SWIDTH 500 0 DWIDTH 6 0 BBX 5 3 0 5 BITMAP D8 48 90 ENDCHAR STARTCHAR quotesinglbase ENCODING -1 SWIDTH 278 0 DWIDTH 3 0 BBX 2 3 0 -2 BITMAP C0 40 80 ENDCHAR STARTCHAR quotesingle ENCODING -1 SWIDTH 238 0 DWIDTH 3 0 BBX 1 3 1 5 BITMAP 80 80 80 ENDCHAR STARTCHAR ring ENCODING -1 SWIDTH 333 0 DWIDTH 4 0 BBX 3 3 0 5 BITMAP 40 A0 40 ENDCHAR STARTCHAR scaron ENCODING -1 SWIDTH 556 0 DWIDTH 6 0 BBX 5 9 0 0 BITMAP 50 20 00 70 D8 70 18 D8 70 ENDCHAR STARTCHAR tilde ENCODING -1 SWIDTH 333 0 DWIDTH 4 0 BBX 4 2 0 6 BITMAP 50 A0 ENDCHAR STARTCHAR trademark ENCODING -1 SWIDTH 1000 0 DWIDTH 11 0 BBX 9 4 1 3 BITMAP E880 4D80 4A80 4A80 ENDCHAR STARTCHAR zcaron ENCODING -1 SWIDTH 500 0 DWIDTH 5 0 BBX 5 9 0 0 BITMAP 50 20 00 F8 18 30 60 C0 F8 ENDCHAR ENDFONT bogl-0.1.18/reduce-font.c0000644000000000000000000001062411407777275012015 0ustar #include #include #include #include #include #include #include #define BITS_NO (65536l / 32) u_int32_t used[BITS_NO]; void usage (void) { printf ("usage: reduce-font < text\n"); } inline size_t bits (u_int32_t x) { size_t r; for (r = 0 ; x != 0 ; r++) x = x & (x - 1); return r; } void test (u_int32_t x) { int i; size_t l = bits (x); printf ("%08x: ", x); for (i = 0 ; i < 32 ; x <<= 1, ++i) putchar (x & 0x80000000 ? '1' : '0'); printf (": %d\n", l); } int main (int argc, char **argv) { FILE *font; char *buffer = NULL; char *locale = setlocale (LC_CTYPE, ""); int error = 0; if (locale == NULL) { fprintf (stderr, "Unable to set locale\n"); return 1; } fprintf (stderr, "setlocale: %s\n", locale); #if 1 fprintf (stderr, "FYI: MB_CUR_MAX/MB_LEN_MAX: %d/%d\n", MB_CUR_MAX, MB_LEN_MAX); #endif if (argc != 2) usage (); else if ((buffer = (char *)malloc (MB_LEN_MAX)) == NULL) perror ("buffer allocation"); else if ((font = fopen (argv[1], "r")) == NULL) perror (argv[1]); else { size_t got, avail, chars, pos; int i; wchar_t wc; mbstate_t wstate = { 0 }; /* Initialize the array */ /* Make sure ASCII is included! */ for (i = 0 ; i < (128 / 32) ; ++i) used[i] = UINT_MAX; /* Other stuff will only be included iff it's there... :) */ for (; i < BITS_NO ; ++i) used[i] = 0; mbrtowc (NULL, NULL, 0, &wstate); /* Init the engine */ for (pos = avail = 0 ; (got = fread (buffer + avail, 1, MB_LEN_MAX - avail, stdin)) >= 0 && (avail += got) > 0 ;) { switch (got = mbrtowc (&wc, buffer, avail, &wstate)) { case -1: /* An error occured */ fprintf (stderr, "error -1 at position %ld (bytes: %d %*.*s)\n", pos, avail, avail, avail, buffer); error = 1; break; case -2: fprintf (stderr, "-2: bytes: %d %*.*s\n", avail, avail, avail, buffer); continue; case 0: /* Nothing's read so far */ fprintf (stderr, "0: bytes: %d %*.*s\n", avail, avail, avail, buffer); continue; default: /* Seems to read something reasonable */ #if 0 fprintf (stdout, "got: %ld\n", wc); #endif pos += got; used[wc / 32] |= (1 << (wc % 32)); if (got == avail) /* I just do not know how memcpy behaves in case of length equal to 0 :) */ avail = 0; else { memcpy (buffer, buffer + got, avail - got); avail -= got; } continue; } break; } /* Process stdin here */ /* mbrtowc */ #if 0 usage (); test (0x12345678); #endif for (chars = 0, i = 0 ; i < BITS_NO ; ++i) chars += bits (used[i]); fprintf (stderr, "Used chars: %d (%d processed)\n", chars, pos); #if 1 { char *buf = (char *)malloc (1024); int header, docopy; for (header = 1, docopy = 0 ; fgets (buf, 1024, font) != NULL ;) { if (header) { if (strncmp (buf, "CHARS ", 6) == 0) printf ("CHARS %d\n", chars); else if (strncmp (buf, "STARTCHAR ", 10) == 0) header = 0; else fprintf (stdout, buf); } if (!header) { if (strncmp (buf, "STARTCHAR ", 10) == 0) { wc = strtol (buf + 12, NULL, 16); docopy = used[wc / 32] & (1 << (wc % 32)); } if (docopy) fprintf (stdout, buf); } } if (!header) fputs ("ENDFONT\n", stdout); free (buf); } #endif fclose (font); } if (buffer != NULL) free (buffer); return error; } bogl-0.1.18/helvB12.bdf0000644000000000000000000006417411407777275011327 0ustar STARTFONT 2.1 FONT -Adobe-Helvetica-Bold-R-Normal--12-120-75-75-P-70-ISO8859-1 SIZE 12 75 75 FONTBOUNDINGBOX 14 15 -1 -3 COMMENT $XConsortium: helvB12.bdf,v 1.13 95/01/26 18:01:34 gildea Exp $ COMMENT COMMENT + COMMENT Copyright 1984-1989, 1994 Adobe Systems Incorporated. COMMENT Copyright 1988, 1994 Digital Equipment Corporation. COMMENT COMMENT Adobe is a trademark of Adobe Systems Incorporated which may be COMMENT registered in certain jurisdictions. COMMENT Permission to use these trademarks is hereby granted only in COMMENT association with the images described in this file. COMMENT COMMENT Permission to use, copy, modify, distribute and sell this software COMMENT and its documentation for any purpose and without fee is hereby COMMENT granted, provided that the above copyright notices appear in all COMMENT copies and that both those copyright notices and this permission COMMENT notice appear in supporting documentation, and that the names of COMMENT Adobe Systems and Digital Equipment Corporation not be used in COMMENT advertising or publicity pertaining to distribution of the software COMMENT without specific, written prior permission. Adobe Systems and COMMENT Digital Equipment Corporation make no representations about the COMMENT suitability of this software for any purpose. It is provided "as COMMENT is" without express or implied warranty. COMMENT - STARTPROPERTIES 28 FOUNDRY "Adobe" FAMILY_NAME "Helvetica" WEIGHT_NAME "Bold" SLANT "R" SETWIDTH_NAME "Normal" ADD_STYLE_NAME "" PIXEL_SIZE 12 POINT_SIZE 120 RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "P" AVERAGE_WIDTH 70 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" CAP_HEIGHT 9 X_HEIGHT 7 FONT_ASCENT 11 FONT_DESCENT 3 FACE_NAME "Helvetica Bold" COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved." NOTICE "Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries. " _DEC_DEVICE_FONTNAMES "PS=Helvetica-Bold" _DEC_PRODUCTINFO "DECwindows Fonts V2.2, 07-Nov-1991" DEFAULT_CHAR 32 RELATIVE_SETWIDTH 50 RELATIVE_WEIGHT 70 CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD" FULL_NAME "Helvetica Bold" ENDPROPERTIES CHARS 229 STARTCHAR space ENCODING 32 SWIDTH 278 0 DWIDTH 4 0 BBX 1 1 0 0 BITMAP 00 ENDCHAR STARTCHAR exclam ENCODING 33 SWIDTH 333 0 DWIDTH 4 0 BBX 2 9 1 0 BITMAP C0 C0 C0 C0 C0 80 00 C0 C0 ENDCHAR STARTCHAR quotedbl ENCODING 34 SWIDTH 474 0 DWIDTH 5 0 BBX 3 3 1 6 BITMAP A0 A0 A0 ENDCHAR STARTCHAR numbersign ENCODING 35 SWIDTH 556 0 DWIDTH 8 0 BBX 7 8 0 0 BITMAP 14 14 7E 28 28 FC 50 50 ENDCHAR STARTCHAR dollar ENCODING 36 SWIDTH 556 0 DWIDTH 7 0 BBX 6 11 0 -2 BITMAP 10 78 D4 D0 78 1C 94 D4 78 10 10 ENDCHAR STARTCHAR percent ENCODING 37 SWIDTH 889 0 DWIDTH 12 0 BBX 11 9 0 0 BITMAP 7100 DB00 DA00 7400 0400 09C0 0B60 1B60 11C0 ENDCHAR STARTCHAR ampersand ENCODING 38 SWIDTH 722 0 DWIDTH 9 0 BBX 9 9 0 0 BITMAP 3800 6C00 6C00 3800 7900 CF00 C600 CF00 7980 ENDCHAR STARTCHAR quoteright ENCODING 39 SWIDTH 278 0 DWIDTH 4 0 BBX 2 3 1 6 BITMAP C0 40 80 ENDCHAR STARTCHAR parenleft ENCODING 40 SWIDTH 333 0 DWIDTH 6 0 BBX 4 12 1 -3 BITMAP 30 60 60 C0 C0 C0 C0 C0 C0 60 60 30 ENDCHAR STARTCHAR parenright ENCODING 41 SWIDTH 333 0 DWIDTH 6 0 BBX 4 12 1 -3 BITMAP C0 60 60 30 30 30 30 30 30 60 60 C0 ENDCHAR STARTCHAR asterisk ENCODING 42 SWIDTH 389 0 DWIDTH 6 0 BBX 5 4 0 5 BITMAP 20 F8 70 50 ENDCHAR STARTCHAR plus ENCODING 43 SWIDTH 584 0 DWIDTH 7 0 BBX 6 5 0 1 BITMAP 30 30 FC 30 30 ENDCHAR STARTCHAR comma ENCODING 44 SWIDTH 278 0 DWIDTH 4 0 BBX 2 4 1 -2 BITMAP C0 C0 40 80 ENDCHAR STARTCHAR minus ENCODING 45 SWIDTH 584 0 DWIDTH 8 0 BBX 5 1 1 3 BITMAP F8 ENDCHAR STARTCHAR period ENCODING 46 SWIDTH 278 0 DWIDTH 4 0 BBX 2 2 1 0 BITMAP C0 C0 ENDCHAR STARTCHAR slash ENCODING 47 SWIDTH 278 0 DWIDTH 4 0 BBX 4 9 0 0 BITMAP 30 30 20 60 60 40 40 C0 C0 ENDCHAR STARTCHAR zero ENCODING 48 SWIDTH 556 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP 78 CC CC CC CC CC CC CC 78 ENDCHAR STARTCHAR one ENCODING 49 SWIDTH 556 0 DWIDTH 7 0 BBX 4 9 0 0 BITMAP 30 F0 30 30 30 30 30 30 30 ENDCHAR STARTCHAR two ENCODING 50 SWIDTH 556 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP 78 CC 0C 18 30 60 C0 C0 FC ENDCHAR STARTCHAR three ENCODING 51 SWIDTH 556 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP 78 CC 0C 38 0C 0C 0C CC 78 ENDCHAR STARTCHAR four ENCODING 52 SWIDTH 556 0 DWIDTH 7 0 BBX 7 9 0 0 BITMAP 0C 1C 2C 2C 4C 8C FE 0C 0C ENDCHAR STARTCHAR five ENCODING 53 SWIDTH 556 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP 7C 60 C0 F8 0C 0C CC CC 78 ENDCHAR STARTCHAR six ENCODING 54 SWIDTH 556 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP 78 CC C0 C0 F8 CC CC CC 78 ENDCHAR STARTCHAR seven ENCODING 55 SWIDTH 556 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP FC 0C 18 18 30 30 30 60 60 ENDCHAR STARTCHAR eight ENCODING 56 SWIDTH 556 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP 78 CC CC 78 CC CC CC CC 78 ENDCHAR STARTCHAR nine ENCODING 57 SWIDTH 556 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP 78 CC CC CC 7C 0C 0C CC 78 ENDCHAR STARTCHAR colon ENCODING 58 SWIDTH 333 0 DWIDTH 4 0 BBX 2 7 1 0 BITMAP C0 C0 00 00 00 C0 C0 ENDCHAR STARTCHAR semicolon ENCODING 59 SWIDTH 333 0 DWIDTH 4 0 BBX 2 9 1 -2 BITMAP C0 C0 00 00 00 C0 C0 40 80 ENDCHAR STARTCHAR less ENCODING 60 SWIDTH 584 0 DWIDTH 7 0 BBX 5 5 1 1 BITMAP 18 70 C0 70 18 ENDCHAR STARTCHAR equal ENCODING 61 SWIDTH 584 0 DWIDTH 7 0 BBX 6 3 0 2 BITMAP FC 00 FC ENDCHAR STARTCHAR greater ENCODING 62 SWIDTH 584 0 DWIDTH 7 0 BBX 5 5 1 1 BITMAP C0 70 18 70 C0 ENDCHAR STARTCHAR question ENCODING 63 SWIDTH 611 0 DWIDTH 8 0 BBX 6 9 1 0 BITMAP 78 CC CC 18 30 30 00 30 30 ENDCHAR STARTCHAR at ENCODING 64 SWIDTH 975 0 DWIDTH 12 0 BBX 10 10 1 -1 BITMAP 1F00 6080 4040 8D40 9240 A240 A680 9B00 4000 3E00 ENDCHAR STARTCHAR A ENCODING 65 SWIDTH 722 0 DWIDTH 8 0 BBX 8 9 0 0 BITMAP 18 3C 24 66 66 7E C3 C3 C3 ENDCHAR STARTCHAR B ENCODING 66 SWIDTH 722 0 DWIDTH 9 0 BBX 7 9 1 0 BITMAP FC C6 C6 C6 FC C6 C6 C6 FC ENDCHAR STARTCHAR C ENCODING 67 SWIDTH 722 0 DWIDTH 8 0 BBX 7 9 1 0 BITMAP 3C 66 C0 C0 C0 C0 C0 66 3C ENDCHAR STARTCHAR D ENCODING 68 SWIDTH 722 0 DWIDTH 9 0 BBX 7 9 1 0 BITMAP F8 CC C6 C6 C6 C6 C6 CC F8 ENDCHAR STARTCHAR E ENCODING 69 SWIDTH 667 0 DWIDTH 8 0 BBX 6 9 1 0 BITMAP FC C0 C0 C0 FC C0 C0 C0 FC ENDCHAR STARTCHAR F ENCODING 70 SWIDTH 611 0 DWIDTH 7 0 BBX 6 9 1 0 BITMAP FC C0 C0 C0 F8 C0 C0 C0 C0 ENDCHAR STARTCHAR G ENCODING 71 SWIDTH 778 0 DWIDTH 10 0 BBX 8 9 1 0 BITMAP 3E 63 C0 C0 CF C3 C3 63 3D ENDCHAR STARTCHAR H ENCODING 72 SWIDTH 722 0 DWIDTH 9 0 BBX 7 9 1 0 BITMAP C6 C6 C6 C6 FE C6 C6 C6 C6 ENDCHAR STARTCHAR I ENCODING 73 SWIDTH 278 0 DWIDTH 4 0 BBX 2 9 1 0 BITMAP C0 C0 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR J ENCODING 74 SWIDTH 556 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP 0C 0C 0C 0C 0C 0C CC CC 78 ENDCHAR STARTCHAR K ENCODING 75 SWIDTH 722 0 DWIDTH 9 0 BBX 8 9 1 0 BITMAP C6 CC D8 F0 F0 D8 CC C6 C3 ENDCHAR STARTCHAR L ENCODING 76 SWIDTH 611 0 DWIDTH 7 0 BBX 6 9 1 0 BITMAP C0 C0 C0 C0 C0 C0 C0 C0 FC ENDCHAR STARTCHAR M ENCODING 77 SWIDTH 833 0 DWIDTH 11 0 BBX 9 9 1 0 BITMAP C180 C180 E380 E380 F780 D580 DD80 C980 C980 ENDCHAR STARTCHAR N ENCODING 78 SWIDTH 722 0 DWIDTH 9 0 BBX 7 9 1 0 BITMAP C6 E6 E6 D6 D6 CE CE C6 C6 ENDCHAR STARTCHAR O ENCODING 79 SWIDTH 778 0 DWIDTH 10 0 BBX 8 9 1 0 BITMAP 3C 66 C3 C3 C3 C3 C3 66 3C ENDCHAR STARTCHAR P ENCODING 80 SWIDTH 667 0 DWIDTH 8 0 BBX 7 9 1 0 BITMAP FC C6 C6 C6 FC C0 C0 C0 C0 ENDCHAR STARTCHAR Q ENCODING 81 SWIDTH 778 0 DWIDTH 10 0 BBX 8 9 1 0 BITMAP 3C 66 C3 C3 C3 CB CF 66 3F ENDCHAR STARTCHAR R ENCODING 82 SWIDTH 722 0 DWIDTH 9 0 BBX 7 9 1 0 BITMAP FC C6 C6 C6 FC CC C6 C6 C6 ENDCHAR STARTCHAR S ENCODING 83 SWIDTH 667 0 DWIDTH 9 0 BBX 7 9 1 0 BITMAP 7C C6 C6 70 1C 0E C6 C6 7C ENDCHAR STARTCHAR T ENCODING 84 SWIDTH 611 0 DWIDTH 8 0 BBX 8 9 0 0 BITMAP FF 18 18 18 18 18 18 18 18 ENDCHAR STARTCHAR U ENCODING 85 SWIDTH 722 0 DWIDTH 9 0 BBX 7 9 1 0 BITMAP C6 C6 C6 C6 C6 C6 C6 6C 7C ENDCHAR STARTCHAR V ENCODING 86 SWIDTH 667 0 DWIDTH 8 0 BBX 8 9 0 0 BITMAP C3 C3 66 66 66 24 3C 18 18 ENDCHAR STARTCHAR W ENCODING 87 SWIDTH 944 0 DWIDTH 10 0 BBX 10 9 0 0 BITMAP CCC0 CCC0 CCC0 4C80 6D80 6D80 3300 3300 3300 ENDCHAR STARTCHAR X ENCODING 88 SWIDTH 667 0 DWIDTH 8 0 BBX 8 9 0 0 BITMAP C3 C3 66 3C 18 3C 66 C3 C3 ENDCHAR STARTCHAR Y ENCODING 89 SWIDTH 667 0 DWIDTH 8 0 BBX 8 9 0 0 BITMAP C3 C3 66 66 3C 18 18 18 18 ENDCHAR STARTCHAR Z ENCODING 90 SWIDTH 611 0 DWIDTH 7 0 BBX 7 9 0 0 BITMAP FE 06 0C 18 30 30 60 C0 FE ENDCHAR STARTCHAR bracketleft ENCODING 91 SWIDTH 333 0 DWIDTH 4 0 BBX 3 12 1 -3 BITMAP E0 C0 C0 C0 C0 C0 C0 C0 C0 C0 C0 E0 ENDCHAR STARTCHAR backslash ENCODING 92 SWIDTH 278 0 DWIDTH 4 0 BBX 4 9 0 0 BITMAP C0 C0 40 60 60 20 20 30 30 ENDCHAR STARTCHAR bracketright ENCODING 93 SWIDTH 333 0 DWIDTH 4 0 BBX 3 12 0 -3 BITMAP E0 60 60 60 60 60 60 60 60 60 60 E0 ENDCHAR STARTCHAR asciicircum ENCODING 94 SWIDTH 584 0 DWIDTH 7 0 BBX 7 4 0 5 BITMAP 10 38 6C C6 ENDCHAR STARTCHAR underscore ENCODING 95 SWIDTH 556 0 DWIDTH 7 0 BBX 7 1 0 -3 BITMAP FE ENDCHAR STARTCHAR quoteleft ENCODING 96 SWIDTH 278 0 DWIDTH 4 0 BBX 2 3 1 6 BITMAP 40 80 C0 ENDCHAR STARTCHAR a ENCODING 97 SWIDTH 556 0 DWIDTH 7 0 BBX 7 7 0 0 BITMAP 78 CC 0C 7C CC CC 76 ENDCHAR STARTCHAR b ENCODING 98 SWIDTH 611 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP C0 C0 D8 EC CC CC CC EC D8 ENDCHAR STARTCHAR c ENCODING 99 SWIDTH 556 0 DWIDTH 7 0 BBX 6 7 0 0 BITMAP 78 CC C0 C0 C0 CC 78 ENDCHAR STARTCHAR d ENCODING 100 SWIDTH 611 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP 0C 0C 6C DC CC CC CC DC 6C ENDCHAR STARTCHAR e ENCODING 101 SWIDTH 556 0 DWIDTH 7 0 BBX 6 7 0 0 BITMAP 78 CC CC FC C0 CC 78 ENDCHAR STARTCHAR f ENCODING 102 SWIDTH 333 0 DWIDTH 5 0 BBX 5 9 0 0 BITMAP 38 60 F0 60 60 60 60 60 60 ENDCHAR STARTCHAR g ENCODING 103 SWIDTH 611 0 DWIDTH 7 0 BBX 6 10 0 -3 BITMAP 6C DC CC CC CC DC 6C 0C CC 78 ENDCHAR STARTCHAR h ENCODING 104 SWIDTH 611 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP C0 C0 D8 EC CC CC CC CC CC ENDCHAR STARTCHAR i ENCODING 105 SWIDTH 278 0 DWIDTH 3 0 BBX 2 9 0 0 BITMAP C0 00 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR j ENCODING 106 SWIDTH 278 0 DWIDTH 3 0 BBX 3 12 -1 -3 BITMAP 60 00 60 60 60 60 60 60 60 60 60 C0 ENDCHAR STARTCHAR k ENCODING 107 SWIDTH 556 0 DWIDTH 7 0 BBX 7 9 0 0 BITMAP C0 C0 CC D8 F0 F0 D8 CC C6 ENDCHAR STARTCHAR l ENCODING 108 SWIDTH 278 0 DWIDTH 3 0 BBX 2 9 0 0 BITMAP C0 C0 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR m ENCODING 109 SWIDTH 889 0 DWIDTH 11 0 BBX 10 7 0 0 BITMAP BB80 CCC0 CCC0 CCC0 CCC0 CCC0 CCC0 ENDCHAR STARTCHAR n ENCODING 110 SWIDTH 611 0 DWIDTH 7 0 BBX 6 7 0 0 BITMAP D8 EC CC CC CC CC CC ENDCHAR STARTCHAR o ENCODING 111 SWIDTH 611 0 DWIDTH 7 0 BBX 6 7 0 0 BITMAP 78 CC CC CC CC CC 78 ENDCHAR STARTCHAR p ENCODING 112 SWIDTH 611 0 DWIDTH 7 0 BBX 6 10 0 -3 BITMAP D8 EC CC CC CC EC D8 C0 C0 C0 ENDCHAR STARTCHAR q ENCODING 113 SWIDTH 611 0 DWIDTH 7 0 BBX 6 10 0 -3 BITMAP 74 DC CC CC CC DC 6C 0C 0C 0C ENDCHAR STARTCHAR r ENCODING 114 SWIDTH 389 0 DWIDTH 5 0 BBX 5 7 0 0 BITMAP D8 F8 E0 C0 C0 C0 C0 ENDCHAR STARTCHAR s ENCODING 115 SWIDTH 556 0 DWIDTH 7 0 BBX 6 7 0 0 BITMAP 78 CC E0 38 1C CC 78 ENDCHAR STARTCHAR t ENCODING 116 SWIDTH 333 0 DWIDTH 5 0 BBX 5 9 0 0 BITMAP 60 60 F0 60 60 60 60 68 30 ENDCHAR STARTCHAR u ENCODING 117 SWIDTH 611 0 DWIDTH 7 0 BBX 6 7 0 0 BITMAP CC CC CC CC CC DC 6C ENDCHAR STARTCHAR v ENCODING 118 SWIDTH 556 0 DWIDTH 8 0 BBX 7 7 0 0 BITMAP C6 C6 6C 6C 38 38 10 ENDCHAR STARTCHAR w ENCODING 119 SWIDTH 778 0 DWIDTH 11 0 BBX 10 7 0 0 BITMAP CCC0 CCC0 6D80 6D80 6D80 3300 3300 ENDCHAR STARTCHAR x ENCODING 120 SWIDTH 556 0 DWIDTH 7 0 BBX 6 7 0 0 BITMAP CC CC 78 30 78 CC CC ENDCHAR STARTCHAR y ENCODING 121 SWIDTH 556 0 DWIDTH 8 0 BBX 7 10 0 -3 BITMAP C6 C6 6C 6C 38 38 18 10 30 60 ENDCHAR STARTCHAR z ENCODING 122 SWIDTH 500 0 DWIDTH 6 0 BBX 5 7 0 0 BITMAP F8 18 30 20 60 C0 F8 ENDCHAR STARTCHAR braceleft ENCODING 123 SWIDTH 389 0 DWIDTH 5 0 BBX 4 12 0 -3 BITMAP 30 60 60 60 60 C0 60 60 60 60 60 30 ENDCHAR STARTCHAR bar ENCODING 124 SWIDTH 280 0 DWIDTH 4 0 BBX 2 12 1 -3 BITMAP C0 C0 C0 C0 C0 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR braceright ENCODING 125 SWIDTH 389 0 DWIDTH 5 0 BBX 4 12 0 -3 BITMAP C0 60 60 60 60 30 60 60 60 60 60 C0 ENDCHAR STARTCHAR asciitilde ENCODING 126 SWIDTH 584 0 DWIDTH 7 0 BBX 7 2 0 3 BITMAP 76 DC ENDCHAR STARTCHAR space ENCODING 160 SWIDTH 278 0 DWIDTH 4 0 BBX 1 1 0 0 BITMAP 00 ENDCHAR STARTCHAR exclamdown ENCODING 161 SWIDTH 333 0 DWIDTH 4 0 BBX 2 10 1 -3 BITMAP C0 C0 00 40 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR cent ENCODING 162 SWIDTH 556 0 DWIDTH 7 0 BBX 6 9 0 -1 BITMAP 10 78 DC 90 A0 A0 EC 78 40 ENDCHAR STARTCHAR sterling ENCODING 163 SWIDTH 556 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP 38 6C 60 60 F8 60 60 EC D8 ENDCHAR STARTCHAR currency ENCODING 164 SWIDTH 556 0 DWIDTH 7 0 BBX 6 6 0 1 BITMAP CC 78 48 48 78 CC ENDCHAR STARTCHAR yen ENCODING 165 SWIDTH 556 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP CC CC 48 FC 30 FC 30 30 30 ENDCHAR STARTCHAR brokenbar ENCODING 166 SWIDTH 280 0 DWIDTH 4 0 BBX 2 11 1 -2 BITMAP C0 C0 C0 C0 00 00 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR section ENCODING 167 SWIDTH 556 0 DWIDTH 7 0 BBX 6 12 0 -3 BITMAP 78 CC E0 70 D8 CC CC 6C 38 1C CC 78 ENDCHAR STARTCHAR dieresis ENCODING 168 SWIDTH 333 0 DWIDTH 5 0 BBX 5 1 0 8 BITMAP D8 ENDCHAR STARTCHAR copyright ENCODING 169 SWIDTH 737 0 DWIDTH 11 0 BBX 9 9 1 0 BITMAP 3E00 4100 9C80 A280 A080 A280 9C80 4100 3E00 ENDCHAR STARTCHAR ordfeminine ENCODING 170 SWIDTH 370 0 DWIDTH 6 0 BBX 4 6 1 3 BITMAP E0 30 F0 B0 00 F0 ENDCHAR STARTCHAR guillemotleft ENCODING 171 SWIDTH 556 0 DWIDTH 8 0 BBX 6 5 1 1 BITMAP 24 6C D8 6C 24 ENDCHAR STARTCHAR logicalnot ENCODING 172 SWIDTH 584 0 DWIDTH 8 0 BBX 6 4 1 2 BITMAP FC 04 04 04 ENDCHAR STARTCHAR hyphen ENCODING 173 SWIDTH 333 0 DWIDTH 5 0 BBX 4 1 0 3 BITMAP F0 ENDCHAR STARTCHAR registered ENCODING 174 SWIDTH 737 0 DWIDTH 11 0 BBX 9 9 1 0 BITMAP 3E00 4100 9C80 9480 9880 9480 9480 4100 3E00 ENDCHAR STARTCHAR macron ENCODING 175 SWIDTH 333 0 DWIDTH 4 0 BBX 4 1 0 8 BITMAP F0 ENDCHAR STARTCHAR degree ENCODING 176 SWIDTH 400 0 DWIDTH 5 0 BBX 4 4 0 4 BITMAP 60 90 90 60 ENDCHAR STARTCHAR plusminus ENCODING 177 SWIDTH 584 0 DWIDTH 7 0 BBX 6 7 0 0 BITMAP 30 30 FC 30 30 00 FC ENDCHAR STARTCHAR twosuperior ENCODING 178 SWIDTH 333 0 DWIDTH 4 0 BBX 4 5 0 4 BITMAP 60 B0 60 C0 F0 ENDCHAR STARTCHAR threesuperior ENCODING 179 SWIDTH 333 0 DWIDTH 4 0 BBX 4 5 0 4 BITMAP 60 B0 60 30 E0 ENDCHAR STARTCHAR acute ENCODING 180 SWIDTH 333 0 DWIDTH 4 0 BBX 3 2 0 8 BITMAP 60 C0 ENDCHAR STARTCHAR mu ENCODING 181 SWIDTH 611 0 DWIDTH 7 0 BBX 6 10 0 -3 BITMAP CC CC CC CC CC DC EC C0 C0 C0 ENDCHAR STARTCHAR paragraph ENCODING 182 SWIDTH 556 0 DWIDTH 7 0 BBX 7 12 0 -3 BITMAP 3E 74 F4 F4 F4 74 34 14 14 14 14 14 ENDCHAR STARTCHAR periodcentered ENCODING 183 SWIDTH 278 0 DWIDTH 4 0 BBX 2 2 1 3 BITMAP C0 C0 ENDCHAR STARTCHAR cedilla ENCODING 184 SWIDTH 333 0 DWIDTH 4 0 BBX 4 4 0 -3 BITMAP 60 30 30 E0 ENDCHAR STARTCHAR onesuperior ENCODING 185 SWIDTH 333 0 DWIDTH 4 0 BBX 3 5 0 4 BITMAP 60 E0 60 60 60 ENDCHAR STARTCHAR ordmasculine ENCODING 186 SWIDTH 365 0 DWIDTH 6 0 BBX 4 6 1 3 BITMAP 60 D0 D0 60 00 F0 ENDCHAR STARTCHAR guillemotright ENCODING 187 SWIDTH 556 0 DWIDTH 8 0 BBX 6 5 1 1 BITMAP 90 D8 6C D8 90 ENDCHAR STARTCHAR onequarter ENCODING 188 SWIDTH 834 0 DWIDTH 10 0 BBX 10 9 0 0 BITMAP 6300 E600 6600 6C00 6D80 0B80 1A80 37C0 3180 ENDCHAR STARTCHAR onehalf ENCODING 189 SWIDTH 834 0 DWIDTH 10 0 BBX 10 9 0 0 BITMAP 6300 E600 6600 6C00 6D80 0AC0 1980 3300 33C0 ENDCHAR STARTCHAR threequarters ENCODING 190 SWIDTH 834 0 DWIDTH 10 0 BBX 10 9 0 0 BITMAP 6300 B300 6600 3600 ED80 0B80 1A80 37C0 3180 ENDCHAR STARTCHAR questiondown ENCODING 191 SWIDTH 611 0 DWIDTH 8 0 BBX 6 10 1 -3 BITMAP 30 30 00 30 30 30 60 CC CC 78 ENDCHAR STARTCHAR Agrave ENCODING 192 SWIDTH 722 0 DWIDTH 8 0 BBX 8 12 0 0 BITMAP 30 18 00 18 18 3C 24 66 7E C3 C3 C3 ENDCHAR STARTCHAR Aacute ENCODING 193 SWIDTH 722 0 DWIDTH 8 0 BBX 8 12 0 0 BITMAP 0C 18 00 18 18 3C 24 66 7E C3 C3 C3 ENDCHAR STARTCHAR Acircumflex ENCODING 194 SWIDTH 722 0 DWIDTH 8 0 BBX 8 12 0 0 BITMAP 1C 36 00 18 18 3C 24 66 7E C3 C3 C3 ENDCHAR STARTCHAR Atilde ENCODING 195 SWIDTH 722 0 DWIDTH 8 0 BBX 8 12 0 0 BITMAP 1A 2C 00 18 18 3C 24 66 7E C3 C3 C3 ENDCHAR STARTCHAR Adieresis ENCODING 196 SWIDTH 722 0 DWIDTH 8 0 BBX 8 11 0 0 BITMAP 36 00 18 18 3C 24 66 7E C3 C3 C3 ENDCHAR STARTCHAR Aring ENCODING 197 SWIDTH 722 0 DWIDTH 8 0 BBX 8 12 0 0 BITMAP 18 24 18 18 18 3C 24 66 7E C3 C3 C3 ENDCHAR STARTCHAR AE ENCODING 198 SWIDTH 1000 0 DWIDTH 13 0 BBX 11 9 1 0 BITMAP 1FE0 3600 2600 6600 67E0 7E00 C600 C600 C7E0 ENDCHAR STARTCHAR Ccedilla ENCODING 199 SWIDTH 722 0 DWIDTH 8 0 BBX 7 12 1 -3 BITMAP 3C 66 C0 C0 C0 C0 C0 66 3C 18 18 70 ENDCHAR STARTCHAR Egrave ENCODING 200 SWIDTH 667 0 DWIDTH 8 0 BBX 6 12 1 0 BITMAP 60 30 00 FC C0 C0 C0 FC C0 C0 C0 FC ENDCHAR STARTCHAR Eacute ENCODING 201 SWIDTH 667 0 DWIDTH 8 0 BBX 6 12 1 0 BITMAP 18 30 00 FC C0 C0 C0 FC C0 C0 C0 FC ENDCHAR STARTCHAR Ecircumflex ENCODING 202 SWIDTH 667 0 DWIDTH 8 0 BBX 6 12 1 0 BITMAP 38 6C 00 FC C0 C0 C0 FC C0 C0 C0 FC ENDCHAR STARTCHAR Edieresis ENCODING 203 SWIDTH 667 0 DWIDTH 8 0 BBX 6 11 1 0 BITMAP 6C 00 FC C0 C0 C0 FC C0 C0 C0 FC ENDCHAR STARTCHAR Igrave ENCODING 204 SWIDTH 278 0 DWIDTH 4 0 BBX 3 12 0 0 BITMAP C0 60 00 60 60 60 60 60 60 60 60 60 ENDCHAR STARTCHAR Iacute ENCODING 205 SWIDTH 278 0 DWIDTH 4 0 BBX 3 12 1 0 BITMAP 60 C0 00 C0 C0 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR Icircumflex ENCODING 206 SWIDTH 278 0 DWIDTH 4 0 BBX 5 12 0 0 BITMAP 70 D8 00 60 60 60 60 60 60 60 60 60 ENDCHAR STARTCHAR Idieresis ENCODING 207 SWIDTH 278 0 DWIDTH 4 0 BBX 5 11 0 0 BITMAP D8 00 60 60 60 60 60 60 60 60 60 ENDCHAR STARTCHAR Eth ENCODING 208 SWIDTH 722 0 DWIDTH 9 0 BBX 8 9 0 0 BITMAP 7C 66 63 63 F3 63 63 66 7C ENDCHAR STARTCHAR Ntilde ENCODING 209 SWIDTH 722 0 DWIDTH 9 0 BBX 7 12 1 0 BITMAP 34 58 00 C6 C6 E6 E6 F6 CE CE C6 C6 ENDCHAR STARTCHAR Ograve ENCODING 210 SWIDTH 778 0 DWIDTH 10 0 BBX 8 12 1 0 BITMAP 30 18 00 3C 66 C3 C3 C3 C3 C3 66 3C ENDCHAR STARTCHAR Oacute ENCODING 211 SWIDTH 778 0 DWIDTH 10 0 BBX 8 12 1 0 BITMAP 0C 18 00 3C 66 C3 C3 C3 C3 C3 66 3C ENDCHAR STARTCHAR Ocircumflex ENCODING 212 SWIDTH 778 0 DWIDTH 10 0 BBX 8 12 1 0 BITMAP 1C 36 00 3C 66 C3 C3 C3 C3 C3 66 3C ENDCHAR STARTCHAR Otilde ENCODING 213 SWIDTH 778 0 DWIDTH 10 0 BBX 8 12 1 0 BITMAP 1A 2C 00 3C 66 C3 C3 C3 C3 C3 66 3C ENDCHAR STARTCHAR Odieresis ENCODING 214 SWIDTH 778 0 DWIDTH 10 0 BBX 8 11 1 0 BITMAP 66 00 3C 66 C3 C3 C3 C3 C3 66 3C ENDCHAR STARTCHAR multiply ENCODING 215 SWIDTH 584 0 DWIDTH 7 0 BBX 6 5 0 1 BITMAP CC 78 30 78 CC ENDCHAR STARTCHAR Oslash ENCODING 216 SWIDTH 778 0 DWIDTH 10 0 BBX 8 10 1 -1 BITMAP 3D 66 CF CB DB D3 F3 66 7C 80 ENDCHAR STARTCHAR Ugrave ENCODING 217 SWIDTH 722 0 DWIDTH 9 0 BBX 7 12 1 0 BITMAP 30 18 00 C6 C6 C6 C6 C6 C6 C6 6C 7C ENDCHAR STARTCHAR Uacute ENCODING 218 SWIDTH 722 0 DWIDTH 9 0 BBX 7 12 1 0 BITMAP 0C 18 00 C6 C6 C6 C6 C6 C6 C6 6C 7C ENDCHAR STARTCHAR Ucircumflex ENCODING 219 SWIDTH 722 0 DWIDTH 9 0 BBX 7 12 1 0 BITMAP 38 6C 00 C6 C6 C6 C6 C6 C6 C6 6C 7C ENDCHAR STARTCHAR Udieresis ENCODING 220 SWIDTH 722 0 DWIDTH 9 0 BBX 7 11 1 0 BITMAP 6C 00 C6 C6 C6 C6 C6 C6 C6 6C 7C ENDCHAR STARTCHAR Yacute ENCODING 221 SWIDTH 667 0 DWIDTH 8 0 BBX 8 12 0 0 BITMAP 0C 18 00 C3 C3 66 66 24 3C 18 18 18 ENDCHAR STARTCHAR Thorn ENCODING 222 SWIDTH 667 0 DWIDTH 8 0 BBX 7 9 1 0 BITMAP C0 C0 FC C6 C6 C6 FC C0 C0 ENDCHAR STARTCHAR germandbls ENCODING 223 SWIDTH 611 0 DWIDTH 8 0 BBX 6 9 1 0 BITMAP 78 CC CC CC D8 CC CC CC D8 ENDCHAR STARTCHAR agrave ENCODING 224 SWIDTH 556 0 DWIDTH 7 0 BBX 7 10 0 0 BITMAP 30 18 00 78 CC 0C 7C CC CC 76 ENDCHAR STARTCHAR aacute ENCODING 225 SWIDTH 556 0 DWIDTH 7 0 BBX 7 10 0 0 BITMAP 18 30 00 78 CC 0C 7C CC CC 76 ENDCHAR STARTCHAR acircumflex ENCODING 226 SWIDTH 556 0 DWIDTH 7 0 BBX 7 10 0 0 BITMAP 38 6C 00 78 CC 0C 7C CC CC 76 ENDCHAR STARTCHAR atilde ENCODING 227 SWIDTH 556 0 DWIDTH 7 0 BBX 7 10 0 0 BITMAP 34 58 00 78 CC 0C 7C CC CC 76 ENDCHAR STARTCHAR adieresis ENCODING 228 SWIDTH 556 0 DWIDTH 7 0 BBX 7 9 0 0 BITMAP 6C 00 78 CC 0C 7C CC CC 76 ENDCHAR STARTCHAR aring ENCODING 229 SWIDTH 556 0 DWIDTH 7 0 BBX 7 11 0 0 BITMAP 30 48 30 00 78 CC 0C 7C CC CC 76 ENDCHAR STARTCHAR ae ENCODING 230 SWIDTH 889 0 DWIDTH 11 0 BBX 10 7 0 0 BITMAP 7780 CCC0 0CC0 7FC0 CC00 CCC0 7780 ENDCHAR STARTCHAR ccedilla ENCODING 231 SWIDTH 556 0 DWIDTH 7 0 BBX 6 10 0 -3 BITMAP 78 CC C0 C0 C0 CC 78 10 18 70 ENDCHAR STARTCHAR egrave ENCODING 232 SWIDTH 556 0 DWIDTH 7 0 BBX 6 10 0 0 BITMAP 60 30 00 78 CC CC FC C0 CC 78 ENDCHAR STARTCHAR eacute ENCODING 233 SWIDTH 556 0 DWIDTH 7 0 BBX 6 10 0 0 BITMAP 18 30 00 78 CC CC FC C0 CC 78 ENDCHAR STARTCHAR ecircumflex ENCODING 234 SWIDTH 556 0 DWIDTH 7 0 BBX 6 10 0 0 BITMAP 38 6C 00 78 CC CC FC C0 CC 78 ENDCHAR STARTCHAR edieresis ENCODING 235 SWIDTH 556 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP 6C 00 78 CC CC FC C0 CC 78 ENDCHAR STARTCHAR igrave ENCODING 236 SWIDTH 278 0 DWIDTH 3 0 BBX 3 10 -1 0 BITMAP C0 60 00 60 60 60 60 60 60 60 ENDCHAR STARTCHAR iacute ENCODING 237 SWIDTH 278 0 DWIDTH 3 0 BBX 3 10 0 0 BITMAP 60 C0 00 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR icircumflex ENCODING 238 SWIDTH 278 0 DWIDTH 3 0 BBX 5 10 -1 0 BITMAP 70 D8 00 60 60 60 60 60 60 60 ENDCHAR STARTCHAR idieresis ENCODING 239 SWIDTH 278 0 DWIDTH 3 0 BBX 5 9 -1 0 BITMAP D8 00 60 60 60 60 60 60 60 ENDCHAR STARTCHAR eth ENCODING 240 SWIDTH 611 0 DWIDTH 7 0 BBX 6 10 0 0 BITMAP D8 70 90 18 7C CC CC CC CC 78 ENDCHAR STARTCHAR ntilde ENCODING 241 SWIDTH 611 0 DWIDTH 7 0 BBX 6 10 0 0 BITMAP 34 58 00 D8 EC CC CC CC CC CC ENDCHAR STARTCHAR ograve ENCODING 242 SWIDTH 611 0 DWIDTH 7 0 BBX 6 10 0 0 BITMAP 60 30 00 78 CC CC CC CC CC 78 ENDCHAR STARTCHAR oacute ENCODING 243 SWIDTH 611 0 DWIDTH 7 0 BBX 6 10 0 0 BITMAP 18 30 00 78 CC CC CC CC CC 78 ENDCHAR STARTCHAR ocircumflex ENCODING 244 SWIDTH 611 0 DWIDTH 7 0 BBX 6 10 0 0 BITMAP 38 6C 00 78 CC CC CC CC CC 78 ENDCHAR STARTCHAR otilde ENCODING 245 SWIDTH 611 0 DWIDTH 7 0 BBX 6 10 0 0 BITMAP 34 58 00 78 CC CC CC CC CC 78 ENDCHAR STARTCHAR odieresis ENCODING 246 SWIDTH 611 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP 6C 00 78 CC CC CC CC CC 78 ENDCHAR STARTCHAR divide ENCODING 247 SWIDTH 584 0 DWIDTH 7 0 BBX 6 5 0 1 BITMAP 30 00 FC 00 30 ENDCHAR STARTCHAR oslash ENCODING 248 SWIDTH 611 0 DWIDTH 7 0 BBX 8 7 -1 0 BITMAP 3D 66 6E 76 66 66 BC ENDCHAR STARTCHAR ugrave ENCODING 249 SWIDTH 611 0 DWIDTH 7 0 BBX 6 10 0 0 BITMAP 60 30 00 CC CC CC CC CC DC 6C ENDCHAR STARTCHAR uacute ENCODING 250 SWIDTH 611 0 DWIDTH 7 0 BBX 6 10 0 0 BITMAP 18 30 00 CC CC CC CC CC DC 6C ENDCHAR STARTCHAR ucircumflex ENCODING 251 SWIDTH 611 0 DWIDTH 7 0 BBX 6 10 0 0 BITMAP 38 6C 00 CC CC CC CC CC DC 6C ENDCHAR STARTCHAR udieresis ENCODING 252 SWIDTH 611 0 DWIDTH 7 0 BBX 6 9 0 0 BITMAP 6C 00 CC CC CC CC CC DC 6C ENDCHAR STARTCHAR yacute ENCODING 253 SWIDTH 556 0 DWIDTH 8 0 BBX 7 13 0 -3 BITMAP 0C 18 00 C6 C6 6C 6C 38 38 18 10 30 60 ENDCHAR STARTCHAR thorn ENCODING 254 SWIDTH 611 0 DWIDTH 7 0 BBX 6 12 0 -3 BITMAP C0 C0 D8 EC CC CC CC EC D8 C0 C0 C0 ENDCHAR STARTCHAR ydieresis ENCODING 255 SWIDTH 556 0 DWIDTH 8 0 BBX 7 12 0 -3 BITMAP 6C 00 C6 C6 6C 6C 38 38 18 10 30 60 ENDCHAR STARTCHAR Lslash ENCODING -1 SWIDTH 611 0 DWIDTH 8 0 BBX 7 9 0 0 BITMAP 60 60 78 70 E0 60 60 60 7E ENDCHAR STARTCHAR OE ENCODING -1 SWIDTH 1000 0 DWIDTH 13 0 BBX 11 9 1 0 BITMAP 3FE0 6600 C600 C600 C7E0 C600 C600 6600 3FE0 ENDCHAR STARTCHAR Scaron ENCODING -1 SWIDTH 667 0 DWIDTH 9 0 BBX 7 10 1 0 BITMAP 6C 38 00 78 CC E0 78 1C CE 7C ENDCHAR STARTCHAR Ydieresis ENCODING -1 SWIDTH 667 0 DWIDTH 8 0 BBX 8 9 0 0 BITMAP 6C 00 C3 66 24 3C 18 18 18 ENDCHAR STARTCHAR Zcaron ENCODING -1 SWIDTH 611 0 DWIDTH 7 0 BBX 7 10 0 0 BITMAP 6C 38 00 FC 18 30 30 60 C0 FE ENDCHAR STARTCHAR breve ENCODING -1 SWIDTH 333 0 DWIDTH 5 0 BBX 5 2 0 8 BITMAP 88 70 ENDCHAR STARTCHAR bullet ENCODING -1 SWIDTH 350 0 DWIDTH 4 0 BBX 4 3 0 2 BITMAP 60 F0 60 ENDCHAR STARTCHAR caron ENCODING -1 SWIDTH 333 0 DWIDTH 5 0 BBX 5 2 0 8 BITMAP D8 70 ENDCHAR STARTCHAR circumflex ENCODING -1 SWIDTH 333 0 DWIDTH 5 0 BBX 5 2 0 8 BITMAP 70 D8 ENDCHAR STARTCHAR dagger ENCODING -1 SWIDTH 556 0 DWIDTH 7 0 BBX 6 12 0 -3 BITMAP 30 30 30 FC 30 30 30 30 30 30 30 30 ENDCHAR STARTCHAR daggerdbl ENCODING -1 SWIDTH 556 0 DWIDTH 7 0 BBX 6 12 0 -3 BITMAP 30 30 30 FC 30 30 30 FC 30 30 30 30 ENDCHAR STARTCHAR dotaccent ENCODING -1 SWIDTH 333 0 DWIDTH 4 0 BBX 2 1 1 8 BITMAP C0 ENDCHAR STARTCHAR dotlessi ENCODING -1 SWIDTH 278 0 DWIDTH 3 0 BBX 2 7 0 0 BITMAP C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR ellipsis ENCODING -1 SWIDTH 1000 0 DWIDTH 12 0 BBX 10 1 1 0 BITMAP CCC0 ENDCHAR STARTCHAR emdash ENCODING -1 SWIDTH 1000 0 DWIDTH 12 0 BBX 12 1 0 3 BITMAP FFF0 ENDCHAR STARTCHAR endash ENCODING -1 SWIDTH 556 0 DWIDTH 7 0 BBX 7 1 0 3 BITMAP FE ENDCHAR STARTCHAR fi ENCODING -1 SWIDTH 611 0 DWIDTH 8 0 BBX 7 9 0 0 BITMAP 36 60 F6 66 66 66 66 66 66 ENDCHAR STARTCHAR fl ENCODING -1 SWIDTH 611 0 DWIDTH 8 0 BBX 7 9 0 0 BITMAP 36 66 F6 66 66 66 66 66 66 ENDCHAR STARTCHAR florin ENCODING -1 SWIDTH 556 0 DWIDTH 7 0 BBX 7 11 0 -3 BITMAP 0E 18 18 7C 30 30 30 30 30 E0 C0 ENDCHAR STARTCHAR fraction ENCODING -1 SWIDTH 167 0 DWIDTH 4 0 BBX 5 8 -1 0 BITMAP 18 18 30 30 60 60 C0 C0 ENDCHAR STARTCHAR grave ENCODING -1 SWIDTH 333 0 DWIDTH 4 0 BBX 3 2 0 8 BITMAP C0 60 ENDCHAR STARTCHAR guilsinglleft ENCODING -1 SWIDTH 333 0 DWIDTH 5 0 BBX 3 5 1 1 BITMAP 20 60 C0 60 20 ENDCHAR STARTCHAR guilsinglright ENCODING -1 SWIDTH 333 0 DWIDTH 5 0 BBX 3 5 1 1 BITMAP 80 C0 60 C0 80 ENDCHAR STARTCHAR hungarumlaut ENCODING -1 SWIDTH 333 0 DWIDTH 5 0 BBX 5 2 1 8 BITMAP 68 B0 ENDCHAR STARTCHAR lslash ENCODING -1 SWIDTH 278 0 DWIDTH 3 0 BBX 4 9 -1 0 BITMAP 60 60 70 60 E0 60 60 60 60 ENDCHAR STARTCHAR oe ENCODING -1 SWIDTH 944 0 DWIDTH 11 0 BBX 10 7 0 0 BITMAP 7780 CCC0 CCC0 CFC0 CC00 CCC0 7780 ENDCHAR STARTCHAR ogonek ENCODING -1 SWIDTH 333 0 DWIDTH 4 0 BBX 4 4 0 -3 BITMAP 60 C0 C0 70 ENDCHAR STARTCHAR perthousand ENCODING -1 SWIDTH 1000 0 DWIDTH 13 0 BBX 13 8 0 0 BITMAP 7100 DB00 DA00 7400 05B0 0B68 1B68 11B0 ENDCHAR STARTCHAR quotedblbase ENCODING -1 SWIDTH 500 0 DWIDTH 7 0 BBX 5 3 1 -2 BITMAP D8 48 90 ENDCHAR STARTCHAR quotedblleft ENCODING -1 SWIDTH 500 0 DWIDTH 7 0 BBX 5 3 1 6 BITMAP 48 90 D8 ENDCHAR STARTCHAR quotedblright ENCODING -1 SWIDTH 500 0 DWIDTH 7 0 BBX 5 3 1 6 BITMAP D8 48 90 ENDCHAR STARTCHAR quotesinglbase ENCODING -1 SWIDTH 278 0 DWIDTH 4 0 BBX 2 3 1 -2 BITMAP C0 40 80 ENDCHAR STARTCHAR quotesingle ENCODING -1 SWIDTH 238 0 DWIDTH 3 0 BBX 1 3 1 6 BITMAP 80 80 80 ENDCHAR STARTCHAR ring ENCODING -1 SWIDTH 333 0 DWIDTH 5 0 BBX 5 3 0 7 BITMAP 70 D8 70 ENDCHAR STARTCHAR scaron ENCODING -1 SWIDTH 556 0 DWIDTH 7 0 BBX 6 10 0 0 BITMAP D8 70 00 78 CC E0 38 1C CC 78 ENDCHAR STARTCHAR tilde ENCODING -1 SWIDTH 333 0 DWIDTH 5 0 BBX 5 2 0 8 BITMAP 68 B0 ENDCHAR STARTCHAR trademark ENCODING -1 SWIDTH 1000 0 DWIDTH 11 0 BBX 9 5 1 3 BITMAP E880 4D80 4A80 4A80 4A80 ENDCHAR STARTCHAR zcaron ENCODING -1 SWIDTH 500 0 DWIDTH 6 0 BBX 5 10 0 0 BITMAP D8 70 00 F8 18 30 20 60 C0 F8 ENDCHAR ENDFONT bogl-0.1.18/bogl-cfb.c0000644000000000000000000001032411407777275011252 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* bogl-cfb.h: Just contains the memset_var function, which has definitely gotten too large to be inlined (unless of course the bits-per-pixel argument is a constant, in which case most of it gets optimized away) Written by David Huggins-Daines . Somewhat based on sysdeps/generic/memset.c in GNU libc sources Copyright (C) 1991 Free Software Foundation, Inc. */ #include #include "bogl-cfb.h" /* Some notes: - len is counted in pixels, not bits! - Of course there are many architecture-specific ways to optimize this. PPC can move things around in FP registers, 68040 can use MOVE16, on i686 there are string instructions, and of course we could probably use VIS registers on Sparc64. Frankly, I don't care. */ void* memset_var(void* d, unsigned int c, ssize_t offset, size_t len, size_t b) { unsigned char* dst; int i; /* 8 bits per pixel and less */ if (b < 8) return memset_sub8(d, c, offset, len, b); if (b == 8) return memset((unsigned char*) d + offset, c, len); /* 24 bits per pixel */ if (b == 24) return memset_24((unsigned char*) d + offset * 3, c, len, b); /* For anything else, assert that we are actually aligned on a pixel boundary, otherwise we are sure to lose */ dst = (unsigned char*) d + offset * b / 8; assert((((unsigned int)dst * 8) % b) == 0); /* Sanity... */ assert (b <= 32); /* 16/32 bits per pixel */ if (len > 64) { /* Size of an "unsigned int" in pixels: == sizeof(unsigned int) / b / 8 */ const int intsiz = sizeof(unsigned int) * 8 / b; const unsigned int mask = (b == 32) ? ((unsigned int) -1) : ((1 << b) - 1); unsigned int fill; /* MUST be signed! */ ssize_t xlen; /* Construct an "unsigned int" full of pixels */ fill = 0; for (i = 0; i < intsiz; i++) fill |= (c&mask) << (b*i); /* printf ("c is %x, fill is %x\n\r", c, fill); */ /* printf ("Filling %d pixels == %d bytes\n\r", len, len * b / 8); */ /* Align to an int boundary */ while ((unsigned int)dst % sizeof(unsigned int)) { /* printf ("Aligning %d bytes\n\r", (unsigned int)dst % sizeof(unsigned int)); */ if (b >= 8) { put_var(dst, 0, c, b); dst += b / 8; len--; } else { int i; for (i = 0; i < (8 / b); i++) { put_var(dst, i, c, b); len--; } dst++; } } /* Write 8 unsigned ints at a time for as long as possible */ xlen = len / (intsiz * 8); /* printf ("Filling %d units of %d pixels\n\r", xlen, intsiz * 8); */ while (xlen > 0) { ((unsigned int *) dst)[0] = fill; ((unsigned int *) dst)[1] = fill; ((unsigned int *) dst)[2] = fill; ((unsigned int *) dst)[3] = fill; ((unsigned int *) dst)[4] = fill; ((unsigned int *) dst)[5] = fill; ((unsigned int *) dst)[6] = fill; ((unsigned int *) dst)[7] = fill; /* == 8 * intsiz * (b / 8) */ dst += intsiz * b; xlen--; } len %= (intsiz * 8); /* Now individual unsigned ints */ xlen = len / intsiz; /* printf ("Filling %d units of %d pixels\n\r", xlen, intsiz); */ while (xlen > 0) { ((unsigned int *) dst)[0] = fill; dst += intsiz * b / 8; xlen--; } len %= intsiz; } /* In any case, fill in some individual pixels */ /* printf ("Filling %d pixels\n\r", len); */ for (i = 0; i < len; i++) { put_var(dst, i, c, b); } return dst; } bogl-0.1.18/bowl.c0000644000000000000000000012723011407777275010547 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #define _GNU_SOURCE 1 #include #include #include #include #include #include #include #include #include "bogl-font.h" #include "bogl.h" #include "boml.h" #include "bowl.h" #ifdef _TESTING_ # define _(String) String #else # include # define _(String) gettext(String) #endif /* #include "dbootstrap.h" #include "lang.h" */ #define bogl_char_width(ch, font) \ bogl_font_glyph(font, (wchar_t)(unsigned char)ch, 0) /* Widget type. */ enum { W_TEXT, W_BUTTON, W_INPUT, W_MENU, W_CHECKBOX, W_SCALE, }; /* A widget. */ struct widget { struct widget *next, *prev; int type; /* Widget type. */ int w, h; /* Width, height. */ int x, y; /* Location. */ union { struct { char *text; /* Text contents. */ } text; struct { char *label; /* Button label. */ int command; /* Value returned to caller. */ int focused; /* Drawn as focused? */ } button; struct { char **string; /* Input line contents. */ int length; /* Number of characters on line. */ int offset; /* Leftmost displayed character. */ int cursor; /* Cursor position. */ } input; struct { int length; /* Number of items. */ int offset; /* Topmost displayed item. */ int cursor; /* Selected item. */ int shown; /* Number of items to show at once. */ int tag_width; /* Width of tag column. */ char **item; /* Items. */ char **tag; /* Tags. */ int *state; /* Values to return to caller. */ } menu; struct { int length; /* Number of items. */ int offset; /* Topmost displayed item. */ int cursor; /* Selected item. */ int shown; /* Number of items to show at once. */ int tag_width; /* Width of tag column. */ char **item; /* Items. */ char *values; /* Values. */ } checkbox; struct { long long value; /* Current value. */ long long max; /* Maximum value. */ } scale; } p; }; static struct widget *widgets_head, *widgets_tail; static struct widget *focus; /* Mouse grab if active, but usually NULL. */ static struct widget *grab; static int default_result; static char *title; static int wx1, wy1, wx2, wy2; /* Colors. */ #define BASIC_COLORS 5 static unsigned char palette[16][3] = { {0x00, 0x00, 0x00}, /* 0: Black. */ {0xaa, 0xaa, 0xaa}, /* 1: Gray 66%. */ {0xff, 0xff, 0xff}, /* 2: White. */ {0x00, 0x00, 0xff}, /* 3: Blue. */ {0xff, 0x00, 0x00}, /* 4: Red. */ {0x00, 0x00, 0x00}, /* 5: Unused #1. */ {0x00, 0x00, 0x00}, /* 6: Unused #2. */ {0x00, 0x00, 0x00}, /* 7: Unused #3. */ {0x00, 0x00, 0x00}, /* 8: Unused #4. */ {0xff, 0xff, 0xfb}, /* 9: Unused #5. */ {0xa9, 0x99, 0x75}, /* A: Tux #1. */ {0xec, 0xc9, 0x39}, /* B: Tux #2. */ {0x61, 0x52, 0x39}, /* C: Tux #3. */ {0xe4, 0xa8, 0x10}, /* D: Tux #4. */ {0xa0, 0x6d, 0x0c}, /* E: Tux #5. */ {0x38, 0x2e, 0x1e}, /* F: Tux #6. */ }; enum { black, gray, white, blue, red, custom1, custom2, custom3, custom4, custom5, custom6, custom7, custom8, custom9, custom10, custom11, }; static int pix_cmap[16]; #define wallpaper_color blue #define big_title_color white #define window_bg_color gray #define window_outline_color black #define window_title_color black #define text_color black #define focus_color red #define menu_cursor_bg_color blue #define menu_cursor_fg_color white /* Fonts. */ extern struct bogl_pixmap pixmap_tux75; extern struct bogl_font font_helvR10; extern struct bogl_font font_helvB12; extern struct bogl_font font_helvB10; extern struct bogl_font font_timBI18; extern struct bogl_font font_symbol; struct bogl_font *title_font; struct bogl_font *text_font; struct bogl_font *button_font; struct bogl_font *input_font; struct bogl_font *menu_font; #define symbol_font (&font_symbol) /* Symbol font characters. */ #define SYM_UNCHECKED "\1" /* Unchecked check box. */ #define SYM_CHECKED "\2" /* Checked check box. */ #define SYM_UP "\3" /* Up arrow. */ #define SYM_DOWN "\4" /* Down arrow. */ /* Measurements. */ #define horz_margin 5 #define vert_margin 5 #define cursor_width 5 #define window_width (bogl_xres * 3 / 4) #define left_margin ((bogl_xres - window_width) / 2) #define arrow_width 6 /* Prototypes. */ static void *xmalloc (size_t); static void *xrealloc (void *, size_t); static char *xstrdup (const char *); static int flow_text (char **dest, const char *src, int width, const struct bogl_font *font); static void add_widget (struct widget *); static void draw_widget (struct widget *); static void rect_3d (int x1, int y1, int x2, int y2); static int keypress (int ch); static void focus_next (int dir); static int dialogue_result (void); static int mouse (void); static void menu_up (void); static void menu_down (void); static void menu_page_up (void); static void menu_page_down (void); static void menu_draw_item (struct widget *w, int index, int bg); static void menu_draw_cursor (int visible); static int menu_click (int x, int y); static void checkbox_toggle (void); static void input_eol (struct widget *); static void input_insert (int ch); static void input_backspace (void); static void input_delete (void); static void input_kill_fwd (void); static void input_kill_bkwd (void); static void input_kill_word_bkwd (void); static void input_kill_word_fwd (void); static void input_fwd_word (void); static void input_bkwd_word (void); static int input_cursor_left (); static int input_cursor_right (); static int input_bol (void); static void input_visible_width (struct widget *, int *count, int *width); static int input_cursor_width (struct widget *); static int input_cursor_position (struct widget *, int side); static void input_draw_cursor (int visible); static void input_move (int (*func) (void)); #define input_str(W) (*(W)->p.input.string) #define input_ofs(W) ((W)->p.input.offset) #define input_csr(W) ((W)->p.input.cursor) #define input_len(W) ((W)->p.input.length) #define input_field_width(W) ((W)->w - 2 * horz_margin) /* Initialize BOWL fonts */ static void bowl_font_init (void) { if(! title_font) title_font = bogl_read_bdf("helvR10.bdf"); if(! text_font) text_font = bogl_read_bdf("helvR10.bdf"); if(! button_font) button_font = bogl_read_bdf("helvR10.bdf"); if(! input_font) input_font = bogl_read_bdf("helvR10.bdf"); if(! menu_font) menu_font = bogl_read_bdf("helvR10.bdf"); if (!(title_font && text_font && button_font && input_font && menu_font)) { fprintf (stderr, "Error loading fonts: %s\n", bogl_error ()); exit (EXIT_FAILURE); } } /* Set custom colors from a pixmap's palette. */ void bowl_init_palette(struct bogl_pixmap *pix) { int custom = BASIC_COLORS; int i, j; /* Sanity check. */ if(pix->ncols >= 16) return; for(i = 0; i < pix->ncols; i++) { /* Check existing palette. */ for(j = 0; j < BASIC_COLORS; j++) if(pix->palette[i][0] == palette[j][0] && pix->palette[i][1] == palette[i][1] && pix->palette[i][2] == palette[i][2]) { pix_cmap[i] = j; break; } if(j < BASIC_COLORS) continue; /* Too many colors? */ if(custom >= 16) break; palette[custom][0] = pix->palette[i][0]; palette[custom][1] = pix->palette[i][1]; palette[custom][2] = pix->palette[i][2]; pix_cmap[i] = custom; custom++; } } static struct widget *callback_widget; static void callback (int percent) { bowl_set_scale (callback_widget, percent); } /* Start up BOWL. */ void bowl_init (void) { static int inited = 0; extern struct bogl_pointer pointer_arrow; bowl_font_init (); /* Initialize graphics. */ if (!bogl_init ()) { fprintf (stderr, "Error starting graphics: %s\n", bogl_error ()); exit (EXIT_FAILURE); } if (!inited) { bowl_init_palette(&pixmap_tux75); bowl_flush (); if (boml_quick_init () == 0) { bowl_title (_("Please wait")); bowl_new_text (_("Detecting mice...")); callback_widget = bowl_new_scale (100); bowl_layout (); boml_init (callback); } } /* Initialize mouse. */ boml_pointer (&pointer_arrow, ((int []) {black, white})); boml_show (); bowl_flush (); inited = 1; } /* Close down BOWL. */ void bowl_done () { boml_hide (); bogl_done (); } /* Arranges all the widgets on the screen and draws them. */ void bowl_layout (void) { struct widget *w; int y = 0; focus = NULL; y += bogl_font_height (title_font); y += vert_margin; for (w = widgets_head; w; ) { int h = w->h; if (w->type == W_TEXT) { w->x = left_margin + horz_margin; w->y = y; w = w->next; } else { struct widget *x; int n = 0; int i; if (!focus) focus = w; for (x = w; x; x = x->next) if (x->type == w->type) n++; else break; for (i = 0; i < n; i++) { w->x = (window_width * i / n + (window_width / n / 2) - w->w / 2 + left_margin); w->y = y; w = w->next; } } y += h + vert_margin; } wy2 = y; y = (bogl_yres - y) / 2; for (w = widgets_head; w; w = w->next) w->y += y; wx1 = left_margin; wy1 = y; wx2 = left_margin + window_width; wy2 += y; bogl_refresh = 1; bowl_refresh (); } /* Redraw the screen if necessary. */ void bowl_refresh (void) { const char *big_title = "Debian GNU/Linux 2.2 Installation"; struct widget *w; if (!bogl_refresh) { boml_refresh (); return; } bogl_refresh = 0; boml_drawn (0); bogl_set_palette (0, 16, palette); bogl_clear (0, 0, bogl_xres, bogl_yres, wallpaper_color); bogl_put (0, 0, &pixmap_tux75, pix_cmap); bogl_text (55, 0, big_title, (int) strlen (big_title), big_title_color, -1, 0, &font_timBI18); if (!widgets_head) return; bogl_clear (wx1, wy1, wx2, wy2, window_bg_color); rect_3d (wx1, wy1, wx2, wy1 + bogl_font_height (title_font)); rect_3d (wx1, wy1 + bogl_font_height (title_font) + 1, wx2, wy2); bogl_hline (wx1, wx2, wy1 + bogl_font_height (title_font), wallpaper_color); if (title) bogl_text (wx1 + horz_margin, wy1, title, strlen (title), window_title_color, -1, 0, title_font); for (w = widgets_head; w; w = w->next) draw_widget (w); boml_refresh (); } /* Draw and run the dialogue. Returns the command value of the button that ended the dialogue, or -1 if none. */ int bowl_run (void) { const int tty = fileno (stdin); int cursor_on = 1; fd_set fds; FD_ZERO (&fds); for (;;) { struct timeval timeout; timeout.tv_sec = 0; timeout.tv_usec = 500000; bowl_refresh (); FD_SET (tty, &fds); boml_fds (0, &fds); if (select (FD_SETSIZE, &fds, NULL, NULL, &timeout) > 0) { if (FD_ISSET (tty, &fds)) { int n_chars; unsigned char key; cursor_on = 1; if (-1 == ioctl (tty, FIONREAD, &n_chars)) continue; while (n_chars--) if (1 == read (tty, &key, 1)) { if (keypress (key)) return dialogue_result (); } else break; } if (boml_fds (1, &fds)) { boml_refresh (); if (mouse ()) return dialogue_result (); } } else { if (focus->type == W_INPUT) input_draw_cursor (cursor_on ^= 1); } } } /* Clear and free all the widgets on the list. */ void bowl_flush (void) { struct widget *w, *n; grab = NULL; for (w = widgets_head; w; w = n) { n = w->next; switch (w->type) { case W_TEXT: free (w->p.text.text); break; case W_BUTTON: free (w->p.button.label); break; case W_MENU: case W_CHECKBOX: { int i; for (i = 0; i < w->p.menu.length; i++) { if (w->type == W_MENU) free (w->p.menu.tag[i]); free (w->p.menu.item[i]); } if (w->type == W_MENU) { free (w->p.menu.tag); free (w->p.menu.state); } free (w->p.menu.item); } break; case W_SCALE: break; default: abort (); } free (w); } widgets_head = widgets_tail = NULL; free (title); title = NULL; bogl_refresh = 1; default_result = -1; } /* Set the default termination result for this dialogue. A default result of -1 means there is no default. */ void bowl_default (int result) { default_result = result; } /* Add a text widget containing TEXT to the widget list. */ void bowl_new_text (const char *text) { struct widget *w = xmalloc (sizeof (struct widget)); w->type = W_TEXT; w->w = window_width - 2 * horz_margin; w->h = (bogl_font_height (text_font) * flow_text (&w->p.text.text, text, w->w, text_font)); add_widget (w); } /* Add a button with text LABEL and returning COMMAND to the widget list. */ void bowl_new_button (const char *label, int command) { struct widget *w = xmalloc (sizeof (struct widget)); int n = (int) strlen (label); w->type = W_BUTTON; w->w = (bogl_metrics (label, n, button_font) + 2 * horz_margin); w->h = bogl_font_height (button_font) * 3 / 2; w->p.button.label = xstrdup (label); w->p.button.command = command; add_widget (w); } /* Add an input line to the widget list. The string is stored in *STRING. If PROTO is not a null pointer then it will be used as the default contents. */ void bowl_new_input (char **string, const char *proto) { struct widget *w = xmalloc (sizeof (struct widget)); w->type = W_INPUT; w->w = window_width - 2 * horz_margin; w->h = bogl_font_height (input_font) + 6; w->p.input.string = string; *w->p.input.string = xstrdup (proto); w->p.input.length = proto ? strlen (proto) : 0; input_eol (w); add_widget (w); } /* Add a menu to the widget list. The menu has N_ITEMS items, taken from ITEMS. The menu will show at most HEIGHT menu items at once. */ void bowl_new_menu (const struct bowl_menu_item *items, int n_items, int height) { struct widget *w = xmalloc (sizeof (struct widget)); int i; if (height > n_items) height = n_items; w->type = W_MENU; w->w = window_width - 2 * horz_margin; w->h = bogl_font_height (input_font) * height + 6; w->p.menu.tag = xmalloc (sizeof (char *) * n_items); w->p.menu.item = xmalloc (sizeof (char *) * n_items); w->p.menu.state = xmalloc (sizeof (int) * n_items); w->p.menu.tag_width = 0; w->p.menu.length = n_items; w->p.menu.offset = 0; w->p.menu.cursor = 0; w->p.menu.shown = height; for (i = 0; i < n_items; i++) { w->p.menu.tag[i] = xstrdup (items[i].tag); if (w->p.menu.tag[i]) { int width = bogl_metrics (w->p.menu.tag[i], strlen (w->p.menu.tag[i]), menu_font); if (width > w->p.menu.tag_width) w->p.menu.tag_width = width; } w->p.menu.state[i] = items[i].command; } if (w->p.menu.tag_width > 0) w->p.menu.tag_width += horz_margin; for (i = 0; i < n_items; i++) if (items[i].item) { const char *s; int width; width = w->w - horz_margin * 2 - w->p.menu.tag_width - arrow_width; for (s = items[i].item; *s; s++) { int cw = bogl_char_width (*s, menu_font); if (width - cw < 0) break; width -= cw; } w->p.menu.item[i] = xmalloc (s - items[i].item + 1); memcpy (w->p.menu.item[i], items[i].item, s - items[i].item); w->p.menu.item[i][s - items[i].item] = 0; } else w->p.menu.item[i] = NULL; add_widget (w); } /* Add a checkbox group to the widget list. The N checkboxes are labeled as given in CHOICES. Each index into VALUES is ' ' for unchecked or '*' for checked, and their values will be modified by the user's actions. */ void bowl_new_checkbox (char **choices, char *values, int n, int height) { struct widget *w = xmalloc (sizeof (struct widget)); int i; w->type = W_CHECKBOX; w->w = window_width - 2 * horz_margin; w->h = bogl_font_height (input_font) * height + 6; w->p.checkbox.values = values; w->p.checkbox.item = xmalloc (sizeof (char *) * n); w->p.checkbox.tag_width = (bogl_char_width (SYM_CHECKED[0], symbol_font) + horz_margin); w->p.checkbox.length = n; w->p.checkbox.offset = 0; w->p.checkbox.cursor = 0; w->p.checkbox.shown = height; for (i = 0; i < n; i++) { const char *s; int width; width = w->w - horz_margin * 2 - w->p.checkbox.tag_width - arrow_width; for (s = choices[i]; *s; s++) { int cw = bogl_char_width (*s, menu_font); if (width - cw < 0) break; width -= cw; } w->p.checkbox.item[i] = xmalloc (s - choices[i] + 1); memcpy (w->p.checkbox.item[i], choices[i], s - choices[i]); w->p.checkbox.item[i][s - choices[i]] = 0; } add_widget (w); } /* Add a scale to the widget list and return it. The scale goes from 0 to MAX. */ struct widget * bowl_new_scale (long long max) { struct widget *w = xmalloc (sizeof (struct widget)); w->type = W_SCALE; w->w = (window_width - horz_margin * 2) / 2; w->h = bogl_font_height (text_font) * 2; w->p.scale.value = 0; w->p.scale.max = max; add_widget (w); return w; } /* Make S the dialogue title. */ void bowl_title (const char *s) { const char *p; int w; p = s; w = 0; while (*p) { w += bogl_char_width (*p, title_font); if (w > window_width - horz_margin * 2) break; p++; } free (title); title = NULL; title = xmalloc (p - s + 1); memcpy (title, s, p - s); title[p - s] = 0; } /* Utilities. */ /* Routine to flow text, copying from TEXT to DEST while inserting newlines where needed. Allocates *DEST automatically. TEXT is in font FONT. It's so nice to be able to make _simple_ assumptions. This is a piece of cake after other programs I've written that need to do kerning, ligatures, full justification, multiple fonts, ... */ static int flow_text (char **dest, const char *text, int width, const struct bogl_font *font) { /* Current destination pointer. */ char *d; /* Beginning, end of source line. */ const char *s, *p; /* Cumulative width; number of lines. */ int w, nl; *dest = xmalloc (strlen (text) + 128); d = *dest; s = p = text; w = nl = 0; for (;;) { /* Handle end-of-string and end-of-line. */ if (*p == 0) { if (p != s) { memcpy (d, s, p - s); d += p - s; *d++ = '\n'; } *d = 0; return nl + 1; } else if (*p == '\n') { memcpy (d, s, p - s + 1); d += p - s + 1; s = ++p; nl++; w = 0; continue; } /* Add a character if it will fit. */ { int cw; cw = bogl_char_width (*p, font); if (w + cw <= width) { w += cw; p++; continue; } } /* Output a line. */ { int no_wrap = 0; { const char *sp = p; while (p > s && !isspace ((unsigned char) p[-1])) p--; while (p > s && isspace ((unsigned char) p[-1])) p--; if (p == s) { no_wrap = 1; p = sp - 1; } assert (p != s); } /* Copy the text into the destination string. */ memcpy (d, s, p - s); d += p - s; *d++ = '\n'; /* Advance to the next line. */ if (no_wrap) p++; else while (isspace ((unsigned char) *p)) p++; w = 0; s = p; nl++; } } } /* Out of memory. Give up. */ static void out_of_memory (void) { fprintf (stderr, "virtual memory exhausted\n"); abort (); } /* Allocate AMT bytes of memory and make sure it succeeded. */ void * xmalloc (size_t size) { void *p; if (size == 0) return 0; p = malloc (size); if (!p) out_of_memory (); return p; } /* Reallocate BLOCK to AMT bytes in size and make sure it succeeded. */ void * xrealloc (void *p, size_t size) { if (p == NULL) return xmalloc (size); if (size == 0) { free (p); return NULL; } p = realloc (p, size); if (!p) out_of_memory (); return p; } /* Make a copy of string S and return a pointer to it. If S is null, returns a null pointer. */ char * xstrdup (const char *s) { if (s) { size_t size = strlen (s) + 1; char *p = xmalloc (size); memcpy (p, s, size); return p; } else return NULL; } /* Add the specified widget W to the widget list. */ static void add_widget (struct widget *w) { if (widgets_head == NULL) { widgets_head = widgets_tail = w; w->next = w->prev = NULL; } else { w->prev = widgets_tail; w->next = NULL; widgets_tail = widgets_tail->next = w; } } static void rect_3d (int x1, int y1, int x2, int y2) { bogl_hline (x1, x2 - 1, y1, white); bogl_vline (x1, y1, y2 - 1, white); bogl_hline (x1 + 1, x2, y2 - 1, black); bogl_vline (x2 - 1, y1 + 1, y2, black); bogl_pixel (x1, y2 - 1, gray); bogl_pixel (x2 - 1, y1, gray); } /* Draw the specified widget W. */ static void draw_widget (struct widget *w) { boml_hide (); switch (w->type) { case W_TEXT: { int y = w->y; char *p; p = w->p.text.text; for (;;) { char *e = strchr (p, '\n'); if (!e) break; bogl_text (w->x, y, p, e - p, text_color, -1, 0, text_font); y += bogl_font_height (text_font); p = e + 1; } } break; case W_BUTTON: bogl_clear (w->x, w->y, w->x + w->w, w->y + w->h, window_bg_color); if (w == focus) bogl_rectangle (w->x + 2, w->y + 2, w->x + w->w - 2, w->y + w->h - 2, focus_color); rect_3d (w->x, w->y, w->x + w->w, w->y + w->h); bogl_text (w->x + horz_margin, w->y + bogl_font_height (button_font) / 4, w->p.button.label, (int) strlen (w->p.button.label), text_color, -1, 0, button_font); w->p.button.focused = (w == focus); break; case W_INPUT: { int count; int width; rect_3d (w->x, w->y, w->x + w->w, w->y + w->h); bogl_clear (w->x + 1, w->y + 1, w->x + w->w - 2, w->y + w->h - 2, window_bg_color); if (w == focus) bogl_rectangle (w->x + 2, w->y + 2, w->x + w->w - 2, w->y + w->h - 2, focus_color); input_visible_width (w, &count, &width); bogl_text (w->x + horz_margin, w->y + 3, &input_str (w)[input_ofs (w)], count, text_color, -1, 0, input_font); if (w == focus) input_draw_cursor (1); } break; case W_MENU: case W_CHECKBOX: { int i; rect_3d (w->x, w->y, w->x + w->w, w->y + w->h); bogl_clear (w->x + 1, w->y + 1, w->x + w->w - 2, w->y + w->h - 2, window_bg_color); if (w == focus) bogl_rectangle (w->x + 2, w->y + 2, w->x + w->w - 2, w->y + w->h - 2, focus_color); for (i = w->p.menu.offset; i < w->p.menu.offset + w->p.menu.shown; i++) menu_draw_item (w, i, i == w->p.menu.cursor ? menu_cursor_bg_color : -1); if (w->p.menu.offset) bogl_text (w->x + w->w - horz_margin - arrow_width, w->y + 3, SYM_UP, 1, text_color, -1, 0, symbol_font); if (w->p.menu.offset + w->p.menu.shown < w->p.menu.length) bogl_text (w->x + w->w - horz_margin - arrow_width, (w->y + 3 + bogl_font_height (text_font) * (w->p.menu.shown - 1)), SYM_DOWN, 1, text_color, -1, 0, symbol_font); } break; case W_SCALE: { bogl_clear (w->x, w->y, w->x + w->w, w->y + w->h, window_bg_color); { long long amt = w->p.scale.value * w->w / w->p.scale.max; if (amt > 0) rect_3d (w->x, w->y, w->x + amt, w->y + w->h); } { char percent[16]; int width; sprintf (percent, "%d%%", (int) (w->p.scale.value * 100ll / w->p.scale.max)); width = bogl_metrics (percent, strlen (percent), text_font); bogl_text (w->x + w->w / 2 - width / 2, w->y + w->h / 2 - bogl_font_height (text_font) / 2, percent, strlen (percent), text_color, -1, 0, text_font); } } break; default: abort (); } boml_show (); } /* The user pressed a key. The character received was CH. Returns nonzero only if the dialogue with the user is over. */ static int keypress (int ch) { static int state = 0; static int accum; switch (state) { case 0: if (ch == '\e') state = 1; else if (ch == '\t') focus_next (1); else if (ch == '\r' && (focus->type == W_BUTTON || (focus->type == W_MENU && focus->p.menu.state[focus->p.menu.cursor] != -1) || default_result != -1)) return 1; else if (ch == 'V' - 64 && (focus->type == W_MENU || focus->type == W_CHECKBOX)) menu_page_down (); else if (focus->type == W_INPUT) { if (ch == '\x7f') { input_backspace (); draw_widget (focus); } else if (ch >= 32 && ch <= 126) input_insert (ch); else if (ch == 'A' - 64) input_move (input_bol); else if (ch == 'B' - 64) input_move (input_cursor_left); else if (ch == 'D' - 64) { input_delete (); draw_widget (focus); } else if (ch == 'E' - 64) { input_eol (focus); draw_widget (focus); } else if (ch == 'F' - 64) input_move (input_cursor_right); else if (ch == 'K' - 64) input_kill_fwd (); else if (ch == 'U' - 64) input_kill_bkwd (); } else if (ch == '\x7f') focus_next (-1); else if (focus->type == W_CHECKBOX && ch == ' ') checkbox_toggle (); else if (focus->type == W_BUTTON && ch == ' ') return 1; break; case 1: state = 0; if (ch == '[') state = 2; else if (focus->type == W_INPUT) switch (ch) { case 'b': input_bkwd_word (); break; case 'd': input_kill_word_fwd (); break; case 'f': input_fwd_word (); break; case '\x7f': input_kill_word_bkwd (); break; } else if (focus->type == W_MENU || focus->type == W_CHECKBOX) switch (ch) { case 'v': menu_page_up (); break; } break; case 2: state = 0; if ((focus->type == W_MENU || focus->type == W_CHECKBOX) && ch == 'A') menu_up (); else if ((focus->type == W_MENU || focus->type == W_CHECKBOX) && ch == 'B') menu_down (); else if (focus->type == W_INPUT && ch == 'C') input_move (input_cursor_right); else if (focus->type == W_INPUT && ch == 'D') input_move (input_cursor_left); else if (ch == 'A' || ch == 'D') focus_next (-1); else if (ch == 'B' || ch == 'C') focus_next (1); else { if (ch >= '0' && ch <= '9') { accum = ch - '0'; state = 3; } } break; case 3: state = 0; if (ch >= '0' && ch <= '9') { accum = accum * 10 + ch - '0'; state = 3; } else if (ch == '~') { if (focus->type == W_INPUT) switch (accum) { case 1: input_move (input_bol); break; case 3: input_delete (); draw_widget (focus); break; case 4: input_eol (focus); draw_widget (focus); break; } else if (accum == 3) focus_next (-1); else if (focus->type == W_MENU || focus->type == W_CHECKBOX) switch (accum) { case 5: menu_page_up (); break; case 6: menu_page_down (); break; } } break; default: abort (); } return 0; } /* Sets the focused widget to W, if that's appropriate. */ static void focus_widget (struct widget *w) { struct widget *old_focus = focus; if (w == focus || w == NULL || w->type == W_TEXT) return; focus = w; boml_hide (); draw_widget (old_focus); draw_widget (focus); boml_show (); } /* Moves the focus to the next control, if DIR > 0, or to the previous control, if DIR < 0. */ static void focus_next (int dir) { struct widget *w; w = focus; if (w == NULL) return; do { if (dir > 0) { w = w->next; if (w == NULL) w = widgets_head; } else { w = w->prev; if (w == NULL) w = widgets_tail; } } while (w->type == W_TEXT); focus_widget (w); } /* Returns the command value of the button that caused the dialogue to terminate. */ static int dialogue_result (void) { if (focus->type == W_BUTTON) return focus->p.button.command; else if (focus->type == W_MENU) return focus->p.menu.state[focus->p.menu.cursor]; else return default_result; return -1; } /* Mouse handling functions. */ /* Returns 1 if (X,Y) lies inside widget W, 0 otherwise. */ static int point_in_widget (struct widget *w, int x, int y) { return (x >= w->x && x < w->x + w->w && y >= w->y && y < w->y + w->h); } /* Find the widget that contains the specified pixel. Returns NULL if no widget contains that pixel. */ static struct widget * find_widget_at (int x, int y) { struct widget *w; for (w = widgets_head; w; w = w->next) if (point_in_widget (w, x, y)) return w; return NULL; } /* Draw widget W, but as if it had the focus if F != 0 or as if it didn't have the focus if F == 0. */ static void draw_as_focused (struct widget *w, int f) { struct widget *old_focus = focus; if (f) focus = w; else focus = NULL; draw_widget (w); focus = old_focus; } /* Process all mouse events in the queue. Returns 1 if the dialogue interaction is now complete. */ static int mouse (void) { for (;;) { int event, x, y, btn; event = boml_event (&x, &y, &btn); if (event == BOML_E_NONE) return 0; if (grab) { switch (event) { case BOML_E_MOVE: if (point_in_widget (grab, x, y) ^ grab->p.button.focused) draw_as_focused (grab, !grab->p.button.focused); break; case BOML_E_RELEASE: grab = NULL; draw_widget (focus); if (point_in_widget (focus, x, y)) return 1; break; } continue; } switch (event) { case BOML_E_PRESS: { /* Click to focus. */ struct widget *w = find_widget_at (x, y); focus_widget (w); if (focus != w) continue; if (w->type == W_BUTTON) grab = w; else if (w->type == W_MENU || w->type == W_CHECKBOX) { if (menu_click (x - w->x, y - w->y)) return 1; } } break; } } } /* Input line utilities. */ /* Move to the end of the line. */ static void input_eol (struct widget *w) { int width = 0; input_csr (w) = input_ofs (w) = input_len (w); width = cursor_width; while (input_ofs (w) > 0) { int cw = bogl_char_width (input_str (w)[input_ofs (w) - 1], input_font); if (cw + width > input_field_width (w)) break; width += cw; input_ofs (w)--; } } /* Calculate the number of characters visible in input line widget W. The number of characters is stored into *COUNT, and their width into *WIDTH. */ void input_visible_width (struct widget *w, int *count, int *width) { int i; *count = 0; *width = 0; for (i = input_ofs (w); i < input_len (w); i++) { int cw = bogl_char_width (input_str (w)[i], input_font); if (*width + cw > input_field_width (w)) break; *width += cw; (*count)++; } } /* Calculates and returns the width of the cursor for the focused input line. */ int input_cursor_width (struct widget *w) { if (input_csr (w) < input_len (w)) return bogl_char_width (input_str (w)[input_csr (w)], input_font); else return cursor_width; } /* Calculates and returns the horizontal offset of the the cursor from the left side of the cursor field in input widget W. If SIDE is zero then the the offset of the left side of the cursor is returned, otherwise the right side. */ int input_cursor_position (struct widget *w, int side) { int width = bogl_metrics (&input_str (w)[input_ofs (w)], input_csr (w) - input_ofs (w), input_font); if (side) width += input_cursor_width (w); return width; } /* Move the cursor right. Returns nonzero if the display is scrolled. */ static int input_cursor_right (void) { int adjust_ofs = 0; int width; if (input_csr (focus) >= input_len (focus)) return 0; input_csr (focus)++; width = input_cursor_position (focus, 1); while (width > input_field_width (focus)) { width -= bogl_char_width (input_str (focus)[input_ofs (focus)], input_font); input_ofs (focus)++; adjust_ofs = 1; } return adjust_ofs; } /* Move the cursor left. Returns nonzero if the display is scrolled. */ static int input_cursor_left (void) { if (input_csr (focus) == 0) return 0; input_csr (focus)--; if (input_csr (focus) < input_ofs (focus)) { input_ofs (focus) = input_csr (focus); return 1; } else return 0; } /* Insert the specified character in the line of the focused input line, and update the display. */ static void input_insert (int ch) { input_str (focus) = xrealloc (input_str (focus), input_len (focus) + 1); memmove (&input_str (focus)[input_csr (focus) + 1], &input_str (focus)[input_csr (focus)], input_len (focus) - input_csr (focus)); input_str (focus)[input_csr (focus)] = ch; input_len (focus)++; input_cursor_right (); draw_widget (focus); } /* Backspace the focused input line and update the display. */ static void input_backspace (void) { if (input_csr (focus) == 0) return; memmove (&input_str (focus)[input_csr (focus) - 1], &input_str (focus)[input_csr (focus)], input_len (focus) - input_csr (focus)); input_len (focus)--; input_cursor_left (); } /* Delete the focused input line and update the display. */ static void input_delete (void) { if (input_csr (focus) >= input_len (focus)) return; memmove (&input_str (focus)[input_csr (focus)], &input_str (focus)[input_csr (focus) + 1], input_len (focus) - input_csr (focus)); input_len (focus)--; } /* Delete from the cursor to the end of the line, and update the display. */ static void input_kill_fwd (void) { if (input_csr (focus) >= input_len (focus)) return; input_len (focus) = input_csr (focus); draw_widget (focus); } /* Delete from the cursor to the beginning of the line, and update the display. */ static void input_kill_bkwd (void) { input_len (focus) -= input_csr (focus); memmove (input_str (focus), &input_str (focus)[input_csr (focus)], input_len (focus) + 1); input_csr (focus) = 0; draw_widget (focus); } /* Return nonzero iff the character at position P relative to the cursor position is part of a word. */ static int input_csr_is_word (int p) { int ch = input_str (focus)[input_csr (focus) + p]; return ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || ch > 127); } /* Move the cursor forward a word and update the display. */ static void input_fwd_word (void) { int redraw = 0; boml_hide (); input_draw_cursor (0); while (input_csr (focus) < input_len (focus) && !input_csr_is_word (0)) redraw |= input_cursor_right (); while (input_csr (focus) < input_len (focus) && input_csr_is_word (0)) redraw |= input_cursor_right (); if (redraw) draw_widget (focus); else input_draw_cursor (1); boml_show (); } /* Move the cursor backward a word and update the display. */ static void input_bkwd_word (void) { int redraw = 0; boml_hide (); input_draw_cursor (0); input_cursor_left (); if (input_csr (focus) == 0) return; while (input_csr (focus) > 0 && !input_csr_is_word (0)) redraw |= input_cursor_left (); while (input_csr (focus) > 0 && input_csr_is_word (-1)) redraw |= input_cursor_left (); if (redraw) draw_widget (focus); else input_draw_cursor (1); boml_show (); } /* Delete word behind the cursor. */ static void input_kill_word_bkwd (void) { while (input_csr (focus) > 0 && !input_csr_is_word (-1)) input_backspace (); while (input_csr (focus) > 0 && input_csr_is_word (-1)) input_backspace (); draw_widget (focus); } /* Delete word in front of the cursor. */ static void input_kill_word_fwd (void) { while (input_csr (focus) < input_len (focus) && !input_csr_is_word (0)) input_delete (); while (input_csr (focus) < input_len (focus) && input_csr_is_word (0)) input_delete (); draw_widget (focus); } /* Draw the cursor, if VISIBLE != 0, or erase it, if VISIBLE == 0. */ static void input_draw_cursor (int visible) { int cursor_x; int fg, bg; if (visible) fg = window_bg_color, bg = text_color; else fg = text_color, bg = window_bg_color; cursor_x = focus->x + horz_margin + input_cursor_position (focus, 0); boml_hide (); if (focus->p.input.cursor < focus->p.input.length) { char cursor[2]; cursor[0] = input_str (focus)[input_csr (focus)]; cursor[1] = '\0'; bogl_text (cursor_x, focus->y + 3, cursor, 1, fg, bg, 0, input_font); } else bogl_clear (cursor_x, focus->y + 3, cursor_x + cursor_width, focus->y + 3 + bogl_font_height (input_font), bg); boml_show (); } /* Move to the beginning of the input line. Return nonzero if scrolled. */ static int input_bol (void) { input_csr (focus) = 0; if (input_ofs (focus)) { input_ofs (focus) = 0; return 1; } else return 0; } /* Calls FUNC and redraws the entire widget if FUNC returns nonzero, or just the cursor otherwise. */ static void input_move (int (*func) (void)) { boml_hide (); input_draw_cursor (0); if (func ()) draw_widget (focus); else input_draw_cursor (1); boml_show (); } /* Menu utilities. */ /* Draw menu item INDEX for menu widget W with background color BG. */ static void menu_draw_item (struct widget *w, int index, int bg) { int fg; int y; boml_hide (); y = w->y + 3 + bogl_font_height (menu_font) * (index - w->p.menu.offset); fg = text_color; if (bg != -1) { bogl_clear (w->x + horz_margin, y, w->x + w->w - horz_margin - arrow_width, y + bogl_font_height (menu_font), bg); if (bg == menu_cursor_bg_color) fg = menu_cursor_fg_color; } if (w->type == W_MENU) { if (w->p.menu.tag[index]) bogl_text (w->x + horz_margin, y, w->p.menu.tag[index], strlen (w->p.menu.tag[index]), fg, -1, 0, menu_font); } else /* W_CHECKBOX */ { char *s; s = w->p.checkbox.values[index] == '*' ? SYM_CHECKED : SYM_UNCHECKED; bogl_text (w->x + horz_margin, y, s, 1, fg, -1, 0, symbol_font); } if (w->p.menu.item[index]) bogl_text (w->x + horz_margin + w->p.menu.tag_width, y, w->p.menu.item[index], strlen (w->p.menu.item[index]), fg, -1, 0, menu_font); boml_show (); } /* Draws the cursor for the focused menu if VISIBLE != 0, or erases the cursor if VISIBLE == 0. */ static void menu_draw_cursor (int visible) { menu_draw_item (focus, focus->p.menu.cursor, visible ? menu_cursor_bg_color : window_bg_color); } /* Move the focused menu's cursor to LOC. */ static void menu_move_cursor (int loc) { boml_hide (); menu_draw_cursor (0); focus->p.menu.cursor = loc; menu_draw_cursor (1); boml_show (); } /* Move up one item on the focused menu. */ static void menu_up (void) { if (focus->p.menu.cursor == 0) return; if (focus->p.menu.cursor == focus->p.menu.offset) { focus->p.menu.cursor--; focus->p.menu.offset--; draw_widget (focus); } else menu_move_cursor (focus->p.menu.cursor - 1); } /* Move down one item on the focused menu. */ static void menu_down (void) { if (focus->p.menu.cursor == focus->p.menu.length - 1) return; if (focus->p.menu.cursor == focus->p.menu.offset + focus->p.menu.shown - 1) { focus->p.menu.cursor++; focus->p.menu.offset++; draw_widget (focus); } else menu_move_cursor (focus->p.menu.cursor + 1); } /* Move up an entire page on the focused menu. */ static void menu_page_up (void) { if (focus->p.menu.cursor == 0) return; if (focus->p.menu.cursor != focus->p.menu.offset) menu_move_cursor (focus->p.menu.offset); else { focus->p.menu.offset -= focus->p.menu.shown; if (focus->p.menu.offset < 0) focus->p.menu.offset = 0; focus->p.menu.cursor = focus->p.menu.offset; draw_widget (focus); } } /* Move down an entire page on the focused menu. */ static void menu_page_down (void) { if (focus->p.menu.cursor == focus->p.menu.length - 1) return; if (focus->p.menu.cursor != focus->p.menu.offset + focus->p.menu.shown - 1) menu_move_cursor (focus->p.menu.offset + focus->p.menu.shown - 1); else { focus->p.menu.offset += focus->p.menu.shown; if (focus->p.menu.offset > focus->p.menu.length - focus->p.menu.shown) focus->p.menu.offset = focus->p.menu.length - focus->p.menu.shown; focus->p.menu.cursor = focus->p.menu.offset + focus->p.menu.shown - 1; draw_widget (focus); } } /* Subtract the `struct timeval' values X and Y, storing the result in RESULT. Return 1 if the difference is negative, otherwise 0. */ int timeval_subtract (struct timeval *result, struct timeval *x, struct timeval *y) { /* Perform the carry for the later subtraction by updating Y. */ if (x->tv_usec < y->tv_usec) { int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1; y->tv_usec -= 1000000 * nsec; y->tv_sec += nsec; } if (x->tv_usec - y->tv_usec > 1000000) { int nsec = (y->tv_usec - x->tv_usec) / 1000000; y->tv_usec += 1000000 * nsec; y->tv_sec -= nsec; } /* Compute the time remaining to wait. `tv_usec' is certainly positive. */ result->tv_sec = x->tv_sec - y->tv_sec; result->tv_usec = x->tv_usec - y->tv_usec; /* Return 1 if result is negative. */ return x->tv_sec < y->tv_sec; } /* The menu has been clicked at (X,Y) relative to the menu's location. Returns nonzero if a menu selection is made. */ static int menu_click (int x, int y) { int loc; if (x >= focus->w - horz_margin - arrow_width) { if (y >= 3 && y < bogl_font_height (menu_font) + 3) menu_up (); else if (y >= 3 + (bogl_font_height (menu_font) * (focus->p.menu.shown - 1)) && y <= 3 + bogl_font_height (menu_font) * focus->p.menu.shown) menu_down (); return 0; } loc = focus->p.menu.offset + y / bogl_font_height (menu_font); if (loc < 0) loc = 0; else if (loc >= focus->p.menu.length) loc = focus->p.menu.length - 1; { static struct timeval last; struct timeval this; gettimeofday (&this, NULL); if (loc != focus->p.menu.cursor) menu_move_cursor (loc); else if (focus->type == W_MENU) { /* Detect double-click. */ struct timeval diff; if (!timeval_subtract (&diff, &this, &last) && diff.tv_sec == 0 && diff.tv_sec < 400000) return 1; } last = this; } if (focus->type == W_CHECKBOX && x < focus->p.checkbox.tag_width) checkbox_toggle (); return 0; } /* Checkbox functions. */ static void checkbox_toggle (void) { char *s; boml_hide (); if (focus->p.checkbox.values[focus->p.checkbox.cursor] == '*') { focus->p.checkbox.values[focus->p.checkbox.cursor] = ' '; s = SYM_UNCHECKED; } else { focus->p.checkbox.values[focus->p.checkbox.cursor] = '*'; s = SYM_CHECKED; } bogl_text (focus->x + horz_margin, (focus->y + 3 + (bogl_font_height (menu_font) * (focus->p.checkbox.cursor - focus->p.checkbox.offset))), s, 1, menu_cursor_fg_color, menu_cursor_bg_color, 0, symbol_font); boml_show (); } /* Scale functions. */ void bowl_set_scale (struct widget *w, long long value) { if (w->p.scale.value == value) { bowl_refresh (); return; } w->p.scale.value = value; if (bogl_refresh) bowl_refresh (); else draw_widget (w); } bogl-0.1.18/Makefile0000644000000000000000000000672611407777275011106 0ustar LIBS = -lc LIB = libbogl.a DEVLINK = libbogl.so SONAME = libbogl.so.0 SHARED_LIB = libbogl.so.0.1 CFLAGS = -O2 -g -D_GNU_SOURCE WARNCFLAGS += -Wall -D_GNU_SOURCE ALLCFLAGS = $(CFLAGS) $(WARNCFLAGS) $(FBCFLAGS) architecture := $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU) LIBOBJECTS = $(LIBBOGLOBJECTS) $(LIBBOMLOBJECTS) $(LIBBOWLOBJECTS) \ $(LIBRSRCOBJECTS) LIBBOGLOBJECTS = bogl.o bogl-font.o LIBBOMLOBJECTS = arrow.o boml.o LIBBOWLOBJECTS = bowl.o symbol.o LIBRSRCOBJECTS = helvB10.o helvB12.o helvR10.o timBI18.o tux75.o SOURCES_DEP = arrow.c bdftobogl.c bogl-cfb.c bogl-cfb.h bogl-cfb8.c \ bogl-cfb8.h bogl-font.c bogl-font.h bogl-pcfb.c bogl-pcfb.h \ bogl-tcfb.c bogl-tcfb.h bogl-test.c bogl.c bogl.h boglP.h boml.c \ boml.h bowl-boxes.c bowl.c bowl.h pngtobogl.c ifeq (,) FBCFLAGS += -DBOGL_CFB_FB=1 LIBBOGLOBJECTS += bogl-cfb.o bogl-pcfb.o bogl-tcfb.o endif ifneq (,$(filter i386 arm ia64 amd64,$(architecture))) FBCFLAGS += -DBOGL_VGA16_FB=1 LIBBOGLOBJECTS += bogl-vga16.o SOURCES_DEP += bogl-vga16.c bogl-vga16.h endif OBJECTS = $(LIBOBJECTS) bowl-boxes.o GENERATED = helvB10.c helvB12.c helvR10.c timBI18.c tux75.c # libutf8/libutf8_plug.so unifont-reduced.bgf all: depend $(SHARED_LIB) $(LIB) bterm bdftobogl reduce-font %.lo: %.c $(CC) $(ALLCFLAGS) -o $@ -fPIC -c $< %.o: %.c $(CC) $(ALLCFLAGS) -o $@ -c $< $(SHARED_LIB): $(OBJECTS:%.o=%.lo) $(CC) -shared -Wl,-soname,$(SONAME) -o $(SHARED_LIB) $(OBJECTS:%.o=%.lo) # unifont-reduced.bgf: bdftobogl unifont-reduced.bdf # ./bdftobogl -b unifont-reduced.bdf > unifont-reduced.bgf # unifont-reduced.bdf: ../bf-utf/unifont.bdf ../all.utf libutf8/libutf8_plug.so reduce-font # LD_PRELOAD=./libutf8/libutf8_plug.so LC_CTYPE=C.UTF-8 ./reduce-font $< < ../all.utf > $@ # ../all.utf: ../po.utf ../rn.utf $(xml_files) # cat $^ > $@ # ../po.utf: # $(MAKE) -C ../dbootstrap/po all-po-utf # cat ../dbootstrap/po/utf/*.po > $@ # ../rn.utf: # $(MAKE) RN_TARGET_DIR=. -C ../../scripts/rootdisk/messages install-utf # cat ../../scripts/rootdisk/messages/release_notes.* > $@ reduce-font: reduce-font.c $(LIB): $(OBJECTS) rm -f $(LIB) ar rcs $(LIB) $(OBJECTS) bogl-test: $(LIB) bogl-test.c tux75.o $(CC) $(ALLCFLAGS) -o bogl-test bogl-test.c tux75.o $(LIB) bowl-boxes: $(LIB) $(CC) -DSTANDALONE_TEST $(ALLCFLAGS) bowl-boxes.c $(LIBOBJECTS) -o bowl-boxes bterm: $(LIB) bterm.o bogl-term.o bogl-bgf.o $(CC) $+ $(LIB) -o bterm bdftobogl: $(LIBBOGLOBJECTS) %.c: %.bdf bdftobogl ./bdftobogl $< > $@ pngtobogl: pngtobogl.o $(CC) $(ALLCFLAGS) -o pngtobogl pngtobogl.o -lgd -lpng -lm %.c: %.png pngtobogl ./pngtobogl $< > $@ depend: .depend .depend: $(SOURCES_DEP) $(CPP) $(ALLCFLAGS) -M $(SOURCES_DEP) > .depend clean: rm -rf reduce-font bterm bdftobogl pngtobogl *.o $(GENERATED) *-test lang.h tmp.*.c bowl-boxes $(LIB) unifont-reduced.bgf unifont-reduced.bdf rm -f $(OBJECTS:%.o=%.lo) $(SHARED_LIB) rm -f .depend distclean: clean rm -f $(LIB) .depend *~ .nfs* force: ifeq (.depend,$(wildcard .depend)) include .depend endif install: all install -d $(DESTDIR)/usr/lib $(DESTDIR)/usr/include/bogl $(DESTDIR)/usr/bin install -m644 $(SHARED_LIB) $(DESTDIR)/usr/lib/$(SHARED_LIB) ln -s $(SHARED_LIB) $(DESTDIR)/usr/lib/$(DEVLINK) ln -s $(SHARED_LIB) $(DESTDIR)/usr/lib/$(SONAME) install -m644 $(LIB) $(DESTDIR)/usr/lib/$(LIB) install -m644 *.h $(DESTDIR)/usr/include/bogl install -m755 bdftobogl mergebdf bterm pngtobogl reduce-font $(DESTDIR)/usr/bin install -d $(DESTDIR)/usr/share/terminfo tic -o$(DESTDIR)/usr/share/terminfo bterm.ti bogl-0.1.18/tux75.gif0000644000000000000000000000207511407777275011122 0ustar GIF89aKXu9aR9m 8.!Made with GIMP!,KXI譱`("\Yh즾Բ\PwE |@D `l:6*n: LvX!46k`'wJc,F~viz{w~F%t,o&"w rwyYǤ.C2xIXGj-c߻tj#VwOӫt6R;V 8S~(ε515qJ> i%3n: nJ, r۟>)@8gWܚ+Մa7%+nĶ-ctx z Ġ^vg*SCzJ)8Dϝ̇pjUf-ֶdvu)d{LXm8QU/6;:]5vF}?{;y 7W] insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME bdftobogl - bogl/bterm font convertor .SH SYNOPSIS .B bdftobogl .RI font.bdf > .RI font.c .B bdftobogl .B -b .RI font.bdf > .RI font.bgf .SH DESCRIPTION .B bdftobogl is a conversion program for .B BOGL fonts. By default it generates a C source file containing the converted .B BDF font. .SH OPTIONS .TP .B -b Generate a .B .bgf font (for \f[B]bterm\f[R]) instead of C source. .SH NOTES On Debian systems, one appropriate BDF font can be found in the .B bf-utf-source package. .SH SEE ALSO .BR bterm (1) .SH AUTHOR This manual page was written by Daniel Jacobowitz . bogl-0.1.18/bogl-cfb8.h0000644000000000000000000000276011407777275011354 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef bogl_cfb8_h #define bogl_cfb8_h #include size_t bogl_cfb8_init (); void bogl_cfb8_pixel (int x, int y, int c); void bogl_cfb8_hline (int x1, int x2, int y, int c); void bogl_cfb8_vline (int x, int y1, int y2, int c); void bogl_cfb8_text (int x, int y, const char *s, int n, int fg, int bg, struct bogl_font *font); void bogl_cfb8_clear (int x1, int y1, int x2, int y2, int c); void bogl_cfb8_move (int sx, int sy, int dx, int dy, int w, int h); void bogl_cfb8_put (int x, int y, const struct bogl_pixmap *pixmap, const int color_map[16]); void bogl_cfb8_pointer (int visible, int x1, int y1, const struct bogl_pointer *pointer, int colors[2]); #endif /* bogl_cfb8_h */ bogl-0.1.18/bogl.h0000644000000000000000000000720611407777275010534 0ustar /* BOGL - Ben's Own Graphics Library. Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef bogl_h #define bogl_h #include #include /* As a temporary measure, we do this here rather than in config.h, which would probably make more sense. */ #include #ifndef MB_LEN_MAX #define MB_LEN_MAX 6 /* for UTF-8 */ #endif /* Proportional font structure definition. */ struct bogl_font { char *name; /* Font name. */ int height; /* Height in pixels. */ int index_mask; /* ((1 << N) - 1). */ int *offset; /* (1 << N) offsets into index. */ int *index; /* An index entry consists of ((wc & ~index_mask) | width) followed by an offset into content. A list of such entries is terminated by the value 0. */ u_int32_t *content; /* 32-bit right-padded bitmap array. The bitmap for a single glyph consists of (height * ((width + 31) / 32)) values. */ wchar_t default_char; }; /* Pixmap structure definition. */ struct bogl_pixmap { int width, height; /* Width, height in pixels. */ int ncols; /* Number of colors. */ int transparent; /* Transparent color or -1 if none. */ unsigned char (*palette)[3]; /* Palette. */ unsigned char *data; /* Run-length compressed data. */ }; /* Pointer structure definition. */ struct bogl_pointer { int hx, hy; /* Hot spot. */ unsigned short mask[16]; /* Drawing mask: 0=clear, 1=drawn. */ unsigned short color[16]; /* Pixel colors: 0=black, 1=white. */ }; /* Screen parameters. */ extern int bogl_xres, bogl_yres, bogl_ncols; /* 1=Must refresh screen due to tty change. */ extern int bogl_refresh; /* Generic routines. */ int bogl_init (void); void bogl_done (void); const char *bogl_error (void); void bogl_gray_scale (int make_gray); void bogl_fb_set_palette (int c, int nc, const unsigned char palette[][3]); void bogl_rectangle (int x1, int y1, int x2, int y2, int c); int bogl_metrics (const char *s, int n, const struct bogl_font *font); /* Font access. */ #define bogl_font_height(FONT) ((FONT)->height) int bogl_font_glyph (const struct bogl_font *font, wchar_t wc, u_int32_t **bitmap); int bogl_in_font (const struct bogl_font *font, wchar_t wc); /* Device-specific routines. */ void (*bogl_pixel) (int x, int y, int c); void (*bogl_hline) (int x1, int x2, int y, int c); void (*bogl_vline) (int x, int y1, int y2, int c); void (*bogl_text) (int x, int y, const char *s, int n, int fg, int bg, int ul, const struct bogl_font *font); void (*bogl_clear) (int x1, int y1, int x2, int y2, int c); void (*bogl_move) (int sx, int sy, int dx, int dy, int w, int h); void (*bogl_put) (int x, int y, const struct bogl_pixmap *pixmap, const int color_map[16]); void (*bogl_pointer) (int visible, int x, int y, const struct bogl_pointer *, int colors[2]); void (*bogl_set_palette) (int c, int nc, const unsigned char palette[][3]); void (*bogl_reinit) (void); #endif /* bogl_h */ bogl-0.1.18/README.BOGL-bterm0000644000000000000000000001034711407777275012151 0ustar By Edmund GRIMLEY EVANS Amended by Adam Di Carlo Updated by Marcin Owsiany libutf8 can be found in boot-floppies CVS module now, in 'utilities/bf-utf' directory I haven't made the file UTF-8-test; instead do echo -e "\304\211" to get a 'c' with hat, for example. System requirements I don't know what the requirements are, but this is what I'm using: kernel 2.2.14, which I compiled myself and configured to use the framebuffer console. My /etc/lilo.conf contains the line "vga=771". I have a cheap motherboard with a Cyrix "i686" processor and on-board graphics using SiS 5597/8. When the system starts I get a penguin in the top left of the screen and a text console with 100 columns. I don't have the bandwidth to dist-upgrade, but I keep things like libc6 and gcc up-to-date with potato. When I run BOGL I'm using the code in bogl-pcfb.c with 8 bpp, I think. The code If you're not already familiar with boot-floppies, you probably shouldn't be reading this, but the basic instructions are: install the latest boot-floppies using apt-get, so that you get other required packages too, then look in /usr/src/boot-floppies/README-CVS for instructions on how to get the very latest version from CVS. Fonts Get Markus Kuhn's fixed-width BDF fonts with UCS encoding: http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts-asian.tar.gz These fonts are also useful for a UTF-8 xterm. I used 9x18.bdf and 18x18ja.bdf for testing. Compiling $ cd /usr/src/boot-floppies/utilities/libutf8 $ make $ cd /usr/src/boot-floppies/utilities/bogl $ make bdftobogl bterm $ ./mergebdf .../9x18.bdf .../18x18ja.bdf > font.bdf $ ./bdftobogl -b font.bdf > font.bgf For screen-oriented programs you need a terminfo entry for bterm. Do the following to check you don't already have an entry for bterm, then make one in the user's ~/.terminfo/. Either make sure you run bterm as the same user as you ran tic, or run tic as root to make a terminfo entry in the system terminfo directory. $ infocmp bterm $ tic bterm.ti $ infocmp bterm Running Go to a text console, as I don't know what effect this might have on X, and: $ cd /usr/src/boot-floppies/utilities/bogl $ export LC_CTYPE=eo.UTF-8 $ ./bterm -f font.bgf You should get a new text console with a disgusting black-on-white colour scheme. You can check that UTF-8 works with: $ cat UTF-8-test Screen handling Bterm understands a tiny subset of the control sequences that xterm understands, but sufficient, I hope, for slang, curses and GNU Readline. (If you want vt100 emulation, you can always run GNU Screen.) You can test a program's ability to work in a bterm by running it in a UTF-8 xterm with export TERM=bterm. If you notice any incompatibilites between bterm and a UTF-8 xterm, please tell me. For instructions on how to get a UTF-8 xterm, see: ftp://ftp.ilog.fr/pub/Users/haible/utf8/Unicode-HOWTO.html Slang and newt I have patched slang and newt to (partially) work in UTF-8. Get the code from: http://www.rano.org/mutt/slang-1.4.0-ege5.diff http://www.rano.org/mutt/newt-0.50-5.3-ege1.diff Here's what to do (there's a fixed relative path to ../slang14 in newt-0.50/Makefile; sorry about that): $ bzcat /usr/local/src/slang/slang-1.4.0.tar.bz2 | tar xf - $ mv -i slang-1.4.0 slang14 $ cd slang14 $ patch -p0 < ~/slang-1.4.0-ege5.diff $ ./configure && make $ cd .. $ tar xzf newt_0.50.orig.tar.gz $ cd newt-0.50 $ zcat newt_0.50-5.3.diff.gz | patch -p1 $ patch -p1 < newt-0.50-5.3-ege1.diff $ # Using a UTF-8 editor, change the messages in test.c and testgrid.c # to include lots of exotic characters. $ ./configure && make testing testgrid Now, in the bterm (or a UTF-8 xterm): $ newt-0.25/testing $ newt-0.25/testgrid Internationalised boot-floppies I haven't tried this yet, but I intend to: Convert the PO files to UTF-8 using the command iconv in a script. Recompile dbootstrap with language chooser against the patched slang and newt. Include bterm and a suitable font in root.bin and modify /etc/init.d/ to run dbootstrap in a bterm. Make sure the kernel on the rescue floppy has a framebuffer. Et voila, maybe. There are probably bugs in the patched slang and newt, because they're not very much tested yet. If you can identify a bug, please send me details.