Replicating Malthus with text-replace

Primary tabs

13 posts / 0 new
Last post
howcome's picture
Offline
Joined: 4 Jan 2008 - 6:24pm
Replicating Malthus with text-replace
0

I’m working on a project which other may find interesting. I’m trying to replicate a publication from 1798 (Malthus’ Essay on the Principle of Population as it affects the future improvement of society). The source files are HTML (from Project Gutenberg) and I’ve added a CSS style sheet to produce a PDF file as close to the printed edition as possible, while still keeping the HTML in a browsable form. Here are links to my edition:

http://css4.pub/2015/malthus/essay.html
http://css4.pub/2015/malthus/essay.pdf

And here’s the original from 1798:

https://archive.org/details/essayonprincipl00malt

The PDF is produced with Prince.

The printed first edition uses long s. I didn’t feel like changing the HTML source files for this purpose and instead uses the ‘text-replace’ property in CSS to achieve this:

text-replace: “s” “\017F”

Now, the long s should not be used at the end of a word, so exceptions must also be coded:

text-replace: “\017F\20” “s\20”

There are more such exceptions, see the HTML source for the set I’ve been using. I know that some fonts also encode these substitutions. However, I believe it is easier for authors/replicators to edit the CSS source. Changing font files is frowned upon, no? Also, some other interesting substitutions are encoded. For example, to change “etc.” to “&c.”, one can use:

text-replace: “etc.” “\26 c.”

And “economist” to “œconomist”:

text-replace: “economist” “\153 conomist”

The ‘text-replace’ property is described here:

https://books.spec.whatwg.org/#character-substitution

It would be interesting to hear of similar projects and how presentational substitutions are encoded.

In the past, I’ve also replicated Henrik Ibsen’s poems from 1871 in the same manner, it’s linked from here:

http://css4.pub

Cheers, Håkon

Riccardo Sartori's picture
Joined: 13 Jul 2009 - 4:20am
-1

Very interesting project!
In a perfect world, the right form of |s| would be automatically handled via OpenType features in the font, but support in applications is still spotty (https://www.typotheque.com/fonts/opentype_feature_support), more so in browsers (http://caniuse.com/#feat=font-feature).

Nick Shinn's picture
Offline
Joined: 8 Jul 2003 - 11:00am
0

I’ve put an OpenType feature which follows the 18th century English language convention for long s, in several of my typefaces—but none of them are revivals from that era.

sub longs' f by s;
sub longs longs' by s;
sub f longs' by s;
ignore sub longs' @hist1;
sub longs' by s;

(@hist1 = lower case characters)

howcome's picture
Offline
Joined: 4 Jan 2008 - 6:24pm
+1

@Nick,

I'm trying to understand your code. Don't you also need to have a "sub s by longs;" at the beginning to perform the majority of subsitutions? And, the last line seems to revert all substitutions? How to you express that an "s" at the end of a word should remain "s"?

howcome's picture
Offline
Joined: 4 Jan 2008 - 6:24pm
+1

@riccard0

I can see two reasons against encoding this in the font files. First, is it acceptable/legal for users like me to edit the font files if a font doesn't have the feature I need? Second, I'm not sure that the rules for handling longs are set -- they may vary from language to language or era to era. Having several features in every font file may be an option, but using the human-readable (albeit with unicode code point) 'text-transform' property seems like a more compact and editable solution?

Riccardo Sartori's picture
Joined: 13 Jul 2009 - 4:20am
0

First, is it acceptable/legal for users like me to edit the font files if a font doesn't have the feature I need?

Not unless the license allows it, but you can select an appropriate font and serve it as webfont.

the rules for handling longs [...] may vary from language to language or era to era

They do. That's why you have both language and historical related features.
As I said, that would be the right solution for the user in a perfect word, where copying the text and pasting it using a different font would not end up with characters either missing or rendered with yet another different font.
Today, especially for the creator, your solution is probably the best, and indubitably a very clever one.

Michel Boyer's picture
Offline
Joined: 2 Jun 2007 - 1:01pm
-1

What Nick used is Contextual substitutions i.e. substitutions that occur only in a specified context (for example substitute an s only when followed by a letter). LuaTeX allows using .fea (Adobe feature) files to do that so as to get the functionality without modifying the font.

Vladimir Tamari's picture
Offline
Joined: 4 Nov 2007 - 11:15pm
0

My AlQuds Arabic font featured a nicely extended letter /ra but it clashed with the following mark in a couple of specific cases. To correct it I used a contextual Marks feature to change the mark position when that combination occurs, implemented as an OpenType feature in MS VOLT tool. Iffue solved.

Reynir Heiðberg Stefánsson's picture
Joined: 19 Nov 2010 - 11:15am
0

@howcome: The "ignore sub" takes care of that. It details when a substitution is not to happen. The net effect is that 'longs' is substituted by 's' unless it is followed by a lower-case character.

Nick Shinn's picture
Offline
Joined: 8 Jul 2003 - 11:00am
0

@howcome: true, there is no standard for long s usage.
I based my code on studying this excellent resource:
http://babelstone.blogspot.ca/2006/06/rules-for-long-s.html

howcome's picture
Offline
Joined: 4 Jan 2008 - 6:24pm
0

Thanks to all for enlightening me. I've now also found an inconsistency in the original 1798 edition: "necessity" is spelled with double ss, on page 35; however, on page 42 it is written "neceſsity". So the practice must have caused some confusion, even back then.

Reynir Heiðberg Stefánsson's picture
Joined: 19 Nov 2010 - 11:15am
0

Either that, or the setter had run out of 'ſ'.

howcome's picture
Offline
Joined: 4 Jan 2008 - 6:24pm
0