There's no need to reset the font every line if it hasn't changed. This saves
authorben <ben@cda61777-01e9-0310-a592-d414129be87e>
Sun, 14 May 2006 18:27:34 +0000 (18:27 +0000)
committerben <ben@cda61777-01e9-0310-a592-d414129be87e>
Sun, 14 May 2006 18:27:34 +0000 (18:27 +0000)
a few K and a lot of calls to scalefont and setfont, which is probably good.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6686 cda61777-01e9-0310-a592-d414129be87e

bk_ps.c

diff --git a/bk_ps.c b/bk_ps.c
index 496a7f6..61a7993 100644 (file)
--- a/bk_ps.c
+++ b/bk_ps.c
@@ -149,6 +149,8 @@ void ps_backend(paragraph *sourceform, keywordlist *keywords,
     for (page = doc->pages; page; page = page->next) {
        text_fragment *frag, *frag_end;
        rect *r;
+       font_encoding *fe;
+       int fs;
 
        pageno++;
        fprintf(fp, "%%%%Page: %d %d\n", pageno, pageno);
@@ -183,9 +185,9 @@ void ps_backend(paragraph *sourceform, keywordlist *keywords,
        }
 
        frag = page->first_text;
+       fe = NULL;
+       fs = -1;
        while (frag) {
-           font_encoding *fe;
-           int fs;
            char *c;
 
            /*
@@ -198,9 +200,6 @@ void ps_backend(paragraph *sourceform, keywordlist *keywords,
 
            fprintf(fp, "%g[", frag->y / FUNITS_PER_PT);
 
-           fe = NULL;
-           fs = -1;
-
            while (frag && frag != frag_end) {
 
                if (frag->fe != fe || frag->fontsize != fs)