Auto-feature suggestion for Greek

Greek OpenType features suggestion:
Greek-specific features are absent in most fonts but there should be three substitutions, first two of which should be ideally done by a text layout engine but only InDesign is smart enough to support. The last one is a solution to the misuse of periodcentered caused by antique keyboard layouts.

  1. Capital letters with tonos have to be substituted with normal letters:
    The letters Ά Έ Ή Ί Ό Ύ Ώ only occur at the beginning of a word in a lowercase-dominant text. In all-cap setting, all tonos caps need to be tonos-less. Unless you want to resolve PDF text extraction issue, addition of tonos-less alternates is not necessary.
    The code logic should be the following, and be written in calt, case, and/or ccmp (given that InDesign’s all-cap option does exactly what it’s supposed to do, support in case feature may not be necessary):
    If a tonos capital is followed by another capital letter, suppress
    If a tonos capital is preceded by another capital letter, suppress
    There are single-letter words with tonos (e.g. ώ). You need to check them across word spaces and punctuations.
  2. As an additional rule, if there is a diphthong whose first letter has a tonos, the second letter (either ι or υ) should have a dieresis when converted to all cap. (άυλες > ΑΫΛΕΣ)
    άι έι όι ύι becomes ΑΪ ΕΪ ΟΪ ΥΪ in all-cap
    άυ έυ ήυ όυ ώυ becomes ΑΫ ΕΫ ΗΫ ΟΫ ΩΫ in all-cap
    Some of the vowel combinations that are not listed here do exist (e.g. ήι ώι), but they are not diphthongs and dieresis insertion should not happen.
  3. In Greek keyboard, anoteleia is not accessible, instead periodcentered is used. When periodcentered is preceded by a greek letter, it should be substituted with anoteleia. In dictionary use, letter-periodcentered-letter sequence is probably a legitimate case of periodcentered and therefore should not be substituted. For the graphical difference between periodcentered and anoteleia, see this link:
    http://leonidas.org/greek-type-design/examples-of-ano-teleia-use/
4 Likes

That sounds like a good idea.

2 Likes

My suggestion (in ccmp?)

lookup grek_dieresisCapInsertion {
	script grek;
	sub [Alphatonos Epsilontonos Omicrontonos Upsilontonos] Iota' by Iotadieresis;
	sub [Alphatonos Epsilontonos Etatonos Omicrontonos Omegatonos] Upsilon' by Upsilondieresis;
	sub [alphatonos.sc epsilontonos.sc omicrontonos.sc upsilontonos.sc] iota.sc' by iotadieresis.sc;
	sub [alphatonos.sc epsilontonos.sc etatonos.sc omicrontonos.sc omegatonos.sc] upsilon.sc' by upsilondieresis.sc;
} grek_dieresisCapInsertion;

lookup grek_tonosCap {
	script grek;
	# tonos supression of single-letter word
    sub @grekCapsTonos' @nonLetter @nonLetter @nonLetter @nonLetter @nonLetter @grekCaps by @grekCapsTonosless;
    sub @grekCapsTonos' @nonLetter @nonLetter @nonLetter @nonLetter @grekCaps by @grekCapsTonosless;
    sub @grekCapsTonos' @nonLetter @nonLetter @nonLetter @grekCaps by @grekCapsTonosless;
    sub @grekCapsTonos' @nonLetter @nonLetter @grekCaps by @grekCapsTonosless;
    sub @grekCapsTonos' @nonLetter @grekCaps by @grekCapsTonosless;
	sub @grekCaps @nonLetter @nonLetter @nonLetter @nonLetter @nonLetter @grekCapsTonos' by @grekCapsTonosless;
	sub @grekCaps @nonLetter @nonLetter @nonLetter @nonLetter @grekCapsTonos' by @grekCapsTonosless;
	sub @grekCaps @nonLetter @nonLetter @nonLetter @grekCapsTonos' by @grekCapsTonosless;
	sub @grekCaps @nonLetter @nonLetter @grekCapsTonos' by @grekCapsTonosless;
	sub @grekCaps @nonLetter @grekCapsTonos' by @grekCapsTonosless;
	# tonos supression within a word
	sub @grekCapsTonos' @grekSmcp by @grekCapsTonosless;
	sub 	@grekCaps @grekCapsTonos' by @grekCapsTonosless;
	sub 	@grekCapsTonos' @grekCaps by @grekCapsTonosless;
} grek_tonosCap;

lookup grek_anoteleia {
	script grek;
	ignore sub @grekAll periodcentered' @grekAll;
	sub @grekAll periodcentered' by anoteleia;
} grek_anoteleia;

and in smcp

sub [alphatonos.sc epsilontonos.sc omicrontonos.sc upsilontonos.sc] iota.sc' by iotadieresis.sc;
sub [alphatonos.sc epsilontonos.sc etatonos.sc omicrontonos.sc omegatonos.sc] upsilon.sc' by upsilondieresis.sc;

Thanks for the code. This helps a lot.

isn’t the long lookahead and look behind a bit dangerous? that might apply to normal mixed case settings, too.

It could be, but it of course doesn’t include lowercase in the search range (only trying to find the first uppercase letter and skipping non-letter junk). I guess it should search for two uppercase letters in sequence over non-letter junk, not just one, assuming the previous or following word consists of multiple letters?

What do you Glyphs guys propose for dealing with a Greek UC-only Font? Particularly I am referencing the case conversion. Is it the best to just add the UC glyphs as a component to the LC glyphs and then hope for the user’s grammar responsibility during typesetting? And/or is there some backstage magic happening in Glyphs during the export or auto feature writing that can be messed up by not having real LC? Any experiences with Uppercase-only Greek?

I do have experience with UC only Greek. I simply copied tonos-less letters to tonos glyph slot, and duplicated that to lowercase. I still made dieresis conversion happen.

Thanks Tosche, I will take this into account.