2002-06-08 08:47:18 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* t42objs.c */
|
|
|
|
/* */
|
|
|
|
/* Type 42 objects manager (body). */
|
|
|
|
/* */
|
2011-11-26 13:38:26 +01:00
|
|
|
/* Copyright 2002-2009, 2011 */
|
2009-03-21 08:51:44 +01:00
|
|
|
/* 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_LIST_H
|
2012-01-16 18:00:24 +01:00
|
|
|
#include FT_TRUETYPE_IDS_H
|
2002-06-07 09:23:06 +02:00
|
|
|
|
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;
|
|
|
|
|
2003-10-16 17:48:39 +02:00
|
|
|
error = t42_parse_dict( face, &loader,
|
|
|
|
parser->base_dict, parser->base_len );
|
2007-06-18 19:00:05 +02:00
|
|
|
if ( error )
|
|
|
|
goto Exit;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
if ( type1->font_type != 42 )
|
|
|
|
{
|
Improve tracing.
* src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c
(PCF_Face_Done): Remove tracing message.
* src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c
(cff_face_init), src/cid/cidobjs.c (cid_face_init),
src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c
(sfnt_init_face), src/truetype/ttobjs.c (tt_face_init),
src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c
(T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add
`greeting' message.
* src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c
(T42_Open_Face): Improve tracing.
2011-11-26 20:09:39 +01:00
|
|
|
FT_ERROR(( "T42_Open_Face: cannot handle FontType %d\n",
|
|
|
|
type1->font_type ));
|
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;
|
|
|
|
|
2003-10-16 17:48:39 +02:00
|
|
|
if ( !loader.charstrings.init )
|
|
|
|
{
|
2009-06-26 06:15:41 +02:00
|
|
|
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 */
|
|
|
|
|
2009-09-01 08:10:24 +02:00
|
|
|
min_char = 0;
|
|
|
|
max_char = 0;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
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 )
|
|
|
|
{
|
2003-10-16 17:48:39 +02:00
|
|
|
if ( charcode < min_char )
|
|
|
|
min_char = charcode;
|
2009-09-01 08:10:24 +02:00
|
|
|
if ( charcode >= max_char )
|
|
|
|
max_char = charcode + 1;
|
2002-06-07 09:23:06 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-09-01 08:10:24 +02:00
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
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,
|
2011-11-30 13:38:51 +01:00
|
|
|
FT_Face t42face, /* T42_Face */
|
2002-06-07 09:23:06 +02:00
|
|
|
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
|
|
|
{
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_Face face = (T42_Face)t42face;
|
2003-10-16 17:48:39 +02:00
|
|
|
FT_Error error;
|
* 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
|
|
|
FT_Service_PsCMaps psnames;
|
2003-10-16 17:48:39 +02:00
|
|
|
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;
|
|
|
|
|
* 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
|
|
|
FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
|
2003-09-29 22:33:37 +02:00
|
|
|
face->psnames = psnames;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
|
|
|
|
"psaux" );
|
|
|
|
psaux = (PSAux_Service)face->psaux;
|
2011-11-26 13:38:26 +01:00
|
|
|
if ( !psaux )
|
|
|
|
{
|
|
|
|
FT_ERROR(( "T42_Face_Init: cannot access `psaux' module\n" ));
|
|
|
|
error = T42_Err_Missing_Module;
|
|
|
|
goto Exit;
|
|
|
|
}
|
2002-06-07 09:23:06 +02:00
|
|
|
|
Improve tracing.
* src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c
(PCF_Face_Done): Remove tracing message.
* src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c
(cff_face_init), src/cid/cidobjs.c (cid_face_init),
src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c
(sfnt_init_face), src/truetype/ttobjs.c (tt_face_init),
src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c
(T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add
`greeting' message.
* src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c
(T42_Open_Face): Improve tracing.
2011-11-26 20:09:39 +01:00
|
|
|
FT_TRACE2(( "Type 42 driver\n" ));
|
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
/* 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 */
|
2008-12-26 00:52:00 +01:00
|
|
|
if ( face_index > 0 )
|
2002-06-07 09:23:06 +02:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2003-10-16 17:48:39 +02:00
|
|
|
/* Now load the font program into the face object */
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
/* 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;
|
2008-12-26 00:52:00 +01:00
|
|
|
root->face_index = 0;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
2005-10-05 17:18:29 +02:00
|
|
|
root->face_flags = FT_FACE_FLAG_SCALABLE |
|
|
|
|
FT_FACE_FLAG_HORIZONTAL |
|
|
|
|
FT_FACE_FLAG_GLYPH_NAMES;
|
2002-06-07 09:23:06 +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
|
|
|
if ( info->is_fixed_pitch )
|
2002-06-07 09:23:06 +02:00
|
|
|
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
|
|
|
|
|
2006-09-03 08:18:45 +02:00
|
|
|
/* We only set this flag if we have the patented bytecode interpreter. */
|
|
|
|
/* There are no known `tricky' Type42 fonts that could be loaded with */
|
|
|
|
/* the unpatented interpreter. */
|
2005-10-05 17:18:29 +02:00
|
|
|
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
|
|
|
root->face_flags |= FT_FACE_FLAG_HINTER;
|
|
|
|
#endif
|
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
/* 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 */
|
2005-12-03 09:13:43 +01:00
|
|
|
{
|
|
|
|
FT_Open_Args args;
|
|
|
|
|
|
|
|
|
|
|
|
args.flags = FT_OPEN_MEMORY;
|
|
|
|
args.memory_base = face->ttf_data;
|
|
|
|
args.memory_size = face->ttf_size;
|
|
|
|
|
|
|
|
if ( num_params )
|
|
|
|
{
|
|
|
|
args.flags |= FT_OPEN_PARAMS;
|
|
|
|
args.num_params = num_params;
|
|
|
|
args.params = params;
|
|
|
|
}
|
|
|
|
|
|
|
|
error = FT_Open_Face( FT_FACE_LIBRARY( face ),
|
|
|
|
&args, 0, &face->ttf_face );
|
|
|
|
}
|
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
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;
|
|
|
|
|
2004-02-14 20:21:37 +01:00
|
|
|
root->underline_position = (FT_Short)info->underline_position;
|
|
|
|
root->underline_thickness = (FT_Short)info->underline_thickness;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
/* compute style flags */
|
|
|
|
root->style_flags = 0;
|
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
|
|
|
if ( 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;
|
|
|
|
|
|
|
|
{
|
2011-11-26 13:38:26 +01:00
|
|
|
if ( psnames )
|
2002-06-07 09:23:06 +02:00
|
|
|
{
|
|
|
|
FT_CharMapRec charmap;
|
|
|
|
T1_CMap_Classes cmap_classes = psaux->t1_cmap_classes;
|
|
|
|
FT_CMap_Class clazz;
|
|
|
|
|
|
|
|
|
|
|
|
charmap.face = root;
|
|
|
|
|
2008-10-01 23:16:44 +02:00
|
|
|
/* first of all, try to synthesize a Unicode charmap */
|
2010-07-09 05:26:33 +02:00
|
|
|
charmap.platform_id = TT_PLATFORM_MICROSOFT;
|
|
|
|
charmap.encoding_id = TT_MS_ID_UNICODE_CS;
|
* 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
|
|
|
|
2010-07-04 05:08:41 +02:00
|
|
|
error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
|
2010-07-09 04:36:00 +02:00
|
|
|
if ( error && FT_Err_No_Unicode_Glyph_Name != error )
|
2010-07-04 05:08:41 +02:00
|
|
|
goto Exit;
|
2010-07-10 17:31:17 +02:00
|
|
|
error = FT_Err_Ok;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
/* now, generate an Adobe Standard encoding when appropriate */
|
2010-07-09 16:43:14 +02:00
|
|
|
charmap.platform_id = TT_PLATFORM_ADOBE;
|
2002-06-07 09:23:06 +02:00
|
|
|
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;
|
2010-07-09 05:26:33 +02:00
|
|
|
charmap.encoding_id = TT_ADOBE_ID_STANDARD;
|
2002-06-07 09:23:06 +02:00
|
|
|
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;
|
2010-07-09 05:26:33 +02:00
|
|
|
charmap.encoding_id = TT_ADOBE_ID_EXPERT;
|
2002-06-07 09:23:06 +02:00
|
|
|
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;
|
2010-07-09 05:26:33 +02:00
|
|
|
charmap.encoding_id = TT_ADOBE_ID_CUSTOM;
|
2002-06-07 09:23:06 +02:00
|
|
|
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;
|
2010-07-09 05:26:33 +02:00
|
|
|
charmap.encoding_id = TT_ADOBE_ID_LATIN_1;
|
2002-06-07 09:23:06 +02:00
|
|
|
clazz = cmap_classes->unicode;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( clazz )
|
2010-07-04 05:08:41 +02:00
|
|
|
error = FT_CMap_New( clazz, NULL, &charmap, NULL );
|
2002-06-07 09:23:06 +02:00
|
|
|
|
2002-07-18 00:51:06 +02:00
|
|
|
#if 0
|
2002-06-08 08:47:18 +02:00
|
|
|
/* Select default charmap */
|
2003-10-16 17:48:39 +02:00
|
|
|
if ( root->num_charmaps )
|
2002-06-08 08:47:18 +02:00
|
|
|
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 )
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_Face_Done( FT_Face t42face )
|
2002-06-07 09:23:06 +02:00
|
|
|
{
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_Face face = (T42_Face)t42face;
|
2002-06-07 09:23:06 +02:00
|
|
|
T1_Font type1;
|
|
|
|
PS_FontInfo info;
|
|
|
|
FT_Memory memory;
|
|
|
|
|
|
|
|
|
2008-10-02 00:39:05 +02:00
|
|
|
if ( !face )
|
|
|
|
return;
|
|
|
|
|
|
|
|
type1 = &face->type1;
|
|
|
|
info = &type1->font_info;
|
|
|
|
memory = face->root.memory;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
2008-10-02 00:39:05 +02:00
|
|
|
/* delete internal ttf face prior to freeing face->ttf_data */
|
|
|
|
if ( face->ttf_face )
|
|
|
|
FT_Done_Face( face->ttf_face );
|
2002-06-07 09:23:06 +02:00
|
|
|
|
2008-10-02 00:39:05 +02:00
|
|
|
/* 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 );
|
2002-06-07 09:23:06 +02:00
|
|
|
|
2008-10-02 00:39:05 +02:00
|
|
|
/* release top dictionary */
|
|
|
|
FT_FREE( type1->charstrings_len );
|
|
|
|
FT_FREE( type1->charstrings );
|
|
|
|
FT_FREE( type1->glyph_names );
|
2002-06-07 09:23:06 +02:00
|
|
|
|
2008-10-02 00:39:05 +02:00
|
|
|
FT_FREE( type1->charstrings_block );
|
|
|
|
FT_FREE( type1->glyph_names_block );
|
2002-06-07 09:23:06 +02:00
|
|
|
|
2008-10-02 00:39:05 +02:00
|
|
|
FT_FREE( type1->encoding.char_index );
|
|
|
|
FT_FREE( type1->encoding.char_name );
|
|
|
|
FT_FREE( type1->font_name );
|
2002-06-07 09:23:06 +02:00
|
|
|
|
2008-10-02 00:39:05 +02:00
|
|
|
FT_FREE( face->ttf_data );
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
#if 0
|
2008-10-02 00:39:05 +02:00
|
|
|
/* release afm data if present */
|
|
|
|
if ( face->afm_data )
|
|
|
|
T1_Done_AFM( memory, (T1_AFM*)face->afm_data );
|
2002-06-07 09:23:06 +02:00
|
|
|
#endif
|
|
|
|
|
2008-10-02 00:39:05 +02:00
|
|
|
/* release unicode map, if any */
|
|
|
|
FT_FREE( face->unicode_map.maps );
|
|
|
|
face->unicode_map.num_maps = 0;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
2008-10-02 00:39:05 +02:00
|
|
|
face->root.family_name = 0;
|
|
|
|
face->root.style_name = 0;
|
2002-06-07 09:23:06 +02:00
|
|
|
}
|
|
|
|
|
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 )
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_Driver_Init( FT_Module module ) /* T42_Driver */
|
2002-06-07 09:23:06 +02:00
|
|
|
{
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_Driver driver = (T42_Driver)module;
|
|
|
|
FT_Module ttmodule;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
|
|
|
|
2011-11-30 13:38:51 +01:00
|
|
|
ttmodule = FT_Get_Module( module->library, "truetype" );
|
2011-11-26 13:38:26 +01:00
|
|
|
if ( !ttmodule )
|
|
|
|
{
|
|
|
|
FT_ERROR(( "T42_Driver_Init: cannot access `truetype' module\n" ));
|
|
|
|
return T42_Err_Missing_Module;
|
|
|
|
}
|
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
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 )
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_Driver_Done( FT_Module module )
|
2002-06-07 09:23:06 +02:00
|
|
|
{
|
2011-11-30 13:38:51 +01:00
|
|
|
FT_UNUSED( module );
|
2002-06-07 09:23:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( FT_Error )
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_Size_Init( FT_Size size ) /* T42_Size */
|
2002-06-07 09:23:06 +02:00
|
|
|
{
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_Size t42size = (T42_Size)size;
|
|
|
|
FT_Face face = size->face;
|
2002-06-07 09:23:06 +02:00
|
|
|
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 );
|
2011-11-30 13:38:51 +01:00
|
|
|
t42size->ttsize = ttsize;
|
2002-06-07 09:23:06 +02:00
|
|
|
|
2002-06-11 22:35:58 +02:00
|
|
|
FT_Activate_Size( ttsize );
|
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
* include/freetype/internal/sfnt.h (SFNT_Interface): New method
`load_strike_metrics' used to load the strike's metrics.
* src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.
* src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.
* src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
nominal size unless it is obviously incorrect.
* include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
FNT driver.
Introduce new size selection interface.
* include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec_):
Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
`select_size'.
* include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
(FT_Select_Size, FT_Request_Size): API additions to export the new
size selection interface.
* src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
`FT_Request_Size'.
* include/freetype/internal/ftobjs.h (FT_Match_Size),
src/base/ftobjs.c (FT_Match_Size): New function to match a size
request against `available_sizes'. Drivers supporting bitmap strikes
can use this function to implement `request_size'.
* src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
Update to new size selection interface.
* src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
selection interface.
Make `strike_index' FT_ULong and always defined.
Use `load_strike_metrics' provided by SFNT interface.
2006-01-13 13:21:31 +01:00
|
|
|
FT_LOCAL_DEF( FT_Error )
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_Size_Request( FT_Size t42size, /* T42_Size */
|
* include/freetype/internal/sfnt.h (SFNT_Interface): New method
`load_strike_metrics' used to load the strike's metrics.
* src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.
* src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.
* src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
nominal size unless it is obviously incorrect.
* include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
FNT driver.
Introduce new size selection interface.
* include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec_):
Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
`select_size'.
* include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
(FT_Select_Size, FT_Request_Size): API additions to export the new
size selection interface.
* src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
`FT_Request_Size'.
* include/freetype/internal/ftobjs.h (FT_Match_Size),
src/base/ftobjs.c (FT_Match_Size): New function to match a size
request against `available_sizes'. Drivers supporting bitmap strikes
can use this function to implement `request_size'.
* src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
Update to new size selection interface.
* src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
selection interface.
Make `strike_index' FT_ULong and always defined.
Use `load_strike_metrics' provided by SFNT interface.
2006-01-13 13:21:31 +01:00
|
|
|
FT_Size_Request req )
|
|
|
|
{
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_Size size = (T42_Size)t42size;
|
|
|
|
T42_Face face = (T42_Face)t42size->face;
|
* include/freetype/freetype.h (FT_Select_Size): Rename the second
argument from `idx' to `strike_index'.
(FT_Size_Request_Type): Add FT_SIZE_REQUEST_TYPE_MAX to the end of
this enum.
* include/freetype/internal/ftobjs.h (FT_REQUEST_WIDTH,
FT_REQUEST_HEIGHT): New macros to get the width and height of a
request, in fractional pixels.
* include/freetype/internal/ftobjs.h (FT_Select_Metrics,
FT_Request_Metrics), src/base/ftobjs.c (FT_Select_Metrics,
FT_Request_Metrics): New base functions to set the font metrics. They
were part of FT_Select_Size/FT_Request_Size and are made independent
functions so that metrics are not set again and again.
* src/base/ftobjs.c (FT_Select_Size, FT_Request_Size): Metrics are set
only when driver's size_select/size_request is NULL. That is, drivers
should set the metrics themselves.
(FT_Match_Size): Round before matching. This was what we did and it
does cause some problems without rounding.
* src/cff/cffobjs.c (cff_size_select), src/truetype/ttdriver.c
(tt_size_select): Set the font metrics.
s/index/strike_index/.
The scaled metrics are always preferred over strikes' metrics, even
when some strike is selected. This is done because the strikes'
metrics are not reliable, e.g., the sign of the descender is wrong for
some fonts.
* src/cff/cffobjs.c (cff_size_request), src/truetype/ttdriver.c
(tt_size_request): Set the font metrics.
Call cff_size_select/tt_size_select when some strike is matched.
* src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/cid/cidobjs.c,
src/pcf/pcfdrivr.c, src/truetype/ttdriver.c, src/type1/t1objs.c,
src/type1/t1objs.h, src/type42/t42objs.c, src/winfonts/winfnt.c:
Set the font metrics.
s/index/strike_index/.
* src/tools/test_afm.c, src/psaux/psconv.c: Older versions of these
files were committed. Just a catch-up.
(PS_Conv_ToFixed): Remove the `goto'.
(PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Speed up a little.
* src/sfnt/ttsbit.c (tt_face_load_sbit_strikes,
tt_face_load_strike_metrics), src/sfnt/ttsbit0.c
(tt_face_load_sbit_strikes, tt_face_load_strike_metrics): The
advertised metrics in `available_sizes' are different from those
actually used.
2006-01-23 15:12:40 +01:00
|
|
|
FT_Error error;
|
* include/freetype/internal/sfnt.h (SFNT_Interface): New method
`load_strike_metrics' used to load the strike's metrics.
* src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.
* src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.
* src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
nominal size unless it is obviously incorrect.
* include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
FNT driver.
Introduce new size selection interface.
* include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec_):
Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
`select_size'.
* include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
(FT_Select_Size, FT_Request_Size): API additions to export the new
size selection interface.
* src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
`FT_Request_Size'.
* include/freetype/internal/ftobjs.h (FT_Match_Size),
src/base/ftobjs.c (FT_Match_Size): New function to match a size
request against `available_sizes'. Drivers supporting bitmap strikes
can use this function to implement `request_size'.
* src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
Update to new size selection interface.
* src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
selection interface.
Make `strike_index' FT_ULong and always defined.
Use `load_strike_metrics' provided by SFNT interface.
2006-01-13 13:21:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
FT_Activate_Size( size->ttsize );
|
|
|
|
|
* include/freetype/freetype.h (FT_Select_Size): Rename the second
argument from `idx' to `strike_index'.
(FT_Size_Request_Type): Add FT_SIZE_REQUEST_TYPE_MAX to the end of
this enum.
* include/freetype/internal/ftobjs.h (FT_REQUEST_WIDTH,
FT_REQUEST_HEIGHT): New macros to get the width and height of a
request, in fractional pixels.
* include/freetype/internal/ftobjs.h (FT_Select_Metrics,
FT_Request_Metrics), src/base/ftobjs.c (FT_Select_Metrics,
FT_Request_Metrics): New base functions to set the font metrics. They
were part of FT_Select_Size/FT_Request_Size and are made independent
functions so that metrics are not set again and again.
* src/base/ftobjs.c (FT_Select_Size, FT_Request_Size): Metrics are set
only when driver's size_select/size_request is NULL. That is, drivers
should set the metrics themselves.
(FT_Match_Size): Round before matching. This was what we did and it
does cause some problems without rounding.
* src/cff/cffobjs.c (cff_size_select), src/truetype/ttdriver.c
(tt_size_select): Set the font metrics.
s/index/strike_index/.
The scaled metrics are always preferred over strikes' metrics, even
when some strike is selected. This is done because the strikes'
metrics are not reliable, e.g., the sign of the descender is wrong for
some fonts.
* src/cff/cffobjs.c (cff_size_request), src/truetype/ttdriver.c
(tt_size_request): Set the font metrics.
Call cff_size_select/tt_size_select when some strike is matched.
* src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/cid/cidobjs.c,
src/pcf/pcfdrivr.c, src/truetype/ttdriver.c, src/type1/t1objs.c,
src/type1/t1objs.h, src/type42/t42objs.c, src/winfonts/winfnt.c:
Set the font metrics.
s/index/strike_index/.
* src/tools/test_afm.c, src/psaux/psconv.c: Older versions of these
files were committed. Just a catch-up.
(PS_Conv_ToFixed): Remove the `goto'.
(PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Speed up a little.
* src/sfnt/ttsbit.c (tt_face_load_sbit_strikes,
tt_face_load_strike_metrics), src/sfnt/ttsbit0.c
(tt_face_load_sbit_strikes, tt_face_load_strike_metrics): The
advertised metrics in `available_sizes' are different from those
actually used.
2006-01-23 15:12:40 +01:00
|
|
|
error = FT_Request_Size( face->ttf_face, req );
|
|
|
|
if ( !error )
|
2011-11-30 13:38:51 +01:00
|
|
|
t42size->metrics = face->ttf_face->size->metrics;
|
* include/freetype/freetype.h (FT_Select_Size): Rename the second
argument from `idx' to `strike_index'.
(FT_Size_Request_Type): Add FT_SIZE_REQUEST_TYPE_MAX to the end of
this enum.
* include/freetype/internal/ftobjs.h (FT_REQUEST_WIDTH,
FT_REQUEST_HEIGHT): New macros to get the width and height of a
request, in fractional pixels.
* include/freetype/internal/ftobjs.h (FT_Select_Metrics,
FT_Request_Metrics), src/base/ftobjs.c (FT_Select_Metrics,
FT_Request_Metrics): New base functions to set the font metrics. They
were part of FT_Select_Size/FT_Request_Size and are made independent
functions so that metrics are not set again and again.
* src/base/ftobjs.c (FT_Select_Size, FT_Request_Size): Metrics are set
only when driver's size_select/size_request is NULL. That is, drivers
should set the metrics themselves.
(FT_Match_Size): Round before matching. This was what we did and it
does cause some problems without rounding.
* src/cff/cffobjs.c (cff_size_select), src/truetype/ttdriver.c
(tt_size_select): Set the font metrics.
s/index/strike_index/.
The scaled metrics are always preferred over strikes' metrics, even
when some strike is selected. This is done because the strikes'
metrics are not reliable, e.g., the sign of the descender is wrong for
some fonts.
* src/cff/cffobjs.c (cff_size_request), src/truetype/ttdriver.c
(tt_size_request): Set the font metrics.
Call cff_size_select/tt_size_select when some strike is matched.
* src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/cid/cidobjs.c,
src/pcf/pcfdrivr.c, src/truetype/ttdriver.c, src/type1/t1objs.c,
src/type1/t1objs.h, src/type42/t42objs.c, src/winfonts/winfnt.c:
Set the font metrics.
s/index/strike_index/.
* src/tools/test_afm.c, src/psaux/psconv.c: Older versions of these
files were committed. Just a catch-up.
(PS_Conv_ToFixed): Remove the `goto'.
(PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Speed up a little.
* src/sfnt/ttsbit.c (tt_face_load_sbit_strikes,
tt_face_load_strike_metrics), src/sfnt/ttsbit0.c
(tt_face_load_sbit_strikes, tt_face_load_strike_metrics): The
advertised metrics in `available_sizes' are different from those
actually used.
2006-01-23 15:12:40 +01:00
|
|
|
|
|
|
|
return error;
|
* include/freetype/internal/sfnt.h (SFNT_Interface): New method
`load_strike_metrics' used to load the strike's metrics.
* src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.
* src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.
* src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
nominal size unless it is obviously incorrect.
* include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
FNT driver.
Introduce new size selection interface.
* include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec_):
Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
`select_size'.
* include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
(FT_Select_Size, FT_Request_Size): API additions to export the new
size selection interface.
* src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
`FT_Request_Size'.
* include/freetype/internal/ftobjs.h (FT_Match_Size),
src/base/ftobjs.c (FT_Match_Size): New function to match a size
request against `available_sizes'. Drivers supporting bitmap strikes
can use this function to implement `request_size'.
* src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
Update to new size selection interface.
* src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
selection interface.
Make `strike_index' FT_ULong and always defined.
Use `load_strike_metrics' provided by SFNT interface.
2006-01-13 13:21:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( FT_Error )
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_Size_Select( FT_Size t42size, /* T42_Size */
|
* include/freetype/freetype.h (FT_Select_Size): Rename the second
argument from `idx' to `strike_index'.
(FT_Size_Request_Type): Add FT_SIZE_REQUEST_TYPE_MAX to the end of
this enum.
* include/freetype/internal/ftobjs.h (FT_REQUEST_WIDTH,
FT_REQUEST_HEIGHT): New macros to get the width and height of a
request, in fractional pixels.
* include/freetype/internal/ftobjs.h (FT_Select_Metrics,
FT_Request_Metrics), src/base/ftobjs.c (FT_Select_Metrics,
FT_Request_Metrics): New base functions to set the font metrics. They
were part of FT_Select_Size/FT_Request_Size and are made independent
functions so that metrics are not set again and again.
* src/base/ftobjs.c (FT_Select_Size, FT_Request_Size): Metrics are set
only when driver's size_select/size_request is NULL. That is, drivers
should set the metrics themselves.
(FT_Match_Size): Round before matching. This was what we did and it
does cause some problems without rounding.
* src/cff/cffobjs.c (cff_size_select), src/truetype/ttdriver.c
(tt_size_select): Set the font metrics.
s/index/strike_index/.
The scaled metrics are always preferred over strikes' metrics, even
when some strike is selected. This is done because the strikes'
metrics are not reliable, e.g., the sign of the descender is wrong for
some fonts.
* src/cff/cffobjs.c (cff_size_request), src/truetype/ttdriver.c
(tt_size_request): Set the font metrics.
Call cff_size_select/tt_size_select when some strike is matched.
* src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/cid/cidobjs.c,
src/pcf/pcfdrivr.c, src/truetype/ttdriver.c, src/type1/t1objs.c,
src/type1/t1objs.h, src/type42/t42objs.c, src/winfonts/winfnt.c:
Set the font metrics.
s/index/strike_index/.
* src/tools/test_afm.c, src/psaux/psconv.c: Older versions of these
files were committed. Just a catch-up.
(PS_Conv_ToFixed): Remove the `goto'.
(PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Speed up a little.
* src/sfnt/ttsbit.c (tt_face_load_sbit_strikes,
tt_face_load_strike_metrics), src/sfnt/ttsbit0.c
(tt_face_load_sbit_strikes, tt_face_load_strike_metrics): The
advertised metrics in `available_sizes' are different from those
actually used.
2006-01-23 15:12:40 +01:00
|
|
|
FT_ULong strike_index )
|
* include/freetype/internal/sfnt.h (SFNT_Interface): New method
`load_strike_metrics' used to load the strike's metrics.
* src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.
* src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.
* src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
nominal size unless it is obviously incorrect.
* include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
FNT driver.
Introduce new size selection interface.
* include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec_):
Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
`select_size'.
* include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
(FT_Select_Size, FT_Request_Size): API additions to export the new
size selection interface.
* src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
`FT_Request_Size'.
* include/freetype/internal/ftobjs.h (FT_Match_Size),
src/base/ftobjs.c (FT_Match_Size): New function to match a size
request against `available_sizes'. Drivers supporting bitmap strikes
can use this function to implement `request_size'.
* src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
Update to new size selection interface.
* src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
selection interface.
Make `strike_index' FT_ULong and always defined.
Use `load_strike_metrics' provided by SFNT interface.
2006-01-13 13:21:31 +01:00
|
|
|
{
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_Size size = (T42_Size)t42size;
|
|
|
|
T42_Face face = (T42_Face)t42size->face;
|
* include/freetype/freetype.h (FT_Select_Size): Rename the second
argument from `idx' to `strike_index'.
(FT_Size_Request_Type): Add FT_SIZE_REQUEST_TYPE_MAX to the end of
this enum.
* include/freetype/internal/ftobjs.h (FT_REQUEST_WIDTH,
FT_REQUEST_HEIGHT): New macros to get the width and height of a
request, in fractional pixels.
* include/freetype/internal/ftobjs.h (FT_Select_Metrics,
FT_Request_Metrics), src/base/ftobjs.c (FT_Select_Metrics,
FT_Request_Metrics): New base functions to set the font metrics. They
were part of FT_Select_Size/FT_Request_Size and are made independent
functions so that metrics are not set again and again.
* src/base/ftobjs.c (FT_Select_Size, FT_Request_Size): Metrics are set
only when driver's size_select/size_request is NULL. That is, drivers
should set the metrics themselves.
(FT_Match_Size): Round before matching. This was what we did and it
does cause some problems without rounding.
* src/cff/cffobjs.c (cff_size_select), src/truetype/ttdriver.c
(tt_size_select): Set the font metrics.
s/index/strike_index/.
The scaled metrics are always preferred over strikes' metrics, even
when some strike is selected. This is done because the strikes'
metrics are not reliable, e.g., the sign of the descender is wrong for
some fonts.
* src/cff/cffobjs.c (cff_size_request), src/truetype/ttdriver.c
(tt_size_request): Set the font metrics.
Call cff_size_select/tt_size_select when some strike is matched.
* src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/cid/cidobjs.c,
src/pcf/pcfdrivr.c, src/truetype/ttdriver.c, src/type1/t1objs.c,
src/type1/t1objs.h, src/type42/t42objs.c, src/winfonts/winfnt.c:
Set the font metrics.
s/index/strike_index/.
* src/tools/test_afm.c, src/psaux/psconv.c: Older versions of these
files were committed. Just a catch-up.
(PS_Conv_ToFixed): Remove the `goto'.
(PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Speed up a little.
* src/sfnt/ttsbit.c (tt_face_load_sbit_strikes,
tt_face_load_strike_metrics), src/sfnt/ttsbit0.c
(tt_face_load_sbit_strikes, tt_face_load_strike_metrics): The
advertised metrics in `available_sizes' are different from those
actually used.
2006-01-23 15:12:40 +01:00
|
|
|
FT_Error error;
|
* include/freetype/internal/sfnt.h (SFNT_Interface): New method
`load_strike_metrics' used to load the strike's metrics.
* src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.
* src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.
* src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
nominal size unless it is obviously incorrect.
* include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
FNT driver.
Introduce new size selection interface.
* include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec_):
Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
`select_size'.
* include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
(FT_Select_Size, FT_Request_Size): API additions to export the new
size selection interface.
* src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
`FT_Request_Size'.
* include/freetype/internal/ftobjs.h (FT_Match_Size),
src/base/ftobjs.c (FT_Match_Size): New function to match a size
request against `available_sizes'. Drivers supporting bitmap strikes
can use this function to implement `request_size'.
* src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
Update to new size selection interface.
* src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
selection interface.
Make `strike_index' FT_ULong and always defined.
Use `load_strike_metrics' provided by SFNT interface.
2006-01-13 13:21:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
FT_Activate_Size( size->ttsize );
|
|
|
|
|
* src/autofit/afcjk.c, src/base/ftoutln.c, src/base/ftrfork.c,
src/bdf/bdfdrivr.c, src/gxvalid/gxvmorx.c, src/otvalid/otvmath.c,
src/pcf/pcfdrivr.c, src/psnames/pstables.h, src/smooth/ftgrays.c,
src/tools/glnames.py, src/truetype/ttinterp.c, src/type1/t1load.c,
src/type42/t42objs.c, src/winfonts/winfnt.c: Fix compiler warnings
(Atari PureC).
2008-11-29 23:50:24 +01:00
|
|
|
error = FT_Select_Size( face->ttf_face, (FT_Int)strike_index );
|
* include/freetype/freetype.h (FT_Select_Size): Rename the second
argument from `idx' to `strike_index'.
(FT_Size_Request_Type): Add FT_SIZE_REQUEST_TYPE_MAX to the end of
this enum.
* include/freetype/internal/ftobjs.h (FT_REQUEST_WIDTH,
FT_REQUEST_HEIGHT): New macros to get the width and height of a
request, in fractional pixels.
* include/freetype/internal/ftobjs.h (FT_Select_Metrics,
FT_Request_Metrics), src/base/ftobjs.c (FT_Select_Metrics,
FT_Request_Metrics): New base functions to set the font metrics. They
were part of FT_Select_Size/FT_Request_Size and are made independent
functions so that metrics are not set again and again.
* src/base/ftobjs.c (FT_Select_Size, FT_Request_Size): Metrics are set
only when driver's size_select/size_request is NULL. That is, drivers
should set the metrics themselves.
(FT_Match_Size): Round before matching. This was what we did and it
does cause some problems without rounding.
* src/cff/cffobjs.c (cff_size_select), src/truetype/ttdriver.c
(tt_size_select): Set the font metrics.
s/index/strike_index/.
The scaled metrics are always preferred over strikes' metrics, even
when some strike is selected. This is done because the strikes'
metrics are not reliable, e.g., the sign of the descender is wrong for
some fonts.
* src/cff/cffobjs.c (cff_size_request), src/truetype/ttdriver.c
(tt_size_request): Set the font metrics.
Call cff_size_select/tt_size_select when some strike is matched.
* src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/cid/cidobjs.c,
src/pcf/pcfdrivr.c, src/truetype/ttdriver.c, src/type1/t1objs.c,
src/type1/t1objs.h, src/type42/t42objs.c, src/winfonts/winfnt.c:
Set the font metrics.
s/index/strike_index/.
* src/tools/test_afm.c, src/psaux/psconv.c: Older versions of these
files were committed. Just a catch-up.
(PS_Conv_ToFixed): Remove the `goto'.
(PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Speed up a little.
* src/sfnt/ttsbit.c (tt_face_load_sbit_strikes,
tt_face_load_strike_metrics), src/sfnt/ttsbit0.c
(tt_face_load_sbit_strikes, tt_face_load_strike_metrics): The
advertised metrics in `available_sizes' are different from those
actually used.
2006-01-23 15:12:40 +01:00
|
|
|
if ( !error )
|
2011-11-30 13:38:51 +01:00
|
|
|
t42size->metrics = face->ttf_face->size->metrics;
|
* include/freetype/freetype.h (FT_Select_Size): Rename the second
argument from `idx' to `strike_index'.
(FT_Size_Request_Type): Add FT_SIZE_REQUEST_TYPE_MAX to the end of
this enum.
* include/freetype/internal/ftobjs.h (FT_REQUEST_WIDTH,
FT_REQUEST_HEIGHT): New macros to get the width and height of a
request, in fractional pixels.
* include/freetype/internal/ftobjs.h (FT_Select_Metrics,
FT_Request_Metrics), src/base/ftobjs.c (FT_Select_Metrics,
FT_Request_Metrics): New base functions to set the font metrics. They
were part of FT_Select_Size/FT_Request_Size and are made independent
functions so that metrics are not set again and again.
* src/base/ftobjs.c (FT_Select_Size, FT_Request_Size): Metrics are set
only when driver's size_select/size_request is NULL. That is, drivers
should set the metrics themselves.
(FT_Match_Size): Round before matching. This was what we did and it
does cause some problems without rounding.
* src/cff/cffobjs.c (cff_size_select), src/truetype/ttdriver.c
(tt_size_select): Set the font metrics.
s/index/strike_index/.
The scaled metrics are always preferred over strikes' metrics, even
when some strike is selected. This is done because the strikes'
metrics are not reliable, e.g., the sign of the descender is wrong for
some fonts.
* src/cff/cffobjs.c (cff_size_request), src/truetype/ttdriver.c
(tt_size_request): Set the font metrics.
Call cff_size_select/tt_size_select when some strike is matched.
* src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/cid/cidobjs.c,
src/pcf/pcfdrivr.c, src/truetype/ttdriver.c, src/type1/t1objs.c,
src/type1/t1objs.h, src/type42/t42objs.c, src/winfonts/winfnt.c:
Set the font metrics.
s/index/strike_index/.
* src/tools/test_afm.c, src/psaux/psconv.c: Older versions of these
files were committed. Just a catch-up.
(PS_Conv_ToFixed): Remove the `goto'.
(PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Speed up a little.
* src/sfnt/ttsbit.c (tt_face_load_sbit_strikes,
tt_face_load_strike_metrics), src/sfnt/ttsbit0.c
(tt_face_load_sbit_strikes, tt_face_load_strike_metrics): The
advertised metrics in `available_sizes' are different from those
actually used.
2006-01-23 15:12:40 +01:00
|
|
|
|
|
|
|
return error;
|
|
|
|
|
* include/freetype/internal/sfnt.h (SFNT_Interface): New method
`load_strike_metrics' used to load the strike's metrics.
* src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.
* src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.
* src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
nominal size unless it is obviously incorrect.
* include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
FNT driver.
Introduce new size selection interface.
* include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec_):
Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
`select_size'.
* include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
(FT_Select_Size, FT_Request_Size): API additions to export the new
size selection interface.
* src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
`FT_Request_Size'.
* include/freetype/internal/ftobjs.h (FT_Match_Size),
src/base/ftobjs.c (FT_Match_Size): New function to match a size
request against `available_sizes'. Drivers supporting bitmap strikes
can use this function to implement `request_size'.
* src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
Update to new size selection interface.
* src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
selection interface.
Make `strike_index' FT_ULong and always defined.
Use `load_strike_metrics' provided by SFNT interface.
2006-01-13 13:21:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-06-07 09:23:06 +02:00
|
|
|
FT_LOCAL_DEF( void )
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_Size_Done( FT_Size t42size ) /* T42_Size */
|
2002-06-07 09:23:06 +02:00
|
|
|
{
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_Size size = (T42_Size)t42size;
|
|
|
|
FT_Face face = t42size->face;
|
2002-06-07 09:23:06 +02:00
|
|
|
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 )
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_GlyphSlot_Init( FT_GlyphSlot t42slot ) /* T42_GlyphSlot */
|
2002-06-07 09:23:06 +02:00
|
|
|
{
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_GlyphSlot slot = (T42_GlyphSlot)t42slot;
|
|
|
|
FT_Face face = t42slot->face;
|
|
|
|
T42_Face t42face = (T42_Face)face;
|
|
|
|
FT_GlyphSlot ttslot;
|
|
|
|
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 )
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_GlyphSlot_Done( FT_GlyphSlot t42slot ) /* T42_GlyphSlot */
|
2002-06-07 09:23:06 +02:00
|
|
|
{
|
2011-11-30 13:38:51 +01:00
|
|
|
T42_GlyphSlot slot = (T42_GlyphSlot)t42slot;
|
|
|
|
|
|
|
|
|
2005-05-20 23:52:19 +02:00
|
|
|
FT_Done_GlyphSlot( slot->ttslot );
|
2002-06-07 09:23:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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,
|
2003-10-16 17:48:39 +02:00
|
|
|
FT_UInt 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 */
|