~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/freetype/src/type1/t1gload.c

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2006-10-12 23:14:14 UTC
  • mto: (15.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20061012231414-y2oqbom5dy389os0
Tags: upstream-4.2.0
ImportĀ upstreamĀ versionĀ 4.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
/*                                                                         */
5
5
/*    Type 1 Glyph Loader (body).                                          */
6
6
/*                                                                         */
7
 
/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
 
7
/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */
8
8
/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
9
9
/*                                                                         */
10
10
/*  This file is part of the FreeType project, and may only be used,       */
195
195
  }
196
196
 
197
197
 
198
 
  /*************************************************************************/
199
 
  /*************************************************************************/
200
 
  /*************************************************************************/
201
 
  /**********                                                      *********/
202
 
  /**********               UNHINTED GLYPH LOADER                  *********/
203
 
  /**********                                                      *********/
204
 
  /**********    The following code is in charge of loading a      *********/
205
 
  /**********    single outline.  It completely ignores hinting    *********/
206
 
  /**********    and is used when FT_LOAD_NO_HINTING is set.       *********/
207
 
  /**********                                                      *********/
208
 
  /**********      The Type 1 hinter is located in `t1hint.c'      *********/
209
 
  /**********                                                      *********/
210
 
  /*************************************************************************/
211
 
  /*************************************************************************/
212
 
  /*************************************************************************/
213
 
 
214
 
 
215
198
  FT_LOCAL_DEF( FT_Error )
216
199
  T1_Load_Glyph( T1_GlyphSlot  glyph,
217
200
                 T1_Size       size,
315
298
        glyph->root.linearHoriAdvance           = decoder.builder.advance.x;
316
299
        glyph->root.internal->glyph_transformed = 0;
317
300
 
318
 
        /* make up vertical metrics */
319
 
        metrics->vertBearingX = 0;
320
 
        metrics->vertBearingY = 0;
321
 
        metrics->vertAdvance  = 0;
322
 
 
323
 
        glyph->root.linearVertAdvance = 0;
 
301
        /* make up vertical ones */
 
302
        metrics->vertAdvance = ( face->type1.font_bbox.yMax -
 
303
                                 face->type1.font_bbox.yMin ) >> 16;
 
304
        glyph->root.linearVertAdvance = metrics->vertAdvance;
324
305
 
325
306
        glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;
326
307
 
356
337
 
357
338
 
358
339
          /* First of all, scale the points, if we are not hinting */
359
 
          if ( !hinting )
 
340
          if ( !hinting || ! decoder.builder.hints_funcs )
360
341
            for ( n = cur->n_points; n > 0; n--, vec++ )
361
342
            {
362
343
              vec->x = FT_MulFix( vec->x, x_scale );
363
344
              vec->y = FT_MulFix( vec->y, y_scale );
364
345
            }
365
346
 
366
 
          FT_Outline_Get_CBox( &glyph->root.outline, &cbox );
367
 
 
368
347
          /* Then scale the metrics */
369
348
          metrics->horiAdvance  = FT_MulFix( metrics->horiAdvance,  x_scale );
370
349
          metrics->vertAdvance  = FT_MulFix( metrics->vertAdvance,  y_scale );
371
 
 
372
 
          metrics->vertBearingX = FT_MulFix( metrics->vertBearingX, x_scale );
373
 
          metrics->vertBearingY = FT_MulFix( metrics->vertBearingY, y_scale );
374
 
 
375
 
          if ( hinting )
376
 
          {
377
 
            metrics->horiAdvance = FT_PIX_ROUND( metrics->horiAdvance );
378
 
            metrics->vertAdvance = FT_PIX_ROUND( metrics->vertAdvance );
379
 
 
380
 
            metrics->vertBearingX = FT_PIX_ROUND( metrics->vertBearingX );
381
 
            metrics->vertBearingY = FT_PIX_ROUND( metrics->vertBearingY );
382
 
          }
383
350
        }
384
351
 
385
352
        /* compute the other metrics */
386
353
        FT_Outline_Get_CBox( &glyph->root.outline, &cbox );
387
354
 
388
 
        /* grid fit the bounding box if necessary */
389
 
        if ( hinting )
390
 
        {
391
 
          cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
392
 
          cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
393
 
          cbox.xMax = FT_PIX_CEIL( cbox.xMax );
394
 
          cbox.yMax = FT_PIX_CEIL( cbox.yMax );
395
 
        }
396
 
 
397
355
        metrics->width  = cbox.xMax - cbox.xMin;
398
356
        metrics->height = cbox.yMax - cbox.yMin;
399
357
 
400
358
        metrics->horiBearingX = cbox.xMin;
401
359
        metrics->horiBearingY = cbox.yMax;
 
360
 
 
361
        /* make up vertical ones */
 
362
        ft_synthesize_vertical_metrics( metrics,
 
363
                                        metrics->vertAdvance );
402
364
      }
403
365
 
404
366
      /* Set control data to the glyph charstrings.  Note that this is */