]> git.donarmstrong.com Git - lilypond.git/commitdiff
(pad-to-box): new markup command.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 30 Nov 2005 14:45:55 +0000 (14:45 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 30 Nov 2005 14:45:55 +0000 (14:45 +0000)
ChangeLog
Documentation/topdocs/NEWS.tely
input/regression/font-kern.ly [new file with mode: 0644]
scm/define-markup-commands.scm
scm/output-ps.scm

index 473c816d3a443d5f5a1af671a07b9b5a9a4e5373..a2e78e0343daf79b3e8140572fbb31e935ce4aab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2005-11-30  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * scm/define-markup-commands.scm (pad-to-box): new markup command.
+
        * scm/define-grobs.scm (all-grob-descriptions): set thickness to
        1.0.
        (all-grob-descriptions): don't shift RehearsalMark arbitrarily.
index 18627dcea311b8df1855e8d3ebba1aa704b6e65e..c2a91473b2d8cd4434a53d8820f1772a129d01a9 100644 (file)
@@ -45,9 +45,11 @@ This document is also available in @uref{NEWS.pdf,PDF}.
 
 
 @itemize @bullet
+@item Texts set in a TrueType font are now kerned.
 
-@item LilyPond does no longer link to kpathsea for the @TeX{} backend.
-This makes the @TeX{} backend more easily usable on various systems.
+@item Using the @TeX{}  no longer requires linking or dynamically
+opening the kpathsea library, making the backend more easily usable on
+various systems.
 
 This fix was sponsored by Christian Ebert.
 
diff --git a/input/regression/font-kern.ly b/input/regression/font-kern.ly
new file mode 100644 (file)
index 0000000..8cc4ea0
--- /dev/null
@@ -0,0 +1,22 @@
+\version "2.7.20"
+
+\header {
+  texidoc = "Text set in TrueType Fonts that contain kerning tables, are kerned. "
+}
+
+\markup {
+%  \override #'(font-name . "VeraSerif")
+  \override #'(padding . 0)
+  \override #'(thickness . 0.00001)
+  \override #'(box-padding . 0.0)
+  \column {
+    \line { \pad-to-box #'(0 . 50) #'(0 . 2) \line { With kerning: }
+           \override #'(font-size . 12)
+           \box { VAVAVA } }
+    \line {
+      \pad-to-box #'(0 . 50) #'(0 . 2) \line { Without kerning: }
+      \override #'(font-size . 12)
+      \override #'(word-space . 0.0) \line { \box V \box A \box V \box A \box V \box A } }
+  }
+}
+
index 3597686ef8d6a7f6ff638df32a49ecbd958be8a2..6f1cf2b256e8b8379c5db12bb6fb8c8590604457 100644 (file)
@@ -97,6 +97,7 @@ the PDF backend."
   "Draw a box round @var{arg}.  Looks at @code{thickness},
 @code{box-padding} and @code{font-size} properties to determine line
 thickness and padding around the markup."
+  
   (let* ((th (chain-assoc-get 'thickness props  0.1))
         (size (chain-assoc-get 'font-size props 0))
         (pad (* (magstep size)
@@ -391,7 +392,6 @@ determines the space between each markup in @var{args}."
        (text-dir (chain-assoc-get 'text-direction props RIGHT)) 
        )
 
-    
     (if (= text-dir LEFT)
        (set! stencils (reverse stencils)))
     
@@ -687,6 +687,21 @@ alignment accordingly."
                     x y)))
 
 
+(def-markup-command (pad-to-box layout props x-ext y-ext arg) (number-pair? number-pair? markup?)
+  "Make @var{arg} take at least @var{x-ext}, @var{y-ext} space"
+
+  (let*
+      ((m (interpret-markup layout props arg))
+       (x (ly:stencil-extent m X))
+       (y (ly:stencil-extent m Y)))
+
+
+    (ly:make-stencil (ly:stencil-expr m)
+                    (interval-union x-ext x)
+                    (interval-union y-ext y))))
+
+
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; property
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
index 74e1d01b61b54c6fa0e8dbbc82d8dff559e66641..67431321ff75d6958303da3e6f0c464560144ebb 100644 (file)
         size cid?
         w-x-y-named-glyphs)
 
-  (format #f "gsave 1 output-scale div 1 output-scale div scale
-  /~a ~a ~a scalefont setfont\n~a grestore"
+  (format #f "gsave 
+  /~a ~a ~a output-scale div scalefont setfont\n~a grestore"
          postscript-font-name
          (if cid?
              " /CIDFont findresource "
              " findfont")
-         
          size
          (apply
           string-append
                       (g (cadddr item))
                       (prefix (if  (string? g) "/" "")))
 
-                   (if (and (= 0.0 x)
-                            (= 0.0 y))
-                       (format #f " ~a~a glyphshow\n" prefix g)
-;;                     (format #f " gsave ~a~a glyphshow grestore ~a 0 rmoveto \n" prefix g w)
-                       (format #f " ~a ~a rmoveto ~a~a glyphshow\n"
-                               x y
-                               prefix
-                               g))))
+                   (format #f " gsave ~a~a glyphshow grestore ~a ~a rmoveto \n" prefix g (+ w x) y)
+                   ))
                w-x-y-named-glyphs))))
 
 (define (grob-cause offset grob)