ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Placing a scaled symbol within the flow of text
@ 2005-12-02 17:01 Pearson, Mark (Capita Symonds)
  2005-12-02 18:56 ` Taco Hoekwater
  2005-12-04 21:01 ` Hans Hagen
  0 siblings, 2 replies; 3+ messages in thread
From: Pearson, Mark (Capita Symonds) @ 2005-12-02 17:01 UTC (permalink / raw)


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.

Thanks,

Mark Pearson


**********************************************************************************
This email and any files transmitted with it are confidential, and may be subject to legal privilege, and are intended solely for the use of the individual or entity to whom they are addressed.  
If you have received this email in error or think you may have done so, you may not peruse, use, disseminate, distribute or copy this message. Please notify the sender immediately and delete the original e-mail from your system.

Computer viruses can be transmitted by e-mail. Recipients should check this e-mail for the presence of viruses. The Capita Group and its subsidiaries accept no liability for any damage caused by any virus transmitted by this e-mail.
***********************************************************************************

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Placing a scaled symbol within the flow of text
  2005-12-02 17:01 Placing a scaled symbol within the flow of text Pearson, Mark (Capita Symonds)
@ 2005-12-02 18:56 ` Taco Hoekwater
  2005-12-04 21:01 ` Hans Hagen
  1 sibling, 0 replies; 3+ messages in thread
From: Taco Hoekwater @ 2005-12-02 18:56 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Placing a scaled symbol within the flow of text
  2005-12-02 17:01 Placing a scaled symbol within the flow of text Pearson, Mark (Capita Symonds)
  2005-12-02 18:56 ` Taco Hoekwater
@ 2005-12-04 21:01 ` Hans Hagen
  1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2005-12-04 21:01 UTC (permalink / raw)


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}]
>  
>
a \getscaledglyph{.5}{Serif}{a} a

Hans

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-12-04 21:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-02 17:01 Placing a scaled symbol within the flow of text Pearson, Mark (Capita Symonds)
2005-12-02 18:56 ` Taco Hoekwater
2005-12-04 21:01 ` Hans Hagen

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).