ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: No straightforward .png support in ConTeXt?
Date: Sun, 21 Jun 1998 19:44:02 +0200	[thread overview]
Message-ID: <358D4662.D5D477D5@wxs.nl> (raw)

Berend de Boer wrote:

> The main problem was figuring out that I had to use texutil to get the
> sizes correct (this was the first time I tried to use figures within
> context).

TeX can only process non binary data. Therefore one has to use a
separate tool to determins figure dimensions. Because TeX can do text
input, eps illustrations can be processed (as well as pdf) although last
week at the pdftex list we found out that on Windows this can give
problems if we strickly follow the original tex implementation. 

Therefore, ConTeXt can either read the eps file directly or texutil.tuf
to determine the size. 

> The error message context gives in this case is really confusing: "figuur
> . niet te vinden".
> 
> Looking through the source this really means that no size for this figure
> could be find.

You can trick context by saying e.g. 

\externafigure[somename][type=xxx,preset=no,width=3cm,height=4cm]

But keep in mind that TeX has to know the dimension to reserve space. 

> With latex including a .png figure is really easy. Why is context not able

I'm not sure of the state of the implementation you use, but I guess png
is possible: 

\externalfigure[name][type=png,...]

Now the reason why LaTeX can determines the size, is simply that is uses
the fact that when one says: 

  \pdfimage name width ... height ... 

the figure is scaled ok. (thanks to pdf) But how about movies and pdf? 

Only the latest pdftex release supports pdf en jpg and tif. 

> to auto-determine the size of .png? I.e. I need a \dogetfiguresizepng. Is

Keep in mind that tex (latex/context) techically depend on some programe
to determine these! pdfTeX does scale by using width/height, but other
(dvi) drivers differ in this respect (e.g. scale). When you include
figures in 1:1, in pdftex you get back a box of the right size, somthing
you cannot do in dvi. Therefore the mechanisms I use are general,
non-pdftex specific!

> this routine available somewhere already?

If you can be patient for a few days, I'll upload the latest release.
Due to very recent developments in pdftex I extended the figure
mechanism. Given a suitable texutil.tuf file (you can generate one, but
also provide one yourself: if you add an entry: 

\presetfigure[name][type=png,width=...,height=...]

ConTeXt is pretty well able to include whatever illustration you want,
even ones that are not at you machine that moment. 

Back to the extensions: 

-   fully automatic type recognitions (so no problems when 
    switching from dvi to pdf, given that alternatives are 
    at hand)
-   direct scanning of figure
-   when not possible using or even calling directly for 
    texutil (now texutil can also read tif, png, jpg and 
    pdf)
-   automatic recognition of metapost (mps/eps) files and 
    automatic handling of fonts, clor conversion, direct pdf 
    conversion etc)
-   reusing inserts when possible (was already done with mps 
    figures)

For those unaware of some features already present: 

-   there is automatic scaling to the max: (b)(h)factor=max/fit/dimen
-   with width/height limitations checked
-   as well as isometric scaling
-   and width/height, scale or document design size scaling, etc etc 

(Well, we've been including eps and tif ever since we started with
context, with scaling tricks provided, so things are possible.)

Hans 

Again, keep in mind that, althought often possible, there are situations
where tex cannot determine boundingboxes, while texutil can. 

-----------------------------------------------------------------
                                              Hans Hagen | PRAGMA
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | fax: 038 477 53 74 | mail: pragma@wxs.nl
-----------------------------------------------------------------


             reply	other threads:[~1998-06-21 17:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-21 17:44 Hans Hagen [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-06-21 19:35 Hans Hagen
1998-06-21 18:08 Hans Hagen
1998-06-20 17:14 Berend de Boer
1998-06-20 13:39 Frans Goddijn
1998-06-20 10:57 Berend de Boer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=358D4662.D5D477D5@wxs.nl \
    --to=pragma@wxs.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).