~ubuntu-branches/debian/squeeze/ghostscript/squeeze

« back to all changes in this revision

Viewing changes to src/gdevpdtf.c

  • Committer: Bazaar Package Importer
  • Author(s): Masayuki Hatta (mhatta)
  • Date: 2009-01-04 12:09:59 UTC
  • mfrom: (16.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090104120959-m9lbagj775ucg0h3
Tags: 8.63.dfsg.1-2
libgs-dev: put versioned dependency on libgs8 - closes: #510691

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
12
12
*/
13
13
 
14
 
/* $Id: gdevpdtf.c 8474 2008-01-02 13:10:59Z ken $ */
 
14
/* $Id: gdevpdtf.c 8603 2008-03-20 10:20:17Z ken $ */
15
15
/* Font and CMap resource implementation for pdfwrite text */
16
16
#include "memory_.h"
17
17
#include "string_.h"
662
662
    int index = pdf_find_standard_font_name(chars, size);
663
663
    bool embed_as_standard_called = false;
664
664
    bool do_embed_as_standard = false; /* Quiet compiler. */
665
 
 
 
665
    int code;
 
666
    gs_font_info_t info;
 
667
 
 
668
    memset(&info, 0x00, sizeof(gs_font_info_t));
 
669
    code = font->procs.font_info(font, NULL, FONT_INFO_EMBEDDING_RIGHTS, &info);
 
670
    if (code == 0 && (info.members & FONT_INFO_EMBEDDING_RIGHTS)) {
 
671
        if ((info.EmbeddingRights == 0x0002) || (info.EmbeddingRights & 0x0200)) {
 
672
            /* See the OpenType specification, "The 'OS/2' and Windows Metrics Table" for details
 
673
               of the fstype parameter. This is a bitfield, currently we forbid embedding of fonts
 
674
               with these bits set:
 
675
               bit 1    0x0002  Fonts that have only this bit set must not be modified, embedded or
 
676
                                exchanged in any manner.
 
677
               bit 9    0x0200  Bitmap embedding only.
 
678
 
 
679
               Note for Restricted License embedding (bit 1), this must be the only level of embedding 
 
680
               selected (see the OpenType spec).
 
681
             */
 
682
            char name[gs_font_name_max + 1];
 
683
            int len;
 
684
 
 
685
            len = min(gs_font_name_max, font->font_name.size);
 
686
            memcpy(name, font->font_name.chars, len);
 
687
            name[len] = 0;
 
688
            eprintf1("\nWarning: %s cannot be embedded because of licensing restrictions\n", name);
 
689
            return FONT_EMBED_NO;
 
690
        }
 
691
    }
666
692
    /*
667
693
     * The behavior of Acrobat Distiller changed between 3.0 (PDF 1.2),
668
694
     * which will never embed the base 14 fonts, and 4.0 (PDF 1.3), which