or
निरंजन
fonts
See this minimal code -

```
\documentclass[border=0.5cm]{standalone}
\usepackage{gchords}
\usepackage{fontspec}
\setmainfont[Script=Devanagari,Mapping=devanagarinumerals]{Shobhika}

\begin{document}
	\mediumchords
	\chord{t}{f२p3,f२p2,n,n,n,f३p3}{शुद्ध सूरमेळ}
	\chord{t}{f2p3,f1p2,n,n,n,f3p3}{G Major}
\end{document}
```

It produces something like -

![Screenshot from 2020-03-13 17-00-34.png](/image?hash=97840d868c3b8abf1e7480cb30fae0a297f98882191d3f16c2ace184dfed96b2)

How to make Devanagari script appear in this output?

Edit -

```
\documentclass[border=0.5cm]{standalone}
\usepackage{gchords}
\usepackage{fontspec}
\setmainfont[Script=Devanagari,Mapping=devanagarinumerals]{Shobhika}
\newfontfamily\sho[Script=Devanagari,Mapping=devanagarinumerals]{Shobhika}

\begin{document}
	\mediumchords
	\chord{t}{f{\sho२}p3,f{\sho१}p2,n,n,n,f{\sho३}p3}{\sho शुद्ध सूरमेळ}
	\chord{t}{f2p3,f1p2,n,n,n,f3p3}{G Major}
\end{document}
```
Top Answer
samcarter
In the `gchords` package, the use of the computer modern font is hard coded. With a few redefinitions one can make the package use the font of the surrounding text: 


```
% !TeX TS-program = xelatex

\documentclass[border=0.5cm]{standalone}
\usepackage{gchords}
\usepackage{fontspec}
\setmainfont[Script=Devanagari,Mapping=devanagarinumerals]{Shobhika}

% These should be modified if you want chords in a different size
\renewcommand\mediumchords{
\def\chordsize{3.0mm}    % distance between two frets (and two strings)
\def\dampsymbol{$\scriptstyle\times$}    % symbol of the `damp this % string' marker
\def\opensymbol{$\scriptstyle\circ$}     % symbol of the `open string' marker
}
\renewcommand\smallchords{
\def\chordsize{2.0mm}    % distance between two frets (and two strings)
\def\dampsymbol{$\scriptstyle\times$}    % symbol of the `damp this string' marker
\def\opensymbol{$\scriptstyle\circ$}     % symbol of the `open string' marker
}

\renewcommand{\fingerfont}{\tiny}
\renewcommand{\namefont}{}
\renewcommand{\fretposfont}{}


\begin{document}
	\mediumchords
	\chord{t}{f२p3,f२p2,n,n,n,f३p3}{शुद्ध सूरमेळ}

{
  \fontspec{Arial}
	\chord{t}{f2p3,f1p2,n,n,n,f3p3}{G Major}
} 
 
\end{document}
```

