~ubuntu-branches/ubuntu/trusty/xscreensaver/trusty

« back to all changes in this revision

Viewing changes to hacks/glx/texfont.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2009-11-30 13:33:13 UTC
  • mfrom: (1.1.8 upstream) (2.1.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091130133313-3b5nz2e7hvbb8h3l
Tags: 5.10-3ubuntu1
* Merge with Debian unstable, remaining changes: (LP: #489062)
  - debian/control: add Build-Depends on ubuntu-artwork
  - debian/rules: use /usr/share/backgrounds
  - debian/control: Move xli | xloadimage recommends to suggests
  - debian/split-hacks.config: Use different set of default hacks to Debian
  - debian/source_xscreensaver.py: Add apport hook
  - debian/patches/53_XScreenSaver.ad.in.patch: Use Ubuntu branding

Show diffs side-by-side

added added

removed removed

Lines of Context:
257
257
 
258
258
          /* See comment in print_texture_string for bit layout explanation.
259
259
           */
260
 
          int lbearing = (f->per_char
 
260
          int lbearing = (f->per_char && ii >= f->min_char_or_byte2
261
261
                          ? f->per_char[ii - f->min_char_or_byte2].lbearing
262
262
                          : f->min_bounds.lbearing);
263
 
          int ascent   = (f->per_char
 
263
          int ascent   = (f->per_char && ii >= f->min_char_or_byte2
264
264
                          ? f->per_char[ii - f->min_char_or_byte2].ascent
265
265
                          : f->max_bounds.ascent);
266
 
          int width    = (f->per_char
 
266
          int width    = (f->per_char && ii >= f->min_char_or_byte2
267
267
                          ? f->per_char[ii - f->min_char_or_byte2].width
268
268
                          : f->max_bounds.width);
269
269
 
334
334
  while (*c)
335
335
    {
336
336
      int cc = *((unsigned char *) c);
337
 
      w += (f->per_char
 
337
      w += (f->per_char && cc >= f->min_char_or_byte2
338
338
            ? f->per_char[cc-f->min_char_or_byte2].width
339
339
            : f->max_bounds.width);
340
340
      c++;
430
430
             We want to make a quad from point A to point C.
431
431
             We want to position that quad so that point B lies at x,y.
432
432
           */
433
 
          int lbearing = (f->per_char
 
433
          int lbearing = (f->per_char && c >= f->min_char_or_byte2
434
434
                          ? f->per_char[c - f->min_char_or_byte2].lbearing
435
435
                          : f->min_bounds.lbearing);
436
 
          int rbearing = (f->per_char
 
436
          int rbearing = (f->per_char && c >= f->min_char_or_byte2
437
437
                          ? f->per_char[c - f->min_char_or_byte2].rbearing
438
438
                          : f->max_bounds.rbearing);
439
 
          int ascent   = (f->per_char
 
439
          int ascent   = (f->per_char && c >= f->min_char_or_byte2
440
440
                          ? f->per_char[c - f->min_char_or_byte2].ascent
441
441
                          : f->max_bounds.ascent);
442
 
          int descent  = (f->per_char
 
442
          int descent  = (f->per_char && c >= f->min_char_or_byte2
443
443
                          ? f->per_char[c - f->min_char_or_byte2].descent
444
444
                          : f->max_bounds.descent);
445
 
          int cwidth   = (f->per_char
 
445
          int cwidth   = (f->per_char && c >= f->min_char_or_byte2
446
446
                          ? f->per_char[c - f->min_char_or_byte2].width
447
447
                          : f->max_bounds.width);
448
448