+2005-02-20 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/pfb.cc (LY_DEFINE): ly:ttf->pfa, new function.
+
+ * THANKS: add Steve D
+
+ * ttftool/*.c: add TTF -> Type42 conversion library.
+
+2005-02-20 Tatsuya Ono <tats_ono@infoseek.jp>
+
+ * mf/parmesan-heads.mf: "0harmonic" -> "s0harmonic"
+ to show harmonic notes
+ * scm/define-markup-commands.scm: in \markup-by-number
+ "dots-dot" -> "dots.dot" to show dotted notes
+
+2005-02-20 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * flower/include/memory-stream.hh (class Memory_out_stream): new file.
+
+ * flower/memory-stream.cc (writer): new file.
+
+ * configure.in: add endian test.
+
2005-02-19 Jürgen Reuter <reuter@ipd.uka.de>
* Documentation/user/examples.itely: small
@cindex fetachar
To include feta symbols (such as flat, segno, etc) in a LaTeX
-document, use @code{\input{titledefs}
+document, use @code{\input@{titledefs@}}
@example
-\documentclass[a4paper]{article}
+\documentclass[a4paper]@{article@}
-\input{titledefs}
+\input@{titledefs@}
-\begin{document}
+\begin@{document@}
\fetachar\fetasharp
-\end{document}
+\end@{document@}
@end example
The font symbol names are defined in the file feta20.tex; to find
begins on concert D, one would write
@example
-\transpose c bes { e4 @dots{} }
+\transpose c bes @{ e4 @dots{} @}
@end example
To print this music in B-flat again (ie producing a trumpet part,
existing music with another @code{transpose}
@example
-\transpose bes c { \transpose c bes { e4 @dots{} } }
+\transpose bes c @{ \transpose c bes @{ e4 @dots{} @} @}
@end example
This command sets the property @code{instrumentTransposition}. The value of
this property is used for MIDI output and quotations. It does not
affect how notes are printed in the current staff. To change the printed
-output, see @ref{transpose}.
+output, see @ref{Transpose}.
The pitch to use for @code{\transposition} should correspond to the
transposition of the notes. For example, when entering a score in
#
SUBDIRS = buildscripts python scripts \
elisp \
- flower lily \
+ flower ttftool lily \
mf ly tex ps scm \
po make \
cygwin debian stepmake \
CONTRIBUTORS
+Andreas Scherer
+Arno Waschk
Bertalan Fodor
+Carl Sorensen
Christian Hitz
Erlend Aasland
-Arno Waschk
-Carl Sorensen
Heikki Junes
-Werner Lemberg
-Andreas Scherer
+Juergen Reuter
+Mats Bengtsson
Nicolas Sceaux
Tatsuya Ono
-Mats Bengtsson
+Werner Lemberg
SPONSORS
Jonathan Walther
+Steve Doonan
BUG HUNTERS/SUGGESTIONS
# Move to aclocal.m4?
AC_CONFIG_HEADER([$CONFIGFILE.hh:config.hh.in])
+AC_C_BIGENDIAN(CFLAGS="$CFLAGS -DBIGENDIAN",
+ CFLAGS="$CFLAGS -DSMALLENDIAN")
+
+
+
+
# Uncomment the configuration options your package needs.
--- /dev/null
+/*
+ memory-stream.hh -- declare
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+*/
+
+#ifndef MEMORY_STREAM_HH
+#define MEMORY_STREAM_HH
+
+#include <stdio.h>
+#include <unistd.h>
+
+
+/*
+ TODO: read support as well.
+ */
+class Memory_out_stream
+{
+ char *buffer_;
+ ssize_t size_;
+ int buffer_blocks_;
+ FILE *file_;
+
+ static cookie_io_functions_t functions_;
+ static const int block_size_;
+
+ static ssize_t reader (void*, char*, size_t);
+ static ssize_t writer (void*, const char*, size_t);
+ static int seeker (void*, off64_t *, int whence);
+ static int cleaner (void*);
+
+
+public:
+ ~Memory_out_stream ();
+ Memory_out_stream ();
+ FILE *get_file () const;
+ char const *get_string() const;
+ ssize_t get_length () const;
+};
+
+#endif /* MEMORY_STREAM_HH */
--- /dev/null
+/*
+ memory-stream.cc -- implement Memory_out_stream
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+*/
+
+#include <assert.h>
+#include <string.h>
+#include <stdlib.h>
+#include <libio.h>
+#include "memory-stream.hh"
+
+const int Memory_out_stream::block_size_ = 1024;
+
+cookie_io_functions_t
+Memory_out_stream::functions_ = {
+ Memory_out_stream::reader,
+ Memory_out_stream::writer,
+ Memory_out_stream::seeker,
+ Memory_out_stream::cleaner
+};
+
+int
+Memory_out_stream::cleaner (void *cookie)
+{
+ Memory_out_stream *stream = (Memory_out_stream*) cookie;
+
+ stream->file_ = 0;
+ return 0;
+}
+
+Memory_out_stream::Memory_out_stream ()
+{
+ size_ = 0;
+ buffer_ = 0;
+ buffer_blocks_ = 0;
+ file_ = fopencookie ((void*) this, "w", functions_);
+}
+
+Memory_out_stream::~Memory_out_stream()
+{
+ if (file_)
+ fclose (file_);
+
+ free (buffer_);
+}
+
+FILE*
+Memory_out_stream::get_file () const
+{
+ return file_;
+}
+
+ssize_t
+Memory_out_stream::get_length () const
+{
+ return size_;
+}
+
+const char *
+Memory_out_stream::get_string () const
+{
+ return buffer_;
+}
+
+
+ssize_t
+Memory_out_stream::writer (void *cookie,
+ const char *buffer,
+ size_t size)
+{
+ Memory_out_stream * stream = (Memory_out_stream*) cookie;
+
+ ssize_t newsize = stream->size_ + size;
+
+ bool change = false;
+ while (newsize > stream->buffer_blocks_ * block_size_)
+ {
+ stream->buffer_blocks_ *= 2;
+ stream->buffer_blocks_ += 1;
+ change = true;
+ }
+
+ if (change)
+ stream->buffer_ = (char*) realloc (stream->buffer_, stream->buffer_blocks_ * block_size_);
+
+ memcpy (stream->buffer_ + stream->size_, buffer, size);
+ stream->size_ = newsize;
+
+ return size;
+}
+
+
+ssize_t
+Memory_out_stream::reader (void *cookie,
+ char *buffer,
+ size_t size)
+{
+ (void) cookie;
+ (void) buffer;
+ (void) size;
+
+ assert (false);
+}
+
+
+int
+Memory_out_stream::seeker (void*, off64_t *, int whence)
+{
+ assert (false);
+ (void)whence;
+ return 0;
+}
japanese = \lyricsto "melody" \new Lyrics {
いろはにほへど ちりぬるを
- わがよたれぞ つねならむ
- うゐのおくやまけふこえて
+ わがよたれぞ つねならむ
+ うゐのおくや まけふこえて
あさきゆめみじ ゑひもせず
}
%% no support for TTF yet.
-% \japanese
+ \japanese
>>
NAME = lilypond
SUBDIRS = include
-MODULE_LIBS=$(depth)/flower
-MODULE_INCLUDES= $(depth)/flower/include
+MODULE_LIBS=$(depth)/flower $(depth)/ttftool
+MODULE_INCLUDES= $(depth)/flower/include $(depth)/ttftool/include
MODULE_CXXFLAGS=
#include <cstring>
#include "source-file.hh"
+#include "memory-stream.hh"
+#include "ttftool.h"
char *
pfb2pfa (Byte const * pfb, int length)
Byte const * p = pfb;
while (p < pfb + length)
{
- if (*p++ != 128)
+ if (*p++ != 128)
break;
Byte type = *p++;
delete str;
return pfa_scm;
}
+
+
+LY_DEFINE(ly_ttf_to_pfa, "ly:ttf->pfa",
+ 1, 0, 0, (SCM ttf_path),
+ "Convert the contents of a TTF file to Type42 PFA, returning it as "
+ " a string."
+ )
+{
+ SCM_ASSERT_TYPE(scm_is_string (ttf_path), ttf_path,
+ SCM_ARG1, __FUNCTION__, "string");
+
+ String path = ly_scm2string (ttf_path);
+
+ Memory_out_stream stream;
+ create_type42(path.to_str0 (),
+ stream.get_file());
+ SCM asscm = scm_from_locale_stringn (stream.get_string (),
+ stream.get_length ());
+
+ return asscm;
+}
+
%
fet_beginchar("Harmonic notehead (Neo-mensural open)",
- "0harmonic")
+ "s0harmonic")
draw_neomensural_open_head (1.3 staff_space#, 1.3 noteheight#);
charwx := head_width#;
(cons (min stemy attachy)
(max stemy attachy))
(/ stem-thickness 3))))
- (dot (ly:font-get-glyph font "dots-dot"))
+ (dot (ly:font-get-glyph font "dots.dot"))
(dotwid (interval-length (ly:stencil-extent dot X)))
(dots (and (> dot-count 0)
(apply ly:stencil-add
(a-file-name (ly:kpathsea-find-file aname))
(b-file-name (ly:kpathsea-find-file bname)))
(cond
- (bare-file-name (if (string-match "\\.pfb" bare-file-name)
- (ly:pfb->pfa bare-file-name)
- (cached-file-contents bare-file-name)))
+ ((and bare-file-name (string-match "\\.pfb" bare-file-name))
+ (ly:pfb->pfa bare-file-name))
+ ((and bare-file-name (string-match "\\.ttf" bare-file-name))
+ (ly:ttf->pfa bare-file-name))
+ (bare-file-name (cached-file-contents bare-file-name))
(cff-file-name (cached-file-contents cff-file-name))
(a-file-name (ps-embed-pfa (cached-file-contents a-file-name) x 0))
(b-file-name (ps-embed-pfa (ly:pfb->pfa b-file-name) x 0))