Closed mark-summerfield closed 2 hours ago
This feature is out of scope for this project. It's something that should instead be handled by the font library. You are free to use an extended converter if you want to add something like this, or you can look into what it would take for the font library to support this directly.
The reason I think it belongs in asccidoctor-pdf is because surely a font library can only mechanically replace each, say, fl with fl, but cannot distinguish when this should—or should not—be done.
For example, how can a font library know that
The file's name is `filename.txt`.
should become:
The file’s name is `filename.txt`.
i.e., the first "fi" should be converted to a ligature, but not the second?
I'm sorry, but it's just out of scope given the current state of this project. We aren't adding any more features to Asciidoctor PDF unless they are absolutely essential. You're welcome to use an Asciidoctor extension or extended converter to accomplish this, which is very much possible.
I wrote a program that I run over my *.adoc
files which pretty well does it, so I'll keep using that. Thanks.
If you'd like to discuss other ideas, or how to use an extension to do the replacement contextually, I'm always open to have a conversation in the chat.
asciidoctor-pdf already supports a number of Text Replacements, e.g.,
=>
to⇒
.I think it would be helpful to add ligatures so that the following substitutions are done automatically (except as noted below). Replace ff, fi, fl, ffi, ffl, with their corresponding ligatures ff, fi, fl, ffi, ffl.
But do not do any such replacements inside any of: