From: Daniel Pittman <daniel@rimspace.net>
Subject: Re: Is it possible to automatically determine font size to fit text to a given space?
Date: Sat, 03 Dec 2005 21:10:26 +1100 [thread overview]
Message-ID: <877jam8p9p.fsf@rimspace.net> (raw)
In-Reply-To: <4390540E.3000501@wxs.nl> (Hans Hagen's message of "Fri, 02 Dec 2005 15:02:54 +0100")
Hans Hagen <pragma@wxs.nl> writes:
> Daniel Pittman wrote:
G'day Hans.
>>Hints about that, or a native TeX method[1], would be very much
>>appreciated. At the moment it is a relatively slow process of manual
>>trial and error.
>
> this is something tex is pretty good at and it runs as fast as normal
>
> how does your current code look? (the solution depends a bit it); think
> of something
Sorry, I should have included that. The cut down version follows; I
have a few more comments and so forth so I can revisit it if I wish.
I didn't make any attempt to automate the process at this stage, but
will have a play with all the suggestion and see if I can get it to
work.
For reference, this is aimed at printing multiple identical labels in
each batch, rather than distinct content on each label, so I don't worry
about the font size changing between the individual labels in the run or
anything.
Regards,
Daniel
\loadmapfile[ec-bitstream-vera.map]
\usetypescriptfile[type-bitstream-vera]
\usetypescript[fiee][bitstream-vera]
\setupbodyfont[bitstream-vera, ss, 10pt]
% Avery Slide labels (L7656) layout.
\definepapersize[L7656][width=46.0mm,height=11.1mm]
\setuppapersize [XY][A4]
\setuppaper [topspace=15.9mm,backspace=6.0mm,dx=4.7mm,dy=1.6mm,nx=4,ny=21]
\setuplayout [page] [topspace=15.9mm,backspace=6.0mm]
\setuplayout [page]
\setuplayout [location=middle]
\setuparranging [XY]
% The layout within the label
\setuplayout[
width=fit,height=fit,
header=1mm,footer=0mm,leftmargin=0mm,rightmargin=0mm,
topspace=1mm,backspace=1mm,
]
\setuppagenumbering[state=stop]
\startbuffer[label]
\vbox{20051112 \crlf Black Rock Cider}
\stopbuffer
\starttext
% skip already printed labels
\dorecurse{30}{~~\page}%
% print a number of labels.
\dorecurse{129}{%
\bf\setupinterlinespace[line=2ex]%
\startalignment[middle]%
\getbuffer[label]%
\stopalignment%
\page}
\stoptext
next prev parent reply other threads:[~2005-12-03 10:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-02 1:14 Daniel Pittman
2005-12-02 14:02 ` Hans Hagen
2005-12-02 15:18 ` Wolfgang Zillig
2005-12-02 15:30 ` Hans Hagen
2005-12-03 10:10 ` Daniel Pittman [this message]
2005-12-04 9:40 ` Gerben Wierda
2005-12-04 20:46 ` Hans Hagen
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=877jam8p9p.fsf@rimspace.net \
--to=daniel@rimspace.net \
--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).