ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Producing quotesingle glyph
@ 2011-03-19  0:29 Pontus Lurcock
  2011-03-19  8:05 ` Mojca Miklavec
  0 siblings, 1 reply; 11+ messages in thread
From: Pontus Lurcock @ 2011-03-19  0:29 UTC (permalink / raw)
  To: ConTeXt list

Hello,

This may be a stupid question, but I can't work out how to produce the
' character (quotesingle, unicode 0x0027) glyph in a document. Just
typing the character in the source produces a quoteright as expected.
Here are my other attempts:

\starttext
\quotesingle
\getnamedglyphdirect{lm}{quotesingle}
\uchar{00}{39}
\stoptext

They all produce quoteright as well. Does anyone have a better
suggestion? I'm using MkIV, version 2011.02.25 22:03.

Thanks,

Pont
___________________________________________________________________________________
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] 11+ messages in thread

* Re: Producing quotesingle glyph
  2011-03-19  0:29 Producing quotesingle glyph Pontus Lurcock
@ 2011-03-19  8:05 ` Mojca Miklavec
  2011-03-19  8:12   ` Mojca Miklavec
  0 siblings, 1 reply; 11+ messages in thread
From: Mojca Miklavec @ 2011-03-19  8:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, Mar 19, 2011 at 01:29, Pontus Lurcock wrote:
> Hello,
>
> This may be a stupid question, but I can't work out how to produce the
> ' character (quotesingle, unicode 0x0027) glyph in a document. Just
> typing the character in the source produces a quoteright as expected.
> Here are my other attempts:
>
> \starttext
> \quotesingle
> \getnamedglyphdirect{lm}{quotesingle}
> \uchar{00}{39}
> \stoptext
>
> They all produce quoteright as well. Does anyone have a better
> suggestion? I'm using MkIV, version 2011.02.25 22:03.

In font-ini.mkiv you can find

\definefontfeature
  [default]
  [%mode=node,
   liga=yes,kern=yes,tlig=yes,trep=yes] % texligatures=yes,texquotes=yes

You can find those features defined in font-otc.lua, but in short:
trep is responsible for auto-replacing 0x0027 into 0x2019. If you want
to disable that behaviour, you need to turn trep feature off, for
example with
    \definefontfeature[default][liga=yes,kern=yes,tlig=yes] % trep=no
to be more explicit

Sometimes you need to load the font after redefining the features, but
I'm not sure when that is and maybe I'm wrong (it might be true for
Type1 fonts or I may be wrong completely).

Mojca

PS: just as a thought ... it might make sense to map 0x27 to some
(constant) private range slot and make it accessible with some control
sequence. I don't know to what extent that would be usable though, so
maybe that's just a way too silly idea.
___________________________________________________________________________________
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] 11+ messages in thread

* Re: Producing quotesingle glyph
  2011-03-19  8:05 ` Mojca Miklavec
@ 2011-03-19  8:12   ` Mojca Miklavec
  2011-03-19  8:20     ` Khaled Hosny
  0 siblings, 1 reply; 11+ messages in thread
From: Mojca Miklavec @ 2011-03-19  8:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, Mar 19, 2011 at 09:05, Mojca Miklavec wrote:
>
> If you want
> to disable that behaviour, you need to turn trep feature off, for
> example with
>    \definefontfeature[default][liga=yes,kern=yes,tlig=yes]

... or maybe just disable the font feature temporary with
\subff{trep}. In theory that should work, but it didn't when I tried
it.

Mojca
___________________________________________________________________________________
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] 11+ messages in thread

* Re: Producing quotesingle glyph
  2011-03-19  8:12   ` Mojca Miklavec
@ 2011-03-19  8:20     ` Khaled Hosny
  2011-03-19 22:41       ` Pontus Lurcock
  0 siblings, 1 reply; 11+ messages in thread
From: Khaled Hosny @ 2011-03-19  8:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, Mar 19, 2011 at 09:12:42AM +0100, Mojca Miklavec wrote:
> On Sat, Mar 19, 2011 at 09:05, Mojca Miklavec wrote:
> >
> > If you want
> > to disable that behaviour, you need to turn trep feature off, for
> > example with
> >    \definefontfeature[default][liga=yes,kern=yes,tlig=yes]
> 
> ... or maybe just disable the font feature temporary with
> \subff{trep}. In theory that should work, but it didn't when I tried
> it.

You need node mode for that stuff to work.

Regards,
 Khaled

-- 
 Khaled Hosny
 Egyptian
 Arab
___________________________________________________________________________________
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] 11+ messages in thread

* Re: Producing quotesingle glyph
  2011-03-19  8:20     ` Khaled Hosny
