]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/pfb.cc (LY_DEFINE): ly:ttf->pfa, new function.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 20 Feb 2005 17:51:07 +0000 (17:51 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 20 Feb 2005 17:51:07 +0000 (17:51 +0000)
* THANKS: add Steve D

14 files changed:
ChangeLog
Documentation/user/lilypond-book.itely
Documentation/user/notation.itely
GNUmakefile.in
THANKS
configure.in
flower/include/memory-stream.hh [new file with mode: 0644]
flower/memory-stream.cc [new file with mode: 0644]
input/regression/utf8.ly
lily/GNUmakefile
lily/pfb.cc
mf/parmesan-heads.mf
scm/define-markup-commands.scm
scm/framework-ps.scm

index ed5f2de7b417edc3f59374f9c87d3fb3590d2cd2..2c67c691b79a60716dfce0f941a8f0e83016d4ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+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
 2005-02-19  Jürgen Reuter  <reuter@ipd.uka.de>
 
        * Documentation/user/examples.itely: small
index f2eba932e2836ad849909c360b146aec361ec81e..6b49e68dcfb88d69ad99e25a132e33d3d8c74138 100644 (file)
@@ -239,18 +239,18 @@ defined by the user.
 @cindex fetachar
 
 To include feta symbols (such as flat, segno, etc) in a LaTeX
 @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
 
 @example
-\documentclass[a4paper]{article}
+\documentclass[a4paper]@{article@}
 
 
-\input{titledefs}
+\input@{titledefs@}
 
 
-\begin{document}
+\begin@{document@}
 
 \fetachar\fetasharp
 
 
 \fetachar\fetasharp
 
-\end{document}
+\end@{document@}
 @end example
 
 The font symbol names are defined in the file feta20.tex; to find
 @end example
 
 The font symbol names are defined in the file feta20.tex; to find
index 95cdceb7743c998b4dde83fc3b926b61a3b249bb..564169a733d46707e3c0807648c66f746c8af9a9 100644 (file)
@@ -5431,7 +5431,7 @@ key.  For example, when entering music for a B-flat trumpet which
 begins on concert D, one would write
 
 @example
 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,
 @end example
 
 To print this music in B-flat again (ie producing a trumpet part,
@@ -5439,7 +5439,7 @@ instead of a concert pitch conductor's score) you would wrap the
 existing music with another @code{transpose}
 
 @example
 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
 
 
 @end example
 
 
@@ -5472,7 +5472,7 @@ The transposition is entered after the keyword @code{\transposition}
 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
 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
 
 The pitch to use for @code{\transposition} should correspond to the
 transposition of the notes.  For example, when entering a score in
index 881fb2c69239c4924a619c62d3a40aecd12c7f90..be27d482005a110b5a9e96124cca70b0b8d43c33 100644 (file)
@@ -10,7 +10,7 @@ depth = .
 # 
 SUBDIRS = buildscripts python scripts \
        elisp \
 # 
 SUBDIRS = buildscripts python scripts \
        elisp \
-       flower lily \
+       flower ttftool lily \
        mf ly tex ps scm \
        po make \
        cygwin debian stepmake \
        mf ly tex ps scm \
        po make \
        cygwin debian stepmake \
diff --git a/THANKS b/THANKS
index bbae33962f379ee69723cf3296e3e7c0ee7a370d..82014184941f4ae968e18516008ddf71270476e0 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -11,21 +11,23 @@ Graham Percival   - Documentation Editor
 
 CONTRIBUTORS
 
 
 CONTRIBUTORS
 
+Andreas Scherer
+Arno Waschk
 Bertalan Fodor
 Bertalan Fodor
+Carl Sorensen
 Christian Hitz
 Erlend Aasland
 Christian Hitz
 Erlend Aasland
-Arno Waschk
-Carl Sorensen
 Heikki Junes
 Heikki Junes
-Werner Lemberg
-Andreas Scherer
+Juergen Reuter
+Mats Bengtsson
 Nicolas Sceaux
 Tatsuya Ono
 Nicolas Sceaux
 Tatsuya Ono
-Mats Bengtsson
+Werner Lemberg
 
 SPONSORS
 
 Jonathan Walther
 
 SPONSORS
 
 Jonathan Walther
+Steve Doonan
 
 BUG HUNTERS/SUGGESTIONS
 
 
 BUG HUNTERS/SUGGESTIONS
 
index d2b8289cad50bfff78f58adee652cf439ce5b417..8959d684e7caeab3879e96c7af98ae878f392177 100644 (file)
@@ -19,6 +19,12 @@ AC_CONFIG_SRCDIR([lily/main.cc])
 # Move to aclocal.m4?
 AC_CONFIG_HEADER([$CONFIGFILE.hh:config.hh.in])
 
 # 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.
 
 
 # Uncomment the configuration options your package needs.
 
 
diff --git a/flower/include/memory-stream.hh b/flower/include/memory-stream.hh
new file mode 100644 (file)
index 0000000..822c447
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+  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 */
diff --git a/flower/memory-stream.cc b/flower/memory-stream.cc
new file mode 100644 (file)
index 0000000..d73e808
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+  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;
+}
index 89e5f76d50597bf59b56aea8079efb58a4730e88..4bb9a5802e5dd90b48c3ca8ab3090cbef07adc49 100644 (file)
@@ -31,8 +31,8 @@ will render Japanese, Hebrew and Cyrillic.
 japanese = \lyricsto "melody" \new Lyrics {  
 
   いろはにほへど ちりぬるを
 japanese = \lyricsto "melody" \new Lyrics {  
 
   いろはにほへど ちりぬるを
-  わがよたれぞ つねならむ
-  うゐのおくやまけふこえて
+  わがよたれぞ  つねならむ
+  うゐのおくや  まけふこえて
   あさきゆめみじ ゑひもせず 
 
  }
   あさきゆめみじ ゑひもせず 
 
  }
@@ -59,6 +59,6 @@ hebrew = \lyricsto "melody" \new Lyrics {
 
   %% no support for TTF  yet.
   
 
   %% no support for TTF  yet.
   
-%  \japanese
+  \japanese
   
 >>
   
 >>
index 24c14b1ec85211f5252e37fb0bc37782044578fe..e5c1fccb023d0f743c891d14f527a26abf5dbe35 100644 (file)
@@ -4,8 +4,8 @@ depth = ..
 NAME = lilypond
 SUBDIRS = include
 
 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= 
 
 
 MODULE_CXXFLAGS= 
 
 
index e35bc01b2fd3c65e199d169f50f36d6609788fa1..5ca2341a119200bfb3d9ce3416c74437d0bc5925 100644 (file)
@@ -12,6 +12,8 @@
 #include <cstring>
 
 #include "source-file.hh"
 #include <cstring>
 
 #include "source-file.hh"
+#include "memory-stream.hh"
+#include "ttftool.h"
 
 char *
 pfb2pfa (Byte const * pfb, int length)
 
 char *
 pfb2pfa (Byte const * pfb, int length)
@@ -22,7 +24,7 @@ pfb2pfa (Byte const * pfb, int length)
   Byte const * p = pfb;
   while (p  < pfb + length)  
     {
   Byte const * p = pfb;
   while (p  < pfb + length)  
     {
-      if (*p++ != 128)
+      if (*p++ != 128) 
        break;
 
       Byte type = *p++;
        break;
 
       Byte type = *p++;
@@ -86,4 +88,26 @@ LY_DEFINE(ly_pfb_to_pfa, "ly:pfb->pfa",
   delete str;
   return pfa_scm;
 }
   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;
+}
          
          
+
index a61c8e115967b124ad2a63a68c092ad9a2493647..095c4c9c0fd1e2be8d552c9af57660be0fb3e86e 100644 (file)
@@ -189,7 +189,7 @@ fet_endchar;
 %
 
 fet_beginchar("Harmonic notehead (Neo-mensural open)",
 %
 
 fet_beginchar("Harmonic notehead (Neo-mensural open)",
-               "0harmonic")
+               "s0harmonic")
 
        draw_neomensural_open_head (1.3 staff_space#, 1.3 noteheight#);
        charwx := head_width#;
 
        draw_neomensural_open_head (1.3 staff_space#, 1.3 noteheight#);
        charwx := head_width#;
index b6425764ec7fd20d5db822bfec8d52522afc250d..9492d14b270cd9fed0141f1fc0dd977731eed222 100644 (file)
@@ -487,7 +487,7 @@ and/or @code{extra-offset} properties. "
                           (cons (min stemy attachy)
                                 (max stemy attachy))
                           (/ stem-thickness 3))))
                           (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
          (dotwid (interval-length (ly:stencil-extent dot X)))
          (dots (and (> dot-count 0)
                     (apply ly:stencil-add
index 1c26d8a863964f84d9942909a5fc87d74f790ccc..b11aa79f66f37f65fc40216e6d16422872987f03 100644 (file)
                           (a-file-name (ly:kpathsea-find-file aname))
                           (b-file-name (ly:kpathsea-find-file bname)))
                      (cond
                           (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))
                       (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))