irenevlachou / Polytonic-tutorial

This tutorial explains how to add Polytonic characters to an existing Monotonic Greek typeface. In terms of the Google Fonts Glyph Sets/Greek/defined in 2017, we explain how to extend a Greek Core set into Greek Plus set.
30 stars 2 forks source link

Disjunctive Eta #2

Open kosbarts opened 4 years ago

kosbarts commented 4 years ago

Very good job and it's great to see something like this online.

You have forgotten to mention the only caps exception that keeps the tonos, the greek “or” which is called disjunctive eta (διαζευτικό ήτα). This should also apply for a tonos-less small cap set. I tend to program this in the Opentype features.

The rule is found in most Greek Grammar books. Here is one: https://www.koutrozi.gr/syggrafiko-ergo/54-kanones-tonismoy

kosbarts commented 4 years ago

Hi Irene. So here is a series of instructions I have written related to Monotonic Greek OT features. It can be a starting point for Polytonic code. It is also up for scrutiny.

Greek Tonos Rules:

  1. Letters with tonos should be replaced by a tonosless version in ALL CAPS text setting (or when they are on their own in a sentence).

  2. Exception: The greek “or” is called Disjunctive Eta and carries a tonos (Ή). Even in all caps setting it is suggested that the tonos remains so that it clearly avoids ambiguity compared to a normal Eta. With the exception of the Disjunctive Eta, all single letter Greek words are not accented. The other case that needs attention is the word ‘Ο,τι (a sort of abbreviated “anything”) which features the Omicrontonos followed by a comma. In this case we want the tonos to drop in all caps.

  3. 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

  4. 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 (should be top aligned on the meanline). 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/

In design terms, the Anoteleia should be like a periodcentered but vertically aligned to the x-height.

Greek Manual Code for Glyphsapp:

  1. Create the following classes (+ button on the bottom left, Class) – grekCaps: Add all Greek Capital Letters: Alpha Beta Gamma Delta Epsilon Zeta Eta Theta Iota Kappa Lambda Mu Nu Xi Omicron Pi Rho Sigma Tau Upsilon Phi Chi Psi Omega Alphatonos Epsilontonos Etatonos Iotatonos Omicrontonos Upsilontonos Omegatonos Iotadieresis Upsilondieresis

    – grekCapsTonos: Add all Greek Capital Letters with Tonos: Alphatonos Epsilontonos Etatonos Iotatonos Omicrontonos Upsilontonos Omegatonos – grekCapsTonosless: Add the Tonosless substitutions in the same order: Alpha Epsilon Eta Iota Omicron Upsilon Omega – grekAll: Add all Greek Glyphs (you can select Greek from the Glyphs language menu/copy glyph names/space separated) Include Greek specific Punctuation and Symbols (anoteleia, questiongreek, numeral-greek, lowernumeral-greek). Include Small Caps . Don’t include the accents (tonos, tonos.case, dieresistonos): Alpha Beta Gamma Delta Epsilon Zeta Eta Theta Iota Kappa Lambda Mu Nu Xi Omicron Pi Rho Sigma Tau Upsilon Phi Chi Psi Omega Alphatonos Epsilontonos Etatonos Iotatonos Omicrontonos Upsilontonos Omegatonos Iotadieresis Upsilondieresis Alpha.swsh Beta.swsh Epsilon.swsh Zeta.swsh Eta.swsh Kappa.swsh Mu.swsh Nu.swsh Rho.swsh Tau.swsh Chi.swsh Alphatonos.swsh Epsilontonos.swsh Etatonos.swsh alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu nu xi omicron pi rho sigmafinal sigma tau upsilon phi chi psi omega iotatonos iotadieresis iotadieresistonos upsilontonos upsilondieresis upsilondieresistonos omicrontonos omegatonos alphatonos epsilontonos etatonos beta.ss02 theta.ss02 xi.ss02 phi.ss02 alpha.sc beta.sc gamma.sc delta.sc epsilon.sc zeta.sc eta.sc theta.sc iota.sc kappa.sc lambda.sc mu.sc nu.sc xi.sc omicron.sc pi.sc rho.sc sigma.sc tau.sc upsilon.sc phi.sc chi.sc psi.sc omega.sc iotatonos.sc iotadieresis.sc upsilontonos.sc upsilondieresis.sc omicrontonos.sc omegatonos.sc alphatonos.sc epsilontonos.sc etatonos.sc anoteleia questiongreek numeral-greek lowernumeral-greek – nonLetter: Add all the Punctuation and Spaces/Separator Glyphs (excluding .notdef .null CR)

