2002-05-22 07:41:06 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* ftbdf.h */
|
|
|
|
/* */
|
|
|
|
/* FreeType API for accessing BDF-specific strings (specification). */
|
|
|
|
/* */
|
2006-03-24 13:46:49 +01:00
|
|
|
/* Copyright 2002, 2003, 2004, 2006 by */
|
2002-05-22 07:41:06 +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. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __FTBDF_H__
|
|
|
|
#define __FTBDF_H__
|
2002-05-21 22:50:53 +02:00
|
|
|
|
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_FREETYPE_H
|
|
|
|
|
2003-11-04 08:44:19 +01:00
|
|
|
#ifdef FREETYPE_H
|
|
|
|
#error "freetype.h of FreeType 1 has been loaded!"
|
|
|
|
#error "Please fix the directory search order for header files"
|
|
|
|
#error "so that freetype.h of FreeType 2 is found first."
|
|
|
|
#endif
|
|
|
|
|
2002-05-22 07:41:06 +02:00
|
|
|
|
2002-05-21 22:50:53 +02:00
|
|
|
FT_BEGIN_HEADER
|
|
|
|
|
2002-05-22 07:41:06 +02:00
|
|
|
|
2002-05-28 22:14:28 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Section> */
|
|
|
|
/* bdf_fonts */
|
|
|
|
/* */
|
|
|
|
/* <Title> */
|
2008-06-26 21:56:51 +02:00
|
|
|
/* BDF and PCF Files */
|
2002-05-28 22:14:28 +02:00
|
|
|
/* */
|
|
|
|
/* <Abstract> */
|
2008-06-26 21:56:51 +02:00
|
|
|
/* BDF and PCF specific API. */
|
2002-05-28 22:14:28 +02:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2008-06-26 21:56:51 +02:00
|
|
|
/* This section contains the declaration of functions specific to BDF */
|
|
|
|
/* and PCF fonts. */
|
2002-05-28 22:14:28 +02:00
|
|
|
/* */
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
2008-06-26 21:56:51 +02:00
|
|
|
/**********************************************************************
|
|
|
|
*
|
|
|
|
* @enum:
|
|
|
|
* FT_PropertyType
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* A list of BDF property types.
|
|
|
|
*
|
|
|
|
* @values:
|
|
|
|
* BDF_PROPERTY_TYPE_NONE ::
|
|
|
|
* Value~0 is used to indicate a missing property.
|
|
|
|
*
|
|
|
|
* BDF_PROPERTY_TYPE_ATOM ::
|
|
|
|
* Property is a string atom.
|
|
|
|
*
|
|
|
|
* BDF_PROPERTY_TYPE_INTEGER ::
|
|
|
|
* Property is a 32-bit signed integer.
|
|
|
|
*
|
|
|
|
* BDF_PROPERTY_TYPE_CARDINAL ::
|
|
|
|
* Property is a 32-bit unsigned integer.
|
|
|
|
*/
|
2003-06-18 08:59:57 +02:00
|
|
|
typedef enum BDF_PropertyType_
|
2003-01-22 23:45:28 +01:00
|
|
|
{
|
|
|
|
BDF_PROPERTY_TYPE_NONE = 0,
|
|
|
|
BDF_PROPERTY_TYPE_ATOM = 1,
|
|
|
|
BDF_PROPERTY_TYPE_INTEGER = 2,
|
|
|
|
BDF_PROPERTY_TYPE_CARDINAL = 3
|
|
|
|
|
|
|
|
} BDF_PropertyType;
|
|
|
|
|
|
|
|
|
2008-06-26 21:56:51 +02:00
|
|
|
/**********************************************************************
|
|
|
|
*
|
|
|
|
* @type:
|
|
|
|
* BDF_Property
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* A handle to a @BDF_PropertyRec structure to model a given
|
|
|
|
* BDF/PCF property.
|
|
|
|
*/
|
2003-04-22 09:49:24 +02:00
|
|
|
typedef struct BDF_PropertyRec_* BDF_Property;
|
|
|
|
|
2003-01-22 23:45:28 +01:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
*
|
2003-04-22 09:49:24 +02:00
|
|
|
* @struct:
|
|
|
|
* BDF_PropertyRec
|
2003-01-22 23:45:28 +01:00
|
|
|
*
|
|
|
|
* @description:
|
2003-04-22 09:49:24 +02:00
|
|
|
* This structure models a given BDF/PCF property.
|
2003-01-22 23:45:28 +01:00
|
|
|
*
|
2003-04-22 09:49:24 +02:00
|
|
|
* @fields:
|
Make reference valid HTML 4.01 transitional.
* src/tools/docmaker/tohtml.py (html_header_1): Add doctype
and charset.
(html_header_2): Fix style elements and add some more.
Fix syntax.
(block_header, block_footer, description_header, description_footer,
marker_header, marker_footer, source_header, source_footer,
chapter_header, chapter_footer): Don't use <center>...</center> but
`align=center' table attribute.
Use double quotes around table widths given in percent.
(keyword_prefix, keyword_suffix): Don't change font colour directly
but use a new <span> class.
(section_synopsis_header, section_synopsis_footer): Don't change
colour.
(print_html_field): <tr> gets the `valign' attribute, not <table>.
(print_html_field_list): Ditto.
(index_exit): Don't use <center>...</center> but `align=center'
table attribute.
(toc_exit, section_enter): Ditto.
(block_enter): Use <h4><a>, not <a><h4>.
This change reimplements fix from 2003-05-30 without breaking
binary compatibility.
* include/freetype/t1tables.h (PS_FontInfoRec): `italic_angle',
`is_fixed_pitch', `underline_position', `underline_thickness' are
reverted to be normal values.
* include/freetype/internal/psaux.h (T1_FieldType): Remove
`T1_FIELD_TYPE_BOOL_P', `T1_FIELD_TYPE_INTEGER_P',
`T1_FIELD_TYPE_FIXED_P', `T1_FIELD_TYPE_FIXED_1000_P'.
(T1_FIELD_TYPE_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P,
T1_FIELD_FIXED_1000_P): Removed.
(T1_FIELD_TYPE_BOOL): Renamed to...
(T1_FIELD_BOOL): New macro. Updated all callers.
* src/type42/t42parse.c: `italic_angle', `is_fixed_pitch',
`underline_position', `underline_thickness', `paint_type',
`stroke_width' are reverted to be normal values.
(T42_KEYWORD_COUNT): New macro.
(t42_parse_dict): New array `keyword_flags' to mark that a value has
already been assigned to a dictionary entry.
* src/type42/t42objs.c (T42_Face_Init, T42_Face_Done): Updated.
* src/cid/cidtoken.h: `italic_angle', `is_fixed_pitch',
`underline_position', `underline_thickness' are reverted to be
normal values.
* src/cid/cidobjs.c (cid_face_done, cid_face_init): Updated.
* src/psaux/psobjs.c (ps_parser_load_field): Updated.
* src/type1/t1tokens.h: `italic_angle', `is_fixed_pitch',
`underline_position', `underline_thickness', `paint_type',
`stroke_width' are reverted to be normal values.
* src/type1/t1objs.c (T1_Face_Done, T1_Face_Init): Updated.
* src/type1/t1load.c (T1_FIELD_COUNT): New macro.
(parse_dict): Add parameter for keyword flags.
Record only first instance of a field.
(T1_Open_Face): New array `keyword_flags'.
2003-07-26 00:09:53 +02:00
|
|
|
* type ::
|
|
|
|
* The property type.
|
2003-04-22 09:49:24 +02:00
|
|
|
*
|
Make reference valid HTML 4.01 transitional.
* src/tools/docmaker/tohtml.py (html_header_1): Add doctype
and charset.
(html_header_2): Fix style elements and add some more.
Fix syntax.
(block_header, block_footer, description_header, description_footer,
marker_header, marker_footer, source_header, source_footer,
chapter_header, chapter_footer): Don't use <center>...</center> but
`align=center' table attribute.
Use double quotes around table widths given in percent.
(keyword_prefix, keyword_suffix): Don't change font colour directly
but use a new <span> class.
(section_synopsis_header, section_synopsis_footer): Don't change
colour.
(print_html_field): <tr> gets the `valign' attribute, not <table>.
(print_html_field_list): Ditto.
(index_exit): Don't use <center>...</center> but `align=center'
table attribute.
(toc_exit, section_enter): Ditto.
(block_enter): Use <h4><a>, not <a><h4>.
This change reimplements fix from 2003-05-30 without breaking
binary compatibility.
* include/freetype/t1tables.h (PS_FontInfoRec): `italic_angle',
`is_fixed_pitch', `underline_position', `underline_thickness' are
reverted to be normal values.
* include/freetype/internal/psaux.h (T1_FieldType): Remove
`T1_FIELD_TYPE_BOOL_P', `T1_FIELD_TYPE_INTEGER_P',
`T1_FIELD_TYPE_FIXED_P', `T1_FIELD_TYPE_FIXED_1000_P'.
(T1_FIELD_TYPE_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P,
T1_FIELD_FIXED_1000_P): Removed.
(T1_FIELD_TYPE_BOOL): Renamed to...
(T1_FIELD_BOOL): New macro. Updated all callers.
* src/type42/t42parse.c: `italic_angle', `is_fixed_pitch',
`underline_position', `underline_thickness', `paint_type',
`stroke_width' are reverted to be normal values.
(T42_KEYWORD_COUNT): New macro.
(t42_parse_dict): New array `keyword_flags' to mark that a value has
already been assigned to a dictionary entry.
* src/type42/t42objs.c (T42_Face_Init, T42_Face_Done): Updated.
* src/cid/cidtoken.h: `italic_angle', `is_fixed_pitch',
`underline_position', `underline_thickness' are reverted to be
normal values.
* src/cid/cidobjs.c (cid_face_done, cid_face_init): Updated.
* src/psaux/psobjs.c (ps_parser_load_field): Updated.
* src/type1/t1tokens.h: `italic_angle', `is_fixed_pitch',
`underline_position', `underline_thickness', `paint_type',
`stroke_width' are reverted to be normal values.
* src/type1/t1objs.c (T1_Face_Done, T1_Face_Init): Updated.
* src/type1/t1load.c (T1_FIELD_COUNT): New macro.
(parse_dict): Add parameter for keyword flags.
Record only first instance of a field.
(T1_Open_Face): New array `keyword_flags'.
2003-07-26 00:09:53 +02:00
|
|
|
* u.atom ::
|
|
|
|
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
|
|
|
|
*
|
|
|
|
* u.integer ::
|
|
|
|
* A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
|
|
|
|
*
|
|
|
|
* u.cardinal ::
|
|
|
|
* An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
|
2003-01-22 23:45:28 +01:00
|
|
|
*/
|
2003-04-22 09:49:24 +02:00
|
|
|
typedef struct BDF_PropertyRec_
|
2003-01-22 23:45:28 +01:00
|
|
|
{
|
2003-04-22 09:49:24 +02:00
|
|
|
BDF_PropertyType type;
|
2003-01-22 23:45:28 +01:00
|
|
|
union {
|
2003-04-22 09:49:24 +02:00
|
|
|
const char* atom;
|
|
|
|
FT_Int32 integer;
|
|
|
|
FT_UInt32 cardinal;
|
2003-01-22 23:45:28 +01:00
|
|
|
|
|
|
|
} u;
|
|
|
|
|
|
|
|
} BDF_PropertyRec;
|
|
|
|
|
|
|
|
|
2002-05-28 22:14:28 +02:00
|
|
|
/**********************************************************************
|
|
|
|
*
|
2002-05-29 00:38:05 +02:00
|
|
|
* @function:
|
|
|
|
* FT_Get_BDF_Charset_ID
|
2002-05-28 22:14:28 +02:00
|
|
|
*
|
|
|
|
* @description:
|
2008-06-26 21:56:51 +02:00
|
|
|
* Retrieve a BDF font character set identity, according to
|
2002-05-29 00:38:05 +02:00
|
|
|
* the BDF specification.
|
2002-05-28 22:14:28 +02:00
|
|
|
*
|
|
|
|
* @input:
|
2002-05-29 00:38:05 +02:00
|
|
|
* face ::
|
2003-04-22 09:49:24 +02:00
|
|
|
* A handle to the input face.
|
2002-05-28 22:14:28 +02:00
|
|
|
*
|
|
|
|
* @output:
|
2002-05-29 00:38:05 +02:00
|
|
|
* acharset_encoding ::
|
2008-06-26 21:56:51 +02:00
|
|
|
* Charset encoding, as a C~string, owned by the face.
|
2002-05-29 00:38:05 +02:00
|
|
|
*
|
|
|
|
* acharset_registry ::
|
2008-06-26 21:56:51 +02:00
|
|
|
* Charset registry, as a C~string, owned by the face.
|
2002-05-28 22:14:28 +02:00
|
|
|
*
|
|
|
|
* @return:
|
2008-06-26 21:56:51 +02:00
|
|
|
* FreeType error code. 0~means success.
|
2002-05-28 22:14:28 +02:00
|
|
|
*
|
|
|
|
* @note:
|
2002-05-29 00:38:05 +02:00
|
|
|
* This function only works with BDF faces, returning an error otherwise.
|
2002-05-28 22:14:28 +02:00
|
|
|
*/
|
2002-05-21 22:50:53 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Get_BDF_Charset_ID( FT_Face face,
|
|
|
|
const char* *acharset_encoding,
|
|
|
|
const char* *acharset_registry );
|
|
|
|
|
2003-04-22 09:49:24 +02:00
|
|
|
|
2003-01-22 23:45:28 +01:00
|
|
|
/**********************************************************************
|
|
|
|
*
|
|
|
|
* @function:
|
|
|
|
* FT_Get_BDF_Property
|
|
|
|
*
|
|
|
|
* @description:
|
2008-06-26 21:56:51 +02:00
|
|
|
* Retrieve a BDF property from a BDF or PCF font file.
|
2003-01-22 23:45:28 +01:00
|
|
|
*
|
|
|
|
* @input:
|
2003-04-22 09:49:24 +02:00
|
|
|
* face :: A handle to the input face.
|
|
|
|
*
|
|
|
|
* name :: The property name.
|
2003-01-22 23:45:28 +01:00
|
|
|
*
|
|
|
|
* @output:
|
2003-04-22 09:49:24 +02:00
|
|
|
* aproperty :: The property.
|
2003-01-22 23:45:28 +01:00
|
|
|
*
|
|
|
|
* @return:
|
2008-06-26 21:56:51 +02:00
|
|
|
* FreeType error code. 0~means success.
|
2003-01-22 23:45:28 +01:00
|
|
|
*
|
|
|
|
* @note:
|
2003-04-22 09:49:24 +02:00
|
|
|
* This function works with BDF _and_ PCF fonts. It returns an error
|
|
|
|
* otherwise. It also returns an error if the property is not in the
|
2003-01-22 23:45:28 +01:00
|
|
|
* font.
|
|
|
|
*
|
2006-03-24 13:46:49 +01:00
|
|
|
* In case of error, `aproperty->type' is always set to
|
2003-04-22 09:49:24 +02:00
|
|
|
* @BDF_PROPERTY_TYPE_NONE.
|
2003-01-22 23:45:28 +01:00
|
|
|
*/
|
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Get_BDF_Property( FT_Face face,
|
|
|
|
const char* prop_name,
|
|
|
|
BDF_PropertyRec *aproperty );
|
|
|
|
|
2002-05-28 22:14:28 +02:00
|
|
|
/* */
|
|
|
|
|
2002-05-21 22:50:53 +02:00
|
|
|
FT_END_HEADER
|
|
|
|
|
2002-05-22 07:41:06 +02:00
|
|
|
#endif /* __FTBDF_H__ */
|
|
|
|
|
|
|
|
|
|
|
|
/* END */
|