lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feedback for starting a crowd funding campaign


From: karl
Subject: Re: Feedback for starting a crowd funding campaign
Date: Wed, 5 Mar 2014 17:23:55 +0100 (CET)

Urs:
> Am 05.03.2014 15:26, schrieb address@hidden:
...
> > Proof of concept:
> >
> > http://turkos.aspodata.se/git/musik/bin/lilyfont.readme
> > http://turkos.aspodata.se/git/musik/bin/lilyfont.pl
> > http://turkos.aspodata.se/git/musik/bin/lilyfont.tex
> > http://turkos.aspodata.se/tmp/lilyfont.pdf
> >
> > Next step is to find a suitable mapping between the postscript glyphs
> > names and a the latex commands in the resulting .sty file, I could
> > possible extract that and scaling and raise info from the lilyglyphs
> > package.
> 
> Maybe it would be a more generic/straightforward/maintainable approach 
> not to create a parallel approach but to inject it in the current behaviour:
> - generate a mapping between the postscript and the OpenType glyph names

I think that the glyph names are the same, well they should, since
the .otf's are build from the .pfb's.

> - create an additional implementation to access the glyphs from the font
>    (currently there are different implementations to access the glyphs
>     when running lualatex or xelatex)

I get the glyph names and the encoding by reading the postscript font
file (.pfb) in lilypond/mf/out, I could use the .enc file instead, but
then I cannot read the postscript fontname (maybe I could trust that
the basename of the filename and the postscript font name are the
same). My guess is that the .enc files are made by
lilypond/scripts/build/mf-to-table.py and one could possible modify
that script so it generated something usable to latex (i.e. make
lilyfont.pl above redundant) and lilyglyphs.

> - use \lilyGetGlyph just as for the existing versions.

You define \lilyGetGlyph in lilyglyphs/core/genericAccess.inp
(https://github.com/openlilylib/lilyglyphs.git):

\usepackage{ifluatex,ifxetex}

\ifluatex
\usepackage{luaotfload,luacode} 
\begin{luacode}
documentdata = documentdata or { }

local stringformat = string.format
local texsprint = tex.sprint
local slot_of_name = luaotfload.aux.slot_of_name

documentdata.fontchar = function (chr)
local chr = slot_of_name(font.current(), chr, false)
if chr and type(chr) == "number" then
texsprint
(stringformat ([[\char"%X"]], chr))
end
end
\end{luacode}

\def\lilyGetGlyph#1{\directlua{documentdata.fontchar "#1"}}
\fi

\ifxetex
\newcommand*{\lilyGetGlyph}[1]{\XeTeXglyph\XeTeXglyphindex"#1" }
\fi

I don't know how to do that in plain latex, sorry. I mimiced
/usr/share/texmf/tex/latex/tipa/tipx.sty from the tipa package.

> This wouldn't automatically create commands for all existing glyphs but 
> it would make the use consistent regardless of the used latex engine.

That's an good idea, but I don't know how to do an \lilyGetGlyph in 
latex. Maybe someone else know.

Regards,
/Karl Hammar

-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57





reply via email to

[Prev in Thread] Current Thread [Next in Thread]