From - Fri Mar  2 05:02:33 2001
Return-Path: <JGMBenoit@Wanadoo.fr>
Received: from apeiba.wanadoo.fr (smtp-rt-2.wanadoo.fr [193.252.19.154])
    by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f2242Mu76318 for
    <metafont@ens.fr>; Fri, 2 Mar 2001 05:02:22 +0100 (CET)
Received: from antholoma.wanadoo.fr (193.252.19.153) by apeiba.wanadoo.fr;
    2 Mar 2001 05:02:22 +0100
Received: from wanadoo.fr (193.248.130.208) by antholoma.wanadoo.fr;
    2 Mar 2001 05:02:21 +0100
Message-Id: <3A9F1B96.AF03686C@Wanadoo.fr>
Date: Fri, 02 Mar 2001 05:03:34 +0100
From: Jerome BENOIT <JGMBenoit@Wanadoo.fr>
X-Mailer: Mozilla 4.76 [en] (Win98; U)
X-Accept-Language: en
Mime-Version: 1.0
To: MetaPost <metafont@nef.ens.fr>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 420
Precedence: list
Subject: [metafont] CMR10 vs cmr10

Hello !

MetaPost output with source using CM fonts
uses UPPER case name (CMR10 but not cmr10):

%%Creator: MetaPost
%%CreationDate: 2001.02.05:1643
%%Pages: 1
%%DocumentFonts: CMR10 CMR7 CMMI10 CMSS10 CMSS8
 /cmr10 /CMR10 def
 /cmr7 /CMR7 def
 /cmmi10 /CMMI10 def
 /cmss10 /CMSS10 def
 /cmss8 /CMSS8 def
/fshow {exch findfont exch scalefont setfont show}bind def

If we can configure our system in consequence,
unfortunately it seems that some `standard' system use lower case
scheme: 
how can we configure MetaPost to support both ?


Thanks in advance,
Jerome BENOIT


From - Fri Mar  2 22:59:21 2001
Return-Path: <luecking@uark.edu>
Received: from mail.uark.edu (mail.uark.edu [130.184.5.107]) by nef.ens.fr
    (8.10.1/1.01.28121999) with ESMTP id f22Lx8u75746 for <metafont@ens.fr>;
    Fri, 2 Mar 2001 22:59:08 +0100 (CET)
Received: from comp.uark.edu ([130.184.5.197]) by mail.uark.edu (Netscape
    Messaging Server 4.15) with ESMTP id G9LBQI01.XAY; Fri, 2 Mar 2001
    15:59:06 -0600
Received: (from luecking@localhost) by comp.uark.edu (8.10.2/8.10.2) id
    f22Lx6f11080; Fri, 2 Mar 2001 15:59:06 -0600 (CST)
Date: Fri, 2 Mar 2001 15:59:06 -0600 (CST)
From: "Daniel Luecking" <luecking@uark.edu>
To: Jerome BENOIT <JGMBenoit@Wanadoo.fr>
Cc: MetaPost <metafont@nef.ens.fr>
Subject: Re: [metafont] CMR10 vs cmr10
In-Reply-To: <3A9F1B96.AF03686C@Wanadoo.fr>
Message-Id: <Pine.SOL.4.10.10103021544310.8946-100000@comp.uark.edu>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 421
Precedence: list

On Fri, 2 Mar 2001, Jerome BENOIT wrote:

> Hello !
> 
> MetaPost output with source using CM fonts
> uses UPPER case name (CMR10 but not cmr10):
> 
> %%Creator: MetaPost
> %%CreationDate: 2001.02.05:1643
> %%Pages: 1
> %%DocumentFonts: CMR10 CMR7 CMMI10 CMSS10 CMSS8
>  /cmr10 /CMR10 def
>  /cmr7 /CMR7 def
>  /cmmi10 /CMMI10 def
>  /cmss10 /CMSS10 def
>  /cmss8 /CMSS8 def
> /fshow {exch findfont exch scalefont setfont show}bind def
> 
> If we can configure our system in consequence,
> unfortunately it seems that some `standard' system use lower case
> scheme: 
> how can we configure MetaPost to support both ?

Actually, MetaPost alone does not support upper case, it requires the
right entries in psfonts.map. If prologues is 0, all the above def-s are
absent. If prologues is positive (I forget whether the actual number
makes a difference) then MP searches psfonts.map for the name of cmr10
or other cm fonts. If psfonts.map doesn't mention cm fonts (and on many
systems it will not) then you will find the above lines say

/cmr10 /cmr10 def 
etc.

Only if psfonts.map contains lines like 

cmr10 CMR10
etc.

do you get upper case names.

To get support for both upper and lower case names you need to interfere
in the above described proceedure. You could swap different versions of
psfonts.map or you could run a sed, awk or perl script that changed the
cases in the ps output files. Lastly, you could configure other programs
to handle whatever case MP produces. I know it is easy to modify the GS
Fontmap so it handles both with ease.


