Left: | ||
Right: |
OLD | NEW |
---|---|
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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
238 " | 238 " |
239 font-set-name font-set-name version font-set-name | 239 font-set-name font-set-name version font-set-name |
240 (string-length binary-data))) | 240 (string-length binary-data))) |
241 (footer "\n%%EndData | 241 (footer "\n%%EndData |
242 %%EndResource | 242 %%EndResource |
243 %%EndResource\n")) | 243 %%EndResource\n")) |
244 (string-append header | 244 (string-append header |
245 binary-data | 245 binary-data |
246 footer))) | 246 footer))) |
247 | 247 |
248 (define check-conflict-and-embed-cff | |
249 (let ((font-list '())) | |
250 (lambda (name file-name font-index) | |
251 (let* ((name-symbol (string->symbol name)) | |
252 (args-filename-offset | |
253 (cons file-name (ly:get-cff-offset file-name font-index))) | |
254 (found-filename-offset (assq name-symbol font-list))) | |
255 (if found-filename-offset | |
256 (begin | |
257 (if (equal? args-filename-offset (cdr found-filename-offset)) | |
258 (ly:debug | |
259 (_ "The same CFF font `~a' has been detected. Omit the font e mbedding.") | |
lemzwerg
2016/06/28 16:36:38
Perhaps
CFF font `~a' already embedded, skippin
trueroad
2016/06/28 22:05:23
Done.
| |
260 name) | |
261 (ly:warning | |
262 (_ "Different CFF fonts which have the same name `~a' has bee n detected. The font cannot be embedded.") | |
263 name)) | |
264 "") | |
265 (begin | |
266 (ly:debug | |
267 (_ "New CFF font `~a' has been detected. Embed the font.") | |
lemzwerg
2016/06/28 16:36:38
Perhaps
Embedding CFF font `~a'
trueroad
2016/06/28 22:05:23
Done.
| |
268 name) | |
269 (set! font-list | |
270 (acons name-symbol args-filename-offset font-list)) | |
271 (ps-embed-cff (ly:otf->cff file-name font-index) name 0))))))) | |
272 | |
248 (define (write-preamble paper load-fonts? port) | 273 (define (write-preamble paper load-fonts? port) |
249 (define (internal-font? font-name-filename) | 274 (define (internal-font? font-name-filename) |
250 (let* ((font (car font-name-filename)) | 275 (let* ((font (car font-name-filename)) |
251 (file-name (caddr font-name-filename)) | 276 (file-name (caddr font-name-filename)) |
252 (font-file-name (ly:find-file (format #f "~a.otf" file-name)))) | 277 (font-file-name (ly:find-file (format #f "~a.otf" file-name)))) |
253 (and font | 278 (and font |
254 (cff-font? font) | 279 (cff-font? font) |
255 font-file-name | 280 font-file-name |
256 (string-contains font-file-name | 281 (string-contains font-file-name |
257 (ly:get-option 'datadir))))) | 282 (ly:get-option 'datadir))))) |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
366 (let ((font-format (ly:get-font-format file-name font-index))) | 391 (let ((font-format (ly:get-font-format file-name font-index))) |
367 (cond | 392 (cond |
368 ((eq? font-format (string->symbol "Type 1")) | 393 ((eq? font-format (string->symbol "Type 1")) |
369 ;; Type 1 (PFA and PFB) fonts | 394 ;; Type 1 (PFA and PFB) fonts |
370 (ly:type1->pfa file-name)) | 395 (ly:type1->pfa file-name)) |
371 ((eq? font-format 'TrueType) | 396 ((eq? font-format 'TrueType) |
372 ;; TrueType fonts (TTF) and TrueType Collection (TTC) | 397 ;; TrueType fonts (TTF) and TrueType Collection (TTC) |
373 (ly:ttf->pfa file-name font-index)) | 398 (ly:ttf->pfa file-name font-index)) |
374 ((eq? font-format 'CFF) | 399 ((eq? font-format 'CFF) |
375 ;; OpenType/CFF fonts (OTF) and OpenType/CFF Collection (OTC) | 400 ;; OpenType/CFF fonts (OTF) and OpenType/CFF Collection (OTC) |
376 (ps-embed-cff (ly:otf->cff file-name font-index) name 0)) | 401 (check-conflict-and-embed-cff name file-name font-index)) |
377 (else | 402 (else |
378 (ly:warning (_ "do not know how to embed ~S=~S") name file-name) | 403 (ly:warning (_ "do not know how to embed ~S=~S") name file-name) |
379 "")))) | 404 "")))) |
380 | 405 |
381 (define (mac-font? bare-file-name) | 406 (define (mac-font? bare-file-name) |
382 (and (eq? PLATFORM 'darwin) | 407 (and (eq? PLATFORM 'darwin) |
383 bare-file-name | 408 bare-file-name |
384 (or (string-endswith bare-file-name ".dfont") | 409 (or (string-endswith bare-file-name ".dfont") |
385 (= (stat:size (stat bare-file-name)) 0)))) | 410 (= (stat:size (stat bare-file-name)) 0)))) |
386 | 411 |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
787 | 812 |
788 lilypond -dbackend=eps FILE | 813 lilypond -dbackend=eps FILE |
789 | 814 |
790 If you have cut & pasted a lilypond fragment from a webpage, be sure | 815 If you have cut & pasted a lilypond fragment from a webpage, be sure |
791 to only remove anything before | 816 to only remove anything before |
792 | 817 |
793 %% **************************************************************** | 818 %% **************************************************************** |
794 %% Start cut-&-pastable-section | 819 %% Start cut-&-pastable-section |
795 %% **************************************************************** | 820 %% **************************************************************** |
796 "))) | 821 "))) |
OLD | NEW |