Debian Codegraph @

texk/lcdf-typetools/lcdf-typetools-src/cfftot1/maket1font.cc

raw
1 /* maket1font.{cc,hh} -- translate CFF fonts to Type 1 fonts
2 *
3 * Copyright (c) 2002-2023 Eddie Kohler
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; either version 2 of the License, or (at your option)
8 * any later version. This program is distributed in the hope that it will be
9 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11 * Public License for more details.
12 */
13
14 #ifdef HAVE_CONFIG_H
15 # include <config.h>
16 #endif
17 #include "maket1font.hh"
18 #include <efont/t1interp.hh>
19 #include <efont/t1csgen.hh>
20 #include <lcdf/point.hh>
21 #include <lcdf/error.hh>
22 #include <efont/t1font.hh>
23 #include <efont/t1item.hh>
24 #include <efont/t1unparser.hh>
25
26 using namespace Efont;
27
28 typedef unsigned CsRef;
29 enum { CSR_GLYPH = 0x00000000, CSR_SUBR = 0x80000000,
30 CSR_GSUBR = 0xC0000000,
31 CSR_TYPE = 0xC0000000, CSR_NUM = 0x3FFFFFFF };
32
33 class MakeType1CharstringInterp : public Type1CharstringGenInterp { public:
34
35 MakeType1CharstringInterp(int precision = 5);
36 ~MakeType1CharstringInterp();
37
38 Type1Font *output() const { return _output; }
39
40 void run(const CharstringProgram *, Type1Font *, PermString glyph_definer, ErrorHandler *);
41 void run(const CharstringContext &, Type1Charstring &, ErrorHandler *);
42
43 bool type2_command(int, const uint8_t *, int *);
44
45 String landmark(ErrorHandler *errh) const;
46
47 class Subr;
48
49 private:
50
51 // output
52 Type1Font *_output;
53 int _flex_message;
54
55 // subroutines
56 int _subr_bias;
57 int _gsubr_bias;
58 mutable Vector<Subr *> _glyphs;
59 mutable Vector<Subr *> _subrs;
60 mutable Vector<Subr *> _gsubrs;
61
62 Subr *_cur_subr;
63 int _cur_glyph;
64
65 Subr *csr_subr(CsRef, bool force) const;
66 Type1Charstring *csr_charstring(CsRef) const;
67
68 };
69
70 class MakeType1CharstringInterp::Subr { public:
71
72 Subr(CsRef csr) : _csr(csr), _output_subrno(-1), _stamp(0) { }
73
74 bool up_to_date() const { return _stamp == max_stamp; }
75 void update() { _stamp = max_stamp; }
76 static void bump_date() { max_stamp++; }
77
78 //String name(const MakeType1CharstringInterp *) const;
79 Type1Charstring *charstring(const MakeType1CharstringInterp *) const;
80
81 int ncalls() const { return _calls.size(); }
82 Subr *call(int i) const { return _calls[i]; }
83 bool has_call(Subr *) const;
84
85 struct Caller {
86 Subr *subr;
87 int pos;
88 int len;
89 Caller(Subr *s, int p, int l)
90 : subr(s), pos(p), len(l) {
91 }
92 String charstring(MakeType1CharstringInterp *mcsi) const {
93 Type1Charstring *t1cs = subr->charstring(mcsi);
94 return t1cs->substring(pos, len);
95 }
96 };
97
98 int ncallers() const { return _callers.size(); }
99 const Caller &caller(int i) const { return _callers[i]; }
100
101 void add_call(Subr *s) { _calls.push_back(s); }
102 void add_caller(Subr *s, int pos, int len);
103
104 int output_subrno() const { return _output_subrno; }
105 void set_output_subrno(int n) { _output_subrno = n; }
106
107 void transfer_nested_calls(int pos, int length, Subr *new_caller) const;
108 void change_callers(Subr *, int pos, int length, int new_length);
109 bool unify(MakeType1CharstringInterp *);
110
111 private:
112
113 CsRef _csr;
114 Vector<Subr *> _calls;
115 Vector<Caller> _callers;
116
117 int _output_subrno;
118 int _stamp;
119
120 static int max_stamp;
121
122 friend class MakeType1CharstringInterp;
123
124 };
125
126 int MakeType1CharstringInterp::Subr::max_stamp = 1;
127
128 inline void
129 MakeType1CharstringInterp::Subr::add_caller(Subr *s, int pos, int len)
130 {
131 _callers.push_back(Caller(s, pos, len));
132 }
133
134 bool
135 MakeType1CharstringInterp::Subr::has_call(Subr *s) const
136 {
137 for (int i = 0; i < _calls.size(); i++)
138 if (_calls[i] == s)
139 return true;
140 return false;
141 }
142
143
144 /*****
145 * MakeType1CharstringInterp
146 **/
147
148 MakeType1CharstringInterp::MakeType1CharstringInterp(int precision)
149 : Type1CharstringGenInterp(precision), _flex_message(0)
150 {
151 }
152
153 MakeType1CharstringInterp::~MakeType1CharstringInterp()
154 {
155 for (int i = 0; i < _glyphs.size(); i++)
156 delete _glyphs[i];
157 for (int i = 0; i < _subrs.size(); i++)
158 delete _subrs[i];
159 for (int i = 0; i < _gsubrs.size(); i++)
160 delete _gsubrs[i];
161 }
162
163 String
164 MakeType1CharstringInterp::landmark(ErrorHandler *errh) const
165 {
166 if (_cur_glyph >= 0 && _cur_glyph < program()->nglyphs())
167 return errh->format("glyph %<%s%>", program()->glyph_name(_cur_glyph).c_str());
168 else
169 return String();
170 }
171
172
173 // subroutines
174
175 MakeType1CharstringInterp::Subr *
176 MakeType1CharstringInterp::csr_subr(CsRef csr, bool force) const
177 {
178 Vector<Subr *> *vp;
179 if ((csr & CSR_TYPE) == CSR_SUBR)
180 vp = &_subrs;
181 else if ((csr & CSR_TYPE) == CSR_GSUBR)
182 vp = &_gsubrs;
183 else if ((csr & CSR_TYPE) == CSR_GLYPH)
184 vp = &_glyphs;
185 else
186 return 0;
187
188 int n = (csr & CSR_NUM);
189 if (n >= vp->size())
190 return 0;
191
192 Subr *&what = (*vp)[n];
193 if (!what && force)
194 what = new Subr(csr);
195 return what;
196 }
197
198 #if 0
199 String
200 MakeType1CharstringInterp::Subr::name(const MakeType1CharstringInterp *mcsi) const
201 {
202 int n = (_csr & CSR_NUM);
203 switch (_csr & CSR_TYPE) {
204 case CSR_SUBR:
205 return "subr" + String(n);
206 case CSR_GSUBR:
207 return "gsubr" + String(n);
208 case CSR_GLYPH:
209 if (String name = mcsi->output()->glyph_name(n))
210 return name;
211 else
212 return "??glyph" + String(n) + "??";
213 default:
214 return "";
215 }
216 }
217 #endif
218
219 Type1Charstring *
220 MakeType1CharstringInterp::Subr::charstring(const MakeType1CharstringInterp *mcsi) const
221 {
222 int n = (_csr & CSR_NUM);
223 switch (_csr & CSR_TYPE) {
224 case CSR_SUBR:
225 case CSR_GSUBR:
226 if (_output_subrno >= 0)
227 return static_cast<Type1Charstring *>(mcsi->output()->subr(_output_subrno));
228 return 0;
229 case CSR_GLYPH:
230 return static_cast<Type1Charstring *>(mcsi->output()->glyph(n));
231 default:
232 return 0;
233 }
234 }
235
236 void
237 MakeType1CharstringInterp::Subr::transfer_nested_calls(int pos, int length, Subr *new_caller) const
238 {
239 int right = pos + length;
240 for (int i = 0; i < _calls.size(); i++) {
241 Subr *cs = _calls[i];
242 // 11.Jul.2006 - remember not to shift the new caller's records! (Michael Zedler)
243 if (cs != new_caller)
244 for (int j = 0; j < cs->_callers.size(); j++) {
245 Caller &c = cs->_callers[j];
246 if (c.subr == this && pos <= c.pos && c.pos + c.len <= right) {
247 // shift caller to point at the subroutine
248 c.subr = new_caller;
249 c.pos -= pos;
250 new_caller->add_call(cs);
251 }
252 }
253 }
254 }
255
256 void
257 MakeType1CharstringInterp::Subr::change_callers(Subr *caller, int pos, int length, int new_length)
258 {
259 if (up_to_date())
260 return;
261 update();
262
263 int right = pos + length;
264 int delta = new_length - length;
265 for (int i = 0; i < _callers.size(); i++) {
266 Caller &c = _callers[i];
267 if (c.subr != caller)
268 /* nada */;
269 else if (pos <= c.pos && c.pos + c.len <= right) {
270 // erase
271 //if (c.debug) fprintf(stderr, " ERASE caller %08x:%d+%d [%d+%d]\n", c.subr->_csr, c.pos, c.len, pos, length);
272 c.subr = 0;
273 } else if (right <= c.pos) {
274 //if (c.debug) fprintf(stderr, " ADJUST caller %08x:%d+%d -> %d+%d [%d+%d]\n", c.subr->_csr, c.pos, c.len, c.pos+delta, c.len, pos, length);
275 c.pos += delta;
276 } else if (c.pos <= pos && right <= c.pos + c.len) {
277 //if (c.debug) fprintf(stderr, " ADJUST caller %08x:%d+%d -> %d+%d [%d+%d]\n", c.subr->_csr, c.pos, c.len, c.pos, c.len+delta, pos, length);
278 c.len += delta;
279 } else
280 c.subr = 0;
281 }
282 }
283
284 bool
285 MakeType1CharstringInterp::Subr::unify(MakeType1CharstringInterp *mcsi)
286 {
287 // clean up caller list
288 for (int i = 0; i < _callers.size(); i++)
289 if (!_callers[i].subr) {
290 _callers[i] = _callers.back();
291 _callers.pop_back();
292 i--;
293 }
294
295 if (!_callers.size())
296 return false;
297 assert(!_calls.size()); // because this hasn't been unified yet
298
299 // Find the smallest shared complete charstring.
300 String substr = _callers[0].charstring(mcsi);
301 int suboff = 0;
302 for (int i = 1; i < _callers.size(); i++) {
303 String substr1 = _callers[i].charstring(mcsi);
304 const char *d = substr.data() + suboff, *d1 = substr1.data();
305 const char *dx = substr.data() + substr.length(), *d1x = d1 + substr1.length();
306 while (dx > d && d1x > d1 && dx[-1] == d1x[-1])
307 dx--, d1x--;
308 if (d1x != d1) {
309 // 8.13.2013 -- We might have stopped in the middle of a number
310 // or command in d1 -- even if we absorbed all of d! For
311 // example, maybe d's version is "15 rlineto" (encoded "154 5"),
312 // and our version is "518 rlineto" (encoded "248 154 5")! So
313 // whenever we stop before the end of d1, we must adjust our
314 // position to the next caret in d1, which, in the example,
315 // would be after "248 154" and before "5".
316 int suboff1 = Type1Charstring(substr1).first_caret_after(d1x - d1);
317 dx += suboff1 - (d1x - d1);
318 }
319 suboff = dx - substr.data();
320 }
321 substr = substr.substring(Type1Charstring(substr).first_caret_after(suboff));
322 if (!substr.length())
323 return false;
324 for (int i = 0; i < _callers.size(); i++) {
325 Caller &c = _callers[i];
326 if (int delta = c.len - substr.length()) {
327 //if (c.debug) fprintf(stderr, " PREFIX caller %08x:%d+%d -> %d+%d [%s]\n", c.subr->_csr, c.pos, c.len, c.pos+delta, c.len+delta, CharstringUnparser::unparse(Type1Charstring(substr)).c_str());
328 c.pos += delta;
329 c.len -= delta;
330 }
331 }
332
333 // otherwise, success
334 _output_subrno = mcsi->output()->nsubrs();
335 mcsi->output()->set_subr(_output_subrno, Type1Charstring(substr + "\013"));
336
337 // This subr has become real, so it is suitable for later unifications.
338 // Mark it as having called any subroutines contained completely within itself.
339 // How to do this? Look at one caller, and go over all its calls.
340 _callers[0].subr->transfer_nested_calls(_callers[0].pos, _callers[0].len, this);
341
342 // adapt callers
343 String callsubr_string = Type1CharstringGen::callsubr_string(_output_subrno);
344
345 for (int i = 0; i < _callers.size(); i++)
346 // 13.Jun.2003 - must check whether _callers[i].subr exists: if we
347 // called a subroutine more than once, change_callers() might have
348 // zeroed it out.
349 if (_callers[i].subr && _callers[i].subr != this) {
350 Subr::Caller c = _callers[i];
351 c.subr->charstring(mcsi)->assign_substring(c.pos, c.len, callsubr_string);
352 Subr::bump_date();
353 for (int j = 0; j < c.subr->ncalls(); j++)
354 c.subr->call(j)->change_callers(c.subr, c.pos, c.len, callsubr_string.length());
355 assert(!_callers[i].subr);
356 }
357
358 // this subr is no longer "called"/interpolated from anywhere
359 _callers.clear();
360
361 //fprintf(stderr, "Succeeded %x\n", _csr);
362 return true;
363 }
364
365
366 // running
367
368 bool
369 MakeType1CharstringInterp::type2_command(int cmd, const uint8_t *data, int *left)
370 {
371 switch (cmd) {
372
373 case Cs::cCallsubr:
374 case Cs::cCallgsubr:
375 if (subr_depth() < MAX_SUBR_DEPTH && size() == 1) {
376 //fprintf(stderr, "succeeded %d\n", (int) top());
377 bool g = (cmd == Cs::cCallgsubr);
378 CsRef csref = ((int)top() + program()->xsubr_bias(g)) | (g ? CSR_GSUBR : CSR_SUBR);
379 Subr *callee = csr_subr(csref, true);
380 if (callee)
381 _cur_subr->add_call(callee);
382
383 int left = csgen().length();
384
385 bool more = callxsubr_command(g);
386
387 int right = csgen().length();
388 if (error() >= 0 && callee)
389 callee->add_caller(_cur_subr, left, right - left);
390 return more;
391 } else {
392 //fprintf(stderr, "failed %d\n", (int) top());
393 goto normal;
394 }
395
396 normal:
397 default:
398 return CharstringInterp::type2_command(cmd, data, left);
399
400 }
401 }
402
403 void
404 MakeType1CharstringInterp::run(const CharstringContext &g, Type1Charstring &out, ErrorHandler *errh)
405 {
406 Type1CharstringGenInterp::run(g, out);
407
408 if (Type1CharstringGenInterp::had_bad_flex() && !(_flex_message & 1)) {
409 errh->lwarning(landmark(errh), "complex flex hint replaced with curves");
410 errh->message("(This font contains flex hints prohibited by Type 1. They%,ve been\nreplaced by ordinary curves.)");
411 _flex_message |= 1;
412 }
413 #if !HAVE_ADOBE_CODE
414 if (Type1CharstringGenInterp::had_flex() && !(_flex_message & 2)) {
415 errh->lwarning(landmark(errh), "flex hints required");
416 errh->message("(This program was compiled without Adobe code for flex hint support,\nso its output may not work on all devices.)");
417 _flex_message |= 2;
418 }
419 if (Type1CharstringGenInterp::had_hr() && !(_flex_message & 4)) {
420 errh->lwarning(landmark(errh), "hint replacement required");
421 errh->message("(This program was compiled without Adobe code for hint replacement,\nso its output may not work on all devices.)");
422 _flex_message |= 4;
423 }
424 #endif
425 }
426
427 void
428 MakeType1CharstringInterp::run(const CharstringProgram *program, Type1Font *output, PermString glyph_definer, ErrorHandler *errh)
429 {
430 _output = output;
431 set_hint_replacement_storage(output);
432
433 _glyphs.assign(program->nglyphs(), 0);
434 _subrs.assign(program->nsubrs(), 0);
435 _subr_bias = program->subr_bias();
436 _gsubrs.assign(program->ngsubrs(), 0);
437 _gsubr_bias = program->gsubr_bias();
438
439 // run over the glyphs
440 int nglyphs = program->nglyphs();
441 Type1Charstring receptacle;
442 for (int i = 0; i < nglyphs; i++) {
443 _cur_subr = _glyphs[i] = new Subr(CSR_GLYPH | i);
444 _cur_glyph = i;
445 run(program->glyph_context(i), receptacle, errh);
446 #if 0
447 PermString n = program->glyph_name(i);
448 if (i == 408 || i == 20) {
449 fprintf(stderr, "%d: %s was %s\n", i, n.c_str(), CharstringUnparser::unparse(*program->glyph(i)).c_str());
450 fprintf(stderr, " now %s\n", CharstringUnparser::unparse(receptacle).c_str());
451 fprintf(stderr, " *** %d.%d: %s\n", 134, 30, CharstringUnparser::unparse(Type1Charstring(receptacle.data_string().substring(134, 30))).c_str());
452 }
453 #endif
454 PermString name = program->glyph_name(i);
455 if (output->glyph(name)) {
456 errh->warning("glyph %<%s%> defined more than once", name.c_str());
457 int i = 1;
458 do {
459 name = program->glyph_name(i) + String(".") + String(i);
460 ++i;
461 } while (output->glyph(name));
462 }
463 output->add_glyph(Type1Subr::make_glyph(name, receptacle, glyph_definer));
464 }
465
466 // unify Subrs
467 for (int i = 0; i < _subrs.size(); i++)
468 if (_subrs[i])
469 _subrs[i]->unify(this);
470
471 for (int i = 0; i < _gsubrs.size(); i++)
472 if (_gsubrs[i])
473 _gsubrs[i]->unify(this);
474 }
475
476
477 /*****
478 * main
479 **/
480
481 static void
482 add_number_def(Type1Font* output, int dict, PermString name, const Cff::Font* font, Cff::DictOperator op)
483 {
484 double v;
485 if (font->dict_value(op, &v))
486 output->add_definition(dict, Type1Definition::make(name, v, "def"));
487 }
488
489 static void
490 add_number_def(Type1Font* output, int dict, PermString name, const Cff::Font* font, Cff::DictOperator op, double default_value)
491 {
492 double v;
493 if (font->dict_value(op, &v) && v != default_value)
494 output->add_definition(dict, Type1Definition::make(name, v, "def"));
495 }
496
497 static void
498 add_delta_def(Type1Font* output, int dict, PermString name, const Cff::Font* font, Cff::DictOperator op)
499 {
500 Vector<double> vec;
501 if (font->dict_value(op, vec)) {
502 for (int i = 1; i < vec.size(); i++)
503 vec[i] += vec[i - 1];
504 StringAccum sa;
505 for (int i = 0; i < vec.size(); i++)
506 sa << (i ? ' ' : '[') << vec[i];
507 sa << ']';
508 output->add_definition(dict, Type1Definition::make_literal(name, sa.take_string(), (dict == Type1Font::dP ? "|-" : "readonly def")));
509 }
510 }
511
512 Type1Font *
513 create_type1_font(Cff::Font *font, ErrorHandler *errh)
514 {
515 String version = font->dict_string(Cff::oVersion);
516 Type1Font *output = Type1Font::skeleton_make(font->font_name(), version);
517 StringAccum sa;
518 double v;
519 Vector<double> vec;
520 const char* old_double_format = StringAccum::double_format;
521 StringAccum::double_format = "%.9g";
522
523 output->add_definition(Type1Font::dF, Type1Definition::make("FontType", 1.0, "def"));
524 output->add_definition(Type1Font::dF, Type1Definition::make_literal("FontName", "/" + font->font_name(), "def"));
525 font->dict_value(Cff::oPaintType, &v);
526 output->add_definition(Type1Font::dF, Type1Definition::make("PaintType", v, "def"));
527 if (font->dict_value(Cff::oFontMatrix, vec) && vec.size() == 6) {
528 sa << '[' << vec[0] << ' ' << vec[1] << ' ' << vec[2] << ' ' << vec[3] << ' ' << vec[4] << ' ' << vec[5] << ']';
529 output->add_definition(Type1Font::dF, Type1Definition::make_literal("FontMatrix", sa.take_string(), "readonly def"));
530 } else {
531 output->add_definition(Type1Font::dF, Type1Definition::make_literal("FontMatrix", "[0.001 0 0 0.001 0 0]", "readonly def"));
532 }
533
534 // FontInfo dictionary
535 if (version)
536 output->add_definition(Type1Font::dFI, Type1Definition::make_string("version", version, "readonly def"));
537 if (String s = font->dict_string(Cff::oNotice))
538 output->add_definition(Type1Font::dFI, Type1Definition::make_string("Notice", s, "readonly def"));
539 if (String s = font->dict_string(Cff::oCopyright))
540 output->add_definition(Type1Font::dFI, Type1Definition::make_string("Copyright", s, "readonly def"));
541 if (String s = font->dict_string(Cff::oFullName))
542 output->add_definition(Type1Font::dFI, Type1Definition::make_string("FullName", s, "readonly def"));
543 if (String s = font->dict_string(Cff::oFamilyName))
544 output->add_definition(Type1Font::dFI, Type1Definition::make_string("FamilyName", s, "readonly def"));
545 if (String s = font->dict_string(Cff::oWeight))
546 output->add_definition(Type1Font::dFI, Type1Definition::make_string("Weight", s, "readonly def"));
547 if (font->dict_value(Cff::oIsFixedPitch, &v))
548 output->add_definition(Type1Font::dFI, Type1Definition::make_literal("isFixedPitch", (v ? "true" : "false"), "def"));
549 add_number_def(output, Type1Font::dFI, "ItalicAngle", font, Cff::oItalicAngle);
550 add_number_def(output, Type1Font::dFI, "UnderlinePosition", font, Cff::oUnderlinePosition);
551 add_number_def(output, Type1Font::dFI, "UnderlineThickness", font, Cff::oUnderlineThickness);
552 output->skeleton_fontinfo_end();
553
554 // Encoding, other font dictionary entries
555 output->add_item(font->type1_encoding_copy());
556 add_number_def(output, Type1Font::dF, "StrokeWidth", font, Cff::oStrokeWidth);
557 add_number_def(output, Type1Font::dF, "UniqueID", font, Cff::oUniqueID);
558 if (font->dict_value(Cff::oXUID, vec) && vec.size()) {
559 for (int i = 0; i < vec.size(); i++)
560 sa << (i ? ' ' : '[') << vec[i];
561 sa << ']';
562 output->add_definition(Type1Font::dF, Type1Definition::make_literal("XUID", sa.take_string(), "readonly def"));
563 }
564 if (font->dict_value(Cff::oFontBBox, vec) && vec.size() == 4) {
565 sa << '{' << vec[0] << ' ' << vec[1] << ' ' << vec[2] << ' ' << vec[3] << '}';
566 output->add_definition(Type1Font::dF, Type1Definition::make_literal("FontBBox", sa.take_string(), "readonly def"));
567 } else
568 output->add_definition(Type1Font::dF, Type1Definition::make_literal("FontBBox", "{0 0 0 0}", "readonly def"));
569 output->skeleton_fontdict_end();
570
571 // Private dictionary
572 if (font->dict_has(Cff::oBlueValues))
573 add_delta_def(output, Type1Font::dP, "BlueValues", font, Cff::oBlueValues);
574 else
575 output->add_definition(Type1Font::dP, Type1Definition::make_literal("BlueValues", "[]", "|-"));
576 add_delta_def(output, Type1Font::dP, "OtherBlues", font, Cff::oOtherBlues);
577 add_delta_def(output, Type1Font::dP, "FamilyBlues", font, Cff::oFamilyBlues);
578 add_delta_def(output, Type1Font::dP, "FamilyOtherBlues", font, Cff::oFamilyOtherBlues);
579 add_number_def(output, Type1Font::dP, "BlueScale", font, Cff::oBlueScale, 0.039625);
580 add_number_def(output, Type1Font::dP, "BlueShift", font, Cff::oBlueShift, 7);
581 add_number_def(output, Type1Font::dP, "BlueFuzz", font, Cff::oBlueFuzz, 1);
582 if (font->dict_value(Cff::oStdHW, &v))
583 output->add_definition(Type1Font::dP, Type1Definition::make_literal("StdHW", String("[") + String(v) + "]", "|-"));
584 if (font->dict_value(Cff::oStdVW, &v))
585 output->add_definition(Type1Font::dP, Type1Definition::make_literal("StdVW", String("[") + String(v) + "]", "|-"));
586 add_delta_def(output, Type1Font::dP, "StemSnapH", font, Cff::oStemSnapH);
587 add_delta_def(output, Type1Font::dP, "StemSnapV", font, Cff::oStemSnapV);
588 if (font->dict_value(Cff::oForceBold, &v))
589 output->add_definition(Type1Font::dP, Type1Definition::make_literal("ForceBold", (v ? "true" : "false"), "def"));
590 add_number_def(output, Type1Font::dP, "LanguageGroup", font, Cff::oLanguageGroup, 0);
591 add_number_def(output, Type1Font::dP, "ExpansionFactor", font, Cff::oExpansionFactor, 0.06);
592 add_number_def(output, Type1Font::dP, "UniqueID", font, Cff::oUniqueID);
593 output->add_definition(Type1Font::dP, Type1Definition::make_literal("MinFeature", "{16 16}", "|-"));
594 output->add_definition(Type1Font::dP, Type1Definition::make_literal("password", "5839", "def"));
595 output->add_definition(Type1Font::dP, Type1Definition::make_literal("lenIV", "0", "def"));
596 output->skeleton_private_end();
597 output->skeleton_common_subrs();
598
599 // add glyphs
600 MakeType1CharstringInterp maker(5);
601 maker.run(font, output, " |-", errh);
602
603 StringAccum::double_format = old_double_format;
604 return output;
605 }
606
607 #include <lcdf/vector.cc>