-- 
Dan Luecking                           Dept. of Mathematical Sciences     
luecking@comp.uark.edu                 University of Arkansas      
http://comp.uark.edu/~luecking/        Fayetteville, AR 72101


From - Mon Mar  5 07:24:13 2001
Return-Path: <smuelas@mecanica.upm.es>
Received: from filemon.mecanica.upm.es (filemon.mecanica.upm.es
    [138.100.66.1]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id
    f256O3u35081 for <metafont@ens.fr>; Mon, 5 Mar 2001 07:24:03 +0100 (CET)
Received: from [138.100.66.37] (helo=simux.mecanica.upm.es ident=smuelas)
    by filemon.mecanica.upm.es with esmtp (Exim 3.11 #1 (Debian)) id
    14ZoPO-0006Wb-00; Mon, 05 Mar 2001 07:23:50 +0100
Date: Mon, 5 Mar 2001 07:21:15 +0100 (CET)
From: smuelas <smuelas@mecanica.upm.es>
To: Daniel Luecking <luecking@uark.edu>
Cc: Jerome BENOIT <JGMBenoit@Wanadoo.fr>, MetaPost <metafont@nef.ens.fr>
Subject: Re: [metafont] CMR10 vs cmr10
In-Reply-To: <Pine.SOL.4.10.10103021544310.8946-100000@comp.uark.edu>
Message-Id: <Pine.LNX.4.30.0103050720280.1263-100000@simux.mecanica.upm.es>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 422
Precedence: list

>
> Actually, MetaPost alone does not support upper case, it requires the
> right entries in psfonts.map. If prologues is 0, all the above def-s are
> absent. If prologues is positive (I forget whether the actual number
> makes a difference) then MP searches psfonts.map for the name of cmr10

prologues:=2;


-- 
Santiago Muelas
E.T.S. Ingenieros de Caminos, (U.P.M)    Tf.: (34) 91 336 66 59
e-mail: smuelas@mecanica.upm.es          Fax: (34) 91 336 67 61
www: http://w3.mecanica.upm.es/~smuelas



From - Thu Mar  8 21:22:59 2001
Return-Path: <smidi@gmx.at>
Received: from smtp1.utaiop.at (mx2.utanet.at [195.70.253.46]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f28KMnr08458 for
    <metafont@ens.fr>; Thu, 8 Mar 2001 21:22:49 +0100 (CET)
Received: from multi2.utaiop.at ([10.1.1.196]) by smtp1.utaiop.at
    (Netscape Messaging Server 4.15) with ESMTP id G9WBA002.JE4 for
    <metafont@ens.fr>; Thu, 8 Mar 2001 21:22:48 +0100
Received: from gmx.at ([212.152.215.25]) by multi2.utaiop.at (Netscape
    Messaging Server 4.15) with ESMTP id G9WB9Y03.V6S for <metafont@ens.fr>;
    Thu, 8 Mar 2001 21:22:46 +0100
Message-Id: <3AA7EA02.93B1002B@gmx.at>
Date: Thu, 08 Mar 2001 21:22:26 +0100
From: Roland Smiderkal <smidi@gmx.at>
X-Mailer: Mozilla 4.7 [de] (Win98; I)
X-Accept-Language: de
Mime-Version: 1.0
To: metafont@ens.fr
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 423
Precedence: list
Subject: [metafont] Large values in MetaPost?

Numbers in MetaPost are limited to less than 4096. Is there a MetaPost
version without this limit (for Windows 98)?

In what programming language is MetaPost written? In my naive opinion
recompiling MetaPost with an appropriate compiler should help to
overcome the above limit.

Roland Smiderkal


From - Fri Mar  9 07:33:43 2001
Return-Path: <be@mek.dtu.dk>
Received: from brayton.et.dtu.dk (brayton.et.dtu.dk [130.225.70.231]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f296XWr41952 for
    <Metafont@ens.fr>; Fri, 9 Mar 2001 07:33:32 +0100 (CET)
Received: from mek.dtu.dk (brian@euler.et.dtu.dk [130.225.70.230]) by
    brayton.et.dtu.dk (8.9.3 (PHNE_18979)/8.9.3) with ESMTP id HAA09953;
    Fri, 9 Mar 2001 07:30:21 GMT
Sender: brian@brayton.et.dtu.dk
Message-Id: <3AA88544.2D452B27@mek.dtu.dk>
Date: Fri, 09 Mar 2001 08:24:52 +0100
From: Brian Elmegaard <be@mek.dtu.dk>
Organization: Department of Energy Engineering, Technical University of
    Denmark
X-Mailer: Mozilla 4.7 [en] (X11; I; HP-UX B.10.20 9000/715)
X-Accept-Language: en
Mime-Version: 1.0
To: Roland Smiderkal <smidi@gmx.at>, Metafont@ens.fr
Subject: Re: [metafont] Large values in MetaPost?
References: <3AA7EA02.93B1002B@gmx.at>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 424
Precedence: list

Roland Smiderkal wrote:
> 
> Numbers in MetaPost are limited to less than 4096. Is there a MetaPost
> version without this limit (for Windows 98)?
> 
I am pretty sure, there is not. And I believe that there is a way to overcome
the problem without.

Large numbers will most probably occur in graphs. If you use the graph package
there are macros (Sdiv) which will let you scale the numbers appropriately.  

In 'normal' geaphics you should scale the numbers yourself.

The 4096 doesn't affect labelling of course.

> In what programming language is MetaPost written? In my naive opinion
> recompiling MetaPost with an appropriate compiler should help to
> overcome the above limit.

Like other programs in the TeX-world mp is portable. IMHO it should be kept like
that.

-- 
Brian Elmegaard (be@mek.dtu.dk) http://www.et.dtu.dk 
Dept. of Mechanical Engineering, Energy Engineering,
Technical University of Denmark, Phone +45 4525 4169  Fax +45 4593 5215
:) http://www.rk-speed.dk http://fiduso.dk http://sunsite.auc.dk/dk-tug


From - Fri Mar  9 17:22:51 2001
Return-Path: <tim@maths.tcd.ie>
Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11])
    by nef.ens.fr (8.10.1/1.01.28121999) with SMTP id f29GMer04792 for
    <metafont@ens.fr>; Fri, 9 Mar 2001 17:22:43 +0100 (CET)
Received: from boole.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id
    <aa19761@salmon>; 9 Mar 2001 16:22:35 +0000 (GMT)
Date: Fri, 9 Mar 2001 16:22:35 +0000
From: Timothy Murphy <tim@maths.tcd.ie>
To: Roland Smiderkal <smidi@gmx.at>
Cc: metafont@ens.fr
Subject: Re: [metafont] Large values in MetaPost?
Message-Id: <20010309162235.A32161@boole.maths.tcd.ie>
References: <3AA7EA02.93B1002B@gmx.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <3AA7EA02.93B1002B@gmx.at>; from smidi@gmx.at on Thu,
    Mar 08, 2001 at 09:22:26PM +0100
Sender: tim@maths.tcd.ie
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 425
Precedence: list

On Thu, Mar 08, 2001 at 09:22:26PM +0100, Roland Smiderkal wrote:
> Numbers in MetaPost are limited to less than 4096. Is there a MetaPost
> version without this limit (for Windows 98)?
> 
> In what programming language is MetaPost written? In my naive opinion
> recompiling MetaPost with an appropriate compiler should help to
> overcome the above limit.

It isn't quite as easy as that,
as the real numbers x is represented by the integer [2^{20}x],
and all computations are done in integers,
to ensure that the result is the same on all systems.

-- 
Timothy Murphy  
e-mail: tim@maths.tcd.ie
tel: 086-233 6090
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland


From - Sat Mar 10 14:40:48 2001
Return-Path: <pragma@wxs.nl>
Received: from smtp8.xs4all.nl (smtp8.xs4all.nl [194.109.127.134]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f2ADebr77030 for
    <metafont@ens.fr>; Sat, 10 Mar 2001 14:40:37 +0100 (CET)
Received: from server-1.pragma-ade.nl (s340-modem3105.dial.xs4all.nl
    [194.109.172.33]) by smtp8.xs4all.nl (8.9.3/8.9.3) with ESMTP id OAA08758;
    Sat, 10 Mar 2001 14:40:36 +0100 (CET)
Received: from laptop-1 ([200.1.1.42]) by server-1.pragma-ade.nl
    (8.9.3/8.9.3) with SMTP id OAA13587; Sat, 10 Mar 2001 14:31:00 +0100
Message-Id: <3.0.6.32.20010309083117.014e2960@server-1>
X-Sender: hagen@server-1
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Fri, 09 Mar 2001 08:31:17 +0100
To: Roland Smiderkal <smidi@gmx.at>
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: [metafont] Large values in MetaPost?
Cc: metafont@ens.fr
In-Reply-To: <3AA7EA02.93B1002B@gmx.at>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 426
Precedence: list

At 09:22 PM 3/8/01 +0100, Roland Smiderkal wrote:
>Numbers in MetaPost are limited to less than 4096. Is there a MetaPost
>version without this limit (for Windows 98)?

warningcheck := 0 ; 

>In what programming language is MetaPost written? In my naive opinion

pascal 

>recompiling MetaPost with an appropriate compiler should help to
>overcome the above limit.

memory management is hard coded and the limits are hard coded too. 

Hans
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


From - Mon Mar 12 00:07:20 2001
Return-Path: <smidi@gmx.at>
Received: from smtp1.utaiop.at (mx2.utanet.at [195.70.253.46]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f2BN7Ar80269 for
    <metafont@ens.fr>; Mon, 12 Mar 2001 00:07:10 +0100 (CET)
Received: from multi2.utaiop.at ([10.1.1.196]) by smtp1.utaiop.at
    (Netscape Messaging Server 4.15) with ESMTP id GA22VX00.9ZJ for
    <metafont@ens.fr>; Mon, 12 Mar 2001 00:07:09 +0100
Received: from gmx.at ([212.152.214.107]) by multi2.utaiop.at (Netscape
    Messaging Server 4.15) with ESMTP id GA22VV01.4IW for <metafont@ens.fr>;
    Mon, 12 Mar 2001 00:07:08 +0100
Message-Id: <3AAAA73A.225E1F10@gmx.at>
Date: Sat, 10 Mar 2001 23:14:18 +0100
From: Roland Smiderkal <smidi@gmx.at>
X-Mailer: Mozilla 4.7 [de] (Win98; I)
X-Accept-Language: de
Mime-Version: 1.0
To: metafont@ens.fr
Subject: Re: [metafont] Large values in MetaPost?
References: <3.0.6.32.20010309083117.014e2960@server-1>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 427
Precedence: list

Hans Hagen schrieb:
> 
> >Numbers in MetaPost are limited to less than 4096. Is there a MetaPost
> >version without this limit (for Windows 98)?
> 
> warningcheck := 0 ;

Ah, I see! The absolute limit seems to be less than 32768. That should
be sufficent! Now if only the arithmetic calculations were more accurate
it would be perfect.

> >In what programming language is MetaPost written?
> pascal

On CTAN/systems/msdos/metapost/src there seems to be a C version.

Thank you and the others who answered me!

Roland Smiderkal


From - Mon Mar 12 16:21:55 2001
Return-Path: <jim@joshua.smcvt.edu>
Received: from joshua.smcvt.edu (joshua.smcvt.edu [192.80.64.209]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f2CFLfr55350 for
    <metafont@ens.fr>; Mon, 12 Mar 2001 16:21:41 +0100 (CET)
Received: (from jim@localhost) by joshua.smcvt.edu (8.9.3/8.9.3) id
    KAA25864; Mon, 12 Mar 2001 10:21:36 -0500
Date: Mon, 12 Mar 2001 10:21:36 -0500
Message-Id: <200103121521.KAA25864@joshua.smcvt.edu>
X-Authentication-Warning: joshua.smcvt.edu: jim set sender to
    jim@joshua.smcvt.edu using -f
From: Jim Hefferon <jim@joshua.smcvt.edu>
To: metafont@ens.fr
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 428
Precedence: list
Subject: [metafont] How to make MP forget box names?

Hello,

I use the boxit macros quite a bit.  But I'm having trouble getting
MP to allow me to do this:

beginfig(1)
  :
boxit.vv ...
  :
endfig;

beginfig(2)
  :
boxit.vv ...
  :
endfig;

I get a `redundant equation' error.  Now, MP's error messages could be 
more informative, but some experimenting makes me pretty sure that the 
objection is to using the vv name twice.

I've tried declaring `pair vv[];' but I still get that error, so the objection
doesn't seem to be to reusing vv.c, etc.  I've of course looked through 
boxes.mp and tried some things like declaring `picture pic_vv;' but 
considerable hacking on my part has not helped.  How can I get MP to forget 
the vv?

Thanks,
Jim Hefferon


From - Mon Mar 12 16:50:29 2001
Return-Path: <Denis.Roegel@loria.fr>
Received: from lorraine.loria.fr (lorraine.loria.fr [152.81.1.17]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f2CFoHr58396 for
    <metafont@ens.fr>; Mon, 12 Mar 2001 16:50:17 +0100 (CET)
Received: from bar.loria.fr (bar.loria.fr [152.81.2.13]) by
    lorraine.loria.fr (8.9.3/8.9.3/8.9.3/JCG-DG) with ESMTP id QAA01199;
    Mon, 12 Mar 2001 16:50:15 +0100 (MET)
From: "Denis B. Roegel" <Denis.Roegel@loria.fr>
Received: (from roegel@localhost) by bar.loria.fr
    (8.9.3/8.9.3/8.9.3-client/JCG) id QAA17271; Mon, 12 Mar 2001 16:50:15
    +0100 (MET)
Message-Id: <200103121550.QAA17271@bar.loria.fr>
Subject: Re: [metafont] How to make MP forget box names?
To: jim@joshua.smcvt.edu (Jim Hefferon)
Date: Mon, 12 Mar 2001 16:50:15 +0100 (MET)
Cc: metafont@ens.fr
In-Reply-To: <200103121521.KAA25864@joshua.smcvt.edu> from
    "Jim Hefferon" at Mar 12, 2001 10:21:36 AM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 429
Precedence: list

`Jim Hefferon' wrote
>   
>   Hello,
>   
>   I use the boxit macros quite a bit.  But I'm having trouble getting
>   MP to allow me to do this:
>   
>   beginfig(1)
>     :
>   boxit.vv ...
>     :
>   endfig;

try

save vv;

>   
>   beginfig(2)
>     :
>   boxit.vv ...
>     :
>   endfig;
>   

Denis


From - Tue Mar 13 04:41:08 2001
Return-Path: <Pascal.Perichon@u-bourgogne.fr>
Received: from mail.libertysurf.net (mail.libertysurf.net [213.36.80.91])
    by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f2D3evr14891 for
    <metafont@ens.fr>; Tue, 13 Mar 2001 04:40:57 +0100 (CET)
Received: from perichon (213.36.96.54) by mail.libertysurf.net (5.1.053)
    id 3AA9029100055D15 for metafont@ens.fr; Tue, 13 Mar 2001 04:40:57 +0100
Message-Id: <3AA9029100055D15@mail.libertysurf.net> (added by
    postmaster@libertysurf.fr)
X-Sender: perichon@193.50.50.2
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0.1
Date: Tue, 13 Mar 2001 04:41:04 +0100
To: metafont@ens.fr
From: "Pascal PERICHON - LE2I, Université de Bourgogne" <Pascal.Perichon@u-bourgogne.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 430
Precedence: list
Subject: [metafont] [Metapost] CMYK colors

Hello,

   Is there any way to manage CMYK colors in Metapost
(for ready to camera documents)

Pascal
-----
                      Pascal PERICHON
Laboratoire d'Electronique, d'Informatique de l'Image (LE2I)
     Université de Bourgogne, Falcultés des sciences
  9 Avenue Alain Savary B.P. 400  - 21011 DIJON cedex
       http://www.u-bourgogne.fr/CRI-CCUB/pc-texmf
       ftp://ftp.u-bourgogne.fr/pub/pc-texmf


From - Tue Mar 13 10:41:28 2001
Return-Path: <pragma@wxs.nl>
Received: from smtp3.xs4all.nl (smtp3.xs4all.nl [194.109.127.132]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f2D9fHr41537 for
    <metafont@ens.fr>; Tue, 13 Mar 2001 10:41:17 +0100 (CET)
Received: from server-1.pragma-ade.nl (s340-modem3649.dial.xs4all.nl
    [194.109.174.65]) by smtp3.xs4all.nl (8.9.3/8.9.3) with ESMTP id KAA25251;
    Tue, 13 Mar 2001 10:41:16 +0100 (CET)
Received: from laptop-1 (laptop-1.pragma-ade.nl [200.1.1.25]) by
    server-1.pragma-ade.nl (8.9.3/8.9.3) with SMTP id KAA18867; Tue,
    13 Mar 2001 10:34:24 +0100
Message-Id: <3.0.6.32.20010313101026.01914e70@server-1>
X-Sender: hagen@server-1
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Tue, 13 Mar 2001 10:10:26 +0100
To: =?iso-8859-1?Q?=22Pascal_PERICHON_-_LE2I=2C_Universit=E9_de_Bourgog?=
    =?iso-8859-1?Q?ne=22?= <Pascal.Perichon@u-bourgogne.fr>
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: [metafont] [Metapost] CMYK colors
Cc: metafont@ens.fr
In-Reply-To: <3AA9029100055D15@mail.libertysurf.net> (added by
    postmaster@libertysurf.fr)
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Mime-Autoconverted: from quoted-printable to 8bit by nef.ens.fr id
    f2D9fHr41537
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 431
Precedence: list

At 04:41 AM 3/13/01 +0100, Pascal PERICHON - LE2I, Université de Bourgogne
wrote:
>Hello,
>
>   Is there any way to manage CMYK colors in Metapost
>(for ready to camera documents)

% file: x.mp 

beginfig(10) ;
  fill fullcircle scaled 4cm withcolor blue ;
endfig ;

end .

% file x.tex 

\setupoutput[pdftex]

\setupcolors[cmyk=yes,rgb=no,state=start]

\starttext

\startMPpage
  fill fullcircle scaled 5cm withcolor yellow ;
\stopMPpage

\startMPpage
  loadfigure "x.mp" number 10 ;
\stopMPpage

\stoptext

% call

texexec x

[when embedding graphics in context, color transformation are done on the
fly, rgb/cmyk/mixed/reduction/weighted grayscaled etc]

and you got a pdf file with cmyk colored mp graphics, [if needed i can make
it an option to teh mp to pdf converter]

Hans
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


From - Tue Mar 13 11:12:35 2001
Return-Path: <marcel@hsdev.com>
Received: from knuth.hsdev.com (knuth.hsdev.com [195.193.208.19]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f2DACOr45854 for
    <metafont@ens.fr>; Tue, 13 Mar 2001 11:12:24 +0100 (CET)
Received: from hsdev.com (nat32@davinci.hsdev.com [195.193.208.20]) by
    knuth.hsdev.com (8.11.0/8.9.3) with ESMTP id f2DABWx09142 for
    <metafont@ens.fr>; Tue, 13 Mar 2001 11:11:32 +0100
Message-Id: <3AADF254.48E16A59@hsdev.com>
Date: Tue, 13 Mar 2001 11:11:32 +0100
From: Marcel van der Boom <marcel@hsdev.com>
Organization: HS development BV
X-Mailer: Mozilla 4.76 [en]C-CCK-MCD   (Windows NT 5.0; U)
X-Accept-Language: en,nl
Mime-Version: 1.0
To: metafont@ens.fr
Subject: Re: [metafont] [Metapost] CMYK colors
References: <3.0.6.32.20010313101026.01914e70@server-1>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Mime-Autoconverted: from quoted-printable to 8bit by nef.ens.fr id
    f2DACOr45854
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 432
Precedence: list

Managing the colors in CMYK does not mean that the generated postscript contains CMYK colors
but the RGB equivalent (or the best it can do) to that color, doesn't it?

I have been inspecting some postscript files generated by Metapost (plain) and colors are specified
as RGB triples, which is fine in most cases, but we are using Metapost to generate symbol libraries
which must be compliant with standards, some of which specify CMYK colors (actually Pantone colors).

I'm not a mp wizard enough to determine how color generation in the postscript file is done.

Any insights?

Marcel

Hans Hagen wrote:
> 
> At 04:41 AM 3/13/01 +0100, Pascal PERICHON - LE2I, Université de Bourgogne
> wrote:
> >Hello,
> >
> >   Is there any way to manage CMYK colors in Metapost
> >(for ready to camera documents)
> 
> % file: x.mp
> 
> beginfig(10) ;
>   fill fullcircle scaled 4cm withcolor blue ;
> endfig ;
> 
> end .
> 
> % file x.tex
> 
> \setupoutput[pdftex]
> 
> \setupcolors[cmyk=yes,rgb=no,state=start]
> 
> \starttext
> 
> \startMPpage
>   fill fullcircle scaled 5cm withcolor yellow ;
> \stopMPpage
> 
> \startMPpage
>   loadfigure "x.mp" number 10 ;
> \stopMPpage
> 
> \stoptext
> 
> % call
> 
> texexec x
> 
> [when embedding graphics in context, color transformation are done on the
> fly, rgb/cmyk/mixed/reduction/weighted grayscaled etc]
> 
> and you got a pdf file with cmyk colored mp graphics, [if needed i can make
> it an option to teh mp to pdf converter]
> 
> Hans
> -------------------------------------------------------------------------
>                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
>                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
> -------------------------------------------------------------------------

-- 

Marcel van der Boom
HS-development BV
Kwartiersedijk 14-B
4793 RE Fijnaart
The Netherlands
http://www.hsdev.com

T: +31-168-468822
F: +31-168-468823
E: marcel@hsdev.com


From - Tue Mar 13 12:11:13 2001
Return-Path: <pragma@wxs.nl>
Received: from smtp3.xs4all.nl (smtp3.xs4all.nl [194.109.127.132]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f2DBB5r53039 for
    <metafont@ens.fr>; Tue, 13 Mar 2001 12:11:05 +0100 (CET)
Received: from server-1.pragma-ade.nl (s340-modem4060.dial.xs4all.nl
    [194.109.175.220]) by smtp3.xs4all.nl (8.9.3/8.9.3) with ESMTP id MAA16502;
    Tue, 13 Mar 2001 12:11:04 +0100 (CET)
Received: from laptop-1 (laptop-1.pragma-ade.nl [200.1.1.25]) by
    server-1.pragma-ade.nl (8.9.3/8.9.3) with SMTP id MAA20306; Tue,
    13 Mar 2001 12:08:09 +0100
Message-Id: <3.0.6.32.20010313120255.016b93e0@server-1>
X-Sender: hagen@server-1
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Tue, 13 Mar 2001 12:02:55 +0100
To: Marcel van der Boom <marcel@hsdev.com>
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: [metafont] [Metapost] CMYK colors
Cc: metafont@ens.fr
In-Reply-To: <3AADF254.48E16A59@hsdev.com>
References: <3.0.6.32.20010313101026.01914e70@server-1>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 433
Precedence: list

At 11:11 AM 3/13/01 +0100, Marcel van der Boom wrote:
>Managing the colors in CMYK does not mean that the generated postscript
contains CMYK colors
>but the RGB equivalent (or the best it can do) to that color, doesn't it?

for dtp people it means that they see cmyk instead of rgb, so for mp it
means just rgb mapped onto cmyk; the k component makes sense in either
postprocessed graphics (tuned for specific paperm which in itself is tricky
business: some programs save your eps / tif with a specific kind of paper
[adobe pshop 4 even has defaults in conversion settings that you need to be
aware of] in mind and that can screw up ripping for other kinds of paper.
The cmyk-rgb doc at our site shows some of the translation problems that
can occur. 

So, for the average mp picture, simple mapping works ok, as does generating
the black component [reduction=yes].   

>I have been inspecting some postscript files generated by Metapost (plain)
and colors are specified
>as RGB triples, which is fine in most cases, but we are using Metapost to
generate symbol libraries
>which must be compliant with standards, some of which specify CMYK colors
(actually Pantone colors).

Should be possible with a perl script. 

Hans
 
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


From - Tue Mar 13 18:06:48 2001
Return-Path: <B.Jackowski@GUST.org.pl>
Received: from linux.bop.com.pl (pg85.gdansk.sdi.tpnet.pl [213.77.190.85])
    by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f2DH6Zr95384 for
    <metafont@ens.fr>; Tue, 13 Mar 2001 18:06:35 +0100 (CET)
Received: from localhost (bop@localhost) by linux.bop.com.pl (8.9.3/8.9.3)
    with ESMTP id SAA05314; Tue, 13 Mar 2001 18:08:36 +0100
X-Authentication-Warning: linux.bop.com.pl: bop owned process doing -bs
Date: Tue, 13 Mar 2001 18:08:35 +0100 (CET)
From: Boguslaw Jackowski <B.Jackowski@GUST.org.pl>
X-Sender: bop@linux.bop.com.pl
To: The Discussion List of METAFONT/METAPOST <metafont@ens.fr>
Cc: Krzys Leszczynski <chris@camk.edu.pl>
Subject: Re: [metafont] [Metapost] CMYK colors
Message-Id: <Pine.LNX.4.21.0103131806200.5312-100000@linux.bop.com.pl>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 434
Precedence: list


Pascal PERICHON:
> Is there any way to manage CMYK colors in Metapost
> (for ready to camera documents)

Hans Hagen:
> [when embedding graphics in context, color transformation are done on the
> fly, rgb/cmyk/mixed/reduction/weighted grayscaled etc]

Marcel van der Boom:
> I'm not a mp wizard enough to determine how color generation in the
> postscript file is done.

Actually, color conversion is always ready to play (unpleasant) tricks...
I try to avoid it whenever possible and to use cmyk colors explicitly.

My coleagues and me use two techniques. One is nearly trivial and involves
using special commands.

For example, the following sequence of specials:
  special "/mpepsilon 0.01 def";
  special "/setgray {";
  special "dup .8 sub abs mpepsilon lt {0.2 0.2 0.3 0.05 setcmykcolor} if ";
  special "dup .5 sub abs mpepsilon lt {0 0.85 0.85 0 setcmykcolor} if ";
  special "dup 0 sub abs mpepsilon lt { 0 0 0 1 setcmykcolor} if ";
  special "pop} def";
replaces
  80% gray with cmyk 0.2 0.2 0.3 0.05, 
  50% gray with cmyk 0 0.85 0.85 0, 
   0% gray (i.e., black) with cmyk 0 0 0 1 (rather than with 1 1 1 0).
In other words, cmyk colors are ``numbered'' with gray ones.

This approach has one disadvantage: it is impossible (without postprocessing)
to colour fragments of TeX texts (between `btex' and `etex' directives),
because METAPOST places all specials at the beginning of EPS file, not at
a place where they were issued, like in TeX.

The remedy (admittedly tricky), is due to Krzysio Leszczy\'nski, who
proposed that a special font can be used to convey special commands. The
topic is currently under study, so please consider the examples shown below
as preliminary.

The font can be pretty trivial:

  %%%% This is cmdfont.mp file
  designsize:=10bp/pt - epsilon;
  fontmaking:=1;
  def font_normal_space expr x = fontdimen 2: x enddef;
  for i:=0 upto 255:
   beginfig(i-256); charwd:=0; charht:=0; chardp:=0; charic:=0; endfig;
  endfor
  font_normal_space 10;
  end;
  %%%% End of cmdfont.mp file

Now run 
  mpost cmdfont.mp
to obtain `cmdfont.tfm' (dummy cmdfont.ps is also generated; it is to be
removed). Once you have cmdfont.tfm, you should put it to the appropriate
directory and add the following line to dvips's psfonts.map:
  cmdfont Courier
This completes the preparatory stage.

Below you'll find a file containing three examples of using the cmdfont
technique: coloring selected parts of text, eofill and eoclip. The example
is not neither particulary legible nor nice, sorry...

Krzysio Leszcz\'nski and I are going to prepare a (joint) paper about the
cmdfont technique for the Polish TeX User's Meeting in Bachotek this year
(from 29th of April to 1st of May). I hope we will manage to prepare a
better and broader collection of examples until then...

In order to run the sample file, the following fonts habve to be
declared in the psfonts.map:
  cmbx10  CMBX10 <cmbx10.pfb
  cminch  CMINCH <cminch.pfb
  cmr10   CMR10  <cmr10.pfb
  cmdfont Courier
I hope this is not an obstacle.

  %%%% This is testcmdf.mp file
  prologues:=-1;
  
  verbatimtex
    \def\incmyk#1#2{\rlap{\font\f=cmdfont \f gsave #1 setcmykcolor}%
      #2%
     \rlap{\font\f=cmdfont \f grestore}}
  etex
  
  def prep_cmdfont =
   special "/fshow where {pop} {/fshow {pop} def} ifelse";
   special "/cmdfont {cvx exec";
   special "  /fshow.tmp /fshow load def";
   special "  /fshow {pop /fshow /fshow.tmp load def} def";
   special "} def";
  enddef;
  extra_endfig:=extra_endfig & ";prep_cmdfont;";
  
  def eofill(text paths) text modif =
   begingroup
    save xpos_, ypos_;
    for p_:=paths:
     xpos_:=xpart(llcorner(p_));
     ypos_:=ypart(llcorner(p_));
     exitif true;
    endfor
    draw ("/fill.tmp /fill load def /newpath.tmp /newpath load def" &
     "/fill {/fill{}def /newpath{}def}def")
     infont "cmdfont" shifted (xpos_, ypos_) modif;
    for p_:=paths: fill p_ modif; endfor
    draw "eofill /fill /fill.tmp load def /newpath /newpath.tmp load def"
     infont "cmdfont"  shifted (xpos_, ypos_) modif;
   endgroup
  enddef;
  
  def eoclip(text pic)(text paths) text modif =
   begingroup
    save s_, xmin_, xmax_, ymin, ymax_;
    xmin_=ymin_:=infinity; xmax_=ymax_:=-infinity;
    draw ("/clip.tmp /clip load def /newpath.tmp /newpath load def" &
     "/clip {/clip{}def /newpath{}def}def") infont "cmdfont";
    picture s_;
    s_:=image(draw ("eoclip /clip /clip.tmp load def " &
     "/newpath /newpath.tmp load def") infont "cmdfont"; draw pic);
    for p_:=paths: clip s_ to p_ modif;
     if xpart(llcorner(p_ modif)) < xmin_: xmin_:=xpart(llcorner(p_ modif)); fi
     if xpart(urcorner(p_ modif)) > xmax_: xmax_:=xpart(urcorner(p_ modif)); fi
     if ypart(llcorner(p_ modif)) < ymin_: ymin_:=ypart(llcorner(p_ modif)); fi
     if ypart(urcorner(p_ modif)) > ymax_: ymax_:=ypart(urcorner(p_ modif)); fi
    endfor
    setbounds s_ to 
      (xmin_,ymin_)--(xmax_,ymin_)--(xmax_,ymax_)--(xmin_,ymax_)--cycle;
    addto currentpicture also s_;
   endgroup
  enddef;
  
  beginfig(101);
    draw btex \font\f cmr10 \f pp \incmyk{1 0 0 0}{qq}
              \font\f cmbx10 \f rr \incmyk{0 1 1 0}{qq} ss etex;
  endfig;
  
  beginfig(102);
   eofill (fullcircle scaled 50mm,
    fullcircle scaled 50mm shifted (20mm,20mm),
    fullcircle scaled 50mm shifted (10mm,10mm),
    fullcircle scaled 50mm shifted (-10mm,-10mm),
    fullcircle scaled 50mm shifted (-20mm,-20mm)
    )
    shifted (100mm,0) withcolor red;
   fill fullcircle scaled 50mm shifted (100mm,50mm) withcolor blue;
  endfig;
  
  beginfig(103);
    save s,w,h,t; picture t;
    t=image(draw btex \font\f cminch \f ABCD etex);
    n=20;
    w0=xpart (urcorner t - llcorner t); h0=ypart (urcorner t - llcorner t);
    s=h0/(2n+1); % show s;
    for i:=1 upto n: w[i]=w[i-1]-2s; h[i]=h[i-1]-2s; endfor
    fill fullcircle scaled 2cm shifted (0,0) withcolor red;
    fill fullcircle scaled 2cm shifted (w0,0) withcolor green;
    eoclip (t)
     (
      unitsquare xscaled w0 yscaled h0
      for i:=1 upto n:
        , unitsquare xscaled w[i] yscaled h[i] shifted (i*s, i*s)
      endfor
     );
    fill fullcircle scaled 2cm shifted (w0,h0) withcolor blue;
  endfig;
  
  end.
  %%%% End of testcmdf.mp file

Comments are welcome.

All the best -- Jacko.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 Bogus\l{}aw Jackowski: B.Jackowski@GUST.ORG.PL
----------------------------------------------------------------
 Hofstadter's Law: It always takes longer than you expect, even
                   when you take into account Hofstadter's Law.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-