1b. If the design has Small Caps create also the following classes – grekSC : Add all Greek Small Caps alpha.sc beta.sc gamma.sc delta.sc epsilon.sc zeta.sc eta.sc theta.sc iota.sc kappa.sc lambda.sc mu.sc nu.sc xi.sc omicron.sc pi.sc rho.sc sigma.sc tau.sc upsilon.sc phi.sc chi.sc psi.sc omega.sc iotatonos.sc iotadieresis.sc upsilontonos.sc upsilondieresis.sc omicrontonos.sc omegatonos.sc alphatonos.sc epsilontonos.sc etatonos.sc – grekSCTonos : Add all Greek Small Caps with tonos alphatonos.sc epsilontonos.sc etatonos.sc iotatonos.sc omicrontonos.sc upsilontonos.sc omegatonos.sc

– grekSCTonosless : Add the matching Greek Small Caps toneless alpha.sc epsilon.sc eta.sc iota.sc omicron.sc upsilon.sc omega.sc

  1. Add the following code to the case feature: (Note this is a commented version of the code)

lookup grek_dieresisCapInsertion { sub [Alphatonos Epsilontonos Omicrontonos Upsilontonos] Iota' by Iotadieresis; sub [Alphatonos Epsilontonos Etatonos Omicrontonos Omegatonos] Upsilon' by Upsilondieresis; } grek_dieresisCapInsertion;

lookup grek_tonosCap { ignore sub @nonLetter Etatonos' @nonLetter @nonLetter; #makes sure the Etatonos will remain even if it is followed by a comma and a space in the middle of a sentence or paragraph. sub @nonLetter @grekCapsTonos' @nonLetter @nonLetter by @grekCapsTonosless; #suppresses the tonos for all Uppercase with Tonos if they are followed by at least two nonletters (so the tonos will remain in the case of ‘Ο,τι but will drop for Ώ!) in the middle of a sentence or paragraph. sub @grekCapsTonos' @grekCaps by @grekCapsTonosless; #suppresses all tonos within a word sub @grekCaps @grekCapsTonos' by @grekCapsTonosless; #suppresses all tonos within a word ignore sub Etatonos' @nonLetter @grekCaps; #makes sure the Etatonos will remain even if it is in the beginning of a paragraph. sub @grekCapsTonos' @nonLetter @grekCaps by @grekCapsTonosless; #suppresses the tonos for all isolated Uppercase with Tonos if they are in the beginning of a paragraph. ignore sub Etatonos' @nonLetter @nonLetter; #makes sure the Etatonos will remain even if it is followed by a comma and a space in the beginning of a paragraph. sub @grekCapsTonos' @nonLetter @nonLetter by @grekCapsTonosless; #suppresses the tonos for all Uppercase with Tonos if they are followed by at least two nonletters (so the tonos will remain in the case of ‘Ο,τι but will drop for Ώ!) in the beginning of a paragraph.
} grek_tonosCap;

  1. Add the following code to the calt feature

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

lookup grek_dieresisCapInsertion; lookup grek_tonosCap;

  1. Add the following code to c2sc

