diff options
| author | Eli Zaretskii | 2020-05-23 10:59:39 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2020-05-23 10:59:39 +0300 |
| commit | fb2e34cd2155cbaaf945d8cd167b600b55b9edff (patch) | |
| tree | 2f245d37d7c1d065849e193c57b8953ad01a845c /etc | |
| parent | 13b6dfd4f767a6ce2b01a519fe412dbf80f4921e (diff) | |
| download | emacs-fb2e34cd2155cbaaf945d8cd167b600b55b9edff.tar.gz emacs-fb2e34cd2155cbaaf945d8cd167b600b55b9edff.zip | |
; * etc/TODO (Ligatures): Update the entry based on recent discussions.
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/TODO | 33 |
1 files changed, 25 insertions, 8 deletions
| @@ -220,10 +220,23 @@ https://lists.gnu.org/r/emacs-devel/2013-11/msg00515.html | |||
| 220 | width fonts. However, more features are still needed to achieve this. | 220 | width fonts. However, more features are still needed to achieve this. |
| 221 | 221 | ||
| 222 | ** Support ligatures out of the box | 222 | ** Support ligatures out of the box |
| 223 | For the list of typographical ligatures, see | 223 | For the list of frequently-used typographical ligatures, see |
| 224 | 224 | ||
| 225 | https://en.wikipedia.org/wiki/Orthographic_ligature#Ligatures_in_Unicode_(Latin_alphabets) | 225 | https://en.wikipedia.org/wiki/Orthographic_ligature#Ligatures_in_Unicode_(Latin_alphabets) |
| 226 | 226 | ||
| 227 | (Note that in general, the number of possible ligatures can be much | ||
| 228 | larger, and there's no way, in principle, to specify the superset of | ||
| 229 | all the ligatures that could exist. Each font can support different | ||
| 230 | ligatures. The reliable way of supporting any and all ligatures is to | ||
| 231 | hand all text to be displayed to the shaping engine and get back the | ||
| 232 | font glyphs to display that text. However, doing this is impossible | ||
| 233 | with the current design of the Emacs display engine, since it examines | ||
| 234 | buffer text one character at a time, and implements character | ||
| 235 | composition by calls to Lisp, which makes doing this for every | ||
| 236 | character impractically slow. therefore, the rest of this item | ||
| 237 | describes a limited form of ligature support which is compatible with | ||
| 238 | the current display engine design and uses automatic compositions.) | ||
| 239 | |||
| 227 | For Text and derived modes, the job is to figure out which ligatures | 240 | For Text and derived modes, the job is to figure out which ligatures |
| 228 | we want to support, how to let the user customize that, and probably | 241 | we want to support, how to let the user customize that, and probably |
| 229 | define a minor mode for automatic ligation (as some contexts might not | 242 | define a minor mode for automatic ligation (as some contexts might not |
| @@ -237,12 +250,12 @@ prettify-symbols-mode. We need to figure out which ligatures are | |||
| 237 | needed for each programming language, and provide user options to turn | 250 | needed for each programming language, and provide user options to turn |
| 238 | this on and off. | 251 | this on and off. |
| 239 | 252 | ||
| 240 | The implementation should use the infrastructure for character | 253 | The implementation should use the infrastructure for automatic |
| 241 | compositions, i.e., we should define appropriate regexp-based rules | 254 | character compositions, i.e., we should define appropriate |
| 242 | for character sequences that need to be composed into ligatures, and | 255 | regexp-based rules for character sequences that need to be composed |
| 243 | populate composition-function-table with those rules. See | 256 | into ligatures, and populate composition-function-table with those |
| 244 | composite.el for examples of this, and also grep lisp/language/*.el | 257 | rules. See composite.el for examples of this, and also grep |
| 245 | for references to composition-function-table. | 258 | lisp/language/*.el for references to composition-function-table. |
| 246 | 259 | ||
| 247 | One problem with character compositions that will need to be solved is | 260 | One problem with character compositions that will need to be solved is |
| 248 | that composition-function-table, the char-table which holds the | 261 | that composition-function-table, the char-table which holds the |
| @@ -259,7 +272,11 @@ way of preventing the ligation from happening. One possibility is to | |||
| 259 | have a ZWNJ character separate these ASCII characters; another | 272 | have a ZWNJ character separate these ASCII characters; another |
| 260 | possibility is to introduce a special text property that prevents | 273 | possibility is to introduce a special text property that prevents |
| 261 | character composition, and place that property on the relevant parts | 274 | character composition, and place that property on the relevant parts |
| 262 | of the mode line. | 275 | of the mode line. Yet another possibility would be to write a |
| 276 | specialized composition function, which would detect that it is called | ||
| 277 | on mode-line strings, and return nil to signal that composition is not | ||
| 278 | possible in this case; then use that function in the rules for | ||
| 279 | ligatures stored in composition-function-table. | ||
| 263 | 280 | ||
| 264 | The prettify-symbols-mode should be deprecated once ligature support | 281 | The prettify-symbols-mode should be deprecated once ligature support |
| 265 | is in place. | 282 | is in place. |