ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Taco Hoekwater <taco@elvenkind.com>
Subject: Re: Placing a scaled symbol within the flow of text
Date: Fri, 02 Dec 2005 19:56:16 +0100	[thread overview]
Message-ID: <439098D0.6020708@elvenkind.com> (raw)
In-Reply-To: <4A78B8B834217341AA3152A47BB3C44701F23FFA@CAPITACAREXCH01.central.ad.capita.co.uk>

Pearson, Mark (Capita Symonds) wrote:
> Hi all,
> 
> I am attempting to insert a symbol at a reduced size within the
> text flow but I'm not sure how to achieve this.
> 
> I've included my test script below. 
> 
> \starttext
> 
> \definefontsynonym[Dingbats][uzdr]
> \definesymbol[filledSq][\getglyph{Dingbats}{\char110}]
> 
> \def\FilledSq{\symbol[filledSq]}
> \def\FilledSquare{\scale[height=0.5ex]{\symbol[filledSq]}}
> 
> \switchtobodyfont[20pt]
> 
> \startlines
> \FilledSq Here is a line
> This is one line
> and this should be another
> \FilledSq Hello again 
> \FilledSquare and again!!
> and here are some more lines
> this is the last one
> \stoplines
> 
> \stoptext
> 
> When a \FilledSq is inserted, the text which follows appears 
> on the same line but when a \FilledSquare is inserted the text 
> which follows appears on the line below. I'm probably using 
> \scale in an inappropriate way and I'm sure don't know my
> \vbox's from my \hbox's!
> 
> Any examples of how to reduce the size of a glyph whilst
> still being able to insert it as a normal character in the 
> text flow would be greatly appreciated.

In TeX terms, \scale creates a \hbox. If TeX is in vertical
mode (as it is when \startlines is in effect, because every line
is a paragraph by itself in the mode), then a simple \hbox is
not a good enough hint to make it switch to horizontal (paragraph)
mode. So need another command to switch TeX to paragraph building
mode, and it is:

   \def\FilledSquare%
     {\dontleavehmode\scale[height=0.5ex]{\symbol[filledSq]}}

Cheers, Taco

  reply	other threads:[~2005-12-02 18:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-02 17:01 Pearson, Mark (Capita Symonds)
2005-12-02 18:56 ` Taco Hoekwater [this message]
2005-12-04 21:01 ` 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=439098D0.6020708@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).