Re: [NTG-context] Greek font in Footnote problem

2005-01-19 Thread Thomas A . Schmitz
On Jan 17, 2005, at 4:54 PM, Giuseppe Bilotta wrote:
enablegreek relies on catcode changes, so it cannot work inside
commands. It should be redefined to make use of e-TeX's
\scantoken feature so that it can re-parse its input.
--
Giuseppe Oblomov Bilotta
Giuseppe,
I'll be too bust the next three weeks to look into this, but would love 
to correct my quick and dirty hack. Can you give me a hint where I can 
learn more about \scantoken and how I can implement it for my Greek 
stuff?

Thanks
Thomas
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context][metapost] shading in meta[post/play] PDF

2005-01-19 Thread Mojca Miklavec
The answer to the mail follows, but to reformulate my question slightly:
How can I make shading inside metapost(play) to produce exactly what's 
in the attached picture (smooth shades). Or more generally: how can I 
hardcode some PS/PDF code in .mp, not (yet) supported by metapost(play)?

(PDF supports even 3D shapes (already shaded properly) since version 1.5 
or 1.6, but I suppose that's another story anyway.)

Here's the corresponding PostScript code:
%!PS-Adobe-3.0 Resource-ProcSet
%%Title: Hsbwheel.ps
%%Creator: Henry McGilton, Adobe Systems Incorporated (modified!)
%%EndComments
200 dup scale
/X3  1.0 3 div def
/X6  2.0 3 div def
/Y3  1.0 3 div def
/Y6  2.0 3 div def
/middlecolor  [ 11   1 ] def
/topcolor [ 10   0 ] def
/rightcolor   [ 0.5  0   1 ] def
newpath

/ShadingType 6
/ColorSpace /DeviceRGB
/DataSource [
0
  0.0 0.0X3 0.0 X6  0.0   1.0 0.0
  1.0 .552   .552 1.0   0.0 1.0
  0.0 Y6 0.0 Y3 0.0 0.0   0.0 0.00.0 0.0
  middlecolor aload poprightcolor  aload pop
  topcolor   aload pop middlecolor aload pop
]
 shfill
showpage

Laurence Finston wrote:
Mojca Miklavec wrote:

There's a wonderful tutorial on drawing 3D graphics in PostScript on 
http://www.math.ubc.ca/~cass/graphics/manual/, specifically
http://www.math.ubc.ca/~cass/graphics/manual/code/doughnut.eps as an 
example.

Thanks for the reference, it looks very interesting.

In metapost, perfect spheres can be drawn, like on 
http://www.gnu.org/software/3dldf/cdsmpls.html. But how can I add  colour?

The spheres in that example are really just circles.  The globe font was
done using Metafont, which doesn't support color at all.  The sphere graphic
at the beginning of that file was done using MetaPost, so the circles could be
drawn in color, but I know this isn't what you mean.
Well - the main question is how to add the proper (smooth shading) color 
once I calculate the grid points in one way or another.

The glyphs from the globe font (which I plan to improve) could be colored,
e.g., by using the macros defined in the `colordvi.tex' file supplied with
`dvips'.  Of course, a given glyph could only be printed or displayed in a
single color.
GNU 3DLDF does not yet possess a `sphere' type, but I plan to add one in the
not-too-distant future.  I also plan to add shading, but that is in the more
distant future.  The shading methods I'm (vaguely) familiar with operate on
raster data and I haven't quite decided how to handle rasterization.  I'm
leaning toward using the PNG format rather than PostScript for this.  I
believe PostScript can be used for both vector and raster data, but my memory
of the details is hazy.
Well, PostScript can be used for raster images, but that doesn't bring 
anything. The examples on Cass' page are actually done using *vector* 
graphics (colors are really calculated only in grid points, but then the 
color is interpolated by postscript interpreter): the perfect sphere 
coloring is thus really limited to floating point accuracy and printer 
capabilities.

The spheres drawn directly in PostScript as in the examples above still 
have straight lines (well, I agree that with some mathematics it would 
be possible to draw them with proper splines as well).


If you mean my spheres, that's an artefact of the PNG graphics.  The
PostScript versions look nicer.  I believe that on commonly available devices,
 curves are ultimately drawn as short straight-line segments, though.  In the
code in that file, the circles have 64 points, and I thought the results were
good enough.  Raising it to some value x such that x % 4 == 0 and x  64 might
improve them, I haven't tried it.  32 wasn't enough.
No, I wasn't talking about the PNGs. I was talking about the PostScript 
pictures. http://www.math.ubc.ca/~cass/graphics/manual/code/doughnut.eps 
has a really *perfect* shading, but its edges are drawn using straight 
segments instead of drawing them with splines which damages slightly the 
whole impression of its perfectness. Some additional calculation for 
spline drawing would help, but I still find it easier to calculate the 
curves in metapost than in PostScript.

Those straight-line segments on printers are just as straight as they 
are on any laser print-out of texts if I'm not wrong - i.e. not worth 
considering.

Thank you,
Mojca


hsbwheel.pdf
Description: Adobe PDF document
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Framed text question

2005-01-19 Thread Brian Kahne
Hi,
I'm new to Context, so hopefully this isn't a completely obvious question, but I 
was wondering whether it was possible to have framed text split across a page. 
In this particular case, I have a code sample that I want to be framed and have 
a different background color than the rest of the text, so I have it surrounded 
by \startframedtext and \stopframedtext.  Is it possible to use \splitfloat to 
split this if the code sample is too large to fit on a single page?  If so, what 
would be the syntax?  If not, is there another mechanism?

Thanks for any help!
Brian Kahne
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Framed text question

2005-01-19 Thread Hans Hagen
Brian Kahne wrote:
Hi,
I'm new to Context, so hopefully this isn't a completely obvious 
question, but I was wondering whether it was possible to have framed 
text split across a page. In this particular case, I have a code sample 
that I want to be framed and have a different background color than the 
rest of the text, so I have it surrounded by \startframedtext and 
\stopframedtext.  Is it possible to use \splitfloat to split this if the 
code sample is too large to fit on a single page?  If so, what would be 
the syntax?  If not, is there another mechanism?
the following background mechanism splits across pages, works over columns, can 
be used nested, can be applied for very dirty tricks, etc

\setupcolors[state=start]
\starttext
\definetextbackground[more][state=start,backgroundcolor=red] % 
location=paragraph
\definetextbackground[test][state=start,backgroundcolor=green]
\page \placefigure[left]{}{}
\starttextbackground[test]
  \readfile{ward}{}{}
  \starttextbackground[more]
\readfile{ward}{}{}
  \stoptextbackground
  \readfile{ward}{}{}
\stoptextbackground
\page \placefigure[right]{}{}
\starttextbackground[test]
  \readfile{ward}{}{}
  \starttextbackground[more]
\readfile{ward}{}{}
  \stoptextbackground
  \readfile{ward}{}{}
\stoptextbackground
\stoptext
-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-


test.pdf
Description: Adobe PDF document
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context