2018-06-03 09:01:17 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* fttype1.c
|
|
|
|
*
|
|
|
|
* FreeType utility file for PS names support (body).
|
|
|
|
*
|
2019-02-23 10:07:09 +01:00
|
|
|
* Copyright (C) 2002-2019 by
|
2018-06-03 09:01:17 +02: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.
|
|
|
|
*
|
|
|
|
*/
|
2002-05-30 21:22:14 +02:00
|
|
|
|
|
|
|
|
2002-05-29 00:07:49 +02:00
|
|
|
#include <ft2build.h>
|
2014-11-26 21:59:21 +01:00
|
|
|
#include FT_INTERNAL_DEBUG_H
|
2002-05-29 00:07:49 +02:00
|
|
|
#include FT_INTERNAL_OBJECTS_H
|
* include/freetype/internal/bdftypes.h: removed obsolete header
* include/freetype/internal/cfftypes.h, src/cff/cfftypes.h,
src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h,
include/freetype/internal/services/svbdf.h: moving "cfftypes.h" from
'include/freetype/internal' to 'src/cff' since no other modules needs
to known about these types
* include/freetype/internal/t42types.h,
include/freetype/internal/internal.h, src/type42/t42objs.h,
src/type42/t42drivr.c, src/type42/t42types.h: moving "t42types.h" from
'include/freetype/internal' to 'src/type42' since no other modules needs
to known about these types
* src/gzip/infblock.c: removing compiler warning
* include/freetype/internal/services/svpsinfo.h,
include/freetype/internal/ftserv.h, src/cff/cffdrivr.c,
src/cid/ciddrivr.c, src/type1/t1driver.c, src/type42/t42drivr.c,
src/base/fttype1.c: migrating to FT_SERVICE_ID_POSTSCRIPT_INFO defined
in "svpsinfo.h", removing some sad hacks.
2003-10-29 22:43:52 +01:00
|
|
|
#include FT_INTERNAL_SERVICE_H
|
|
|
|
#include FT_SERVICE_POSTSCRIPT_INFO_H
|
2002-05-29 00:07:49 +02:00
|
|
|
|
2002-05-30 21:22:14 +02:00
|
|
|
|
|
|
|
/* documentation is in t1tables.h */
|
2002-05-29 00:07:49 +02:00
|
|
|
|
|
|
|
FT_EXPORT_DEF( FT_Error )
|
|
|
|
FT_Get_PS_Font_Info( FT_Face face,
|
|
|
|
PS_FontInfoRec* afont_info )
|
|
|
|
{
|
2014-11-26 21:59:21 +01:00
|
|
|
FT_Error error;
|
|
|
|
FT_Service_PsInfo service;
|
2002-05-29 00:07:49 +02:00
|
|
|
|
2003-11-01 15:36:20 +01:00
|
|
|
|
2014-11-26 21:59:21 +01:00
|
|
|
if ( !face )
|
|
|
|
return FT_THROW( Invalid_Face_Handle );
|
2003-11-01 15:36:20 +01:00
|
|
|
|
2014-11-26 21:59:21 +01:00
|
|
|
if ( !afont_info )
|
|
|
|
return FT_THROW( Invalid_Argument );
|
* include/freetype/internal/bdftypes.h: removed obsolete header
* include/freetype/internal/cfftypes.h, src/cff/cfftypes.h,
src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h,
include/freetype/internal/services/svbdf.h: moving "cfftypes.h" from
'include/freetype/internal' to 'src/cff' since no other modules needs
to known about these types
* include/freetype/internal/t42types.h,
include/freetype/internal/internal.h, src/type42/t42objs.h,
src/type42/t42drivr.c, src/type42/t42types.h: moving "t42types.h" from
'include/freetype/internal' to 'src/type42' since no other modules needs
to known about these types
* src/gzip/infblock.c: removing compiler warning
* include/freetype/internal/services/svpsinfo.h,
include/freetype/internal/ftserv.h, src/cff/cffdrivr.c,
src/cid/ciddrivr.c, src/type1/t1driver.c, src/type42/t42drivr.c,
src/base/fttype1.c: migrating to FT_SERVICE_ID_POSTSCRIPT_INFO defined
in "svpsinfo.h", removing some sad hacks.
2003-10-29 22:43:52 +01:00
|
|
|
|
2014-11-26 21:59:21 +01:00
|
|
|
FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
|
2002-05-30 21:22:14 +02:00
|
|
|
|
2014-11-26 21:59:21 +01:00
|
|
|
if ( service && service->ps_get_font_info )
|
|
|
|
error = service->ps_get_font_info( face, afont_info );
|
|
|
|
else
|
|
|
|
error = FT_THROW( Invalid_Argument );
|
2003-11-01 15:36:20 +01:00
|
|
|
|
2002-05-29 00:07:49 +02:00
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-05-30 21:22:14 +02:00
|
|
|
/* documentation is in t1tables.h */
|
2002-05-29 00:07:49 +02:00
|
|
|
|
|
|
|
FT_EXPORT_DEF( FT_Int )
|
2002-05-30 21:22:14 +02:00
|
|
|
FT_Has_PS_Glyph_Names( FT_Face face )
|
2002-05-29 00:07:49 +02:00
|
|
|
{
|
2014-11-26 21:59:21 +01:00
|
|
|
FT_Int result = 0;
|
|
|
|
FT_Service_PsInfo service;
|
2002-05-30 21:22:14 +02:00
|
|
|
|
2003-11-01 15:36:20 +01:00
|
|
|
|
* include/freetype/internal/bdftypes.h: removed obsolete header
* include/freetype/internal/cfftypes.h, src/cff/cfftypes.h,
src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h,
include/freetype/internal/services/svbdf.h: moving "cfftypes.h" from
'include/freetype/internal' to 'src/cff' since no other modules needs
to known about these types
* include/freetype/internal/t42types.h,
include/freetype/internal/internal.h, src/type42/t42objs.h,
src/type42/t42drivr.c, src/type42/t42types.h: moving "t42types.h" from
'include/freetype/internal' to 'src/type42' since no other modules needs
to known about these types
* src/gzip/infblock.c: removing compiler warning
* include/freetype/internal/services/svpsinfo.h,
include/freetype/internal/ftserv.h, src/cff/cffdrivr.c,
src/cid/ciddrivr.c, src/type1/t1driver.c, src/type42/t42drivr.c,
src/base/fttype1.c: migrating to FT_SERVICE_ID_POSTSCRIPT_INFO defined
in "svpsinfo.h", removing some sad hacks.
2003-10-29 22:43:52 +01:00
|
|
|
if ( face )
|
2002-05-29 00:07:49 +02:00
|
|
|
{
|
2003-11-01 15:36:20 +01:00
|
|
|
FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
|
2002-05-29 00:07:49 +02:00
|
|
|
|
* include/freetype/internal/bdftypes.h: removed obsolete header
* include/freetype/internal/cfftypes.h, src/cff/cfftypes.h,
src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h,
include/freetype/internal/services/svbdf.h: moving "cfftypes.h" from
'include/freetype/internal' to 'src/cff' since no other modules needs
to known about these types
* include/freetype/internal/t42types.h,
include/freetype/internal/internal.h, src/type42/t42objs.h,
src/type42/t42drivr.c, src/type42/t42types.h: moving "t42types.h" from
'include/freetype/internal' to 'src/type42' since no other modules needs
to known about these types
* src/gzip/infblock.c: removing compiler warning
* include/freetype/internal/services/svpsinfo.h,
include/freetype/internal/ftserv.h, src/cff/cffdrivr.c,
src/cid/ciddrivr.c, src/type1/t1driver.c, src/type42/t42drivr.c,
src/base/fttype1.c: migrating to FT_SERVICE_ID_POSTSCRIPT_INFO defined
in "svpsinfo.h", removing some sad hacks.
2003-10-29 22:43:52 +01:00
|
|
|
if ( service && service->ps_has_glyph_names )
|
|
|
|
result = service->ps_has_glyph_names( face );
|
2002-05-29 00:07:49 +02:00
|
|
|
}
|
2003-11-01 15:36:20 +01:00
|
|
|
|
2002-05-29 00:07:49 +02:00
|
|
|
return result;
|
|
|
|
}
|
2002-05-30 21:22:14 +02:00
|
|
|
|
|
|
|
|
2004-11-12 08:02:45 +01:00
|
|
|
/* documentation is in t1tables.h */
|
|
|
|
|
|
|
|
FT_EXPORT_DEF( FT_Error )
|
|
|
|
FT_Get_PS_Font_Private( FT_Face face,
|
|
|
|
PS_PrivateRec* afont_private )
|
|
|
|
{
|
2014-11-26 21:59:21 +01:00
|
|
|
FT_Error error;
|
|
|
|
FT_Service_PsInfo service;
|
2004-11-12 08:02:45 +01:00
|
|
|
|
|
|
|
|
2014-11-26 21:59:21 +01:00
|
|
|
if ( !face )
|
|
|
|
return FT_THROW( Invalid_Face_Handle );
|
2004-11-12 08:02:45 +01:00
|
|
|
|
2014-11-26 21:59:21 +01:00
|
|
|
if ( !afont_private )
|
|
|
|
return FT_THROW( Invalid_Argument );
|
2004-11-12 08:02:45 +01:00
|
|
|
|
2014-11-26 21:59:21 +01:00
|
|
|
FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
|
2004-11-12 08:02:45 +01:00
|
|
|
|
2014-11-26 21:59:21 +01:00
|
|
|
if ( service && service->ps_get_font_private )
|
|
|
|
error = service->ps_get_font_private( face, afont_private );
|
|
|
|
else
|
|
|
|
error = FT_THROW( Invalid_Argument );
|
2004-11-12 08:02:45 +01:00
|
|
|
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-11-13 16:30:59 +01:00
|
|
|
/* documentation is in t1tables.h */
|
|
|
|
|
|
|
|
FT_EXPORT_DEF( FT_Long )
|
|
|
|
FT_Get_PS_Font_Value( FT_Face face,
|
|
|
|
PS_Dict_Keys key,
|
|
|
|
FT_UInt idx,
|
|
|
|
void *value,
|
|
|
|
FT_Long value_len )
|
|
|
|
{
|
|
|
|
FT_Int result = 0;
|
|
|
|
FT_Service_PsInfo service = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
if ( face )
|
|
|
|
{
|
|
|
|
FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
|
|
|
|
|
|
|
|
if ( service && service->ps_get_font_value )
|
|
|
|
result = service->ps_get_font_value( face, key, idx,
|
|
|
|
value, value_len );
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-05-30 21:22:14 +02:00
|
|
|
/* END */
|