@ 2011-03-19 22:41       ` Pontus Lurcock
  2011-03-20  0:33         ` Pontus Lurcock
  2011-03-20  7:11         ` Wolfgang Schuster
  0 siblings, 2 replies; 11+ messages in thread
From: Pontus Lurcock @ 2011-03-19 22:41 UTC (permalink / raw)
  To: ntg-context

Thanks, Mojca and Khaled!

Taking trep out of the default features works nicely, but since in
this case I want quote-replacement as the default and straight
quotes only occasionally, I ended up with the following solution:

\definefontfeature[default][liga=yes,kern=yes,tlig=yes,trep=yes,mode=node]
\definefontfeature[notrep][liga=yes,kern=yes,tlig=yes,trep=no,mode=node]
\def\realquotesingle{{\setfontfeature{notrep}'}}

\starttext

Straight quote: \realquotesingle

Standard quote: '

\stoptext

Will wikify later today in case anyone else ever needs this.

Pont
___________________________________________________________________________________
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] 11+ messages in thread

* Re: Producing quotesingle glyph
  2011-03-19 22:41       ` Pontus Lurcock
@ 2011-03-20  0:33         ` Pontus Lurcock
  2011-03-20  7:11         ` Wolfgang Schuster
  1 sibling, 0 replies; 11+ messages in thread
From: Pontus Lurcock @ 2011-03-20  0:33 UTC (permalink / raw)
  To: ntg-context

On Sun 20 Mar 2011, Pontus Lurcock wrote:

> Will wikify later today in case anyone else ever needs this.

Done: http://wiki.contextgarden.net/Quotesingle . At present it is
only linked from http://wiki.contextgarden.net/Visuals , because
I couldn't find many appropriate related pages.

Pont
___________________________________________________________________________________
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] 11+ messages in thread

* Re: Producing quotesingle glyph
  2011-03-19 22:41       ` Pontus Lurcock
  2011-03-20  0:33         ` Pontus Lurcock
@ 2011-03-20  7:11         ` Wolfgang Schuster
  2011-03-20  7:34           ` Pontus Lurcock
  1 sibling, 1 reply; 11+ messages in thread
From: Wolfgang Schuster @ 2011-03-20  7:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 19.03.2011 um 23:41 schrieb Pontus Lurcock:

> Thanks, Mojca and Khaled!
> 
> Taking trep out of the default features works nicely, but since in
> this case I want quote-replacement as the default and straight
> quotes only occasionally, I ended up with the following solution:
> 
> \definefontfeature[default][liga=yes,kern=yes,tlig=yes,trep=yes,mode=node]

You can add a feature with this:

\definefontfeature[default][default][mode=node]

