aliftype / amiri

Amiri (أميري) is a body text Naskh typeface
http://amirifont.org
SIL Open Font License 1.1
379 stars 34 forks source link

Please add visible space character and quote characters to Amiri #143

Closed donovaly closed 6 years ago

donovaly commented 6 years ago

For a technical documentation I need these characters:

Could you please add them to the Amiri fonts?

khaledhosny commented 6 years ago

French quotes are ‹› «», the ones above are CJK quote marks. Amiri is an Arabic font with Latin support, it is not usable for Japanese or other CJK languages, so I don’t see any point in adding quote marks only used in these languages.

I’m not sure about visible space, though, and I’d like to know why you need it in Amiri.

donovaly commented 6 years ago

the ones above are CJK quote marks

Yes, my mistake.

I’m not sure about visible space, though, and I’d like to know why you need it in Amiri.

We need them for the OpenSource writing software LyX: http://www.lyx.org/ The visible space character is used in documentation of LaTeX commands and of program code (LaTeX environment verbatim*). LyX's Arabic translator stumbled over the missing characters and that is why I got active.

khaledhosny commented 6 years ago

I’m appreciate some examples of these usages. Verbatim probably shouldn’t be using Amiri but a monospaced font like DejaVu Sans Mono or NoName Fixed.

donovaly commented 6 years ago

OK, let me explain the use case:

Verbatim probably shouldn’t be using Amiri but a monospaced font like DejaVu Sans Mono or NoName Fixed.

That is right. In LaTeX (XeTeX or LuaTeX) is is not that easy to switch the fonts. What can easily be done is to set one document font for Roman, one for sansserif and one for monospaced. Important is here that the fonts declare to LaTeX that they fully contain the Arabic script if your document language is Arabic. If you select for example a DejaVu Sans Mono font you get this error message: Missing character: There is no ح in font DejaVu Sans Mono Oblique/OT:script=arab;language=DFLT;mapping=tex-text;! So despite that DevaVu tells LaTeX that it contains Arabic, it misses some characters. Therefore this font is no alternative.

To support our Arabic users, I set up this table with Arabic fonts that can be used for LyX: https://wiki.lyx.org/Windows/Arabic#toc6 Unfortunately none of them supports the visible space character or they do but miss other characters. Our Arabic translator tested and found that Scheherazade is the font supporting the most characters used for technical documentation. (Of course I also contacted the developers of Scheherazade too to add the visible space.)

Yesterday I tested by myself (I don't know Arabic) and found our that Amiri and Jomhuria are Arabic fonts containing many non-Arabic characters as well. Btw. testing the Noto fonts was a bit disappointing.

khaledhosny commented 6 years ago

Switching fonts in XeTeX/LuaTeX shouldn’t be hard, and you have to do it anyway since setting Amiri for use in Arabic requires different options than for use in Ensglish and you can’t just use the same font definition for both Arabic text and English comand, this will give wrong results. DejaVu Sans Oblique does not support Arabic, but since it is not a true italic anyway, you can use only DejaVu Sans Regular and auto-slant it (fontspec has support for this, see its manual).

donovaly commented 6 years ago

Switching fonts in XeTeX/LuaTeX shouldn’t be hard

LyX supports the visible space character because users requested this. What users want is convenience. Switching fonts just for certain characters is inconvenient and consumes time people could invest in writing. Therefore I asked you to add the visible scape character to the Amiri fonts.

I think the goal is to provide a font that many people use. Most users will chose a font that contains all characters they use to avoid fiddling around with different fonts.

khaledhosny commented 6 years ago

I don’t know how you use LaTeX, but switching fonts for verbatim text is the standard course of action:

\documentclass{article}
\usepackage{polyglossia}

\setmainlanguage{arabic}
\setotherlanguage{english}

\newfontfamily\arabicfont  [Script=Arabic]{Amiri}
\newfontfamily\arabicfontsf[Script=Arabic]{Mada}
\newfontfamily\arabicfonttt[Script=Arabic]{NoName Fixed}

\begin{document}
كلام.\par
\textsf{كلام.}\par
\texttt{كلام␣كلام.}\par
\verb|كلام␣كلام.|

\begin{english}
Stuff.\par
\textsf{Stuff.}\par
\texttt{Stuff␣stuff.}\par
\verb|Stuff␣stuff.|
\end{english}
\end{document}

image

I can’t just added every character to the font, there are just too many of them. ␣ is a pretty specialized character and does not fall into the normal uses for a font like Amiri.

donovaly commented 6 years ago

The goal of my request was to achieve convenience of the users of LyX. They should not need to learn workarounds to be able to use certain characters. Frequently used characters should be included in the main Arabic font to make life as easy as possible.

I can’t just added every character to the font

Of course not, but those that people request because they are apparently used. There are other missing characters users will need:

I cannot speak Arabic I was just informed by users about missing characters and therefore contacted you.

KrasnayaPloshchad commented 6 years ago

Do you really need these CJK quote marks for typesetting Xiao'erjing? If so, I think they could be consider intergrating into Amiri. Alternatively, there are some open source CJK fonts with good quality that you can use, notably Source Han Sans/Serif.

khaledhosny commented 6 years ago

Using different fonts for different contexts is not a workaround, it is a feature and users should embrace it. No single font is suitable for every use. You can’t just shift the burden on me to do the work of adding out of scope characters because it is convenient for some users.

donovaly commented 6 years ago

Do you really need these CJK quote marks for typesetting Xiao'erjing?

No, but what is needed are the characters I listed in my comment from March, 11. I am sure this would help many users.

donovaly commented 6 years ago

Using different fonts for different contexts is not a workaround, it is a feature and users should embrace it.

Maybe Arabic is different in this respect but for Latin languages this is not common because it requires extra work to change fonts. In the economy world people have to write texts as fast as possible and every font change requires time.

The characters I listed in https://github.com/alif-type/amiri/issues/143#issuecomment-372127651 are frequently used and I don't understand your decision why Arabic fonts should not contain this.

khaledhosny commented 6 years ago

Changing fonts shouldn’t take time, it should be done automatically without even the user noting about it. I can’t help if the TeX world is still living in the previous century. Again, I don’t see why I should feel obliged to add characters that are out of scope of this font.

KrasnayaPloshchad commented 6 years ago

I think this problem is probably related to font fallback mechnism, not for the font itself.

donovaly commented 6 years ago

Changing fonts shouldn’t take time, it should be done automatically without even the user noting about it.

This is not possible in LaTeX. Users select fonts in the document settings/header and this font is taken. If you use a character not part of the selected font, you will first get errors when compiling your document as PDF. Then you can react and insert some nasty font change commands that require a lot of background info.

Therefore it is important in the LaTeX world that a font covers commonly used characters and my list: https://github.com/alif-type/amiri/issues/143#issuecomment-372127651 is sensible in this respect.

KrasnayaPloshchad commented 6 years ago

You can report to here: https://github.com/latex3

KrasnayaPloshchad commented 6 years ago

I have an idea now. You can try xeCJK macro package to specify CJK font, which allow you to make use of these characters.