~ubuntu-branches/ubuntu/karmic/luatex/karmic

« back to all changes in this revision

Viewing changes to src/texk/web2c/luatexdir/font/writefont.c

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2008-04-15 07:50:17 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080415075017-syz15wlp1f2ep6lo
Tags: 0.25.2-1
* several new upstreams
* fix poppler patch for 0.4 (etch) to work with split out libpng patch
* fix poppler patch for 0.6
* fix README.Debian-source
* add copyright statement for src/libs/md5 (needed now)
* link the luatex reference manual into /usr/share/doc/texmf to make it
  available to texdoc (Closes: #473049)
* fix doc-base section of luatex-ref manual

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
along with pdfTeX; if not, write to the Free Software
18
18
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
19
 
20
 
$Id: writefont.c,v 1.3 2005/12/27 19:04:42 hahe Exp $
 
20
$Id: writefont.c 1139 2008-04-09 14:44:20Z taco $
21
21
*/
22
22
 
23
23
#include "ptexlib.h"
121
121
    int i;
122
122
    fd->font_dim[ITALIC_ANGLE_CODE].val =
123
123
        divide_scaled(-atan(get_slant(f) / 65536.0) * (180 / M_PI),
124
 
                     pdf_font_size[f], 3);
 
124
                                          pdf_font_size(f), 3);
125
125
    fd->font_dim[ASCENT_CODE].val =
126
 
        divide_scaled(char_height(f, 'h'), pdf_font_size[f], 3);
 
126
          divide_scaled(char_height(f, 'h'), pdf_font_size(f), 3);
127
127
    fd->font_dim[CAPHEIGHT_CODE].val =
128
 
        divide_scaled(char_height(f, 'H'), pdf_font_size[f], 3);
129
 
    i = -divide_scaled(char_depth(f, 'y'), pdf_font_size[f], 3);
 
128
          divide_scaled(char_height(f, 'H'), pdf_font_size(f), 3);
 
129
    i = -divide_scaled(char_depth(f, 'y'), pdf_font_size(f), 3);
130
130
    fd->font_dim[DESCENT_CODE].val = i < 0 ? i : 0;
131
131
    fd->font_dim[STEMV_CODE].val =
132
 
        divide_scaled(char_width(f, '.') / 3, pdf_font_size[f], 3);
 
132
          divide_scaled(char_width(f, '.') / 3, pdf_font_size(f), 3);
133
133
    fd->font_dim[XHEIGHT_CODE].val =
134
 
        divide_scaled(get_x_height(f), pdf_font_size[f], 3);
 
134
          divide_scaled(get_x_height(f), pdf_font_size(f), 3);
135
135
    fd->font_dim[FONTBBOX1_CODE].val = 0;
136
136
    fd->font_dim[FONTBBOX2_CODE].val = fd->font_dim[DESCENT_CODE].val;
137
137
    fd->font_dim[FONTBBOX3_CODE].val =
138
 
        divide_scaled(get_quad(f), pdf_font_size[f], 3);
 
138
          divide_scaled(get_quad(f), pdf_font_size(f), 3);
139
139
    fd->font_dim[FONTBBOX4_CODE].val =
140
140
        fd->font_dim[CAPHEIGHT_CODE].val > fd->font_dim[ASCENT_CODE].val ?
141
141
        fd->font_dim[CAPHEIGHT_CODE].val : fd->font_dim[ASCENT_CODE].val;
335
335
            j++;
336
336
        }
337
337
        j = i;
338
 
        width = divide_scaled(char_width(f, i), pdf_font_size[f], 4);
 
338
        width = divide_scaled(char_width(f, i), pdf_font_size(f), 4);
339
339
        pdf_printf("%i", (int) width / 10);     /* see adv_char_width() in pdftex.web */
340
340
        if ((width = width % 10) != 0)
341
341
            pdf_printf(".%i", width);
