29#include FT_INTERNAL_DEBUG_H
30#include FT_INTERNAL_STREAM_H
31#include FT_INTERNAL_OBJECTS_H
33#include FT_TRUETYPE_IDS_H
35#include FT_SERVICE_BDF_H
36#include FT_SERVICE_FONT_FORMAT_H
51#define FT_COMPONENT trace_bdfdriver
111 if ( charcode ==
code )
115 result = encodings[mid].glyph + 1;
119 if ( charcode <
code )
131 FT_UInt32 *acharcode )
151 if ( charcode ==
code )
155 result = encodings[mid].glyph + 1;
159 if ( charcode <
code )
166 if ( min < cmap->num_encodings )
173 if ( charcode > 0xFFFFFFFFUL )
175 FT_TRACE1((
"bdf_cmap_char_next: charcode 0x%x > 32bit API" ));
180 *acharcode = (FT_UInt32)charcode;
211 face->style_flags = 0;
246 for (
len = 0, nn = 0; nn < 4; nn++ )
258 strings[0] = (
char *)
"Regular";
270 s =
face->style_name;
272 for ( nn = 0; nn < 4; nn++ )
283 if (
s !=
face->style_name )
290 if ( nn == 0 || nn == 3 )
295 for ( mm = 0; mm <
len; mm++ )
327 FT_FREE( bdfface->family_name );
328 FT_FREE( bdfface->style_name );
330 FT_FREE( bdfface->available_sizes );
382 if ( face_index > 0 && ( face_index & 0xFFFF ) > 0 )
384 FT_ERROR((
"BDF_Face_Init: invalid face index\n" ));
386 return FT_THROW( Invalid_Argument );
393 FT_TRACE4((
" number of glyphs: allocated %d (used %d)\n",
395 font->glyphs_used ));
396 FT_TRACE4((
" number of unencoded glyphs: allocated %d (used %d)\n",
397 font->unencoded_size,
398 font->unencoded_used ));
400 bdfface->num_faces = 1;
401 bdfface->face_index = 0;
424 bdfface->family_name =
NULL;
431 bdfface->num_glyphs = (
FT_Long)(
font->glyphs_size + 1 );
433 bdfface->num_fixed_sizes = 1;
439 FT_Short resolution_x = 0, resolution_y = 0;
446 if (
font->font_ascent > 0x7FFF ||
font->font_ascent < -0x7FFF )
448 font->font_ascent =
font->font_ascent < 0 ? -0x7FFF : 0x7FFF;
449 FT_TRACE0((
"BDF_Face_Init: clamping font ascent to value %d\n",
450 font->font_ascent ));
452 if (
font->font_descent > 0x7FFF ||
font->font_descent < -0x7FFF )
454 font->font_descent =
font->font_descent < 0 ? -0x7FFF : 0x7FFF;
455 FT_TRACE0((
"BDF_Face_Init: clamping font descent to value %d\n",
456 font->font_descent ));
464#ifdef FT_DEBUG_LEVEL_TRACE
466 FT_TRACE0((
"BDF_Face_Init: negative average width\n" ));
468 if ( prop->
value.
l > 0x7FFFL * 10 - 5 ||
469 prop->
value.
l < -( 0x7FFFL * 10 - 5 ) )
471 bsize->
width = 0x7FFF;
472 FT_TRACE0((
"BDF_Face_Init: clamping average width to value %d\n",
487#ifdef FT_DEBUG_LEVEL_TRACE
489 FT_TRACE0((
"BDF_Face_Init: negative point size\n" ));
492 if ( prop->
value.
l > 0x504C2L ||
493 prop->
value.
l < -0x504C2L )
495 bsize->
size = 0x7FFF;
496 FT_TRACE0((
"BDF_Face_Init: clamping point size to value %d\n",
504 else if (
font->point_size )
506 if (
font->point_size > 0x7FFF )
508 bsize->
size = 0x7FFF;
509 FT_TRACE0((
"BDF_Face_Init: clamping point size to value %d\n",
524#ifdef FT_DEBUG_LEVEL_TRACE
526 FT_TRACE0((
"BDF_Face_Init: negative pixel size\n" ));
528 if ( prop->
value.
l > 0x7FFF || prop->
value.
l < -0x7FFF )
530 bsize->
y_ppem = 0x7FFF << 6;
531 FT_TRACE0((
"BDF_Face_Init: clamping pixel size to value %d\n",
545#ifdef FT_DEBUG_LEVEL_TRACE
547 FT_TRACE0((
"BDF_Face_Init: negative X resolution\n" ));
551 resolution_x = 0x7FFF;
552 FT_TRACE0((
"BDF_Face_Init: clamping X resolution to value %d\n",
566#ifdef FT_DEBUG_LEVEL_TRACE
568 FT_TRACE0((
"BDF_Face_Init: negative Y resolution\n" ));
572 resolution_y = 0x7FFF;
573 FT_TRACE0((
"BDF_Face_Init: clamping Y resolution to value %d\n",
586 if ( resolution_x && resolution_y )
603 face->default_glyph = 0;
604 for (
n = 0;
n <
font->glyphs_size;
n++ )
616 " idx %d is too large for this system\n",
n ));
631 if ( charset_registry && charset_encoding )
649 s =
face->charset_registry;
650 if ( (
s[0] ==
'i' ||
s[0] ==
'I' ) &&
651 (
s[1] ==
's' ||
s[1] ==
'S' ) &&
652 (
s[2] ==
'o' ||
s[2] ==
'O' ) )
670 charmap.
encoding = FT_ENCODING_NONE;
675 if ( unicode_charmap )
677 charmap.
encoding = FT_ENCODING_UNICODE;
696 charmap.
encoding = FT_ENCODING_ADOBE_STANDARD;
703 if ( bdfface->num_charmaps )
704 bdfface->charmap = bdfface->charmaps[0];
714 return FT_THROW( Unknown_File_Format );
779 FT_Int32 load_flags )
803 FT_TRACE1((
"BDF_Glyph_Load: glyph index %d\n", glyph_index ));
806 if ( glyph_index == 0 )
817 FT_TRACE1((
"BDF_Glyph_Load: too large pitch %d is truncated\n",
842 slot->format = FT_GLYPH_FORMAT_BITMAP;
872 const char* prop_name,
891 if ( prop->
value.
l > 0x7FFFFFFFL || prop->
value.
l < ( -1 - 0x7FFFFFFFL ) )
894 " too large integer 0x%x is truncated\n" ));
904 " too large cardinal 0x%x is truncated\n" ));
917 return FT_THROW( Invalid_Argument );
923 const char* *acharset_encoding,
924 const char* *acharset_registry )
926 *acharset_encoding =
face->charset_encoding;
927 *acharset_registry =
face->charset_registry;
bdf_get_font_property(bdf_font_t *font, const char *name)
bdf_free_font(bdf_font_t *font)
bdf_load_font(FT_Stream stream, FT_Memory memory, bdf_options_t *opts, bdf_font_t **font)
BDF_Face_Init(FT_Stream stream, FT_Face bdfface, FT_Int face_index, FT_Int num_params, FT_Parameter *params)
bdf_cmap_char_index(FT_CMap bdfcmap, FT_UInt32 charcode)
bdf_cmap_init(FT_CMap bdfcmap, FT_Pointer init_data)
BDF_Face_Done(FT_Face bdfface)
bdf_driver_requester(FT_Module module, const char *name)
BDF_Size_Request(FT_Size size, FT_Size_Request req)
static FT_Error bdf_interpret_style(BDF_Face bdf)
FT_CALLBACK_TABLE_DEF const FT_Driver_ClassRec bdf_driver_class
static const FT_ServiceDescRec bdf_services[]
bdf_cmap_done(FT_CMap bdfcmap)
BDF_Glyph_Load(FT_GlyphSlot slot, FT_Size size, FT_UInt glyph_index, FT_Int32 load_flags)
static const FT_CMap_ClassRec bdf_cmap_class
struct BDF_CMapRec_ * BDF_CMap
BDF_Size_Select(FT_Size size, FT_ULong strike_index)
static FT_Error bdf_get_bdf_property(BDF_Face face, const char *prop_name, BDF_PropertyRec *aproperty)
static FT_Error bdf_get_charset_id(BDF_Face face, const char **acharset_encoding, const char **acharset_registry)
bdf_cmap_char_next(FT_CMap bdfcmap, FT_UInt32 *acharcode)
struct BDF_CMapRec_ BDF_CMapRec
static const FT_Service_BDFRec bdf_service_bdf
struct BDF_FaceRec_ BDF_FaceRec
struct BDF_FaceRec_ * BDF_Face
FT_BEGIN_HEADER struct BDF_encoding_el_ BDF_encoding_el
#define TT_MS_ID_UNICODE_CS
#define TT_PLATFORM_MICROSOFT
#define TT_APPLE_ID_DEFAULT
#define TT_PLATFORM_APPLE_UNICODE
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
#define FT_STYLE_FLAG_ITALIC
#define FT_FACE_FLAG_FIXED_SIZES
@ FT_SIZE_REQUEST_TYPE_NOMINAL
@ FT_SIZE_REQUEST_TYPE_REAL_DIM
#define FT_FACE_FLAG_FIXED_WIDTH
struct FT_GlyphSlotRec_ FT_GlyphSlotRec
#define FT_FACE_FLAG_FAST_GLYPHS
#define FT_STYLE_FLAG_BOLD
#define FT_FACE_FLAG_HORIZONTAL
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
@ BDF_PROPERTY_TYPE_CARDINAL
@ BDF_PROPERTY_TYPE_INTEGER
#define FT_CALLBACK_DEF(x)
#define FT_CALLBACK_TABLE_DEF
#define FT_ASSERT(condition)
#define FT_TRACE0(varformat)
#define FT_ERROR(varformat)
#define FT_TRACE2(varformat)
#define FT_TRACE1(varformat)
#define FT_TRACE4(varformat)
FT_BEGIN_HEADER typedef signed long FT_Pos
#define FT_NEW_ARRAY(ptr, count)
#define FT_STRDUP(dst, str)
#define FT_SET_ERROR(expression)
#define FT_ALLOC(ptr, size)
#define FT_MODULE_FONT_DRIVER
#define FT_MODULE_DRIVER_NO_OUTLINES
ft_synthesize_vertical_metrics(FT_Glyph_Metrics *metrics, FT_Pos advance)
FT_Select_Metrics(FT_Face face, FT_ULong strike_index)
struct FT_DriverRec_ FT_DriverRec
#define FT_REQUEST_HEIGHT(req)
#define FT_FACE_MEMORY(x)
FT_CMap_New(FT_CMap_Class clazz, FT_Pointer init_data, FT_CharMap charmap, FT_CMap *acmap)
ft_glyphslot_set_bitmap(FT_GlyphSlot slot, FT_Byte *buffer)
ft_service_list_lookup(FT_ServiceDesc service_descriptors, const char *service_id)
#define FT_STREAM_SEEK(position)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLint GLint GLsizei GLsizei height
GLsizei const GLchar *const * strings
GLenum GLuint GLint GLenum face
GLsizei GLenum GLenum GLuint GLenum GLsizei * lengths
GLenum const GLfloat * params
static char memory[1024 *256]
BDF_encoding_el * encodings
union BDF_PropertyRec_::@4227 u
union bdf_property_t_::@4231 value
#define FT_SERVICE_ID_BDF
FT_Error(* FT_BDF_GetPropertyFunc)(FT_Face face, const char *prop_name, BDF_PropertyRec *aproperty)
FT_Error(* FT_BDF_GetCharsetIdFunc)(FT_Face face, const char **acharset_encoding, const char **acharset_registry)
#define FT_SERVICE_ID_FONT_FORMAT
#define FT_FONT_FORMAT_BDF
#define TT_ADOBE_ID_STANDARD
#define TT_PLATFORM_ADOBE