lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: @Font trumps @B & @I (which is a pity)


From: Mark Summerfield
Subject: Re: @Font trumps @B & @I (which is a pity)
Date: Tue, 12 Oct 2010 17:13:07 +0100

On Tue, 12 Oct 2010 12:07:55 +0200
address@hidden (Ludovic Courtès) wrote:
> Hi Mark,
> 
> Mark Summerfield <address@hidden> writes:
> 
> > def @VSChar right x{{VenusSymbol address@hidden@Char x}}
> 
> [...]
> 
> > doesn't work (as noted); but nor does
> >
> > @address@hidden @VSChar{gamma}}
> 
> That’s because @VSChar should check the current value of the
> ‘boldicity’ context variable and choose whether to use ‘Base’ or
> ‘Bold’ based on that.

Ooops, thanks, that works great!

The actual defs I've used are:

def @VSChar right x{
    address@hidden scopeState} @Case {
    bold @Yield {{VenusSymbol address@hidden@Char x}}
    italic @Yield {{VenusSymbol address@hidden@Char x}}
    else @Yield {{VenusSymbol address@hidden@Char x}}
    }
}
def @ScopedBold right x {
  { scopeState @Yield bold } @SetContext {
    { @GetContext scopeState } @Case {
      bold @Yield address@hidden
      else  @Yield {x}
    }
  }
}
def @ScopedItalic right x {
  { scopeState @Yield italic } @SetContext {
    { @GetContext scopeState } @Case {
      italic @Yield address@hidden
      else  @Yield {x}
    }
  }
}

This is because in my use case these things can only be roman, bold, or
italic, but not bold and italic.

However, whenever I use @VSChar{} lout outputs a warning:

no value for context variable `scopeState', using the empty string

I solved this by enclosing the whole para in:

{scopeState @Yield @address@hidden
... # Used @ScopedBold & @ScopedItalic
}

But what I'd really like to do is set the scopeState globally for the
whole document.

Thanks!

-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
    C++, Python, Qt, PyQt - training and consultancy
        "Programming in Python 3" - ISBN 0321680561
            http://www.qtrac.eu/py3book.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]