Hanging Punctuation

Alter Littera's picture

In the course of developing a revival of Mergenthaler Linotype's Benedictine (1915-1922), I am considering the possibility of including hanging punctuation marks (quotes, periods, colons, hyphens and the like) in the OpenType implementation. I was thinking of using contextual alternates to substitute punctuation marks at the begining/ending of lines with the corresponding hanging (null-width) marks. However, I haven't been able to figure out how to detect within the "calt" feature a begin/end of line event. Is this possible? Or, more generally, is there any way of implementing mechanically this type of substitutions?

Thanks in advance for your advice.

Bert Vanderveen's picture

Why would you want to do that? It is a feature in inDesign (don't know about QuarkXPress, haven’t used that for years).

Alter Littera's picture

Thanks for responding.
Apart from ID, I don't know of any other software doing this. I thought it could be a nice addition to the font.

eliason's picture

This strikes me as something you do *with* a font, not *in* a font.

Alter Littera's picture

Thanks for replying.
I just wanted to know if it could be done *within* the font through some OpenType selectable feature, and contextual alternates seemed the most appropriate to me. It would be nice to have hanging punctuation at one's disposal outside ID.

Joshua Langman's picture

I actually applaud you for trying to do this within the font itself, though unfortunately I can't give you any practical advice. InDesign's "optical margin alignment" does a whole lot more than just hang punctuation, so in fact there isn't simply a way to get all your commas and quotes in the margin without other things ending up in the margin as well.

JamesM's picture

Seems like that's more in the realm of paragraph settings in the application.

eliason's picture

To answer your question, AFAIK beginning/ending of lines isn't something opentype coding can detect. I was looking for this when experimenting with swashes to no avail.

Vladimirsson's picture

Microtype package for LaTeX/XeLaTeX/LuaLaTeX does that (among other things). It uses per-font configs which specify how far a particular glyph will extend beyond the page border (which could be probably included in the font itself, if there was a corresponding OpenType feature — but right now it is not exactly a standard).

kentlew's picture

Although the inherently technical jargon of the discussion probably obscures the fact, hanging punctuation is something that is ostensibly possible with the Optical Bounds features — {opbd} {lfbd} {rtbd} — discussed recently here: http://typophile.com/node/100183

But these features are not implemented in any common software that I know of.

It’s also possible to get something like this to happen with GSUB Type 5 contextual substitutions – relying on some careful ignore sub statements — but it’s a bit of a hack and can become cumbersome. And I think it will only deploy reliably with beginning-of-line cases, not end-of-line. If you put this in {calt} however, then it will be on by default; it’s best not to put discretionary features in {calt}.

kentlew's picture

Another possible approach just occurred to me. I haven’t thought through all the possible ramifications.

You could probably deploy a certain amount of hanging punctuation using a series of space-punctuation / punctuation-space contextual substitutions, combined with backstopped kerning pairs.

    sub space @punct' by @punct_hang_left;
    sub @punct' space by @punct_hang_right; 

You’d need relevant sets of .calt_hanglft and .calt_hangrt alternates with sidebearings adjusted accordingly. And you’d want to put in positive kerning pairs between space and these alternates to restore “normal” spacing, since they’ll be substituted throughout the text. But then, when they occur at the beginning or end of a line, the kerning won’t be relevant and the adjusted sidebearings will create the hanging effect.

However, it might not be possible to account for hyphens in automatic hyphenation. You’d have to test applications to see whether or not they respect a separately encoded u+00AD soft hyphen in a font, along with any subsequent gsub (which would just be a single subst in this case, not a contextual subst).

And this approach won’t work on any punctuation at the beginning of a paragraph — opening quote, as a primary example — since there’s no preceding space, obviously.

It would take some tinkering to cover all eventualities. But there might be potential in this approach.

Jack B. Nimblest Jr.'s picture

I thought this too. The " is hanging with a huge kern on 0 width and pairs fix it when it's not to hang...

"However, it might not be possible to account for hyphens in automatic hyphenation."

And does OT layout see < space-CR-" > the same as < space-" > ?

"And this approach won’t work on any punctuation at the beginning of a paragraph — opening quote, as a primary example"

...but it would if one made a composite of each Uppercase letter with a hanging “, and sub for each “-Cap typed, for a Cap with a hanging “ attached... maybe?

Alter Littera's picture

Thanks to you all for your time and advice. Although some of the ideas mentioned go beyond my limited abilities with OpenType, I think I understand the main points. I will play around with them and will post here any progress. And if anyone has any further suggestion, please let me know. As in Statistics and Econometrics, the null hypothesis that hanging punctuation is possible within a font will be maintained until sufficient empirical evidence is found against it.
Cheers.

kentlew's picture

David —

And does OT layout see < space-CR-" > the same as < space-" > ?

No, I’m pretty certain that a hard return is a boundary for both OT backtrack and lookahead input sequences. Now that I think about it, it’s probable that any line end, soft or hard, bounds both the backtrack and lookahead also. And layout engines generally treat the intermediate space as belonging to the previous line, which is how this would work for end-of-line.

But, like I said, I didn’t test this overall approach. You’re right, it might not work at all with beginning-of-line.

...but it would if one made a composite of each Uppercase letter with a hanging “, and sub for each “-Cap typed, for a Cap with a hanging “ attached... maybe?

Interesting. Yeah, that would probably work. But you’d have to go through the trouble of composing all those quotedblleft_capital.hanging “logotypes” and then kern the space to them all. Could be scripted, I reckon.

I’d probably approach beginning-of-line with the ignore sub approach I mentioned before. It’s pretty reliable for this situation.

Jack B. Nimblest Jr.'s picture

"Could be scripted, I reckon."

OTish for classable;)

