ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* First Line After Whitespace Styling
@ 2011-05-27 16:08 Marc Trius
  2011-05-27 16:30 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Trius @ 2011-05-27 16:08 UTC (permalink / raw)
  To: ntg-context

Hi,
I would like to be able to specify a style that would apply to text that appears on the first line of a paragraph after whitespace. I have no idea how to go about it. 

Specifically, I have a font with an alternate glyph that can only be used after whitespace, and I would like to have it used automatically when appropriate. 

Thank you,
Marc Trius

-- 
Marc Trius <derpayatz@riseup.net>

"The enemy is the gramophone mind, whether or not one agrees with the record that is being played at the moment." --- George Orwell
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: First Line After Whitespace Styling
  2011-05-27 16:08 First Line After Whitespace Styling Marc Trius
@ 2011-05-27 16:30 ` Wolfgang Schuster
  2011-05-27 19:08   ` Marc Trius
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2011-05-27 16:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 27.05.2011 um 18:08 schrieb Marc Trius:

> Hi,
> I would like to be able to specify a style that would apply to text that appears on the first line of a paragraph after whitespace. I have no idea how to go about it. 
> 
> Specifically, I have a font with an alternate glyph that can only be used after whitespace, and I would like to have it used automatically when appropriate. 

Do you want a initial?

\setupinitial[state=start]

\starttext
\placeinitial \input knuth
\stoptext

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: First Line After Whitespace Styling
  2011-05-27 16:30 ` Wolfgang Schuster
@ 2011-05-27 19:08   ` Marc Trius
  2011-05-27 19:19     ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Trius @ 2011-05-27 19:08 UTC (permalink / raw)
  To: ntg-context

On Fri, 27 May 2011 18:30:53 +0200
Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:

> 
> Am 27.05.2011 um 18:08 schrieb Marc Trius:
> 
> > Hi,
> > I would like to be able to specify a style that would apply to text that appears on the first line of a paragraph after whitespace. I have no idea how to go about it. 
> > 
> > Specifically, I have a font with an alternate glyph that can only be used after whitespace, and I would like to have it used automatically when appropriate. 
> 
> Do you want a initial?
> 
> \setupinitial[state=start]
> 
> \starttext
> \placeinitial \input knuth
> \stoptext
> 
> Wolfgang
> 

No, what is something like:

...

\starttypescript      [Standard]
      \definetypeface [Standard] [rm] [serif] [frankruehl]       [default] [features=default]
      \definetypeface [Alt]    [rm] [serif] [frankruehl] [default] [features=alt]
  \stoptypescript

...

{\Alt This is the first line after a whitespace, this is the linebreak} and this is the rest of the paragraph. I'd like to have a macro that automatically styles the first line only so I don't have to guess at linebreaks every time I edit the text.

I need to do this because in texts that are written with the Hebrew alphabet, a shorter glyph of the tallest letter, 'lamed,' is used inside a block of text than in a first line, so that the interline space can be smaller. Employing this technique makes the difference between a pretty good and a really first-rate typesetting job :)

Thanks,
Marc

> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


-- 
Marc Trius <derpayatz@riseup.net>

"The enemy is the gramophone mind, whether or not one agrees with the record that is being played at the moment." --- George Orwell
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: First Line After Whitespace Styling
  2011-05-27 19:08   ` Marc Trius
@ 2011-05-27 19:19     ` Wolfgang Schuster
  2011-05-27 20:37       ` Marc Trius
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2011-05-27 19:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 27.05.2011 um 21:08 schrieb Marc Trius:

> No, what is something like:
> 
> ...
> 
> \starttypescript      [Standard]
>      \definetypeface [Standard] [rm] [serif] [frankruehl]       [default] [features=default]
>      \definetypeface [Alt]    [rm] [serif] [frankruehl] [default] [features=alt]
>  \stoptypescript
> 
> ...
> 
> {\Alt This is the first line after a whitespace, this is the linebreak} and this is the rest of the paragraph. I'd like to have a macro that automatically styles the first line only so I don't have to guess at linebreaks every time I edit the text.
> 
> I need to do this because in texts that are written with the Hebrew alphabet, a shorter glyph of the tallest letter, 'lamed,' is used inside a block of text than in a first line, so that the interline space can be smaller. Employing this technique makes the difference between a pretty good and a really first-rate typesetting job :)

Adapt the following to your case:

\setupbodyfont[pagella]

\definefontfeature[allcaps][smcp=yes,c2sc=yes]

\starttext

\TreatFirstLine {\addff{allcaps}} {} {} {}
The Earth, as a habitat for animal life, is in old age and has a fatal illness. Several, in fact. It would be happening whether humans had ever evolved or not. But our presence is like the effect of an old-age patient who smokes many packs of cigarettes per day — and we humans are the cigarettes.

\stoptext

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: First Line After Whitespace Styling
  2011-05-27 19:19     ` Wolfgang Schuster
@ 2011-05-27 20:37       ` Marc Trius
  0 siblings, 0 replies; 5+ messages in thread
From: Marc Trius @ 2011-05-27 20:37 UTC (permalink / raw)
  To: ntg-context

On Fri, 27 May 2011 21:19:29 +0200
Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:

> 
> Am 27.05.2011 um 21:08 schrieb Marc Trius:
> 
> > No, what is something like:
> > 
> > ...
> > 
> > \starttypescript      [Standard]
> >      \definetypeface [Standard] [rm] [serif] [frankruehl]       [default] [features=default]
> >      \definetypeface [Alt]    [rm] [serif] [frankruehl] [default] [features=alt]
> >  \stoptypescript
> > 
> > ...
> > 
> > {\Alt This is the first line after a whitespace, this is the linebreak} and this is the rest of the paragraph. I'd like to have a macro that automatically styles the first line only so I don't have to guess at linebreaks every time I edit the text.
> > 
> > I need to do this because in texts that are written with the Hebrew alphabet, a shorter glyph of the tallest letter, 'lamed,' is used inside a block of text than in a first line, so that the interline space can be smaller. Employing this technique makes the difference between a pretty good and a really first-rate typesetting job :)
> 
> Adapt the following to your case:
> 
> \setupbodyfont[pagella]
> 
> \definefontfeature[allcaps][smcp=yes,c2sc=yes]
> 
> \starttext
> 
> \TreatFirstLine {\addff{allcaps}} {} {} {}
> The Earth, as a habitat for animal life, is in old age and has a fatal illness. Several, in fact. It would be happening whether humans had ever evolved or not. But our presence is like the effect of an old-age patient who smokes many packs of cigarettes per day — and we humans are the cigarettes.
> 
> \stoptext
> 
> Wolfgang
> 
>
This works perfectly! Also, the \addff is going to make my life much easier. Thank you very much.

Marc
 ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


-- 
Marc Trius <derpayatz@riseup.net>

"The enemy is the gramophone mind, whether or not one agrees with the record that is being played at the moment." --- George Orwell
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2011-05-27 20:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-27 16:08 First Line After Whitespace Styling Marc Trius
2011-05-27 16:30 ` Wolfgang Schuster
2011-05-27 19:08   ` Marc Trius
2011-05-27 19:19     ` Wolfgang Schuster
2011-05-27 20:37       ` Marc Trius

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