Allow FT_ENCODING_NONE for `FT_Select_Charmap'.

This is a valid encoding tag for BDF, PCF, and Windows FNT, and
there is no reason to disallow it for these formats.

* src/base/ftobjs.c (FT_Select_Charmap): Implement it.
This commit is contained in:
Werner Lemberg 2018-07-17 21:45:24 +02:00
parent 9e69987aaa
commit 8f09eb5ce0
3 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,12 @@
2018-07-17 Werner Lemberg <wl@gnu.org>
Allow FT_ENCODING_NONE for `FT_Select_Charmap'.
This is a valid encoding tag for BDF, PCF, and Windows FNT, and
there is no reason to disallow it for these formats.
* src/base/ftobjs.c (FT_Select_Charmap): Implement it.
2018-07-17 Werner Lemberg <wl@gnu.org>
* src/pcf/pcfread.c (pcf_get_encodings): Trace `defaultChar'.

View File

@ -642,7 +642,8 @@ FT_BEGIN_HEADER
*
* @values:
* FT_ENCODING_NONE ::
* The encoding value~0 is reserved.
* The encoding value~0 is reserved for all formats except BDF, PCF,
* and Windows FNT; see below for more information.
*
* FT_ENCODING_UNICODE ::
* The Unicode character set. This value covers all versions of

View File

@ -3480,7 +3480,8 @@
if ( !face )
return FT_THROW( Invalid_Face_Handle );
if ( encoding == FT_ENCODING_NONE )
/* FT_ENCODING_NONE is a valid encoding for BDF, PCF, and Windows FNT */
if ( encoding == FT_ENCODING_NONE && !face->num_charmaps )
return FT_THROW( Invalid_Argument );
/* FT_ENCODING_UNICODE is special. We try to find the `best' Unicode */
@ -3501,7 +3502,7 @@
if ( cur[0]->encoding == encoding )
{
face->charmap = cur[0];
return 0;
return FT_Err_Ok;
}
}