lookup grek_dieresisC2SCInsertion { 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_dieresisC2SCInsertion;

lookup grek_C2SCTonosless { ignore sub space etatonos.sc' space; sub @grekCapsTonos' @grekSC by @grekCapsTonosless;
sub @grekSCTonos' @grekSC by @grekSCTonosless; sub @grekSC @grekSCTonos' by @grekSCTonosless; } grek_C2SCTonosless;

  1. Add the following code to smcp

lookup grek_dieresisSCInsertion { 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_dieresisSCInsertion;

lookup grek_SCTonosless { ignore sub space etatonos.sc' space; sub @grekCapsTonos' @grekSC by @grekCapsTonosless;
sub @grekSCTonos' @grekSC by @grekSCTonosless; sub @grekSC @grekSCTonos' by @grekSCTonosless; } grek_SCTonosless;

note: the two lookups in c2sc and smcp are practically the same but in Glyphs the simple lookup call does not work in this case. You can put the two lookups in the Prefix and call them in both features or if you manually compose the Opentype Feature code.

  1. Add the following code to ssXX

just include the full smcp list of subs without the tonos and dieresis lookup. Make sure you include the following sub iotatonos by iotatonos.sc; sub iotadieresis by iotadieresis.sc; sub iotadieresistonos by iotadieresistonos.sc; sub upsilontonos by upsilontonos.sc; sub upsilondieresis by upsilondieresis.sc; sub upsilondieresistonos by upsilondieresistonos.sc; sub omicrontonos by omicrontonos.sc; sub omegatonos by omegatonos.sc; sub alphatonos by alphatonos.sc; sub epsilontonos by epsilontonos.sc; sub etatonos by etatonos.sc;

  1. Compile, generate and test. This feature should work in all design applications, TextEdit and on the Web. – In InDesign, there might be different results from capitalising via the All Caps button vs. capitalising via Type/Change Case/Uppercase. This has to do with the InDesign text engine which tries to resolve this Greek feature by itself. – In MS Word, it will only work if you enable Contextual Alternates from Format/Font/Advanced/Use contextual alternates ✅ (There seems to be an issue with the way Word forces capitalization of the first letter in all sentences. If you type a sentence starting with a Greek Uppercase letter with Tonos and then you switch All Caps on from Font/Font menu it leaves the tonos only in the first letter. If you start typing while All Caps is activated, the feature works fine.)

This is a good text to add to all the testing documents: άς πάμε παίδια. ήταν ένα μικρό καράβι· ήταν ένα ή ό,τι μικρό· άυλος. ή όχι; ό,τι και να’ναι πάμε ή, αν είναι, ό,τι. ή άς μας πείτε τί ώ! έλατο! ώ! έλατο. ό,τι ό,τι. ό,τι και να πώ ό,τι. ώ! έλατο. μαγική αρχή, ή ή τέλος όλα καλά αχ! ή, καλύτερα. ό άσπρος ώ! ό,τι ήτοι ή, καλα. ή, αν λέγαμε. ώ! έλατο. ώ!

Άς πάμε παίδια. Ήταν ένα μικρό καράβι· Ήταν ένα ή ό,τι μικρό· άυλος. Ή όχι; Ό,τι και να’ναι πάμε ή, αν είναι, ό,τι. Ή άς μας πείτε τί ώ! Έλατο! Ώ! Έλατο. Ό,τι ό,τι. Ό,τι και να πώ ό,τι. Ώ! Έλατο. Μαγική αρχή, ή ή τέλος όλα καλά αχ! Ή, καλύτερα. Ό άσπρος ώ! Ό,τι ήτοι ή, καλα. Ή, αν λέγαμε. Ώ! Έλατο. Ώ!

ΆΣ ΠΆΜΕ ΠΑΊΔΙΑ. ΉΤΑΝ ΈΝΑ ΜΙΚΡΌ ΚΑΡΆΒΙ· ΉΤΑΝ ΈΝΑ Ή Ό,ΤΙ ΜΙΚΡΌ· ΆΥΛΟΣ. Ή ΌΧΙ; Ό,ΤΙ ΚΑΙ ΝΑ’ΝΑΙ ΠΆΜΕ Ή, ΑΝ ΕΊΝΑΙ, Ό,ΤΙ. Ή ΆΣ ΜΑΣ ΠΕΊΤΕ ΤΊ Ώ! ΈΛΑΤΟ! Ώ! ΈΛΑΤΟ. Ό,ΤΙ Ό,ΤΙ. Ό,ΤΙ ΚΑΙ ΝΑ ΠΏ Ό,ΤΙ. Ώ! ΈΛΑΤΟ. ΜΑΓΙΚΉ ΑΡΧΉ, Ή Ή ΤΈΛΟΣ ΌΛΑ ΚΑΛΆ ΑΧ! Ή, ΚΑΛΎΤΕΡΑ. Ό ΆΣΠΡΟΣ Ώ! Ό,ΤΙ ΉΤΟΙ Ή, ΚΑΛΑ. Ή, ΑΝ ΛΈΓΑΜΕ. Ώ! ΈΛΑΤΟ. Ώ!