1

This is my code

\documentclass[letterpaper,12pt]{article}
\usepackage{fancyhdr}
\usepackage{footnpag}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage[total={6.5in,8.75in},top=1.2in,left=1.1in]{geometry}
\pagestyle{fancy}

\newcommand{\san}{
\catcode`\^=12
\catcode`\~=12
\fontspec[Script=Devanagari,Mapping=velthuis-sanskrit]{Shobhika Bold}}

\begin{document}
{\san .h}
\end{document}

I want to get just the visarga symbol. The output of the above code is a circle followed by a visarga symbol. enter image description here

1 Answer 1

0

Could you say why you want this? According to the rules of Devanagari a visarga by itself is not meaningful; it is intended to be attached to a consonant.

Anyway, searching for “isolated combining character” gives some results (like this and this and, more specific to XeTeX, this and this), and the suggestion of using U+00A0 No-Break Space as the base character does seem to avoid the dotted circle, with both xelatex and lualatex, at least with the font (Shobhika) mentioned in the question and a few other fonts I tried:

\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\newfontfamily{\shob}{Shobhika Bold}[Script=Devanagari, Renderer=HarfBuzz]
\newcommand{\visarga}{\shob \char"00A0\char"0903}
\begin{document}
\visarga
\end{document}

output

However, note that this (as instructed) renders it with a space:

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

\newfontfamily{\shob}{Shobhika Bold}[Script=Devanagari, Renderer=HarfBuzz]

\newcommand{\visarga}{\shob \char"00A0\char"0903}
\newcommand{\ka}{\shob \char"0915}

\begin{document}
\ka\visarga\ka
\end{document}

output 2, note space

If you're trying to do something strange (probably true by definition, given the question!) and don't want the space, you may need a different solution. Perhaps all you want is simply to use \char"0915 for the visarga, and let it combine with preceding consonants normally?

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

\newfontfamily{\shob}{Shobhika Bold}[Script=Devanagari, Renderer=HarfBuzz]

\newcommand{\visarga}{\char"0903}
\newcommand{\ka}{\char"0915}

\begin{document}
\shob \ka\visarga\ka
\end{document}

output 3

But then you can probably just .h as in the question, so you probably wouldn't have asked the question if this is acceptable. Instead, another solution is to use U+200C ZERO WIDTH NON-JOINER or U+200D ZERO WIDTH JOINER as the base character. This seems to work (typesets the visarga, without either a dotted circle or a space) and may be what you want:

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

\newfontfamily{\shob}{Shobhika Bold}[Script=Devanagari, Renderer=HarfBuzz]

\newcommand{\visarga}{\shob \char"200C\char"0903}
\newcommand{\ka}{\shob \char"0915} % Or, {\san ka} as in the question.

\begin{document}
\ka\visarga\ka
\end{document}

output four, seems to work for all uses

3
  • Thank you so much @ShreevatsaR. The genesis of the question is this. I am writing some documents in Kannada using Noto Serif Kannada and the ligatures of kShN[aeiou] and kShNa.m and kShNa.h are incorrect. I don't see the problem with Noto Sans Kannada but the serif fonts look better. So I thought if I had access to each of the glyphs then I could solve this problem. The question I posed, although alluding to Devanagari, solved my problems for Kannada with your answer. So thank you so much.
    – Sundar
    Jan 11, 2021 at 23:30
  • @Sundar Sounds like an xy-problem, then, but you can add a bit of negative kerning.
    – Davislor
    Jan 12, 2021 at 2:17
  • @Sundar Could you post a separate question about the Noto Serif Kannada issue? There may be an alternative solution or at least a known bug with the font. (BTW, if this answer worked for you, you could click on the upvote button and/or tick mark at the left of the answer (near the top), so that this question gets off the Unanswered queue and others know that it has been answered. Similarly with some of your previous questions maybe…) Jan 12, 2021 at 7:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .