Showing posts with label fonts. Show all posts
Showing posts with label fonts. Show all posts

Sunday, May 14, 2023

Sanskrit 2003

Sanskrit 2003

The Sanskrit 2003 font provides a rich set of conjunct consonants (sandhyakṣarāḥ) and looks really good, if you like classic Devanagari typefaces in the tradition of the Nirṇaya Sāgara Press. 

Sanskrit 2003 was created under the aegis of the Omkarananda Ashram, near Rishikesh.  The font is freely downloadable from the Omkarananda Ashram website, on this page:

Or directly by clicking this link:

Terms of Distribution

In 2017 I corresponded with the Omkarananda Ashram in order to clarify whether their font was covered by a free-use license.  Here is their reply:

Info (OAH) <info@omkarananda-ashram.org>
Sun, 12 Feb 2017, 05:12

Dear Dominik Wujastyk,

Thank you for your email.

We do not know about this licensing stuff, but the Sanskrit 2003 font is made available freely to anyone to use.

With kind regards,
Swami Satchidananda
Omkarananda Ashram Himalayas
Muni-ki-reti, Rishikesh, India

I tried to get more clarity and to get the Ashram to specify a modern license to formalise their statement but I received no further responses.  I have some sympathy with their unwillingness to get tangled up in licensing terms, however helpful that might be for others.

The Swamiji and the Ashram are being extremely generous in making this superb font available freely to all, and I personally thank them very much indeed.  In spite of the growing choice of Devanagari fonts, I usually come back to Sanskrit 2003.

Friday, September 25, 2020

Simple example of using XeLaTeX for Devanagari with Velthuis transliteration as input

In earlier posts I addressed this issue, but I think my examples were much too complicated.  Here's a minimum working example.

 

\documentclass{article}
\usepackage{polyglossia}

\setmainlanguage{sanskrit}
\newfontfamily\sanskritfont[Mapping=velthuis-sanskrit] {Sanskrit 2003}

\begin{document}

\Huge
\noindent
dharmak.setre kuruk.setre samavetaa yuyutsava.h| \\
maamakaa.h paa.n.davaa"scaiva kimakurvata sa.mjaya||

\end{document}


And here's the PDF output:

 

This was done with the TeXlive distribution of 2020 and XeLaTeX, running on Linux Mint. I have Sanskrit 2003 font installed in my system (and XeLaTeX can see it: see installation instructions 3.4.4).  Nothing special was required.  Everything is nowadays provided in the TeXlive distribution. The magic happens because of Polyglossia and Fontspec.  The manuals for these two packages explains the \setmainlanguage and \newfontfamily commands.

Saturday, June 17, 2017

Expanded Devanāgarī font comparison

In 2012 I posted a comparison of some Devanāgarī fonts that were around at the time.


Here's an update, with some more fonts and more concise TeX code:

\documentclass{article}
\usepackage{polyglossia}
\defaultfontfeatures{Script=Devanagari,Language=Sanskrit}
\newfontfamily\eng{TeX Gyre Pagella}

