ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Taco Hoekwater <taco@elvenkind.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Minimals - problems with format: metafun.mp
Date: Wed, 05 Nov 2008 12:24:37 +0100	[thread overview]
Message-ID: <49118275.90808@elvenkind.com> (raw)
In-Reply-To: <fe8d59da0811041230h33b8a6e5o26bbfec7bda66b4d@mail.gmail.com>

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


Hi,

Meanwhile we found there is a timing issue inside \everyjob.
Hans is thinking really hard about a solution.

Just for verification purposes, you could try the attached,
patched t-openoffice.tex. That one should work, but it is
not a solution, just to verify the bug.

Best wishes,
Taco

luigi scarso wrote:
> 
> 
> On Tue, Nov 4, 2008 at 1:28 PM, Hans Hagen <pragma@wxs.nl 
> <mailto:pragma@wxs.nl>> wrote:
> 
>     Johannes Graumann wrote:
>      > No changes in error message. I attach the code that doesn't work
>     like so:
>      >
>      > context --ctx=t-openoffice Attempt.odt
> 
>     runs ok here
> 
> 
> hmm
> not here
> 
> 
> minimals-beta
> Linux luigicasa-laptop 2.6.24-21-generic #1 SMP Tue Oct 21 23:43:45 UTC 
> 2008 i686 GNU/Linux
> This is LuaTeX, Version snapshot-0.30.2-2008102016, build unknown
> ConTeXt MtxRun | current version: 2008.11.03 09:22
> 
> minimalsBIRTHDAY
> Linux luigicasa-laptop 2.6.24-21-generic #1 SMP Tue Oct 21 23:43:45 UTC 
> 2008 i686 GNU/Linux
> This is LuaTeX, Version snapshot-0.30.2-2008102016, build unknown
> ConTeXt MtxRun | current version: 2008.10.31 13:58
> 
> -- 
> luigi
> 
> 
> ------------------------------------------------------------------------
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

[-- Attachment #2: t-openoffice.tex --]
[-- Type: text/x-tex, Size: 2699 bytes --]

%context --ctx=t-openoffice BoldAndItalicContent.xml

\startenvironment t-openoffice.tex

\checknotes 
\initializeMPgraphics 
\MPLIBregister 
\the \everysetupxml
\ctxlua {input.stoptiming(ctx)}
\checkpreprocessor


  \startluacode
    document.commands = document.commands or { }
    function document.commands.somehexcolor(str)
      local r, g, b = str:match("#(..)(..)(..)")
      r, g, b = tonumber(r,16) or 0, tonumber(g,16) or 0, tonumber(b,16) or 0
      tex.sprint(string.format("\\colored[r=%s,g=%s,b=%s]",r/255,g/255,b/255))
    end
  \stopluacode

  \startxmlsetups office
    \xmlsetsetup{main}{text:p|text:span}{*}
  \stopxmlsetups
  \xmlregistersetup{office}

  \startxmlsetups text:p
    \xmlflush{#1}\endgraf
  \stopxmlsetups

  \startxmlsetups text:span
    \bgroup
      \let\leftofspan \relax
      \let\rightofspan\relax
      \xmlfilter{main}{office:automatic-styles/style:style[@style:name='\xmlatt{#1}{style-name}']/style:text-properties/command(do:style:text-properties)}
      \leftofspan
      \xmlflush{#1}
      \rightofspan
    \egroup
  \stopxmlsetups

  \startxmlsetups do:style:text-properties
    \xmlval{fo:font-weight}            {\xmlatt{#1}{font-weight}}{}% todo: namespaces in attributes
    \xmlval{fo:font-style}             {\xmlatt{#1}{font-style}}{}
    %\xmlval{fo:color}                  {\xmlatt{#1}{color}}{}
    \getvalue{fo:color}{\xmlatt{#1}{color}}
    \xmlval{style:text-position}       {\xmlatt{#1}{text-position}}{}
    \xmlval{style:text-underline-style}{\xmlatt{#1}{text-underline-style}}{}
  \stopxmlsetups

  \xmlmapvalue{fo:font-weight}{bold}{\bf}
  \xmlmapvalue{fo:font-style}{italic}{\em}

  \xmlmapvalue{fo:color}{#ff0000}{\colored[h=ff0000]}
  \setvalue{fo:color}#1{\expandafter\colored\expandafter[h=#1]}
  %\setvalue{fo:color}#1{\edef\temp{\noexpand\ctxlua{document.commands.somehexcolor("\letterhash\uppercase{#1}")}}\temp}

  \catcode`\%=11
  \xmlmapvalue{style:text-position}{sub 58%}  {\def\leftofspan##1\rightofspan{\low {##1}}}
  \xmlmapvalue{style:text-position}{super 58%}{\def\leftofspan##1\rightofspan{\high{##1}}}
  \catcode`\%=14

  \definetextbackground
    [underline]
    [location=text,
     alternative=1,
     background=,
     framecolor=black,
     frame=off]

  %\xmlmapvalue{style:text-underline-style}{solid}{\def\leftofspan##1\rightofspan{\startunderline##1\stopunderline}}
  \xmlmapvalue{style:text-underline-style}{solid}{\let\leftofspan\startunderline\let\rightofspan\stopunderline}

  \setupcolors[state=start]
  
  \starttext
    %\xmlprocess{main}{zip:///\inputfilename.odt?name=content.xml}{}
    \usezipfile[\inputfilename.odt]
    \xmlprocess{main}{*/content.xml}{}
  \stoptext
  
\stopenvironment




[-- 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
___________________________________________________________________________________

  reply	other threads:[~2008-11-05 11:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-02 18:53 Johannes Graumann
2008-11-02 19:58 ` luigi scarso
2008-11-03 19:51   ` Johannes Graumann
2008-11-03 20:34     ` luigi scarso
2008-11-03 20:57     ` luigi scarso
2008-11-04 12:28     ` Hans Hagen
2008-11-04 20:30       ` luigi scarso
2008-11-05 11:24         ` Taco Hoekwater [this message]
2008-11-05 14:26           ` luigi scarso
2008-11-02 20:33 ` Peter Rolf
2008-11-03  9:30   ` Hans Hagen
2008-11-03 10:29     ` Peter Rolf

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=49118275.90808@elvenkind.com \
    --to=taco@elvenkind.com \
    --cc=ntg-context@ntg.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).