misc/libfreetype/src/autofit/afindic.c
author Leonard
Sat, 03 Dec 2011 15:15:14 +0100
changeset 6482 07eeb905620e
parent 5172 88f2e05288ba
permissions -rw-r--r--
GCI task: iOS German
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5172
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     1
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     2
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     3
/*  afindic.c                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     4
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     5
/*    Auto-fitter hinting routines for Indic scripts (body).               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     6
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     7
/*  Copyright 2007, 2011 by                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
/*  Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     9
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    10
/*  This file is part of the FreeType project, and may only be used,       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    11
/*  modified, and distributed under the terms of the FreeType project      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    12
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    13
/*  this file you indicate that you have read the license and              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    14
/*  understand and accept it fully.                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    15
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    16
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    17
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    18
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    19
#include "aftypes.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
#include "aflatin.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
#ifdef AF_CONFIG_OPTION_INDIC
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
#include "afindic.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
#include "aferrors.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
#include "afcjk.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    28
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    29
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    30
#ifdef AF_CONFIG_OPTION_USE_WARPER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    31
#include "afwarp.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
  static FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
  af_indic_metrics_init( AF_LatinMetrics  metrics,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
                         FT_Face          face )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    38
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    39
    /* use CJK routines */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
    return af_cjk_metrics_init( metrics, face );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    44
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
  af_indic_metrics_scale( AF_LatinMetrics  metrics,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
                          AF_Scaler        scaler )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
    /* use CJK routines */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
    af_cjk_metrics_scale( metrics, scaler );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
  static FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
  af_indic_hints_init( AF_GlyphHints    hints,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
                       AF_LatinMetrics  metrics )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    57
    /* use CJK routines */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    58
    return af_cjk_hints_init( hints, metrics );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
  static FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
  af_indic_hints_apply( AF_GlyphHints    hints,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
                        FT_Outline*      outline,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
                        AF_LatinMetrics  metrics)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
    /* use CJK routines */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
    return af_cjk_hints_apply( hints, outline, metrics );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
  /*****                I N D I C   S C R I P T   C L A S S            *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
  static const AF_Script_UniRangeRec  af_indic_uniranges[] =
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
#if 0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
    AF_UNIRANGE_REC( 0x0100UL, 0xFFFFUL ),  /* why this? */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
    AF_UNIRANGE_REC( 0x0900UL, 0x0DFFUL),    /* Indic Range */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
    AF_UNIRANGE_REC( 0x0F00UL, 0x0FFFUL),    /* Tibetan */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
    AF_UNIRANGE_REC( 0x1900UL, 0x194FUL),    /* Limbu */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    89
    AF_UNIRANGE_REC( 0x1B80UL, 0x1BBFUL),    /* Sundanese */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
    AF_UNIRANGE_REC( 0x1C80UL, 0x1CDFUL),    /* Meetei Mayak */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
    AF_UNIRANGE_REC( 0xA800UL, 0xA82FUL),    /* Syloti Nagri */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
    AF_UNIRANGE_REC( 0x11800UL, 0x118DFUL),  /* Sharada */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
    AF_UNIRANGE_REC(      0UL,      0UL)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
  AF_DEFINE_SCRIPT_CLASS(af_indic_script_class,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    98
    AF_SCRIPT_INDIC,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
    af_indic_uniranges,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
    sizeof( AF_LatinMetricsRec ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
    (AF_Script_InitMetricsFunc) af_indic_metrics_init,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
    (AF_Script_ScaleMetricsFunc)af_indic_metrics_scale,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
    (AF_Script_DoneMetricsFunc) NULL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   107
    (AF_Script_InitHintsFunc)   af_indic_hints_init,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   108
    (AF_Script_ApplyHintsFunc)  af_indic_hints_apply
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
  )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
#else /* !AF_CONFIG_OPTION_INDIC */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
  static const AF_Script_UniRangeRec  af_indic_uniranges[] =
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
    { 0, 0 }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
  AF_DEFINE_SCRIPT_CLASS(af_indic_script_class,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
    AF_SCRIPT_INDIC,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   121
    af_indic_uniranges,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   122
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   123
    sizeof( AF_LatinMetricsRec ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   124
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
    (AF_Script_InitMetricsFunc) NULL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   126
    (AF_Script_ScaleMetricsFunc)NULL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   127
    (AF_Script_DoneMetricsFunc) NULL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   128
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   129
    (AF_Script_InitHintsFunc)   NULL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   130
    (AF_Script_ApplyHintsFunc)  NULL
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   131
  )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   132
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   133
#endif /* !AF_CONFIG_OPTION_INDIC */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   134
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   135
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   136
/* END */