From 1333797c489e45a9ce20753440cdba7ebadf299d Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Mon, 28 Jun 2010 23:26:09 +0000 Subject: Clean-up of variable-width glyph support. Adds no new code; only restructured to make a bit more readable. Also removed an unused entry in the PS engine structure. --- term_ps.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'term_ps.c') diff --git a/term_ps.c b/term_ps.c index 00bede51..ab3de54b 100644 --- a/term_ps.c +++ b/term_ps.c @@ -1,4 +1,4 @@ -/* $Id: term_ps.c,v 1.14 2010/06/28 22:46:21 kristaps Exp $ */ +/* $Id: term_ps.c,v 1.15 2010/06/28 23:26:09 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -31,14 +31,21 @@ #include "main.h" #include "term.h" +/* TODO: all this will go away with different paper sizes. */ +#define PS_CHAR_HEIGHT 12 +#define PS_CHAR_TOPMARG (792 - 24) +#define PS_CHAR_TOP (PS_CHAR_TOPMARG - 36) +#define PS_CHAR_LEFT 36 +#define PS_CHAR_BOTMARG 24 +#define PS_CHAR_BOT (PS_CHAR_BOTMARG + 36) + struct glyph { int wx; /* WX in AFM */ }; -#define MAXCHAR 95 - struct font { const char *name; /* FontName in AFM */ +#define MAXCHAR 95 /* total characters we can handle */ struct glyph gly[MAXCHAR]; /* glyph metrics */ }; @@ -342,13 +349,7 @@ static const struct font fonts[3] = { } }, }; -#define PS_CHAR_HEIGHT 12 -#define PS_CHAR_TOPMARG (792 - 24) -#define PS_CHAR_TOP (PS_CHAR_TOPMARG - 36) -#define PS_CHAR_LEFT 36 -#define PS_CHAR_BOTMARG 24 -#define PS_CHAR_BOT (PS_CHAR_BOTMARG + 36) - +/* These work the buffer used by the header and footer. */ #define PS_BUFSLOP 128 #define PS_GROWBUF(p, sz) \ do if ((p)->engine.ps.psmargcur + (sz) > \ @@ -388,6 +389,7 @@ ps_alloc(void) return(NULL); p->defrmargin = 612 - (PS_CHAR_LEFT * 2); + p->type = TERMTYPE_PS; p->letter = ps_letter; p->begin = ps_begin; -- cgit v1.2.3