< prev index next >

src/java.desktop/share/native/libfreetype/src/autofit/afcjk.c

Print this page


   1 /****************************************************************************
   2  *
   3  * afcjk.c
   4  *
   5  *   Auto-fitter hinting routines for CJK writing system (body).
   6  *
   7  * Copyright (C) 2006-2019 by
   8  * David Turner, Robert Wilhelm, and Werner Lemberg.
   9  *
  10  * This file is part of the FreeType project, and may only be used,
  11  * modified, and distributed under the terms of the FreeType project
  12  * license, LICENSE.TXT.  By continuing to use, modify, or distribute
  13  * this file you indicate that you have read the license and
  14  * understand and accept it fully.
  15  *
  16  */
  17 
  18   /*
  19    * The algorithm is based on akito's autohint patch, archived at
  20    *
  21    * https://web.archive.org/web/20051219160454/http://www.kde.gr.jp:80/~akito/patch/freetype2/2.1.7/
  22    *
  23    */
  24 
  25 #include <ft2build.h>
  26 #include FT_ADVANCES_H
  27 #include FT_INTERNAL_DEBUG_H


 789   }
 790 
 791 
 792   /*************************************************************************/
 793   /*************************************************************************/
 794   /*****                                                               *****/
 795   /*****              C J K   G L Y P H   A N A L Y S I S              *****/
 796   /*****                                                               *****/
 797   /*************************************************************************/
 798   /*************************************************************************/
 799 
 800 
 801   /* Walk over all contours and compute its segments. */
 802 
 803   static FT_Error
 804   af_cjk_hints_compute_segments( AF_GlyphHints  hints,
 805                                  AF_Dimension   dim )
 806   {
 807     AF_AxisHints  axis          = &hints->axis[dim];
 808     AF_Segment    segments      = axis->segments;
 809     AF_Segment    segment_limit = segments + axis->num_segments;
 810     FT_Error      error;
 811     AF_Segment    seg;
 812 
 813 
 814     error = af_latin_hints_compute_segments( hints, dim );
 815     if ( error )
 816       return error;
 817 
 818     /* a segment is round if it doesn't have successive */
 819     /* on-curve points.                                 */
 820     for ( seg = segments; seg < segment_limit; seg++ )
 821     {
 822       AF_Point  pt   = seg->first;
 823       AF_Point  last = seg->last;
 824       FT_UInt   f0   = pt->flags & AF_FLAG_CONTROL;
 825       FT_UInt   f1;
 826 
 827 
 828       seg->flags &= ~AF_EDGE_ROUND;
 829 


   1 /****************************************************************************
   2  *
   3  * afcjk.c
   4  *
   5  *   Auto-fitter hinting routines for CJK writing system (body).
   6  *
   7  * Copyright (C) 2006-2020 by
   8  * David Turner, Robert Wilhelm, and Werner Lemberg.
   9  *
  10  * This file is part of the FreeType project, and may only be used,
  11  * modified, and distributed under the terms of the FreeType project
  12  * license, LICENSE.TXT.  By continuing to use, modify, or distribute
  13  * this file you indicate that you have read the license and
  14  * understand and accept it fully.
  15  *
  16  */
  17 
  18   /*
  19    * The algorithm is based on akito's autohint patch, archived at
  20    *
  21    * https://web.archive.org/web/20051219160454/http://www.kde.gr.jp:80/~akito/patch/freetype2/2.1.7/
  22    *
  23    */
  24 
  25 #include <ft2build.h>
  26 #include FT_ADVANCES_H
  27 #include FT_INTERNAL_DEBUG_H


 789   }
 790 
 791 
 792   /*************************************************************************/
 793   /*************************************************************************/
 794   /*****                                                               *****/
 795   /*****              C J K   G L Y P H   A N A L Y S I S              *****/
 796   /*****                                                               *****/
 797   /*************************************************************************/
 798   /*************************************************************************/
 799 
 800 
 801   /* Walk over all contours and compute its segments. */
 802 
 803   static FT_Error
 804   af_cjk_hints_compute_segments( AF_GlyphHints  hints,
 805                                  AF_Dimension   dim )
 806   {
 807     AF_AxisHints  axis          = &hints->axis[dim];
 808     AF_Segment    segments      = axis->segments;
 809     AF_Segment    segment_limit = FT_OFFSET( segments, axis->num_segments );
 810     FT_Error      error;
 811     AF_Segment    seg;
 812 
 813 
 814     error = af_latin_hints_compute_segments( hints, dim );
 815     if ( error )
 816       return error;
 817 
 818     /* a segment is round if it doesn't have successive */
 819     /* on-curve points.                                 */
 820     for ( seg = segments; seg < segment_limit; seg++ )
 821     {
 822       AF_Point  pt   = seg->first;
 823       AF_Point  last = seg->last;
 824       FT_UInt   f0   = pt->flags & AF_FLAG_CONTROL;
 825       FT_UInt   f1;
 826 
 827 
 828       seg->flags &= ~AF_EDGE_ROUND;
 829 


< prev index next >