w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

cidtype0.c
Go to the documentation of this file.
1 /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
2 
3  Copyright (C) 2002-2021 by Jin-Hwan Cho and Shunsaku Hirata,
4  the dvipdfmx project team.
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19 */
20 
21 /*
22  * CID-Keyed Font support:
23  *
24  * Only CFF/OpenType CID-Keyed Font with Type 2 charstrings is supported.
25  *
26  */
27 
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 
32 #include "system.h"
33 #include "numbers.h"
34 #include "mem.h"
35 #include "error.h"
36 #include "dpxconf.h"
37 
38 #include "dpxfile.h"
39 
40 #include "pdfobj.h"
41 /* pseudo unique tag */
42 #include "pdffont.h"
43 
44 /* Font info. from OpenType tables */
45 #include "sfnt.h"
46 #include "tt_aux.h"
47 /* Metrics */
48 #include "tt_table.h"
49 
50 #include "cff_types.h"
51 #include "cff_limits.h"
52 #include "cff.h"
53 #include "cff_dict.h"
54 #include "cs_type2.h"
55 
56 /* typedef CID in cmap.h */
57 #include "cmap.h"
58 #include "type0.h"
59 #include "cid.h"
60 #include "cidtype0.h"
61 
62 /* Type1 --> CFF CIDFont */
63 #include "unicode.h"
64 #include "t1_load.h"
65 #include "t1_char.h"
66 
67 #include "agl.h"
68 
69 #include "cmap.h"
70 #include "cmap_write.h"
71 #include "fontmap.h"
72 
73 /*
74  * PDF Reference 3rd. ed., p.340, "Glyph Metrics in CID Fonts".
75  */
76 #ifndef PDFUNIT
77 #define PDFUNIT(v) (ROUND((1000.0*(v))/(head->unitsPerEm),1))
78 #endif
79 
80 static void
82  unsigned char *CIDToGIDMap, unsigned short last_cid,
83  struct tt_maxp_table *maxp,
84  struct tt_head_table *head, struct tt_longMetrics *hmtx)
85 {
86  pdf_obj *w_array, *an_array = NULL;
87  int cid, start = 0, prev = 0;
88  double defaultAdvanceWidth;
89  int empty = 1;
90 
91  (void) sfont; /* unsed */
92  defaultAdvanceWidth = PDFUNIT(hmtx[0].advance);
93  /*
94  * We alway use format:
95  * c [w_1 w_2 ... w_n]
96  */
97  w_array = pdf_new_array();
98  for (cid = 0; cid <= last_cid; cid++) {
99  USHORT gid;
100  double advanceWidth;
101  gid = CIDToGIDMap ? ((CIDToGIDMap[2*cid] << 8)|CIDToGIDMap[2*cid+1]) : cid;
102  if (gid >= maxp->numGlyphs || (cid != 0 && gid == 0))
103  continue;
104  advanceWidth = PDFUNIT(hmtx[gid].advance);
105  if (advanceWidth == defaultAdvanceWidth) {
106  if (an_array) {
108  pdf_add_array(w_array, an_array);
109  an_array = NULL;
110  empty = 0;
111  }
112  } else {
113  if (cid != prev + 1 && an_array) {
115  pdf_add_array(w_array, an_array);
116  an_array = NULL;
117  empty = 0;
118  }
119  if (an_array == NULL) {
120  an_array = pdf_new_array();
121  start = cid;
122  }
123  pdf_add_array(an_array, pdf_new_number(advanceWidth));
124  prev = cid;
125  }
126  }
127 
128  if (an_array) {
130  pdf_add_array(w_array, an_array);
131  empty = 0;
132  }
133 
134  /*
135  * We always write DW for older MacOS X's preview app.
136  * PDF Reference 2nd. ed, wrongly described default value of DW as 0, and
137  * MacOS X's (up to 10.2.8) preview app. implements this wrong description.
138  */
140  pdf_new_name("DW"),
141  pdf_new_number(defaultAdvanceWidth));
142  if (!empty) {
144  pdf_new_name("W"),
145  pdf_ref_obj(w_array));
146  }
147  pdf_release_obj(w_array);
148 
149  return;
150 }
151 
152 static void
154  unsigned char *CIDToGIDMap, unsigned short last_cid,
155  struct tt_maxp_table *maxp,
156  struct tt_head_table *head, struct tt_longMetrics *hmtx)
157 {
158  pdf_obj *w2_array, *an_array = NULL;
159  int cid;
160 #if 0
161  int prev = 0, start = 0;
162 #endif
163  struct tt_VORG_table *vorg;
164  struct tt_vhea_table *vhea = NULL;
165  struct tt_longMetrics *vmtx = NULL;
166  double defaultAdvanceHeight, defaultVertOriginY;
167  int empty = 1;
168 
169  /*
170  * No accurate vertical metrics can be obtained by simple way if the
171  * font does not have VORG table. Only CJK fonts may have VORG.
172  */
173  if (sfnt_find_table_pos(sfont, "VORG") <= 0)
174  return;
175 
176  vorg = tt_read_VORG_table(sfont);
177  defaultVertOriginY = PDFUNIT(vorg->defaultVertOriginY);
178  if (sfnt_find_table_pos(sfont, "vhea") > 0)
179  vhea = tt_read_vhea_table(sfont);
180  if (vhea && sfnt_find_table_pos(sfont, "vmtx") > 0) {
181  sfnt_locate_table(sfont, "vmtx");
183  }
184 
185  if (sfnt_find_table_pos(sfont, "OS/2") <= 0) {
186  struct tt_os2__table *os2;
187  /* OpenType font must have OS/2 table. */
188  os2 = tt_read_os2__table(sfont);
189  defaultVertOriginY = PDFUNIT(os2->sTypoAscender);
190  defaultAdvanceHeight = PDFUNIT(os2->sTypoAscender - os2->sTypoDescender);
191  RELEASE(os2);
192  } else {
193  /* Some TrueType fonts used in Macintosh does not have OS/2 table. */
194  defaultAdvanceHeight = 1000;
195  }
196 
197  w2_array = pdf_new_array();
198  for (cid = 0; cid <= last_cid; cid++) {
199  USHORT i, gid;
200  double advanceHeight, vertOriginX, vertOriginY;
201  gid = CIDToGIDMap ? ((CIDToGIDMap[2*cid] << 8)|CIDToGIDMap[2*cid+1]) : cid;
202  if (gid >= maxp->numGlyphs || (cid != 0 && gid == 0))
203  continue;
204  advanceHeight = vmtx ? PDFUNIT(vmtx[gid].advance) : defaultAdvanceHeight;
205  vertOriginX = PDFUNIT(hmtx[gid].advance*0.5);
206  vertOriginY = defaultVertOriginY;
207  for (i = 0;
208  i < vorg->numVertOriginYMetrics && gid >= vorg->vertOriginYMetrics[i].glyphIndex;
209  i++) {
210  if (gid == vorg->vertOriginYMetrics[i].glyphIndex)
211  vertOriginY = PDFUNIT(vorg->vertOriginYMetrics[i].vertOriginY);
212  }
213 #if 0
214  /*
215  * c [w1_1y v_1x v_1y w1_2y v_2x v_2y ...]
216  * Not working... Why?
217  * Acrobat Reader:
218  * Wrong rendering, interpretation of position vector is wrong.
219  * Xpdf and gs: ignores W2?
220  */
221  if (vertOriginY == defaultVertOriginY &&
222  advanceHeight == defaultAdvanceHeight) {
223  if (an_array) {
224  pdf_add_array(w2_array, pdf_new_number(start));
225  pdf_add_array(w2_array, an_array);
226  an_array = NULL;
227  empty = 0;
228  }
229  } else {
230  if (cid != prev + 1 && an_array) {
231  pdf_add_array(w2_array, pdf_new_number(start));
232  pdf_add_array(w2_array, an_array);
233  an_array = NULL;
234  empty = 0;
235  }
236  if (an_array == NULL) {
237  an_array = pdf_new_array();
238  start = cid;
239  }
240  pdf_add_array(an_array, pdf_new_number(-advanceHeight));
241  pdf_add_array(an_array, pdf_new_number(vertOriginX));
242  pdf_add_array(an_array, pdf_new_number(vertOriginY));
243  prev = cid;
244  }
245 #else
246  /*
247  * c_first c_last w1_y v_x v_y
248  * This form may hit Acrobat's implementation limit of array element size, 8192.
249  * AFPL GhostScript 8.11 stops with rangecheck error with this. Maybe GS's bug?
250  */
251  if (vertOriginY != defaultVertOriginY ||
252  advanceHeight != defaultAdvanceHeight) {
253  pdf_add_array(w2_array, pdf_new_number(cid));
254  pdf_add_array(w2_array, pdf_new_number(cid));
255  pdf_add_array(w2_array, pdf_new_number(-advanceHeight));
256  pdf_add_array(w2_array, pdf_new_number(vertOriginX));
257  pdf_add_array(w2_array, pdf_new_number(vertOriginY));
258  empty = 0;
259  }
260 #endif
261  }
262 
263 #if 0
264  if (an_array) {
265  pdf_add_array(w2_array, pdf_new_number(start));
266  pdf_add_array(w2_array, an_array);
267  empty = 0;
268  }
269 #endif
270 
271  if (defaultVertOriginY != 880 || defaultAdvanceHeight != 1000) {
272  an_array = pdf_new_array();
273  pdf_add_array(an_array, pdf_new_number(defaultVertOriginY));
274  pdf_add_array(an_array, pdf_new_number(-defaultAdvanceHeight));
275  pdf_add_dict(fontdict, pdf_new_name ("DW2"), an_array);
276  }
277  if (!empty) {
279  pdf_new_name("W2"), pdf_ref_obj(w2_array));
280  }
281  pdf_release_obj(w2_array);
282 
283  if (vorg->vertOriginYMetrics)
284  RELEASE(vorg->vertOriginYMetrics);
285  RELEASE(vorg);
286 
287  if (vmtx)
288  RELEASE(vmtx);
289  if (vhea)
290  RELEASE(vhea);
291 
292  return;
293 }
294 
295 static void
297  unsigned char *CIDToGIDMap, unsigned short last_cid, int need_vmetrics)
298 {
299  struct tt_longMetrics *hmtx;
300  struct tt_head_table *head;
301  struct tt_hhea_table *hhea;
302  struct tt_maxp_table *maxp;
303 
304  /*
305  * Read head, hhea, maxp:
306  *
307  * unitsPerEm --> head
308  * numHMetrics --> hhea
309  * numGlyphs --> maxp
310  */
311  head = tt_read_head_table(sfont);
312  maxp = tt_read_maxp_table(sfont);
313  hhea = tt_read_hhea_table(sfont);
314 
315  sfnt_locate_table(sfont, "hmtx");
317 
318  add_CIDHMetrics(sfont, fontdict, CIDToGIDMap, last_cid, maxp, head, hmtx);
319  if (need_vmetrics)
320  add_CIDVMetrics(sfont, fontdict, CIDToGIDMap, last_cid, maxp, head, hmtx);
321 
322  RELEASE(hmtx);
323  RELEASE(hhea);
324  RELEASE(maxp);
325  RELEASE(head);
326 
327  return;
328 }
329 
330 /*
331  * Create an instance of embeddable font.
332  */
333 static int
335 {
336  cff_index *topdict, *fdarray, *private;
337  unsigned char *dest;
338  int destlen = 0, i, size;
339  int offset, topdict_offset, fdarray_offset;
340 
341  /* DICT sizes (offset set to long int) */
342  topdict = cff_new_index(1);
343  fdarray = cff_new_index(cffont->num_fds);
344  private = cff_new_index(cffont->num_fds);
345 
346  cff_dict_remove(cffont->topdict, "UniqueID");
347  cff_dict_remove(cffont->topdict, "XUID");
348  cff_dict_remove(cffont->topdict, "Private"); /* some bad font may have */
349  cff_dict_remove(cffont->topdict, "Encoding"); /* some bad font may have */
350 
351  topdict->offset[1] = cff_dict_pack(cffont->topdict,
352  (card8 *) work_buffer,
353  WORK_BUFFER_SIZE) + 1;
354  for (i = 0;i < cffont->num_fds; i++) {
355  size = 0;
356  if (cffont->private && cffont->private[i]) {
357  size = cff_dict_pack(cffont->private[i],
359  if (size < 1) { /* Private had contained only Subr */
360  cff_dict_remove(cffont->fdarray[i], "Private");
361  }
362  }
363  (private->offset)[i+1] = (private->offset)[i] + size;
364  (fdarray->offset)[i+1] = (fdarray->offset)[i] +
365  cff_dict_pack(cffont->fdarray[i],
367  }
368 
369  destlen = 4; /* header size */
370  destlen += cff_set_name(cffont, font->fontname);
371  destlen += cff_index_size(topdict);
372  destlen += cff_index_size(cffont->string);
373  destlen += cff_index_size(cffont->gsubr);
374  destlen += (cffont->charsets->num_entries) * 2 + 1; /* charset format 0 */
375  destlen += (cffont->fdselect->num_entries) * 3 + 5; /* fdselect format 3 */
376  destlen += cff_index_size(cffont->cstrings);
377  destlen += cff_index_size(fdarray);
378  destlen += private->offset[private->count] - 1; /* Private is not INDEX */
379 
380  dest = NEW(destlen, card8);
381 
382  offset = 0;
383  /* Header */
384  offset += cff_put_header(cffont, dest + offset, destlen - offset);
385  /* Name */
386  offset += cff_pack_index(cffont->name, dest + offset, destlen - offset);
387  /* Top DICT */
388  topdict_offset = offset;
389  offset += cff_index_size(topdict);
390  /* Strings */
391  offset += cff_pack_index(cffont->string, dest + offset, destlen - offset);
392  /* Global Subrs */
393  offset += cff_pack_index(cffont->gsubr, dest + offset, destlen - offset);
394 
395  /* charset */
396  cff_dict_set(cffont->topdict, "charset", 0, offset);
397  offset += cff_pack_charsets(cffont, dest + offset, destlen - offset);
398 
399  /* FDSelect */
400  cff_dict_set(cffont->topdict, "FDSelect", 0, offset);
401  offset += cff_pack_fdselect(cffont, dest + offset, destlen - offset);
402 
403  /* CharStrings */
404  cff_dict_set(cffont->topdict, "CharStrings", 0, offset);
405  offset += cff_pack_index(cffont->cstrings,
406  dest + offset, cff_index_size(cffont->cstrings));
407  cff_release_index(cffont->cstrings);
408  cffont->cstrings = NULL; /* Charstrings cosumes huge memory */
409 
410  /* FDArray and Private */
411  cff_dict_set(cffont->topdict, "FDArray", 0, offset);
412  fdarray_offset = offset;
413  offset += cff_index_size(fdarray);
414 
415  fdarray->data = NEW(fdarray->offset[fdarray->count] - 1, card8);
416  for (i = 0; i < cffont->num_fds; i++) {
417  size = private->offset[i+1] - private->offset[i];
418  if (cffont->private[i] && size > 0) {
419  cff_dict_pack(cffont->private[i], dest + offset, size);
420  cff_dict_set(cffont->fdarray[i], "Private", 0, size);
421  cff_dict_set(cffont->fdarray[i], "Private", 1, offset);
422  }
423  cff_dict_pack(cffont->fdarray[i],
424  fdarray->data + (fdarray->offset)[i] - 1,
425  fdarray->offset[fdarray->count] - 1);
426  offset += size;
427  }
428 
429  cff_pack_index(fdarray, dest + fdarray_offset, cff_index_size(fdarray));
430  cff_release_index(fdarray);
431  cff_release_index(private);
432 
433  /* Finally Top DICT */
434  topdict->data = NEW(topdict->offset[topdict->count] - 1, card8);
435  cff_dict_pack(cffont->topdict,
436  topdict->data, topdict->offset[topdict->count] - 1);
437  cff_pack_index(topdict, dest + topdict_offset, cff_index_size(topdict));
438  cff_release_index(topdict);
439 
440  /*
441  * FontFile
442  */
443  {
444  pdf_obj *fontfile, *stream_dict;
445 
447  stream_dict = pdf_stream_dict(fontfile);
448  pdf_add_dict(font->descriptor,
449  pdf_new_name("FontFile3"),
451  pdf_add_dict(stream_dict,
452  pdf_new_name("Subtype"),
453  pdf_new_name("CIDFontType0C"));
454  pdf_add_stream(fontfile, (char *) dest, offset);
456  RELEASE(dest);
457  }
458 
459  return destlen;
460 }
461 
462 static void
463 CIDFont_type0_add_CIDSet (pdf_font *font, char *used_chars, card16 last_cid) {
464  /*
465  * CIDSet:
466  * Length of CIDSet stream is not clear. Must be 8192 bytes long?
467  */
468  pdf_obj *cidset;
469 
471  pdf_add_stream(cidset, used_chars, (last_cid / 8) + 1);
472  pdf_add_dict(font->descriptor,
473  pdf_new_name("CIDSet"), pdf_ref_obj(cidset));
475 }
476 
477 int
479 {
480  FILE *fp;
481  sfnt *sfont;
482  cff_font *cffont;
483  cff_index *charstrings, *idx;
485  cff_fdselect *fdselect = NULL;
486  int charstring_len, max_len;
487  int destlen = 0;
488  int size, offset = 0;
489  card8 *data;
490  card16 num_glyphs = 0, gid;
491  int cid;
492  card16 cs_count, last_cid = 0;
493  int fd, prev_fd;
494  char *used_chars;
495  unsigned char *CIDToGIDMap = NULL;
496 
497  ASSERT(font);
498 
499  if (!font->reference)
500  return 0;
501 
502  pdf_add_dict(font->resource,
503  pdf_new_name("FontDescriptor"),
504  pdf_ref_obj (font->descriptor));
505 
507  return 0;
508  } else if (!font->cid.options.embed &&
510  /* No metrics needed. */
511  pdf_add_dict(font->resource,
512  pdf_new_name("DW"), pdf_new_number(1000.0));
513  return 0;
514  }
515 
516  used_chars = font->usedchars;
517 
519  if (!fp) {
521  if (!fp) {
522  WARN("Could not open file: %s", font->filename);
523  return -1;
524  }
525  }
526 
527  sfont = sfnt_open(fp);
528  if (!sfont) {
529  WARN("Failed to read font file: %s", font->filename);
530  DPXFCLOSE(fp);
531  return -1;
532  }
533 
534  if (sfont->type == SFNT_TYPE_TTC)
535  offset = ttc_read_offset(sfont, font->index);
536 
537  if ((sfont->type != SFNT_TYPE_TTC &&
538  sfont->type != SFNT_TYPE_POSTSCRIPT) ||
539  sfnt_read_table_directory(sfont, offset) < 0 ||
540  (offset = sfnt_find_table_pos(sfont, "CFF ")) == 0) {
541  WARN("Not a CFF/OpenType font: %s", font->filename);
542  sfnt_close(sfont);
543  DPXFCLOSE(fp);
544  return -1;
545  }
546 
547  cffont = cff_open(sfont->stream, offset, 0);
548  if (!cffont) {
549  WARN("Failed to read CFF font data: %s", font->filename);
550  sfnt_close(sfont);
551  DPXFCLOSE(fp);
552  return -1;
553  }
554 
555  if (!(cffont->flag & FONTTYPE_CIDFONT)) {
556  WARN("Unexpected type (CIDFont expected): %s", font->filename);
557  cff_close(cffont);
558  sfnt_close(sfont);
559  DPXFCLOSE(fp);
560  return -1;
561  }
562 
563  cff_read_charsets(cffont);
564 
565  {
566  int cid_count;
567 
568  if (cff_dict_known(cffont->topdict, "CIDCount")) {
569  cid_count = (int) cff_dict_get(cffont->topdict, "CIDCount", 0);
570  } else {
571  cid_count = CID_MAX + 1;
572  }
573 
574  CIDToGIDMap = NEW(2 * cid_count, unsigned char);
575  memset(CIDToGIDMap, 0, 2 * cid_count);
576  add_to_used_chars2(used_chars, 0); /* .notdef */
577  for (cid = 0; cid <= CID_MAX; cid++) {
578  if (is_used_char2(used_chars, cid)) {
579  gid = cff_charsets_lookup(cffont, (card16)cid);
580  if (cid != 0 && gid == 0) {
581  WARN("Glyph for CID %u missing in font \"%s\".", (CID) cid, font->filename);
582  used_chars[cid/8] &= ~(1 << (7 - (cid % 8)));
583  continue;
584  }
585  CIDToGIDMap[2*cid] = (gid >> 8) & 0xff;
586  CIDToGIDMap[2*cid+1] = gid & 0xff;
587  last_cid = cid;
588  num_glyphs++;
589  }
590  }
591  }
592 
593  /*
594  * DW, W, DW2 and W2:
595  * Those values are obtained from OpenType table (not TFM).
596  */
598  pdf_add_dict(font->resource,
599  pdf_new_name("DW"), pdf_new_number(1000.0));
600  } else {
601  add_CIDMetrics(sfont, font->resource, CIDToGIDMap, last_cid,
602  font->cid.need_vmetrics ? 1 : 0);
603  }
604 
605  if (!font->cid.options.embed) {
606  RELEASE(CIDToGIDMap);
607  cff_close(cffont);
608  sfnt_close(sfont);
609  DPXFCLOSE(fp);
610  return 0;
611  }
612 
613  /*
614  * Embed font subset.
615  */
616  cff_read_fdselect(cffont);
617  cff_read_fdarray(cffont);
618  cff_read_private(cffont);
619 
620  cff_read_subrs(cffont);
621 
622  offset = (int) cff_dict_get(cffont->topdict, "CharStrings", 0);
623  cff_seek_set(cffont, offset);
624  idx = cff_get_index_header(cffont);
625  /* offset is now absolute offset ... bad */
626  offset = cff_tell(cffont);
627 
628  if ((cs_count = idx->count) < 2) {
629  WARN("No valid charstring data found: %s", font->filename);
630  cff_close(cffont);
631  sfnt_close(sfont);
632  DPXFCLOSE(fp);
633  return -1;
634  }
635 
636  /* New Charsets data */
637  charset = NEW(1, cff_charsets);
638  charset->format = 0;
639  charset->num_entries = 0;
640  charset->data.glyphs = NEW(num_glyphs, s_SID);
641 
642  /* New FDSelect data */
643  fdselect = NEW(1, cff_fdselect);
644  fdselect->format = 3;
645  fdselect->num_entries = 0;
646  fdselect->data.ranges = NEW(num_glyphs, cff_range3);
647 
648  /* New CharStrings INDEX */
649  charstrings = cff_new_index((card16)(num_glyphs+1));
650  max_len = 2 * CS_STR_LEN_MAX;
651  charstrings->data = NEW(max_len, card8);
652  charstring_len = 0;
653 
654  /*
655  * TODO: Re-assign FD number.
656  */
657  prev_fd = -1; gid = 0;
659  for (cid = 0; cid <= last_cid; cid++) {
660  unsigned short gid_org;
661 
662  if (!is_used_char2(used_chars, cid))
663  continue;
664 
665  gid_org = (CIDToGIDMap[2*cid] << 8)|(CIDToGIDMap[2*cid+1]);
666  if ((size = (idx->offset)[gid_org+1] - (idx->offset)[gid_org])
667  > CS_STR_LEN_MAX) {
668  WARN("Charstring too long: %s (gid=%u)", font->filename, gid_org);
669  RELEASE(data);
670  RELEASE(charstrings);
671  RELEASE(fdselect);
672  RELEASE(charset);
674  RELEASE(CIDToGIDMap);
675  cff_close(cffont);
676  sfnt_close(sfont);
677  DPXFCLOSE(fp);
678  return -1;
679  }
680  if (charstring_len + CS_STR_LEN_MAX >= max_len) {
681  max_len = charstring_len + 2 * CS_STR_LEN_MAX;
682  charstrings->data = RENEW(charstrings->data, max_len, card8);
683  }
684  (charstrings->offset)[gid] = charstring_len + 1;
685  cff_seek(cffont, offset + (idx->offset)[gid_org] - 1);
686  cff_read_data(data, size, cffont);
687  fd = cff_fdselect_lookup(cffont, gid_org);
688  charstring_len += cs_copy_charstring(charstrings->data + charstring_len,
689  max_len - charstring_len,
690  data, size,
691  cffont->gsubr, (cffont->subrs)[fd], 0, 0, NULL);
692  if (cid > 0 && gid_org > 0) {
693  charset->data.glyphs[charset->num_entries] = cid;
694  charset->num_entries += 1;
695  }
696  if (fd != prev_fd) {
697  fdselect->data.ranges[fdselect->num_entries].first = gid;
698  fdselect->data.ranges[fdselect->num_entries].fd = fd;
699  fdselect->num_entries += 1;
700  prev_fd = fd;
701  }
702  gid++;
703  }
704  if (gid != num_glyphs) {
705  WARN("Unexpeced error: %s", font->filename);
706  RELEASE(data);
707  RELEASE(charstrings);
708  RELEASE(fdselect);
709  RELEASE(charset);
711  RELEASE(CIDToGIDMap);
712  cff_close(cffont);
713  sfnt_close(sfont);
714  DPXFCLOSE(fp);
715  return -1;
716  }
717  RELEASE(data);
719 
720  RELEASE(CIDToGIDMap);
721 
722  (charstrings->offset)[num_glyphs] = charstring_len + 1;
723  charstrings->count = num_glyphs;
724  cffont->num_glyphs = num_glyphs;
725  cffont->cstrings = charstrings;
726 
727  /* discard old one, set new data */
729  cffont->charsets = charset;
731  cffont->fdselect = fdselect;
732 
733  /* no Global subr */
734  if (cffont->gsubr)
735  cff_release_index(cffont->gsubr);
736  cffont->gsubr = cff_new_index(0);
737 
738  for (fd = 0; fd < cffont->num_fds; fd++) {
739  if (cffont->subrs && cffont->subrs[fd]) {
740  cff_release_index(cffont->subrs[fd]);
741  cffont->subrs[fd] = NULL;
742  }
743  if (cffont->private && (cffont->private)[fd]) {
744  cff_dict_remove((cffont->private)[fd], "Subrs"); /* no Subrs */
745  }
746  }
747 
748  destlen = write_fontfile(font, cffont);
749 
750  cff_close(cffont);
751  sfnt_close(sfont);
752  DPXFCLOSE(fp);
753 
754  if (dpx_conf.verbose_level > 1)
755  MESG("[%u/%u glyphs][%ld bytes]", num_glyphs, cs_count, destlen);
756 
757  if (pdf_check_version(2, 0) < 0) {
758  CIDFont_type0_add_CIDSet(font, used_chars, last_cid);
759  }
760 
761  return 0;
762 }
763 
764 int
766 {
767  CIDSysInfo csi;
768  char *fontname;
769  cff_font *cffont;
770  FILE *fp = NULL;
771 
772  ASSERT(font);
773 
775  if (!fp)
776  return -1;
777 
778  cffont = t1_load_font(NULL, 1, fp);
779  if (!cffont) {
780  DPXFCLOSE(fp);
781  return -1;
782  }
783 
784  {
785  char *shortname;
786  int fontname_len = 8;
787 
788  shortname = cff_get_name(cffont);
789  if (!shortname) {
790  WARN("No valid FontName found: %s", name);
791  cff_close(cffont);
792  DPXFCLOSE(fp);
793  }
794  /*
795  * Mangled name requires more 7 bytes.
796  */
797  fontname = NEW(strlen(shortname) + fontname_len, char);
798  memset(fontname, 0, strlen(shortname) + fontname_len);
799  strcpy(fontname, shortname);
800  RELEASE(shortname);
801  }
802 
803  csi.registry = NEW(strlen("Adobe") + 1, char);
804  strcpy(csi.registry, "Adobe");
805  csi.ordering = NEW(strlen("Identity") + 1, char);
806  strcpy(csi.ordering, "Identity");
807  csi.supplement = 0;
808  if (opt->style != FONT_STYLE_NONE) {
809  WARN(",Bold, ,Italic, ... not supported for this type of font...");
810  opt->style = FONT_STYLE_NONE;
811  }
812 
814  font->subtype = PDF_FONT_FONTTYPE_CIDTYPE0;
815  font->cid.csi = csi;
817 
818  font->resource = pdf_new_dict();
819  pdf_add_dict(font->resource,
820  pdf_new_name("Type"),
821  pdf_new_name("Font"));
822  pdf_add_dict(font->resource,
823  pdf_new_name("Subtype"),
824  pdf_new_name("CIDFontType0"));
825 
826  pdf_font_make_uniqueTag(font->uniqueID);
827 
828  font->descriptor = pdf_new_dict();
829  {
830  char *tmp;
831 
832  tmp = NEW(strlen(font->fontname)+8, char);
833  sprintf(tmp, "%s+%s", font->uniqueID, font->fontname);
834  pdf_add_dict(font->descriptor, pdf_new_name("FontName"), pdf_new_name(tmp));
835  pdf_add_dict(font->resource, pdf_new_name("BaseFont"), pdf_new_name(tmp));
836  RELEASE(tmp);
837  }
838  {
839  pdf_obj *csi_dict = pdf_new_dict();
840  pdf_add_dict(csi_dict,
841  pdf_new_name("Registry"),
843  pdf_add_dict(csi_dict,
844  pdf_new_name("Ordering"),
846  pdf_add_dict(csi_dict,
847  pdf_new_name("Supplement"),
849  pdf_add_dict(font->resource, pdf_new_name("CIDSystemInfo"), csi_dict);
850  }
851 
852  return 0;
853 }
854 
855 int
856 CIDFont_type0_open (pdf_font *font, const char *name, int index, cid_opt *opt)
857 {
858  CIDSysInfo csi;
859  char *fontname;
860  sfnt *sfont = NULL;
861  cff_font *cffont;
862  FILE *fp = NULL;
863  ULONG offset = 0;
864 
865  ASSERT(font);
866 
868  if (!fp) {
870  if (!fp) return -1;
871  }
872 
873  sfont = sfnt_open(fp);
874  if (!sfont) {
875  DPXFCLOSE(fp);
876  return -1;
877  }
878 
879  if (sfont->type == SFNT_TYPE_TTC)
880  offset = ttc_read_offset(sfont, index);
881 
882  if ((sfont->type != SFNT_TYPE_TTC && sfont->type != SFNT_TYPE_POSTSCRIPT) ||
883  sfnt_read_table_directory(sfont, offset) < 0 ||
884  (offset = sfnt_find_table_pos(sfont, "CFF ")) == 0) {
885  sfnt_close(sfont);
886  DPXFCLOSE(fp);
887  return -1;
888  }
889 
890  cffont = cff_open(sfont->stream, offset, 0);
891  if (!cffont) {
892  WARN("Cannot read CFF font data");
893  sfnt_close(sfont);
894  DPXFCLOSE(fp);
895  return -1;
896  }
897 
898  if (!(cffont->flag & FONTTYPE_CIDFONT)) {
899  cff_close(cffont);
900  sfnt_close(sfont);
901  DPXFCLOSE(fp);
902  return -1;
903  }
904 
905  {
906  char *shortname;
907  int fontname_len = 8;
908 
909  shortname = cff_get_name(cffont);
910  if (!shortname) {
911  WARN("No valid FontName found.");
912  cff_close(cffont);
913  sfnt_close(sfont);
914  DPXFCLOSE(fp);
915  return -1;
916  }
917  /*
918  * Mangled name requires more 7 bytes.
919  * Style requires more 11 bytes.
920  */
921  fontname_len += 11;
922  fontname = NEW(strlen(shortname) + fontname_len, char);
923  memset(fontname, 0, strlen(shortname) + fontname_len);
924  strcpy(fontname, shortname);
925  RELEASE(shortname);
926  }
927  csi.registry = cff_get_string(cffont, (s_SID)cff_dict_get(cffont->topdict, "ROS", 0));
928  csi.ordering = cff_get_string(cffont, (s_SID)cff_dict_get(cffont->topdict, "ROS", 1));
929  csi.supplement = (int)cff_dict_get(cffont->topdict, "ROS", 2);
930 
931  cff_close(cffont);
932 
933  if (opt->embed && opt->style != FONT_STYLE_NONE) {
934  WARN("Embedding disabled due to style option for %s.", name);
935  opt->embed = 0;
936 
937  switch (opt->style) {
938  case FONT_STYLE_BOLD:
939  strcat(fontname, ",Bold");
940  break;
941  case FONT_STYLE_ITALIC:
942  strcat(fontname, ",Italic");
943  break;
945  strcat(fontname, ",BoldItalic");
946  break;
947  }
948  }
949 
950  /* getting font info. from TrueType tables */
951  font->descriptor = tt_get_fontdesc(sfont, &(opt->embed), opt->stemv, 0, name);
952  if (!font->descriptor) {
953  WARN("Could not obtain necessary font info: %s", name);
954  RELEASE(fontname);
955  RELEASE(csi.registry);
956  RELEASE(csi.ordering);
957  sfnt_close(sfont);
958  DPXFCLOSE(fp);
959  return -1;
960  }
961 
963  font->subtype = PDF_FONT_FONTTYPE_CIDTYPE0;
964  font->cid.csi = csi;
965 
966  font->resource = pdf_new_dict();
967  pdf_add_dict(font->resource,
968  pdf_new_name("Type"),
969  pdf_new_name("Font"));
970  pdf_add_dict(font->resource,
971  pdf_new_name("Subtype"),
972  pdf_new_name("CIDFontType0"));
973 
974  if (opt->embed) {
975  char *tmp;
976 
977  tmp = NEW(strlen(font->fontname)+8, char);
978  pdf_font_make_uniqueTag(font->uniqueID);
979  sprintf(tmp, "%s+%s", font->uniqueID, font->fontname);
980  pdf_add_dict(font->descriptor, pdf_new_name("FontName"), pdf_new_name(tmp));
981  pdf_add_dict(font->resource, pdf_new_name("BaseFont"), pdf_new_name(tmp));
982  RELEASE(tmp);
983  } else {
984  pdf_add_dict(font->descriptor, pdf_new_name("FontName"), pdf_new_name(font->fontname));
985  pdf_add_dict(font->resource, pdf_new_name("BaseFont"), pdf_new_name(font->fontname));
986  }
987  {
988  pdf_obj *csi_dict = pdf_new_dict();
989  pdf_add_dict(csi_dict,
990  pdf_new_name("Registry"),
992  pdf_add_dict(csi_dict,
993  pdf_new_name("Ordering"),
995  pdf_add_dict(csi_dict,
996  pdf_new_name("Supplement"),
998  pdf_add_dict(font->resource, pdf_new_name("CIDSystemInfo"), csi_dict);
999  }
1000  pdf_add_dict(font->resource,
1001  pdf_new_name("DW"),
1002  pdf_new_number(1000)); /* not sure */
1003 
1004  sfnt_close(sfont);
1005  DPXFCLOSE(fp);
1006 
1007  return 0;
1008 }
1009 
1010 int
1012 {
1013  CIDSysInfo csi;
1014  char *fontname;
1015  sfnt *sfont = NULL;
1016  cff_font *cffont;
1017  FILE *fp = NULL;
1018  ULONG offset = 0;
1019 
1020  ASSERT(font);
1021 
1023  if (!fp) {
1025  if (!fp) return -1;
1026  }
1027 
1028  sfont = sfnt_open(fp);
1029  if (!sfont) {
1030  WARN("Not a CFF/OpenType font: %s", name);
1031  DPXFCLOSE(fp);
1032  }
1033 
1034  if (sfont->type == SFNT_TYPE_TTC)
1035  offset = ttc_read_offset(sfont, index);
1036 
1037  if ((sfont->type != SFNT_TYPE_TTC && sfont->type != SFNT_TYPE_POSTSCRIPT) ||
1038  sfnt_read_table_directory(sfont, offset) < 0 ||
1039  (offset = sfnt_find_table_pos(sfont, "CFF ")) == 0) {
1040  sfnt_close(sfont);
1041  DPXFCLOSE(fp);
1042  return -1;
1043  }
1044 
1045  cffont = cff_open(sfont->stream, offset, 0);
1046  if (!cffont) {
1047  WARN("Cannot read CFF font data: %s", name);
1048  sfnt_close(sfont);
1049  DPXFCLOSE(fp);
1050  return -1;
1051  }
1052 
1053  if (cffont->flag & FONTTYPE_CIDFONT) {
1054  cff_close(cffont);
1055  sfnt_close(sfont);
1056  DPXFCLOSE(fp);
1057  return -1;
1058  }
1059 
1060  {
1061  char *shortname;
1062  int fontname_len = 8;
1063 
1064  shortname = cff_get_name(cffont);
1065  if (!shortname) {
1066  WARN("No valid FontName found: %s", name);
1067  cff_close(cffont);
1068  sfnt_close(sfont);
1069  DPXFCLOSE(fp);
1070  return -1;
1071  }
1072  /*
1073  * Mangled name requires more 7 bytes.
1074  */
1075  fontname = NEW(strlen(shortname) + fontname_len, char);
1076  memset(fontname, 0, strlen(shortname) + fontname_len);
1077  strcpy(fontname, shortname);
1078  RELEASE(shortname);
1079  }
1080  csi.registry = NEW(strlen("Adobe") + 1, char);
1081  strcpy(csi.registry, "Adobe");
1082  csi.ordering = NEW(strlen("Identity") + 1, char);
1083  strcpy(csi.ordering, "Identity");
1084  csi.supplement = 0;
1085 
1086  cff_close(cffont);
1087 
1088  opt->embed = 1;
1089  /* getting font info. from TrueType tables */
1090  font->descriptor = tt_get_fontdesc(sfont, &(opt->embed), opt->stemv, 0, name);
1091  if (!font->descriptor) {
1092  WARN("Could not obtain necessary font info: %s", name);
1093  RELEASE(fontname);
1094  RELEASE(csi.registry);
1095  RELEASE(csi.ordering);
1096  sfnt_close(sfont);
1097  DPXFCLOSE(fp);
1098  return -1;
1099  } else if (!opt->embed) {
1100  WARN("Can’t embed font due to font license: %s", name);
1101  RELEASE(fontname);
1102  RELEASE(csi.registry);
1103  RELEASE(csi.ordering);
1104  sfnt_close(sfont);
1105  DPXFCLOSE(fp);
1106  return -1;
1107  }
1108 
1109  font->fontname = fontname;
1110  font->subtype = PDF_FONT_FONTTYPE_CIDTYPE0;
1111  font->cid.csi = csi;
1113 
1114  font->resource = pdf_new_dict();
1115  pdf_add_dict(font->resource,
1116  pdf_new_name("Type"),
1117  pdf_new_name("Font"));
1118  pdf_add_dict(font->resource,
1119  pdf_new_name("Subtype"),
1120  pdf_new_name("CIDFontType0"));
1121 
1122  if (opt->embed) {
1123  char *tmp;
1124 
1125  tmp = NEW(strlen(font->fontname)+8, char);
1126  pdf_font_make_uniqueTag(font->uniqueID);
1127  sprintf(tmp, "%s+%s", font->uniqueID, font->fontname);
1128  pdf_add_dict(font->descriptor, pdf_new_name("FontName"), pdf_new_name(tmp));
1129  pdf_add_dict(font->resource, pdf_new_name("BaseFont"), pdf_new_name(tmp));
1130  RELEASE(tmp);
1131  } else {
1132  pdf_add_dict(font->descriptor, pdf_new_name("FontName"), pdf_new_name(font->fontname));
1133  pdf_add_dict(font->resource, pdf_new_name("BaseFont"), pdf_new_name(font->fontname));
1134  }
1135  {
1136  pdf_obj *csi_dict = pdf_new_dict();
1137  pdf_add_dict(csi_dict,
1138  pdf_new_name("Registry"),
1139  pdf_new_string(csi.registry, strlen(csi.registry)));
1140  pdf_add_dict(csi_dict,
1141  pdf_new_name("Ordering"),
1142  pdf_new_string(csi.ordering, strlen(csi.ordering)));
1143  pdf_add_dict(csi_dict,
1144  pdf_new_name("Supplement"),
1145  pdf_new_number(csi.supplement));
1146  pdf_add_dict(font->resource, pdf_new_name("CIDSystemInfo"), csi_dict);
1147  }
1148 
1149  sfnt_close(sfont);
1150  DPXFCLOSE(fp);
1151 
1152  return 0;
1153 }
1154 
1155 int
1157 {
1158  FILE *fp;
1159  sfnt *sfont;
1160  cff_font *cffont;
1161  cff_index *charstrings, *idx;
1162  int charstring_len, max_len;
1163  int destlen = 0;
1164  int size, offset = 0;
1165  card8 *data;
1166  card16 num_glyphs, gid, last_cid;
1167  int i, cid;
1168  char *used_chars;
1169  double default_width, nominal_width;
1170 
1171  ASSERT(font);
1172 
1173  if (!font->reference)
1174  return 0;
1175 
1176  pdf_add_dict(font->resource,
1177  pdf_new_name("FontDescriptor"),
1178  pdf_ref_obj (font->descriptor));
1179 
1180  used_chars = font->usedchars;
1181 
1183  if (!fp) {
1185  if (!fp) {
1186  WARN("Could not open file: %s", font->filename);
1187  return -1;
1188  }
1189  }
1190 
1191  sfont = sfnt_open(fp);
1192  if (!sfont) {
1193  WARN("Failed to read font data: %s", font->filename);
1194  DPXFCLOSE(fp);
1195  return -1;
1196  }
1197 
1198  if (sfont->type == SFNT_TYPE_TTC)
1199  offset = ttc_read_offset(sfont, font->index);
1200 
1201  if ((sfont->type != SFNT_TYPE_TTC &&
1202  sfont->type != SFNT_TYPE_POSTSCRIPT) ||
1203  sfnt_read_table_directory(sfont, offset) < 0 ||
1204  (offset = sfnt_find_table_pos(sfont, "CFF ")) == 0) {
1205  WARN("Not a CFF/OpenType font: %s", font->filename);
1206  sfnt_close(sfont);
1207  DPXFCLOSE(fp);
1208  return -1;
1209  }
1210 
1211  cffont = cff_open(sfont->stream, offset, 0);
1212  if (!cffont) {
1213  WARN("Failed to read CFF font data: %s", font->filename);
1214  sfnt_close(sfont);
1215  DPXFCLOSE(fp);
1216  return -1;
1217  }
1218 
1219  if (cffont->flag & FONTTYPE_CIDFONT) {
1220  WARN("Unxpected type (CIDFont) found: %s", font->filename);
1221  cff_close(cffont);
1222  sfnt_close(sfont);
1223  DPXFCLOSE(fp);
1224  return -1;
1225  }
1226 
1227  cff_read_private(cffont);
1228  cff_read_subrs (cffont);
1229 
1230  if (cffont->private[0] && cff_dict_known(cffont->private[0], "StdVW")) {
1231  double stemv;
1232  stemv = cff_dict_get(cffont->private[0], "StdVW", 0);
1233  pdf_add_dict(font->descriptor,
1234  pdf_new_name("StemV"), pdf_new_number(stemv));
1235  }
1236  if (cffont->private[0] && cff_dict_known(cffont->private[0], "defaultWidthX")) {
1237  default_width = (double) cff_dict_get(cffont->private[0], "defaultWidthX", 0);
1238  } else {
1239  default_width = CFF_DEFAULTWIDTHX_DEFAULT;
1240  }
1241  if (cffont->private[0] && cff_dict_known(cffont->private[0], "nominalWidthX")) {
1242  nominal_width = (double) cff_dict_get(cffont->private[0], "nominalWidthX", 0);
1243  } else {
1244  nominal_width = CFF_NOMINALWIDTHX_DEFAULT;
1245  }
1246 
1247  num_glyphs = 0; last_cid = 0;
1248  add_to_used_chars2(used_chars, 0); /* .notdef */
1249  for (i = 0; i < (cffont->num_glyphs + 7)/8; i++) {
1250  int c, j;
1251 
1252  c = used_chars[i];
1253  for (j = 7; j >= 0; j--) {
1254  if (c & (1 << j)) {
1255  num_glyphs++;
1256  last_cid = (i + 1) * 8 - j - 1;
1257  }
1258  }
1259  }
1260 
1261  {
1262  cff_fdselect *fdselect;
1263 
1264  fdselect = NEW(1, cff_fdselect);
1265  fdselect->format = 3;
1266  fdselect->num_entries = 1;
1267  fdselect->data.ranges = NEW(1, cff_range3);
1268  fdselect->data.ranges[0].first = 0;
1269  fdselect->data.ranges[0].fd = 0;
1270  cffont->fdselect = fdselect;
1271  }
1272 
1273  {
1275 
1276  charset = NEW(1, cff_charsets);
1277  charset->format = 0;
1278  charset->num_entries = num_glyphs-1;
1279  charset->data.glyphs = NEW(num_glyphs-1, s_SID);
1280 
1281  for (gid = 0, cid = 0; cid <= last_cid; cid++) {
1282  if (is_used_char2(used_chars, cid)) {
1283  if (gid > 0)
1284  charset->data.glyphs[gid-1] = cid;
1285  gid++;
1286  }
1287  }
1288  /* cff_release_charsets(cffont->charsets); */
1289  cffont->charsets = charset;
1290  }
1291 
1292  cff_dict_add(cffont->topdict, "CIDCount", 1);
1293  cff_dict_set(cffont->topdict, "CIDCount", 0, last_cid + 1);
1294 
1295  cffont->fdarray = NEW(1, cff_dict *);
1296  cffont->fdarray[0] = cff_new_dict();
1297  cff_dict_add(cffont->fdarray[0], "FontName", 1);
1298  cff_dict_set(cffont->fdarray[0], "FontName", 0,
1299  (double) cff_add_string(cffont, font->fontname + 7, 1)); /* FIXME: Skip XXXXXX+ */
1300  cff_dict_add(cffont->fdarray[0], "Private", 2);
1301  cff_dict_set(cffont->fdarray[0], "Private", 0, 0.0);
1302  cff_dict_set(cffont->fdarray[0], "Private", 0, 0.0);
1303  /* FDArray - index offset, not known yet */
1304  cff_dict_add(cffont->topdict, "FDArray", 1);
1305  cff_dict_set(cffont->topdict, "FDArray", 0, 0.0);
1306  /* FDSelect - offset, not known yet */
1307  cff_dict_add(cffont->topdict, "FDSelect", 1);
1308  cff_dict_set(cffont->topdict, "FDSelect", 0, 0.0);
1309 
1310  cff_dict_remove(cffont->topdict, "UniqueID");
1311  cff_dict_remove(cffont->topdict, "XUID");
1312  cff_dict_remove(cffont->topdict, "Private");
1313  cff_dict_remove(cffont->topdict, "Encoding");
1314 
1315 
1316  /* */
1317  offset = (int) cff_dict_get(cffont->topdict, "CharStrings", 0);
1318  cff_seek_set(cffont, offset);
1319  idx = cff_get_index_header(cffont);
1320  /* offset is now absolute offset ... bad */
1321  offset = cff_tell(cffont);
1322 
1323  if (idx->count < 2) {
1324  WARN("No valid charstring data found: %s", font->filename);
1326  cff_close(cffont);
1327  sfnt_close(sfont);
1328  DPXFCLOSE(fp);
1329  return -1;
1330  }
1331 
1332  /* New CharStrings INDEX */
1333  charstrings = cff_new_index((card16)(num_glyphs+1));
1334  max_len = 2 * CS_STR_LEN_MAX;
1335  charstrings->data = NEW(max_len, card8);
1336  charstring_len = 0;
1337 
1338  gid = 0;
1340  for (cid = 0; cid <= last_cid; cid++) {
1341  if (!is_used_char2(used_chars, cid))
1342  continue;
1343 
1344  if ((size = (idx->offset)[cid+1] - (idx->offset)[cid])
1345  > CS_STR_LEN_MAX) {
1346  WARN("Charstring too long:%s (gid=%u)", font->filename, cid);
1347  RELEASE(data);
1348  cff_release_index(charstrings);
1350  cff_close(cffont);
1351  sfnt_close(sfont);
1352  DPXFCLOSE(fp);
1353  return -1;
1354  }
1355  if (charstring_len + CS_STR_LEN_MAX >= max_len) {
1356  max_len = charstring_len + 2 * CS_STR_LEN_MAX;
1357  charstrings->data = RENEW(charstrings->data, max_len, card8);
1358  }
1359  (charstrings->offset)[gid] = charstring_len + 1;
1360  cff_seek(cffont, offset + (idx->offset)[cid] - 1);
1361  cff_read_data(data, size, cffont);
1362  charstring_len += cs_copy_charstring(charstrings->data + charstring_len,
1363  max_len - charstring_len,
1364  data, size,
1365  cffont->gsubr, (cffont->subrs)[0],
1366  default_width, nominal_width, NULL);
1367  gid++;
1368  }
1369  if (gid != num_glyphs) {
1370  WARN("Unexpeced error: %s", font->filename);
1371  RELEASE(data);
1372  cff_release_index(charstrings);
1374  cff_close(cffont);
1375  sfnt_close(sfont);
1376  DPXFCLOSE(fp);
1377  return -1;
1378  }
1379  RELEASE(data);
1381 
1382  (charstrings->offset)[num_glyphs] = charstring_len + 1;
1383  charstrings->count = num_glyphs;
1384  cffont->num_glyphs = num_glyphs;
1385  cffont->cstrings = charstrings;
1386 
1387  /* no Global subr */
1388  if (cffont->gsubr)
1389  cff_release_index(cffont->gsubr);
1390  cffont->gsubr = cff_new_index(0);
1391 
1392  if (cffont->subrs && cffont->subrs[0]) {
1393  cff_release_index(cffont->subrs[0]);
1394  cffont->subrs[0] = NULL;
1395  }
1396  if (cffont->private && (cffont->private)[0]) {
1397  cff_dict_remove((cffont->private)[0], "Subrs"); /* no Subrs */
1398  }
1399 
1400  cff_add_string(cffont, "Adobe", 1);
1401  cff_add_string(cffont, "Identity", 1);
1402 
1403  cff_dict_update(cffont->topdict, cffont);
1404  cff_dict_update(cffont->private[0], cffont);
1405  cff_update_string(cffont);
1406 
1407  /* CFF code need to be rewrote... */
1408  cff_dict_add(cffont->topdict, "ROS", 3);
1409  cff_dict_set(cffont->topdict, "ROS", 0,
1410  (double) cff_get_sid(cffont, "Adobe"));
1411  cff_dict_set(cffont->topdict, "ROS", 1,
1412  (double) cff_get_sid(cffont, "Identity"));
1413  cff_dict_set(cffont->topdict, "ROS", 2, 0.0);
1414 
1415  destlen = write_fontfile(font, cffont);
1416 
1417  /*
1418  * DW, W, DW2 and W2:
1419  * Those values are obtained from OpenType table (not TFM).
1420  */
1421  {
1422  unsigned char *CIDToGIDMap;
1423 
1424  CIDToGIDMap = NEW(2 * (last_cid+1), unsigned char);
1425  memset(CIDToGIDMap, 0, 2 * (last_cid + 1));
1426  for (cid = 0; cid <= last_cid; cid++) {
1427  if (is_used_char2(used_chars, cid)) {
1428  CIDToGIDMap[2*cid ] = (cid >> 8) & 0xff;
1429  CIDToGIDMap[2*cid+1] = cid & 0xff;
1430  }
1431  }
1432  add_CIDMetrics(sfont, font->resource, CIDToGIDMap, last_cid,
1433  font->cid.need_vmetrics ? 1 : 0);
1434  RELEASE(CIDToGIDMap);
1435  }
1436 
1437  cff_close(cffont);
1438  sfnt_close(sfont);
1439  DPXFCLOSE(fp);
1440 
1441  if (dpx_conf.verbose_level > 1)
1442  MESG("[%u glyphs][%ld bytes]", num_glyphs, destlen);
1443 
1444  if (pdf_check_version(2, 0) < 0) {
1445  CIDFont_type0_add_CIDSet(font, used_chars, last_cid);
1446  }
1447 
1448  return 0;
1449 }
1450 
1451 static int
1452 load_base_CMap (const char *font_name, int wmode, cff_font *cffont)
1453 {
1454  int cmap_id = -1;
1455  CMap *cmap;
1456  char *cmap_name;
1457  card16 gid;
1458  unsigned char range_min[4] = {0x00, 0x00, 0x00, 0x00};
1459  unsigned char range_max[4] = {0x7f, 0xff, 0xff, 0xff};
1460 
1461  cmap_name = NEW(strlen(font_name)+strlen("-UCS4-H")+1, char);
1462  if (wmode) {
1463  sprintf(cmap_name, "%s-UCS4-V", font_name);
1464  } else {
1465  sprintf(cmap_name, "%s-UCS4-H", font_name);
1466  }
1467 
1468  cmap_id = CMap_cache_find(cmap_name);
1469  if (cmap_id >= 0) {
1470  RELEASE(cmap_name);
1471  return cmap_id;
1472  }
1473 
1474  cmap = CMap_new();
1475  CMap_set_name (cmap, cmap_name);
1477  CMap_set_wmode(cmap, wmode);
1480  RELEASE(cmap_name);
1481 
1482  for (gid = 1; gid < cffont->num_glyphs; gid++) {
1483  int32_t ucv;
1484  s_SID sid;
1485  char *glyph, *name, *suffix;
1486  unsigned char srcCode[4];
1487 
1488  sid = cff_charsets_lookup_inverse(cffont, gid);
1489  glyph = cff_get_string (cffont, sid);
1490 
1492  if (!name) {
1493  if (suffix)
1494  RELEASE(suffix);
1495  RELEASE(glyph);
1496  continue;
1497  }
1498 
1499  if (suffix) {
1500  RELEASE(name);
1501  RELEASE(suffix);
1502  RELEASE(glyph);
1503  continue;
1504  }
1505 
1506  if (agl_name_is_unicode(name)) {
1508  srcCode[0] = (ucv >> 24) & 0xff;
1509  srcCode[1] = (ucv >> 16) & 0xff;
1510  srcCode[2] = (ucv >> 8) & 0xff;
1511  srcCode[3] = ucv & 0xff;
1512  CMap_add_cidchar(cmap, srcCode, 4, gid);
1513  } else {
1514  agl_name *agln;
1515 
1516  agln = agl_lookup_list(name);
1517  if (!agln)
1518  WARN("Glyph \"%s\" inaccessible (no Unicode mapping)", glyph);
1519  while (agln) {
1520  if (agln->n_components > 1) {
1521  WARN("Glyph \"%s\" inaccessible (composite character)", glyph);
1522  } else if (agln->n_components == 1) {
1523  ucv = agln->unicodes[0];
1524  srcCode[0] = (ucv >> 24) & 0xff;
1525  srcCode[1] = (ucv >> 16) & 0xff;
1526  srcCode[2] = (ucv >> 8) & 0xff;
1527  srcCode[3] = ucv & 0xff;
1528  CMap_add_cidchar(cmap, srcCode, 4, gid);
1529  }
1530  agln = agln->alternate;
1531  }
1532  }
1533  RELEASE(name);
1534  if (suffix)
1535  RELEASE(suffix);
1536  RELEASE(glyph);
1537  }
1538  cmap_id = CMap_cache_add(cmap);
1539 
1540  return cmap_id;
1541 }
1542 
1543 int
1545  const char *otl_tags, /* not supported yet */
1546  int wmode)
1547 {
1548  int cmap_id = -1;
1549  cff_font *cffont;
1550  FILE *fp;
1551 
1552  if (!font_name)
1553  return -1;
1554 
1556  if (!fp)
1557  return -1;
1558 
1559  cffont = t1_load_font(NULL, 1, fp);
1560  DPXFCLOSE(fp);
1561  if (!cffont)
1562  return -1;
1563 
1564  cmap_id = load_base_CMap(font_name, wmode, cffont);
1565 
1566  cff_close(cffont);
1567 
1568  if (cmap_id < 0) {
1569  WARN("Failed to create Unicode charmap for font \"%s\".", font_name);
1570  return -1;
1571  }
1572 
1573  if (otl_tags) {
1574  WARN("Glyph substitution not supported for Type1 font yet...");
1575  }
1576 
1577  return cmap_id;
1578 }
1579 
1580 
1581 /*
1582  * ToUnicode CMap
1583  */
1584 
1585 static pdf_obj *
1587  const char *font_name, const char *used_glyphs)
1588 {
1589  pdf_obj *stream = NULL;
1590  CMap *cmap;
1591  CID cid;
1592  card16 gid;
1593  int glyph_count, total_fail_count;
1594  char *cmap_name;
1595 #define WBUF_SIZE 1024
1596  unsigned char wbuf[WBUF_SIZE];
1597  unsigned char *p, *endptr;
1598  static unsigned char range_min[2] = {0x00, 0x00};
1599  static unsigned char range_max[2] = {0xff, 0xff};
1600 
1601  if (!font_name || !used_glyphs)
1602  return NULL;
1603 
1604  cmap = CMap_new();
1605 
1606  cmap_name = NEW(strlen(font_name)+strlen("-UTF16")+1, char);
1607  strcpy(cmap_name, font_name);
1608  strcat(cmap_name, "-UTF16");
1609  CMap_set_name (cmap, cmap_name);
1610  RELEASE(cmap_name);
1611 
1612  CMap_set_wmode(cmap, 0);
1615 
1617 
1618  glyph_count = total_fail_count = 0;
1619  p = wbuf;
1620  endptr = wbuf + WBUF_SIZE;
1621  for (cid = 1; cid < cffont->num_glyphs; cid++) { /* Skip .notdef */
1622  if (is_used_char2(used_glyphs, cid)) {
1623  char *glyph;
1624  int32_t len;
1625  int fail_count;
1626 
1627  wbuf[0] = (cid >> 8) & 0xff;
1628  wbuf[1] = (cid & 0xff);
1629 
1630  p = wbuf + 2;
1631  gid = cff_charsets_lookup_inverse(cffont, cid);
1632  if (gid == 0)
1633  continue;
1634  glyph = cff_get_string(cffont, gid);
1635  if (glyph) {
1636  len = agl_sput_UTF16BE(glyph, &p, endptr, &fail_count);
1637  if (len < 1 || fail_count) {
1638  total_fail_count += fail_count;
1639  } else {
1640  CMap_add_bfchar(cmap, wbuf, 2, wbuf+2, len);
1641  }
1642  RELEASE(glyph);
1643  }
1644  glyph_count++;
1645  }
1646  }
1647 
1648  if (total_fail_count != 0 &&
1649  total_fail_count >= glyph_count/10) {
1650  WARN("%d glyph names (out of %d) missing Unicode mapping.",
1651  total_fail_count, glyph_count);
1652  WARN("ToUnicode CMap \"%s-UTF16\" removed.", font_name);
1653  } else {
1655  }
1656  CMap_release(cmap);
1657 
1658  return stream;
1659 }
1660 
1661 pdf_obj *
1662 CIDFont_type0_t1create_ToUnicode_stream (const char *filename, const char *fontname, const char *used_chars)
1663 {
1664  pdf_obj *ref = NULL;
1665  pdf_obj *tounicode;
1666  cff_font *cffont;
1667  FILE *fp;
1668 
1669  ASSERT(filename);
1670  ASSERT(fontname);
1671  ASSERT(used_chars);
1672 
1674  if (!fp) {
1675  return NULL;
1676  }
1677 
1678  cffont = t1_load_font(NULL, 1, fp);
1679  if (cffont) {
1680  tounicode = create_ToUnicode_stream(cffont, fontname, used_chars);
1681  if (tounicode) {
1684  }
1685  }
1686  DPXFCLOSE(fp);
1687 
1688  return ref;
1689 }
1690 
1691 /* Duplicate from type1.c */
1692 #define TYPE1_NAME_LEN_MAX 127
1693 
1694 #define FONT_FLAG_FIXEDPITCH (1 << 0) /* Fixed-width font */
1695 #define FONT_FLAG_SERIF (1 << 1) /* Serif font */
1696 #define FONT_FLAG_SYMBOLIC (1 << 2) /* Symbolic font */
1697 #define FONT_FLAG_SCRIPT (1 << 3) /* Script font */
1698 #define FONT_FLAG_STANDARD (1 << 5) /* Adobe Standard Character Set */
1699 #define FONT_FLAG_ITALIC (1 << 6) /* Italic */
1700 #define FONT_FLAG_ALLCAP (1 << 16) /* All-cap font */
1701 #define FONT_FLAG_SMALLCAP (1 << 17) /* Small-cap font */
1702 #define FONT_FLAG_FORCEBOLD (1 << 18) /* Force bold at small text sizes */
1703 
1704 static void
1706 {
1707  double capheight, ascent, descent;
1708  double italicangle, stemv;
1709  double defaultwidth, nominalwidth;
1710  int flags = 0;
1711  int gid;
1712  int i;
1713  static const char *L_c[] = {
1714  "H", "P", "Pi", "Rho", NULL
1715  };
1716  static const char *L_d[] = {
1717  "p", "q", "mu", "eta", NULL
1718  };
1719  static const char *L_a[] = {
1720  "b", "h", "lambda", NULL
1721  };
1722  t1_ginfo gm;
1723 
1724  defaultwidth = 500.0;
1725  nominalwidth = 0.0;
1726 
1727  /*
1728  * CapHeight, Ascent, and Descent is meaningfull only for Latin/Greek/Cyrillic.
1729  * The BlueValues and OtherBlues also have those information.
1730  */
1731  if (cff_dict_known(cffont->topdict, "FontBBox")) {
1732  /* Default values */
1733  capheight = ascent = cff_dict_get(cffont->topdict, "FontBBox", 3);
1734  descent = cff_dict_get(cffont->topdict, "FontBBox", 1);
1735  } else {
1736  capheight = 680.0;
1737  ascent = 690.0;
1738  descent = -190.0;
1739  }
1740  if (cff_dict_known(cffont->private[0], "StdVW")) {
1741  stemv = cff_dict_get(cffont->private[0], "StdVW", 0);
1742  } else {
1743  /*
1744  * We may use the following values for StemV:
1745  * Thin - ExtraLight: <= 50
1746  * Light: 71
1747  * Regular(Normal): 88
1748  * Medium: 109
1749  * SemiBold(DemiBold): 135
1750  * Bold - Heavy: >= 166
1751  */
1752  stemv = 88.0;
1753  }
1754  if (cff_dict_known(cffont->topdict, "ItalicAngle")) {
1755  italicangle = cff_dict_get(cffont->topdict, "ItalicAngle", 0);
1756  if (italicangle != 0.0)
1758  } else {
1759  italicangle = 0.0;
1760  }
1761 
1762  /*
1763  * Use "space", "H", "p", and "b" for various values.
1764  * Those characters should not "seac". (no accent)
1765  */
1766  gid = cff_glyph_lookup(cffont, "space");
1767  if (gid >= 0 && gid < cffont->cstrings->count) {
1768  t1char_get_metrics(cffont->cstrings->data + cffont->cstrings->offset[gid] - 1,
1769  cffont->cstrings->offset[gid+1] - cffont->cstrings->offset[gid],
1770  cffont->subrs[0], &gm);
1771  defaultwidth = gm.wx;
1772  }
1773 
1774  for (i = 0; L_c[i] != NULL; i++) {
1775  gid = cff_glyph_lookup(cffont, L_c[i]);
1776  if (gid >= 0 && gid < cffont->cstrings->count) {
1777  t1char_get_metrics(cffont->cstrings->data + cffont->cstrings->offset[gid] - 1,
1778  cffont->cstrings->offset[gid+1] - cffont->cstrings->offset[gid],
1779  cffont->subrs[0], &gm);
1780  capheight = gm.bbox.ury;
1781  break;
1782  }
1783  }
1784 
1785  for (i = 0; L_d[i] != NULL; i++) {
1786  gid = cff_glyph_lookup(cffont, L_d[i]);
1787  if (gid >= 0 && gid < cffont->cstrings->count) {
1788  t1char_get_metrics(cffont->cstrings->data + cffont->cstrings->offset[gid] - 1,
1789  cffont->cstrings->offset[gid+1] - cffont->cstrings->offset[gid],
1790  cffont->subrs[0], &gm);
1791  descent = gm.bbox.lly;
1792  break;
1793  }
1794  }
1795 
1796  for (i = 0; L_a[i] != NULL; i++) {
1797  gid = cff_glyph_lookup(cffont, L_a[i]);
1798  if (gid >= 0 && gid < cffont->cstrings->count) {
1799  t1char_get_metrics(cffont->cstrings->data + cffont->cstrings->offset[gid] - 1,
1800  cffont->cstrings->offset[gid+1] - cffont->cstrings->offset[gid],
1801  cffont->subrs[0], &gm);
1802  ascent = gm.bbox.ury;
1803  break;
1804  }
1805  }
1806 
1807  if (defaultwidth != 0.0) {
1808  cff_dict_add(cffont->private[0], "defaultWidthX", 1);
1809  cff_dict_set(cffont->private[0], "defaultWidthX", 0, defaultwidth);
1810  }
1811  if (nominalwidth != 0.0) {
1812  cff_dict_add(cffont->private[0], "nominalWidthX", 1);
1813  cff_dict_set(cffont->private[0], "nominalWidthX", 0, nominalwidth);
1814  }
1815  if (cff_dict_known(cffont->private[0], "ForceBold") &&
1816  cff_dict_get(cffont->private[0], "ForceBold", 0)) {
1818  }
1819  if (cff_dict_known(cffont->private[0], "IsFixedPitch") &&
1820  cff_dict_get(cffont->private[0], "IsFixedPitch", 0)) {
1822  }
1823  if (font->fontname &&
1824  !strstr(font->fontname, "Sans")) {
1826  }
1828 
1829  pdf_add_dict(font->descriptor,
1830  pdf_new_name("CapHeight"), pdf_new_number(capheight));
1831  pdf_add_dict(font->descriptor,
1832  pdf_new_name("Ascent"), pdf_new_number(ascent));
1833  pdf_add_dict(font->descriptor,
1834  pdf_new_name("Descent"), pdf_new_number(descent));
1835  pdf_add_dict(font->descriptor,
1836  pdf_new_name("ItalicAngle"), pdf_new_number(italicangle));
1837  pdf_add_dict(font->descriptor,
1838  pdf_new_name("StemV"), pdf_new_number(stemv));
1839  pdf_add_dict(font->descriptor,
1840  pdf_new_name("Flags"), pdf_new_number(flags));
1841 }
1842 
1843 static void
1845  unsigned char *CIDToGIDMap,
1846  double *widths, double default_width, CID last_cid)
1847 {
1848  pdf_obj *tmp;
1849  double val;
1850  card16 cid, gid;
1851  char *used_chars;
1852  int i;
1853 
1854  /*
1855  * The original FontBBox of the font is preserved, instead
1856  * of replacing it with tight bounding box calculated from
1857  * charstrings, to prevent Acrobat 4 from greeking text as
1858  * much as possible.
1859  */
1860  if (!cff_dict_known(cffont->topdict, "FontBBox")) {
1861  WARN("No FontBBox found: %s", font->filename);
1862  } else {
1863  tmp = pdf_new_array();
1864  for (i = 0; i < 4; i++) {
1865  val = cff_dict_get(cffont->topdict, "FontBBox", i);
1866  pdf_add_array(tmp, pdf_new_number(ROUND(val, 1.0)));
1867  }
1868  pdf_add_dict(font->descriptor, pdf_new_name("FontBBox"), tmp);
1869  }
1870 
1871  used_chars = font->usedchars;
1872 
1873  /* FIXME:
1874  * This writes "CID CID width".
1875  * I think it's better to handle each 8 char block
1876  * and to use "CID_start [ w0 w1 ...]".
1877  */
1878  tmp = pdf_new_array();
1879  for (cid = 0; cid <= last_cid; cid++) {
1880  if (is_used_char2(used_chars, cid)) {
1881  gid = (CIDToGIDMap[2*cid] << 8)|CIDToGIDMap[2*cid+1];
1882  if (widths[gid] != default_width) {
1883  pdf_add_array(tmp, pdf_new_number(cid));
1884  pdf_add_array(tmp, pdf_new_number(cid));
1885  pdf_add_array(tmp, pdf_new_number(ROUND(widths[gid], 1.0)));
1886  }
1887  }
1888  }
1889  pdf_add_dict(font->resource,
1890  pdf_new_name("DW"), pdf_new_number(default_width));
1891  if (pdf_array_length(tmp) > 0) {
1892  pdf_add_dict(font->resource, pdf_new_name("W"), pdf_ref_obj(tmp));
1893  }
1894  pdf_release_obj(tmp);
1895 }
1896 
1897 int
1899 {
1900  cff_font *cffont;
1901  double defaultwidth, nominalwidth;
1902  int num_glyphs = 0;
1903  FILE *fp;
1904  int i, offset;
1905  char *used_chars = NULL;
1906  card16 last_cid, gid, cid;
1907  unsigned char *CIDToGIDMap;
1908 
1909  ASSERT(font);
1910 
1911  if (!font->reference) {
1912  return 0;
1913  }
1914 
1915  pdf_add_dict(font->resource,
1916  pdf_new_name("FontDescriptor"),
1917  pdf_ref_obj (font->descriptor));
1918 
1920  if (!fp) {
1921  WARN("Type1: Could not open Type1 font.");
1922  return -1;
1923  }
1924 
1925  cffont = t1_load_font(NULL, 0, fp);
1926  if (!cffont) {
1927  WARN("Could not read Type 1 font...");
1928  DPXFCLOSE(fp);
1929  return -1;
1930  }
1931  DPXFCLOSE(fp);
1932 
1933  ASSERT(font->fontname);
1934  ASSERT(font->usedchars);
1935 
1936  used_chars = font->usedchars;
1937 
1938  cff_set_name(cffont, font->fontname);
1939 
1940  /* defaultWidthX, CapHeight, etc. */
1941  get_font_attr(font, cffont);
1942  if (cff_dict_known(cffont->private[0], "defaultWidthX")) {
1943  defaultwidth = cff_dict_get(cffont->private[0], "defaultWidthX", 0);
1944  } else {
1945  defaultwidth = 0.0;
1946  }
1947  if (cff_dict_known(cffont->private[0], "nominalWidthX")) {
1948  nominalwidth = cff_dict_get(cffont->private[0], "nominalWidthX", 0);
1949  } else {
1950  nominalwidth = 0.0;
1951  }
1952 
1953  num_glyphs = 0; last_cid = 0;
1954  add_to_used_chars2(used_chars, 0); /* .notdef */
1955  for (i = 0; i < (cffont->num_glyphs + 7)/8; i++) {
1956  int c, j;
1957 
1958  c = used_chars[i];
1959  for (j = 7; j >= 0; j--) {
1960  if (c & (1 << j)) {
1961  num_glyphs++;
1962  last_cid = (i + 1) * 8 - j - 1;
1963  }
1964  }
1965  }
1966 
1967  {
1968  cff_fdselect *fdselect;
1969 
1970  fdselect = NEW(1, cff_fdselect);
1971  fdselect->format = 3;
1972  fdselect->num_entries = 1;
1973  fdselect->data.ranges = NEW(1, cff_range3);
1974  fdselect->data.ranges[0].first = 0;
1975  fdselect->data.ranges[0].fd = 0;
1976  cffont->fdselect = fdselect;
1977  }
1978 
1979  CIDToGIDMap = NEW(2*(last_cid+1), unsigned char);
1980  memset(CIDToGIDMap, 0, 2*(last_cid+1));
1981  {
1983 
1984  charset = NEW(1, cff_charsets);
1985  charset->format = 0;
1986  charset->num_entries = num_glyphs-1;
1987  charset->data.glyphs = NEW(num_glyphs-1, s_SID);
1988 
1989  for (gid = 0, cid = 0; cid <= last_cid; cid++) {
1990  if (is_used_char2(used_chars, cid)) {
1991  if (gid > 0)
1992  charset->data.glyphs[gid-1] = cid;
1993  CIDToGIDMap[2*cid ] = (gid >> 8) & 0xff;
1994  CIDToGIDMap[2*cid+1] = gid & 0xff;
1995  gid++;
1996  }
1997  }
1998 
1999  cff_release_charsets(cffont->charsets);
2000  cffont->charsets = charset;
2001  }
2002 
2003  cff_dict_add(cffont->topdict, "CIDCount", 1);
2004  cff_dict_set(cffont->topdict, "CIDCount", 0, last_cid + 1);
2005 
2006  cffont->fdarray = NEW(1, cff_dict *);
2007  cffont->fdarray[0] = cff_new_dict();
2008  cff_dict_add(cffont->fdarray[0], "FontName", 1);
2009  cff_dict_set(cffont->fdarray[0], "FontName", 0,
2010  (double) cff_add_string(cffont, font->fontname + 7, 1)); /* FIXME: Skip XXXXXX+ */
2011  cff_dict_add(cffont->fdarray[0], "Private", 2);
2012  cff_dict_set(cffont->fdarray[0], "Private", 0, 0.0);
2013  cff_dict_set(cffont->fdarray[0], "Private", 0, 0.0);
2014 
2015  /* FDArray - index offset, not known yet */
2016  cff_dict_add(cffont->topdict, "FDArray", 1);
2017  cff_dict_set(cffont->topdict, "FDArray", 0, 0.0);
2018  /* FDSelect - offset, not known yet */
2019  cff_dict_add(cffont->topdict, "FDSelect", 1);
2020  cff_dict_set(cffont->topdict, "FDSelect", 0, 0.0);
2021 
2022  cff_dict_add(cffont->topdict, "charset", 1);
2023  cff_dict_set(cffont->topdict, "charset", 0, 0.0);
2024 
2025  cff_dict_add(cffont->topdict, "CharStrings", 1);
2026  cff_dict_set(cffont->topdict, "CharStrings", 0, 0.0);
2027 
2028  {
2029  cff_index *cstring;
2030  t1_ginfo gm;
2031  int max = 0;
2032  double *widths;
2033  int w_stat[1001], max_count, dw;
2034 
2035  widths = NEW(num_glyphs, double);
2036  memset(w_stat, 0, sizeof(int)*1001);
2037  offset = 0L;
2038  cstring = cff_new_index((card16)num_glyphs);
2039  cstring->data = NULL;
2040  cstring->offset[0] = 1;
2041  gid = 0;
2042  for (cid = 0; cid <= last_cid; cid++) {
2043  if (!is_used_char2(used_chars, cid))
2044  continue;
2045 
2046  if (offset + CS_STR_LEN_MAX >= max) {
2047  max += CS_STR_LEN_MAX*2;
2048  cstring->data = RENEW(cstring->data, max, card8);
2049  }
2050  offset += t1char_convert_charstring(cstring->data + cstring->offset[gid] - 1, CS_STR_LEN_MAX,
2051  cffont->cstrings->data + cffont->cstrings->offset[cid] - 1,
2052  cffont->cstrings->offset[cid+1] - cffont->cstrings->offset[cid],
2053  cffont->subrs[0], defaultwidth, nominalwidth, &gm);
2054  cstring->offset[gid+1] = offset + 1;
2055  if (gm.use_seac) {
2056  WARN("The \"seac\" command for an accented character found: %s", font->filename);
2057  RELEASE(widths);
2059  RELEASE(CIDToGIDMap);
2060  cff_close(cffont);
2061  return -1;
2062  }
2063  widths[gid] = gm.wx;
2064  if (gm.wx >= 0.0 && gm.wx <= 1000.0) {
2065  w_stat[((int) gm.wx)] += 1;
2066  }
2067  gid++;
2068  }
2069 
2070  cff_release_index(cffont->cstrings);
2071  cffont->cstrings = cstring;
2072 
2073  max_count = 0; dw = -1;
2074  for (i = 0; i <= 1000; i++) {
2075  if (w_stat[i] > max_count) {
2076  dw = i;
2077  max_count = w_stat[i];
2078  }
2079  }
2080  if (dw >= 0) {
2081  add_metrics(font, cffont, CIDToGIDMap, widths, dw, last_cid);
2082  } else {
2083  add_metrics(font, cffont, CIDToGIDMap, widths, defaultwidth, last_cid);
2084  }
2085  RELEASE(widths);
2086  }
2087  cff_release_index(cffont->subrs[0]);
2088  cffont->subrs[0] = NULL;
2089 
2090  RELEASE(CIDToGIDMap);
2091 
2092  cff_add_string(cffont, "Adobe", 1);
2093  cff_add_string(cffont, "Identity", 1);
2094 
2095  cff_dict_update(cffont->topdict, cffont);
2096  cff_dict_update(cffont->private[0], cffont);
2097 
2098  cff_update_string(cffont);
2099 
2100  /* CFF code need to be rewrote... */
2101  cff_dict_add(cffont->topdict, "ROS", 3);
2102  cff_dict_set(cffont->topdict, "ROS", 0,
2103  (double) cff_get_sid(cffont, "Adobe"));
2104  cff_dict_set(cffont->topdict, "ROS", 1,
2105  (double) cff_get_sid(cffont, "Identity"));
2106  cff_dict_set(cffont->topdict, "ROS", 2, 0.0);
2107 
2108  cffont->num_glyphs = num_glyphs;
2109  offset = write_fontfile(font, cffont);
2110 
2111  cff_close(cffont);
2112 
2113  if (pdf_check_version(2, 0) < 0) {
2114  CIDFont_type0_add_CIDSet(font, used_chars, last_cid);
2115  }
2116 
2117  return 0;
2118 }
return _Result< 0 ? -1 :_Result;} #line 1069 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsnwprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1091 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, va_list _ArgList) { return _vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1108 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format, va_list _Args);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format, va_list _ArgList) { return _vsnwprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1133 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_c_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1163 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_c(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1179 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1196 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl __vswprintf_l(wchar_t *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vswprintf_l(_Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1212 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf(wchar_t *const _Buffer, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_l(_Buffer,(size_t) -1, _Format,((void *) 0), _ArgList);} #line 1227 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswprintf(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1243 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1264 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1281 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1283 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_p_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_p((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1312 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_p(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1328 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_l(wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1347 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf(wchar_t const *const _Format, va_list _ArgList) { return _vscwprintf_l(_Format,((void *) 0), _ArgList);} #line 1361 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_p_l(wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_p((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1380 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_p(wchar_t const *const _Format, va_list _ArgList) { return _vscwprintf_p_l(_Format,((void *) 0), _ArgList);} #line 1394 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl __swprintf_l(wchar_t *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__vswprintf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1414 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1435 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf(wchar_t *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__vswprintf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1454 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swprintf(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1474 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "__swprintf_l_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl __swprintf_l(wchar_t *_Buffer, wchar_t const *_Format, _locale_t _Locale,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vswprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl __vswprintf_l(wchar_t *_Buffer, wchar_t const *_Format, _locale_t _Locale, va_list _Args);__declspec(deprecated("This function or variable may be unsafe. Consider using " "swprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _swprintf(wchar_t *_Buffer, wchar_t const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "vswprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vswprintf(wchar_t *_Buffer, wchar_t const *_Format, va_list _Args);__inline int __cdecl _swprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1511 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1532 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1534 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_p_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1562 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_p(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1582 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_c_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1603 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_c(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1623 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1646 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1668 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1690 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1711 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_l(wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1737 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf(wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1755 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_p_l(wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_p_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1774 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_p(wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_p_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1792 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #pragma warning(push) #pragma warning(disable:4141 6054) #pragma warning(pop) #line 1856 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" int __cdecl __stdio_common_vswscanf(unsigned __int64 _Options, wchar_t const *_Buffer, size_t _BufferCount, wchar_t const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vswscanf_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options()), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1897 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswscanf(wchar_t const *_Buffer, wchar_t const *_Format, va_list _ArgList) { return _vswscanf_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 1912 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswscanf_s_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1930 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswscanf_s(wchar_t const *const _Buffer, wchar_t const *const _Format, va_list _ArgList) { return _vswscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 1947 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1949 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwscanf_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1976 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwscanf_s_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1995 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_swscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _swscanf_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2015 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "swscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl swscanf(wchar_t const *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2034 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swscanf_s_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_s_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2054 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swscanf_s(wchar_t const *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2075 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 2077 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwscanf_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2100 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwscanf(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2122 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwscanf_s_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2143 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwscanf_s(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2163 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) typedef __int64 fpos_t;errno_t __cdecl _get_stream_buffer_pointers(FILE *_Stream, char ***_Base, char ***_Pointer, int **_Count);errno_t __cdecl clearerr_s(FILE *_Stream);errno_t __cdecl fopen_s(FILE **_Stream, char const *_FileName, char const *_Mode);size_t __cdecl fread_s(void *_Buffer, size_t _BufferSize, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);errno_t __cdecl freopen_s(FILE **_Stream, char const *_FileName, char const *_Mode, FILE *_OldStream);char *__cdecl gets_s(char *_Buffer, rsize_t _Size);errno_t __cdecl tmpfile_s(FILE **_Stream);errno_t __cdecl tmpnam_s(char *_Buffer, rsize_t _Size);#line 145 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" void __cdecl clearerr(FILE *_Stream);int __cdecl fclose(FILE *_Stream);int __cdecl _fcloseall(void);FILE *__cdecl _fdopen(int _FileHandle, char const *_Mode);int __cdecl feof(FILE *_Stream);int __cdecl ferror(FILE *_Stream);int __cdecl fflush(FILE *_Stream);int __cdecl fgetc(FILE *_Stream);int __cdecl _fgetchar(void);int __cdecl fgetpos(FILE *_Stream, fpos_t *_Position);char *__cdecl fgets(char *_Buffer, int _MaxCount, FILE *_Stream);int __cdecl _fileno(FILE *_Stream);int __cdecl _flushall(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "fopen_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl fopen(char const *_FileName, char const *_Mode);int __cdecl fputc(int _Character, FILE *_Stream);int __cdecl _fputchar(int _Character);int __cdecl fputs(char const *_Buffer, FILE *_Stream);size_t __cdecl fread(void *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);__declspec(deprecated("This function or variable may be unsafe. Consider using " "freopen_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl freopen(char const *_FileName, char const *_Mode, FILE *_Stream);FILE *__cdecl _fsopen(char const *_FileName, char const *_Mode, int _ShFlag);int __cdecl fsetpos(FILE *_Stream, fpos_t const *_Position);int __cdecl fseek(FILE *_Stream, long _Offset, int _Origin);int __cdecl _fseeki64(FILE *_Stream, __int64 _Offset, int _Origin);long __cdecl ftell(FILE *_Stream);__int64 __cdecl _ftelli64(FILE *_Stream);size_t __cdecl fwrite(void const *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl getc(FILE *_Stream);int __cdecl getchar(void);int __cdecl _getmaxstdio(void);int __cdecl _getw(FILE *_Stream);void __cdecl perror(char const *_ErrorMessage);int __cdecl _pclose(FILE *_Stream);FILE *__cdecl _popen(char const *_Command, char const *_Mode);#line 344 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl putc(int _Character, FILE *_Stream);int __cdecl putchar(int _Character);int __cdecl puts(char const *_Buffer);int __cdecl _putw(int _Word, FILE *_Stream);int __cdecl remove(char const *_FileName);int __cdecl rename(char const *_OldFileName, char const *_NewFileName);int __cdecl _unlink(char const *_FileName);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_unlink" ". See online help for details.")) int __cdecl unlink(char const *_FileName);#line 391 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" void __cdecl rewind(FILE *_Stream);int __cdecl _rmtmp(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "setvbuf" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) void __cdecl setbuf(FILE *_Stream, char *_Buffer);int __cdecl _setmaxstdio(int _Maximum);int __cdecl setvbuf(FILE *_Stream, char *_Buffer, int _Mode, size_t _Size);__declspec(allocator) char *__cdecl _tempnam(char const *_DirectoryName, char const *_FilePrefix);__declspec(deprecated("This function or variable may be unsafe. Consider using " "tmpfile_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl tmpfile(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "tmpnam_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl tmpnam(char *_Buffer);int __cdecl ungetc(int _Character, FILE *_Stream);void __cdecl _lock_file(FILE *_Stream);void __cdecl _unlock_file(FILE *_Stream);int __cdecl _fclose_nolock(FILE *_Stream);int __cdecl _fflush_nolock(FILE *_Stream);int __cdecl _fgetc_nolock(FILE *_Stream);int __cdecl _fputc_nolock(int _Character, FILE *_Stream);size_t __cdecl _fread_nolock(void *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);size_t __cdecl _fread_nolock_s(void *_Buffer, size_t _BufferSize, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl _fseek_nolock(FILE *_Stream, long _Offset, int _Origin);int __cdecl _fseeki64_nolock(FILE *_Stream, __int64 _Offset, int _Origin);long __cdecl _ftell_nolock(FILE *_Stream);__int64 __cdecl _ftelli64_nolock(FILE *_Stream);size_t __cdecl _fwrite_nolock(void const *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl _getc_nolock(FILE *_Stream);int __cdecl _putc_nolock(int _Character, FILE *_Stream);int __cdecl _ungetc_nolock(int _Character, FILE *_Stream);int *__cdecl __p__commode(void);#line 596 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vfprintf(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vfprintf_s(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vfprintf_p(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vfprintf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 648 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfprintf(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_l(_Stream, _Format,((void *) 0), _ArgList);} #line 662 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf_s((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 677 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfprintf_s(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_s_l(_Stream, _Format,((void *) 0), _ArgList);} #line 693 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 695 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_p_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf_p((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 710 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_p(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_p_l(_Stream, _Format,((void *) 0), _ArgList);} #line 724 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 738 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vprintf(char const *const _Format, va_list _ArgList) { return _vfprintf_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 751 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_s_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_s_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 765 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vprintf_s(char const *const _Format, va_list _ArgList) { return _vfprintf_s_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 780 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 782 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_p_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_p_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 796 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_p(char const *const _Format, va_list _ArgList) { return _vfprintf_p_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 809 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 828 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fprintf(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 846 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl _set_printf_count_output(int _Value);int __cdecl _get_printf_count_output(void);__inline int __cdecl _fprintf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 871 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fprintf_s(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 891 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 893 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_p_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 912 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_p(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 930 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 948 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl printf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 965 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_s_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 983 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl printf_s(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1002 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1004 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_p_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1022 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_p(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1039 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vfscanf(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _Arglist);__inline int __cdecl _vfscanf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfscanf((*__local_stdio_scanf_options()), _Stream, _Format, _Locale, _ArgList);} #line 1070 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfscanf(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfscanf_l(_Stream, _Format,((void *) 0), _ArgList);} #line 1084 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfscanf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Stream, _Format, _Locale, _ArgList);} #line 1101 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfscanf_s(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfscanf_s_l(_Stream, _Format,((void *) 0), _ArgList);} #line 1118 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1120 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscanf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfscanf_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);} #line 1134 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vscanf(char const *const _Format, va_list _ArgList) { return _vfscanf_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);} #line 1147 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscanf_s_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfscanf_s_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);} #line 1161 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vscanf_s(char const *const _Format, va_list _ArgList) { return _vfscanf_s_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);} #line 1176 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1178 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_fscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _fscanf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1197 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "fscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl fscanf(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1215 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fscanf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1234 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fscanf_s(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1254 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1256 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_scanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _scanf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1274 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "scanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl scanf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1291 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scanf_s_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1309 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl scanf_s(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1328 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1330 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vsprintf(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsprintf_s(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsnprintf_s(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, size_t _MaxCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsprintf_p(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnprintf_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1399 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1415 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsnprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 1), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);return _Result< 0 ? -1 :_Result;} #line 1446 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsprintf_l(char *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vsnprintf_l(_Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1462 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "vsprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl vsprintf(char *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsnprintf_l(_Buffer,(size_t) -1, _Format,((void *) 0), _ArgList);} #line 1477 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_s_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1498 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsprintf_s(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1516 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1526 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_p_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_p((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1547 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_p(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1563 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_s_l(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsnprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1585 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1602 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsnprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1630 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1641 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1659 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf(char const *const _Format, va_list _ArgList) { return _vscprintf_l(_Format,((void *) 0), _ArgList);} #line 1672 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_p_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_p((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1690 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_p(char const *const _Format, va_list _ArgList) { return _vscprintf_p_l(_Format,((void *) 0), _ArgList);} #line 1703 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_c_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1723 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_c(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1739 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_sprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _sprintf_l(char *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1761 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sprintf(char *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1782 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "sprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl sprintf(char *_Buffer, char const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "vsprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl vsprintf(char *_Buffer, char const *_Format, va_list _Args);__inline int __cdecl _sprintf_s_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1810 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sprintf_s(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1832 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1834 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sprintf_p_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1862 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sprintf_p(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1882 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snprintf_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1905 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl snprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1936 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1956 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl _snprintf(char *_Buffer, size_t _BufferCount, char const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl _vsnprintf(char *_Buffer, size_t _BufferCount, char const *_Format, va_list _Args);__inline int __cdecl _snprintf_c_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1986 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_c(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2006 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_s_l(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2028 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2049 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2075 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2092 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_p_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_p_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2110 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_p(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_p(_Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2127 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vsscanf(unsigned __int64 _Options, char const *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vsscanf_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 2158 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsscanf(char const *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsscanf_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 2172 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsscanf_s_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 2189 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(push) #pragma warning(disable:6530) __inline int __cdecl vsscanf_s(char const *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 2208 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(pop) #line 2219 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_sscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _sscanf_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2238 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "sscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl sscanf(char const *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2256 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sscanf_s_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_s_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2275 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sscanf_s(char const *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=vsscanf_s(_Buffer, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2297 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 2299 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(push) #pragma warning(disable:6530) __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snscanf_l(char const *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2326 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snscanf(char const *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2349 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snscanf_s_l(char const *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2374 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snscanf_s(char const *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2397 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(pop) __declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_tempnam" ". See online help for details.")) char *__cdecl tempnam(char const *_Directory, char const *_FilePrefix);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fcloseall" ". See online help for details.")) int __cdecl fcloseall(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fdopen" ". See online help for details.")) FILE *__cdecl fdopen(int _FileHandle, char const *_Format);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fgetchar" ". See online help for details.")) int __cdecl fgetchar(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fileno" ". See online help for details.")) int __cdecl fileno(FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_flushall" ". See online help for details.")) int __cdecl flushall(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fputchar" ". See online help for details.")) int __cdecl fputchar(int _Ch);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_getw" ". See online help for details.")) int __cdecl getw(FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_putw" ". See online help for details.")) int __cdecl putw(int _Ch, FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_rmtmp" ". See online help for details.")) int __cdecl rmtmp(void);#line 2441 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h"__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma once#pragma once#pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) int *__cdecl _errno(void);errno_t __cdecl _set_errno(int _Value);errno_t __cdecl _get_errno(int *_Value);unsigned long *__cdecl __doserrno(void);errno_t __cdecl _set_doserrno(unsigned long _Value);errno_t __cdecl _get_doserrno(unsigned long *_Value);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4514 4820) __pragma(pack(push, 8)) void *__cdecl memchr(void const *_Buf, int _Val, size_t _MaxCount);int __cdecl memcmp(void const *_Buf1, void const *_Buf2, size_t _Size);void *__cdecl memcpy(void *_Dst, void const *_Src, size_t _Size);void *__cdecl memmove(void *_Dst, void const *_Src, size_t _Size);void *__cdecl memset(void *_Dst, int _Val, size_t _Size);char *__cdecl strchr(char const *_Str, int _Val);char *__cdecl strrchr(char const *_Str, int _Ch);char *__cdecl strstr(char const *_Str, char const *_SubStr);wchar_t *__cdecl wcschr(wchar_t const *_Str, wchar_t _Ch);wchar_t *__cdecl wcsrchr(wchar_t const *_Str, wchar_t _Ch);wchar_t *__cdecl wcsstr(wchar_t const *_Str, wchar_t const *_SubStr);__pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) static __inline errno_t __cdecl memcpy_s(void *const _Destination, rsize_t const _DestinationSize, void const *const _Source, rsize_t const _SourceSize) { if(_SourceSize==0) { return 0;} { int _Expr_val=!!(_Destination !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;if(_Source==((void *) 0)||_DestinationSize< _SourceSize) { memset(_Destination, 0, _DestinationSize);{ int _Expr_val=!!(_Source !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_DestinationSize >=_SourceSize);if(!(_Expr_val)) {(*_errno())=34;_invalid_parameter_noinfo();return 34;} } ;return 22 ;} memcpy(_Destination, _Source, _SourceSize);return 0;} static __inline errno_t __cdecl memmove_s(void *const _Destination, rsize_t const _DestinationSize, void const *const _Source, rsize_t const _SourceSize) { if(_SourceSize==0) { return 0;} { int _Expr_val=!!(_Destination !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_Source !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_DestinationSize >=_SourceSize);if(!(_Expr_val)) {(*_errno())=34;_invalid_parameter_noinfo();return 34;} } ;memmove(_Destination, _Source, _SourceSize);return 0;}#pragma warning(pop) __pragma(pack(pop))#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) int __cdecl _memicmp(void const *_Buf1, void const *_Buf2, size_t _Size);int __cdecl _memicmp_l(void const *_Buf1, void const *_Buf2, size_t _Size, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_memccpy" ". See online help for details.")) void *__cdecl memccpy(void *_Dst, void const *_Src, int _Val, size_t _Size);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_memicmp" ". See online help for details.")) int __cdecl memicmp(void const *_Buf1, void const *_Buf2, size_t _Size);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) errno_t __cdecl wcscat_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source);errno_t __cdecl wcscpy_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source);errno_t __cdecl wcsncat_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source, rsize_t _MaxCount);errno_t __cdecl wcsncpy_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source, rsize_t _MaxCount);wchar_t *__cdecl wcstok_s(wchar_t *_String, wchar_t const *_Delimiter, wchar_t **_Context);__declspec(allocator) wchar_t *__cdecl _wcsdup(wchar_t const *_String);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcscat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcscat(wchar_t *_Destination, wchar_t const *_Source);int __cdecl wcscmp(wchar_t const *_String1, wchar_t const *_String2);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcscpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcscpy(wchar_t *_Destination, wchar_t const *_Source);size_t __cdecl wcscspn(wchar_t const *_String, wchar_t const *_Control);size_t __cdecl wcslen(wchar_t const *_String);size_t __cdecl wcsnlen(wchar_t const *_Source, size_t _MaxCount);static __inline size_t __cdecl wcsnlen_s(wchar_t const *_Source, size_t _MaxCount) { return(_Source==0) ? 0 :wcsnlen(_Source, _MaxCount);}__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcsncat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcsncat(wchar_t *_Destination, wchar_t const *_Source, size_t _Count);int __cdecl wcsncmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcsncpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcsncpy(wchar_t *_Destination, wchar_t const *_Source, size_t _Count);wchar_t *__cdecl wcspbrk(wchar_t const *_String, wchar_t const *_Control);size_t __cdecl wcsspn(wchar_t const *_String, wchar_t const *_Control);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcstok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcstok(wchar_t *_String, wchar_t const *_Delimiter, wchar_t **_Context);#line 237 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstring.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "wcstok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) static __inline wchar_t *__cdecl _wcstok(wchar_t *const _String, wchar_t const *const _Delimiter) { return wcstok(_String, _Delimiter, 0);} __declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcserror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcserror(int _ErrorNumber);errno_t __cdecl _wcserror_s(wchar_t *_Buffer, size_t _SizeInWords, int _ErrorNumber);__declspec(deprecated("This function or variable may be unsafe. Consider using " "__wcserror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl __wcserror(wchar_t const *_String);errno_t __cdecl __wcserror_s(wchar_t *_Buffer, size_t _SizeInWords, wchar_t const *_ErrorMessage);int __cdecl _wcsicmp(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcsicmp_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsnicmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsnicmp_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);errno_t __cdecl _wcsnset_s(wchar_t *_Destination, size_t _SizeInWords, wchar_t _Value, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsnset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsnset(wchar_t *_String, wchar_t _Value, size_t _MaxCount);wchar_t *__cdecl _wcsrev(wchar_t *_String);errno_t __cdecl _wcsset_s(wchar_t *_Destination, size_t _SizeInWords, wchar_t _Value);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsset(wchar_t *_String, wchar_t _Value);errno_t __cdecl _wcslwr_s(wchar_t *_String, size_t _SizeInWords);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcslwr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcslwr(wchar_t *_String);errno_t __cdecl _wcslwr_s_l(wchar_t *_String, size_t _SizeInWords, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcslwr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcslwr_l(wchar_t *_String, _locale_t _Locale);errno_t __cdecl _wcsupr_s(wchar_t *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsupr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsupr(wchar_t *_String);errno_t __cdecl _wcsupr_s_l(wchar_t *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsupr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsupr_l(wchar_t *_String, _locale_t _Locale);size_t __cdecl wcsxfrm(wchar_t *_Destination, wchar_t const *_Source, size_t _MaxCount);size_t __cdecl _wcsxfrm_l(wchar_t *_Destination, wchar_t const *_Source, size_t _MaxCount, _locale_t _Locale);int __cdecl wcscoll(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcscoll_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsicoll(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcsicoll_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsncoll(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsncoll_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _wcsnicoll(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsnicoll_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsdup" ". See online help for details.")) wchar_t *__cdecl wcsdup(wchar_t const *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsicmp" ". See online help for details.")) int __cdecl wcsicmp(wchar_t const *_String1, wchar_t const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsnicmp" ". See online help for details.")) int __cdecl wcsnicmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsnset" ". See online help for details.")) wchar_t *__cdecl wcsnset(wchar_t *_String, wchar_t _Value, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsrev" ". See online help for details.")) wchar_t *__cdecl wcsrev(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsset" ". See online help for details.")) wchar_t *__cdecl wcsset(wchar_t *_String, wchar_t _Value);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcslwr" ". See online help for details.")) wchar_t *__cdecl wcslwr(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsupr" ". See online help for details.")) wchar_t *__cdecl wcsupr(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsicoll" ". See online help for details.")) int __cdecl wcsicoll(wchar_t const *_String1, wchar_t const *_String2);__pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) errno_t __cdecl strcpy_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source);errno_t __cdecl strcat_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source);errno_t __cdecl strerror_s(char *_Buffer, size_t _SizeInBytes, int _ErrorNumber);errno_t __cdecl strncat_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source, rsize_t _MaxCount);errno_t __cdecl strncpy_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source, rsize_t _MaxCount);char *__cdecl strtok_s(char *_String, char const *_Delimiter, char **_Context);void *__cdecl _memccpy(void *_Dst, void const *_Src, int _Val, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strcat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strcat(char *_Destination, char const *_Source);int __cdecl strcmp(char const *_Str1, char const *_Str2);int __cdecl _strcmpi(char const *_String1, char const *_String2);int __cdecl strcoll(char const *_String1, char const *_String2);int __cdecl _strcoll_l(char const *_String1, char const *_String2, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strcpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strcpy(char *_Destination, char const *_Source);size_t __cdecl strcspn(char const *_Str, char const *_Control);__declspec(allocator) char *__cdecl _strdup(char const *_Source);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strerror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strerror(char const *_ErrorMessage);errno_t __cdecl _strerror_s(char *_Buffer, size_t _SizeInBytes, char const *_ErrorMessage);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strerror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strerror(int _ErrorMessage);int __cdecl _stricmp(char const *_String1, char const *_String2);int __cdecl _stricoll(char const *_String1, char const *_String2);int __cdecl _stricoll_l(char const *_String1, char const *_String2, _locale_t _Locale);int __cdecl _stricmp_l(char const *_String1, char const *_String2, _locale_t _Locale);size_t __cdecl strlen(char const *_Str);errno_t __cdecl _strlwr_s(char *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strlwr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strlwr(char *_String);errno_t __cdecl _strlwr_s_l(char *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strlwr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strlwr_l(char *_String, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strncat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strncat(char *_Destination, char const *_Source, size_t _Count);int __cdecl strncmp(char const *_Str1, char const *_Str2, size_t _MaxCount);int __cdecl _strnicmp(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strnicmp_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _strnicoll(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strnicoll_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _strncoll(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strncoll_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);size_t __cdecl __strncnt(char const *_String, size_t _Count);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strncpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strncpy(char *_Destination, char const *_Source, size_t _Count);size_t __cdecl strnlen(char const *_String, size_t _MaxCount);static __inline size_t __cdecl strnlen_s(char const *_String, size_t _MaxCount) { return _String==0 ? 0 :strnlen(_String, _MaxCount);} errno_t __cdecl _strnset_s(char *_String, size_t _SizeInBytes, int _Value, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strnset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strnset(char *_Destination, int _Value, size_t _Count);char *__cdecl strpbrk(char const *_Str, char const *_Control);char *__cdecl _strrev(char *_Str);errno_t __cdecl _strset_s(char *_Destination, size_t _DestinationSize, int _Value);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strset(char *_Destination, int _Value);size_t __cdecl strspn(char const *_Str, char const *_Control);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strtok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strtok(char *_String, char const *_Delimiter);errno_t __cdecl _strupr_s(char *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strupr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strupr(char *_String);errno_t __cdecl _strupr_s_l(char *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strupr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strupr_l(char *_String, _locale_t _Locale);size_t __cdecl strxfrm(char *_Destination, char const *_Source, size_t _MaxCount);size_t __cdecl _strxfrm_l(char *_Destination, char const *_Source, size_t _MaxCount, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strdup" ". See online help for details.")) char *__cdecl strdup(char const *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strcmpi" ". See online help for details.")) int __cdecl strcmpi(char const *_String1, char const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_stricmp" ". See online help for details.")) int __cdecl stricmp(char const *_String1, char const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strlwr" ". See online help for details.")) char *__cdecl strlwr(char *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strnicmp" ". See online help for details.")) int __cdecl strnicmp(char const *_String1, char const *_String2, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strnset" ". See online help for details.")) char *__cdecl strnset(char *_String, int _Value, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strrev" ". See online help for details.")) char *__cdecl strrev(char *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strset" ". See online help for details.")) char *__cdecl strset(char *_String, int _Value);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strupr" ". See online help for details.")) char *__cdecl strupr(char *_String);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4514 4820) __pragma(pack(push, 8)) __pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) typedef unsigned short _ino_t;typedef _ino_t ino_t;#line 24 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h" typedef unsigned int _dev_t;typedef _dev_t dev_t;#line 36 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h" typedef long _off_t;typedef _off_t off_t;#line 48 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h"#pragma warning(pop) typedef char *sds;#pragma pack(push, 1) struct sdshdr5 { unsigned char flags;char buf[];};struct sdshdr8 { uint8_t len;uint8_t alloc;unsigned char flags;char buf[];};struct sdshdr16 { uint16_t len;uint16_t alloc;unsigned char flags;char buf[];};struct sdshdr32 { uint32_t len;uint32_t alloc;unsigned char flags;char buf[];};struct sdshdr64 { uint64_t len;uint64_t alloc;unsigned char flags;char buf[];};#pragma pack(pop) static inline size_t sdslen(const sds s) { unsigned char flags=s[-1];switch(flags &7) { case 0 :return((flags) >> 3) ;case 1 :return((struct sdshdr8 *)((s) -(sizeof(struct sdshdr8)))) ->len;case 2 :return((struct sdshdr16 *)((s) -(sizeof(struct sdshdr16)))) ->len;case 3 :return((struct sdshdr32 *)((s) -(sizeof(struct sdshdr32)))) ->len;case 4 :return((struct sdshdr64 *)((s) -(sizeof(struct sdshdr64)))) ->len;} return 0;}static inline size_t sdsavail(const sds s) { unsigned char flags=s[-1];switch(flags &7) { case 0 :{ return 0;} case 1 :{ struct sdshdr8 *sh=(void *)((s) -(sizeof(struct sdshdr8)));;return sh->alloc - sh->len;} case 2 :{ struct sdshdr16 *sh=(void *)((s) -(sizeof(struct sdshdr16)));;return sh->alloc - sh->len;} case 3 :{ struct sdshdr32 *sh=(void *)((s) -(sizeof(struct sdshdr32)));;return sh->alloc - sh->len;} case 4 :{ struct sdshdr64 *sh=(void *)((s) -(sizeof(struct sdshdr64)));;return sh->alloc - sh->len;} } return 0;}static inline void sdssetlen(sds s, size_t newlen) { unsigned char flags=s[-1];switch(flags &7) { case 0 :{ unsigned char *fp=((unsigned char *) s) - 1;*fp=0|(newlen<< 3);} break;case 1 :((struct sdshdr8 *)((s) -(sizeof(struct sdshdr8)))) ->len=(uint8_t) newlen;break;case 2 :((struct sdshdr16 *)((s) -(sizeof(struct sdshdr16)))) ->len=(uint16_t) newlen;break;case 3 :((struct sdshdr32 *)((s) -(sizeof(struct sdshdr32)))) -> len
Definition: CPAL.d:15583
const char * fontname
Definition: afm2pl.c:186
float italicangle
Definition: afm2pl.c:209
float capheight
Definition: afm2tfm.c:240
#define empty
Definition: aptex-macros.h:52
#define head
Definition: aptex-macros.h:513
#define name
#define advance
Definition: aptex-macros.h:464
Definition: CMap.h:33
char * strcpy()
struct rect data
Definition: dvipdfm.c:64
static void
Definition: fpif.c:118
TT_OS2 * os2
Definition: ftlib.c:50
static FIELD_PTR prev
Definition: genind.c:36
#define c(n)
Definition: gpos-common.c:150
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
FT_UInt sid
Definition: cffcmap.c:138
FT_UInt idx
Definition: cffcmap.c:135
#define NEW
Definition: gdkanji.c:77
signed int int32_t
Definition: stdint.h:77
unsigned int CID
Definition: CharTypes.h:16
static int cs_count
Definition: writet1.c:215
agl_name * agl_lookup_list(const char *glyphname)
Definition: agl.c:499
int agl_name_is_unicode(const char *glyphname)
Definition: agl.c:512
char * agl_chop_suffix(const char *glyphname, char **suffix)
Definition: agl.c:87
int32_t agl_name_convert_unicode(const char *glyphname)
Definition: agl.c:550
int32_t agl_sput_UTF16BE(const char *glyphstr, unsigned char **dstpp, unsigned char *limptr, int *fail_count)
Definition: agl.c:644
int cff_pack_charsets(cff_font *cff, card8 *dest, int destlen)
Definition: cff.c:927
card16 cff_charsets_lookup_inverse(cff_font *cff, card16 gid)
Definition: cff.c:1115
int cff_index_size(cff_index *idx)
Definition: cff.c:429
char * cff_get_string(cff_font *cff, s_SID id)
Definition: cff.c:484
int cff_pack_fdselect(cff_font *cff, card8 *dest, int destlen)
Definition: cff.c:1249
int cff_read_fdselect(cff_font *cff)
Definition: cff.c:1196
int cff_read_subrs(cff_font *cff)
Definition: cff.c:1356
int cff_read_fdarray(cff_font *cff)
Definition: cff.c:1404
void cff_release_charsets(cff_charsets *charset)
Definition: cff.c:1172
int cff_set_name(cff_font *cff, char *name)
Definition: cff.c:250
card16 cff_glyph_lookup(cff_font *cff, const char *glyph)
Definition: cff.c:991
int cff_get_sid(cff_font *cff, const char *str)
Definition: cff.c:508
card8 cff_fdselect_lookup(cff_font *cff, card16 gid)
Definition: cff.c:1314
cff_font * cff_open(FILE *stream, int offset, int n)
Definition: cff.c:58
cff_index * cff_get_index_header(cff_font *cff)
Definition: cff.c:292
int cff_put_header(cff_font *cff, card8 *dest, int destlen)
Definition: cff.c:273
void cff_release_index(cff_index *idx)
Definition: cff.c:470
int cff_pack_index(cff_index *idx, card8 *dest, int destlen)
Definition: cff.c:369
void cff_update_string(cff_font *cff)
Definition: cff.c:567
s_SID cff_add_string(cff_font *cff, const char *str, int unique)
Definition: cff.c:578
int cff_read_charsets(cff_font *cff)
Definition: cff.c:837
void cff_close(cff_font *cff)
Definition: cff.c:192
void cff_release_fdselect(cff_fdselect *fdselect)
Definition: cff.c:1302
card16 cff_charsets_lookup(cff_font *cff, card16 cid)
Definition: cff.c:1055
char * cff_get_name(cff_font *cff)
Definition: cff.c:234
int cff_read_private(cff_font *cff)
Definition: cff.c:1438
cff_index * cff_new_index(card16 count)
Definition: cff.c:451
#define cff_read_data(d, l, c)
Definition: cff.h:85
#define cff_seek_set(c, p)
Definition: cff.h:84
#define cff_seek(c, p)
Definition: cff.h:87
#define cff_tell(c)
Definition: cff.h:86
#define FONTTYPE_CIDFONT
Definition: cff.h:28
void cff_dict_set(cff_dict *dict, const char *key, int idx, double value)
Definition: cff_dict.c:680
void cff_dict_update(cff_dict *dict, cff_font *cff)
Definition: cff_dict.c:700
cff_dict * cff_new_dict(void)
Definition: cff_dict.c:61
double cff_dict_get(cff_dict *dict, const char *key, int idx)
Definition: cff_dict.c:657
int cff_dict_pack(cff_dict *dict, card8 *dest, int destlen)
Definition: cff_dict.c:570
int cff_dict_known(cff_dict *dict, const char *key)
Definition: cff_dict.c:644
void cff_dict_remove(cff_dict *dict, const char *key)
Definition: cff_dict.c:631
void cff_dict_add(cff_dict *dict, const char *key, int count)
Definition: cff_dict.c:590
#define CFF_NOMINALWIDTHX_DEFAULT
Definition: cff_dict.h:27
#define CFF_DEFAULTWIDTHX_DEFAULT
Definition: cff_dict.h:28
#define CS_STR_LEN_MAX
Definition: cff_limits.h:38
unsigned char card8
Definition: cff_types.h:42
unsigned short s_SID
Definition: cff_types.h:47
unsigned short card16
Definition: cff_types.h:43
CIDSysInfo CSI_UNICODE
Definition: cid.c:92
int opt_flags_cidfont
Definition: cid.c:115
CIDSysInfo CSI_IDENTITY
Definition: cid.c:86
#define CIDFONT_FORCE_FIXEDPITCH
Definition: cid.h:32
int CIDFont_type0_dofont(pdf_font *font)
Definition: cidtype0.c:478
int CIDFont_type0_t1dofont(pdf_font *font)
Definition: cidtype0.c:1898
int CIDFont_type0_open(pdf_font *font, const char *name, int index, cid_opt *opt)
Definition: cidtype0.c:856
int CIDFont_type0_open_from_t1(pdf_font *font, const char *name, int index, cid_opt *opt)
Definition: cidtype0.c:765
int t1_load_UnicodeCMap(const char *font_name, const char *otl_tags, int wmode)
Definition: cidtype0.c:1544
int CIDFont_type0_open_from_t1c(pdf_font *font, const char *name, int index, cid_opt *opt)
Definition: cidtype0.c:1011
pdf_obj * CIDFont_type0_t1create_ToUnicode_stream(const char *filename, const char *fontname, const char *used_chars)
Definition: cidtype0.c:1662
int CIDFont_type0_t1cdofont(pdf_font *font)
Definition: cidtype0.c:1156
int CMap_cache_find(const char *cmap_name)
Definition: cmap.c:902
void CMap_set_CIDSysInfo(CMap *cmap, const CIDSysInfo *csi)
Definition: cmap.c:410
int CMap_add_cidchar(CMap *cmap, const unsigned char *src, int srcdim, CID dst)
Definition: cmap.c:653
void CMap_release(CMap *cmap)
Definition: cmap.c:111
void CMap_set_type(CMap *cmap, int type)
Definition: cmap.c:396
int CMap_add_codespacerange(CMap *cmap, const unsigned char *codelo, const unsigned char *codehi, int dim)
Definition: cmap.c:504
void CMap_set_wmode(CMap *cmap, int wmode)
Definition: cmap.c:403
void CMap_set_name(CMap *cmap, const char *name)
Definition: cmap.c:386
int CMap_add_bfchar(CMap *cmap, const unsigned char *src, int srcdim, const unsigned char *dst, int dstdim)
Definition: cmap.c:594
int CMap_cache_add(CMap *cmap)
Definition: cmap.c:952
CMap * CMap_new(void)
Definition: cmap.c:78
#define CID_MAX
Definition: cmap.h:33
#define CMAP_TYPE_CODE_TO_CID
Definition: cmap.h:45
#define CMAP_TYPE_TO_UNICODE
Definition: cmap.h:46
pdf_obj * CMap_create_stream(CMap *cmap)
Definition: cmap_write.c:323
int cs_copy_charstring(card8 *dst, int dstlen, card8 *src, int srclen, cff_index *gsubr, cff_index *subr, double default_width, double nominal_width, cs_ginfo *ginfo)
Definition: cs_type2.c:783
struct _dpx_conf dpx_conf
Definition: dpxconf.c:33
#define DPXFCLOSE(f)
Definition: dpxfile.h:57
#define DPXFOPEN(n, t)
Definition: dpxfile.h:56
@ DPX_RES_TYPE_OTFONT
Definition: dpxfile.h:33
@ DPX_RES_TYPE_T1FONT
Definition: dpxfile.h:31
@ DPX_RES_TYPE_TTFONT
Definition: dpxfile.h:32
void WARN(const char *fmt,...)
Definition: error.c:62
void MESG(const char *fmt,...)
Definition: error.c:49
#define ASSERT(e)
Definition: error.h:48
#define RENEW(p, n, type)
Definition: mem.h:38
#define RELEASE(p)
Definition: mem.h:39
char work_buffer[1024]
Definition: mfileio.c:171
#define WORK_BUFFER_SIZE
Definition: mfileio.h:68
static unsigned char range_min[1]
Definition: pdfencoding.c:597
static unsigned char range_max[1]
Definition: pdfencoding.c:598
static unsigned char wbuf[1024]
Definition: pdfencoding.c:596
void pdf_font_make_uniqueTag(char *tag)
Definition: pdffont.c:65
#define FONT_STYLE_NONE
Definition: pdffont.h:60
#define PDF_FONT_FLAG_BASEFONT
Definition: pdffont.h:43
#define FONT_STYLE_ITALIC
Definition: pdffont.h:62
#define is_used_char2(b, c)
Definition: pdffont.h:161
#define add_to_used_chars2(b, c)
Definition: pdffont.h:160
#define FONT_STYLE_BOLDITALIC
Definition: pdffont.h:63
#define PDF_FONT_FONTTYPE_CIDTYPE0
Definition: pdffont.h:36
#define FONT_STYLE_BOLD
Definition: pdffont.h:61
#define CIDFONT_FLAG_TYPE1C
Definition: pdffont.h:53
#define CIDFONT_FLAG_TYPE1
Definition: pdffont.h:52
pdf_obj * pdf_new_array(void)
Definition: pdfobj.c:1421
pdf_obj * pdf_new_name(const char *name)
Definition: pdfobj.c:1330
int pdf_check_version(int major, int minor)
Definition: pdfobj.c:416
pdf_obj * pdf_new_number(double value)
Definition: pdfobj.c:1076
pdf_obj * pdf_ref_obj(pdf_obj *object)
Definition: pdfobj.c:960
pdf_obj * pdf_new_stream(int flags)
Definition: pdfobj.c:1863
void pdf_release_obj(pdf_obj *object)
Definition: pdfobj.c:3217
pdf_obj * pdf_stream_dict(pdf_obj *stream)
Definition: pdfobj.c:2374
void pdf_add_stream(pdf_obj *stream, const void *stream_data, int length)
Definition: pdfobj.c:2424
pdf_obj * pdf_new_string(const void *str, unsigned length)
Definition: pdfobj.c:1131
void pdf_add_array(pdf_obj *array, pdf_obj *object)
Definition: pdfobj.c:1511
pdf_obj * pdf_new_dict(void)
Definition: pdfobj.c:1645
unsigned pdf_array_length(pdf_obj *array)
Definition: pdfobj.c:1479
int pdf_add_dict(pdf_obj *dict, pdf_obj *key, pdf_obj *value)
Definition: pdfobj.c:1680
#define STREAM_COMPRESS
Definition: pdfobj.h:45
int sfnt_read_table_directory(sfnt *sfont, SFNT_ULONG offset)
Definition: sfnt.c:356
void sfnt_close(sfnt *sfont)
Definition: sfnt.c:164
SFNT_ULONG sfnt_find_table_pos(sfnt *sfont, const char *tag)
Definition: sfnt.c:320
sfnt * sfnt_open(FILE *fp)
Definition: sfnt.c:52
SFNT_ULONG sfnt_locate_table(sfnt *sfont, const char *tag)
Definition: sfnt.c:340
#define SFNT_TYPE_POSTSCRIPT
Definition: sfnt.h:71
#define SFNT_TYPE_TTC
Definition: sfnt.h:72
unsigned short USHORT
Definition: sfnt.h:36
int t1char_convert_charstring(card8 *dst, int dstlen, card8 *src, int srclen, cff_index *subrs, double default_width, double nominal_width, t1_ginfo *ginfo)
Definition: t1_char.c:1548
int t1char_get_metrics(card8 *src, int srclen, cff_index *subrs, t1_ginfo *ginfo)
Definition: t1_char.c:1324
cff_font * t1_load_font(char **enc_vec, int mode, FILE *fp)
Definition: t1_load.c:1273
SFNT_ULONG ttc_read_offset(sfnt *sfont, SFNT_ULONG ttc_idx)
Definition: tt_aux.c:38
pdf_obj * tt_get_fontdesc(sfnt *sfont, int *embed, int stemv, int type, const char *fontname)
Definition: tt_aux.c:130
struct tt_head_table * tt_read_head_table(sfnt *sfont)
Definition: tt_table.c:77
struct tt_VORG_table * tt_read_VORG_table(sfnt *sfont)
Definition: tt_table.c:281
struct tt_maxp_table * tt_read_maxp_table(sfnt *sfont)
Definition: tt_table.c:133
struct tt_vhea_table * tt_read_vhea_table(sfnt *sfont)
Definition: tt_table.c:248
struct tt_longMetrics * tt_read_longMetrics(sfnt *sfont, USHORT numGlyphs, USHORT numLongMetrics, USHORT numExSideBearings)
Definition: tt_table.c:324
struct tt_hhea_table * tt_read_hhea_table(sfnt *sfont)
Definition: tt_table.c:185
struct tt_os2__table * tt_read_os2__table(sfnt *sfont)
Definition: tt_table.c:346
char * strstr()
#define cstring
Definition: cpascal.h:200
#define dest
#define sprintf
Definition: snprintf.c:44
def ref(x)
Definition: pdf-org.py:104
#define max(a, b)
Definition: pbmto4425.c:11
char * filename[256]
Definition: pbmtopk.c:46
unsigned long ULONG
Definition: pdfgen.h:158
struct const_name font_name[]
Definition: picttoppm.c:492
#define fp
const char * suffix
Definition: pkg_icu.cpp:27
#define ROUND(x)
Definition: pnmnlfilt.c:322
static int size
Definition: ppmlabel.c:24
static int offset
Definition: ppmtogif.c:642
bstring c int memset(void *s, int c, int length)
struct stream_s stream
Definition: pts_fax.h:93
#define flags
charset
Definition: charset.h:51
static int write_fontfile(pdf_font *font, cff_font *cffont)
Definition: cidtype0.c:334
static void add_CIDHMetrics(sfnt *sfont, pdf_obj *fontdict, unsigned char *CIDToGIDMap, unsigned short last_cid, struct tt_maxp_table *maxp, struct tt_head_table *head, struct tt_longMetrics *hmtx)
Definition: cidtype0.c:81
static void get_font_attr(pdf_font *font, cff_font *cffont)
Definition: cidtype0.c:1705
#define FONT_FLAG_FIXEDPITCH
Definition: cidtype0.c:1694
#define PDFUNIT(v)
Definition: cidtype0.c:77
#define FONT_FLAG_SYMBOLIC
Definition: cidtype0.c:1696
static int load_base_CMap(const char *font_name, int wmode, cff_font *cffont)
Definition: cidtype0.c:1452
#define WBUF_SIZE
#define FONT_FLAG_SERIF
Definition: cidtype0.c:1695
static void add_metrics(pdf_font *font, cff_font *cffont, unsigned char *CIDToGIDMap, double *widths, double default_width, CID last_cid)
Definition: cidtype0.c:1844
static pdf_obj * create_ToUnicode_stream(cff_font *cffont, const char *font_name, const char *used_glyphs)
Definition: cidtype0.c:1586
static void add_CIDVMetrics(sfnt *sfont, pdf_obj *fontdict, unsigned char *CIDToGIDMap, unsigned short last_cid, struct tt_maxp_table *maxp, struct tt_head_table *head, struct tt_longMetrics *hmtx)
Definition: cidtype0.c:153
#define FONT_FLAG_ITALIC
Definition: cidtype0.c:1699
#define FONT_FLAG_FORCEBOLD
Definition: cidtype0.c:1702
static void add_CIDMetrics(sfnt *sfont, pdf_obj *fontdict, unsigned char *CIDToGIDMap, unsigned short last_cid, int need_vmetrics)
Definition: cidtype0.c:296
static void CIDFont_type0_add_CIDSet(pdf_font *font, char *used_chars, card16 last_cid)
Definition: cidtype0.c:463
char * ordering
Definition: pdffont.h:67
char * registry
Definition: pdffont.h:66
int supplement
Definition: pdffont.h:68
int verbose_level
Definition: dpxconf.h:35
Definition: agl.h:31
int32_t unicodes[16]
Definition: agl.h:35
int n_components
Definition: agl.h:34
struct agl_name * alternate
Definition: agl.h:36
card16 num_entries
Definition: cff_types.h:112
card8 format
Definition: cff_types.h:129
card16 num_entries
Definition: cff_types.h:130
cff_range3 * ranges
Definition: cff_types.h:133
union cff_fdselect::@117 data
Definition: cff.h:46
card16 num_glyphs
Definition: cff.h:66
cff_charsets * charsets
Definition: cff.h:56
cff_dict ** private
Definition: cff.h:60
cff_dict * topdict
Definition: cff.h:52
card8 num_fds
Definition: cff.h:67
cff_index * cstrings
Definition: cff.h:58
cff_index * gsubr
Definition: cff.h:54
cff_index ** subrs
Definition: cff.h:61
cff_index * string
Definition: cff.h:53
cff_index * name
Definition: cff.h:51
cff_dict ** fdarray
Definition: cff.h:59
int flag
Definition: cff.h:79
cff_fdselect * fdselect
Definition: cff.h:57
card16 count
Definition: cff_types.h:50
l_offset * offset
Definition: cff_types.h:52
card8 * data
Definition: cff_types.h:53
card8 fd
Definition: cff_types.h:124
card16 first
Definition: cff_types.h:123
int stemv
Definition: pdffont.h:76
int embed
Definition: pdffont.h:75
int style
Definition: pdffont.h:74
Definition: pbmfont.h:11
char * filename
Definition: gf2pbm.c:114
char * fontname
Definition: gf2pbm.c:110
ubyte flags
Definition: gf2pbm.c:117
Definition: pbmfont.h:4
Definition: dvi.c:140
Definition: ttf.h:354
Definition: ttf.h:315
Definition: mendex.h:20
Definition: ttf.h:413
uint16 numGlyphs
Definition: ttf.h:415
Definition: ttf.h:443
Definition: pdfobj.c:63
Definition: psfont.h:67
Definition: sfnt.h:76
int type
Definition: sfnt.h:77
FILE * stream
Definition: sfnt.h:79
USHORT numOfLongHorMetrics
Definition: tt_table.h:64
USHORT numOfExSideBearings
Definition: tt_table.h:65
USHORT numOfLongVerMetrics
Definition: tt_table.h:83
USHORT numOfExSideBearings
Definition: tt_table.h:84
Definition: strexpr.c:21
Definition: ttf.h:548
short defaultVertOriginY
Definition: ttf.h:551
uint16 numVertOriginYMetrics
Definition: ttf.h:552
#define FILE
Definition: t1stdio.h:34
int j
Definition: t4ht.c:1589
*job_name strlen((char *) job_name) - 4)
val
Definition: tex4ht.c:3227
return() int(((double) *(font_tbl[cur_fnt].wtbl+(int)(*(font_tbl[cur_fnt].char_wi+(int)(ch - font_tbl[cur_fnt].char_f)% 256)))/(double)(1L<< 20)) *(double) font_tbl[cur_fnt].scale)
FILE * fontfile
Definition: ttf2afm.c:100
TT_CharMap cmap
Definition: ttf2pfb.c:163
TT_Glyph glyph
Definition: ttf2pfb.c:162
@ L
Definition: ubidiimp.h:45
@ start
Definition: preamble.c:52
int cidset
Definition: writefont.c:511