From: Han-Wen Nienhuys Date: Wed, 13 Jul 2005 14:40:03 +0000 (+0000) Subject: * scm/output-svg.scm (utf-8-string): rename from utf8-string. X-Git-Tag: release/2.7.1~33 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4e510ab3b12fc000637638b42ed4ee548fae5694;p=lilypond.git * scm/output-svg.scm (utf-8-string): rename from utf8-string. * scm/output-gnome.scm: remove beam routine. * scm/output-ps.scm (scm): idem. * scm/output-svg.scm: remove beam. * ps/music-drawing-routines.ps: remove draw_beam. * lily/lookup.cc (beam): use round_filled_polygon() for beam. --- diff --git a/ChangeLog b/ChangeLog index 6254b6bf4e..b5354cf886 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2005-07-13 Han-Wen Nienhuys + * scm/output-svg.scm (utf-8-string): rename from utf8-string. + * scm/output-gnome.scm: remove beam routine. * scm/output-ps.scm (scm): idem. diff --git a/lily/pango-font.cc b/lily/pango-font.cc index c021807467..386f7af172 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -241,7 +241,7 @@ Pango_font::text_stencil (String str) const */ char *descr_string = pango_font_description_to_string (pango_description_); SCM exp - = scm_list_3 (ly_symbol2scm ("utf8-string"), + = scm_list_3 (ly_symbol2scm ("utf-8-string"), scm_makfrom0str (descr_string), scm_makfrom0str (str.to_str0 ())); diff --git a/scm/define-stencil-commands.scm b/scm/define-stencil-commands.scm index 3ebd854a8f..090e736255 100644 --- a/scm/define-stencil-commands.scm +++ b/scm/define-stencil-commands.scm @@ -24,7 +24,7 @@ round-filled-box text url-link - utf8-string + utf-8-string white-dot white-text embedded-ps diff --git a/scm/output-gnome.scm b/scm/output-gnome.scm index 589cfbf3cb..c26e6cb94c 100644 --- a/scm/output-gnome.scm +++ b/scm/output-gnome.scm @@ -100,7 +100,7 @@ lilypond -fgnome input/simple-song.ly ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; helper functions -(define (utf8 i) +(define (utf-8 i) (cond ((< i #x80) (list (integer->char i))) ((< i #x800) (map integer->char @@ -113,19 +113,19 @@ lilypond -fgnome input/simple-song.ly (list (+ #xe0 x) (+ #x80 (quotient y #x40)) (+ #x80 (modulo y #x40)))))) - (else (begin (stderr "programming-error: utf8 too big:~x\n" i) + (else (begin (stderr "programming-error: utf-8 too big:~x\n" i) (list (integer->char 32)))))) -(define (integer->utf8-string integer) - (list->string (utf8 integer))) +(define (integer->utf-8-string integer) + (list->string (utf-8 integer))) -(define (char->utf8-string char) - (list->string (utf8 (char->integer char)))) +(define (char->utf-8-string char) + (list->string (utf-8 (char->integer char)))) -(define (string->utf8-string string) +(define (string->utf-8-string string) (apply string-append - (map (lambda (x) (char->utf8-string x)) (string->list string)))) + (map (lambda (x) (char->utf-8-string x)) (string->list string)))) (define (music-font? font) (let ((family (car (font-name-style font)))) @@ -265,7 +265,7 @@ lilypond -fgnome input/simple-song.ly #:size-points (canvas-font-size font) #:size-set #t #:text - (integer->utf8-string + (integer->utf-8-string (ly:font-glyph-name-to-charcode font (caddr x)))))) x-y-named-glyphs)) @@ -325,10 +325,10 @@ lilypond -fgnome input/simple-song.ly #:size-points (canvas-font-size font) #:size-set #t #:text (if (integer? s) - (integer->utf8-string s) - (string->utf8-string s)))) + (integer->utf-8-string s) + (string->utf-8-string s)))) -(define (utf8-string pango-font-description string) +(define (utf-8-string pango-font-description string) (make #:parent (canvas-root) #:x 0.0 #:y 0.0 diff --git a/scm/output-ps.scm b/scm/output-ps.scm index 681fec17f0..0fe0a1ef14 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -287,8 +287,8 @@ (cdr y) url)) -(define (utf8-string pango-font-description string) - (ly:warning (_ "utf8-string encountered in PS backend"))) +(define (utf-8-string pango-font-description string) + (ly:warning (_ "utf-8-string encountered in PS backend"))) diff --git a/scm/output-socket.scm b/scm/output-socket.scm index 52f80348ee..f55cf93bf9 100644 --- a/scm/output-socket.scm +++ b/scm/output-socket.scm @@ -94,11 +94,13 @@ (grob-bbox grob offset)) ))) -(define-public (glyph-string - postscript-font-name - size cid? - x-y-named-glyphs) + +(define-public (utf-8-string + descr + string) - (format "text \"~a\" ~a ~a " postscript-font-name size - (string-join (map (lambda (xyn) (caddr xyn)) - x-y-named-glyphs)))) + (format "utf-8 \"~a\" \"~a\"" descr + + ;; don't want unescaped spaces. + (string-regexp-substitute " " "\\040" string))) + diff --git a/scm/output-svg.scm b/scm/output-svg.scm index a1df2f474c..cf2e539b85 100644 --- a/scm/output-svg.scm +++ b/scm/output-svg.scm @@ -281,7 +281,7 @@ (define (text font string) (dispatch `(fontify ,font ,(entity 'tspan (string->entities string))))) -(define (utf8-string pango-font-description string) +(define (utf-8-string pango-font-description string) (dispatch `(fontify ,pango-font-description ,(entity 'tspan string))))