![Screen Shot 2020-03-13 at 13.23.23.png](/image?hash=d48c85aa98e781529693888991414f414e3a55fbac807af949c1d16a8b9ff51c)
Musictex with Devanagari script.
samcarter replying to निरंजन
You're welcome!
निरंजन replying to samcarter
Ok. This is great. I like it :)
samcarter
(because `\chord` has so much white space at the top, it probably won't look centred)
samcarter
![Screen Shot 2020-03-13 at 16.07.20.png](/image?hash=5578925e6fb61ca36a78f1acfefb5dd45f5f2b387f6c58117b61eb7d7cba6315)
samcarter
```
% !TeX TS-program = xelatex

\documentclass[border=0.5cm]{standalone}
\usepackage{gchords}
\usepackage{fontspec}
\setmainfont[Script=Devanagari,Mapping=devanagarinumerals]{Shobhika}
% These should be modified if you want chords in a different size
\renewcommand\mediumchords{
\def\chordsize{3.0mm}    % distance between two frets (and two strings)
\def\dampsymbol{$\scriptstyle\times$}    % symbol of the `damp this % string' marker
\def\opensymbol{$\scriptstyle\circ$}     % symbol of the `open string' marker
}
\renewcommand\smallchords{
\def\chordsize{2.0mm}    % distance between two frets (and two strings)
\def\dampsymbol{$\scriptstyle\times$}    % symbol of the `damp this string' marker
\def\opensymbol{$\scriptstyle\circ$}     % symbol of the `open string' marker
}
\renewcommand{\fingerfont}{\tiny}
\renewcommand{\namefont}{}
\renewcommand{\fretposfont}{}

\newcommand*{\vcenteredhbox}[1]{\begingroup
\setbox0=\hbox{#1}\parbox{\wd0}{\box0}\endgroup}

\begin{document}
\mediumchords

abcd
\vcenteredhbox{\fbox{\chord{t}{f२p3,f२p2,n,n,n,f३p3}{शुद्ध सूरमेळ}}}
{\fontspec{CharisSIL}\vcenteredhbox{\fbox{\chord{t}{f2p3,f1p2,n,n,n,f3p3}{G Major}}}} 
\end{document}
```
samcarter replying to निरंजन
How about using a modified version of https://tex.stackexchange.com/a/17102 :
samcarter replying to निरंजन
Ah, now I understand. Thanks for the image. I'll have a look
निरंजन
If you uncomment `%raisebox{0.5in}` that is the output what I want.
निरंजन
```
\documentclass[border=0.5cm]{standalone}
\usepackage{gchords}
\usepackage{fontspec}
\setmainfont[Script=Devanagari,Mapping=devanagarinumerals]{Shobhika}
% These should be modified if you want chords in a different size
\renewcommand\mediumchords{
\def\chordsize{3.0mm}    % distance between two frets (and two strings)
\def\dampsymbol{$\scriptstyle\times$}    % symbol of the `damp this % string' marker
\def\opensymbol{$\scriptstyle\circ$}     % symbol of the `open string' marker
}
\renewcommand\smallchords{
\def\chordsize{2.0mm}    % distance between two frets (and two strings)
\def\dampsymbol{$\scriptstyle\times$}    % symbol of the `damp this string' marker
\def\opensymbol{$\scriptstyle\circ$}     % symbol of the `open string' marker
}
\renewcommand{\fingerfont}{\tiny}
\renewcommand{\namefont}{}
\renewcommand{\fretposfont}{}

\begin{document}
\mediumchords
%\raisebox{0.5in}
{abcd} 
\fbox{\chord{t}{f२p3,f२p2,n,n,n,f३p3}{शुद्ध सूरमेळ}}
{\fontspec{CharisSIL}\fbox{\chord{t}{f2p3,f1p2,n,n,n,f3p3}{G Major}}} 
\end{document}
```
निरंजन replying to samcarter
I don't think this is what I want. I'll show you an image of what I want. Let me show you what I want.
samcarter
![Screen Shot 2020-03-13 at 14.27.39.png](/image?hash=fc86da1c5411413535602583af7dde02aded775bfe7f02011dd8f19d1008c137)
samcarter replying to निरंजन
Very hacky. I choose the value by eye, so it probably needs more fine tuning. I added a comment `% <- change value of 1.3` to show which line you should change
samcarter
```
% !TeX TS-program = xelatex

\documentclass[border=0.5cm]{standalone}
\usepackage{gchords}
\usepackage{fontspec}
\setmainfont[Script=Devanagari,Mapping=devanagarinumerals]{Shobhika}

% These should be modified if you want chords in a different size
\renewcommand\mediumchords{
\def\chordsize{3.0mm}    % distance between two frets (and two strings)
\def\dampsymbol{$\scriptstyle\times$}    % symbol of the `damp this % string' marker
\def\opensymbol{$\scriptstyle\circ$}     % symbol of the `open string' marker
}
\renewcommand\smallchords{
\def\chordsize{2.0mm}    % distance between two frets (and two strings)
\def\dampsymbol{$\scriptstyle\times$}    % symbol of the `damp this string' marker
\def\opensymbol{$\scriptstyle\circ$}     % symbol of the `open string' marker
}

\renewcommand{\fingerfont}{\tiny}
\renewcommand{\namefont}{}
\renewcommand{\fretposfont}{}

\makeatletter
\renewcommand\chord[3]{\vbox{\hbox{\ascale=\chordsize
\truewidth=\strings\advance\truewidth by -1
\advance\truewidth by \xoff
\topline=\numfrets
\advance\topline by \yoff
\advance\topline by 2

%%% The Diagram itself %%%%%%%%%
\unitlength\ascale
\begin{picture}(\truewidth,\topline)
\advance\topline by -1
\advance\truewidth by -\xoff
\myvpos=\yoff\advance\myvpos by \numfrets
%%% Parse the modifier string %%
\newcommand\topbar{n}
\@tfor\modstr:=#1\do 
   { \def\ttest{t}%
     \ifx\modstr\ttest{\linethickness{\topfretsiz}\put(\xoff,\myvpos){\chline{\truewidth}}\thinlines}%
     \else {\advance\topline by -1%
            \put(\xoff,\topline){\hbox to 0pt{\hss\fretposfont\modstr~}}%
           }%
     \fi%
   }
% \@tfor\modstr:=#1\do 
%    { \if\modstr t{\thicklines\put(\xoff,\myvpos){\chline{\truewidth}}\thinlines}%
%      \else {\advance\topline by -2%
%             \put(\xoff,\topline){\hbox to 0pt{\hss\fretposfont\modstr\ }}%
%            }%
%      \fi%
%    }

%%% Horizontal lines (frets)%%%%
\mylength=0
\myvpos=\yoff
\advance\myvpos by 1  % first fret starts a bit higher
\@whilenum \mylength<\numfrets \do {  
  \put(\xoff,\myvpos){\chline{\truewidth}}
  \advance\mylength by 1
  \advance\myvpos   by 1}

%%% The Dots %%%%%%%%%%%%%%%%%%%
\newcommand\fnow{n}
\newcommand\pnow{n}
\newcommand\snow{n}
\newcommand\Lnow{n}

\edef\notelabel{}

\putdots{#2}{\chordsize}
\put(1.3,0){\hbox to \truewidth\ascale{\hss\namefont #3\hss}} % <- change value of 1.3
\end{picture}
}}}

\makeatother



\begin{document}
	\mediumchords
  
	\fbox{\chord{t}{f२p3,f२p2,n,n,n,f३p3}{शुद्ध सूरमेळ}}

{
  \fontspec{Arial}
	\fbox{\chord{t}{f2p3,f1p2,n,n,n,f3p3}{G Major}}
} 
 
\end{document}

```
निरंजन
@samcarter I have one more doubt, right now if we use the `\chord` command with some text, the text shows up at the very bottom of the diagram (where the description line ie. 'G major' is added). Is there any way to make it centered? I mean the text should automatically be adjusted to the center of the full space occupied by the output of `\chord` command.
samcarter replying to निरंजन
My pleasure :)
निरंजन
Thank you so much @samcarter. It looks very pretty! This is more than what was needed :)
निरंजन
Devanagari is enough.
samcarter
Do you need the `\chord` stuff both in latin and Devanagari script, or is `Devanagari` enough?
samcarter replying to निरंजन
Thanks for the information about finger, this helped to find the command
samcarter
```
% !TeX TS-program = xelatex

\documentclass[border=0.5cm]{standalone}
\usepackage{gchords}
\usepackage{fontspec}
\setmainfont[Script=Devanagari,Mapping=devanagarinumerals]{Shobhika}


% These should be modified if you want chords in a different size
\renewcommand\mediumchords{
\def\chordsize{3.0mm}    % distance between two frets (and two strings)
\def\dampsymbol{$\scriptstyle\times$}    % symbol of the `damp this % string' marker
\def\opensymbol{$\scriptstyle\circ$}     % symbol of the `open string' marker
}
\renewcommand\smallchords{
\def\chordsize{2.0mm}    % distance between two frets (and two strings)
\def\dampsymbol{$\scriptstyle\times$}    % symbol of the `damp this string' marker
\def\opensymbol{$\scriptstyle\circ$}     % symbol of the `open string' marker
}

\renewcommand{\fingerfont}{}
\renewcommand{\namefont}{}
\renewcommand{\fretposfont}{}


\begin{document}
	\mediumchords
	\chord{t}{f२p3,f२p2,n,n,n,f३p3}{शुद्ध सूरमेळ}
	\chord{t}{f2p3,f1p2,n,n,n,f3p3}{G Major}
\end{document}
```
samcarter
can you try 
निरंजन
`f2p3` is  a chunk of information which encodes finger number (in this case 2) and the fret number (in this case 3) which results in the first string.
samcarter
maybe. How are the circles with the numbers called? (I'm absolutely music-illiterate and have some problem to identify the elements in the package source code...)
निरंजन
Thanks for the hack by the way. It is working even for the finger numbers.
निरंजन
Oh. Any `renewcommand` possible to make the package ignore it?
samcarter
ah, the package seems to have hard corder to switch back to computer modern....
samcarter
```
% !TeX TS-program = xelatex

\documentclass[border=0.5cm]{standalone}
\usepackage{gchords}
\usepackage{fontspec}
\setmainfont[Script=Devanagari,Mapping=devanagarinumerals]{Shobhika}
\newfontfamily\shobhika[Script=Devanagari,Mapping=devanagarinumerals]{Shobhika}


\begin{document}
	\mediumchords
	\chord{t}{f२p3,f२p2,n,n,n,f३p3}{\shobhika शुद्ध सूरमेळ}
	\chord{t}{f2p3,f1p2,n,n,n,f3p3}{G Major}
\end{document}
```
samcarter
Seem to be some problem with the used font family. For the word below the grid, the following manual hack seems to work: