Add support for ISOLatin1 PS encoding.

* include/freetype/freetype.h (ft_encoding_latin_1): New tag
(`lat1').
* include/freetype/internal/t1types.h (T1_Encoding_Type): Add
`t1_encoding_isolatin1'.
* src/type1/t1driver.c (Get_Char_Index, Get_Next_Char): Handle
ft_encoding_latin_1.
* src/type1/t1load.c (parse_encoding): Handle `ISOLatin1Encoding'.
* src/type1/t1objs.c (T1_Face_Init): Handle `t1_encoding_isolatin1'.
This commit is contained in:
Werner Lemberg 2002-02-10 12:33:14 +00:00
parent 7c89d18d9f
commit 66b3509bdd
6 changed files with 83 additions and 19 deletions

View File

@ -1,3 +1,16 @@
2002-02-10 Roberto Alameda <ojancano@geekmail.de>
Add support for ISOLatin1 PS encoding.
* include/freetype/freetype.h (ft_encoding_latin_1): New tag
(`lat1').
* include/freetype/internal/t1types.h (T1_Encoding_Type): Add
`t1_encoding_isolatin1'.
* src/type1/t1driver.c (Get_Char_Index, Get_Next_Char): Handle
ft_encoding_latin_1.
* src/type1/t1load.c (parse_encoding): Handle `ISOLatin1Encoding'.
* src/type1/t1objs.c (T1_Face_Init): Handle `t1_encoding_isolatin1'.
2002-02-09 Werner Lemberg <wl@gnu.org>
* README: Fix typo.

View File

@ -395,6 +395,7 @@ FT_BEGIN_HEADER
FT_ENC_TAG( ft_encoding_symbol, 's', 'y', 'm', 'b' ),
FT_ENC_TAG( ft_encoding_unicode, 'u', 'n', 'i', 'c' ),
FT_ENC_TAG( ft_encoding_latin_1, 'l', 'a', 't', '1' ),
FT_ENC_TAG( ft_encoding_latin_2, 'l', 'a', 't', '2' ),
FT_ENC_TAG( ft_encoding_sjis, 's', 'j', 'i', 's' ),
FT_ENC_TAG( ft_encoding_gb2312, 'g', 'b', ' ', ' ' ),

View File

@ -80,6 +80,7 @@ FT_BEGIN_HEADER
t1_encoding_none = 0,
t1_encoding_array,
t1_encoding_standard,
t1_encoding_isolatin1,
t1_encoding_expert
} T1_EncodingType;

View File

@ -273,6 +273,24 @@
result = 0;
goto Exit;
/*******************************************************************/
/* */
/* ISOLatin1 encoding support */
/* */
case ft_encoding_latin_1:
/* ISOLatin1 is the first page of Unicode */
if ( charcode < 256 && psnames->unicode_value )
{
result = psnames->lookup_unicode( &face->unicode_map,
(FT_ULong)charcode );
/* the function returns 0xFFFF if the Unicode charcode has */
/* no corresponding glyph */
if ( result == 0xFFFF )
result = 0;
}
goto Exit;
/*******************************************************************/
/* */
/* Custom Type 1 encoding */
@ -365,6 +383,23 @@
return psnames->next_unicode( &face->unicode_map,
(FT_ULong)charcode );
/*******************************************************************/
/* */
/* ISOLatin1 encoding support */
/* */
case ft_encoding_latin_1:
{
FT_Long code;
/* use the `PSNames' module to synthetize the Unicode charmap */
code = psnames->next_unicode( &face->unicode_map,
(FT_ULong)charcode );
if ( code < 256 )
return code;
break;
}
/*******************************************************************/
/* */
/* Custom Type 1 encoding */

View File

@ -1082,6 +1082,10 @@
strncmp( (const char*)cur, "ExpertEncoding", 14 ) == 0 )
face->type1.encoding_type = t1_encoding_expert;
else if ( cur + 18 < limit &&
strncmp( (const char*)cur, "ISOLatin1Encoding", 17 ) == 0 )
face->type1.encoding_type = t1_encoding_isolatin1;
else
{
FT_ERROR(( "parse_encoding: invalid token!\n" ));

View File

@ -489,10 +489,20 @@
charmap->encoding_id = 1;
break;
default:
case t1_encoding_array:
charmap->encoding = ft_encoding_adobe_custom;
charmap->encoding_id = 2;
break;
case t1_encoding_isolatin1:
charmap->encoding = ft_encoding_latin_1;
charmap->encoding_id = 3;
break;
default:
FT_ERROR(( "T1_Face_Init: invalid encoding\n" ));
error = T1_Err_Invalid_File_Format;
goto Exit;
}
root->charmaps = face->charmaps;