update for HEAD-2003050101
[reactos.git] / lib / freetype / include / freetype / ftpfr.h
1 /***************************************************************************/
2 /*                                                                         */
3 /*  ftpfr.h                                                                */
4 /*                                                                         */
5 /*    FreeType API for accessing PFR-specific data                         */
6 /*                                                                         */
7 /*  Copyright 2002 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 #ifndef __FTPFR_H__
20 #define __FTPFR_H__
21
22 #include <ft2build.h>
23 #include FT_FREETYPE_H
24
25
26 FT_BEGIN_HEADER
27
28
29   /*************************************************************************/
30   /*                                                                       */
31   /* <Section>                                                             */
32   /*    pfr_fonts                                                          */
33   /*                                                                       */
34   /* <Title>                                                               */
35   /*    PFR Fonts                                                          */
36   /*                                                                       */
37   /* <Abstract>                                                            */
38   /*    PFR/TrueDoc specific APIs                                          */
39   /*                                                                       */
40   /* <Description>                                                         */
41   /*    This section contains the declaration of PFR-specific functions.   */
42   /*                                                                       */
43   /*************************************************************************/
44
45
46  /**********************************************************************
47   *
48   * @function:
49   *    FT_Get_PFR_Metrics
50   *
51   * @description:
52   *    returns the outline and metrics resolutions of a given PFR
53   *    face.
54   *
55   * @input:
56   *    face :: handle to input face. It can be a non-PFR face.
57   *
58   * @output:
59   *    aoutline_resolution ::
60   *      outline resolution. This is equivalent to "face->units_per_EM".
61   *      optional (parameter can be NULL)
62   *
63   *    ametrics_resolution ::
64   *      metrics_resolution. This is equivalent to "outline_resolution"
65   *      for non-PFR fonts. can be NULL
66   *      optional (parameter can be NULL)
67   *
68   *    ametrics_x_scale ::
69   *      a 16.16 fixed-point number used to scale distance expressed
70   *      in metrics units to device sub-pixels. This is equivalent to
71   *      'face->size->x_scale', but for metrics only.
72   *      optional (parameter can be NULL)
73   *
74   *    ametrics_y_scale ::
75   *      same as 'ametrics_x_scale', but for the vertical direction.
76   *      optional (parameter can be NULL)
77   *
78   * @note:
79   *   if the input face is not a PFR, this function will return an error.
80   *   However, in all cases, it will return valid values.
81   */
82   FT_EXPORT( FT_Error )
83   FT_Get_PFR_Metrics( FT_Face     face,
84                       FT_UInt    *aoutline_resolution,
85                       FT_UInt    *ametrics_resolution,
86                       FT_Fixed   *ametrics_x_scale,
87                       FT_Fixed   *ametrics_y_scale );
88
89  /**********************************************************************
90   *
91   * @function:
92   *    FT_Get_PFR_Kerning
93   *
94   * @description:
95   *    returns the kerning pair corresponding to two glyphs in
96   *    a PFR face. The distance is expressed in metrics units, unlike
97   *    the result of @FT_Get_Kerning.
98   *
99   * @input:
100   *    face :: handle to input face.
101   *    left  :: left glyph index
102   *    right :: right glyph index
103   *
104   * @output:
105   *    avector :: kerning vector
106   *
107   * @note:
108   *    this function always return distances in original PFR metrics
109   *    units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED
110   *    mode, which always return distances converted to outline units.
111   *
112   *    you can use the value of the 'x_scale' and 'y_scale' parameters
113   *    returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels
114   */
115   FT_EXPORT( FT_Error )
116   FT_Get_PFR_Kerning( FT_Face     face,
117                       FT_UInt     left,
118                       FT_UInt     right,
119                       FT_Vector  *avector );
120
121  /**********************************************************************
122   *
123   * @function:
124   *    FT_Get_PFR_Advance
125   *
126   * @description:
127   *    returns a given glyph advance, expressed in original metrics units,
128   *    from a PFR font.
129   *
130   * @input:
131   *    face   :: handle to input face.
132   *    gindex :: glyph index
133   *
134   * @output:
135   *    aadvance :: glyph advance in metrics units
136   *
137   * @return:
138   *    error code. 0 means success
139   *
140   * @note:
141   *    you can use the 'x_scale' or 'y_scale' results of @FT_Get_PFR_Metrics
142   *    to convert the advance to device sub-pixels (i.e. 1/64th of pixels)
143   */
144   FT_EXPORT( FT_Error )
145   FT_Get_PFR_Advance( FT_Face    face,
146                       FT_UInt    gindex,
147                       FT_Pos    *aadvance );
148
149  /* */
150
151 FT_END_HEADER
152
153 #endif /* __FTBDF_H__ */
154
155
156 /* END */