18
18
You should have received a copy of the GNU General Public License along
19
19
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
21
static const char _svn_version[] =
22
"$Id: writefont.c 3285 2009-12-23 19:37:18Z hhenkel $ "
23
"$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/writefont.c $";
21
25
#include "ptexlib.h"
22
26
#include "luatexfont.h"
24
static const char _svn_version[] =
25
"$Id: writefont.c 2331 2009-04-18 16:39:50Z hhenkel $ "
26
"$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.6/source/texk/web2c/luatexdir/font/writefont.c $";
28
void write_cid_fontdictionary(fo_entry * fo, internalfontnumber f);
29
void create_cid_fontdictionary(fm_entry * fm, integer font_objnum,
28
void write_cid_fontdictionary(PDF pdf, fo_entry * fo, internalfontnumber f);
29
void create_cid_fontdictionary(PDF pdf,
30
fm_entry * fm, int font_objnum,
30
31
internalfontnumber f);
32
33
const key_entry font_key[FONT_KEYS_NUM] = {
186
static void write_fontmetrics(fd_entry * fd)
180
static void write_fontmetrics(PDF pdf, fd_entry * fd)
189
183
fix_fontmetrics(fd);
190
pdf_printf("/%s [%i %i %i %i]\n", font_key[FONTBBOX1_CODE].pdfname,
184
pdf_printf(pdf, "/%s [%i %i %i %i]\n", font_key[FONTBBOX1_CODE].pdfname,
191
185
(int) fd->font_dim[FONTBBOX1_CODE].val,
192
186
(int) fd->font_dim[FONTBBOX2_CODE].val,
193
187
(int) fd->font_dim[FONTBBOX3_CODE].val,
194
188
(int) fd->font_dim[FONTBBOX4_CODE].val);
195
189
for (i = 0; i < GEN_KEY_NUM; i++)
196
190
if (fd->font_dim[i].set)
197
pdf_printf("/%s %i\n", font_key[i].pdfname, fd->font_dim[i].val);
191
pdf_printf(pdf, "/%s %i\n", font_key[i].pdfname,
192
fd->font_dim[i].val);
200
195
/**********************************************************************/
202
static void preset_fontname(fo_entry * fo)
197
static void preset_fontname(fo_entry * fo, internalfontnumber f)
204
199
if (fo->fm->ps_name != NULL)
205
200
fo->fd->fontname = xstrdup(fo->fm->ps_name); /* just fallback */
201
else if (font_fullname(f) != NULL)
202
fo->fd->fontname = xstrdup(font_fullname(f));
207
204
fo->fd->fontname = xstrdup(fo->fm->tfm_name);
210
static void write_fontname(fd_entry * fd, char *key)
207
static void write_fontname(PDF pdf, fd_entry * fd, char *key)
212
209
assert(fd->fontname != NULL);
215
pdf_printf("%s /", key);
212
pdf_printf(pdf, "%s /", key);
216
213
if (fd->subset_tag != NULL)
217
pdf_printf("%s+", fd->subset_tag);
218
pdf_printf("%s\n", fd->fontname);
214
pdf_printf(pdf, "%s+", fd->subset_tag);
215
pdf_printf(pdf, "%s\n", fd->fontname);
221
static void write_fontname_object(fd_entry * fd)
218
static void write_fontname_object(PDF pdf, fd_entry * fd)
223
220
assert(fd->fn_objnum != 0);
224
pdf_begin_obj(fd->fn_objnum, 1);
225
write_fontname(fd, NULL);
221
pdf_begin_obj(pdf, fd->fn_objnum, 1);
222
write_fontname(pdf, fd, NULL);
229
226
/**********************************************************************/
231
fd_entry *lookup_fd_entry(char *s, integer slant, integer extend)
228
fd_entry *lookup_fd_entry(char *s)
235
232
assert(s != NULL);
240
235
if (fd_tree == NULL) {
241
236
fd_tree = avl_create(comp_fd_entry, NULL, &avl_xallocator);
390
static void write_charwidth_array(fo_entry * fo, internalfontnumber f)
367
static void write_charwidth_array(PDF pdf, fo_entry * fo, internalfontnumber f)
392
369
int i, j, *ip, *fip;
393
370
struct avl_traverser t;
394
371
assert(fo->tx_tree != NULL);
395
372
assert(fo->cw_objnum == 0);
396
fo->cw_objnum = pdf_new_objnum();
397
pdf_begin_obj(fo->cw_objnum, 1);
373
fo->cw_objnum = pdf_new_objnum(pdf);
374
pdf_begin_obj(pdf, fo->cw_objnum, 1);
398
375
avl_t_init(&t, fo->tx_tree);
399
376
fip = (int *) avl_t_first(&t, fo->tx_tree);
400
377
assert(fip != NULL);
402
379
for (ip = fip, j = *ip; ip != NULL; ip = (int *) avl_t_next(&t)) {
406
383
while (j < i - 1) {
411
pdf_print_charwidth(f, i);
388
pdf_print_charwidth(pdf, f, i);
390
pdf_puts(pdf, "]\n");
417
394
/**********************************************************************/
452
429
/**********************************************************************/
454
static void write_fontfile(fd_entry * fd)
431
static void write_fontfile(PDF pdf, fd_entry * fd)
456
433
assert(is_included(fd->fm));
457
434
if (is_cidkeyed(fd->fm)) {
458
435
if (is_opentype(fd->fm))
460
437
else if (is_truetype(fd->fm))
462
439
else if (is_type1(fd->fm))
440
writetype1w(pdf, fd);
467
444
if (is_type1(fd->fm))
469
446
else if (is_truetype(fd->fm))
471
448
else if (is_opentype(fd->fm))
476
453
if (!fd->ff_found)
478
455
assert(fd->ff_objnum == 0);
479
fd->ff_objnum = pdf_new_objnum();
480
pdf_begin_dict(fd->ff_objnum, 0); /* font file stream */
456
fd->ff_objnum = pdf_new_objnum(pdf);
457
pdf_begin_dict(pdf, fd->ff_objnum, 0); /* font file stream */
481
458
if (is_cidkeyed(fd->fm)) {
482
459
/* No subtype is used for TrueType-based OpenType fonts */
483
460
if (is_opentype(fd->fm) || is_type1(fd->fm))
484
pdf_puts("/Subtype /CIDFontType0C\n");
461
pdf_puts(pdf, "/Subtype /CIDFontType0C\n");
486
pdf_puts("/Subtype /OpenType\n"); */
463
pdf_puts(pdf,"/Subtype /OpenType\n"); */
488
465
if (is_type1(fd->fm))
489
pdf_printf("/Length1 %i\n/Length2 %i\n/Length3 %i\n",
466
pdf_printf(pdf, "/Length1 %i\n/Length2 %i\n/Length3 %i\n",
490
467
(int) t1_length1, (int) t1_length2, (int) t1_length3);
491
468
else if (is_truetype(fd->fm))
492
pdf_printf("/Length1 %i\n", (int) ttf_length);
469
pdf_printf(pdf, "/Length1 %i\n", (int) ttf_length);
493
470
else if (is_opentype(fd->fm))
494
pdf_puts("/Subtype /Type1C\n");
471
pdf_puts(pdf, "/Subtype /Type1C\n");
475
pdf_begin_stream(pdf);
503
480
/**********************************************************************/
505
static void write_fontdescriptor(fd_entry * fd)
482
static void write_fontdescriptor(PDF pdf, fd_entry * fd)
507
484
static const int std_flags[] = {
508
/* indices for << start with 0, but bits start with 1, so the numbers
485
/* indices for << start with 0, but bits start with 1, so the numbers
509
486
* for << are 1 lower than the bits in table 5.20 */
510
487
/* *INDENT-OFF* */
511
488
1 + 2 + (1 << 5), /* Courier */
530
507
assert(fd != NULL && fd->fm != NULL);
532
if (is_fontfile(fd->fm))
533
write_fontfile(fd); /* this will set fd->ff_found if font file is found */
509
if (is_fontfile(fd->fm) && is_included(fd->fm))
510
write_fontfile(pdf, fd); /* this will set fd->ff_found if font file is found */
534
511
if (fd->fn_objnum != 0)
535
write_fontname_object(fd);
512
write_fontname_object(pdf, fd);
536
513
if (fd->fd_objnum == 0)
537
fd->fd_objnum = pdf_new_objnum();
538
pdf_begin_dict(fd->fd_objnum, 1);
539
pdf_puts("/Type /FontDescriptor\n");
540
write_fontname(fd, "FontName");
514
fd->fd_objnum = pdf_new_objnum(pdf);
515
pdf_begin_dict(pdf, fd->fd_objnum, 1);
516
pdf_puts(pdf, "/Type /FontDescriptor\n");
517
write_fontname(pdf, fd, "FontName");
541
518
if (fd->fm->fd_flags != FD_FLAGS_NOT_SET_IN_MAPLINE)
542
519
fd_flags = (int) fd->fm->fd_flags;
543
520
else if (fd->ff_found)
552
529
fd->fm->ps_name != NULL ? fd->fm->ps_name : "No name given",
553
530
fd->fm->tfm_name, fd_flags);
555
pdf_printf("/Flags %i\n", fd_flags);
556
write_fontmetrics(fd);
532
pdf_printf(pdf, "/Flags %i\n", fd_flags);
533
write_fontmetrics(pdf, fd);
557
534
if (is_cidkeyed(fd->fm)) {
558
535
if (is_type1(fd->fm))
559
pdf_printf("/FontFile3 %i 0 R\n", (int) fd->ff_objnum);
536
pdf_printf(pdf, "/FontFile3 %i 0 R\n", (int) fd->ff_objnum);
560
537
else if (is_truetype(fd->fm))
561
pdf_printf("/FontFile2 %i 0 R\n", (int) fd->ff_objnum);
538
pdf_printf(pdf, "/FontFile2 %i 0 R\n", (int) fd->ff_objnum);
562
539
else if (is_opentype(fd->fm))
563
pdf_printf("/FontFile3 %i 0 R\n", (int) fd->ff_objnum);
540
pdf_printf(pdf, "/FontFile3 %i 0 R\n", (int) fd->ff_objnum);
569
546
/* /CharSet is optional; names may appear in any order */
570
547
assert(fd->gl_tree != NULL);
571
548
avl_t_init(&t, fd->gl_tree);
572
pdf_puts("/CharSet (");
549
pdf_puts(pdf, "/CharSet (");
573
550
for (glyph = (char *) avl_t_first(&t, fd->gl_tree);
574
551
glyph != NULL; glyph = (char *) avl_t_next(&t))
575
pdf_printf("/%s", glyph);
552
pdf_printf(pdf, "/%s", glyph);
553
pdf_puts(pdf, ")\n");
578
555
if (is_type1(fd->fm))
579
pdf_printf("/FontFile %i 0 R\n", (int) fd->ff_objnum);
556
pdf_printf(pdf, "/FontFile %i 0 R\n", (int) fd->ff_objnum);
580
557
else if (is_truetype(fd->fm))
581
pdf_printf("/FontFile2 %i 0 R\n", (int) fd->ff_objnum);
558
pdf_printf(pdf, "/FontFile2 %i 0 R\n", (int) fd->ff_objnum);
582
559
else if (is_opentype(fd->fm))
583
pdf_printf("/FontFile3 %i 0 R\n", (int) fd->ff_objnum);
560
pdf_printf(pdf, "/FontFile3 %i 0 R\n", (int) fd->ff_objnum);
588
/* TODO: Optional keys for CID fonts.
565
/* TODO: Optional keys for CID fonts.
590
567
The most interesting ones are
591
568
/Style << /Panose <12-byte string>>>
606
583
avl_t_init(&t, fd_tree);
607
584
for (fd = (fd_entry *) avl_t_first(&t, fd_tree); fd != NULL;
608
585
fd = (fd_entry *) avl_t_next(&t))
609
write_fontdescriptor(fd);
586
write_fontdescriptor(pdf, fd);
612
589
/**********************************************************************/
614
void write_fontdictionary(fo_entry * fo)
591
void write_fontdictionary(PDF pdf, fo_entry * fo)
616
593
assert(fo != NULL);
617
594
assert(fo->fm != NULL);
618
595
assert(fo->fo_objnum != 0); /* reserved as pdf_font_num(f) in pdftex.web */
620
597
/* write ToUnicode entry if needed */
621
if (fixed_gen_tounicode > 0 && fo->fd != NULL) {
598
if (pdf->gen_tounicode > 0 && fo->fd != NULL) {
622
599
if (fo->fe != NULL) {
623
600
fo->tounicode_objnum =
624
write_tounicode(fo->fe->glyph_names, fo->fe->name);
601
write_tounicode(pdf, fo->fe->glyph_names, fo->fe->name);
625
602
} else if (is_type1(fo->fm)) {
626
603
assert(fo->fd->builtin_glyph_names != NULL);
627
604
fo->tounicode_objnum =
628
write_tounicode(fo->fd->builtin_glyph_names, fo->fm->tfm_name);
605
write_tounicode(pdf, fo->fd->builtin_glyph_names,
632
pdf_begin_dict(fo->fo_objnum, 1);
633
pdf_puts("/Type /Font\n");
634
pdf_puts("/Subtype /");
609
pdf_begin_dict(pdf, fo->fo_objnum, 1);
610
pdf_puts(pdf, "/Type /Font\n");
611
pdf_puts(pdf, "/Subtype /");
635
612
if (is_type1(fo->fm))
636
pdf_printf("%s\n", "Type1");
613
pdf_printf(pdf, "%s\n", "Type1");
637
614
else if (is_truetype(fo->fm))
638
pdf_printf("%s\n", "TrueType");
615
pdf_printf(pdf, "%s\n", "TrueType");
639
616
else if (is_opentype(fo->fm))
640
pdf_printf("%s\n", "Type1");
617
pdf_printf(pdf, "%s\n", "Type1");
643
620
assert(fo->fd != NULL && fo->fd->fd_objnum != 0);
644
write_fontname(fo->fd, "BaseFont");
645
pdf_printf("/FontDescriptor %i 0 R\n", (int) fo->fd->fd_objnum);
621
write_fontname(pdf, fo->fd, "BaseFont");
622
pdf_printf(pdf, "/FontDescriptor %i 0 R\n", (int) fo->fd->fd_objnum);
646
623
assert(fo->cw_objnum != 0);
647
pdf_printf("/FirstChar %i\n/LastChar %i\n/Widths %i 0 R\n",
624
pdf_printf(pdf, "/FirstChar %i\n/LastChar %i\n/Widths %i 0 R\n",
648
625
(int) fo->first_char, (int) fo->last_char, (int) fo->cw_objnum);
649
626
if ((is_type1(fo->fm) || is_opentype(fo->fm)) && fo->fe != NULL
650
627
&& fo->fe->fe_objnum != 0)
651
pdf_printf("/Encoding %i 0 R\n", (int) fo->fe->fe_objnum);
628
pdf_printf(pdf, "/Encoding %i 0 R\n", (int) fo->fe->fe_objnum);
652
629
if (fo->tounicode_objnum != 0)
653
pdf_printf("/ToUnicode %i 0 R\n", (int) fo->tounicode_objnum);
654
if (pdf_font_attr(fo->tex_font) != get_nullstr()) {
655
pdf_print(pdf_font_attr(fo->tex_font));
630
pdf_printf(pdf, "/ToUnicode %i 0 R\n", (int) fo->tounicode_objnum);
631
if (pdf_font_attr(fo->tex_font) != get_nullstr() &&
632
pdf_font_attr(fo->tex_font) != 0) {
633
pdf_print(pdf, pdf_font_attr(fo->tex_font));
661
void write_fontdictionaries()
639
void write_fontdictionaries(PDF pdf)
664
642
struct avl_traverser t;
700
678
fo->fe = get_fe_entry(fo->fm->encname); /* returns NULL if .enc file couldn't be opened */
701
679
if (fo->fe != NULL && (is_type1(fo->fm) || is_opentype(fo->fm))) {
702
680
if (fo->fe->fe_objnum == 0)
703
fo->fe->fe_objnum = pdf_new_objnum(); /* then it will be written out */
681
fo->fe->fe_objnum = pdf_new_objnum(pdf); /* then it will be written out */
704
682
/* mark encoding pairs used by TeX to optimize encoding vector */
705
683
fo->fe->tx_tree = mark_chars(fo, fo->fe->tx_tree, f);
708
686
fo->tx_tree = mark_chars(fo, fo->tx_tree, f); /* for write_charwidth_array() */
709
write_charwidth_array(fo, f);
687
write_charwidth_array(pdf, fo, f);
710
688
if (!is_builtin(fo->fm)) {
711
689
if (is_type1(fo->fm)) {
712
690
if ((fo->fd = lookup_fontdescriptor(fo)) == NULL) {
728
706
/* mark non-reencoded characters as chars on TeX level */
729
707
fo->fd->tx_tree = mark_chars(fo, fo->fd->tx_tree, f);
730
708
if (!is_type1(fo->fm))
731
write_fontdescriptor(fo->fd);
709
write_fontdescriptor(pdf, fo->fd);
733
711
/* builtin fonts still need the /Widths array and /FontDescriptor
734
712
* (to avoid error 'font FOO contains bad /BBox')
736
714
create_fontdescriptor(fo, f);
737
write_fontdescriptor(fo->fd);
715
write_fontdescriptor(pdf, fo->fd);
738
716
if (!is_std_t1font(fo->fm))
739
717
pdftex_warn("font `%s' is not a standard font; "
740
718
"I suppose it is available to your PDF viewer then",
781
764
fm = new_fm_entry();
782
765
fm->tfm_name = font_name(f); /* or whatever, not a real tfm */
783
766
fm->ff_name = font_filename(f); /* the actual file */
767
if (font_psname(f) != NULL)
768
fm->ps_name = font_psname(f); /* the true name */
770
fm->ps_name = font_fullname(f); /* the true name */
772
&& strlen(fm->ff_name) >= 6
773
&& strstr(fm->ff_name,
774
".dfont") == (fm->ff_name + strlen(fm->ff_name) - 6)) {
775
/* In case of a .dfont, we will extract the correct ttf here,
776
and adjust fm->ff_name to point to the temporary file.
777
This file will be deleted later. Todo: keep a nicer name
778
somewhere for the terminal message.
780
char *s = FindResourceTtfFont(fm->ff_name, fm->ps_name);
786
("writefont.c: The file (%s) does not contain font `%s'",
787
fm->ff_name, fm->ps_name);
784
790
fm->encname = font_encodingname(f); /* for the CIDSystemInfo */
785
fm->ps_name = font_fullname(f); /* the true name */
786
791
fm->slant = font_slant(f); /* slant factor */
787
793
fm->extend = font_extend(f); /* extension factor */
788
795
fm->fd_flags = 4; /* can perhaps be done better */
791
798
switch (font_format(f)) {
792
799
case opentype_format:
817
824
set_cidkeyed(fm);
818
create_cid_fontdictionary(fm, font_objnum, f);
825
create_cid_fontdictionary(pdf, fm, font_objnum, f);
821
831
fm = hasfmentry(f) ? (fm_entry *) font_map(f) : NULL;
822
832
if (fm == NULL || (fm->ps_name == NULL && fm->ff_name == NULL))
823
writet3(font_objnum, f);
833
writet3(pdf, font_objnum, f);
825
create_fontdictionary(fm, font_objnum, f);
835
create_fontdictionary(pdf, fm, font_objnum, f);
829
839
/**********************************************************************/
833
843
The glyph width is included in |glw_entry|, because that width
834
844
depends on the value it has in the font where it is actually
835
845
typeset from, not the font that is the 'owner' of the fd entry.
911
static void write_cid_charwidth_array(fo_entry * fo)
921
static void write_cid_charwidth_array(PDF pdf, fo_entry * fo)
914
924
glw_entry *glyph;
915
925
struct avl_traverser t;
917
927
assert(fo->cw_objnum == 0);
918
fo->cw_objnum = pdf_new_objnum();
919
pdf_begin_obj(fo->cw_objnum, 1);
928
fo->cw_objnum = pdf_new_objnum(pdf);
929
pdf_begin_obj(pdf, fo->cw_objnum, 1);
920
930
avl_t_init(&t, fo->fd->gl_tree);
921
931
glyph = (glw_entry *) avl_t_first(&t, fo->fd->gl_tree);
922
932
assert(glyph != NULL);
924
pdf_printf("[ %i [", i);
934
pdf_printf(pdf, "[ %i [", i);
925
935
for (; glyph != NULL; glyph = (glw_entry *) avl_t_next(&t)) {
927
937
if (glyph->id > (unsigned) (i + 1)) {
928
pdf_printf("] %i [", glyph->id);
938
pdf_printf(pdf, "] %i [", glyph->id);
931
941
if (glyph->id == (unsigned) (i + 1))
939
949
/* pdf_print_charwidth(f, i); */
941
pdf_printf("%i", (j / 10));
951
pdf_printf(pdf, "%i", (j / 10));
942
952
if ((j % 10) != 0)
943
pdf_printf(".%i", (j % 10));
953
pdf_printf(pdf, ".%i", (j % 10));
957
pdf_puts(pdf, "]]\n");
952
void create_cid_fontdictionary(fm_entry * fm, integer font_objnum,
962
void create_cid_fontdictionary(PDF pdf,
963
fm_entry * fm, int font_objnum,
953
964
internalfontnumber f)
955
966
fo_entry *fo = new_fo_entry();
961
972
create_cid_fontdescriptor(fo, f);
962
973
mark_cid_subset_glyphs(fo, f);
963
974
if (is_subsetted(fo->fm)) {
965
976
this is a bit sneaky. |make_subset_tag()| actually expects the glyph tree
966
977
to contain strings instead of |glw_entry| items. However, all calculations
967
978
are done using explicit typecasts, so it works out ok.
969
980
make_subset_tag(fo->fd);
971
write_cid_charwidth_array(fo);
972
write_fontdescriptor(fo->fd);
982
write_cid_charwidth_array(pdf, fo);
983
write_fontdescriptor(pdf, fo->fd);
974
write_cid_fontdictionary(fo, f);
985
write_cid_fontdictionary(pdf, fo, f);
978
void write_cid_fontdictionary(fo_entry * fo, internalfontnumber f)
989
void write_cid_fontdictionary(PDF pdf, fo_entry * fo, internalfontnumber f)
982
fo->tounicode_objnum = write_cid_tounicode(fo, f);
993
fo->tounicode_objnum = write_cid_tounicode(pdf, fo, f);
984
pdf_begin_dict(fo->fo_objnum, 1);
985
pdf_puts("/Type /Font\n");
986
pdf_puts("/Subtype /Type0\n");
987
pdf_puts("/Encoding /Identity-H\n");
988
write_fontname(fo->fd, "BaseFont");
989
i = pdf_new_objnum();
990
pdf_printf("/DescendantFonts [%i 0 R]\n", i);
995
pdf_begin_dict(pdf, fo->fo_objnum, 1);
996
pdf_puts(pdf, "/Type /Font\n");
997
pdf_puts(pdf, "/Subtype /Type0\n");
998
pdf_puts(pdf, "/Encoding /Identity-H\n");
999
write_fontname(pdf, fo->fd, "BaseFont");
1000
i = pdf_new_objnum(pdf);
1001
pdf_printf(pdf, "/DescendantFonts [%i 0 R]\n", i);
991
1002
/* todo: the ToUnicode CMap */
992
1003
if (fo->tounicode_objnum != 0)
993
pdf_printf("/ToUnicode %i 0 R\n", (int) fo->tounicode_objnum);
997
pdf_begin_dict(i, 1);
998
pdf_puts("/Type /Font\n");
1004
pdf_printf(pdf, "/ToUnicode %i 0 R\n", (int) fo->tounicode_objnum);
1008
pdf_begin_dict(pdf, i, 1);
1009
pdf_puts(pdf, "/Type /Font\n");
999
1010
if (is_opentype(fo->fm) || is_type1(fo->fm)) {
1000
pdf_puts("/Subtype /CIDFontType0\n");
1011
pdf_puts(pdf, "/Subtype /CIDFontType0\n");
1002
pdf_puts("/Subtype /CIDFontType2\n");
1003
pdf_printf("/CIDToGIDMap /Identity\n");
1013
pdf_puts(pdf, "/Subtype /CIDFontType2\n");
1014
pdf_printf(pdf, "/CIDToGIDMap /Identity\n");
1005
write_fontname(fo->fd, "BaseFont");
1006
pdf_printf("/FontDescriptor %i 0 R\n", (int) fo->fd->fd_objnum);
1007
pdf_printf("/W %i 0 R\n", (int) fo->cw_objnum);
1008
pdf_printf("/CIDSystemInfo <<\n");
1009
pdf_printf("/Registry (%s)\n",
1016
write_fontname(pdf, fo->fd, "BaseFont");
1017
pdf_printf(pdf, "/FontDescriptor %i 0 R\n", (int) fo->fd->fd_objnum);
1018
pdf_printf(pdf, "/W %i 0 R\n", (int) fo->cw_objnum);
1019
pdf_printf(pdf, "/CIDSystemInfo <<\n");
1020
pdf_printf(pdf, "/Registry (%s)\n",
1010
1021
(font_cidregistry(f) ? font_cidregistry(f) : "Adobe"));
1011
pdf_printf("/Ordering (%s)\n",
1022
pdf_printf(pdf, "/Ordering (%s)\n",
1012
1023
(font_cidordering(f) ? font_cidordering(f) : "Identity"));
1013
pdf_printf("/Supplement %u\n", (unsigned int) font_cidsupplement(f));
1024
pdf_printf(pdf, "/Supplement %u\n", (unsigned int) font_cidsupplement(f));
1025
pdf_printf(pdf, ">>\n");
1016
1027
/* I doubt there is anything useful that could be written here */
1018
1029
if (pdf_font_attr(fo->tex_font) != get_nullstr()) {
1019
1030
pdf_print(pdf_font_attr(fo->tex_font));