lilypond-user
[Top][All Lists]

## Re: not-latin lyrics

 From: Mats Bengtsson Subject: Re: not-latin lyrics Date: Thu, 01 Jul 2004 17:21:06 +0200 User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616

The steps described below are not relevant for the current versions
of LilyPond. However, they provided enough hints that I think I have
found a solution, see the following example. Note that I don't know
any russian, so I just copied a text from a web page.

------------------------------------------------
inputencoding="koi8-r"
fontencoding="T2A"
}

\score{<<
\context Voice = melody \notes \relative c'{
c d e f g a b c}
\lyricsto melody \new Lyrics \lyrics{
Для поддержки русского языка в teTeX нужно
}>>
\paper{
\context{
\LyricsContext
\override LyricText #'font-name = #'"larm1000"
}
}
}

-------------------------------------------------------

As you can see, the necessary steps are to define the
inputencoding and the fontencoding and to tell LilyPond
the name of the font file. The steps to find out the name of
the font file is just as described below (I don't understand
the problems mentioned about the larm* files though).

Note that you need LilyPond version 2.2.0 or newer for
this solution to work.

/Mats

Herman Grootaers wrote:

On Monday 28 June 2004 19:13, Werner LEMBERG wrote:


Hmm, I only remember having seen the ps.  Do you have a search


I just did a google search by myself, without results.

Werner




Maybe this mail from in the lilypond-user-archive will help. I have been struggling to get it printing in cyrillic, and on my search I found this mail.
reference: lists.gnu.org/archive/html/lilypond-user/2001-11/msg00119.html


I have however not enough knowledge to make it working, but that can come because we are now in version 2.2/2.3


== Greetings,
Herman Grootaers

A copy form the e-mail follows below
= = = =
Re: Cyrillic


From: Gregory (Grisha) Trubetskoy


Subject: Re: Cyrillic


Date: Fri, 16 Nov 2001 01:43:22 -0500 (EST)


OK, I've succeded in having Cyrillic lyrics, here is how I did it. This
may not be the ultimately correct way to do it, but it worked for me.
Hopefully this will help someone facing the same problem.

paths will vary, but everything should be essentially the same.

The initial problem lies (to the best of my understanding) in lilypond
making an assumption that a font "root name" as described in an FD file
matches the actual file name. TeTeX includes a cyrillic font package
called cmcyr, and, for example, a standard size 8 font in the
/usr/local/share/texmf/tex/latex/cyrillic/t2acmr.fd file is called "larm",
but there are no files on my system beginning with larm. May be I haven't
tried hard enough, but I concluded that using cmcyr fonts with lilypond is
impossible.

So, I installed the pscyr package.

(On FreeBSD this amounts to:
# cd /usr/ports/russian/pscyr
# make install)

Here is what you have to do next:

Step 1 - figure out the file name.

A simple way to do it is to put together the following LaTeX file,
say, test.tex:

\documentclass[10pt, letterpaper]{article}

\usepackage[T2A]{fontenc}
\usepackage[koi8-r]{inputenc}
\usepackage[russian]{babel}
\usepackage{pscyr}

\begin{document}

\texttx{XXXXXXXX}

\end{document}

"XXXXXX" above need to be koi8-r encoded cyrillic characters. \texttx
should set the font to Textbook font. (this is all documented in a file
called fonts-ex.tex)

Then, do:

$latex test.tex$ dvitype test.dvi | grep Font
Font 16: ftxr6a---loaded at size 655360 DVI units
Font 15: faqr6a---loaded at size 655360 DVI units


From this you can see that the file is most likely called ftxr6a, which

can be confirmed by:

\$ locate ftxr6a
/usr/local/share/texmf/fonts/tfm/public/pscyr/ftxr6a.tfm

Step 2 - add a link to it so that lilypond can find it

# cd /usr/local/share/lilpond
# ln -s /usr/local/share/texmf/fonts/tfm/public/pscyr tfm.2

Step 3 - add it to fonts.scm

Edit /usr/local/share/lilypond/scm/fonts.scm so that somewhere (which is
apparent by looking at the file), you have:

((4 medium upright roman ftxr6a 17) . "ftxr6a")
((3 medium upright roman ftxr6a 17) . "ftxr6a")
((2 medium upright roman ftxr6a 12) . "ftxr6a")
((1 medium upright roman ftxr6a 12) . "ftxr6a")
((0 medium upright roman ftxr6a 10) . "ftxr6a")
((-1 medium upright roman ftxr6a 8) . "ftxr6a")
((-2 medium upright roman ftxr6a 7) . "ftxr6a" )
((-3 medium upright roman ftxr6a 6) . "ftxr6a" )
((-4 medium upright roman ftxr6a 5) . "ftxr6a" )
((-5 medium upright roman ftxr6a 5) . "ftxr6a" )

Step 4 - add it to your .mulatex file, in \context Lyrics:

\property Lyrics . LyricText \set #'font-name = #'farr6a

Also, make sure that at the beginning of the document you have:
\usepackage[T2A]{fontenc}
\usepackage[koi8-r]{inputenc}
\usepackage[russian]{babel}
\usepackage{pscyr}

I've skipped all of the details about lilypond-book, but all that is in
the documentation. Because you need the above lines, I don't you can do
this in an .ly file.

Grisha

_______________________________________________
lilypond-user mailing list
http://lists.gnu.org/mailman/listinfo/lilypond-user


--
=============================================
Mats Bengtsson
Signal Processing
Signals, Sensors and Systems
Royal Institute of Technology
SE-100 44  STOCKHOLM
Sweden
Phone: (+46) 8 790 8463
Fax:   (+46) 8 790 7260