3

How to typeset vedic fonts/symbols in kannada? I mean to use swaras like udatta, anudatta, dheerga, visarga, etc... I have used BhashaIME but it doesn't work well on Win10 machine.

enter image description here

3

You simply have to use a Kannada font that includes the Vedic accents. According to Sridatta here,

As per Jelle Bosma of Monotype, the designer of Noto Sans Kannada, it should work in the latest Phase III fonts. […] You can get the fonts here https://github.com/googlei18n/noto-fonts/tree/master/phaseIII_only

And indeed, after downloading Noto Sans Kannada from there (e.g. this file), I can get it to work:

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Script=Kannada,Path=$HOME/Downloads/]{NotoSansKannada-Regular.ttf}
\tracinglostchars=2 % https://tex.stackexchange.com/q/41230/48
\begin{document}

ಆ ನೋ᳚ ಭ॒ದ್ರಾಃ ಕ್ರತ॑ವೋ ಯನ್ತು ವಿ॒ಶ್ವತೋಽದ॑ಬ್ಧಾಸೋ॒ ಅಪ॑ರೀತಾಸ ಉ॒ದ್ಭಿದಃ॑ ।
ದೇ॒ವಾ ನೋ॒ ಯಥಾ॒ ಸದ॒ಮಿದ್ ವೃ॒ಧೇ ಅಸ॒ನ್ನಪ್ರಾ᳚ಯುವೋ ರಕ್ಷಿ॒ತಾರೋ᳚ ದಿ॒ವೇದಿ॑ವೇ ॥ 1.089.01

\end{document}

output with Noto Sans Kannada

Note that in the same thread, the creator of Goda (and of Bhasha IME) also says it should work with Goda, if your input is valid Unicode. Trying with Goda (get the font here or (not tested) here) works too:

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Script=Kannada,Path=$HOME/Downloads/]{Goda_1_0_6.ttf}
\tracinglostchars=2 % https://tex.stackexchange.com/a/41235/48
\begin{document}

ಆ ನೋ᳚ ಭ॒ದ್ರಾಃ ಕ್ರತ॑ವೋ ಯನ್ತು ವಿ॒ಶ್ವತೋಽದ॑ಬ್ಧಾಸೋ॒ ಅಪ॑ರೀತಾಸ ಉ॒ದ್ಭಿದಃ॑ ।
ದೇ॒ವಾ ನೋ॒ ಯಥಾ॒ ಸದ॒ಮಿದ್ ವೃ॒ಧೇ ಅಸ॒ನ್ನಪ್ರಾ᳚ಯುವೋ ರಕ್ಷಿ॒ತಾರೋ᳚ ದಿ॒ವೇದಿ॑ವೇ ॥ 1.089.01

\end{document}

Goda

Similarly with Vagisha_1_0_5.ttf it works too:

Vagisha

If it doesn't work, please check your input for whether it's valid Unicode, and whether the font versions are the same. Also, these were tested with xelatex on macOS; I believe they should also work on Windows (especially 8.1 or later) according to the pages on the font (BhashaIME) site.

  • ShreevatsaR, Thanks for your suggestion. It works. But I still cant type kannada with vedic accents within the tex file. Copying and pasting your example works though. I need to understand how to type new slokas/mantra with swaras in the tex file. – Sas3 Jan 25 at 6:31
  • 1
    @Sas3 It may be that the font being used by your text editor does not display the Vedic accents properly. You could try removing all Kannada fonts from your system and installing only one of the above fonts that work. Also, which editor are you using to type it? As you can see, the .tex file is just a file and it can contain any characters (e.g. you can copy-paste from this answer and the file will contain the proper characters, even if the viewer in which you view the .tex file does not display those characters properly). – ShreevatsaR Jan 25 at 6:35
  • 1
    @Sas3 Also, I imagine that BhashaIME (at least recent versions) will have some way of typing with svaras, as its creator made fonts with Vedic accents. I have not read its documentation or used it but you could try looking at its documentation or contacting its author. – ShreevatsaR Jan 25 at 6:36
  • Thank you. uninstalling all other fonts helped. BhashaIME is working fine now. – Sas3 Jan 25 at 6:47
0

First, if you can find a font that contains both the Vedic extensions and the Kannada script, that would be ideal. Then you could simply \DeclareUnicodeAccent.

Otherwise, here is a very crude beginning of an answer. It takes the Vedic extensions from a Devanagari font, composes them with a non-breaking space as the base character, then overlays them on top of the text, possibly from another script. I also did one other simple example of a Vedic accent. I didn’t yet extend this to accents that are medial (this would be a negative kern) or below (this box would need to be cropped, and not just lowered, so as not to leave too large a space between lines).

It might also be tricky to put these over specific letters without breaking up what appear to be the contextual forms of the script.

\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}

\setdefaultlanguage{kannada}
\setotherlanguage{english}

\defaultfontfeatures{ Scale = MatchUppercase }
\setmainfont[Scale = 1.0]{DejaVu Serif}
\setsansfont{Noto Sans}
\newfontfamily\kannadafont{Noto Serif Kannada}[
  Script = Kannada,
  Language = Kannada ]
\newfontfamily\kannadafontsf{Noto Sans Kannada}[
  Script = Kannada,
  Language = Kannada ]
\newfontfamily\devanagarifont{Noto Serif Devanagari}[
  Script = Devanagari]

\makeatletter

\newlength\vedic@width
\newlength\vedic@height
\newlength\vedic@space

\settoheight\vedic@space{\devanagarifont\strut}

\newcommand\karshana[1]{#1
\settowidth\vedic@width{#1}%
\settoheight\vedic@height{#1}\addtolength\vedic@height{-1\vedic@space}%
\makebox[0pt][c]{%
\raisebox{\vedic@height}{\hspace*{-\vedic@width}\devanagarifont\char"A0\char"1CD0}}%
\relax}
\newcommand\nihshvasa[0]{{\devanagarifont\char"1CD3}\relax}

\makeatother

\linespread{1.3} % Line-and-a-half spacing makes for more regular line height.
\makeatletter
% I use a minipage environment to wrap this MWE to a width that fits within
% the size limits of TeX.SX.  That obliterates \parindent and \parskip, and
% this restores it:  (Based on an answer by Markus Kuhn.)
\newlength{\saveindent}
\setlength{\saveindent}{\parindent}
\newcommand{\@minipagerestore}{\setlength{\parindent}{\saveindent}}
\makeatother

\begin{document}

\begin{minipage}{10cm}

ಮಾನವ ಬಾಧ್ಯತೆಗಳ ಸಾರ್ವತ್ರಿಕ ಪ್ರಕಟನೆ ಪ್ರಸ್ತಾವನೆ

ಮಾನವ \karshana{ಬಾಧ್ಯತೆಗಳ} ಸಾರ್ವತ್ರಿಕ ಪ್ರಕಟನೆ\nihshvasa

ಪ್ರಸ್ತಾವನೆ

\end{minipage}
\end{document}

Kannada with Vedic accents

  • Hello Davislor! Thanks for responding. I know how to type kannada. Perhaps, getting the vedic fonts (signs like _,",') is the problem. Can you please help me with that? – Sas3 Jan 23 at 4:25
  • @Sas3 I’m not sure what a good example to test them with is, but if you can enter the Unicode characters for the accents you want, and load a font that has them, they ought to work? – Davislor Jan 23 at 4:32
  • I am not aware of a font that has these accents for Kannada language. – Sas3 Jan 23 at 4:34
  • @Sas3 Okay. They do seem to be in Noto S[erif|ans] Devanagari, so let me try something. – Davislor Jan 23 at 4:45
  • I would really appreciate if you can help me to overcome this hurdle. Thank you! – Sas3 Jan 23 at 6:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.