2002-06-08 08:47:18 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* t42objs.c */
|
|
|
|
/* */
|
|
|
|
/* Type 42 objects manager (body). */
|
|
|
|
/* */
|
2003-04-23 17:50:27 +02:00
|
|
|
/* Copyright 2002, 2003 by Roberto Alameda. */
|
2002-06-08 08:47:18 +02:00
|
|
|
/* */
|
|
|
|
/* 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-06-07 09:23:06 +02:00
|
|
|
#include "t42objs.h"
|
|
|
|
#include "t42parse.h"
|
2002-06-08 08:47:18 +02:00
|
|
|
#include "t42error.h"
|
2002-06-07 09:23:06 +02:00
|
|
|
#include FT_INTERNAL_DEBUG_H
|
|
|
|
#include FT_INTERNAL_STREAM_H
|
|
|
|
#include FT_LIST_H
|
|
|
|
|
2002-06-08 08:47:18 +02:00
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
#undef FT_COMPONENT
|
|
|
|
#define FT_COMPONENT trace_t42
|
|
|
|
|
|
|
|
|
|
|
|
static FT_Error
|
|
|
|
T42_Open_Face( T42_Face face )
|
|
|
|
{
|
|
|
|
T42_LoaderRec loader;
|
|
|
|
T42_Parser parser;
|
|
|
|
T1_Font type1 = &face->type1;
|
|
|
|
FT_Memory memory = face->root.memory;
|
|
|
|
FT_Error error;
|
|
|
|
|
|
|
|
PSAux_Service psaux = (PSAux_Service)face->psaux;
|
|
|
|
|
|
|
|
|
|
|
|
t42_loader_init( &loader, face );
|
|
|
|
|
|
|
|
parser = &loader.parser;
|
|
|
|
|
|
|
|
if ( FT_ALLOC( face->ttf_data, 12 ) )
|
|
|
|
goto Exit;
|
|
|
|
|
|
|
|
error = t42_parser_init( parser,
|
|
|
|
face->root.stream,
|
|
|
|
memory,
|
|
|
|
psaux);
|
|
|
|
if ( error )
|
|
|
|
goto Exit;
|
|
|
|
|
|
|
|
error = t42_parse_dict( face, &loader, parser->base_dict, parser->base_len );
|
|
|
|
|
|
|
|
if ( type1->font_type != 42 )
|
|
|
|
{
|
2002-06-08 08:47:18 +02:00
|
|
|
error = T42_Err_Unknown_File_Format;
|
2002-06-07 09:23:06 +02:00
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now, propagate the charstrings and glyphnames tables */
|
|
|
|
/* to the Type1 data */
|
|
|
|
type1->num_glyphs = loader.num_glyphs;
|
|
|
|
|
|
|
|
if ( !loader.charstrings.init ) {
|
|
|
|
FT_ERROR(( "T42_Open_Face: no charstrings array in face!\n" ));
|
2002-06-08 08:47:18 +02:00
|
|
|
error = T42_Err_Invalid_File_Format;
|
2002-06-07 09:23:06 +02:00
|
|
|
}
|
|
|
|
|
2002-06-08 08:47:18 +02:00
|
|
|
loader.charstrings.init = 0;
|
2002-06-07 09:23:06 +02:00
|
|
|
type1->charstrings_block = loader.charstrings.block;
|
|
|
|
type1->charstrings = loader.charstrings.elements;
|
|
|
|
type1->charstrings_len = loader.charstrings.lengths;
|
|
|
|
|
|
|
|
/* we copy the glyph names `block' and `elements' fields; */
|
|
|
|
/* the `lengths' field must be released later */
|
2002-06-08 08:47:18 +02:00
|
|
|
type1->glyph_names_block = loader.glyph_names.block;
|
|
|
|
type1->glyph_names = (FT_String**)loader.glyph_names.elements;
|
2002-06-07 09:23:06 +02:00
|
|
|
loader.glyph_names.block = 0;
|
|
|
|
loader.glyph_names.elements = 0;
|
|
|
|
|
|
|
|
/* we must now build type1.encoding when we have a custom array */
|
|
|
|
if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY )
|
|
|
|
{
|
|
|
|
FT_Int charcode, idx, min_char, max_char;
|
|
|
|
FT_Byte* char_name;
|
|
|
|
FT_Byte* glyph_name;
|
|
|
|
|
|
|
|
|
|
|
|
/* OK, we do the following: for each element in the encoding */
|
|
|
|
/* table, look up the index of the glyph having the same name */
|
|
|
|
/* as defined in the CharStrings array. */
|
|
|
|
/* The index is then stored in type1.encoding.char_index, and */
|
|
|
|
/* the name in type1.encoding.char_name */
|
|
|
|
|
|
|
|
min_char = +32000;
|
|
|
|
max_char = -32000;
|
|
|
|
|
|
|
|
charcode = 0;
|
|
|
|
for ( ; charcode < loader.encoding_table.max_elems; charcode++ )
|
|
|
|
{
|
|
|
|
type1->encoding.char_index[charcode] = 0;
|
|
|
|
type1->encoding.char_name [charcode] = (char *)".notdef";
|
|
|
|
|
|
|
|
char_name = loader.encoding_table.elements[charcode];
|
|
|
|
if ( char_name )
|
|
|
|
for ( idx = 0; idx < type1->num_glyphs; idx++ )
|
|
|
|
{
|
|
|
|
glyph_name = (FT_Byte*)type1->glyph_names[idx];
|
|
|
|
if ( ft_strcmp( (const char*)char_name,
|
|
|
|
(const char*)glyph_name ) == 0 )
|
|
|
|
{
|
|
|
|
type1->encoding.char_index[charcode] = (FT_UShort)idx;
|
|
|
|
type1->encoding.char_name [charcode] = (char*)glyph_name;
|
|
|
|
|
|
|
|
/* Change min/max encoded char only if glyph name is */
|
|
|
|
/* not /.notdef */
|
|
|
|
if ( ft_strcmp( (const char*)".notdef",
|
|
|
|
(const char*)glyph_name ) != 0 )
|
|
|
|
{
|
|
|
|
if ( charcode < min_char ) min_char = charcode;
|
|
|
|
if ( charcode > max_char ) max_char = charcode;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
type1->encoding.code_first = min_char;
|
|
|
|
type1->encoding.code_last = max_char;
|
|
|
|
type1->encoding.num_chars = loader.num_chars;
|
|
|
|
}
|
|
|
|
|
|
|
|
Exit:
|
|
|
|
t42_loader_done( &loader );
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***************** Driver Functions *************/
|
|
|
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( FT_Error )
|
|
|
|
T42_Face_Init( FT_Stream stream,
|
|
|
|
T42_Face face,
|
|
|
|
FT_Int face_index,
|
|
|
|
FT_Int num_params,
|
* src/sfnt/ttpost.c (load_post_names, tt_face_free_ps_names,
tt_face_get_ps_name): Replace switch statement with if clauses to
make it more portable.
* src/cff/cffobjs.c (cff_face_init): Ditto.
* include/freetype/ftmodule.h (FT_Module_Class): Use `FT_Long' for
`module_size'.
* include/freetype/ftrender.h (FT_Glyph_Class_): Use `FT_Long' for
`glyph_size'.
* src/base/ftobjs.c (FT_Render_Glyph): Change second parameter to
`FT_Render_Mode'.
(FT_Render_Glyph_Internal): Change third parameter to
`FT_Render_Mode'.
* src/base/ftglyph.c (FT_Glyph_To_Bitmap): Change second parameter
to `FT_Render_Mode'.
* src/raster/ftrend1.c (ft_raster1_render): Change third parameter
to `FT_Render_Mode'.
* src/smooth/ftsmooth.c (ft_smooth_render, ft_smooth_render_lcd,
ft_smooth_render_lcd_v): Ditto.
(ft_smooth_render_generic): Change third and fifth parameter to
`FT_Render_Mode'.
* include/freetype/freetype.h, include/freetype/internal/ftobjs.h,
include/freetype/ftglyph.h: Updated.
* src/cff/cffdrivr.c (Load_Glyph), src/pcf/pcfdriver.c
(PCF_Glyph_Load), src/pfr/pfrobjs.c (pfr_slot_load),
src/winfonts/winfnt.c (FNT_Load_Glyph), src/t42/t42objs.c
(T42_GlyphSlot_Load), src/bdf/bdfdrivr.c (BDF_Glyph_Load): Change
fourth parameter to `FT_Int32'.
* src/pfr/pfrobjs.c (pfr_face_init): Add two missing parameters
and declare them as unused.
* src/cid/cidparse.h (CID_Parser): Use FT_Long for `postscript_len'.
* src/psnames/psnames.h (PS_Unicode_Value_Func): Change return
value to FT_UInt32.
* src/psnames/psmodule.c (ps_unicode_value, ps_build_unicode_table):
Updated accordingly.
* src/cff/cffdrivr.c (Get_Kerning): Use FT_Long for `middle'.
(cff_get_glyph_name): Use cast for result of ft_strlen.
* src/cff/cffparse.c (cff_parse_real): User cast for assigning
`exp'.
* src/cff/cffload.c (cff_index_get_pointers): Use FT_ULong for
some local variables.
(cff_charset_load, cff_encoding_load): Use casts to FT_UInt for some
switch statements.
(cff_font_load): Use cast in call to CFF_Load_FD_Select.
* src/cff/cffobjs.c (cff_size_init): Use more casts.
(cff_face_init): Use FT_Int32 for `flags'.
* src/cff/cffgload.c (cff_operator_seac): Use cast for assigning
`adx' and `ady'.
(cff_decoder_parse_charstrings): Use FT_ULong for third parameter.
Use more casts.
* src/cff/cffcmap.c (cff_cmap_unicode_init): Use cast for `count'.
* src/cid/cidload.c (cid_read_subrs): Use FT_ULong for `len'.
* src/cid/cidgload.c (cid_load_glyph): Add missing cast for
`cid_get_offset'.
* src/psaux/t1decode.c (t1_decoder_parse_charstrings) <18>: Use
cast for `num_points'.
(t1_decoder_init): Use cast for assigning `decoder->num_glyphs'.
* src/base/ftdebug.c (ft_debug_init): Use FT_Int.
* include/freetype/internal/ftdriver.h (FT_Slot_LoadFunc): Use
`FT_Int32' for fourth parameter.
* src/base/ftobjs.c (open_face): Use cast for calling
clazz->init_face.
* src/raster/ftraster.c (Set_High_Precision): Use `1' instead of
`1L'.
(Finalize_Profile_Table, Line_Up, ft_black_init): Use casts.
* src/raster/ftrend1.c (ft_raster1_render): Ditto.
* src/sfnt/sfnt_dir_check: Compare `magic' with unsigned long
constant.
* builds/amiga/include/freetype/config/ftmodule.h: Updated.
2002-09-27 13:09:23 +02:00
|
|
|
FT_Parameter* params )
|
2002-06-07 09:23:06 +02:00
|
|
|
{
|
Avoid overwriting of numeric font dictionary entries for synthetic
fonts. Additionally, some entries were handled as `integer' instead
of `number'.
* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
T1_FIELD_TYPE_FIXED_P.
(T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.
* include/freetype/internal/cfftypes.h (CFF_FontRecDict),
src/cff/cfftoken.h: Change type of underline_position and
underline_thickness to FT_Fixed.
* src/cff/cffload.c (cff_subfont_load): Fix default values of
underline_position and underline_thickness.
* src/cff/cffobjs.c (cff_face_init): Set underline_position
and underline_thickness in `root'.
* include/freetype/internal/t1types.h (T1_Font): Change point_type
and stroke_width to pointers.
* include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
is_fixed_pitch, underline_position, and underline_thickness to
pointers.
* src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type1/t1objs.c (T1_Face_Done): Updated.
(T1_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed'.
* src/cid/cidobjs.c (cid_face_done): Updated.
(cid_face_init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change the
type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type42/t42objs.c (T42_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
(T42_Face_Done): Updated.
* src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
* src/pshinter/pshglob.c, src/pshinter/pshglob.h
(psh_globals_set_scale): Make it a local function.
* test/gview.c: Fix remaming ps3->ps typo.
Formatting.
2003-05-30 11:12:50 +02:00
|
|
|
FT_Error error;
|
|
|
|
PSNames_Service psnames;
|
|
|
|
PSAux_Service psaux;
|
|
|
|
FT_Face root = (FT_Face)&face->root;
|
|
|
|
T1_Font type1 = &face->type1;
|
|
|
|
PS_FontInfo info = &type1->font_info;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
FT_UNUSED( num_params );
|
|
|
|
FT_UNUSED( params );
|
|
|
|
FT_UNUSED( face_index );
|
|
|
|
FT_UNUSED( stream );
|
|
|
|
|
|
|
|
|
|
|
|
face->ttf_face = NULL;
|
|
|
|
face->root.num_faces = 1;
|
|
|
|
|
|
|
|
face->psnames = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
|
|
|
|
"psnames" );
|
|
|
|
psnames = (PSNames_Service)face->psnames;
|
|
|
|
|
|
|
|
face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
|
|
|
|
"psaux" );
|
|
|
|
psaux = (PSAux_Service)face->psaux;
|
|
|
|
|
|
|
|
/* open the tokenizer, this will also check the font format */
|
|
|
|
error = T42_Open_Face( face );
|
|
|
|
if ( error )
|
|
|
|
goto Exit;
|
|
|
|
|
|
|
|
/* if we just wanted to check the format, leave successfully now */
|
|
|
|
if ( face_index < 0 )
|
|
|
|
goto Exit;
|
|
|
|
|
|
|
|
/* check the face index */
|
|
|
|
if ( face_index != 0 )
|
|
|
|
{
|
|
|
|
FT_ERROR(( "T42_Face_Init: invalid face index\n" ));
|
2002-06-08 08:47:18 +02:00
|
|
|
error = T42_Err_Invalid_Argument;
|
2002-06-07 09:23:06 +02:00
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Now, load the font program into the face object */
|
|
|
|
|
|
|
|
/* Init the face object fields */
|
|
|
|
/* Now set up root face fields */
|
|
|
|
|
Avoid overwriting of numeric font dictionary entries for synthetic
fonts. Additionally, some entries were handled as `integer' instead
of `number'.
* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
T1_FIELD_TYPE_FIXED_P.
(T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.
* include/freetype/internal/cfftypes.h (CFF_FontRecDict),
src/cff/cfftoken.h: Change type of underline_position and
underline_thickness to FT_Fixed.
* src/cff/cffload.c (cff_subfont_load): Fix default values of
underline_position and underline_thickness.
* src/cff/cffobjs.c (cff_face_init): Set underline_position
and underline_thickness in `root'.
* include/freetype/internal/t1types.h (T1_Font): Change point_type
and stroke_width to pointers.
* include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
is_fixed_pitch, underline_position, and underline_thickness to
pointers.
* src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type1/t1objs.c (T1_Face_Done): Updated.
(T1_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed'.
* src/cid/cidobjs.c (cid_face_done): Updated.
(cid_face_init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change the
type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type42/t42objs.c (T42_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
(T42_Face_Done): Updated.
* src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
* src/pshinter/pshglob.c, src/pshinter/pshglob.h
(psh_globals_set_scale): Make it a local function.
* test/gview.c: Fix remaming ps3->ps typo.
Formatting.
2003-05-30 11:12:50 +02:00
|
|
|
root->num_glyphs = type1->num_glyphs;
|
2002-06-07 09:23:06 +02:00
|
|
|
root->num_charmaps = 0;
|
2002-06-08 08:47:18 +02:00
|
|
|
root->face_index = face_index;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
root->face_flags = FT_FACE_FLAG_SCALABLE;
|
|
|
|
root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
|
|
|
|
root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
|
|
|
|
|
Avoid overwriting of numeric font dictionary entries for synthetic
fonts. Additionally, some entries were handled as `integer' instead
of `number'.
* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
T1_FIELD_TYPE_FIXED_P.
(T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.
* include/freetype/internal/cfftypes.h (CFF_FontRecDict),
src/cff/cfftoken.h: Change type of underline_position and
underline_thickness to FT_Fixed.
* src/cff/cffload.c (cff_subfont_load): Fix default values of
underline_position and underline_thickness.
* src/cff/cffobjs.c (cff_face_init): Set underline_position
and underline_thickness in `root'.
* include/freetype/internal/t1types.h (T1_Font): Change point_type
and stroke_width to pointers.
* include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
is_fixed_pitch, underline_position, and underline_thickness to
pointers.
* src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type1/t1objs.c (T1_Face_Done): Updated.
(T1_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed'.
* src/cid/cidobjs.c (cid_face_done): Updated.
(cid_face_init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change the
type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type42/t42objs.c (T42_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
(T42_Face_Done): Updated.
* src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
* src/pshinter/pshglob.c, src/pshinter/pshglob.h
(psh_globals_set_scale): Make it a local function.
* test/gview.c: Fix remaming ps3->ps typo.
Formatting.
2003-05-30 11:12:50 +02:00
|
|
|
if ( info->is_fixed_pitch && *info->is_fixed_pitch )
|
2002-06-07 09:23:06 +02:00
|
|
|
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
|
|
|
|
|
|
|
|
/* XXX: TODO -- add kerning with .afm support */
|
|
|
|
|
|
|
|
/* get style name -- be careful, some broken fonts only */
|
|
|
|
/* have a `/FontName' dictionary entry! */
|
Avoid overwriting of numeric font dictionary entries for synthetic
fonts. Additionally, some entries were handled as `integer' instead
of `number'.
* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
T1_FIELD_TYPE_FIXED_P.
(T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.
* include/freetype/internal/cfftypes.h (CFF_FontRecDict),
src/cff/cfftoken.h: Change type of underline_position and
underline_thickness to FT_Fixed.
* src/cff/cffload.c (cff_subfont_load): Fix default values of
underline_position and underline_thickness.
* src/cff/cffobjs.c (cff_face_init): Set underline_position
and underline_thickness in `root'.
* include/freetype/internal/t1types.h (T1_Font): Change point_type
and stroke_width to pointers.
* include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
is_fixed_pitch, underline_position, and underline_thickness to
pointers.
* src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type1/t1objs.c (T1_Face_Done): Updated.
(T1_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed'.
* src/cid/cidobjs.c (cid_face_done): Updated.
(cid_face_init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change the
type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type42/t42objs.c (T42_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
(T42_Face_Done): Updated.
* src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
* src/pshinter/pshglob.c, src/pshinter/pshglob.h
(psh_globals_set_scale): Make it a local function.
* test/gview.c: Fix remaming ps3->ps typo.
Formatting.
2003-05-30 11:12:50 +02:00
|
|
|
root->family_name = info->family_name;
|
2003-06-12 06:59:07 +02:00
|
|
|
/* assume "Regular" style if we don't know better */
|
|
|
|
root->style_name = (char *)"Regular";
|
2002-06-07 09:23:06 +02:00
|
|
|
if ( root->family_name )
|
|
|
|
{
|
Avoid overwriting of numeric font dictionary entries for synthetic
fonts. Additionally, some entries were handled as `integer' instead
of `number'.
* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
T1_FIELD_TYPE_FIXED_P.
(T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.
* include/freetype/internal/cfftypes.h (CFF_FontRecDict),
src/cff/cfftoken.h: Change type of underline_position and
underline_thickness to FT_Fixed.
* src/cff/cffload.c (cff_subfont_load): Fix default values of
underline_position and underline_thickness.
* src/cff/cffobjs.c (cff_face_init): Set underline_position
and underline_thickness in `root'.
* include/freetype/internal/t1types.h (T1_Font): Change point_type
and stroke_width to pointers.
* include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
is_fixed_pitch, underline_position, and underline_thickness to
pointers.
* src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type1/t1objs.c (T1_Face_Done): Updated.
(T1_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed'.
* src/cid/cidobjs.c (cid_face_done): Updated.
(cid_face_init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change the
type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type42/t42objs.c (T42_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
(T42_Face_Done): Updated.
* src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
* src/pshinter/pshglob.c, src/pshinter/pshglob.h
(psh_globals_set_scale): Make it a local function.
* test/gview.c: Fix remaming ps3->ps typo.
Formatting.
2003-05-30 11:12:50 +02:00
|
|
|
char* full = info->full_name;
|
2002-06-07 09:23:06 +02:00
|
|
|
char* family = root->family_name;
|
|
|
|
|
|
|
|
|
|
|
|
if ( full )
|
|
|
|
{
|
2003-06-12 06:59:07 +02:00
|
|
|
while ( *full )
|
2002-06-07 09:23:06 +02:00
|
|
|
{
|
2003-06-12 06:59:07 +02:00
|
|
|
if ( *full == *family )
|
|
|
|
{
|
|
|
|
family++;
|
|
|
|
full++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( *full == ' ' || *full == '-' )
|
|
|
|
full++;
|
|
|
|
else if ( *family == ' ' || *family == '-' )
|
|
|
|
family++;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( !*family )
|
|
|
|
root->style_name = full;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2002-06-07 09:23:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* do we have a `/FontName'? */
|
Avoid overwriting of numeric font dictionary entries for synthetic
fonts. Additionally, some entries were handled as `integer' instead
of `number'.
* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
T1_FIELD_TYPE_FIXED_P.
(T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.
* include/freetype/internal/cfftypes.h (CFF_FontRecDict),
src/cff/cfftoken.h: Change type of underline_position and
underline_thickness to FT_Fixed.
* src/cff/cffload.c (cff_subfont_load): Fix default values of
underline_position and underline_thickness.
* src/cff/cffobjs.c (cff_face_init): Set underline_position
and underline_thickness in `root'.
* include/freetype/internal/t1types.h (T1_Font): Change point_type
and stroke_width to pointers.
* include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
is_fixed_pitch, underline_position, and underline_thickness to
pointers.
* src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type1/t1objs.c (T1_Face_Done): Updated.
(T1_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed'.
* src/cid/cidobjs.c (cid_face_done): Updated.
(cid_face_init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change the
type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type42/t42objs.c (T42_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
(T42_Face_Done): Updated.
* src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
* src/pshinter/pshglob.c, src/pshinter/pshglob.h
(psh_globals_set_scale): Make it a local function.
* test/gview.c: Fix remaming ps3->ps typo.
Formatting.
2003-05-30 11:12:50 +02:00
|
|
|
if ( type1->font_name )
|
|
|
|
root->family_name = type1->font_name;
|
2002-06-07 09:23:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* no embedded bitmap support */
|
|
|
|
root->num_fixed_sizes = 0;
|
|
|
|
root->available_sizes = 0;
|
|
|
|
|
|
|
|
/* Load the TTF font embedded in the T42 font */
|
|
|
|
error = FT_New_Memory_Face( FT_FACE_LIBRARY( face ),
|
|
|
|
face->ttf_data,
|
|
|
|
face->ttf_size,
|
|
|
|
0,
|
|
|
|
&face->ttf_face );
|
|
|
|
if ( error )
|
|
|
|
goto Exit;
|
|
|
|
|
2002-06-11 22:35:58 +02:00
|
|
|
FT_Done_Size( face->ttf_face->size );
|
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
/* Ignore info in FontInfo dictionary and use the info from the */
|
|
|
|
/* loaded TTF font. The PostScript interpreter also ignores it. */
|
|
|
|
root->bbox = face->ttf_face->bbox;
|
|
|
|
root->units_per_EM = face->ttf_face->units_per_EM;
|
|
|
|
|
|
|
|
root->ascender = face->ttf_face->ascender;
|
|
|
|
root->descender = face->ttf_face->descender;
|
|
|
|
root->height = face->ttf_face->height;
|
|
|
|
|
2002-06-08 08:47:18 +02:00
|
|
|
root->max_advance_width = face->ttf_face->max_advance_width;
|
2002-06-07 09:23:06 +02:00
|
|
|
root->max_advance_height = face->ttf_face->max_advance_height;
|
|
|
|
|
Avoid overwriting of numeric font dictionary entries for synthetic
fonts. Additionally, some entries were handled as `integer' instead
of `number'.
* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
T1_FIELD_TYPE_FIXED_P.
(T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.
* include/freetype/internal/cfftypes.h (CFF_FontRecDict),
src/cff/cfftoken.h: Change type of underline_position and
underline_thickness to FT_Fixed.
* src/cff/cffload.c (cff_subfont_load): Fix default values of
underline_position and underline_thickness.
* src/cff/cffobjs.c (cff_face_init): Set underline_position
and underline_thickness in `root'.
* include/freetype/internal/t1types.h (T1_Font): Change point_type
and stroke_width to pointers.
* include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
is_fixed_pitch, underline_position, and underline_thickness to
pointers.
* src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type1/t1objs.c (T1_Face_Done): Updated.
(T1_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed'.
* src/cid/cidobjs.c (cid_face_done): Updated.
(cid_face_init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change the
type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type42/t42objs.c (T42_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
(T42_Face_Done): Updated.
* src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
* src/pshinter/pshglob.c, src/pshinter/pshglob.h
(psh_globals_set_scale): Make it a local function.
* test/gview.c: Fix remaming ps3->ps typo.
Formatting.
2003-05-30 11:12:50 +02:00
|
|
|
if ( info->underline_position )
|
|
|
|
root->underline_position = *info->underline_position >> 16;
|
|
|
|
if ( info->underline_thickness )
|
|
|
|
root->underline_thickness = *info->underline_thickness >> 16;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
root->internal->max_points = 0;
|
|
|
|
root->internal->max_contours = 0;
|
|
|
|
|
|
|
|
/* compute style flags */
|
|
|
|
root->style_flags = 0;
|
Avoid overwriting of numeric font dictionary entries for synthetic
fonts. Additionally, some entries were handled as `integer' instead
of `number'.
* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
T1_FIELD_TYPE_FIXED_P.
(T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.
* include/freetype/internal/cfftypes.h (CFF_FontRecDict),
src/cff/cfftoken.h: Change type of underline_position and
underline_thickness to FT_Fixed.
* src/cff/cffload.c (cff_subfont_load): Fix default values of
underline_position and underline_thickness.
* src/cff/cffobjs.c (cff_face_init): Set underline_position
and underline_thickness in `root'.
* include/freetype/internal/t1types.h (T1_Font): Change point_type
and stroke_width to pointers.
* include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
is_fixed_pitch, underline_position, and underline_thickness to
pointers.
* src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type1/t1objs.c (T1_Face_Done): Updated.
(T1_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed'.
* src/cid/cidobjs.c (cid_face_done): Updated.
(cid_face_init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change the
type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type42/t42objs.c (T42_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
(T42_Face_Done): Updated.
* src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
* src/pshinter/pshglob.c, src/pshinter/pshglob.h
(psh_globals_set_scale): Make it a local function.
* test/gview.c: Fix remaming ps3->ps typo.
Formatting.
2003-05-30 11:12:50 +02:00
|
|
|
if ( info->italic_angle && *info->italic_angle )
|
2002-06-07 09:23:06 +02:00
|
|
|
root->style_flags |= FT_STYLE_FLAG_ITALIC;
|
|
|
|
|
|
|
|
if ( face->ttf_face->style_flags & FT_STYLE_FLAG_BOLD )
|
|
|
|
root->style_flags |= FT_STYLE_FLAG_BOLD;
|
|
|
|
|
|
|
|
if ( face->ttf_face->face_flags & FT_FACE_FLAG_VERTICAL )
|
|
|
|
root->face_flags |= FT_FACE_FLAG_VERTICAL;
|
|
|
|
|
|
|
|
{
|
|
|
|
if ( psnames && psaux )
|
|
|
|
{
|
|
|
|
FT_CharMapRec charmap;
|
|
|
|
T1_CMap_Classes cmap_classes = psaux->t1_cmap_classes;
|
|
|
|
FT_CMap_Class clazz;
|
|
|
|
|
|
|
|
|
|
|
|
charmap.face = root;
|
|
|
|
|
|
|
|
/* first of all, try to synthetize a Unicode charmap */
|
|
|
|
charmap.platform_id = 3;
|
|
|
|
charmap.encoding_id = 1;
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
charmap.encoding = FT_ENCODING_UNICODE;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
|
|
|
|
|
|
|
|
/* now, generate an Adobe Standard encoding when appropriate */
|
|
|
|
charmap.platform_id = 7;
|
|
|
|
clazz = NULL;
|
|
|
|
|
Avoid overwriting of numeric font dictionary entries for synthetic
fonts. Additionally, some entries were handled as `integer' instead
of `number'.
* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
T1_FIELD_TYPE_FIXED_P.
(T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.
* include/freetype/internal/cfftypes.h (CFF_FontRecDict),
src/cff/cfftoken.h: Change type of underline_position and
underline_thickness to FT_Fixed.
* src/cff/cffload.c (cff_subfont_load): Fix default values of
underline_position and underline_thickness.
* src/cff/cffobjs.c (cff_face_init): Set underline_position
and underline_thickness in `root'.
* include/freetype/internal/t1types.h (T1_Font): Change point_type
and stroke_width to pointers.
* include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
is_fixed_pitch, underline_position, and underline_thickness to
pointers.
* src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type1/t1objs.c (T1_Face_Done): Updated.
(T1_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed'.
* src/cid/cidobjs.c (cid_face_done): Updated.
(cid_face_init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change the
type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type42/t42objs.c (T42_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
(T42_Face_Done): Updated.
* src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
* src/pshinter/pshglob.c, src/pshinter/pshglob.h
(psh_globals_set_scale): Make it a local function.
* test/gview.c: Fix remaming ps3->ps typo.
Formatting.
2003-05-30 11:12:50 +02:00
|
|
|
switch ( type1->encoding_type )
|
2002-06-07 09:23:06 +02:00
|
|
|
{
|
|
|
|
case T1_ENCODING_TYPE_STANDARD:
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
charmap.encoding = FT_ENCODING_ADOBE_STANDARD;
|
2002-06-07 09:23:06 +02:00
|
|
|
charmap.encoding_id = 0;
|
|
|
|
clazz = cmap_classes->standard;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T1_ENCODING_TYPE_EXPERT:
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
charmap.encoding = FT_ENCODING_ADOBE_EXPERT;
|
2002-06-07 09:23:06 +02:00
|
|
|
charmap.encoding_id = 1;
|
|
|
|
clazz = cmap_classes->expert;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T1_ENCODING_TYPE_ARRAY:
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
charmap.encoding = FT_ENCODING_ADOBE_CUSTOM;
|
2002-06-07 09:23:06 +02:00
|
|
|
charmap.encoding_id = 2;
|
|
|
|
clazz = cmap_classes->custom;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T1_ENCODING_TYPE_ISOLATIN1:
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
charmap.encoding = FT_ENCODING_ADOBE_LATIN_1;
|
2002-06-07 09:23:06 +02:00
|
|
|
charmap.encoding_id = 3;
|
|
|
|
clazz = cmap_classes->unicode;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( clazz )
|
|
|
|
FT_CMap_New( clazz, NULL, &charmap, NULL );
|
|
|
|
|
2002-07-18 00:51:06 +02:00
|
|
|
#if 0
|
2002-06-08 08:47:18 +02:00
|
|
|
/* Select default charmap */
|
|
|
|
if (root->num_charmaps)
|
|
|
|
root->charmap = root->charmaps[0];
|
2002-07-18 00:51:06 +02:00
|
|
|
#endif
|
2002-06-07 09:23:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
Exit:
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( void )
|
|
|
|
T42_Face_Done( T42_Face face )
|
|
|
|
{
|
|
|
|
T1_Font type1;
|
|
|
|
PS_FontInfo info;
|
|
|
|
FT_Memory memory;
|
|
|
|
|
|
|
|
|
|
|
|
if ( face )
|
|
|
|
{
|
2002-06-08 08:47:18 +02:00
|
|
|
type1 = &face->type1;
|
2002-06-07 09:23:06 +02:00
|
|
|
info = &type1->font_info;
|
|
|
|
memory = face->root.memory;
|
|
|
|
|
|
|
|
/* delete internal ttf face prior to freeing face->ttf_data */
|
|
|
|
if ( face->ttf_face )
|
|
|
|
FT_Done_Face( face->ttf_face );
|
|
|
|
|
|
|
|
/* release font info strings */
|
|
|
|
FT_FREE( info->version );
|
|
|
|
FT_FREE( info->notice );
|
|
|
|
FT_FREE( info->full_name );
|
|
|
|
FT_FREE( info->family_name );
|
|
|
|
FT_FREE( info->weight );
|
|
|
|
|
Avoid overwriting of numeric font dictionary entries for synthetic
fonts. Additionally, some entries were handled as `integer' instead
of `number'.
* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
T1_FIELD_TYPE_FIXED_P.
(T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.
* include/freetype/internal/cfftypes.h (CFF_FontRecDict),
src/cff/cfftoken.h: Change type of underline_position and
underline_thickness to FT_Fixed.
* src/cff/cffload.c (cff_subfont_load): Fix default values of
underline_position and underline_thickness.
* src/cff/cffobjs.c (cff_face_init): Set underline_position
and underline_thickness in `root'.
* include/freetype/internal/t1types.h (T1_Font): Change point_type
and stroke_width to pointers.
* include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
is_fixed_pitch, underline_position, and underline_thickness to
pointers.
* src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type1/t1objs.c (T1_Face_Done): Updated.
(T1_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed'.
* src/cid/cidobjs.c (cid_face_done): Updated.
(cid_face_init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change the
type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type42/t42objs.c (T42_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
(T42_Face_Done): Updated.
* src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
* src/pshinter/pshglob.c, src/pshinter/pshglob.h
(psh_globals_set_scale): Make it a local function.
* test/gview.c: Fix remaming ps3->ps typo.
Formatting.
2003-05-30 11:12:50 +02:00
|
|
|
FT_FREE( info->italic_angle );
|
|
|
|
FT_FREE( info->underline_position );
|
|
|
|
FT_FREE( info->underline_thickness );
|
|
|
|
FT_FREE( info->is_fixed_pitch );
|
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
/* release top dictionary */
|
|
|
|
FT_FREE( type1->charstrings_len );
|
|
|
|
FT_FREE( type1->charstrings );
|
|
|
|
FT_FREE( type1->glyph_names );
|
|
|
|
|
|
|
|
FT_FREE( type1->charstrings_block );
|
|
|
|
FT_FREE( type1->glyph_names_block );
|
|
|
|
|
|
|
|
FT_FREE( type1->encoding.char_index );
|
|
|
|
FT_FREE( type1->encoding.char_name );
|
|
|
|
FT_FREE( type1->font_name );
|
|
|
|
|
Avoid overwriting of numeric font dictionary entries for synthetic
fonts. Additionally, some entries were handled as `integer' instead
of `number'.
* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
T1_FIELD_TYPE_FIXED_P.
(T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.
* include/freetype/internal/cfftypes.h (CFF_FontRecDict),
src/cff/cfftoken.h: Change type of underline_position and
underline_thickness to FT_Fixed.
* src/cff/cffload.c (cff_subfont_load): Fix default values of
underline_position and underline_thickness.
* src/cff/cffobjs.c (cff_face_init): Set underline_position
and underline_thickness in `root'.
* include/freetype/internal/t1types.h (T1_Font): Change point_type
and stroke_width to pointers.
* include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
is_fixed_pitch, underline_position, and underline_thickness to
pointers.
* src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type1/t1objs.c (T1_Face_Done): Updated.
(T1_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed'.
* src/cid/cidobjs.c (cid_face_done): Updated.
(cid_face_init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change the
type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type42/t42objs.c (T42_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
(T42_Face_Done): Updated.
* src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
* src/pshinter/pshglob.c, src/pshinter/pshglob.h
(psh_globals_set_scale): Make it a local function.
* test/gview.c: Fix remaming ps3->ps typo.
Formatting.
2003-05-30 11:12:50 +02:00
|
|
|
FT_FREE( type1->paint_type );
|
|
|
|
FT_FREE( type1->stroke_width );
|
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
FT_FREE( face->ttf_data );
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* release afm data if present */
|
|
|
|
if ( face->afm_data )
|
|
|
|
T1_Done_AFM( memory, (T1_AFM*)face->afm_data );
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* release unicode map, if any */
|
|
|
|
FT_FREE( face->unicode_map.maps );
|
|
|
|
face->unicode_map.num_maps = 0;
|
|
|
|
|
|
|
|
face->root.family_name = 0;
|
|
|
|
face->root.style_name = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-06-08 08:47:18 +02:00
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* T42_Driver_Init */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Initializes a given Type 42 driver object. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* driver :: A handle to the target driver object. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
FT_LOCAL_DEF( FT_Error )
|
|
|
|
T42_Driver_Init( T42_Driver driver )
|
|
|
|
{
|
|
|
|
FT_Module ttmodule;
|
|
|
|
|
|
|
|
|
|
|
|
ttmodule = FT_Get_Module( FT_MODULE(driver)->library, "truetype" );
|
|
|
|
driver->ttclazz = (FT_Driver_Class)ttmodule->clazz;
|
|
|
|
|
2002-06-08 08:47:18 +02:00
|
|
|
return T42_Err_Ok;
|
2002-06-07 09:23:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( void )
|
|
|
|
T42_Driver_Done( T42_Driver driver )
|
|
|
|
{
|
|
|
|
FT_UNUSED( driver );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( FT_Error )
|
|
|
|
T42_Size_Init( T42_Size size )
|
|
|
|
{
|
|
|
|
FT_Face face = size->root.face;
|
|
|
|
T42_Face t42face = (T42_Face)face;
|
|
|
|
FT_Size ttsize;
|
2002-06-08 08:47:18 +02:00
|
|
|
FT_Error error = T42_Err_Ok;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
error = FT_New_Size( t42face->ttf_face, &ttsize );
|
|
|
|
size->ttsize = ttsize;
|
|
|
|
|
2002-06-11 22:35:58 +02:00
|
|
|
FT_Activate_Size( ttsize );
|
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( void )
|
|
|
|
T42_Size_Done( T42_Size size )
|
|
|
|
{
|
|
|
|
FT_Face face = size->root.face;
|
|
|
|
T42_Face t42face = (T42_Face)face;
|
|
|
|
FT_ListNode node;
|
|
|
|
|
|
|
|
|
|
|
|
node = FT_List_Find( &t42face->ttf_face->sizes_list, size->ttsize );
|
|
|
|
if ( node )
|
|
|
|
{
|
|
|
|
FT_Done_Size( size->ttsize );
|
|
|
|
size->ttsize = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( FT_Error )
|
|
|
|
T42_GlyphSlot_Init( T42_GlyphSlot slot )
|
|
|
|
{
|
|
|
|
FT_Face face = slot->root.face;
|
|
|
|
T42_Face t42face = (T42_Face)face;
|
|
|
|
FT_GlyphSlot ttslot;
|
2002-06-08 08:47:18 +02:00
|
|
|
FT_Error error = T42_Err_Ok;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
if ( face->glyph == NULL )
|
|
|
|
{
|
|
|
|
/* First glyph slot for this face */
|
|
|
|
slot->ttslot = t42face->ttf_face->glyph;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
error = FT_New_GlyphSlot( t42face->ttf_face, &ttslot );
|
|
|
|
slot->ttslot = ttslot;
|
|
|
|
}
|
|
|
|
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( void )
|
|
|
|
T42_GlyphSlot_Done( T42_GlyphSlot slot )
|
|
|
|
{
|
|
|
|
FT_Face face = slot->root.face;
|
|
|
|
T42_Face t42face = (T42_Face)face;
|
|
|
|
FT_GlyphSlot cur = t42face->ttf_face->glyph;
|
|
|
|
|
|
|
|
|
|
|
|
while ( cur )
|
|
|
|
{
|
|
|
|
if ( cur == slot->ttslot )
|
|
|
|
{
|
|
|
|
FT_Done_GlyphSlot( slot->ttslot );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
cur = cur->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-06-11 22:35:58 +02:00
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
FT_LOCAL_DEF( FT_Error )
|
|
|
|
T42_Size_SetChars( T42_Size size,
|
|
|
|
FT_F26Dot6 char_width,
|
|
|
|
FT_F26Dot6 char_height,
|
|
|
|
FT_UInt horz_resolution,
|
|
|
|
FT_UInt vert_resolution )
|
|
|
|
{
|
|
|
|
FT_Face face = size->root.face;
|
|
|
|
T42_Face t42face = (T42_Face)face;
|
|
|
|
|
|
|
|
|
2002-06-19 21:43:15 +02:00
|
|
|
FT_Activate_Size(size->ttsize);
|
* include/freetype/config/ftoption.h, include/freetype/internal/tttypes.h,
src/base/ftobjs.c, src/bdf/bdfdrivr.c, src/cff/cffobjs.c,
src/pcf/pcfdrivr.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
src/sfnt/ttcmap0.h, src/sfnt/ttload.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c: code cleanup,
FT_CONFIG_OPTION_USE_CMAPS is now the default
2002-07-17 23:14:23 +02:00
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
return FT_Set_Char_Size( t42face->ttf_face,
|
|
|
|
char_width,
|
|
|
|
char_height,
|
|
|
|
horz_resolution,
|
|
|
|
vert_resolution );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( FT_Error )
|
|
|
|
T42_Size_SetPixels( T42_Size size,
|
|
|
|
FT_UInt pixel_width,
|
|
|
|
FT_UInt pixel_height )
|
|
|
|
{
|
|
|
|
FT_Face face = size->root.face;
|
|
|
|
T42_Face t42face = (T42_Face)face;
|
|
|
|
|
|
|
|
|
2002-06-19 21:43:15 +02:00
|
|
|
FT_Activate_Size(size->ttsize);
|
* include/freetype/config/ftoption.h, include/freetype/internal/tttypes.h,
src/base/ftobjs.c, src/bdf/bdfdrivr.c, src/cff/cffobjs.c,
src/pcf/pcfdrivr.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
src/sfnt/ttcmap0.h, src/sfnt/ttload.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c: code cleanup,
FT_CONFIG_OPTION_USE_CMAPS is now the default
2002-07-17 23:14:23 +02:00
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
return FT_Set_Pixel_Sizes( t42face->ttf_face,
|
|
|
|
pixel_width,
|
|
|
|
pixel_height );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2003-03-20 08:04:40 +01:00
|
|
|
t42_glyphslot_clear( FT_GlyphSlot slot )
|
2002-06-07 09:23:06 +02:00
|
|
|
{
|
|
|
|
/* free bitmap if needed */
|
2003-03-20 08:04:40 +01:00
|
|
|
ft_glyphslot_free_bitmap( slot );
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
/* clear all public fields in the glyph slot */
|
2002-06-11 22:35:58 +02:00
|
|
|
FT_ZERO( &slot->metrics );
|
|
|
|
FT_ZERO( &slot->outline );
|
|
|
|
FT_ZERO( &slot->bitmap );
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
slot->bitmap_left = 0;
|
|
|
|
slot->bitmap_top = 0;
|
|
|
|
slot->num_subglyphs = 0;
|
|
|
|
slot->subglyphs = 0;
|
|
|
|
slot->control_data = 0;
|
|
|
|
slot->control_len = 0;
|
|
|
|
slot->other = 0;
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
slot->format = FT_GLYPH_FORMAT_NONE;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
slot->linearHoriAdvance = 0;
|
|
|
|
slot->linearVertAdvance = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( FT_Error )
|
|
|
|
T42_GlyphSlot_Load( FT_GlyphSlot glyph,
|
|
|
|
FT_Size size,
|
|
|
|
FT_Int glyph_index,
|
* src/sfnt/ttpost.c (load_post_names, tt_face_free_ps_names,
tt_face_get_ps_name): Replace switch statement with if clauses to
make it more portable.
* src/cff/cffobjs.c (cff_face_init): Ditto.
* include/freetype/ftmodule.h (FT_Module_Class): Use `FT_Long' for
`module_size'.
* include/freetype/ftrender.h (FT_Glyph_Class_): Use `FT_Long' for
`glyph_size'.
* src/base/ftobjs.c (FT_Render_Glyph): Change second parameter to
`FT_Render_Mode'.
(FT_Render_Glyph_Internal): Change third parameter to
`FT_Render_Mode'.
* src/base/ftglyph.c (FT_Glyph_To_Bitmap): Change second parameter
to `FT_Render_Mode'.
* src/raster/ftrend1.c (ft_raster1_render): Change third parameter
to `FT_Render_Mode'.
* src/smooth/ftsmooth.c (ft_smooth_render, ft_smooth_render_lcd,
ft_smooth_render_lcd_v): Ditto.
(ft_smooth_render_generic): Change third and fifth parameter to
`FT_Render_Mode'.
* include/freetype/freetype.h, include/freetype/internal/ftobjs.h,
include/freetype/ftglyph.h: Updated.
* src/cff/cffdrivr.c (Load_Glyph), src/pcf/pcfdriver.c
(PCF_Glyph_Load), src/pfr/pfrobjs.c (pfr_slot_load),
src/winfonts/winfnt.c (FNT_Load_Glyph), src/t42/t42objs.c
(T42_GlyphSlot_Load), src/bdf/bdfdrivr.c (BDF_Glyph_Load): Change
fourth parameter to `FT_Int32'.
* src/pfr/pfrobjs.c (pfr_face_init): Add two missing parameters
and declare them as unused.
* src/cid/cidparse.h (CID_Parser): Use FT_Long for `postscript_len'.
* src/psnames/psnames.h (PS_Unicode_Value_Func): Change return
value to FT_UInt32.
* src/psnames/psmodule.c (ps_unicode_value, ps_build_unicode_table):
Updated accordingly.
* src/cff/cffdrivr.c (Get_Kerning): Use FT_Long for `middle'.
(cff_get_glyph_name): Use cast for result of ft_strlen.
* src/cff/cffparse.c (cff_parse_real): User cast for assigning
`exp'.
* src/cff/cffload.c (cff_index_get_pointers): Use FT_ULong for
some local variables.
(cff_charset_load, cff_encoding_load): Use casts to FT_UInt for some
switch statements.
(cff_font_load): Use cast in call to CFF_Load_FD_Select.
* src/cff/cffobjs.c (cff_size_init): Use more casts.
(cff_face_init): Use FT_Int32 for `flags'.
* src/cff/cffgload.c (cff_operator_seac): Use cast for assigning
`adx' and `ady'.
(cff_decoder_parse_charstrings): Use FT_ULong for third parameter.
Use more casts.
* src/cff/cffcmap.c (cff_cmap_unicode_init): Use cast for `count'.
* src/cid/cidload.c (cid_read_subrs): Use FT_ULong for `len'.
* src/cid/cidgload.c (cid_load_glyph): Add missing cast for
`cid_get_offset'.
* src/psaux/t1decode.c (t1_decoder_parse_charstrings) <18>: Use
cast for `num_points'.
(t1_decoder_init): Use cast for assigning `decoder->num_glyphs'.
* src/base/ftdebug.c (ft_debug_init): Use FT_Int.
* include/freetype/internal/ftdriver.h (FT_Slot_LoadFunc): Use
`FT_Int32' for fourth parameter.
* src/base/ftobjs.c (open_face): Use cast for calling
clazz->init_face.
* src/raster/ftraster.c (Set_High_Precision): Use `1' instead of
`1L'.
(Finalize_Profile_Table, Line_Up, ft_black_init): Use casts.
* src/raster/ftrend1.c (ft_raster1_render): Ditto.
* src/sfnt/sfnt_dir_check: Compare `magic' with unsigned long
constant.
* builds/amiga/include/freetype/config/ftmodule.h: Updated.
2002-09-27 13:09:23 +02:00
|
|
|
FT_Int32 load_flags )
|
2002-06-07 09:23:06 +02:00
|
|
|
{
|
|
|
|
FT_Error error;
|
|
|
|
T42_GlyphSlot t42slot = (T42_GlyphSlot)glyph;
|
|
|
|
T42_Size t42size = (T42_Size)size;
|
|
|
|
FT_Driver_Class ttclazz = ((T42_Driver)glyph->face->driver)->ttclazz;
|
|
|
|
|
2002-06-12 10:43:58 +02:00
|
|
|
|
2003-03-20 08:04:40 +01:00
|
|
|
t42_glyphslot_clear( t42slot->ttslot );
|
2002-06-07 09:23:06 +02:00
|
|
|
error = ttclazz->load_glyph( t42slot->ttslot,
|
|
|
|
t42size->ttsize,
|
|
|
|
glyph_index,
|
|
|
|
load_flags | FT_LOAD_NO_BITMAP );
|
|
|
|
|
|
|
|
if ( !error )
|
|
|
|
{
|
|
|
|
glyph->metrics = t42slot->ttslot->metrics;
|
|
|
|
|
|
|
|
glyph->linearHoriAdvance = t42slot->ttslot->linearHoriAdvance;
|
|
|
|
glyph->linearVertAdvance = t42slot->ttslot->linearVertAdvance;
|
|
|
|
|
|
|
|
glyph->format = t42slot->ttslot->format;
|
|
|
|
glyph->outline = t42slot->ttslot->outline;
|
|
|
|
|
|
|
|
glyph->bitmap = t42slot->ttslot->bitmap;
|
|
|
|
glyph->bitmap_left = t42slot->ttslot->bitmap_left;
|
|
|
|
glyph->bitmap_top = t42slot->ttslot->bitmap_top;
|
* include/freetype/config/ftoption.h, include/freetype/internal/tttypes.h,
src/base/ftobjs.c, src/bdf/bdfdrivr.c, src/cff/cffobjs.c,
src/pcf/pcfdrivr.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
src/sfnt/ttcmap0.h, src/sfnt/ttload.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c: code cleanup,
FT_CONFIG_OPTION_USE_CMAPS is now the default
2002-07-17 23:14:23 +02:00
|
|
|
|
2002-06-11 22:35:58 +02:00
|
|
|
glyph->num_subglyphs = t42slot->ttslot->num_subglyphs;
|
|
|
|
glyph->subglyphs = t42slot->ttslot->subglyphs;
|
* include/freetype/config/ftoption.h, include/freetype/internal/tttypes.h,
src/base/ftobjs.c, src/bdf/bdfdrivr.c, src/cff/cffobjs.c,
src/pcf/pcfdrivr.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
src/sfnt/ttcmap0.h, src/sfnt/ttload.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c: code cleanup,
FT_CONFIG_OPTION_USE_CMAPS is now the default
2002-07-17 23:14:23 +02:00
|
|
|
|
2002-06-11 22:35:58 +02:00
|
|
|
glyph->control_data = t42slot->ttslot->control_data;
|
|
|
|
glyph->control_len = t42slot->ttslot->control_len;
|
2002-06-07 09:23:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-06-08 08:47:18 +02:00
|
|
|
/* END */
|