"title" in image output

7 views
Skip to first unread message

Qian Yun

unread,
Apr 17, 2024, 7:08:34 AM4/17/24
to fricas-devel
This "title" thing is more complex than I thought.

For vp:=draw(x,x=0..1); write(vp,"pic", FORMAT)

When FORMAT is:

"pixmap" or "bitmap":
generates 400x400 image, title is the same as screen output

"image":
generates 300x324 image, title is 24 pixel higher than screen output

"postscript":
generates 400x376 image currently, no title.
I can modify it to generate 400x400 image with title the same
as screen output.


The "image" format is currently used by hypertex to generate
*.VIEW and convert to images used in book.


I will change "postscript" to generate 400x400 image with title.

However, shall we change the "image" format? I mean what's the
point of generating a smaller image and taller title? Is that
required by hyperdoc somehow?

My guess is that making the image smaller can make the title
font relatively larger.
I think 300x324 is a mistake, it calculated titleHeight twice.

- Qian

Ralf Hemmecke

unread,
Apr 17, 2024, 7:30:21 AM4/17/24
to fricas...@googlegroups.com
On 4/17/24 13:08, Qian Yun wrote:
> This "title" thing is more complex than I thought.
>
> For  vp:=draw(x,x=0..1); write(vp,"pic", FORMAT)
>
> When FORMAT is:
>
> "pixmap" or "bitmap":
> generates 400x400 image, title is the same as screen output
>
> "image":
> generates 300x324 image, title is 24 pixel higher than screen output
>
> "postscript":
> generates 400x376 image currently, no title.
> I can modify it to generate 400x400 image with title the same
> as screen output.

> The "image" format is currently used by hypertex to generate
> *.VIEW and convert to images used in book.

There are two issues.

1) generate the same size for all formats
2) generation for HyperDoc vs generation for the book

ad 1)
I would be happy if I could specify the size, specify whether with or
without title and the font size of the title. There should be some
default so that when converting one format into another they should
(apart from resolution quality) give the same picture, i.e. same size.
((I am not sure whether that is a realistic wish.))

ad 2)
Qian, as I told you in a private mail. I'd like to decouple the book
from the existence of HyperDoc. Currently the pictures are generated for
HyperDoc and then converted to be used by the book. Now that you make
it possible to generate postscript directly, we can use that to not use
the image.xpm files for the book. I think that would conceptually make
the book creation a bit simpler.

> However, shall we change the "image" format?  I mean what's the
> point of generating a smaller image and taller title?  Is that
> required by hyperdoc somehow?

I do not know. The 400x400 size is probably from the times with low
resolution. Change it to 400x400 or maybe even 600x600. I believe it
should be the same for all formats.

Ralf

Waldek Hebisch

unread,
Apr 17, 2024, 8:47:46 AM4/17/24
to fricas...@googlegroups.com
On Wed, Apr 17, 2024 at 07:08:29PM +0800, Qian Yun wrote:
> This "title" thing is more complex than I thought.
>
> For vp:=draw(x,x=0..1); write(vp,"pic", FORMAT)
>
> When FORMAT is:
>
> "pixmap" or "bitmap":
> generates 400x400 image, title is the same as screen output
>
> "image":
> generates 300x324 image, title is 24 pixel higher than screen output
>
> "postscript":
> generates 400x376 image currently, no title.
> I can modify it to generate 400x400 image with title the same
> as screen output.
>
>
> The "image" format is currently used by hypertex to generate
> *.VIEW and convert to images used in book.

Ideally "image" ('.xpm') would be just option for users who want legacy
format. AFAIUI your work make '.xpm' unnecessary for book. And
ideally it would be not used by HyperDoc. Currently graphics
itself uses '.data' file. '.xpm' is used by 'viewAlone'.

> I will change "postscript" to generate 400x400 image with title.
>
> However, shall we change the "image" format? I mean what's the
> point of generating a smaller image and taller title? Is that
> required by hyperdoc somehow?

I do not think so.

> My guess is that making the image smaller can make the title
> font relatively larger.
> I think 300x324 is a mistake, it calculated titleHeight twice.

Possibly.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages