Changes

Jump to navigation Jump to search
3,527 bytes added ,  18:47, 23 January 2023
sample (and explanation)
After a long development,<ref>For historical background, see https://en.wikipedia.org/wiki/Greek_language_question. This reference contains the recommendation for the [https://de.wikipedia.org/wiki/Griechische_Sprachfrage article from the German ''Wikipedia''].</ref> monotonic orthography became law in 1982.<ref>See Law 1228/1982 and Decree 297/1982. Both legatl texts were written with polytonic orthography, but they contain the provisions for the monotonic system.</ref> Greek was polytonic before and ancient Greek is polytonic because it was before 1982.<ref>Just in case you may wonder, this is independent from the popular (δημοτική) v. purified (καθαρέυουσα) dispute for Greek language. See Law 309/1976. The legal text was written in the purified Greek, but it ordered the popular Greek to be the official language.</ref> This means that polytonic Greek is not only ancient Greek, since the main part of modern Greek was polytonic.
 
=Sample=
 
Here is a minimal sample to start with:
 
<context source="yes">
\setuplanguage[en][patterns={en, agr}]
\definefallbackfamily
[mainface]
[rm]
[Gentium]
[preset=range:greek,
force=yes]
 
\definefontfamily
[mainface]
[rm]
[TeX Gyre Pagella]
 
\definebodyfontenvironment[24pt]
 
\setupbodyfont[mainface, 24pt]
 
\starttext
\startTEXpage[pagestate=start, offset=1em, width=15em, align=middle]
«χαλεπὰ τὰ καλά» is Greek for “beauty is hard”
\stopTEXpage
\stoptext
</context>
 
{{cmd|definebodyfontenvironment|[36pt]}} is only required to display the font in the wiki. You may not pay attention to it.
 
As it happens with texts with mixed scripts, the font family used for the Latin script may be well missing the required glyphs for the Greek script.
 
{{cmd|definefallbackfamily}} provides a fallback typeface for certain scripts (or even characters).
 
* It requires a range of characters for the fallback (here as a preset, that equals to <code>range:greek</code><ref>It may look tricky, but the whole preset is <code>range:greek</code>, so the whole option reads <code>preset=range:greek</code> (<code>preset</code> is the key name and <code>range:greek</code> is one of its values).</ref>).
* <code>force=yes</code> would be required to avoid mixing some glyphs that the main typeface might have (such as <code>μ</code>, <code>ν</code> or <code>π</code> in Greek) and the rest of the glyphs from the fallback font.<ref>To give an idea of the poor impression this makes:<context source="yes">\setuplanguage[en][patterns={en, agr}]
\definefallbackfamily
[mainface]
[rm]
[Gentium]
[preset=range:greek]
 
\definefontfamily
[mainface]
[rm]
[TeX Gyre Pagella]
 
\definebodyfontenvironment[24pt]
 
\setupbodyfont[mainface, 24pt]
 
\starttext
\startTEXpage[pagestate=start, offset=1em, width=15em, align=middle]
«χαλεπὰ τὰ καλά» is Greek for “beauty is hard”
\stopTEXpage
\stoptext</context></ref>
 
===Mixed Hyphenation Patterns===
 
As you might have already noticed, {{cmd|setuplanguage}} is loading for US English (the default language in TeX) patterns for both US English and ancient Greek.
 
There are some considerations in how this works:
 
# Basically, each language has a different script, so mixing patterns has no problem. Each script is handled only by a set of hyphenation patterns.
# Other hyphenation patterns might be added (as <code>uk</code> for Ukranian)<ref>Hyphenation patterns for British English are <code>gb</code>.</ref>, since Cyrillic is a different script from Latin and Greek (and it is only used to hyphenate a single language).
# This avoids marking the Greek fragments in the text with its proper language.
# This doesn’t work when having mixed ancient Greek and contemporary Greek fragments (because two different hyphenation patterns would be needed for the same script).
# All other options determined by {{cmd|setuplanguage}} will be the ones from the main language, not the ones for Greek (in this case. Among others, these affect to the minimum number of characters to hyphenate a word (at the end of the line and at the beginning of the new line).
# This approach only applies proper hyphenation patterns to Greek. In order to have all other options related to the language, marking with {{cmd|agr}} (or {{cmd|gr}} in the case of contemporary Greek) is required.
 
With this sample in mind, there are other considerations that may help when dealing with Greek in computers (and with ConTeXt).
=Unicode=
139

edits

Navigation menu