From 30ca2bdcde0675a2d52a9decf9dce73e57fdcee1 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 6 Jan 2007 17:32:34 +0000 Subject: Overhaul of glyph-name handling in the paper backends. Before, we had a separate dense array of glyph names for each font, and referenced glyphs by indicies into that array, which meant that the array had to be set up before we could generate any indices. Now we have an overall array of glyph names, and use the same glyph indicies for all fonts. Some arrays have had to turn into tree234s as a result. [originally from svn r7061] --- bk_pdf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bk_pdf.c') diff --git a/bk_pdf.c b/bk_pdf.c index bdce859..3a0ec75 100644 --- a/bk_pdf.c +++ b/bk_pdf.c @@ -159,14 +159,14 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords, for (i = 0; i < 256; i++) { char buf[20]; - if (!fe->vector[i]) + if (fe->vector[i] == NOGLYPH) continue; if (i != prev + 1) { sprintf(buf, "\n%d", i); objtext(font, buf); } objtext(font, i % 8 ? "/" : "\n/"); - objtext(font, fe->vector[i]); + objtext(font, glyph_extern(fe->vector[i])); prev = i; } @@ -190,7 +190,7 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords, font_info const *fi = fe->font->info; int flags; for (i = 0; i < 256; i++) - if (fe->indices[i] >= 0) { + if (fe->vector[i] != NOGLYPH) { if (firstchar < 0) firstchar = i; lastchar = i; } @@ -202,10 +202,10 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords, objtext(widths, "[\n"); for (i = firstchar; i <= lastchar; i++) { double width; - if (fe->indices[i] < 0) + if (fe->vector[i] == NOGLYPH) width = 0.0; else - width = fi->widths[fe->indices[i]]; + width = find_width(fe->font, fe->vector[i]); sprintf(buf, "%g\n", 1000.0 * width / FUNITS_PER_PT); objtext(widths, buf); } -- cgit v1.1