~ubuntu-branches/ubuntu/intrepid/luatex/intrepid

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2007-12-10 10:24:34 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20071210102434-9w9ljypghznwb4dy
Tags: 0.20.1-1
* new upstreams, add the announcements with changes to the debian dir
* call build.sh.linux with bash, not with sh, otherwise building breaks
  (thanks to Pascal de Bruijn <pmjdebruijn@gmail.com> from Ubuntu for
  letting us know) [np]
* update libpoppler patch
* change the texdoclua patch to use the new os.tmpdir with a template of
  /tmp/luatex.XXXXXX
* bump standards version to 3.7.3, no changes necessary
* convert copyright file to utf-8

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
  ci = xcalloc(1,sizeof(charinfo));
118
118
  set_charinfo_name(ci,xstrdup(".notdef"));
119
119
  font_tables[id]->charinfo = ci;
 
120
  font_tables[id]->charinfo_cache = NULL;
120
121
  return id;
121
122
}
122
123
 
232
233
  return co;
233
234
}
234
235
 
 
236
#if 0
 
237
int 
 
238
find_charinfo_id (internal_font_number f, integer c) {
 
239
  register int g=0;
 
240
  if (font_tables[f]->charinfo_cache==NULL) {
 
241
    int i  = (font_ec(f)+1)*sizeof(int);
 
242
    font_tables[f]->charinfo_cache = xmalloc(i);
 
243
    memset(font_tables[f]->charinfo_cache,0,i);
 
244
  } else {
 
245
    g = font_tables[f]->charinfo_cache[c];
 
246
  }
 
247
  if (g==0) {
 
248
    g = get_sa_item(font_tables[f]->characters, c);
 
249
    font_tables[f]->charinfo_cache[c] = g;
 
250
  }
 
251
  return g;
 
252
}
 
253
#else
 
254
#define find_charinfo_id(f,c) get_sa_item(font_tables[f]->characters,c)
 
255
#endif
 
256
 
 
257
 
235
258
charinfo *
236
259
char_info (internal_font_number f, integer c) {
237
 
  sa_tree_item glyph = 0;
 
260
  if (f>font_id_maxval)
 
261
        return 0;
238
262
  if (proper_char_index(c)) {
239
 
    glyph = get_sa_item(font_tables[f]->characters, c);
 
263
    register int glyph = find_charinfo_id(f,c);
240
264
    return &(font_tables[f]->charinfo[glyph]);
241
265
  } else if (c == left_boundarychar && left_boundary(f)!=NULL) {
242
266
    return left_boundary(f);
257
281
  return s;
258
282
}
259
283
 
260
 
 
261
284
integer
262
285
char_exists (internal_font_number f, integer c) {
263
 
  sa_tree_item glyph;
264
 
  int ret;
265
 
  ret = 0;
 
286
  if (f>font_id_maxval)
 
287
        return 0;
266
288
  if (proper_char_index(c)) {
267
 
    glyph = get_sa_item(font_tables[f]->characters, c);
268
 
    if (glyph) 
269
 
      ret=1;
 
289
    return find_charinfo_id(f,c);
270
290
  } else if ((c == left_boundarychar) && has_left_boundary(f)) {
271
 
      ret=1;
 
291
    return 1;
272
292
  } else if ((c == right_boundarychar) && has_right_boundary(f)) {
273
 
      ret=1;
 
293
    return 1;
274
294
  }
275
 
  return ret;
 
295
  return 0;
276
296
}
277
297
 
278
298
int
659
679
test_no_ligatures (internal_font_number f) {
660
680
 integer c;
661
681
 for (c=font_bc(f);c<=font_ec(f);c++) {
662
 
   if (char_exists(f,c) && has_lig(f,c))
 
682
   if (has_lig(f,c)) /* char_exists(f,c) */
663
683
     return 0;
664
684
 }
665
685
 return 1;
711
731
  integer c;
712
732
  charinfo * co;
713
733
  
 
734
  if (font_tables[f]->ligatures_disabled)
 
735
        return;
 
736
 
714
737
  co = char_info(f,left_boundarychar);
715
738
  set_charinfo_ligatures(co,NULL);
716
 
 
717
739
  co = char_info(f,right_boundarychar); /* this is weird */
718
740
  set_charinfo_ligatures(co,NULL);
719
 
  
720
 
  for (c=font_bc(f);c<=font_ec(f);c++) {
721
 
    if (char_exists(f,c) && has_lig(f,c)) {
722
 
      co = char_info(f,c);
723
 
      set_charinfo_ligatures(co,NULL);
724
 
    }
 
741
  for (c=0;c<font_tables[f]->charinfo_count;c++) {
 
742
        co = font_tables[f]->charinfo+c;
 
743
        set_charinfo_ligatures(co,NULL);
725
744
  }
 
745
  font_tables[f]->ligatures_disabled =1;
726
746
}
727
747
 
728
748
liginfo 
848
868
  int i,x;
849
869
 
850
870
  set_font_used(f,0);
 
871
  font_tables[f]->charinfo_cache = NULL;
851
872
  dump_things(*(font_tables[f]), 1);
852
873
  dump_string(font_name(f));
853
874
  dump_string(font_area(f));