But if one knew the line's beginnings and ends, a fairly important piece of typographic-enabling info, then the next thing one'd like to know before setting a line, would be where the next line's ascent is going to set. Then, regardless of how hideously slow all composition would be, one'd know everything they'd need to. It's just barely not endless...

JamesM's picture

Even if you found a way to implement it, I wonder how many users would actually want that feature in a font. My guess is that most folks who'd want hanging punctuation probably use Quark or InDesign, programs that already have the built-in capability to do it. Outside of that group of users, I'm not sure if most other users even know what hanging punctuation is.

altsan's picture

Scribus has something called 'optical margins' which certainly appears to have the effect of 'hanging' various punctuation marks.

John Hudson's picture

Kent: It’s also possible to get something like this to happen with GSUB Type 5 contextual substitutions – relying on some careful ignore sub statements — but it’s a bit of a hack and can become cumbersome.

It also has the unintended consequence of messing up in-line spacing of contextually triggered line-initial or -terminal substitutions or spacing adjustments at glyph run boundaries. Remember, OpenType Layout is applied to glyph runs, and these can be terminated by many things other than beginning and end of line: change of font (including weight or style change within the same family), change of point size, change of direction in bidi text, and even change of text colour in some software.

charles ellertson's picture

Hmmm. As long as you're trying to get fonts to do things they were never intended to do, how about tackling something important: create a font that, whenever used, turns a book into a bestseller.

John Hudson's picture

Judging from a recent perusal of the bestseller stands at Chapters, apparently that type is Minion.

Alter Littera's picture

Maybe the "null hypothesis" should be rejected, after all. I was just looking for a simple way of implementing automatic hanging punctuation within the fonts I am currently working on, but it seems from your comments and my own tries in the last hours that there exists no such simple way. If only CR, LF, TAB, ... were easily recognizable from within OpenType ... Thank you very much for your comments.

kentlew's picture

messing up in-line spacing of contextually triggered line-initial or -terminal substitutions

Part of the reason for the hack is that these line-ending substitutions don’t seem to be implemented in everybody’s favorite InDesign. Even twiddling under the hood through scripting to toggle the feature, I have not been able to get {falt} deployed. And there doesn’t seem to be a line-initial equivalent “{ialt}”.

(I’m not really talking about hanging punctuation anymore. Not especially my interest.)

Perhaps ME edition includes support for {falt}, but I don’t see it with vanilla InD.

eliason's picture

If you're really persistent, Mark Simonson tells me that Apple's somewhat obscure ATT format has the ability to detect line beginnings and endings...

kentlew's picture

My guess is that most folks who'd want hanging punctuation probably use Quark or InDesign, programs that already have the built-in capability to do it.

In all fairness to Alter Littera and his original query, you cannot achieve the effect of traditional hanging punctuation, as shown in the example, with InDesign’s Story > Optical Margin Alignment setting. Basically, that is not a Hanging Punctuation feature.

In Quark 8, however, you do have specific and fine-grained control over hanging punctuation, and the traditional effect is pretty easily achieved — where it should be: in the layout application, not in the font. This is, in fact, one area where Quark surpasses InDesign, IMO.

Vladimirsson's picture

My guess is that most folks who'd want hanging punctuation probably use Quark or InDesign

Or TeX.

charles ellertson's picture

Yes, TeX gives the most flexibility, most control. Back when Richard Eckersley was alive, he flirted off & on with using hanging punctuation. Richard was enamored with the constant text page, preferring to card rather than run long or short pages. While he'd never presume to tell a compositor how to set type, he even preferred to card over ending a page with an orphan, or either ending or beginning a page with less than a full line of type (including paragraph indents).

We tried all manner of hanging punctuation -- left side only (only quote marks), and both left & right sides. We kept running into tricky constructions on the right, How about period-closequote (now quotedblright)? Hang both? How about quoteright followed by quotedblright? And when that's preceded by a period? Always hang hyphens? How about en-dashes. Etc.

Ultimately, Richard gave up on the notion, Nice in theory, often too awkward in practice.

While Richard's fame was probably for The Telephone Book, he was the consummate designer; in a restrained way (usually), he considered every detail. Before pretty much abandoning hanging punctuation, we worked with it a number of years, and with varying kinds of texts.

Here's a link to a web site built by his son, Sam.

http://www.richardeckersley.net/

(With Sam making a strong showing in the field, there are now three generations of Eckersley graphic designers...)

hrant's picture

Wait a second, you mean Ronell's "The Telephone Book"? All these years I've thought all that "concrete poetry" was the author's design... I guess that's false?

hhp

Syndicate content Syndicate content