ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Taco Hoekwater <taco@elvenkind.com>
Subject: Re: Dropped caps, \startlines\stoplines, and indentation question
Date: Sun, 29 Jan 2006 18:59:05 +0100	[thread overview]
Message-ID: <43DD0269.3080505@elvenkind.com> (raw)
In-Reply-To: <af0b241e0601281750j464e5ec2lc9e69e737759f0e9@mail.gmail.com>

Adrian Drury wrote:
> Is there a way to calculate the width of some number of characters (or a 
> string of characters) to use as a dimension parameter? For example, a 
> macro that returns the width in points of 5 space characters in the 
> current font? I figured hardcoding the width of a space as a percentage 
> of an em might work, but would probably not be consistent across fonts. 
> Is that true, or is it really that simple?

That would break now and then. Here is how you get the natural
size of a space:

   \setbox0=\hbox{ }

now \wd0 (the WiDth of box 0) is the 'natural' width of a space.
But note that this is not 100% accurate in normal typesetting,
because TeX adjusts spaces when needed for justification.
Anyway, after this \setbox command,

    5\wd0

is the width of five spaces, etc.

Chees, taco

  reply	other threads:[~2006-01-29 17:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-29  1:50 Adrian Drury
2006-01-29 17:59 ` Taco Hoekwater [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-01-22  4:08 Adrian Drury
2006-01-25 19:59 ` Radhelorn

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=43DD0269.3080505@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).