2002-10-31 09:30:19 +01:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* ftpfr.c */
|
|
|
|
/* */
|
2003-04-23 07:38:13 +02:00
|
|
|
/* FreeType API for accessing PFR-specific data (body). */
|
2002-10-31 09:30:19 +01:00
|
|
|
/* */
|
2004-12-14 00:16:59 +01:00
|
|
|
/* Copyright 2002, 2003, 2004 by */
|
2002-10-31 09:30:19 +01:00
|
|
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
|
|
|
/* */
|
|
|
|
/* This file is part of the FreeType project, and may only be used, */
|
|
|
|
/* modified, and distributed under the terms of the FreeType project */
|
|
|
|
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
|
|
|
/* this file you indicate that you have read the license and */
|
|
|
|
/* understand and accept it fully. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_INTERNAL_OBJECTS_H
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
#include FT_SERVICE_PFR_H
|
2002-10-31 09:30:19 +01:00
|
|
|
|
|
|
|
|
2003-04-23 07:38:13 +02:00
|
|
|
/* check the format */
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
static FT_Service_PfrMetrics
|
|
|
|
ft_pfr_check( FT_Face face )
|
2002-10-31 09:30:19 +01:00
|
|
|
{
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
FT_Service_PfrMetrics service;
|
2002-10-31 09:30:19 +01:00
|
|
|
|
2003-10-07 07:49:41 +02:00
|
|
|
|
* include/freetype/internal/fnttypes.h,
include/freetype/internal/ftserv.h, src/base/ftbdf.c, src/base/ftmm.c,
src/base/ftobjs.c, src/base/ftpfr.c, src/base/ftwinfnt.c,
src/base/ftxf86.c, src/pfr/pfrdrivr.c, src/winfonts/winfnt.c,
src/winfonts/winfnt.h, include/freetype/internal/service/svwinfnt.h,:
simplification of service lookup macros, updating the PFR and
WINFNT font drivers to new services
2003-09-21 19:15:55 +02:00
|
|
|
FT_FACE_LOOKUP_SERVICE( face, service, PFR_METRICS );
|
2003-04-23 07:38:13 +02:00
|
|
|
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
return service;
|
2002-10-31 09:30:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-12-14 00:16:59 +01:00
|
|
|
/* documentation is in ftpfr.h */
|
|
|
|
|
2002-10-31 09:30:19 +01:00
|
|
|
FT_EXPORT_DEF( FT_Error )
|
2003-04-23 07:38:13 +02:00
|
|
|
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 )
|
2002-10-31 09:30:19 +01:00
|
|
|
{
|
2003-10-20 10:29:46 +02:00
|
|
|
FT_Error error = FT_Err_Ok;
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
FT_Service_PfrMetrics service;
|
2002-10-31 09:30:19 +01:00
|
|
|
|
2003-04-23 07:38:13 +02:00
|
|
|
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
service = ft_pfr_check( face );
|
|
|
|
if ( service )
|
2002-10-31 09:30:19 +01:00
|
|
|
{
|
|
|
|
error = service->get_metrics( face,
|
|
|
|
aoutline_resolution,
|
|
|
|
ametrics_resolution,
|
|
|
|
ametrics_x_scale,
|
|
|
|
ametrics_y_scale );
|
|
|
|
}
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
else if ( face )
|
|
|
|
{
|
|
|
|
FT_Fixed x_scale, y_scale;
|
|
|
|
|
2003-09-22 11:53:56 +02:00
|
|
|
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
/* this is not a PFR font */
|
|
|
|
*aoutline_resolution = face->units_per_EM;
|
|
|
|
*ametrics_resolution = face->units_per_EM;
|
|
|
|
|
|
|
|
x_scale = y_scale = 0x10000L;
|
|
|
|
if ( face->size )
|
|
|
|
{
|
|
|
|
x_scale = face->size->metrics.x_scale;
|
|
|
|
y_scale = face->size->metrics.y_scale;
|
|
|
|
}
|
|
|
|
*ametrics_x_scale = x_scale;
|
|
|
|
*ametrics_y_scale = y_scale;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
error = FT_Err_Invalid_Argument;
|
|
|
|
|
2002-10-31 09:30:19 +01:00
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
2003-04-23 07:38:13 +02:00
|
|
|
|
2004-12-14 00:16:59 +01:00
|
|
|
/* documentation is in ftpfr.h */
|
|
|
|
|
2002-10-31 09:30:19 +01:00
|
|
|
FT_EXPORT_DEF( FT_Error )
|
|
|
|
FT_Get_PFR_Kerning( FT_Face face,
|
|
|
|
FT_UInt left,
|
|
|
|
FT_UInt right,
|
|
|
|
FT_Vector *avector )
|
|
|
|
{
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
FT_Error error;
|
|
|
|
FT_Service_PfrMetrics service;
|
2002-10-31 09:30:19 +01:00
|
|
|
|
2003-04-23 07:38:13 +02:00
|
|
|
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
service = ft_pfr_check( face );
|
|
|
|
if ( service )
|
2002-10-31 09:30:19 +01:00
|
|
|
error = service->get_kerning( face, left, right, avector );
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
else if ( face )
|
2003-09-22 11:53:56 +02:00
|
|
|
error = FT_Get_Kerning( face, left, right,
|
|
|
|
FT_KERNING_UNSCALED, avector );
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
else
|
|
|
|
error = FT_Err_Invalid_Argument;
|
|
|
|
|
2002-10-31 09:30:19 +01:00
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-12-14 00:16:59 +01:00
|
|
|
/* documentation is in ftpfr.h */
|
|
|
|
|
2002-10-31 09:30:19 +01:00
|
|
|
FT_EXPORT_DEF( FT_Error )
|
2003-04-23 07:38:13 +02:00
|
|
|
FT_Get_PFR_Advance( FT_Face face,
|
|
|
|
FT_UInt gindex,
|
|
|
|
FT_Pos *aadvance )
|
2002-10-31 09:30:19 +01:00
|
|
|
{
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
FT_Error error;
|
|
|
|
FT_Service_PfrMetrics service;
|
2002-10-31 09:30:19 +01:00
|
|
|
|
2003-04-23 07:38:13 +02:00
|
|
|
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
service = ft_pfr_check( face );
|
|
|
|
if ( service )
|
2002-10-31 09:30:19 +01:00
|
|
|
{
|
|
|
|
error = service->get_advance( face, gindex, aadvance );
|
|
|
|
}
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
else
|
2003-09-22 11:53:56 +02:00
|
|
|
/* XXX: TODO: PROVIDE ADVANCE-LOADING METHOD TO ALL FONT DRIVERS */
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
error = FT_Err_Invalid_Argument;
|
|
|
|
|
2002-10-31 09:30:19 +01:00
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
2003-04-23 07:38:13 +02:00
|
|
|
|
2002-10-31 09:30:19 +01:00
|
|
|
/* END */
|