Forum Feature requests

optical margin

jim_albright
InDesign allows a setting of "optical margin". This puts some text into the margin area to make a smoother margin. Opening quote, serif of cap were two places that I saw that it made a difference. Please check into adding this as an option for CSS and Prince.

Thanks.

Jim Albright
Wycliffe Bible Translators

mikeday
Sure, it would be a good feature to have; I'll add it to the roadmap.
jim_albright
I love your positive responses. That is one of the big reasons that I am pushing for a publishing path using Prince.

Is there any tool to help build the CSS?

I am sitting in a class right now where someone built a custom interface that exposes all of the settings that we want to use for publishing scripture using InDesign.

What I envision is creating a menu/choices creating tool that takes an XML file for input and displays the menu/choices available.

When you run the menu program and make choices the output is the CSS.

Since all of the text that is actually displayed is in the XML file, changing languages of the interface will be easy. Also because the menu options are created from the XML source file adding and deleting the options displayed in menu/choices is also easy.

Has anyone already done this?

Jim Albright
Wycliffe Bible Translators

mikeday
I'm not aware of an existing tool like this, but it does sound like a reasonably straightforward thing to develop, and a good tool to have.
whit537
+1 for this feature.
jim_albright
Still would like optical margin. :)

Jim Albright
Wycliffe Bible Translators

mikeday
Me too! :D
dauwhe
You guys want to write up a spec for it? I'll run it by the working group :)

Dave
mikeday
Oh no, this is how we get suckered into supporting more features! :)
jim_albright
Suggested Values for Optical Justification

These values may be suitable for common seriffed fonts like Times New Roman, Palatino, or Garamond. Other fonts may need different values.
Characters Value
" “ ” ' ‘ ’, . 100%
hyphen 75%
en-dash 50%
em-dash 25%
A T V W Y 20%
C O 10%

from Wikipedia

Jim Albright
Wycliffe Bible Translators

mikeday
There are OpenType features opbd, lfbd, rtbd, defined by Adobe which I think are intended for use with optical justification. But I'm not sure if any common fonts actually provide these features.
jim_albright
I've asked our type designers if they include any of these settings in our fonts. Also I've ask if graphite supports optical margins.

Jim Albright
Wycliffe Bible Translators

jim_albright
None of the SIL fonts support the optical margins. Neither does graphite. :(.

Jim Albright
Wycliffe Bible Translators

twardoch
I have checked a collection of >120,000 quality commercial and open-source OpenType fonts from practically all relevant font vendors, and not a single font contains the opbd feature, because that feature is a bit stupid. I mean, it shouldn’t exist. :) The lfbd and rtbd features are sufficient. The layout engine should just apply the lfbd feature on the left margin and the rtbd feature on the right margin. opbd has no practical use, and I think that feature has been registered in OpenType prematurely.

Only a very small number of fonts include the lfbd and rtbd features. The reason for it is two-fold: no type design app offers a sensible user interface for type designers to implement these, and no app (except, I believe, XeTeX) supports it at this point.

The only font family that includes lfbd and rtbd that I’m aware (and quite well-designed, too) of is EB Garamond, the wonderful, rich open-source Garamond design:
https://bitbucket.org/georgd/eb-garamond/downloads

Another family that only has a few glyphs covered by lfbd/rtbd is Linux Libertine: http://www.linuxlibertine.org/index.php?id=1&L=1

I think these two may be the only two families that include the optical margins features. The situation may perhaps change in future as I’m aware of at least one font editor that is getting a nice GUI for devising optical margins features.

Edited by twardoch

phillipgessert
Just posting to also request this feature, would make Prince practically perfect in my eyes.
jim_albright
This is still high up on my want list too.

Jim Albright
Wycliffe Bible Translators

JBR
I've been looking for methods to hang punctuation, both at the start and within paragraphs. The current CSS 'hanging-punctuation' spec seems to be lacking options for "within". (See: http://stevehickeydesign.com/blog/2012/12/04/hanging-punctuation-with-css/ for a good analysis).

Will Prince's "optical-margin", when available, accommodate hanging punctuation within paragraphs (i.e. blocks) as well as at the start and end? Is there an interim solution for lines within blocks that anyone here might know about, using JavaScript or otherwise?

It occured to me that I might use <q> tags (despite this not being perfectly semantic) for DOM access, but would like to know if this has been or is being addressed in other ways.
JBR
In the event there's no better, current solution: if anyone else here is looking to do this, I've found a somewhat heavy-handed method using JavaScript to split lines and insert <span> tags (that can then be manipulated to hang any punctuation with CSS): http://stackoverflow.com/a/27925305

Would still like to know about Prince's upcoming "optical-margin" property, though…
jim_albright
Thanks for the links. Indesign has optical margin now.

Jim Albright
Wycliffe Bible Translators

dauwhe
Note that Webkit is implementing hanging-punctuation now. There's a discussion of how it should work starting at https://lists.w3.org/Archives/Public/www-style/2016Mar/0073.html. We'd welcome input on the feature should be defined in CSS.
therewasatime
For the sake of completeness: https://developer.mozilla.org/en-US/docs/Web/CSS/hanging-punctuation.

Only Safari has (partial) support.

Edited by therewasatime

jim_albright
Thanks for including the Safari note. I was disappointed when my firefox view didn't work. Then I remembered your note. :( Here is hoping that others get there too. When I was typesetting Bibles my graphic artist really wanted this feature.

Jim Albright
Wycliffe Bible Translators

twantzen
These posts are very interesting! I didn't know about the OT features opbd (depracated!), lfbd, rtbd! Exciting!

But since most of our template layouts are styled in InDesign, this feature would be really good to have in princeXML either! So I clearly second this feature request!

I can think of an improvement:
Analogous to the feature -prince-text-replace you should be able to define your own character behaviour for the left and/or right border.
Let's say we get a -prince-optical-margins, than one could define:
p {
  -prince-optical-margins: "\0022“”„“'‘’,." "rtbd:100%" "»«" "rtbd:50%" "»«" "ltbd:50%" [...]
}

Or similar ...

Tobias

Edited by twantzen