のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

FT_GLYPH_FORMAT_COMPOSITE

FT_GLYPH_FORMAT_COMPOSITE	
The glyph image is a composite of several other images. 
This format is only used with FT_LOAD_NO_RECURSE, 
and is used to report compound glyphs (like accented characters).
   2453   FT_LOCAL_DEF( FT_Error )
   2454   TT_Load_Glyph( TT_Size       size,
   2455                  TT_GlyphSlot  glyph,
   2456                  FT_UInt       glyph_index,
   2457                  FT_Int32      load_flags )
   2458   {
   2459     FT_Error      error;
   2460     TT_LoaderRec  loader;
   2461 
   2462 
   2463     FT_TRACE1(( "TT_Load_Glyph: glyph index %d\n", glyph_index ));
   2464 
   2465 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
   2501 #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
   2502 
   2503     /* if FT_LOAD_NO_SCALE is not set, `ttmetrics' must be valid */
   2504     if ( !( load_flags & FT_LOAD_NO_SCALE ) && !size->ttmetrics.valid )
   2505       return FT_THROW( Invalid_Size_Handle );
   2506 
   2507     if ( load_flags & FT_LOAD_SBITS_ONLY )
   2508       return FT_THROW( Invalid_Argument );
   2509 
   2510     error = tt_loader_init( &loader, size, glyph, load_flags, FALSE );
   2511     if ( error )
   2512       return error;
   2513 
   2514     glyph->format        = FT_GLYPH_FORMAT_OUTLINE;
   2515     glyph->num_subglyphs = 0;
   2516     glyph->outline.flags = 0;
   2517 
   2518     /* main loading loop */
   2519     error = load_truetype_glyph( &loader, glyph_index, 0, FALSE );
   2520     if ( !error )
   2521     {
   2522       if ( glyph->format == FT_GLYPH_FORMAT_COMPOSITE )
   2523       {
   2524         glyph->num_subglyphs = loader.gloader->base.num_subglyphs;
   2525         glyph->subglyphs     = loader.gloader->base.subglyphs;
   2526       }
   2527       else
   2528       {
   2529         glyph->outline        = loader.gloader->base.outline;
   2530         glyph->outline.flags &= ~FT_OUTLINE_SINGLE_PASS;
   2531 
   2532         /* Translate array so that (0,0) is the glyph's origin.  Note  */
   2533         /* that this behaviour is independent on the value of bit 1 of */
   2534         /* the `flags' field in the `head' table -- at least major     */
   2535         /* applications like Acroread indicate that.                   */
   2536         if ( loader.pp1.x )
   2537           FT_Outline_Translate( &glyph->outline, -loader.pp1.x, 0 );
   2538       }
   2539 
   2540 #ifdef TT_USE_BYTECODE_INTERPRETER
   2572 #endif /* TT_USE_BYTECODE_INTERPRETER */
   2573 
   2574       error = compute_glyph_metrics( &loader, glyph_index );
   2575     }
   2576 
   2577     /* Set the `high precision' bit flag.                           */
   2578     /* This is _critical_ to get correct output for monochrome      */
   2579     /* TrueType glyphs at all sizes using the bytecode interpreter. */
   2580     /*                                                              */
   2581     if ( !( load_flags & FT_LOAD_NO_SCALE ) &&
   2582          size->root.metrics.y_ppem < 24     )
   2583       glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
   2584 
   2585     return error;
   2586   }
   2587