This is my current progress.  The ps image looks much better that
xpm image, I have not realized this before.

I have not looked at the code so sorry if I say something wrong here.

Do you mean "better" after conversion xpm -> ps happened?

Some problems other than black-and-white 2D image:

1. Title not shown in .ps format.

Oh yes, I think that was one of the problems when I experimented with it.

2. Image size needs adjustment in *.tex. (Currently too big.
I guess a new tex package is required for auto resizing.)

Yep. I also remember that. The problem for me was that the .ps has no size and the .tex file does not say in which size it wants the picture. So even an auto-resizing does not help much. I think the best would be to add some size information into the .tex file. But that was too much for me at that time.

3. "smooth" style image is not shown.

What exactly does that mean?

BTW, can be perhaps work on a branch of your github repo. I do not so much like patches in emails when we have git already.

Eventually, the .ps image creation must be fixed.

Ralf


- Qian

diff --git a/src/doc/ugepsf.awk b/src/doc/ugepsf.awk
index e39ddde9..a53d6c9c 100644
--- a/src/doc/ugepsf.awk
+++ b/src/doc/ugepsf.awk
@@ -18,7 +18,7 @@
      } else {
          print "no-pics: " $0
      }
-    print $0 ": " view n ".VIEW/image.xpm"
-    print "\tconvert $< $@"
+    print $0 ": " view n ".VIEW/image.ps"
+    print "\tcp $< $@"
      spadgraph=0
  }
diff --git a/src/graph/view2D/write2d.c b/src/graph/view2D/write2d.c
index 05bbf62e..d9126b53 100644
--- a/src/graph/view2D/write2d.c
+++ b/src/graph/view2D/write2d.c
@@ -186,7 +186,7 @@ writeViewport(int thingsToWrite)
          case Postscript:
             /*** Create postscript output for viewport (in fricas2D.ps) ***/
           fricas_sprintf_to_buf2(PSfilename, "%s%s", viewDirName,
-                                "/fricas2D.ps");
+                                "/image.ps");
          if (PSInit(viewport->viewWindow,viewport->titleWindow) == psError)
             return (-1);
           drawViewport(PSoption);  /* write new script file in /tmp */
diff --git a/src/graph/view3D/write3d.c b/src/graph/view3D/write3d.c
index ac5a1210..990b0fb5 100644
--- a/src/graph/view3D/write3d.c
+++ b/src/graph/view3D/write3d.c
@@ -196,7 +196,7 @@ writeViewport (int thingsToWrite)
          case Postscript:
             /*** Create postscript output for viewport (in fricas3D.ps) ***/
           fricas_sprintf_to_buf2(PSfilename, "%s%s", viewDirName,
-                                "/fricas3D.ps");
+                                "/image.ps");
          if (PSInit(viewport->viewWindow,viewport->titleWindow) == psError)
             return(-1);
           drawViewport(PSoption);  /* write new script file in /tmp */
diff --git a/src/hyper/htinp.c b/src/hyper/htinp.c
index 5174ec69..f8014829 100644
--- a/src/hyper/htinp.c
+++ b/src/hyper/htinp.c
@@ -366,7 +366,7 @@ get_graph_output(char *command,char *pagename,int com_type)
      for (i = 0; i < n; i++) {
          get_string_buf(spad_socket, buf, 1024);
      }
-    sprintf(buf, "(|processInteractive| '(|write| |%s| \"%s%d\" \"image\") NIL)", "%", +    sprintf(buf, "(|processInteractive| '(|write| |%s| \"%s%d\" \"postscript\") NIL)", "%",
              pagename, example_number);
      send_lisp_command(buf);
      send_lisp_command("(|setViewportProcess|)");

On 2/3/24 23:04, Ralf Hemmecke wrote:
Hi Qian,

No. I think there is no reason to convert .xpm for the book.
Any way to produce the final picture that is included in the book is fine.
As far as I know, .xpm might be needed for HyperDoc.
Otherwise, I would be super-happy, if we can generate the pictures for the book without X.

Let me know what you are doing. It would be possible to inject code that while generating the .xmp, some other code generates .ps.

Ralf

On 2/3/24 15:32, Waldek Hebisch wrote:
On Sat, Feb 03, 2024 at 10:09:11PM +0800, Qian Yun wrote:
Hi Ralf,

I noticed that in the creation process of book.pdf,
you convert .xpm (bitmap) image to .ps format.

But "draw" in FriCAS can create ".ps" (vector) image directly.

I'm trying to use this better quality for the book.

So I'm asking there's no particular reason to choose
bitmap image over vector image, right?

There is a trouble: currently our 2D Postscript output is black and
white only (no colors).  So there is some extra work to do,
either use Postscript only for 3D, or modify Postscript output
so that it can handle colors also for 2D.

BTW.  There is long standing issue that our 3D Postscript output
needs connection to X server.  It would be good to make it work
independently of X.




--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/bd757f73-a15f-4f66-a90e-704dd11b80f8%40hemmecke.org.

Reply via email to