Re: [NTG-context] \getscaledglyph

2011-01-20 Thread Thomas Floeren
Thank you, Willi, I wasn't aware of this nice font module!
(btw, running it on ArialUnicode with 2 columns and 10pt produces 500 PDF pages 
and a peak memory usage of 1.2 GB!).

I like the idea of using glyph names rather than unicode numbers. For my actual 
purpose your suggestion works perfectly, with \fontchar{emptyset}. 

Beside this there are many glyphs with only "math names" (the rightmost column 
in the fnt-10 output). I couldn't make \fontchar work with these. For example 
the fore-mentioned char "2300 works with \fontchar{uni2300} but not with 
\fontchar{varnothing}.

Is there a way to set these chars by their math name?

Thomas


On Jan 20, 2011, at 16:37, Willi Egger wrote:

> Hi Thomas,
> 
> I had to do some work with regard to this issue recently.
> 
> What was mentioned on this list, is, that \fontchar is a command which will 
> stay.
> 
> \setupbodyfont[Myfont,rm,12pt]
> \definesymbol[Q.alt]  [\fontchar{Q.alt}]
> \def\Qa{\symbol[Q.alt]}
> 
> The easiest way to get a stable environment is to use the char-names from the 
> font. You can extract a table with all char-names with 
> 
> \usemodule[fnt-10]
> \setupbodyfont[Myfont,rm,12pt]
> \starttext
>   \ShowCompleteFont{Myfont.otf}{10pt}{1} % fontname, size,columns
>   % \ShowAllGlyphs   {Myfont}{48pt}{4} % fontname, size,columns  
> \stoptext
> 
> Kind regards
> 
> Willi
> On 20 Jan 2011, at 08:51, Thomas Floeren wrote:
> 
>> Hi,
>> 
>> I did a rather huge update step from my working context 2010.09.29 to the 
>> actual beta. I noted that \getscaledglyph doesn’t work anymore. 
>> 
>> I use it a lot for symbol insertions like this:
>> 
>> \definefontsynonym [ArialU] [name:ArialUnicodeMS]
>> \definesymbol [Diameter] [\getscaledglyph{1.5}{ArialU}{\char"2300}]
>> \def\Diam{\symbol[Diameter]}
>> 
>> \starttext
>> hello \Diam\ goodbye
>> \stoptext
>> 
>> 
>> ( \getglyph seems to work as usual: \definesymbol [Diameter] 
>> [\tfb\getglyph{ArialU}{\char"2300}] )
>> 
>> Should I better change my definitions or is it just a bug?
>> 
>> 
>> 
>> Thank you
>> & Greetings
>> Thomas
>> 
>> 
>> MTXrun | current version: 2011.01.18 19:34
>> This is LuaTeX, Version beta-0.65.0-2010121316
>> 
>> ___
>> 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
>> ___
> 
> ___
> 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
> ___

___
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
___


Re: [NTG-context] delimitedtext, spacebefore and grid

2011-01-20 Thread Oliver Heins
Wolfgang Schuster  writes:

> Am 20.01.2011 um 17:04 schrieb Oliver Heins:
>
>> Hello,
>> 
>> I want to have both a halfline space before and after blockquotations.
>> Normally, this works fine; after the quotation the main text snaps
>> back to the grid (see page 3 of the example file).
>> 
>> \setupdelimitedtext
>>  [blockquote]
>>  [spacebefore=halfline]
>
> spacebefore={force,halfline}

Hello Wolfgang, thank you for your answer.  Sadly, your solution only
works for blockquotes starting at the top of the page.  When blockquotes
are broken up between two pages the main text doesn't find its way back
to the grid (see page 2 of my minimal example).

Another point is: The space inserted at the top of the page is not a
half line big but of one and a half line.

>> […]
>> 
>> \setuppapersize[a5][A4]
>
> \setuppapersize[A5][A4]

Thanks, it was a typo.  I already wondered about how huge an A5-sized
page in ConTeXt is :) However, the setup of my minimal example
illustrates the problems best on A4, so *here* it should read either
\setuppapersize[A4] or nothing (since A4 seems to be the default
anyway).

Best regards,
 olli

-- 
Oliver Heins he...@sopos.org  http://www.sopos.org/olli
GPG: F27A BA8C 1CFB B905 65A8  2544 0F07 B675 9A00 D827
1024D/9A00D827 2004-09-24 -- gpg --recv-keys 0x9A00D827
Please avoid sending me Word or PowerPoint attachments:
http://www.gnu.org/philosophy/no-word-attachments.html
___
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
___


Re: [NTG-context] delimitedtext, spacebefore and grid

2011-01-20 Thread Wolfgang Schuster

Am 20.01.2011 um 17:04 schrieb Oliver Heins:

> Hello,
> 
> I want to have both a halfline space before and after blockquotations.
> Normally, this works fine; after the quotation the main text snaps
> back to the grid (see page 3 of the example file).
> 
> \setupdelimitedtext
>  [blockquote]
>  [spacebefore=halfline]

spacebefore={force,halfline}

> […]
> 
> \setuppapersize[a5][A4]

\setuppapersize[A5][A4]

Wolfgang
___
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
___


[NTG-context] delimitedtext, spacebefore and grid

2011-01-20 Thread Oliver Heins
Hello,

I want to have both a halfline space before and after blockquotations.
Normally, this works fine; after the quotation the main text snaps
back to the grid (see page 3 of the example file).

\setupdelimitedtext
  [blockquote]
  [spacebefore=halfline]

However, this fails when the blockquote is the first element on the
page, either because a new blockquote starts on the top of the page
(cf. p. 1) or because a blockquote continues from the last page
(cf. p. 2).  Is it possible to tell ConTeXt to insert a halfline of
space on the top of the page in these cases?

TIA,
 olli


\setuppapersize[a5][A4]
\setuplayout[location=middle,marking=on,grid=yes]
\setupbodyfont[14pt]

\setupdelimitedtext
  [blockquote]
  [spacebefore=halfline]

\showgrid

\starttext

\startblockquote
  \input tufte
\stopblockquote

\dorecurse{2}{\input tufte}

\startblockquote
  \input tufte
\stopblockquote

\dorecurse{3}{\input tufte}

\startblockquote
  \input tufte
\stopblockquote

\input tufte

\stoptext


-- 
Oliver Heins he...@sopos.org  http://www.sopos.org/olli
GPG: F27A BA8C 1CFB B905 65A8  2544 0F07 B675 9A00 D827
1024D/9A00D827 2004-09-24 -- gpg --recv-keys 0x9A00D827
Please avoid sending me Word or PowerPoint attachments:
http://www.gnu.org/philosophy/no-word-attachments.html
___
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
___


Re: [NTG-context] \getscaledglyph

2011-01-20 Thread Willi Egger
Hi Thomas,

I had to do some work with regard to this issue recently.

What was mentioned on this list, is, that \fontchar is a command which will 
stay.

\setupbodyfont[Myfont,rm,12pt]
\definesymbol[Q.alt]  [\fontchar{Q.alt}]
\def\Qa{\symbol[Q.alt]}

The easiest way to get a stable environment is to use the char-names from the 
font. You can extract a table with all char-names with 

\usemodule[fnt-10]
\setupbodyfont[Myfont,rm,12pt]
\starttext
\ShowCompleteFont{Myfont.otf}{10pt}{1} % fontname, size,columns
% \ShowAllGlyphs   {Myfont}{48pt}{4} % fontname, size,columns  
\stoptext

Kind regards

Willi
On 20 Jan 2011, at 08:51, Thomas Floeren wrote:

> Hi,
> 
> I did a rather huge update step from my working context 2010.09.29 to the 
> actual beta. I noted that \getscaledglyph doesn’t work anymore. 
> 
> I use it a lot for symbol insertions like this:
> 
> \definefontsynonym [ArialU] [name:ArialUnicodeMS]
> \definesymbol [Diameter] [\getscaledglyph{1.5}{ArialU}{\char"2300}]
> \def\Diam{\symbol[Diameter]}
> 
> \starttext
> hello \Diam\ goodbye
> \stoptext
> 
> 
> ( \getglyph seems to work as usual: \definesymbol [Diameter] 
> [\tfb\getglyph{ArialU}{\char"2300}] )
> 
> Should I better change my definitions or is it just a bug?
> 
> 
> 
> Thank you
> & Greetings
> Thomas
> 
> 
> MTXrun | current version: 2011.01.18 19:34
> This is LuaTeX, Version beta-0.65.0-2010121316
> 
> ___
> 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
> ___

___
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
___


Re: [NTG-context] How to run Typesetting in MetaPost example (MetaFun)?

2011-01-20 Thread luigi scarso
You can also use mkii as command line drawing tool:
#> mtxrun texexec test.tex

\starttext
\startTEXpage
\resetMPdrawing
\startMPdrawing
picture pic[] ;
numeric wid[], len[], pos[], n ;
wid[0] := len[0] := pos[0] := n := 0 ;
\stopMPdrawing

\def\whatever#1%
{\appendtoks#1\to\MPtoks
 \setbox\MPbox=\hbox{\bfd\the\MPtoks}%
 \startMPdrawing
 n := n + 1 ; len[n] := \the\wd\MPbox ;
 \stopMPdrawing
 \startMPdrawing[-]
 pic[n] := textext("\bfd\setstrut\strut#1") ;
 pic[n] := pic[n] shifted - llcorner pic[n] ;
 \stopMPdrawing}

\handletokens MetaPost is Fun!\with\whatever

\startMPdrawing
 pair len ; len := origin ;
 for i=1 upto n :
   draw pic[i] shifted len ;
   draw boundingbox pic[i] shifted len
  withpen pencircle scaled .25pt withcolor red ;
   len := len+(xpart lrcorner pic[i]-xpart llcorner pic[i],0) ;
 endfor ;
\stopMPdrawing

\MPdrawingdonetrue\getMPdrawing

\stopTEXpage
\stoptext


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


Re: [NTG-context] How to run Typesetting in MetaPost example (MetaFun)?

2011-01-20 Thread Verhaag, G.C.H.M.

Aditya Mahajan wrote:


On Tue, 18 Jan 2011, Verhaag, G.C.H.M. wrote:


Hi,

I wanted to try (using ConTeXt minimals MkIV) the example on page 228 
of the MetaFun manual, dealing with typesetting in MetaPost.



I haven't look at the metapost manual ... but


The code is given as:

\resetMPdrawing
\startMPdrawing
picture pic[] ;
numeric wid[], len[], pos[], n ;
wid[0] := len[0] := pos[0] := n := 0 ;
\stopMPdrawing

\def\whatever#1%
{\appendtoks#1\to\MPtoks
\setbox\MPbox=\hbox{\bfd\the\MPtoks}%
\startMPdrawing
 n := n + 1 ; len[n] := \the\wd\MPbox ;
\stopMPdrawing
\startMPdrawing[-]
 pic[n] := textext("\bfd\setstrut\strut#1") ;
 pic[n] := pic[n] shifted - llcorner pic[n] ;
\stopMPdrawing}

\handletokens MetaPost is Fun!\with\whatever

But is won't run. The following message is generated:



The actual error message said

! Undefined control sequence.
\@@toks ->\MPtoks

So add

\newtoks\MPtoks

After which you get

! Undefined control sequence.
\whatever ...endtoks #1\to \MPtoks \setbox \MPbox

so add

\newbox\MPbox

After that the file compiles but you get an empty image. There are two 
things missing in the code. First you don't tell actually draw the 
metapost drawing. for that, add


\MPdrawingdonetrue \getMPdrawing \resetMPdrawing


Still an empty page. Again the pic[n] is calculated but never drawn. 
So add


  draw p[n] shifted (n*1cm,0) ;

(or perhaps along a more sophisticated path),

and now you have a working example:

\newtoks\MPtoks
\newbox\MPbox

\resetMPdrawing
\startMPdrawing
  picture p[] ;
  numeric wid[], len[], pos[], n ;
  wid[0] := len[0] := pos[0] := n := 0 ;
\stopMPdrawing

\def\whatever#1%
{\appendtoks#1\to\MPtoks
 \setbox\MPbox=\hbox{\bfd\the\MPtoks}%
 \startMPdrawing
  n := n + 1 ; len[n] := \the\wd\MPbox ;
  p[n] := textext("\bfd\setstrut\strut#1") ;
  p[n] := p[n] shifted - llcorner p[n] ;
  draw p[n] shifted (n*1cm,0) ;
 \stopMPdrawing}

\starttext
\handletokens MetaPost is Fun!\with\whatever

\MPdrawingdonetrue \getMPdrawing \resetMPdrawing

\stoptext

You could also have just used the macros from meta-txt:

\useMPlibrary[txt]

\startMPdefinitions
  newpath RotPath ;
  RotPath = fullcircle scaled 3cm ;
\stopMPdefinitions

\starttext
\followtokens{Metapost is fun \quad}
\stoptext

@Hans: Perhaps we can have a more ConTeXtist interface to this macro:

\definetextonepath
   [whatever]
   [color=...,
style=...,
mp=..., % path specification
   ]

\whatever{Metapost is fun}

Aditya


Hi,

Okay, that makes things more clear, but couldn't find this in the 
manual! Maybe it is very obvious to someone more familiar with METAPOST.


Well, I also tried the nice macro example on page 232 of the MetaFun 
manual by Hans, and got of course the same problems. But after I added the


\newtoks\MPtoks
\newbox\MPbox

definitions to the file, it worked!

Also the Inkscape alternative is very useful, thanks for helping me out!

Regards,
Gerard
___
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
___


Re: [NTG-context] Translating PDF-files

2011-01-20 Thread Yury G. Kudryashov
Alan BRASLAU wrote:

> A fun exercise is to put a text through google translate into any
> language, then pass the result back into the original language.
> 
> via Russian: Fun exercise is to put the text through Google Translate in
> any language, and then pass the result back to the original language.
The Russian translation is much worse than the English->Russian->English 
one.

___
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
___


Re: [NTG-context] Labels in MetaPost (MetaObj)

2011-01-20 Thread Taco Hoekwater

On 01/18/2011 01:17 PM, Stefan Müller wrote:

Hi list,

I'm having some trouble with MetaPost in general and MetaObj in
particular.


The core problem is that context mkiv loads the metapost code twice
when you are typesetting labels, and that causes trouble for metaobj
which does not expect that. Sorry, I do not know of any solution.
Maybe Hans does?

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
___