Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm having trouble typsetting four consecutive hyphens in a custom font.

Here's a minimal example:

\definesimplefont[myfonthere][myfontname]

\starttext
{\myfonthere ----}
\stoptext

This always comes out as two italicized hyphens. I need four separate hyphens, because this is to represent rolling four minuses on a set of Fudge Dice, which are dice that let you roll a value between -4 and +4.

This may be an incredibly newbie question, but I'm new to ConTeXt, and none of my LaTeX tricks are working here.

share|improve this question
3  
We'd like to keep answers separate from questions, so instead of editing your answer into the question it should be an own answer – and you have in fact written a separate answer. Self-answers are perfectly admissible, and a well-written answer may earn you additional reputation. –  Speravir Apr 24 '13 at 0:35
    
Thank you for that. I saw the "answer your question" button after editing the answer in... and must have forgotten to edit it out! –  gatesphere Apr 24 '13 at 12:00

2 Answers 2

My answer is based on Wolfgang's answer. When the font feature tlig is active, TeX ligatures are active — including the one that merges -- into '–'. You can turn off all font features in the proper way, as described by Wolfgang, if you want such things several times in your document. If you want those discrete dashes just once or twice, this might be good enough for you:

----                           % dashes get merged
{\setfontfeature{none} ----}   % dashes don't get merged
----                           % dashes get merged

If you want to save typing, \setff is a shorter synonym for \setfontfeature.

share|improve this answer
    
Where can I find a description of the exact function of \setff? –  Hans-Peter E. Kristiansen Apr 23 '13 at 21:29
    
@Hans-PeterE.Kristiansen: A combination of two documents, and some guesswork. 1: wiki.contextgarden.net/Command/setff 2:pmrb.free.fr/contextref.pdf, section 5.10 Font feature sets, tlig defaults to no, so not mentioning it in my \setff should work. –  prash Apr 23 '13 at 21:51
1  
@Hans-PeterE.Kristiansen: Looking back at the thread in question, Wolfgang specifies that \setff is just an alias for`\setfontfeature`. Given that, the description in contextref.pdf applies directly. –  prash Apr 23 '13 at 22:04
    
@Hans-PeterE.Kristiansen: See Fonts out of MkIV for details about font features. –  Aditya Apr 23 '13 at 22:30
1  
\addfontfeature, \setfontfeature etc. are nearing obsolescence. Please consult this announcement by Hans for a demonstration of the new, soon to be canonical interface. –  phg Apr 25 '13 at 10:05

Thanks to comments to prash's answer, I hacked together this solution:

\definesimplefont[myfonthere][myfontname][features=none]

\starttext
{\myfonthere ----}
\stoptext

That features=none turned out to be the key.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.