ReactOS 0.4.16-dev-340-g0540c21
ftpfr.c File Reference
#include <ft2build.h>
Include dependency graph for ftpfr.c:

Go to the source code of this file.

Functions

static FT_Service_PfrMetrics ft_pfr_check (FT_Face face)
 
 FT_Get_PFR_Metrics (FT_Face face, FT_UInt *aoutline_resolution, FT_UInt *ametrics_resolution, FT_Fixed *ametrics_x_scale, FT_Fixed *ametrics_y_scale)
 
 FT_Get_PFR_Kerning (FT_Face face, FT_UInt left, FT_UInt right, FT_Vector *avector)
 
 FT_Get_PFR_Advance (FT_Face face, FT_UInt gindex, FT_Pos *aadvance)
 

Function Documentation

◆ FT_Get_PFR_Advance()

FT_Get_PFR_Advance ( FT_Face  face,
FT_UInt  gindex,
FT_Pos aadvance 
)

Definition at line 128 of file ftpfr.c.

131 {
133 FT_Service_PfrMetrics service;
134
135
136 if ( !face )
137 return FT_THROW( Invalid_Face_Handle );
138
139 if ( !aadvance )
140 return FT_THROW( Invalid_Argument );
141
142 service = ft_pfr_check( face );
143 if ( service )
144 error = service->get_advance( face, gindex, aadvance );
145 else
146 /* XXX: TODO: PROVIDE ADVANCE-LOADING METHOD TO ALL FONT DRIVERS */
147 error = FT_THROW( Invalid_Argument );
148
149 return error;
150 }
#define FT_THROW(e)
Definition: ftdebug.h:213
static FT_Service_PfrMetrics ft_pfr_check(FT_Face face)
Definition: ftpfr.c:27
int FT_Error
Definition: fttypes.h:300
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
#define error(str)
Definition: mkdosfs.c:1605

◆ FT_Get_PFR_Kerning()

FT_Get_PFR_Kerning ( FT_Face  face,
FT_UInt  left,
FT_UInt  right,
FT_Vector avector 
)

Definition at line 99 of file ftpfr.c.

103 {
105 FT_Service_PfrMetrics service;
106
107
108 if ( !face )
109 return FT_THROW( Invalid_Face_Handle );
110
111 if ( !avector )
112 return FT_THROW( Invalid_Argument );
113
114 service = ft_pfr_check( face );
115 if ( service )
116 error = service->get_kerning( face, left, right, avector );
117 else
119 FT_KERNING_UNSCALED, avector );
120
121 return error;
122 }
FT_Get_Kerning(FT_Face face, FT_UInt left_glyph, FT_UInt right_glyph, FT_UInt kern_mode, FT_Vector *akerning)
Definition: ftobjs.c:3347
@ FT_KERNING_UNSCALED
Definition: freetype.h:3391
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726

◆ FT_Get_PFR_Metrics()

FT_Get_PFR_Metrics ( FT_Face  face,
FT_UInt aoutline_resolution,
FT_UInt ametrics_resolution,
FT_Fixed ametrics_x_scale,
FT_Fixed ametrics_y_scale 
)

Definition at line 42 of file ftpfr.c.

47 {
49 FT_Service_PfrMetrics service;
50
51
52 if ( !face )
53 return FT_THROW( Invalid_Face_Handle );
54
55 service = ft_pfr_check( face );
56 if ( service )
57 {
58 error = service->get_metrics( face,
59 aoutline_resolution,
60 ametrics_resolution,
61 ametrics_x_scale,
62 ametrics_y_scale );
63 }
64 else
65 {
66 FT_Fixed x_scale, y_scale;
67
68
69 /* this is not a PFR font */
70 if ( aoutline_resolution )
71 *aoutline_resolution = face->units_per_EM;
72
73 if ( ametrics_resolution )
74 *ametrics_resolution = face->units_per_EM;
75
76 x_scale = y_scale = 0x10000L;
77 if ( face->size )
78 {
79 x_scale = face->size->metrics.x_scale;
80 y_scale = face->size->metrics.y_scale;
81 }
82
83 if ( ametrics_x_scale )
84 *ametrics_x_scale = x_scale;
85
86 if ( ametrics_y_scale )
87 *ametrics_y_scale = y_scale;
88
89 error = FT_THROW( Unknown_File_Format );
90 }
91
92 return error;
93 }
return FT_Err_Ok
Definition: ftbbox.c:511
signed long FT_Fixed
Definition: fttypes.h:288

◆ ft_pfr_check()

static FT_Service_PfrMetrics ft_pfr_check ( FT_Face  face)
static

Definition at line 27 of file ftpfr.c.

28 {
29 FT_Service_PfrMetrics service = NULL;
30
31
32 if ( face )
33 FT_FACE_LOOKUP_SERVICE( face, service, PFR_METRICS );
34
35 return service;
36 }
#define NULL
Definition: types.h:112
#define FT_FACE_LOOKUP_SERVICE(face, ptr, id)
Definition: ftserv.h:950

Referenced by FT_Get_PFR_Advance(), FT_Get_PFR_Kerning(), and FT_Get_PFR_Metrics().