Source-Changes-HG archive

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

[xsrc/trunk]: xsrc/external/mit/fonttosfnt/dist initial import of fonttosfnt-...



details:   https://anonhg.NetBSD.org/xsrc/rev/a9662c73c1a9
branches:  trunk
changeset: 10682:a9662c73c1a9
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Apr 27 01:21:04 2021 +0000

description:
initial import of fonttosfnt-1.2.1

diffstat:

 external/mit/fonttosfnt/dist/ChangeLog    |  53 +++++++++++++++++++++++++++++++
 external/mit/fonttosfnt/dist/configure    |  20 +++++-----
 external/mit/fonttosfnt/dist/configure.ac |   4 +-
 external/mit/fonttosfnt/dist/fonttosfnt.h |   1 +
 external/mit/fonttosfnt/dist/read.c       |  42 ++++++++++++++----------
 external/mit/fonttosfnt/dist/util.c       |  18 ++++++++++
 external/mit/fonttosfnt/dist/write.c      |   9 ++--
 7 files changed, 112 insertions(+), 35 deletions(-)

diffs (truncated from 342 to 300 lines):

diff -r 059f086aad76 -r a9662c73c1a9 external/mit/fonttosfnt/dist/ChangeLog
--- a/external/mit/fonttosfnt/dist/ChangeLog    Mon Apr 26 21:25:12 2021 +0000
+++ b/external/mit/fonttosfnt/dist/ChangeLog    Tue Apr 27 01:21:04 2021 +0000
@@ -1,3 +1,56 @@
+commit 33f944705c6c42e1b52f6ec62131d31f737c638f
+Author: Peter Hutterer <peter.hutterer%who-t.net@localhost>
+Date:   Wed Dec 16 15:14:11 2020 +1000
+
+    Bump to 1.2.1
+
+commit 2d30328f9c5390eb38d4052028cd00bafaa151d4
+Author: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+Date:   Sat Oct 31 21:01:02 2020 -0700
+
+    writeFile: avoid file leak on errors
+    
+    Resolves issues found by Oracle Parfait 4.0 static analyser:
+    
+       File Leak [file-ptr-leak]:
+          Leaked File out
+            at line 337 of app/fonttosfnt/write.c in function 'writeFile'.
+              out initialized at line 330 with fopen
+       File Leak [file-ptr-leak]:
+          Leaked File out
+            at line 366 of app/fonttosfnt/write.c in function 'writeFile'.
+              out initialized at line 330 with fopen
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+
+commit 899eadee6750ea39ddb6b874529c29c011599bb2
+Author: Christopher Zimmermann <madroach%gmerlin.de@localhost>
+Date:   Sat Oct 24 11:41:32 2020 +0200
+
+    Fall back to using FONT property as family name
+
+commit 5f2307d883de6ddf55f499f1690840747b1a3ad9
+Author: Christopher Zimmermann <madroach%gmerlin.de@localhost>
+Date:   Sat Oct 24 09:53:32 2020 +0200
+
+    fix sign of calculated descent
+    
+    I discovered this bug when converting the Tamsyn font from pcf to otb.
+
+commit 4d418c1602c8b939d3e5e479c44985a505ecad83
+Author: Christopher Zimmermann <madroach%gmerlin.de@localhost>
+Date:   Fri Oct 23 21:35:24 2020 +0200
+
+    handle empty foundry encoded as NULL
+    
+    to fix a segfault
+
+commit 5727003b1df9071a2bc9a42bc0b25d7c03c8de09
+Author: Christopher Zimmermann <madroach%gmerlin.de@localhost>
+Date:   Fri Oct 23 21:00:06 2020 +0200
+
+    remove leftover debug printf
+
 commit 91af80a0aa18c969cd90668eed80bcbfc1e40661
 Author: Peter Hutterer <peter.hutterer%who-t.net@localhost>
 Date:   Wed Oct 21 16:36:30 2020 +1000
diff -r 059f086aad76 -r a9662c73c1a9 external/mit/fonttosfnt/dist/configure
--- a/external/mit/fonttosfnt/dist/configure    Mon Apr 26 21:25:12 2021 +0000
+++ b/external/mit/fonttosfnt/dist/configure    Tue Apr 27 01:21:04 2021 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for fonttosfnt 1.2.0.
+# Generated by GNU Autoconf 2.69 for fonttosfnt 1.2.1.
 #
 # Report bugs to <https://gitlab.freedesktop.org/xorg/app/fonttosfnt/issues>.
 #
