lout-users
[Top][All Lists]
Advanced

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

Re: Filter input/parsing timing


From: Nathan Bell
Subject: Re: Filter input/parsing timing
Date: Fri, 08 Jun 2007 11:27:18 -0600
User-agent: Thunderbird 1.5.0.10 (X11/20070302)

Thanks for the advice. Just for posterity, I had to create by barcode function as such:

def @Barcode
named @H {.75i}
named @W {2i}
right x
{
   def @BarCode
   left y
   right x
   {
       def @Filter {"wbar -b \"" y "\"" > @FilterOut}
       {lines @Break x}
   }
   {x @BarCode {}} @Graphic { @W @Wide //@H }
}

where wbar is the external application to create a barcode. It's called as such:

@Barcode @W {2.5i} @H {.375i} {barcode to encode}

If anyone wants the Tcl / C application I use (or a pure C application) to create the barcodes, give me a holler and I'll hook you up.

Jeff Kingston wrote:
Although the right parameter of a filtered symbol goes directly from
the input file into the filter with no possibility of variable
substitution first, the filter command itself does go through
Lout variable substitution.  So you need to move your filter
input from stdin to a command line option, like this:

def @BarCode
  left product_code
  right junk
{
  def @Filter { "product_code_to_barcode -c \"" product_code "\"" }
}

This way, when you call

    17830-363 @BarCode {}

you will be executing your filter as

    product_code_to_barcode -c "17830-363"

It will be fed an empty stdin file, or rather a file with just
a newline in it, the result of passing the contents of {}
uninterpreted to the filter.  You don't have to read that file.

If I've understood you correctly, the output of your filter is
text of the form

   { ... } @Graphic { ... }

This Lout object will then be the value of 17830-363 @BarCode {}
as desired.  It sounds like you have the best (most flexible) plan
for getting the size right, so no need to change anything there.

Jeff


reply via email to

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