intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Feb 22, 2019 10:35 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Thu May 03, 2012 5:47 pm 
Offline

Joined: Wed Jan 19, 2011 3:36 pm
Posts: 101
I'd like to include an em-dash (U+2014) in my story description, but Inform is flattening it to an ordinary (ASCII) dash (I checked, it really is ASCII and not some weird formatting thing). I think that under the Treaty of Babel, which states that iFiction is a UTF-8 format (Section 5.2, "Encoding"), it should be possible to encode any Unicode character into such bibliographic data. So how do I do it? I can't use "[unicode 1234]" because that doesn't get substituted at all.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu May 03, 2012 7:29 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5921
There are a number of bugs in the processing of the metadata lines. This may have been fixed as part of bug 553 (fix not yet released) but I'm not positive.

http://inform7.com/mantis/view.php?id=553


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu May 03, 2012 7:51 pm 
Offline

Joined: Wed Jan 19, 2011 3:36 pm
Posts: 101
I must wonder, however, how it managed to take an em dash and produce a "hyphen minus" (ASCII dash) without human intent. I suppose I'll just chain 3 dashes and/or use the babel metadata editor to fix it after release (which is a long way away, so I'll make a note of it).


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu May 03, 2012 8:04 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5921
There's obviously some (wrong) level of charset filtering going on in the current compiler. I tried a test case; it left "ö" alone, converted "—" to a hyphen, and "€" wound up as "[unicode 8364]".


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu May 03, 2012 8:39 pm 
Offline
User avatar

Joined: Tue Aug 02, 2011 3:45 pm
Posts: 366
Location: Iowa
Writing with Inform, section 5.10: "As it reads in the text, Inform silently converts all kinds of dash (en-rules, em-rules, etc.) to simple hyphens, all kinds of space other than tabs (em-spaces, non-breaking spaces, etc.) to simple spaces, and all kinds of quotation marks to "straight" (non-smart) marks."

Makes me think that it was originally intentional, maybe for compatibility reasons? It's always bugged me, though.

_________________
Unhand that gun. Begone.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri May 04, 2012 11:45 am 
Offline
User avatar

Joined: Tue Nov 17, 2009 5:25 pm
Posts: 954
Afterward wrote:
Writing with Inform, section 5.10: "As it reads in the text, Inform silently converts all kinds of dash (en-rules, em-rules, etc.) to simple hyphens, all kinds of space other than tabs (em-spaces, non-breaking spaces, etc.) to simple spaces, and all kinds of quotation marks to "straight" (non-smart) marks."

Makes me think that it was originally intentional, maybe for compatibility reasons? It's always bugged me, though.

This is why many, me included, are forced to use the double dash (--) in place of the extralong one (—).
So, is there a way around this?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri May 04, 2012 12:14 pm 
Offline

Joined: Fri May 06, 2011 7:15 pm
Posts: 490
Location: The Big Apple
One of my pet peeves is the use of typewriter conventions such as double hyphens in place of em-dashes, and single hyphens in place of en-dashes and minus signs. It pains me every time I have to do that in Inform 7. It is ironic, indeed, that technology has completely supplanted the typewriter (to the point where a large percentage of the population has never seen one except perhaps in movies), yet typographical relics which came into existence solely as a result of the mechanical limitations of the typewriter continue to plague us.


Robert Rothman


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri May 04, 2012 12:53 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5921
Quote:
This is why many, me included, are forced to use the double dash (--) in place of the extralong one (—).
So, is there a way around this?


You can always use "[unicode 8212]" in game text. It's only in the metadata lines (such as story title and story description) that this poses problems.

Gargoyle systematically displays "--" as a single en-dash (not the wider em-dash). Letting the interpreter handle it is not ideal, but it does have one advantage; it works for every game.

If it were up to me, I'd drop this transform on dashes, but keep it for spaces. (Whitespace in source code can contain all sorts of garbage that the user almost never intends to carry through to the game, and which interpreters almost never have consistent display rules for.)

Quotes are tricky because I7 already rewigs them from single to double (according to a complex but usually successful set of rules) (which are easy for the user to override by saying [']). Trying to preserve curly-vs-straightness through this process would probably be a disaster. I can see an argument for the compiler generating curly quotes all the time, and also an argument for the interpreter curlifying them (as Gargoyle does).


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri May 04, 2012 1:16 pm 
Offline

Joined: Tue Apr 27, 2010 1:02 pm
Posts: 801
zarf wrote:
Gargoyle systematically displays "--" as a single en-dash (not the wider em-dash).


Gargoyle will convert "---" to an em-dash.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri May 04, 2012 1:57 pm 
Offline

Joined: Thu Oct 22, 2009 4:31 pm
Posts: 1309
bcressey wrote:
zarf wrote:
Gargoyle systematically displays "--" as a single en-dash (not the wider em-dash).


Gargoyle will convert "---" to an em-dash.


Ben, it seems like it would be productive to change Gargoyle's behavior so that the double hyphen is expanded to the em dash. The double dash is pretty much universally used to stand in for the em dash--know what I mean?--whereas most people would never think to use a triple dash for this purpose. (Moreover, since the triple dash isn't so converted by other interpreters, it would look silly anywhere but in Gargoyle.)

I'm not sure there is a need for en dash conversion. If you need to use an en dash in standard English text, you should probably rewrite so you don't need it (it's generally used for complicated compound modifiers). It might be safe, though, to autoconvert a single hyphen to an en dash when it is surrounded by spaces. This would accord with 19th century style typography as well as the use of the en dash in printed equations, e.g. 9 - 5 = 4.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group