> \definefontfeature[notrep][liga=yes,kern=yes,tlig=yes,trep=no,mode=node]
> \def\realquotesingle{{\setfontfeature{notrep}'}}


Another option is to disable only a single feature:

\definefontfeature[notrep][trep=no]
\def\realquotesingle{{\addfs{notrep}'}}

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] 11+ messages in thread

* Re: Producing quotesingle glyph
  2011-03-20  7:11         ` Wolfgang Schuster
@ 2011-03-20  7:34           ` Pontus Lurcock
  2011-03-20 10:04             ` Mojca Miklavec
  0 siblings, 1 reply; 11+ messages in thread
From: Pontus Lurcock @ 2011-03-20  7:34 UTC (permalink / raw)
  To: ntg-context

On Sun 20 Mar 2011, Wolfgang Schuster wrote:

> Another option is to disable only a single feature:
> 
> \definefontfeature[notrep][trep=no]
> \def\realquotesingle{{\addfs{notrep}'}}

Thanks, that's more elegant. I've updated the wiki page to include it.

Pont
___________________________________________________________________________________
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] 11+ messages in thread

* Re: Producing quotesingle glyph
  2011-03-20  7:34           ` Pontus Lurcock
@ 2011-03-20 10:04             ` Mojca Miklavec
  2011-03-20 11:35               ` Wolfgang Schuster
  0 siblings, 1 reply; 11+ messages in thread
From: Mojca Miklavec @ 2011-03-20 10:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen

On Sun, Mar 20, 2011 at 08:34, Pontus Lurcock wrote:
> On Sun 20 Mar 2011, Wolfgang Schuster wrote:
>
>> Another option is to disable only a single feature:
>>
>> \definefontfeature[notrep][trep=no]
>> \def\realquotesingle{{\addfs{notrep}'}}
>
> Thanks, that's more elegant. I've updated the wiki page to include it.

Just a question for Hans or Taco: would it be possible to create a
command sequence that would avoid doing the auto-replacement even when
trep is on? Say, \textapostrophe, \asciiapostrophe, \textquote,
\asciiquote or some similar name.

One option would be to automatically create a "virtual font" with
duplicate of 0x27 at some constant slot and then access that glyph
(even though that might have consequences for searching in PDFs). This
is ugly, but maybe there is some better and more elegant approach.

Mojca
___________________________________________________________________________________
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] 11+ messages in thread

* Re: Producing quotesingle glyph
  2011-03-20 10:04             ` Mojca Miklavec
@ 2011-03-20 11:35               ` Wolfgang Schuster
  2011-03-20 12:02                 ` Mojca Miklavec
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Schuster @ 2011-03-20 11:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mojca Miklavec


Am 20.03.2011 um 11:04 schrieb Mojca Miklavec:

> On Sun, Mar 20, 2011 at 08:34, Pontus Lurcock wrote:
>> On Sun 20 Mar 2011, Wolfgang Schuster wrote:
>> 
>>> Another option is to disable only a single feature:
>>> 
>>> \definefontfeature[notrep][trep=no]
>>> \def\realquotesingle{{\addfs{notrep}'}}
>> 
>> Thanks, that's more elegant. I've updated the wiki page to include it.
> 
> Just a question for Hans or Taco: would it be possible to create a
> command sequence that would avoid doing the auto-replacement even when
> trep is on? Say, \textapostrophe, \asciiapostrophe, \textquote,
> \asciiquote or some similar name.

{ : \letteropenbrace, \letterbgroup, \letterleftbrace, \textbraceleft
} : \letterclosebrace, \letteregroup, \letterrightbrace, \textbraceright
& : \letterampersand
< : \letterless
> : \lettermore
# : \letterhash
" : \letterdoublequote, \quotedbl
' : \lettersinglequote, \quotesingle
$ : \letterdollar, \textdollar
% : \letterpercent, \percent
^ : \letterhat
_ : \letterunderscore, \textunderscore
| : \letterbar, \textbar
~ : \lettertilde, \textasciitilde
\ : \letterbackslash, \letterescape, \textbackslash
/ : \letterslash, \textslash
? : \letterquestionmark
! : \letterexclamationmark
@ : \letterat, \textat
: : \lettercolon
` : \textgrave

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] 11+ messages in thread

* Re: Producing quotesingle glyph
  2011-03-20 11:35               ` Wolfgang Schuster
@ 2011-03-20 12:02                 ` Mojca Miklavec
  0 siblings, 0 replies; 11+ messages in thread
From: Mojca Miklavec @ 2011-03-20 12:02 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

On Sun, Mar 20, 2011 at 12:35, Wolfgang Schuster
<schuster.wolfgang@googlemail.com> wrote:
>
> Am 20.03.2011 um 11:04 schrieb Mojca Miklavec:
>
>> On Sun, Mar 20, 2011 at 08:34, Pontus Lurcock wrote:
>>> On Sun 20 Mar 2011, Wolfgang Schuster wrote:
>>>
>>>> Another option is to disable only a single feature:
>>>>
>>>> \definefontfeature[notrep][trep=no]
>>>> \def\realquotesingle{{\addfs{notrep}'}}
>>>
>>> Thanks, that's more elegant. I've updated the wiki page to include it.
>>
>> Just a question for Hans or Taco: would it be possible to create a
>> command sequence that would avoid doing the auto-replacement even when
>> trep is on? Say, \textapostrophe, \asciiapostrophe, \textquote,
>> \asciiquote or some similar name.
>
> ' : \lettersinglequote, \quotesingle

This is the right one, but if autoreplacement 0x27->0x2019 is on, it
doesn't help - this will still generate the curly 0x2019.

Mojca
___________________________________________________________________________________
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] 11+ messages in thread

end of thread, other threads:[~2011-03-20 12:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-19  0:29 Producing quotesingle glyph Pontus Lurcock
2011-03-19  8:05 ` Mojca Miklavec
2011-03-19  8:12   ` Mojca Miklavec
2011-03-19  8:20     ` Khaled Hosny
2011-03-19 22:41       ` Pontus Lurcock
2011-03-20  0:33         ` Pontus Lurcock
2011-03-20  7:11         ` Wolfgang Schuster
2011-03-20  7:34           ` Pontus Lurcock
2011-03-20 10:04             ` Mojca Miklavec
2011-03-20 11:35               ` Wolfgang Schuster
2011-03-20 12:02                 ` Mojca Miklavec

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