Al-Qurtas-Islamic-bank-The-.../src/sfnt/ttpost.c

567 lines
14 KiB
C
Raw Normal View History

/****************************************************************************
*
* ttpost.c
*
* PostScript name table processing for TrueType and OpenType fonts
* (body).
*
2022-01-11 10:54:10 +01:00
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/**************************************************************************
*
* The post table is not completely loaded by the core engine. This
* file loads the missing PS glyph names and implements an API to access
* them.
*
*/
1999-12-17 00:11:37 +01:00
2000-12-08 17:17:16 +01:00
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftstream.h>
#include <freetype/tttags.h>
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
#include "ttpost.h"
1999-12-17 00:11:37 +01:00
Complete redesign of error codes. Please check ftmoderr.h for more details. * include/freetype/internal/cfferrs.h, include/freetype/internal/tterrors.h, include/freetype/internal/t1errors.h: Removed. Replaced with files local to the module. All extra error codes have been moved to `fterrors.h'. * src/sfnt/ttpost.h: Move error codes to `fterrors.h'. * src/autohint/aherrors.h, src/cache/ftcerror.h, src/cff/cfferrs.h, src/cid/ciderrs.h, src/pcf/pcferror.h, src/psaux/psauxerr.h, src/psnames/psnamerr.h, src/raster/rasterrs.h, src/sfnt/sferrors.h, src/smooth/ftsmerrs.h, src/truetype/tterrors.h, src/type1/t1errors.h, src/winfonts/fnterrs.h: New files defining the error names for the module it belongs to. * include/freetype/ftmoderr.h: New file, defining the module error offsets. Its structure is similar to `fterrors.h'. * include/freetype/fterrors.h (FT_NOERRORDEF): New macro. (FT_ERRORDEF): Redefined to use module error offsets. All internal error codes are now public; unused error codes have been removed, some are new. * include/freetype/config/ftheader.h (FT_MODULE_ERRORS_H): New macro. * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_USE_MODULE_ERRORS): New macro. All other source files have been updated to use the new error codes; some already existing (internal) error codes local to a module have been renamed to give them the same name as in the base module. All make files have been updated to include the local error files. * src/cid/cidtokens.h: Replaced with... * src/cid/cidtoken.h: This file for 8+3 consistency. * src/raster/ftraster.c: Use macros for header file names.
2001-06-06 19:30:41 +02:00
#include "sferrors.h"
/**************************************************************************
*
* The macro FT_COMPONENT is used in trace mode. It is an implicit
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
* messages during execution.
*/
#undef FT_COMPONENT
#define FT_COMPONENT ttpost
/* If this configuration macro is defined, we rely on the `psnames' */
2000-06-05 16:32:32 +02:00
/* module to grab the glyph names. */
#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
2000-06-05 16:32:32 +02:00
#include <freetype/internal/services/svpscmap.h>
#define MAC_NAME( x ) (FT_String*)psnames->macintosh_name( (FT_UInt)(x) )
2000-06-05 16:32:32 +02:00
2000-06-05 16:32:32 +02:00
#else /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */
/* Otherwise, we ignore the `psnames' module, and provide our own */
2000-06-05 16:32:32 +02:00
/* table of Mac names. Thus, it is possible to build a version of */
/* FreeType without the Type 1 driver & psnames module. */
#define MAC_NAME( x ) (FT_String*)tt_post_default_names[x]
/* the 258 default Mac PS glyph names; see file `tools/glnames.py' */
1999-12-17 00:11:37 +01:00
static const FT_String* const tt_post_default_names[258] =
1999-12-17 00:11:37 +01:00
{
/* 0 */
".notdef", ".null", "nonmarkingreturn", "space", "exclam",
"quotedbl", "numbersign", "dollar", "percent", "ampersand",
1999-12-17 00:11:37 +01:00
/* 10 */
"quotesingle", "parenleft", "parenright", "asterisk", "plus",
"comma", "hyphen", "period", "slash", "zero",
1999-12-17 00:11:37 +01:00
/* 20 */
"one", "two", "three", "four", "five",
"six", "seven", "eight", "nine", "colon",
1999-12-17 00:11:37 +01:00
/* 30 */
"semicolon", "less", "equal", "greater", "question",
"at", "A", "B", "C", "D",
1999-12-17 00:11:37 +01:00
/* 40 */
"E", "F", "G", "H", "I",
"J", "K", "L", "M", "N",
1999-12-17 00:11:37 +01:00
/* 50 */
"O", "P", "Q", "R", "S",
"T", "U", "V", "W", "X",
1999-12-17 00:11:37 +01:00
/* 60 */
"Y", "Z", "bracketleft", "backslash", "bracketright",
"asciicircum", "underscore", "grave", "a", "b",
1999-12-17 00:11:37 +01:00
/* 70 */
"c", "d", "e", "f", "g",
"h", "i", "j", "k", "l",
1999-12-17 00:11:37 +01:00
/* 80 */
"m", "n", "o", "p", "q",
"r", "s", "t", "u", "v",
1999-12-17 00:11:37 +01:00
/* 90 */
"w", "x", "y", "z", "braceleft",
"bar", "braceright", "asciitilde", "Adieresis", "Aring",
1999-12-17 00:11:37 +01:00
/* 100 */
"Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis",
"aacute", "agrave", "acircumflex", "adieresis", "atilde",
1999-12-17 00:11:37 +01:00
/* 110 */
"aring", "ccedilla", "eacute", "egrave", "ecircumflex",
"edieresis", "iacute", "igrave", "icircumflex", "idieresis",
1999-12-17 00:11:37 +01:00
/* 120 */
"ntilde", "oacute", "ograve", "ocircumflex", "odieresis",
"otilde", "uacute", "ugrave", "ucircumflex", "udieresis",
1999-12-17 00:11:37 +01:00
/* 130 */
"dagger", "degree", "cent", "sterling", "section",
"bullet", "paragraph", "germandbls", "registered", "copyright",
1999-12-17 00:11:37 +01:00
/* 140 */
"trademark", "acute", "dieresis", "notequal", "AE",
"Oslash", "infinity", "plusminus", "lessequal", "greaterequal",
1999-12-17 00:11:37 +01:00
/* 150 */
"yen", "mu", "partialdiff", "summation", "product",
"pi", "integral", "ordfeminine", "ordmasculine", "Omega",
1999-12-17 00:11:37 +01:00
/* 160 */
"ae", "oslash", "questiondown", "exclamdown", "logicalnot",
"radical", "florin", "approxequal", "Delta", "guillemotleft",
1999-12-17 00:11:37 +01:00
/* 170 */
"guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde",
"Otilde", "OE", "oe", "endash", "emdash",
1999-12-17 00:11:37 +01:00
/* 180 */
"quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide",
"lozenge", "ydieresis", "Ydieresis", "fraction", "currency",
1999-12-17 00:11:37 +01:00
/* 190 */
"guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl",
"periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex",
1999-12-17 00:11:37 +01:00
/* 200 */
"Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute",
"Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex",
1999-12-17 00:11:37 +01:00
/* 210 */
"apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave",
"dotlessi", "circumflex", "tilde", "macron", "breve",
1999-12-17 00:11:37 +01:00
/* 220 */
"dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek",
"caron", "Lslash", "lslash", "Scaron", "scaron",
1999-12-17 00:11:37 +01:00
/* 230 */
"Zcaron", "zcaron", "brokenbar", "Eth", "eth",
"Yacute", "yacute", "Thorn", "thorn", "minus",
1999-12-17 00:11:37 +01:00
/* 240 */
"multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf",
"onequarter", "threequarters", "franc", "Gbreve", "gbreve",
1999-12-17 00:11:37 +01:00
/* 250 */
"Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute",
"Ccaron", "ccaron", "dcroat",
1999-12-17 00:11:37 +01:00
};
2000-06-05 16:32:32 +02:00
2000-06-05 16:32:32 +02:00
#endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */
1999-12-17 00:11:37 +01:00
2001-06-28 01:25:46 +02:00
static FT_Error
load_format_20( TT_Face face,
FT_Stream stream,
FT_ULong post_len )
1999-12-17 00:11:37 +01:00
{
FT_Memory memory = stream->memory;
FT_Error error;
1999-12-17 00:11:37 +01:00
FT_Int num_glyphs;
FT_UShort num_names;
1999-12-17 00:11:37 +01:00
2015-04-16 05:20:23 +02:00
FT_UShort* glyph_indices = NULL;
FT_Char** name_strings = NULL;
FT_Byte* strings = NULL;
1999-12-17 00:11:37 +01:00
if ( FT_READ_USHORT( num_glyphs ) )
1999-12-17 00:11:37 +01:00
goto Exit;
/* UNDOCUMENTED! The number of glyphs in this table can be smaller */
/* than the value in the maxp table (cf. cyberbit.ttf). */
/* There already exist fonts which have more than 32768 glyph names */
/* in this table, so the test for this threshold has been dropped. */
if ( num_glyphs > face->max_profile.numGlyphs ||
(FT_ULong)num_glyphs * 2UL > post_len - 2 )
1999-12-17 00:11:37 +01:00
{
error = FT_THROW( Invalid_File_Format );
1999-12-17 00:11:37 +01:00
goto Exit;
}
/* load the indices */
{
FT_Int n;
1999-12-17 00:11:37 +01:00
2000-06-05 16:32:32 +02:00
if ( FT_QNEW_ARRAY( glyph_indices, num_glyphs ) ||
FT_FRAME_ENTER( num_glyphs * 2L ) )
1999-12-17 00:11:37 +01:00
goto Fail;
for ( n = 0; n < num_glyphs; n++ )
glyph_indices[n] = FT_GET_USHORT();
1999-12-17 00:11:37 +01:00
FT_FRAME_EXIT();
1999-12-17 00:11:37 +01:00
}
/* compute number of names stored in table */
{
FT_Int n;
1999-12-17 00:11:37 +01:00
2000-06-05 16:32:32 +02:00
1999-12-17 00:11:37 +01:00
num_names = 0;
for ( n = 0; n < num_glyphs; n++ )
{
* src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new, ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free, ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug, FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings. * src/base/ftcalc.c (FT_MulFix): Ditto. * src/cff/cffdrivr.c (cff_get_name_index): Ditto. * src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init, CFF_GlyphSlot_Init): Ditto. * src/cid/cidobjs.c (CID_GlyphSlot_Init, CID_Size_Get_Globals_Funcs): Ditto. * src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init): Ditto. * src/pshinter/pshmod.c (pshinter_interface): Use `static const'. * src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused variables. * include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed to... (T1_Builder_FuncsRec): This. (T1_Builder_Funcs): New typedef. (PSAux_Interface): Remove compiler warnings. * src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h (t1_builder_funcs): Updated. * src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ... (PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines. (PSH_AlignmentRec): Updated. * include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix typo. * include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto. * src/base/ftstream (FT_Get_Char): Rename to... (FT_Stream_Get_Char): This. * src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is a built-in function in gcc, causing warning messages with gcc 3.0. * src/autohint/ahglyph.c (ah_outline_load): Ditto. * src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto. * src/cache/ftcmanag.c (ftc_family_table_alloc, ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache): Ditto. * src/cff/cffload.c (cff_new_index, cff_done_index, cff_explicit_index, CFF_Access_Element, CFF_Forget_Element, CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font, CFF_Done_Font): Ditto. * src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto. * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto. * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit, ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3, * src/pshinter/pshalgo1.c (psh1_hint_table_record, psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto. * src/pshinter/pshalgo2.c (psh2_hint_table_record, psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto. * src/sfnt/ttpost.c (Load_Format_20, Load_Format_25, TT_Get_PS_Name): Ditto. * src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics, load_truetype_glyph): Ditto. * src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto. * src/type1/t1afm.c (T1_Get_Kerning): Ditto. * include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
2002-03-07 22:59:59 +01:00
FT_Int idx;
1999-12-17 00:11:37 +01:00
2000-06-05 16:32:32 +02:00
* src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new, ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free, ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug, FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings. * src/base/ftcalc.c (FT_MulFix): Ditto. * src/cff/cffdrivr.c (cff_get_name_index): Ditto. * src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init, CFF_GlyphSlot_Init): Ditto. * src/cid/cidobjs.c (CID_GlyphSlot_Init, CID_Size_Get_Globals_Funcs): Ditto. * src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init): Ditto. * src/pshinter/pshmod.c (pshinter_interface): Use `static const'. * src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused variables. * include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed to... (T1_Builder_FuncsRec): This. (T1_Builder_Funcs): New typedef. (PSAux_Interface): Remove compiler warnings. * src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h (t1_builder_funcs): Updated. * src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ... (PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines. (PSH_AlignmentRec): Updated. * include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix typo. * include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto. * src/base/ftstream (FT_Get_Char): Rename to... (FT_Stream_Get_Char): This. * src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is a built-in function in gcc, causing warning messages with gcc 3.0. * src/autohint/ahglyph.c (ah_outline_load): Ditto. * src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto. * src/cache/ftcmanag.c (ftc_family_table_alloc, ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache): Ditto. * src/cff/cffload.c (cff_new_index, cff_done_index, cff_explicit_index, CFF_Access_Element, CFF_Forget_Element, CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font, CFF_Done_Font): Ditto. * src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto. * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto. * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit, ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3, * src/pshinter/pshalgo1.c (psh1_hint_table_record, psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto. * src/pshinter/pshalgo2.c (psh2_hint_table_record, psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto. * src/sfnt/ttpost.c (Load_Format_20, Load_Format_25, TT_Get_PS_Name): Ditto. * src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics, load_truetype_glyph): Ditto. * src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto. * src/type1/t1afm.c (T1_Get_Kerning): Ditto. * include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
2002-03-07 22:59:59 +01:00
idx = glyph_indices[n];
if ( idx >= 258 )
1999-12-17 00:11:37 +01:00
{
* src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new, ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free, ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug, FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings. * src/base/ftcalc.c (FT_MulFix): Ditto. * src/cff/cffdrivr.c (cff_get_name_index): Ditto. * src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init, CFF_GlyphSlot_Init): Ditto. * src/cid/cidobjs.c (CID_GlyphSlot_Init, CID_Size_Get_Globals_Funcs): Ditto. * src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init): Ditto. * src/pshinter/pshmod.c (pshinter_interface): Use `static const'. * src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused variables. * include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed to... (T1_Builder_FuncsRec): This. (T1_Builder_Funcs): New typedef. (PSAux_Interface): Remove compiler warnings. * src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h (t1_builder_funcs): Updated. * src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ... (PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines. (PSH_AlignmentRec): Updated. * include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix typo. * include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto. * src/base/ftstream (FT_Get_Char): Rename to... (FT_Stream_Get_Char): This. * src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is a built-in function in gcc, causing warning messages with gcc 3.0. * src/autohint/ahglyph.c (ah_outline_load): Ditto. * src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto. * src/cache/ftcmanag.c (ftc_family_table_alloc, ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache): Ditto. * src/cff/cffload.c (cff_new_index, cff_done_index, cff_explicit_index, CFF_Access_Element, CFF_Forget_Element, CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font, CFF_Done_Font): Ditto. * src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto. * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto. * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit, ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3, * src/pshinter/pshalgo1.c (psh1_hint_table_record, psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto. * src/pshinter/pshalgo2.c (psh2_hint_table_record, psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto. * src/sfnt/ttpost.c (Load_Format_20, Load_Format_25, TT_Get_PS_Name): Ditto. * src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics, load_truetype_glyph): Ditto. * src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto. * src/type1/t1afm.c (T1_Get_Kerning): Ditto. * include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
2002-03-07 22:59:59 +01:00
idx -= 257;
if ( idx > num_names )
num_names = (FT_UShort)idx;
1999-12-17 00:11:37 +01:00
}
}
}
/* now load the name strings */
if ( num_names )
1999-12-17 00:11:37 +01:00
{
FT_UShort n;
FT_ULong p;
1999-12-17 00:11:37 +01:00
post_len -= (FT_ULong)num_glyphs * 2UL + 2;
2000-06-05 16:32:32 +02:00
if ( FT_QALLOC( strings, post_len + 1 ) ||
FT_STREAM_READ( strings, post_len ) ||
FT_QNEW_ARRAY( name_strings, num_names ) )
1999-12-17 00:11:37 +01:00
goto Fail;
/* convert from Pascal- to C-strings and set pointers */
for ( p = 0, n = 0; p < post_len && n < num_names; n++ )
1999-12-17 00:11:37 +01:00
{
FT_UInt len = strings[p];
2000-06-05 16:32:32 +02:00
if ( len > 63U )
{
error = FT_THROW( Invalid_File_Format );
goto Fail;
}
strings[p] = 0;
name_strings[n] = (FT_Char*)strings + p + 1;
p += len + 1;
1999-12-17 00:11:37 +01:00
}
strings[post_len] = 0;
/* deal with missing or insufficient string data */
if ( n < num_names )
{
if ( post_len == 0 )
{
/* fake empty string */
if ( FT_QREALLOC( strings, 1, 2 ) )
goto Fail;
post_len = 1;
strings[post_len] = 0;
}
FT_ERROR(( "load_format_20:"
" all entries in post table are already parsed,"
" using NULL names for gid %d - %d\n",
n, num_names - 1 ));
for ( ; n < num_names; n++ )
name_strings[n] = (FT_Char*)strings + post_len;
}
1999-12-17 00:11:37 +01:00
}
2007-01-26 23:18:56 +01:00
/* all right, set table fields and exit successfully */
1999-12-17 00:11:37 +01:00
{
TT_Post_20 table = &face->postscript_names.names.format_20;
1999-12-17 00:11:37 +01:00
2000-06-05 16:32:32 +02:00
table->num_glyphs = (FT_UShort)num_glyphs;
table->num_names = (FT_UShort)num_names;
1999-12-17 00:11:37 +01:00
table->glyph_indices = glyph_indices;
table->glyph_names = name_strings;
}
return FT_Err_Ok;
1999-12-17 00:11:37 +01:00
Fail:
FT_FREE( name_strings );
FT_FREE( strings );
FT_FREE( glyph_indices );
1999-12-17 00:11:37 +01:00
Exit:
return error;
}
2001-06-28 01:25:46 +02:00
static FT_Error
load_format_25( TT_Face face,
FT_Stream stream,
FT_ULong post_len )
1999-12-17 00:11:37 +01:00
{
FT_Memory memory = stream->memory;
FT_Error error;
1999-12-17 00:11:37 +01:00
FT_Int num_glyphs;
2015-04-16 05:20:23 +02:00
FT_Char* offset_table = NULL;
1999-12-17 00:11:37 +01:00
FT_UNUSED( post_len );
1999-12-17 00:11:37 +01:00
if ( FT_READ_USHORT( num_glyphs ) )
1999-12-17 00:11:37 +01:00
goto Exit;
/* check the number of glyphs */
if ( num_glyphs > face->max_profile.numGlyphs ||
num_glyphs > 258 ||
num_glyphs < 1 )
1999-12-17 00:11:37 +01:00
{
error = FT_THROW( Invalid_File_Format );
1999-12-17 00:11:37 +01:00
goto Exit;
}
if ( FT_QNEW_ARRAY( offset_table, num_glyphs ) ||
FT_STREAM_READ( offset_table, num_glyphs ) )
1999-12-17 00:11:37 +01:00
goto Fail;
/* now check the offset table */
{
FT_Int n;
1999-12-17 00:11:37 +01:00
for ( n = 0; n < num_glyphs; n++ )
{
* src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new, ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free, ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug, FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings. * src/base/ftcalc.c (FT_MulFix): Ditto. * src/cff/cffdrivr.c (cff_get_name_index): Ditto. * src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init, CFF_GlyphSlot_Init): Ditto. * src/cid/cidobjs.c (CID_GlyphSlot_Init, CID_Size_Get_Globals_Funcs): Ditto. * src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init): Ditto. * src/pshinter/pshmod.c (pshinter_interface): Use `static const'. * src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused variables. * include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed to... (T1_Builder_FuncsRec): This. (T1_Builder_Funcs): New typedef. (PSAux_Interface): Remove compiler warnings. * src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h (t1_builder_funcs): Updated. * src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ... (PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines. (PSH_AlignmentRec): Updated. * include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix typo. * include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto. * src/base/ftstream (FT_Get_Char): Rename to... (FT_Stream_Get_Char): This. * src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is a built-in function in gcc, causing warning messages with gcc 3.0. * src/autohint/ahglyph.c (ah_outline_load): Ditto. * src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto. * src/cache/ftcmanag.c (ftc_family_table_alloc, ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache): Ditto. * src/cff/cffload.c (cff_new_index, cff_done_index, cff_explicit_index, CFF_Access_Element, CFF_Forget_Element, CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font, CFF_Done_Font): Ditto. * src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto. * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto. * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit, ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3, * src/pshinter/pshalgo1.c (psh1_hint_table_record, psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto. * src/pshinter/pshalgo2.c (psh2_hint_table_record, psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto. * src/sfnt/ttpost.c (Load_Format_20, Load_Format_25, TT_Get_PS_Name): Ditto. * src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics, load_truetype_glyph): Ditto. * src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto. * src/type1/t1afm.c (T1_Get_Kerning): Ditto. * include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
2002-03-07 22:59:59 +01:00
FT_Long idx = (FT_Long)n + offset_table[n];
1999-12-17 00:11:37 +01:00
* src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new, ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free, ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug, FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings. * src/base/ftcalc.c (FT_MulFix): Ditto. * src/cff/cffdrivr.c (cff_get_name_index): Ditto. * src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init, CFF_GlyphSlot_Init): Ditto. * src/cid/cidobjs.c (CID_GlyphSlot_Init, CID_Size_Get_Globals_Funcs): Ditto. * src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init): Ditto. * src/pshinter/pshmod.c (pshinter_interface): Use `static const'. * src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused variables. * include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed to... (T1_Builder_FuncsRec): This. (T1_Builder_Funcs): New typedef. (PSAux_Interface): Remove compiler warnings. * src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h (t1_builder_funcs): Updated. * src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ... (PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines. (PSH_AlignmentRec): Updated. * include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix typo. * include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto. * src/base/ftstream (FT_Get_Char): Rename to... (FT_Stream_Get_Char): This. * src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is a built-in function in gcc, causing warning messages with gcc 3.0. * src/autohint/ahglyph.c (ah_outline_load): Ditto. * src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto. * src/cache/ftcmanag.c (ftc_family_table_alloc, ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache): Ditto. * src/cff/cffload.c (cff_new_index, cff_done_index, cff_explicit_index, CFF_Access_Element, CFF_Forget_Element, CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font, CFF_Done_Font): Ditto. * src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto. * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto. * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit, ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3, * src/pshinter/pshalgo1.c (psh1_hint_table_record, psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto. * src/pshinter/pshalgo2.c (psh2_hint_table_record, psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto. * src/sfnt/ttpost.c (Load_Format_20, Load_Format_25, TT_Get_PS_Name): Ditto. * src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics, load_truetype_glyph): Ditto. * src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto. * src/type1/t1afm.c (T1_Get_Kerning): Ditto. * include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
2002-03-07 22:59:59 +01:00
if ( idx < 0 || idx > num_glyphs )
1999-12-17 00:11:37 +01:00
{
error = FT_THROW( Invalid_File_Format );
1999-12-17 00:11:37 +01:00
goto Fail;
}
}
}
2007-01-26 23:18:56 +01:00
/* OK, set table fields and exit successfully */
1999-12-17 00:11:37 +01:00
{
TT_Post_25 table = &face->postscript_names.names.format_25;
1999-12-17 00:11:37 +01:00
table->num_glyphs = (FT_UShort)num_glyphs;
1999-12-17 00:11:37 +01:00
table->offsets = offset_table;
}
return FT_Err_Ok;
1999-12-17 00:11:37 +01:00
Fail:
FT_FREE( offset_table );
1999-12-17 00:11:37 +01:00
Exit:
return error;
}
2001-06-28 01:25:46 +02:00
static FT_Error
load_post_names( TT_Face face )
1999-12-17 00:11:37 +01:00
{
FT_Stream stream;
FT_Error error;
FT_Fixed format;
FT_ULong post_len;
1999-12-17 00:11:37 +01:00
/* get a stream for the face's resource */
stream = face->root.stream;
/* seek to the beginning of the PS names table */
error = face->goto_table( face, TTAG_post, stream, &post_len );
2000-06-05 16:32:32 +02:00
if ( error )
goto Exit;
1999-12-17 00:11:37 +01:00
format = face->postscript.FormatType;
/* go to beginning of subtable */
if ( FT_STREAM_SKIP( 32 ) )
goto Exit;
1999-12-17 00:11:37 +01:00
/* now read postscript table */
if ( format == 0x00020000L && post_len >= 34 )
error = load_format_20( face, stream, post_len - 32 );
else if ( format == 0x00025000L && post_len >= 34 )
error = load_format_25( face, stream, post_len - 32 );
* 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
else
error = FT_THROW( Invalid_File_Format );
1999-12-17 00:11:37 +01:00
face->postscript_names.loaded = 1;
Exit:
return error;
}
FT_LOCAL_DEF( void )
tt_face_free_ps_names( TT_Face face )
1999-12-17 00:11:37 +01:00
{
FT_Memory memory = face->root.memory;
TT_Post_Names names = &face->postscript_names;
* 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_Fixed format;
1999-12-17 00:11:37 +01:00
if ( names->loaded )
{
* 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
format = face->postscript.FormatType;
1999-12-17 00:11:37 +01:00
* 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
if ( format == 0x00020000L )
{
TT_Post_20 table = &names->names.format_20;
1999-12-17 00:11:37 +01:00
* 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_FREE( table->glyph_indices );
table->num_glyphs = 0;
1999-12-17 00:11:37 +01:00
if ( table->num_names )
{
table->glyph_names[0]--;
FT_FREE( table->glyph_names[0] );
1999-12-17 00:11:37 +01:00
FT_FREE( table->glyph_names );
table->num_names = 0;
}
* 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
}
else if ( format == 0x00025000L )
* 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
{
TT_Post_25 table = &names->names.format_25;
1999-12-17 00:11:37 +01:00
* 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_FREE( table->offsets );
table->num_glyphs = 0;
1999-12-17 00:11:37 +01:00
}
}
names->loaded = 0;
}
/**************************************************************************
*
* @Function:
* tt_face_get_ps_name
*
* @Description:
* Get the PostScript glyph name of a glyph.
*
* @Input:
* face ::
* A handle to the parent face.
*
* idx ::
* The glyph index.
*
* @InOut:
* PSname ::
* The address of a string pointer. Undefined in case of
* error, otherwise it is a pointer to the glyph name.
*
* You must not modify the returned string!
*
* @Output:
* FreeType error code. 0 means success.
*/
FT_LOCAL_DEF( FT_Error )
tt_face_get_ps_name( TT_Face face,
FT_UInt idx,
FT_String** PSname )
1999-12-17 00:11:37 +01:00
{
FT_Error error;
TT_Post_Names names;
FT_Fixed format;
2000-06-05 16:32:32 +02:00
2000-02-22 14:34:26 +01:00
#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
FT_Service_PsCMaps psnames;
2000-02-22 14:34:26 +01:00
#endif
2000-06-05 16:32:32 +02:00
1999-12-17 00:11:37 +01:00
if ( !face )
return FT_THROW( Invalid_Face_Handle );
1999-12-17 00:11:37 +01:00
* include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Remove unused `max_points' and `max_contours'. * src/cid/cidobjs.c (cid_face_init), src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Update. * include/freetype/internal/tttypes.h (TT_FaceRec): Remove unused `max_components'. * src/truetype/ttinterp.h (TT_ExecContextRec): Remove unused `loadSize' and `loadStack'. * src/truetype/ttinterp.c (TT_Done_Context, TT_Load_Context), src/sfnt/ttload.c (tt_face_load_maxp): Update. * src/cff/cffobjs.h (cff_size_select), src/sfnt/sfdriver.c (sfnt_interface), src/truetype/ttdriver.c (tt_size_request): Fix compiler errors/warnings when TT_CONFIG_OPTION_EMBEDDED_BITMAPS is not defined. * src/sfnt/ttmtx.c (tt_face_load_hmtx, tt_face_get_metrics): Fix possible segment faults for the non-FT_OPTIMIZE_MEMORY'ed versions. (finally!) For most OpenType tables, `tt_face_load_xxxx' simply loads the table and `face->root' is set later in `sfnt_load_face'. Here, we try to make this work for _all_ tables. * src/sfnt/ttsbit.c, src/sfnt/ttsbit0.c, src/sfnt/ttload.c, src/sfnt/ttmtx.c: all `tt_face_load_xxxx' should load the table and then exit. Error handling or setting face->root is done later in `sfnt_load_face'. Pretty trace messages. * src/sfnt/sfobjs.c (sfnt_load_face): Work harder. Mac bitmap-only fonts are not scalable. Check that `face->header.Units_Per_EM' is not zero. (LOAD_, LOADM_): Pretty trace messages. * src/sfnt/ttsbit0.c (tt_face_load_strike_metrics): Read metrics from `eblc'. * src/sfnt/ttcmap.c (tt_face_build_cmaps), src/sfnt/ttpost.c (load_format_20, load_format_25, tt_face_get_ps_name): Use face->max_profile.numGlyphs, instead of face->root.num_glyphs.
2006-02-15 08:44:31 +01:00
if ( idx >= (FT_UInt)face->max_profile.numGlyphs )
return FT_THROW( Invalid_Glyph_Index );
1999-12-17 00:11:37 +01:00
2000-02-22 14:34:26 +01:00
#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
psnames = (FT_Service_PsCMaps)face->psnames;
2000-06-05 16:32:32 +02:00
if ( !psnames )
return FT_THROW( Unimplemented_Feature );
2000-02-22 14:34:26 +01:00
#endif
2000-06-05 16:32:32 +02:00
names = &face->postscript_names;
1999-12-17 00:11:37 +01:00
/* `.notdef' by default */
2000-06-05 16:32:32 +02:00
*PSname = MAC_NAME( 0 );
1999-12-17 00:11:37 +01:00
* 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
format = face->postscript.FormatType;
if ( format == 0x00010000L )
1999-12-17 00:11:37 +01:00
{
* src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new, ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free, ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug, FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings. * src/base/ftcalc.c (FT_MulFix): Ditto. * src/cff/cffdrivr.c (cff_get_name_index): Ditto. * src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init, CFF_GlyphSlot_Init): Ditto. * src/cid/cidobjs.c (CID_GlyphSlot_Init, CID_Size_Get_Globals_Funcs): Ditto. * src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init): Ditto. * src/pshinter/pshmod.c (pshinter_interface): Use `static const'. * src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused variables. * include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed to... (T1_Builder_FuncsRec): This. (T1_Builder_Funcs): New typedef. (PSAux_Interface): Remove compiler warnings. * src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h (t1_builder_funcs): Updated. * src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ... (PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines. (PSH_AlignmentRec): Updated. * include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix typo. * include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto. * src/base/ftstream (FT_Get_Char): Rename to... (FT_Stream_Get_Char): This. * src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is a built-in function in gcc, causing warning messages with gcc 3.0. * src/autohint/ahglyph.c (ah_outline_load): Ditto. * src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto. * src/cache/ftcmanag.c (ftc_family_table_alloc, ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache): Ditto. * src/cff/cffload.c (cff_new_index, cff_done_index, cff_explicit_index, CFF_Access_Element, CFF_Forget_Element, CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font, CFF_Done_Font): Ditto. * src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto. * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto. * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit, ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3, * src/pshinter/pshalgo1.c (psh1_hint_table_record, psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto. * src/pshinter/pshalgo2.c (psh2_hint_table_record, psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto. * src/sfnt/ttpost.c (Load_Format_20, Load_Format_25, TT_Get_PS_Name): Ditto. * src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics, load_truetype_glyph): Ditto. * src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto. * src/type1/t1afm.c (T1_Get_Kerning): Ditto. * include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
2002-03-07 22:59:59 +01:00
if ( idx < 258 ) /* paranoid checking */
*PSname = MAC_NAME( idx );
* 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
}
else if ( format == 0x00020000L )
{
TT_Post_20 table = &names->names.format_20;
1999-12-17 00:11:37 +01:00
* 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
if ( !names->loaded )
1999-12-17 00:11:37 +01:00
{
* 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
error = load_post_names( face );
if ( error )
goto End;
}
1999-12-17 00:11:37 +01:00
* 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
if ( idx < (FT_UInt)table->num_glyphs )
{
FT_UShort name_index = table->glyph_indices[idx];
1999-12-17 00:11:37 +01:00
* 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
if ( name_index < 258 )
*PSname = MAC_NAME( name_index );
else
*PSname = (FT_String*)table->glyph_names[name_index - 258];
}
}
else if ( format == 0x00025000L )
* 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
{
TT_Post_25 table = &names->names.format_25;
1999-12-17 00:11:37 +01:00
* 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
if ( !names->loaded )
{
error = load_post_names( face );
if ( error )
goto End;
1999-12-17 00:11:37 +01:00
}
* 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
if ( idx < (FT_UInt)table->num_glyphs ) /* paranoid checking */
*PSname = MAC_NAME( (FT_Int)idx + table->offsets[idx] );
1999-12-17 00:11:37 +01:00
}
* 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
/* nothing to do for format == 0x00030000L */
1999-12-17 00:11:37 +01:00
* 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
End:
return FT_Err_Ok;
1999-12-17 00:11:37 +01:00
}
#else /* !TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
/* ANSI C doesn't like empty source files */
typedef int _tt_post_dummy;
#endif /* !TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
1999-12-17 00:11:37 +01:00
/* END */