ReactOS 0.4.15-dev-7897-g78dc504
pfrdrivr.c File Reference
#include <ft2build.h>
#include "pfrdrivr.h"
#include "pfrobjs.h"
#include "pfrerror.h"
Include dependency graph for pfrdrivr.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 pfr_get_kerning (FT_Face pfrface, FT_UInt left, FT_UInt right, FT_Vector *avector)
 
 pfr_get_advance (FT_Face pfrface, FT_UInt gindex, FT_Pos *anadvance)
 
 pfr_get_metrics (FT_Face pfrface, FT_UInt *anoutline_resolution, FT_UInt *ametrics_resolution, FT_Fixed *ametrics_x_scale, FT_Fixed *ametrics_y_scale)
 
 pfr_get_service (FT_Module module, const FT_String *service_id)
 

Variables

static const FT_Service_PfrMetricsRec pfr_metrics_service_rec
 
static const FT_ServiceDescRec pfr_services []
 
FT_CALLBACK_TABLE_DEF const FT_Driver_ClassRec pfr_driver_class
 

Function Documentation

◆ pfr_get_advance()

pfr_get_advance ( FT_Face  pfrface,
FT_UInt  gindex,
FT_Pos anadvance 
)

Definition at line 66 of file pfrdrivr.c.

69 {
70 PFR_Face face = (PFR_Face)pfrface;
71 FT_Error error = FT_ERR( Invalid_Argument );
72
73
74 *anadvance = 0;
75
76 if ( !gindex )
77 goto Exit;
78
79 gindex--;
80
81 if ( face )
82 {
83 PFR_PhyFont phys = &face->phy_font;
84
85
86 if ( gindex < phys->num_chars )
87 {
88 *anadvance = phys->chars[gindex].advance;
90 }
91 }
92
93 Exit:
94 return error;
95 }
return FT_Err_Ok
Definition: ftbbox.c:511
int FT_Error
Definition: fttypes.h:300
#define FT_ERR(e)
Definition: fttypes.h:586
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
#define error(str)
Definition: mkdosfs.c:1605
typedefFT_BEGIN_HEADER struct PFR_FaceRec_ * PFR_Face
Definition: pfrobjs.h:27
static void Exit(void)
Definition: sock.c:1330
FT_Int advance
Definition: pfrtypes.h:158
PFR_Char chars
Definition: pfrtypes.h:239

◆ pfr_get_kerning()

pfr_get_kerning ( FT_Face  pfrface,
FT_UInt  left,
FT_UInt  right,
FT_Vector avector 
)

Definition at line 31 of file pfrdrivr.c.

35 {
36 PFR_Face face = (PFR_Face)pfrface;
37 PFR_PhyFont phys = &face->phy_font;
38
39
40 (void)pfr_face_get_kerning( pfrface, left, right, avector );
41
42 /* convert from metrics to outline units when necessary */
43 if ( phys->outline_resolution != phys->metrics_resolution )
44 {
45 if ( avector->x != 0 )
46 avector->x = FT_MulDiv( avector->x,
49
50 if ( avector->y != 0 )
51 avector->y = FT_MulDiv( avector->y,
54 }
55
56 return FT_Err_Ok;
57 }
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
Definition: ftcalc.c:416
signed long FT_Long
Definition: fttypes.h:242
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
pfr_face_get_kerning(FT_Face pfrface, FT_UInt glyph1, FT_UInt glyph2, FT_Vector *kerning)
Definition: pfrobjs.c:471
FT_Pos x
Definition: ftimage.h:76
FT_Pos y
Definition: ftimage.h:77
FT_UInt outline_resolution
Definition: pfrtypes.h:211
FT_UInt metrics_resolution
Definition: pfrtypes.h:212

◆ pfr_get_metrics()

pfr_get_metrics ( FT_Face  pfrface,
FT_UInt anoutline_resolution,
FT_UInt ametrics_resolution,
FT_Fixed ametrics_x_scale,
FT_Fixed ametrics_y_scale 
)

Definition at line 99 of file pfrdrivr.c.

104 {
105 PFR_Face face = (PFR_Face)pfrface;
106 PFR_PhyFont phys = &face->phy_font;
107 FT_Fixed x_scale, y_scale;
108 FT_Size size = face->root.size;
109
110
111 if ( anoutline_resolution )
112 *anoutline_resolution = phys->outline_resolution;
113
114 if ( ametrics_resolution )
115 *ametrics_resolution = phys->metrics_resolution;
116
117 x_scale = 0x10000L;
118 y_scale = 0x10000L;
119
120 if ( size )
121 {
122 x_scale = FT_DivFix( size->metrics.x_ppem << 6,
124
125 y_scale = FT_DivFix( size->metrics.y_ppem << 6,
127 }
128
129 if ( ametrics_x_scale )
130 *ametrics_x_scale = x_scale;
131
132 if ( ametrics_y_scale )
133 *ametrics_y_scale = y_scale;
134
135 return FT_Err_Ok;
136 }
FT_DivFix(FT_Long a, FT_Long b)
Definition: ftcalc.c:608
signed long FT_Fixed
Definition: fttypes.h:288
GLsizeiptr size
Definition: glext.h:5919

◆ pfr_get_service()

pfr_get_service ( FT_Module  module,
const FT_String service_id 
)

Definition at line 162 of file pfrdrivr.c.

164 {
165 FT_UNUSED( module );
166
167 return ft_service_list_lookup( pfr_services, service_id );
168 }
#define FT_UNUSED(arg)
Definition: ftconfig.h:101
ft_service_list_lookup(FT_ServiceDesc service_descriptors, const char *service_id)
Definition: ftobjs.c:98
static const FT_ServiceDescRec pfr_services[]
Definition: pfrdrivr.c:153

Variable Documentation

◆ pfr_driver_class

Definition at line 172 of file pfrdrivr.c.

◆ pfr_metrics_service_rec

const FT_Service_PfrMetricsRec pfr_metrics_service_rec
static
Initial value:
=
{
}
pfr_get_metrics(FT_Face pfrface, FT_UInt *anoutline_resolution, FT_UInt *ametrics_resolution, FT_Fixed *ametrics_x_scale, FT_Fixed *ametrics_y_scale)
Definition: pfrdrivr.c:99
pfr_get_advance(FT_Face pfrface, FT_UInt gindex, FT_Pos *anadvance)
Definition: pfrdrivr.c:66

Definition at line 140 of file pfrdrivr.c.

◆ pfr_services

const FT_ServiceDescRec pfr_services[]
static
Initial value:
=
{
{ NULL, NULL }
}
#define NULL
Definition: types.h:112
static const FT_Service_PfrMetricsRec pfr_metrics_service_rec
Definition: pfrdrivr.c:140
#define FT_SERVICE_ID_FONT_FORMAT
Definition: svfntfmt.h:34
#define FT_FONT_FORMAT_PFR
Definition: svfntfmt.h:43
#define FT_SERVICE_ID_PFR_METRICS
Definition: svpfr.h:29

Definition at line 153 of file pfrdrivr.c.

Referenced by pfr_get_service().