@@ -581,8 +581,8 @@
 # Identity of this package.
 PACKAGE_NAME='fonttosfnt'
 PACKAGE_TARNAME='fonttosfnt'
-PACKAGE_VERSION='1.2.0'
-PACKAGE_STRING='fonttosfnt 1.2.0'
+PACKAGE_VERSION='1.2.1'
+PACKAGE_STRING='fonttosfnt 1.2.1'
 PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/app/fonttosfnt/issues'
 PACKAGE_URL=''
 
@@ -1309,7 +1309,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures fonttosfnt 1.2.0 to adapt to many kinds of systems.
+\`configure' configures fonttosfnt 1.2.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1379,7 +1379,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of fonttosfnt 1.2.0:";;
+     short | recursive ) echo "Configuration of fonttosfnt 1.2.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1485,7 +1485,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-fonttosfnt configure 1.2.0
+fonttosfnt configure 1.2.1
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1809,7 +1809,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by fonttosfnt $as_me 1.2.0, which was
+It was created by fonttosfnt $as_me 1.2.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2677,7 +2677,7 @@
 
 # Define the identity of the package.
  PACKAGE='fonttosfnt'
- VERSION='1.2.0'
+ VERSION='1.2.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -11372,7 +11372,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by fonttosfnt $as_me 1.2.0, which was
+This file was extended by fonttosfnt $as_me 1.2.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -11438,7 +11438,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-fonttosfnt config.status 1.2.0
+fonttosfnt config.status 1.2.1
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -r 059f086aad76 -r a9662c73c1a9 external/mit/fonttosfnt/dist/configure.ac
--- a/external/mit/fonttosfnt/dist/configure.ac Mon Apr 26 21:25:12 2021 +0000
+++ b/external/mit/fonttosfnt/dist/configure.ac Tue Apr 27 01:21:04 2021 +0000
@@ -10,7 +10,7 @@
 dnl  specific, written prior permission.  Red Hat makes no
 dnl  representations about the suitability of this software for any purpose.  It
 dnl  is provided "as is" without express or implied warranty.
-dnl 
+dnl
 dnl  RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 dnl  EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@@ -23,7 +23,7 @@
 
 # Initialize Autoconf
 AC_PREREQ([2.60])
-AC_INIT(fonttosfnt,[1.2.0], [https://gitlab.freedesktop.org/xorg/app/fonttosfnt/issues],fonttosfnt)
+AC_INIT(fonttosfnt,[1.2.1], [https://gitlab.freedesktop.org/xorg/app/fonttosfnt/issues],fonttosfnt)
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([config.h])
 
diff -r 059f086aad76 -r a9662c73c1a9 external/mit/fonttosfnt/dist/fonttosfnt.h
--- a/external/mit/fonttosfnt/dist/fonttosfnt.h Mon Apr 26 21:25:12 2021 +0000
+++ b/external/mit/fonttosfnt/dist/fonttosfnt.h Tue Apr 27 01:21:04 2021 +0000
@@ -191,6 +191,7 @@
 char *faceEncoding(FT_Face);
 int faceFlags(FT_Face);
 int faceIntProp(FT_Face, const char *);
+char *faceStringProp(FT_Face, const char *);
 int faceWeight(FT_Face);
 int faceWidth(FT_Face);
 int faceItalicAngle(FT_Face);
diff -r 059f086aad76 -r a9662c73c1a9 external/mit/fonttosfnt/dist/read.c
--- a/external/mit/fonttosfnt/dist/read.c       Mon Apr 26 21:25:12 2021 +0000
+++ b/external/mit/fonttosfnt/dist/read.c       Tue Apr 27 01:21:04 2021 +0000
@@ -103,7 +103,7 @@
     BitmapPtr bitmap;
     int symbol = 0;
     int force_unicode = 1;
-    const char *encoding_name, *file_format;
+    const char *family_name, *encoding_name, *file_format;
     FontMapPtr mapping = NULL;
     FontMapReversePtr reverse = NULL;
     
@@ -171,6 +171,11 @@
         }
     }
 
+    if(face->family_name)
+        family_name = face->family_name;
+    else
+       family_name = faceStringProp(face, "FONT");
+
     if(verbose_flag) {
         fprintf(stderr, "%s %s %s: %d sizes%s\n",
                 filename ? filename : "<stdin>",
@@ -178,15 +183,14 @@
                 symbol ? " (symbol)" : "");
     }
 
-    if(font->numNames == 0 && face->style_name && face->family_name) {
-        char *full_name, *unique_name;
-        BDF_PropertyRec prop;
+    if(font->numNames == 0 && face->style_name && family_name) {
+        char *full_name, *unique_name, *buf;
         int i;
         if(strcmp(face->style_name, "Regular") == 0)
-            full_name = sprintf_alloc("%s", face->family_name);
+            full_name = sprintf_alloc("%s", family_name);
         else
             full_name = sprintf_alloc("%s %s", 
-                                      face->family_name, face->style_name);
+                                      family_name, face->style_name);
 
         /* The unique name doesn't actually need to be globally
            unique; it only needs to be unique among all installed fonts on a
@@ -214,17 +218,18 @@
         }
         i = 0;
 
-        rc = FT_Get_BDF_Property(face, "COPYRIGHT", &prop);
-        if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) {
+       buf = faceStringProp(face, "COPYRIGHT");
+       if(buf) {
             font->names[i].nid = 0;
-            font->names[i].size = 2 * strlen(prop.u.atom);
-            font->names[i].value = makeUTF16((char*)prop.u.atom);
+            font->names[i].size = 2 * strlen(buf);
+            font->names[i].value = makeUTF16(buf);
+           free(buf);
             i++;
-        }
+       }
 
         font->names[i].nid = 1;
-        font->names[i].size = 2 * strlen(face->family_name);
-        font->names[i].value = makeUTF16(face->family_name);
+        font->names[i].size = 2 * strlen(family_name);
+        font->names[i].value = makeUTF16(family_name);
         i++;
 
         font->names[i].nid = 2;
@@ -247,13 +252,14 @@
         font->names[i].value = makeUTF16("Version 0.0");
         i++;
 
-        rc = FT_Get_BDF_Property(face, "FOUNDRY", &prop);
-        if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) {
+       buf = faceStringProp(face, "FOUNDRY");
+       if(buf) {
             font->names[i].nid = 8;
-            font->names[i].size = 2 * strlen(prop.u.atom);
-            font->names[i].value = makeUTF16((char*)prop.u.atom);
+           font->names[i].size = 2 * strlen(buf);
+           font->names[i].value = makeUTF16(buf);
+           free(buf);
             i++;
-        }
+       }
 
         font->names[i].nid = 10;
         font->names[i].size = 2 * strlen(XVENDORNAMESHORT
diff -r 059f086aad76 -r a9662c73c1a9 external/mit/fonttosfnt/dist/util.c
--- a/external/mit/fonttosfnt/dist/util.c       Mon Apr 26 21:25:12 2021 +0000
+++ b/external/mit/fonttosfnt/dist/util.c       Tue Apr 27 01:21:04 2021 +0000
@@ -405,6 +405,24 @@
 }
 
 char *
+faceStringProp(FT_Face face, const char *name)
+{
+    int rc;
+    BDF_PropertyRec prop;
+    char *buf = NULL;
+
+    rc = FT_Get_BDF_Property(face, name, &prop);
+    if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) {
+       buf = sprintf_alloc("%s", prop.u.atom ? prop.u.atom : "");
+       if(buf == NULL) {
+           perror("sprintf_alloc failed");
+           exit(1);
+       }
+    }
+    return buf;
+}
+
+char *
 faceEncoding(FT_Face face)
 {
     BDF_PropertyRec p1, p2;
diff -r 059f086aad76 -r a9662c73c1a9 external/mit/fonttosfnt/dist/write.c
--- a/external/mit/fonttosfnt/dist/write.c      Mon Apr 26 21:25:12 2021 +0000
+++ b/external/mit/fonttosfnt/dist/write.c      Tue Apr 27 01:21:04 2021 +0000
@@ -260,7 +260,7 @@
            * TWO_SIXTEENTH / font->pxMetrics.height;



Home | Main Index | Thread Index | Old Index