freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 8f09eb5: Allow FT_ENCODING_NONE for `FT_Select_Charma


From: Werner LEMBERG
Subject: [freetype2] master 8f09eb5: Allow FT_ENCODING_NONE for `FT_Select_Charmap'.
Date: Tue, 17 Jul 2018 15:45:39 -0400 (EDT)

branch: master
commit 8f09eb5ce0260aa17f93b2ccefb4bae347ca79fc
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    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.
---
 ChangeLog                   | 9 +++++++++
 include/freetype/freetype.h | 3 ++-
 src/base/ftobjs.c           | 5 +++--
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2ff6182..8662cf9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2018-07-17  Werner Lemberg  <address@hidden>
 
+       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  <address@hidden>
+
        * src/pcf/pcfread.c (pcf_get_encodings): Trace `defaultChar'.
 
 2018-07-16  Armin Hasitzka  <address@hidden>
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index b47b0e4..92a4b44 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -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
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 4f237e2..dfae22f 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -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;
       }
     }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]