ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* MetaPost graphics with TRT direction
@ 2009-03-25 15:28 Khaled Hosny
  2009-03-26 22:31 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Khaled Hosny @ 2009-03-25 15:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1.1: Type: text/plain, Size: 613 bytes --]

MPost graphics inside TRT direction are placed incorrectly overlapping
the text on the right, similar to what we had with \pdfximage (see the
attached PDF).

This seems to be unrelated to images issue since MPost graphics are
inserted as \pdfliteral. I'm not sure if this an engine or macro issue,
but I'm guessing the later.

Changing the \startMPLIBtoPDF so that the \hbox where the graphics is
placed is fixed to TLT direction fixes this, but I'm not sure if it is
safe to do so. 

Regards,
 Khaled


-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer

[-- Attachment #1.1.2: mpost_trt.tex --]
[-- Type: text/x-tex, Size: 225 bytes --]

\startuseMPgraphic{dummy}
pickup pencircle xscaled 5 rotated 30;
draw unitsquare scaled 20 withcmykcolor (0.3,0.4,0.6,0);
\stopuseMPgraphic

\starttext
\textdir TRT
This is text \useMPgraphic{dummy} and this is too
\stoptext

[-- Attachment #1.1.3: mpost_trt.pdf --]
[-- Type: application/pdf, Size: 4337 bytes --]

[-- Attachment #1.1.4: mpost_trt.fixed.pdf --]
[-- Type: application/pdf, Size: 4337 bytes --]

[-- Attachment #1.1.5: mlib-pdf.tex.diff --]
[-- Type: text/x-diff, Size: 404 bytes --]

--- mlib-pdf.tex.orig	2009-03-25 17:26:53.000000000 +0200
+++ mlib-pdf.tex	2009-03-25 17:27:04.000000000 +0200
@@ -26,7 +26,7 @@
    \xdef\MPheight{\the\dimexpr#4\onebasepoint-#2\onebasepoint\relax}}
 
 \def\startMPLIBtoPDF#1#2#3#4% watch the transparency reset
-  {\hbox\bgroup
+  {\hbox dir TLT\bgroup
    \MPLIBboundingbox{#1}{#2}{#3}{#4}%
    \forgetall
    \setbox\scratchbox\vbox\bgroup

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: MetaPost graphics with TRT direction
  2009-03-25 15:28 MetaPost graphics with TRT direction Khaled Hosny
@ 2009-03-26 22:31 ` Hans Hagen
  2009-03-27 12:07   ` Khaled Hosny
  2009-04-01 14:41   ` MetaPost graph mkiv error Alan BRASLAU
  0 siblings, 2 replies; 4+ messages in thread
From: Hans Hagen @ 2009-03-26 22:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Idris Samawi Hamid

Khaled Hosny wrote:
> MPost graphics inside TRT direction are placed incorrectly overlapping
> the text on the right, similar to what we had with \pdfximage (see the
> attached PDF).
> 
> This seems to be unrelated to images issue since MPost graphics are
> inserted as \pdfliteral. I'm not sure if this an engine or macro issue,
> but I'm guessing the later.
> 
> Changing the \startMPLIBtoPDF so that the \hbox where the graphics is
> placed is fixed to TLT direction fixes this, but I'm not sure if it is
> safe to do so. 

for the moment i did

\def\startMPLIBtoPDF#1#2#3#4% watch the transparency reset
   {\naturalhbox\bgroup

(as \naturalhbox is the official way)

this keeps the internal direction (in textext) the same as the outer one

idris: we need to discuss what aspects of r-l stay r-l and in what cases 
we revert to lr (as here) or even to lr inside constructs

it depends a bit on general rules for arabic typesetting

Hans


-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: MetaPost graphics with TRT direction
  2009-03-26 22:31 ` Hans Hagen
@ 2009-03-27 12:07   ` Khaled Hosny
  2009-04-01 14:41   ` MetaPost graph mkiv error Alan BRASLAU
  1 sibling, 0 replies; 4+ messages in thread
From: Khaled Hosny @ 2009-03-27 12:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Idris Samawi Hamid


[-- Attachment #1.1: Type: text/plain, Size: 1028 bytes --]

On Thu, Mar 26, 2009 at 11:31:48PM +0100, Hans Hagen wrote:
> Khaled Hosny wrote:
>> MPost graphics inside TRT direction are placed incorrectly overlapping
>> the text on the right, similar to what we had with \pdfximage (see the
>> attached PDF).
>>
>> This seems to be unrelated to images issue since MPost graphics are
>> inserted as \pdfliteral. I'm not sure if this an engine or macro issue,
>> but I'm guessing the later.
>>
>> Changing the \startMPLIBtoPDF so that the \hbox where the graphics is
>> placed is fixed to TLT direction fixes this, but I'm not sure if it is
>> safe to do so. 
>
> for the moment i did
>
> \def\startMPLIBtoPDF#1#2#3#4% watch the transparency reset
>   {\naturalhbox\bgroup
>
> (as \naturalhbox is the official way)
>
> this keeps the internal direction (in textext) the same as the outer one

I didn't know about it, thanks for the tip and the fix.

Regards,
 Khaled


-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* MetaPost graph mkiv error
  2009-03-26 22:31 ` Hans Hagen
  2009-03-27 12:07   ` Khaled Hosny
@ 2009-04-01 14:41   ` Alan BRASLAU
  1 sibling, 0 replies; 4+ messages in thread
From: Alan BRASLAU @ 2009-04-01 14:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

MP "graph" works with latest minimals beta in mkii, broken in mkiv.
Minimal example:

\startuseMPgraphic{test}
input graph
draw begingraph(3in,2in);
  gdraw "agepopm.d";
  endgraph;
\stopuseMPgraphic

\starttext
\useMPgraphic{test}
\stoptext

(Of course, you know where to find agepopm.d)

Alan


[-- Attachment #2: test.log --]
[-- Type: text/x-log, Size: 7221 bytes --]

This is LuaTeX, Version snapshot-0.37.0

(test.tex

ConTeXt  ver: 2009.03.30 18:28 MKIV  fmt: 2009.4.1  int: english/english

system         : cont-new loaded
(/usr/local/context/tex/texmf-context/tex/context/base/cont-new.tex
systems         : beware: some patches loaded from cont-new.tex
(/usr/local/context/tex/texmf-context/tex/context/base/cont-new.mkiv) (/usr/local/context/tex/texmf-context/tex/context/base/cont-mtx.tex))
system         : cont-fil loaded
(/usr/local/context/tex/texmf-context/tex/context/base/cont-fil.tex
loading        : Context File Synonyms
)
system         : cont-sys.rme loaded
(/usr/local/context/tex/texmf-context/tex/context/user/cont-sys.rme (/usr/local/context/tex/texmf-context/tex/context/base/type-tmf.tex) (/usr/local/context/tex/texmf-context/tex/context/base/type-siz.tex (/usr/local/context/tex/texmf-context/tex/context/base/type-siz.mkiv)) (/usr/local/context/tex/texmf-context/tex/context/base/type-otf.tex (/usr/local/context/tex/texmf-context/tex/context/base/type-otf.mkiv)))
system         : test.top loaded
%
%	begin of optionfile
%
%	% runtime options files (command line driven)
%	\unprotect
%	% special commands, mostly for the ctx development team
%	% feedback and basic job control
%	% handy for special styles
%	\startluacode
%	document.arguments={
%	}
%	document.files={
%	 "test",
%	}
%	\stopluacode
%	% process info
%	\setupsystem[\c!n=1,\c!m=1]
%	\setupsystem[\c!type=unix]
%	% modes
%	% options (not that important)
%	\startsetups *runtime:options
%	\setupoutput[pdftex]
%	\stopsetups
%	% styles and modules
%	\startsetups *runtime:modules
%	\stopsetups
%	% done
%	\protect \endinput
%
%	end of optionfile
%
(test.top)
fonts          : preloading latin modern fonts
bodyfont       : 12pt rm is loaded
specials       : pdftex loaded
language       : language en is active
(test.tuo) (test.tuo)
systems        : begin file test at line 8
mplib          : loading format: metafun.mp, name: /usr/local/context/tex/texmf-cache/luatex-cache/context/f70b0d481875d119766efabfbdb61af7/formats/cont-en-metafun.mem
! LuaTeX error ...text/tex/texmf-context/tex/context/base/font-def.lua:114: bad argument #1 to 'match' (string expected, got nil)
stack traceback:
	[C]: in function 'match'
	...text/tex/texmf-context/tex/context/base/font-def.lua:114: in function 'get_specification'
	...text/tex/texmf-context/tex/context/base/font-def.lua:726: in function 'command_1'
	<main ctx instance>:1: in main chunk.
\lowleveldefinefont ...1("\luaescapestring {#1}")}
                                                  \ifcase \scaledfontmode \r...
\dododefinefont ...inefont {#2}\rawfontidentifier 
                                                  \let \localrelativefontsiz...
\dodefinedfont ...csname thedefinedfont\endcsname 
                                                  \the \everydefinedfont 
l.6 \MPLIBsettext{421}{\definedfont[]
                                     1}
\processMPgraphic ...e \MPuserinclusions ;\!!es )}
                                                  \global \settrue \METAFUNi...
\handleuseMPgraphic ...hics \processMPgraphic {#3}
                                                  \elabelgroup 
...
l.9 \useMPgraphic{test}
                       
? 
! Missing number, treated as zero.
<to be read again> 
                   \edef 
\lowleveldefinefont ... \scaledfontsize \fi \edef 
                                                  \somefontspec {at \number ...
\dododefinefont ...inefont {#2}\rawfontidentifier 
                                                  \let \localrelativefontsiz...
\dodefinedfont ...csname thedefinedfont\endcsname 
                                                  \the \everydefinedfont 
l.6 \MPLIBsettext{421}{\definedfont[]
                                     1}
\processMPgraphic ...e \MPuserinclusions ;\!!es )}
                                                  \global \settrue \METAFUNi...
...
l.9 \useMPgraphic{test}
                       
? 
! Illegal unit of measure (pt inserted).
<to be read again> 
                   \edef 
\lowleveldefinefont ... \scaledfontsize \fi \edef 
                                                  \somefontspec {at \number ...
\dododefinefont ...inefont {#2}\rawfontidentifier 
                                                  \let \localrelativefontsiz...
\dodefinedfont ...csname thedefinedfont\endcsname 
                                                  \the \everydefinedfont 
l.6 \MPLIBsettext{421}{\definedfont[]
                                     1}
\processMPgraphic ...e \MPuserinclusions ;\!!es )}
                                                  \global \settrue \METAFUNi...
...
l.9 \useMPgraphic{test}
                       
? X
mkiv lua stats : used config path          - /usr/local/context/tex/texmf/web2c/texmf.cnf
mkiv lua stats : used cache path           - /usr/local/context/tex/texmf-cache
mkiv lua stats : modules/dumps/instances   - 129/32/1
mkiv lua stats : input load time           - 0.024 seconds
mkiv lua stats : kernel processing time    - 0.000 seconds
mkiv lua stats : node memory usage         - 14 hlist, 5 vlist, 3 rule, 1 disc, 10 math, 1 glue, 1 kern, 1 penalty, 9 glyph, 112 attribute, 24 glue_spec, 30 attribute_list, 2 temp, 15 dir, 9 pdf_literal
mkiv lua stats : cleaned up reserved nodes - 16 nodes, 13 lists of 476
mkiv lua stats : node processing time      - 0.000 seconds including kernel
mkiv lua stats : attribute processing time - 0.000 seconds
mkiv lua stats : loaded patterns           - us:us:pat:exc:2
mkiv lua stats : language load time        - 0.018 seconds, n=2
mkiv lua stats : startup time              - 0.485 seconds (including runtime option file processing)
mkiv lua stats : jobdata time              - 0.000 seconds saving, 0.000 seconds loading
mkiv lua stats : callbacks                 - direct: 106, indirect: 4808, total: 4914
mkiv lua stats : loaded fonts              - 31 files: eufb10:tfm eufb7:tfm eufb9:tfm eufm10:tfm eufm7:tfm eufm9:tfm lmex10:tfm lmmi12:tfm lmmi7:tfm lmmi9:tfm lmmib10:tfm lmmib7:tfm lmmono12-regular:otf lmmono8-regular:otf lmmono9-regular:otf lmroman12-bold:otf lmroman12-regular:otf lmroman7-bold:otf lmroman7-regular:otf lmroman9-bold:otf lmroman9-regular:otf lmsans12-regular:otf lmsans8-regular:otf lmsans9-regular:otf lmsy10:tfm lmsy7:tfm lmsy9:tfm msam10:tfm msam7:tfm msbm10:tfm msbm7:tfm
mkiv lua stats : fonts load time           - 0.272 seconds
mkiv lua stats : metapost processing time  - 0.022 seconds, loading: 0.015 seconds, execution: 0.022 seconds, n: 0
mkiv lua stats : mps conversion time       - 0.000 seconds
mkiv lua stats : math processing time      - 0.000 seconds
mkiv lua stats : graphics processing time  - 0.000 seconds including tex, n=0
mkiv lua stats : xml load time             - 0.000 seconds, lpath calls: 0, cached calls: 0
mkiv lua stats : lxml load time            - 0.000 seconds preparation, backreferences: 0
mkiv lua stats : result saved in file      - test.pdf
mkiv lua stats : luatex banner             - this is luatex, version snapshot-0.37.0
mkiv lua stats : control sequences         - 32589 of 165536
mkiv lua stats : current memory usage      - 27 MB (ctx: 28 MB)
mkiv lua stats : runtime                   - 32.025 seconds

[-- Attachment #3: Type: text/plain, Size: 487 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2009-04-01 14:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-25 15:28 MetaPost graphics with TRT direction Khaled Hosny
2009-03-26 22:31 ` Hans Hagen
2009-03-27 12:07   ` Khaled Hosny
2009-04-01 14:41   ` MetaPost graph mkiv error Alan BRASLAU

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