psb1558 / Junicode-font

A new version of Junicode font
SIL Open Font License 1.1
397 stars 17 forks source link

Ancient Greek diacritics combining with Breve and Macron #240

Closed Doc73 closed 12 months ago

Doc73 commented 1 year ago

I would like to suggest an improvement about the positions of diacritics with breve and macron. Here is a comparison with a font widely used by classical philologists, New Athena Unicode (https://apagreekkeys.org/index.html).

Schermata del 2023-09-25 15-39-39

Yes, I know that other importan fonts, like Minion Pro, look very similar to Junicode in this respect, but New Athena Unicode (and IFAOGrec Unicode) follows the conventions of Greek philologists.

Thank you very much for your attention and again for your great job!

psb1558 commented 1 year ago

I didn't even know those particular combos were a thing. I'll take care of it.

psb1558 commented 1 year ago

This already works in Junicode when done in the following way. First set the script for the text to grek and the language to ELL (or whatever you do to set the language in your particular app—it absolutely won't work if the language is not properly set). Then type the base character—alpha, iota, or upsilon. Then combining comma or reversed comma (U+0313, u+0314). Then grave or acute (U+0300, U+0301). For example (in LibreOffice):

image

(This isn't working properly in the italic, and I'm trying to figure out why, since the OT code is supposed to be the same.) New Athena seems to be a paid product, so I can't get it, but this sequence doesn't work in IFAO-Grec:

image

What do you type when working with Athena and IFAO-Grec?

Added note: fixed in italic.

psb1558 commented 1 year ago

I should add that this works in Junicode exactly as it does in Brill, and that is why I set it up the way I did (though I didn't anticipate these particular combinations):

image
Doc73 commented 1 year ago

I must do other tests, but later, because now I'm busy. However I see that there are problems on Libreoffice and probably a lot depends on the way and order of character insertion. I'm testing these tools for Libreoffice:

I see that:

With Latex the situation is even worse. Here a MWE:

% !TeX TS-program = xelatex
% !TeX encoding = UTF-8
% !TeX spellcheck = it_IT
% !TeX root = Root.tex

\documentclass[14pt,b5paper,article]{memoir}
\usepackage{fontspec}
\setmainfont[]{Junicode}
%-----------------------------------------
\usepackage[babelshorthands=true]{polyglossia}
\setmainlanguage[variant=ancient]{greek}
\setotherlanguages{italian,english}

\begin{document}
\section{Greek}

Junicode \u{ἄ} \={ἄ}

\fontspec{Brill}
Brill \u{ἄ} \={ἄ}

\fontspec{New Athena Unicode}
New Athena Unicode \u{ἄ} \={ἄ}

\section{Italian}
\fontspec{Junicode}
Junicode \u{ἄ} \={ἄ}

\fontspec{Brill}
Brill \u{ἄ} \={ἄ}

\fontspec{New Athena Unicode}
New Athena Unicode \u{ἄ} \={ἄ}
\end{document}

%%% Local Variables:
%%% coding: utf-8
%%% mode: latex
%%% TeX-engine: xetex
%%% TeX-output-dir: "build-breve"
%%% TeX-master: t
%%% End:

This is the result: Schermata del 2023-09-27 11-11-20

Unfortunately, I don't have sufficient technical skills in this aspect, so forgive me if I can't follow you and if I'm wrong in something.

psb1558 commented 1 year ago

Now I'm confused about what you're actually looking for. In your first post you were asking about vowels with breathing mark and acute over a macron:

image

But a LaTeX command like e.g. \u{ἄ} is surely asking for a breve positioned over precomposed alpha + breathing + acute (U+1F04), and Junicode and Brill are giving you exactly that (but NAU is not):

image

I don't know polyglossia very well, but if you do \u{α}\char"0313\char"0301, i.e. alpha + breve followed by breathing mark and acute, then you get this:

image

In LibreOffice, what you're seeing here:

image

is an annoying thing that LibreOffice sometimes does, leaving a ghost of one character behind when you replace it with another. It is a purely graphical glitch, which (in my experience) disappears shortly, and in any case isn't reflected in a printout or PDF export. Within the blue selection box (also the bounding box), the result seems to be what you are looking for.

Now it's true that Junicode demands that the language be set to Greek, when the other fonts are okay with English or Italian. This is because the tonos/oxia is shaped differently in the italic face, and the substitution of the Greek shape for the other is triggered by the language tag. I notice that in the other fonts Greek-specific features are triggered only by the script, not the language tags. I am making that change in Junicode, with the result that it will no longer be necessary to specify the language (the script is detected automatically):

image

But I have doubts about whether I am understanding the problems you are seeing and the output you want.

Added note: I notice that in the italic, the marks seem to be sitting rather high above the breve. I will fix that.

Doc73 commented 1 year ago

Thanks for your explanation! I usually use LaTeX, but sometimes also LibreOffice. Fortunately, I rarely need to write those characters in LibreOffice, which I use for less serious things.

The result I would like to achieve is to see breathings and accents under the longum/breve sign.

You suggestion to use \u{α}\char"0313\char"0301 works very well with Junicode (only greek) and New Athena Unicode (greek + italian), doesn't work at all with Brill font, but has the defect that it requires remembering the codes of many diacritical signs.

It is also difficult, at least for me, to remember the keyboard shortcuts to print the longum/breve and for this reason I prefer to use the \={} or \u{} commands in LaTeX, but now I understand that this is wrong. :smile:

I really don't know what to tell you. Now, thanks to your explanation, I know how it works, but if there are better solutions, I honestly can't say.

Evaluate for yourself what is the best thing to do. In the meantime, thank you very much for your patience!

psb1558 commented 1 year ago

Thanks for this clarification. But if you want the breathing and accent under the breve or macron, Junicode seems to be delivering that with \u{ἄ} \={ἄ}. And if you want it the other way around, Junicode seems to be capable of that too. And it seems to be working the same way in LaTeX and LibreOffice. And in the next release it will be more convenient because you won't have to specify Greek as the language of the text.

Am I missing some issue here?

Doc73 commented 1 year ago

No, no! I was wrong! I meant I want breathing and accent above breve or macron. You have to forgive me, but I got confused! :sob:

psb1558 commented 1 year ago

No problem. I've just been taking a closer look at what IFAO and New Athena are doing. As I mentioned, with \u{ἄ} you are actually asking LaTeX to position a macron above the precomposed character ἄ (U+1F04). But neither IFAO nor Athena are capable of doing that, so the macrons are appearing in their default (unanchored) position. In IFAO like this:

image

which looks almost like what you want. But notice that the breathing and accent are at the same height here as they would be if the macron were not there—that is, they are not positioned relative to the macron, but rather relative to the alpha.

In Athena you get this:

image

which is pretty obviously not what you're looking for. Precisely the same thing is going on here as in IFAO, except that the combining macron, when not anchored, is farther to the right in Athena than in IFAO.

In short, \u{ἄ} is giving you a wrong result no matter what font you're using, but in IFAO it looks almost right—by accident, as it were.

Unfortunately, I don't know a convenient font-based way to make the sequence that gives you what you want. What I'd do, I think, is make some LaTeX commands to do it, e.g.

\newcommand{\macronsmoothacute}[1]{#1\char"0304\char"0313\char"0301}

And then in the text, \macronsmoothacute{α} would give you

image

At least you wouldn't have to memorize Unicode values!

Doc73 commented 1 year ago

Yes! It's a good idea! Many thanks!

psb1558 commented 12 months ago

I think we can count this as finished now. Reopen if any problems.