ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* textext vs. btex ... etex
@ 2010-08-17 14:32 Oliver Buerschaper
  2010-08-17 15:34 ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Oliver Buerschaper @ 2010-08-17 14:32 UTC (permalink / raw)
  To: mailing ConTeXt users list for

[-- Attachment #1: Type: text/plain, Size: 562 bytes --]

Hi,

I've been trying to troubleshoot a problem with TeX labels I ran into the other day... finally I discovered that

1. MkIV (textext) includes TeX material as one single chunk apparently while MkII (btex ... etex) used to include a decomposable picture and that
2. the anchor point is completely different!

Is there any way to restore both the "individual addressing" of glyphs and the MkII anchor point in MkIV?

This would be crucial for a customized labelling macro...

Best,
Oliver


P.S. Why is "h," included as one piece in MkII?




[-- Attachment #2: mkii2.mp --]
[-- Type: application/octet-stream, Size: 471 bytes --]

verbatimtex
    \setupbodyfont[10pt]
etex


pickup pencircle scaled 0.05pt;
defaultpen := savepen;

picture crosshair;
crosshair := image(draw fullcircle scaled 2pt;
                   draw (0,-2pt)--(0,2pt);
                   draw (-2pt,0)--(2pt,0);
                  );

bboxmargin := 0;



beginfig(1);            
    for item within btex $(h,g)$ etex:
        draw bbox item withcolor 0.8white;
        draw item;
    endfor;
    
    draw crosshair;
endfig;



end

[-- Attachment #3: Type: text/plain, Size: 2 bytes --]




[-- Attachment #4: mkii2.pdf --]
[-- Type: application/pdf, Size: 9269 bytes --]

[-- Attachment #5: Type: text/plain, Size: 2 bytes --]




[-- Attachment #6: mkiv2.tex --]
[-- Type: application/octet-stream, Size: 542 bytes --]

\setupbodyfont[10pt]



\starttext


\startMPinclusions
    pickup pencircle scaled 0.05pt;
    defaultpen := savepen;
    
    picture crosshair;
    crosshair := image(draw fullcircle scaled 2pt;
                       draw (0,-2pt)--(0,2pt);
                       draw (-2pt,0)--(2pt,0);
                      );
    
    bboxmargin := 0;
\stopMPinclusions


\startMPpage    
    for item within textext("$(h,g)$"):
        draw bbox item withcolor 0.8white;
        draw item;
    endfor;
    
    draw crosshair;
\stopMPpage


\stoptext

[-- Attachment #7: Type: text/plain, Size: 2 bytes --]




[-- Attachment #8: mkiv2.pdf --]
[-- Type: application/pdf, Size: 8643 bytes --]

[-- Attachment #9: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: textext vs. btex ... etex
  2010-08-17 14:32 textext vs. btex ... etex Oliver Buerschaper
@ 2010-08-17 15:34 ` Hans Hagen
  2010-08-18 12:20   ` Oliver Buerschaper
  0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2010-08-17 15:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 17-8-2010 4:32, Oliver Buerschaper wrote:
> Hi,
>
> I've been trying to troubleshoot a problem with TeX labels I ran into the other day... finally I discovered that
>
> 1. MkIV (textext) includes TeX material as one single chunk apparently while MkII (btex ... etex) used to include a decomposable picture and that
> 2. the anchor point is completely different!
>
> Is there any way to restore both the "individual addressing" of glyphs and the MkII anchor point in MkIV?
>
> This would be crucial for a customized labelling macro...
>
> Best,
> Oliver
>
>
> P.S. Why is "h," included as one piece in MkII?

the fact that you have pieces in mkii is a side effect of dvitomp 
turning dvi output in mp pictures; in the process it combines glyphs 
that have no kerning and whatever spacing becomes shifts

in mkiv the text is treated as a whole and that will not change

so, if in mkiv you want pieces, you need to textext each snippet that 
you want as such

keep in mind that the way mkii (read: external tex processing and 
dvitomp) works is quite unpredictable

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: textext vs. btex ... etex
  2010-08-17 15:34 ` Hans Hagen
@ 2010-08-18 12:20   ` Oliver Buerschaper
  2010-08-18 13:02     ` Khaled Hosny
  2010-08-18 14:34     ` Hans Hagen
  0 siblings, 2 replies; 12+ messages in thread
From: Oliver Buerschaper @ 2010-08-18 12:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> the fact that you have pieces in mkii is a side effect of dvitomp turning dvi output in mp pictures; in the process it combines glyphs that have no kerning and whatever spacing becomes shifts

Oh, I didn't know the pieces used to come about by accident... actually, by a rather favourable accident if I may add :-)


> in mkiv the text is treated as a whole and that will not change

That's rather bad news... then essentially MetaPost is a lost case for retouching digital typography it seems. Will have to switch to Illustrator (with the Scriptographer plugin) for these tasks. Sadly, batch processing and TeX integration will be gone with that alternative.


> so, if in mkiv you want pieces, you need to textext each snippet that you want as such

Alright... in that case how would I make sure that all glyph positions are kept if my TeX material is, say, some complex formula? How could I find the baseline with textext?


> keep in mind that the way mkii (read: external tex processing and dvitomp) works is quite unpredictable

Sure. Similar functionality doesn't need to resort to the same implementation :-)

Oliver
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: textext vs. btex ... etex
  2010-08-18 12:20   ` Oliver Buerschaper
@ 2010-08-18 13:02     ` Khaled Hosny
  2010-08-18 14:00       ` Oliver Buerschaper
  2010-08-18 14:34     ` Hans Hagen
  1 sibling, 1 reply; 12+ messages in thread
From: Khaled Hosny @ 2010-08-18 13:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Aug 18, 2010 at 02:20:51PM +0200, Oliver Buerschaper wrote:
> > the fact that you have pieces in mkii is a side effect of dvitomp turning dvi output in mp pictures; in the process it combines glyphs that have no kerning and whatever spacing becomes shifts
> 
> Oh, I didn't know the pieces used to come about by accident... actually, by a rather favourable accident if I may add :-)
> 
> 
> > in mkiv the text is treated as a whole and that will not change
> 
> That's rather bad news... then essentially MetaPost is a lost case for retouching digital typography it seems. Will have to switch to Illustrator (with the Scriptographer plugin) for these tasks. Sadly, batch processing and TeX integration will be gone with that alternative.

I always develop a kind of romantic relationship with the tools I use, I
either hate it and stop using it no matter what it can or can not do; I
hate OpenOffice and Qt, for example, and I would never, willingly use
either. On the other hand, when I love some tool I never turn my back to
it, no matter what shortcomings it might have, love is blind. I love
TeX, and though it has a horrible macro language, I keep using it.

One don't just drop his tools just because he can't, yet, figure out how
to make it do what he wants. You have to try harder, show your love,
your commitment, it will certainly pay back.

;)

Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: textext vs. btex ... etex
  2010-08-18 13:02     ` Khaled Hosny
@ 2010-08-18 14:00       ` Oliver Buerschaper
  0 siblings, 0 replies; 12+ messages in thread
From: Oliver Buerschaper @ 2010-08-18 14:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> I always develop a kind of romantic relationship with the tools I use, I
> either hate it and stop using it no matter what it can or can not do; I
> hate OpenOffice and Qt, for example, and I would never, willingly use
> either. On the other hand, when I love some tool I never turn my back to
> it, no matter what shortcomings it might have, love is blind. I love
> TeX, and though it has a horrible macro language, I keep using it.
> 
> One don't just drop his tools just because he can't, yet, figure out how
> to make it do what he wants. You have to try harder, show your love,
> your commitment, it will certainly pay back.
> 
> ;)

Sigh.

Oliver
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: textext vs. btex ... etex
  2010-08-18 12:20   ` Oliver Buerschaper
  2010-08-18 13:02     ` Khaled Hosny
@ 2010-08-18 14:34     ` Hans Hagen
  2010-08-21 14:24       ` Oliver Buerschaper
  1 sibling, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2010-08-18 14:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 18-8-2010 2:20, Oliver Buerschaper wrote:
>> the fact that you have pieces in mkii is a side effect of dvitomp turning dvi output in mp pictures; in the process it combines glyphs that have no kerning and whatever spacing becomes shifts
>
> Oh, I didn't know the pieces used to come about by accident... actually, by a rather favourable accident if I may add :-)

Well, it all depends on kerning. So 'abc' can become 'a' 'b' 'c' or 'ab' 
'c' or 'a' 'bc' or 'abc' depending on the kerning pairs. IN math it 
depends on the spacing of math characters.

>> in mkiv the text is treated as a whole and that will not change
>
> That's rather bad news... then essentially MetaPost is a lost case for retouching digital typography it seems. Will have to switch to Illustrator (with the Scriptographer plugin) for these tasks. Sadly, batch processing and TeX integration will be gone with that alternative.
>
>
>> so, if in mkiv you want pieces, you need to textext each snippet that you want as such
>
> Alright... in that case how would I make sure that all glyph positions are kept if my TeX material is, say, some complex formula? How could I find the baseline with textext?

see mp.mplib for all those anchor points

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: textext vs. btex ... etex
  2010-08-18 14:34     ` Hans Hagen
@ 2010-08-21 14:24       ` Oliver Buerschaper
  2010-08-21 14:49         ` Taco Hoekwater
  0 siblings, 1 reply; 12+ messages in thread
From: Oliver Buerschaper @ 2010-08-21 14:24 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing ConTeXt users list for

>>> so, if in mkiv you want pieces, you need to textext each snippet that you want as such
>> 
>> Alright... in that case how would I make sure that all glyph positions are kept if my TeX material is, say, some complex formula? How could I find the baseline with textext?
> 
> see mp.mplib for all those anchor points

OK. I found in mp-mplib.mp that rawtextext() does what I was looking for... the baseline is anchored to the current point:

---
\setupbodyfont[10pt]



\starttext


\startMPinclusions
    pickup pencircle scaled 0.05pt;
    defaultpen := savepen;
    
    picture crosshair;
    crosshair := image(draw fullcircle scaled 2pt;
                       draw (0,-2pt)--(0,2pt);
                       draw (-2pt,0)--(2pt,0);
                      );
    
    bboxmargin := 0;
\stopMPinclusions


\startMPpage    
    for item within rawtextext("$(h,g)$"):
        draw bbox item withcolor 0.8white;
        draw item;
    endfor;
    
    draw crosshair;
\stopMPpage


\stoptext
---

This solves step one!

Now onto step two: how can I typeset each glyph in the formula individually such that it appears precisely in the right location?

Thanks,
Oliver
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: textext vs. btex ... etex
  2010-08-21 14:24       ` Oliver Buerschaper
@ 2010-08-21 14:49         ` Taco Hoekwater
  2010-08-22  7:53           ` Oliver Buerschaper
  0 siblings, 1 reply; 12+ messages in thread
From: Taco Hoekwater @ 2010-08-21 14:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen

On 08/21/2010 04:24 PM, Oliver Buerschaper wrote:
>
> Now onto step two: how can I typeset each glyph in the formula individually such that it appears precisely in the right location?

I must be misreading something here, but I cannot figure out what
'the right location' means.

Best wishes,
Taco
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: textext vs. btex ... etex
  2010-08-21 14:49         ` Taco Hoekwater
@ 2010-08-22  7:53           ` Oliver Buerschaper
  2010-08-22  9:32             ` Taco Hoekwater
  0 siblings, 1 reply; 12+ messages in thread
From: Oliver Buerschaper @ 2010-08-22  7:53 UTC (permalink / raw)
  To: Taco Hoekwater; +Cc: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 345 bytes --]

>> Now onto step two: how can I typeset each glyph in the formula individually such that it appears precisely in the right location?
> 
> I must be misreading something here, but I cannot figure out what
> 'the right location' means.

Since textext() always returns a single picture that can't be decomposed into smaller building blocks


[-- Attachment #2: mkiv3.pdf --]
[-- Type: application/pdf, Size: 8642 bytes --]

[-- Attachment #3: Type: text/plain, Size: 1454 bytes --]



Hans suggested to textext() each desired snippet individually. So I tried

---
\setupbodyfont[10pt]



\starttext


\startMPinclusions
    pickup pencircle scaled 0.05pt;
    defaultpen := savepen;
    
    picture crosshair;
    crosshair := image(draw fullcircle scaled 2pt;
                       draw (0,-2pt)--(0,2pt);
                       draw (-2pt,0)--(2pt,0);
                      );
    
    bboxmargin := 0;
\stopMPinclusions



\startMPpage    
    for item within rawtextext("$(h,g)$"):
        draw bbox item withcolor 0.8white;
        draw item;
    endfor;
    
    draw crosshair;
\stopMPpage


\startMPpage    
    draw bbox rawtextext("$($") withcolor 0.8white;
    draw rawtextext("$($");
    
    draw bbox rawtextext("$h$") withcolor 0.8white;
    draw rawtextext("$h$");
    
    draw bbox rawtextext("$,$") withcolor 0.8white;
    draw rawtextext("$,$");
    
    draw bbox rawtextext("$g$") withcolor 0.8white;
    draw rawtextext("$g$");
    
    draw bbox rawtextext("$)$") withcolor 0.8white;
    draw rawtextext("$)$");
    
    draw crosshair;
\stopMPpage


\stoptext
---

Clearly, this gives me each glyph individually but stacked on top of each other. What I need though is that the second figure looks exactly like the first one (with all glyphs in the right location) except that the grey bounding boxes appear per glyph.

Thanks for your help,
Oliver

[-- Attachment #4: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: textext vs. btex ... etex
  2010-08-22  7:53           ` Oliver Buerschaper
@ 2010-08-22  9:32             ` Taco Hoekwater
  2010-08-24  9:31               ` Oliver Buerschaper
  0 siblings, 1 reply; 12+ messages in thread
From: Taco Hoekwater @ 2010-08-22  9:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 08/22/2010 09:53 AM, Oliver Buerschaper wrote:
>
> Clearly, this gives me each glyph individually but stacked on top of
> each other. What I need though is that the second figure looks
> exactly like the first one (with all glyphs in the right location)
> except that the grey bounding boxes appear per glyph.

I know what you want now, but I have no idea how to go about doing
it via this approach. It could be made to work from the other
direction (by writing lua code to intercept tex nodes) but that is
not trivial either.

You could use standalone metapost with btex ... etex, that would work.

Best wishes,
Taco
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: textext vs. btex ... etex
  2010-08-22  9:32             ` Taco Hoekwater
@ 2010-08-24  9:31               ` Oliver Buerschaper
  2010-08-24 10:19                 ` Taco Hoekwater
  0 siblings, 1 reply; 12+ messages in thread
From: Oliver Buerschaper @ 2010-08-24  9:31 UTC (permalink / raw)
  To: Taco Hoekwater; +Cc: mailing list for ConTeXt users

>> Clearly, this gives me each glyph individually but stacked on top of
>> each other. What I need though is that the second figure looks
>> exactly like the first one (with all glyphs in the right location)
>> except that the grey bounding boxes appear per glyph.
> 
> I know what you want now, but I have no idea how to go about doing
> it via this approach. It could be made to work from the other
> direction (by writing lua code to intercept tex nodes) but that is
> not trivial either.

I see.


> You could use standalone metapost with btex ... etex, that would work.

OK. But then I would lose e.g. OpenType fonts, right?

Oliver
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: textext vs. btex ... etex
  2010-08-24  9:31               ` Oliver Buerschaper
@ 2010-08-24 10:19                 ` Taco Hoekwater
  0 siblings, 0 replies; 12+ messages in thread
From: Taco Hoekwater @ 2010-08-24 10:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users



Oliver Buerschaper wrote:
>>> Clearly, this gives me each glyph individually but stacked on top of
>>> each other. What I need though is that the second figure looks
>>> exactly like the first one (with all glyphs in the right location)
>>> except that the grey bounding boxes appear per glyph.
>> I know what you want now, but I have no idea how to go about doing
>> it via this approach. It could be made to work from the other
>> direction (by writing lua code to intercept tex nodes) but that is
>> not trivial either.
> 
> I see.
> 
> 
>> You could use standalone metapost with btex ... etex, that would work.
> 
> OK. But then I would lose e.g. OpenType fonts, right?

Yes, sorry
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-08-24 10:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-17 14:32 textext vs. btex ... etex Oliver Buerschaper
2010-08-17 15:34 ` Hans Hagen
2010-08-18 12:20   ` Oliver Buerschaper
2010-08-18 13:02     ` Khaled Hosny
2010-08-18 14:00       ` Oliver Buerschaper
2010-08-18 14:34     ` Hans Hagen
2010-08-21 14:24       ` Oliver Buerschaper
2010-08-21 14:49         ` Taco Hoekwater
2010-08-22  7:53           ` Oliver Buerschaper
2010-08-22  9:32             ` Taco Hoekwater
2010-08-24  9:31               ` Oliver Buerschaper
2010-08-24 10:19                 ` Taco Hoekwater

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).