summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2006-05-14 18:27:34 +0000
committerBen Harris <bjh21@bjh21.me.uk>2006-05-14 18:27:34 +0000
commit2b31f230ff6fdeecad4ea63347100dd067a3b029 (patch)
treed3603bda5ece75005bbdaa93e42d7b4385ab169a
parente06921ba9541759101336126a6af96ab66b9ee2d (diff)
downloadhalibut-2b31f230ff6fdeecad4ea63347100dd067a3b029.zip
halibut-2b31f230ff6fdeecad4ea63347100dd067a3b029.tar.gz
halibut-2b31f230ff6fdeecad4ea63347100dd067a3b029.tar.bz2
halibut-2b31f230ff6fdeecad4ea63347100dd067a3b029.tar.xz
There's no need to reset the font every line if it hasn't changed. This saves
a few K and a lot of calls to scalefont and setfont, which is probably good. [originally from svn r6686]
-rw-r--r--bk_ps.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/bk_ps.c b/bk_ps.c
index 496a7f6..61a7993 100644
--- 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)