From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- dviware/dvi2pcl/storechar.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 dviware/dvi2pcl/storechar.c (limited to 'dviware/dvi2pcl/storechar.c') diff --git a/dviware/dvi2pcl/storechar.c b/dviware/dvi2pcl/storechar.c new file mode 100644 index 0000000000..ce6ea1841e --- /dev/null +++ b/dviware/dvi2pcl/storechar.c @@ -0,0 +1,44 @@ +/* + * Does similar things as down_character, but instead of putting + * the character's pixel pattern in the bitfile it is stored in dynamicaly + * allocated memory, used for drawing the character in graphic mode. In + * graphic mode the meaning for x_offset and y_offset is different from + * downloaded characters and the pixel pattern is stripped off from pending + * zero bytes in each row. + */ + +#include "globals.h" + +void storechar(c) +int c; +{ + byte *q, *p; + int i; + int width; + int height; + long length; + gcharfmt *g; + + pktopxl(c); + g = &(*gfont)[c]; + if(landscape) { + p = (byte *)rotatechar(); + g->pxl_bytes = width = (c_height + 7)/8; + g->pxl_rows = height = c_width; + g->x_offset = height - c_hoffset - 1; + g->y_offset = -c_voffset; + } + else { + p = (byte *) pxlbuffer; + g->pxl_bytes = width = (c_width + 7)/8; + g->pxl_rows = height = c_height; + g->x_offset = -c_hoffset; + g->y_offset = -c_voffset; + } + + length = height*width; + g->pxl_pattern = (byte *)malloc(length); + q = g->pxl_pattern; + for(i = 0 ; i < length ; i ++) + *q++ = *p++; +} -- cgit v1.2.3