OLD | NEW |
1 | 1 |
2 #include "international.hh" | 2 #include "international.hh" |
3 #include "program-option.hh" | 3 #include "program-option.hh" |
4 #include "source-file.hh" | 4 #include "source-file.hh" |
5 #include "memory-stream.hh" | 5 #include "memory-stream.hh" |
6 #include "open-type-font.hh" | 6 #include "open-type-font.hh" |
7 #include "main.hh" | 7 #include "main.hh" |
8 #include "warn.hh" | 8 #include "warn.hh" |
9 | 9 |
10 using std::string; | 10 using std::string; |
11 using std::vector; | 11 using std::vector; |
12 | 12 |
13 LY_DEFINE (ly_type1_2_pfa, "ly:type1->pfa", | 13 LY_DEFINE (ly_type1_2_pfa, "ly:type1->pfa", |
14 1, 0, 0, (SCM type1_file_name), | 14 1, 0, 0, (SCM type1_file_name), |
15 "Convert the contents of a Type@tie{}1 font in PFB format" | 15 "Convert the contents of a Type@tie{}1 font in PFB format" |
16 " to PFA format. If the file is already in PFA format," | 16 " to PFA format. If the file is already in PFA format," |
17 " pass through it.") | 17 " pass through it.") |
18 { | 18 { |
19 LY_ASSERT_TYPE (scm_is_string, type1_file_name, 1); | 19 LY_ASSERT_TYPE (scm_is_string, type1_file_name, 1); |
20 | 20 |
21 string file_name = ly_scm2string (type1_file_name); | 21 string file_name = ly_scm2string (type1_file_name); |
22 | 22 |
23 debug_output ("[" + file_name); // start message on a new line | 23 debug_output ("[" + file_name); // start message on a new line |
24 | 24 |
25 vector<char> type1_string = gulp_file (file_name, 0); | 25 string type1_string = gulp_file (file_name, 0); |
26 SCM pfa_scm; | 26 SCM pfa_scm; |
27 | 27 |
28 if ((Byte) type1_string[0] == 0x80) | 28 if ((Byte) type1_string[0] == 0x80) |
29 { | 29 { |
30 /* The file is in PFB format. Convert it to PFA format. */ | 30 /* The file is in PFB format. Convert it to PFA format. */ |
31 vector<char> pfa = pfb2pfa (type1_string); | 31 string pfa = pfb2pfa (type1_string); |
32 pfa_scm = scm_from_latin1_stringn (&pfa[0], pfa.size ()); | 32 pfa_scm = scm_from_latin1_stringn (&pfa[0], pfa.size ()); |
33 } | 33 } |
34 else | 34 else |
35 { | 35 { |
36 /* The file is in PFA format. Pass it through. */ | 36 /* The file is in PFA format. Pass it through. */ |
37 pfa_scm = scm_from_latin1_stringn (&type1_string[0], | 37 pfa_scm = scm_from_latin1_stringn (&type1_string[0], |
38 type1_string.size ()); | 38 type1_string.size ()); |
39 } | 39 } |
40 | 40 |
41 debug_output ("]", false); | 41 debug_output ("]", false); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 string table = get_otf_table (face, "CFF "); | 86 string table = get_otf_table (face, "CFF "); |
87 | 87 |
88 SCM asscm = scm_from_latin1_stringn ((char *) table.data (), | 88 SCM asscm = scm_from_latin1_stringn ((char *) table.data (), |
89 table.length ()); | 89 table.length ()); |
90 FT_Done_Face (face); | 90 FT_Done_Face (face); |
91 | 91 |
92 debug_output ("]", false); | 92 debug_output ("]", false); |
93 | 93 |
94 return asscm; | 94 return asscm; |
95 } | 95 } |
OLD | NEW |