Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(653)

Delta Between Two Patch Sets: scm/font.scm

Issue 290850043: output-svg.scm: better defaults for font-family (Closed)
Left Patch Set: Set svg defaults in font.scm instead and add doc edits Created 9 years, 1 month ago
Right Patch Set: minor doc edit Created 9 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Documentation/usage/running.itely ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 ;;;; This file is part of LilyPond, the GNU music typesetter. 1 ;;;; This file is part of LilyPond, the GNU music typesetter.
2 ;;;; 2 ;;;;
3 ;;;; Copyright (C) 2004--2015 Han-Wen Nienhuys <hanwen@xs4all.nl> 3 ;;;; Copyright (C) 2004--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
4 ;;;; 4 ;;;;
5 ;;;; LilyPond is free software: you can redistribute it and/or modify 5 ;;;; LilyPond is free software: you can redistribute it and/or modify
6 ;;;; it under the terms of the GNU General Public License as published by 6 ;;;; it under the terms of the GNU General Public License as published by
7 ;;;; the Free Software Foundation, either version 3 of the License, or 7 ;;;; the Free Software Foundation, either version 3 of the License, or
8 ;;;; (at your option) any later version. 8 ;;;; (at your option) any later version.
9 ;;;; 9 ;;;;
10 ;;;; LilyPond is distributed in the hope that it will be useful, 10 ;;;; LilyPond is distributed in the hope that it will be useful,
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 ; 247 ;
248 ; Leaving out "#:brace", "#:sans", and "#:typewriter" leave them at· 248 ; Leaving out "#:brace", "#:sans", and "#:typewriter" leave them at·
249 ; "emmentaler", "sans-serif", and "monospace", respectively. All fonts are 249 ; "emmentaler", "sans-serif", and "monospace", respectively. All fonts are
250 ; still accesible through the usual scheme symbols: 'feta, 'roman, 'sans, and 250 ; still accesible through the usual scheme symbols: 'feta, 'roman, 'sans, and
251 ; 'typewriter. 251 ; 'typewriter.
252 ; 252 ;
253 ; Note that 'LilyPond Serif', 'LilyPond Sans Serif' and 'Lilypond Monospace' 253 ; Note that 'LilyPond Serif', 'LilyPond Sans Serif' and 'Lilypond Monospace'
254 ; are aliases that are defined in mf/00-lilypond-fonts.conf.in (source file) 254 ; are aliases that are defined in mf/00-lilypond-fonts.conf.in (source file)
255 ; or fonts/00-lilypond-fonts.conf (installed file). 255 ; or fonts/00-lilypond-fonts.conf (installed file).
256 256
257 (define*-public (set-global-fonts #:key 257 (define*-public (set-global-fonts #:key
258 (music "emmentaler") 258 (music "emmentaler")
259 (brace "emmentaler") 259 (brace "emmentaler")
260 (roman (if (eq? (ly:get-option 'backend) 'svg) 260 (roman (if (eq? (ly:get-option 'backend) 'svg)
261 » "serif" "LilyPond Serif")) 261 "serif" "LilyPond Serif"))
262 (sans (if (eq? (ly:get-option 'backend) 'svg) 262 (sans (if (eq? (ly:get-option 'backend) 'svg)
263 » "sans-serif" "LilyPond Sans Serif")) 263 "sans-serif" "LilyPond Sans Serif"))
264 (typewriter (if (eq? (ly:get-option 'backend) 'svg) 264 (typewriter (if (eq? (ly:get-option 'backend) 'svg)
265 » » "monospace" "LilyPond Monospace")) 265 "monospace" "LilyPond Monospace"))
266 (factor 1)) 266 (factor 1))
267 (let ((n (make-font-tree-node 'font-encoding 'fetaMusic))) 267 (let ((n (make-font-tree-node 'font-encoding 'fetaMusic)))
268 (add-music-fonts n 'feta music brace feta-design-size-mapping factor) 268 (add-music-fonts n 'feta music brace feta-design-size-mapping factor)
269 (add-pango-fonts n 'roman roman factor) 269 (add-pango-fonts n 'roman roman factor)
270 (add-pango-fonts n 'sans sans factor) 270 (add-pango-fonts n 'sans sans factor)
271 (add-pango-fonts n 'typewriter typewriter factor) 271 (add-pango-fonts n 'typewriter typewriter factor)
272 n)) 272 n))
273 273
274 (define-public (make-pango-font-tree roman-str sans-str typewrite-str factor) 274 (define-public (make-pango-font-tree roman-str sans-str typewrite-str factor)
275 (let ((n (make-font-tree-node 'font-encoding 'fetaMusic))) 275 (let ((n (make-font-tree-node 'font-encoding 'fetaMusic)))
276 (add-music-fonts n 'feta "emmentaler" "emmentaler" feta-design-size-mapping factor) 276 (add-music-fonts n 'feta "emmentaler" "emmentaler" feta-design-size-mapping factor)
277 (add-pango-fonts n 'roman roman-str factor) 277 (add-pango-fonts n 'roman roman-str factor)
278 (add-pango-fonts n 'sans sans-str factor) 278 (add-pango-fonts n 'sans sans-str factor)
279 (add-pango-fonts n 'typewriter typewrite-str factor) 279 (add-pango-fonts n 'typewriter typewrite-str factor)
280 n)) 280 n))
281 281
282 (define-public (make-default-fonts-tree factor) 282 (define-public (make-default-fonts-tree factor)
283 (make-pango-font-tree 283 (make-pango-font-tree
284 (if (eq? (ly:get-option 'backend) 'svg) "serif" "LilyPond Serif") 284 (if (eq? (ly:get-option 'backend) 'svg) "serif" "LilyPond Serif")
285 (if (eq? (ly:get-option 'backend) 'svg) "sans-serif" "LilyPond Sans Serif") 285 (if (eq? (ly:get-option 'backend) 'svg) "sans-serif" "LilyPond Sans Serif")
286 (if (eq? (ly:get-option 'backend) 'svg) "monospace" "LilyPond Monospace") 286 (if (eq? (ly:get-option 'backend) 'svg) "monospace" "LilyPond Monospace")
287 factor)) 287 factor))
288 288
289 (define-public all-text-font-encodings 289 (define-public all-text-font-encodings
290 '(latin1)) 290 '(latin1))
291 291
292 (define-public all-music-font-encodings 292 (define-public all-music-font-encodings
293 '(fetaBraces 293 '(fetaBraces
294 fetaMusic 294 fetaMusic
295 fetaText)) 295 fetaText))
296 296
297 (define-public (magstep s) 297 (define-public (magstep s)
298 (exp (* (/ s 6) (log 2)))) 298 (exp (* (/ s 6) (log 2))))
299 299
300 (define-public (magnification->font-size m) 300 (define-public (magnification->font-size m)
301 (* 6 (/ (log m) (log 2)))) 301 (* 6 (/ (log m) (log 2))))
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b