% set up a font, print its name, and typeset the test text:
\newcommand{\FontTrial}[1]{ %
    \setmainfont[Mapping=RomDev]{#1}
    \renewfontfamily\eng{#1}
    % print the font name:
    {\eng #1} \TestText }

\newcommand{\TestText}{ = शक्ति, kārtsnyam ṣaṭtriṃśad;
{\addfontfeatures{Language=Hindi} Hindī =
        शक्ति कार्त्स्न्यम्}\par}

\begin{document}

\FontTrial{FreeSerif}
\FontTrial{FreeSans}
\FontTrial{Sanskrit 2003}

\setmainfont[FakeStretch=1.08,Mapping=RomDev]{Sanskrit 2003}
\renewfontfamily\eng[FakeStretch=1.08,Language=English]{Sanskrit 2003}
{\eng Sanskrit 2003+} \TestText

\FontTrial{Nakula}
\FontTrial{Sahadeva}
\FontTrial{Murty Hindi}
\FontTrial{Murty Sanskrit}
\FontTrial{Shobhika}
% ... etcetera

\end{document}

Output:


Lessons learned:
  • Only Sanskrit 2003, Murty Sanskrit, Chandas, Uttara, Siddhanta, and Shobhika do a full conjunct consonant in ṣaṭtriṃśad.  The others fake it with a virāma.
  • Akshar Unicode's "prasanna" has a lazy horizontal conjunct.
  • Free Sans and Free Serif are the only fonts that distinguish Sanskrit and Hindi (see kārtsnyam).
  • Nakula, Sahadeva, Murty Hindi, Shobhika, Annapurna, Akshar Unicode, Kalimati, and Santipur do a lazy, horizontal conjunct consonant in kārtsnyam.
  • There's a special issue affecting FreeSans and FreeSerif.  I described this in a post in 2012.  The publicly distributed version of the fonts fails to make some important conjunct consonants, like त्रि and प्र correctly.  Unfortunately this issue has not changed in the intervening five years. The examples shown here use a fresh compilation of the fonts, based on downloading and compiling the development version at the Savannah repository (June 2017).  (Here's a link to my compiled fonts.)  This Savannah development version works better for  Devanagari, but has problems elsewhere, according to their author Stevan White.

Tuesday, December 16, 2014

GNU Freefont fonts and XeLaTeX

The problem

There's been a long-standing issue about using the Gnu Freefont fonts with XeLaTeX.  The fonts are "Free Serif", "Free Sans" "Free Mono", and each has normal, italic, bold and bold-italic versions.  
These fonts are maintained by Stevan White, who has done a lot of support and maintenance work on them.  
These fonts are of special interest to people who type Indian languages because they include nice, and rather complete Devanāgarī character sets in addition to glyphs for
  • Bengali
  • Gujarati
  • Gurmukhi
  • Oriya
  • Sinhala
  • Tamil
    and
  • Malayalam
The Gnu Freefonts are excellent for an exceptionally wide range of scripts and languages, as well as symbols.  See the coverage chart.

At the time of writing this blog, December 2014, the release version of the fonts is 4-beta, dated May 2012.  This is the release that's distributed with TeXLive 2014, and is generally available with other programs that include or require the FreeFonts.

But the 2012 release of the FreeFonts causes problems with the current versions of XeTeX.  Basically, the Devanagari conjunct consonants in the 2012 fonts are incompatible with the current XeTeX compositing engine. (For the technical: Up to TL 2012 XeTeX used ICU; since TL 2013 it's used HarfBuzz.)

In the last couple of years, Stevan has done a great deal of work on the Devanagari parts of the FreeFonts, and he has solved these problems.  But his improvements and developments are only available in the Subversion repository.   For technically-able users, it's not hard to download and compile this pre-release version of the fonts.  But then to make sure that XeTeX calls the right version of the FreeFonts, it's also necessary to weed out the 2012 version of the fonts that's distributed with TeX Live 2014.  And that's a bit hard.  In short, things get fiddly.

Now, Norbert Preining has created a special TeX Live repository for the Subversion version of the FreeFonts.  TeX Live 2014 users can now just invoke that repo and sit back and enjoy the correct Devanagari typesetting.

New warning June 2017: 
the procedure below is no longer supported.  Don't do it.

WARNING
Be warned that the version distributed here is a development version, not meant for production. Expect severe breakage. You need to know what you are doing!
END WARNING

Here follow Norbert's instructions (as of Dec 2014).  Remember to use sudo if you have TeX Live installed system-wide.

The solution. A new TeX Live repository for the pre-release Gnu FreeFonts

Norbert says (Dec 2014):

Here we go: Please do:
tlmgr repository add http://www.tug.org/~preining/tlptexlive/ tlptexlive
tlmgr pinning add tlptexlive gnu-freefont
tlmgr install --reinstall gnu-freefont
You should see something like:  
[~] tlmgr install --reinstall gnu-freefont
...
[1/1, ??:??/??:??] reinstall: gnu-freefont @tlptexlive [12311k]
...
Note the
@tlptexlive
After that you can do  
tlmgr info gnu-freefont
and should see: 
Package installed:   Yes
revision:    3007
sizes:       src: 27157k, doc: 961k, run: 19769k
relocatable: No
collection:  collection-fontsextra
Note the
revision: 3007
which corresponds to the freefont subversion revision!!!

From now on, after the pinning action, updates for gnu-freefont will
always be pulled from tlptexlive (see man page of tlmgr).
 

Reverting the change:

In case you ever want to return to the versions as distributed in TeX Live, please do
tlmgr pinning remove tlptexlive gnu-freefont
tlmgr install --reinstall gun-freefont


Thank you, Norbert!

Friday, December 13, 2013

Corrupted font spacing in terminal


http://i.stack.imgur.com/D6HgO.jpg

I had this problem, that was solved by purging pango-graphite:
sudo apt-get purge pango-graphite

Thursday, May 24, 2012

Two more good Devanāgarī fonts

I have posted an update to this post with some new material.

Steve White has recently done a great deal of work updating the FreeSerif and FreeSans Unicode fonts (that are, er, free).   He has done especially important work on the Devanagari characters in the font, as well as several other Indian writing systems.  See here for a listing of what has changed. Steve's work means that the Devanāgarī in the Free* fonts now works not only with Xe(La)TeX but also in Firefox, LibreOffice and other programs.  Thanks, Steve!

Zdeněk Wagner recently announced (here) that,
A few days ago version 20120503 of GNU FreeFont was released. This (OpenType as well as TrueType) version contains working Devanagari. FreeSans is based on Gargi with bugs fixed and positions of matras fine-tuned (and changes were reported back to the Gargi developers), FreeSerif is based on Velthuis fonts. Both fonts contain the Indian Rupee sign. In XeLaTeX, conjuncts in FreeSerif can be switched on/off according to the language.
Zdeněk provided an example file showing FreeSans and FreeSerif, and demonstrating the different conjuncts of Sanskrit and Hindī.  I have taken the liberty of expanding his file to compare some of the other leading Unicode fonts that contain both Devanāgarī and Latin typefaces in the same font:

XeLaTeX Input:
\documentclass{article}
\usepackage{polyglossia}

\defaultfontfeatures{Mapping=RomDev,Script=Devanagari,Language=Sanskrit}
\newfontfamily\eng[Mapping=tex-text]{TeX Gyre Pagella}
\begin{document}
\setmainfont{FreeSerif} \newfontfamily\eng[Mapping=tex-text]{FreeSerif}
{\eng FreeSerif} = शक्ति, kārtsnyam {\addfontfeatures{Language=Hindi} Hindī = शक्ति}
\setmainfont{FreeSans} \newfontfamily\eng[Mapping=tex-text]{FreeSans}
{\eng FreeSans} = शक्ति, kārtsnyam {\addfontfeatures{Language=Hindi} Hindī = शक्ति}
\setmainfont{Sanskrit 2003} \newfontfamily\eng[Mapping=tex-text]{Sanskrit 2003}
{\eng Sanskrit 2003} = शक्ति, kārtsnyam {\addfontfeatures{Language=Hindi} Hindī = शक्ति}
\setmainfont[FakeStretch=1.08]{Sanskrit 2003}
{\eng Sanskrit 2003+} = शक्ति, kārtsnyam {\addfontfeatures{Language=Hindi} Hindī = शक्ति}
\setmainfont{Nakula} \newfontfamily\eng[Mapping=tex-text]{Nakula}
{\eng Nakula} = शक्ति, kārtsnyam {\addfontfeatures{Language=Hindi} Hindī = शक्ति}
\setmainfont{Sahadeva} \newfontfamily\eng[Mapping=tex-text]{Sahadeva}
{\eng Sahadeva} = शक्ति, kārtsnyam {\addfontfeatures{Language=Hindi} Hindī = शक्ति}
\end{document}
Output:
(click to enlarge)

Note the use of the RomDev mapping to get "कार्त्स्न्यम्" out of "kārtsnyam", just for fun.  I've included Sanskrit 2003 twice, the second time with a bit of horizontal stretch, that I think makes it look nicer.
The official web page of the newly-updated FreeSans and FreeSerif fonts is:
As Zdeněk adds, ``Hopefully the font will soon appear in TeX Live and (some) Linux distributions. If you install it independently, be sure that you do not have font conflicts."

Be sure to delete all earlier versions of FreeSerif and FreeSans that might be lurking on your hard drive.  Then install the new version.  If you find the conjuncts aren't working as promised, you probably have an old FreeSerif or Sans lurking in a directory somewhere that you have forgotten about.