517
517
{
518
518
    assert(fo != NULL);
519
519
    assert(fo->fm != NULL);
520
 
    assert(fo->fo_objnum != 0); /* reserved as pdf_font_num[f] in pdftex.web */
 
520
    assert(fo->fo_objnum != 0); /* reserved as pdf_font_num(f) in pdftex.web */
521
521
 
522
522
    /* write ToUnicode entry if needed */
523
523
    if (fixed_gen_tounicode > 0 && fo->fd != NULL) {
557
557
        pdf_printf("/Encoding %i 0 R\n", (int) fo->fe->fe_objnum);
558
558
    if (fo->tounicode_objnum != 0)
559
559
        pdf_printf("/ToUnicode %i 0 R\n", (int) fo->tounicode_objnum);
560
 
    if (pdf_font_attr[fo->tex_font] != get_nullstr()) {
561
 
        pdf_print(pdf_font_attr[fo->tex_font]);
 
560
    if (pdf_font_attr(fo->tex_font) != get_nullstr()) {
 
561
            pdf_print(pdf_font_attr(fo->tex_font));
562
562
        pdf_puts("\n");
563
563
    }
564
564
    pdf_end_dict();
596
596
{
597
597
    fo_entry *fo = new_fo_entry();
598
598
    get_char_range(fo, f);      /* set fo->first_char and fo->last_char from f */
 
599
    if (fo->last_char>255) fo->last_char=255; /* added 9-4-2008, mantis #25 */
599
600
    assert(fo->last_char >= fo->first_char);
600
601
    fo->fm = fm;
601
602
    fo->fo_objnum = font_objnum;
664
665
      /* Create a virtual font map entry, as this is needed by the
665
666
           * rest of the font inclusion mechanism.
666
667
       */
667
 
      /* TODO: take slant and extend from the texfont struct */
668
668
      fm = new_fm_entry();
669
669
      fm->tfm_name = font_name(f);          /* or whatever, not a real tfm */
670
670
      fm->ff_name = font_filename(f);       /* the actual file */
671
671
      fm->encname = font_encodingname(f);   /* for the CIDSystemInfo */
672
672
      fm->ps_name = font_fullname(f);       /* the true name */
 
673
      fm->slant = font_slant(f);            /* slant factor */
 
674
      fm->extend = font_extend(f);          /* extension factor */
673
675
      fm->fd_flags = 4;                     /* can perhaps be done better */
674
676
      fm->in_use = true;
675
677
 
748
750
  glw_entry *j;
749
751
  void *aa;
750
752
  for (k = 1; k <= max_font_id(); k++) {
751
 
    if ( k == f || -f == pdf_font_num[k]) { 
 
753
    if ( k == f || -f == pdf_font_num(k)) { 
752
754
      for (i = font_bc(k); i <= font_ec(k); i++) {
753
755
                if (char_exists(k,i) && char_used(k,i)) {
754
756
                  j = xtalloc(1,glw_entry);
755
757
                  j->id = char_index(k,i);
756
 
                  j->wd = divide_scaled_n(char_width(k, i), pdf_font_size[k], 10000.0);
 
758
                  j->wd = divide_scaled_n(char_width(k, i), pdf_font_size(k), 10000.0);
757
759
                  if ((glw_entry *)avl_find(fo->fd->gl_tree,j) == NULL) {
758
760
                        aa = avl_probe(fo->fd->gl_tree, j);
759
761
                        assert(aa != NULL);
873
875
 
874
876
    /* I doubt there is anything useful that could be written here */
875
877
    /*      
876
 
      if (pdf_font_attr[fo->tex_font] != get_nullstr()) {
877
 
      pdf_print(pdf_font_attr[fo->tex_font]);
 
878
      if (pdf_font_attr(fo->tex_font) != get_nullstr()) {
 
879
      pdf_print(pdf_font_attr(fo->tex_font));
878
880
      pdf_puts("\n");
879
881
      }
880
882
    */