[comp.windows.interviews] figures in doc

garry@alice.att.com (05/10/91)

This is the third time I've asked this.  Has it been ignored
or just never made it through?

I've been playing with the doc in 3.0 beta.  It looks like a 
real nice package.  However, I cannot seem to get the figures
within a document to print.  When I print, for example, intro.doc
from lib/all/doc-samples, the document prints fine but there is
just blank space where the figures should be.  I've tried
various combinations of draft and final modes, with no good
results.  What am I doing wrong?  Having seen the Glyph paper,
I assume this can be done...

Garry Hodgson
AT&T Bell Labs

linton@marktwain.rad.sgi.com (Mark Linton) (05/10/91)

In article <9105091907.AA19327@lurch.Stanford.EDU>, garry@alice.att.com writes:
|> This is the third time I've asked this.  Has it been ignored
|> or just never made it through?
|> 
|> I've been playing with the doc in 3.0 beta.  It looks like a 
|> real nice package.  However, I cannot seem to get the figures
|> within a document to print.  When I print, for example, intro.doc
|> from lib/all/doc-samples, the document prints fine but there is
|> just blank space where the figures should be.  I've tried
|> various combinations of draft and final modes, with no good
|> results.  What am I doing wrong?  Having seen the Glyph paper,
|> I assume this can be done...

You need fix3 for iv/src/lib/InterViews/printer.c, included below.

*** printer.c.orig      Mon Apr 15 10:52:49 1991
--- printer.c   Tue Apr 23 15:18:16 1991
***************
*** 193,198 ****
--- 193,199 ----
  }

  void Printer::push_transform() {
+     Canvas::push_transform();
      PrinterRep* p = rep_;
      flush();
      int depth = p->info_->count();
***************
*** 207,215 ****
--- 208,218 ----
      int depth = p->info_->count();
      p->info_->remove(depth - 1);
      *p->out_ << "grestore\n";
+     Canvas::pop_transform();
  }

  void Printer::transform(Transformer& t) {
+     Canvas::transform(t);
      PrinterRep* p = rep_;
      flush();
      float a00, a01, a10, a11, a20, a21;
***************
*** 219,235 ****
      *p->out_ << " " << a20 << " " << a21 << "] concat\n";
  }

- /*
-  * The current transform push/pop just saves and restores state,
-  * so we can use it for clipping as well.
-  */
-
  void Printer::push_clipping() {
!     push_transform();
  }

  void Printer::pop_clipping() {
!     pop_transform();
  }

  void Printer::new_path() {
--- 222,242 ----
      *p->out_ << " " << a20 << " " << a21 << "] concat\n";
  }

  void Printer::push_clipping() {
!     PrinterRep* p = rep_;
!     flush();
!     int depth = p->info_->count();
!     PrinterInfo info = p->info_->item(depth - 1);
!     p->info_->insert(depth, info);
!     *p->out_ << "gsave\n";
  }

  void Printer::pop_clipping() {
!     PrinterRep* p = rep_;
!     flush();
!     int depth = p->info_->count();
!     p->info_->remove(depth - 1);
!     *p->out_ << "grestore\n";
  }

  void Printer::new_path() {

calder@uluru.stanford.edu (Paul Calder) (05/11/91)

Garry Hodgson reports ...

    However, I cannot seem to get the figures
    within a [doc] document to print.

(This patch is archived as 3.0-fixes/fix5 on interviews.stanford.edu)

Printing is broken for tranformed glyphs.  The problem lies with
damage checking in Printer.  Briefly, printer uses the Canvas damage
check, which in turn uses the Canvas transformation matrix.  But
Printer does not propagate transformation changes through to Canvas.
The upshot is that transformed glyphs use incorrect transformations
for damage checks when printing.

    Apply with ``patch -p -N < fix5'' at the top of the source tree.

================
*** iv/src/lib/InterViews/printer.c.orig    Mon Apr 15 10:52:49 1991
--- iv/src/lib/InterViews/printer.c         Tue Apr 23 15:18:16 1991
***************
*** 193,198 ****
--- 193,199 ----
  }

  void Printer::push_transform() {
+     Canvas::push_transform();
      PrinterRep* p = rep_;
      flush();
      int depth = p->info_->count();
***************
*** 207,215 ****
--- 208,218 ----
      int depth = p->info_->count();
      p->info_->remove(depth - 1);
      *p->out_ << "grestore\n";
+     Canvas::pop_transform();
  }

  void Printer::transform(Transformer& t) {
+     Canvas::transform(t);
      PrinterRep* p = rep_;
      flush();
      float a00, a01, a10, a11, a20, a21;
***************
*** 219,235 ****
      *p->out_ << " " << a20 << " " << a21 << "] concat\n";
  }

- /*
-  * The current transform push/pop just saves and restores state,
-  * so we can use it for clipping as well.
-  */
-
  void Printer::push_clipping() {
!     push_transform();
  }

  void Printer::pop_clipping() {
!     pop_transform();
  }

  void Printer::new_path() {
--- 222,242 ----
      *p->out_ << " " << a20 << " " << a21 << "] concat\n";
  }

  void Printer::push_clipping() {
!     PrinterRep* p = rep_;
!     flush();
!     int depth = p->info_->count();
!     PrinterInfo info = p->info_->item(depth - 1);
!     p->info_->insert(depth, info);
!     *p->out_ << "gsave\n";
  }

  void Printer::pop_clipping() {
!     PrinterRep* p = rep_;
!     flush();
!     int depth = p->info_->count();
!     p->info_->remove(depth - 1);
!     *p->out_ << "grestore\n";
  }

  void Printer::new_path() {

--
Paul Calder
Computer Systems Lab
Stanford University
calder@lurch.stanford.edu