@@ -70,74 +70,52 @@ int Translator::sfl() {
70
70
{
71
71
// write macros to file
72
72
std::vector<std::string> definedMacros;
73
- definedMacros.reserve (5 );
73
+ definedMacros.reserve (6 );
74
74
75
- line = " ____" + std::regex_replace (line, std::regex (" -" ), " _" );
75
+ // line = "____" + std::regex_replace(line, std::regex("-"), "_");
76
+ line = " ____" + fontType + " _" + std::to_string (font_width) + " x"
77
+ + std::to_string (font_height) + " _" ;
76
78
std::transform (line.begin (), line.end (), line.begin (), ::toupper);
77
79
78
80
definedMacros.push_back (line);
79
81
80
-
81
- Translator::outputFile << " #ifndef " << line << " \n " ;
82
- Translator::outputFile << " #define " << line << " \n\n\n " ;
83
-
84
- line = " type_" + fontType + " _" +
85
- std::to_string (font_width) + " x" + std::to_string (font_height);
86
-
87
- std::transform (
88
- line.begin (), line.end (),
89
- line.begin (), ::toupper
90
- );
82
+ line = " TYPE_PSF1_8X18" ;
91
83
definedMacros.push_back (line);
92
- Translator::outputFile << " #define " << line <<
93
- " " ;
94
-
95
- if (!Prefs.isCPU ()) {
96
- Translator::outputFile << 5 ;
97
- }
98
- else {
99
- Translator::outputFile << 0 ;
100
- }
101
-
102
- Translator::outputFile << " \n\n " ;
103
-
104
- line = " font_" + fontType + " _" +
105
- std::to_string (font_width) + " x" +
106
- std::to_string (font_height);
107
- tmp = line + " _width" ;
108
- line.append (" _height" );
109
-
110
- std::transform (
111
- line.begin (), line.end (),
112
- line.begin (), ::toupper
113
- );
114
- std::transform (
115
- tmp.begin (), tmp.end (),
116
- tmp.begin (), ::toupper
117
- );
118
84
85
+ line = " PSF1_SIGNATURE" ;
119
86
definedMacros.push_back (line);
120
- definedMacros.push_back (tmp);
121
87
122
- Translator::outputFile << " #define " << line <<
123
- " " << font_height << " \n\n " ;
124
- Translator::outputFile << " #define " << tmp <<
125
- " " << font_width << " \n\n\n " ;
88
+ line = fontType + " _ " + std::to_string (font_width) + " x "
89
+ + std::to_string ( font_height) + " _height " ;
90
+ std::transform (line. begin (), line. end (), line. begin (), ::toupper);
91
+ definedMacros. push_back (line) ;
126
92
93
+ line = fontType + " _" + std::to_string (font_width) + " x"
94
+ + std::to_string (font_height) + " _width" ;
95
+ std::transform (line.begin (), line.end (), line.begin (), ::toupper);
96
+ definedMacros.push_back (line);
127
97
128
- line = " decl_" + fontType + " _" +
129
- std::to_string (font_width) + " x" +
130
- std::to_string (font_height);
131
- std::transform (
132
- line.begin (), line.end (),
133
- line.begin (), ::toupper
134
- );
98
+ line = " decl_" + fontType + " _" + std::to_string (font_width)
99
+ + " x" + std::to_string (font_height);
100
+ std::transform (line.begin (), line.end (), line.begin (), ::toupper);
135
101
definedMacros.push_back (line);
136
102
137
- Translator::outputFile << " #define " << line <<
138
- " \\\n {\\\n\t " ;
103
+
104
+ if (fontType == " psf1" ) {
105
+ line = " 0x3604" ;
106
+ } else {
107
+ line = " " ;
108
+ }
139
109
140
110
111
+ Translator::outputFile << " #ifndef " << definedMacros[0 ]
112
+ << " \n #define " << definedMacros[0 ]
113
+ << " \n\n\n #define " << definedMacros[1 ] << " 0"
114
+ << " \n\n #define " << definedMacros[2 ] << line
115
+ << " \n\n #define " << definedMacros[3 ] << " " << std::to_string (font_height)
116
+ << " \n\n #define " << definedMacros[4 ] << " " << std::to_string (font_width)
117
+ << " \n\n #define " << definedMacros[5 ]
118
+ << " \\\n {\\\n\t " ;
141
119
142
120
143
121
if (!Prefs.isLogSuppressed ()) {
0 commit comments