- Update print/libotf to 0.9.12.

- Fixed otfdump crashes with some fonts, patches from Kenichi Handa <handa@m17n.org>.

PR:		ports/154675
Submitted by:	Nikola Lecic <nikola.lecic@anthesphoria.net> (maintainer)
This commit is contained in:
Sylvio Cesar Teixeira 2011-02-11 12:21:08 +00:00
parent b9afc2d879
commit a5dba8e75c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=268930
4 changed files with 74 additions and 5 deletions

View File

@ -6,7 +6,7 @@
#
PORTNAME= libotf
PORTVERSION= 0.9.11
PORTVERSION= 0.9.12
CATEGORIES= print devel
MASTER_SITES= http://www.m17n.org/libotf/ \
http://anthesphoria.net/FreeBSD/ports/distfiles/
@ -20,7 +20,7 @@ USE_XORG= x11 xt xaw xmu
USE_GNOME= pkgconfig
GNU_CONFIGURE= yes
USE_LDCONFIG= yes
CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include"
CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include"
post-patch:
@${REINPLACE_CMD} -e 's|[(]libdir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g' \

View File

@ -1,3 +1,2 @@
MD5 (libotf-0.9.11.tar.gz) = c966e8ac1c64a01de0a66d9b9aadbb63
SHA256 (libotf-0.9.11.tar.gz) = 34aa22564049edb154588a25c38bc044297ec6c3a5f7a76919076a32ec0f53a8
SIZE (libotf-0.9.11.tar.gz) = 360687
SHA256 (libotf-0.9.12.tar.gz) = a4a04cccf84955242202a4a7e50314259030c1f1573675085ba1c5a95b529297
SIZE (libotf-0.9.12.tar.gz) = 363974

View File

@ -0,0 +1,25 @@
--- example/otfdump.c 19 Mar 2010 12:27:02 -0000 1.27
+++ example/otfdump.c 11 Feb 2011 02:52:37 -0000 1.28
@@ -32,12 +32,8 @@
#include <otf.h>
-char *indent_spaces[] =
- { "", " ", " ", " ", " ", " ", " ",
- " ", " ", " " };
-
/* Indented print. */
-#define IPRINT printf("\n%s", indent_spaces[indent]), printf
+#define IPRINT printf("\n%*s", indent * 2, ""), printf
static void
dump_tag (OTF_Tag tag)
@@ -457,6 +453,8 @@
static void
dump_anchor (int indent, OTF_Anchor *anchor)
{
+ if (anchor->offset == 0)
+ return;
IPRINT ("(Anchor (offset #x%04X) (AnchorFormat %d)",
anchor->offset, anchor->AnchorFormat);
indent++;

View File

@ -0,0 +1,45 @@
--- src/otfopen.c 22 Sep 2010 03:46:17 -0000 1.62
+++ src/otfopen.c 11 Feb 2011 02:55:05 -0000 1.63
@@ -2336,8 +2336,9 @@
}
for (i = 0; i < array->Count; i++)
for (j = 0; j < ClassCount; j++)
- if (read_anchor (otf, stream, offset + array->offset,
- &array->AnchorRecord[i].Anchor[j]) < 0)
+ if (array->AnchorRecord[i].Anchor[j].offset > 0
+ && read_anchor (otf, stream, offset + array->offset,
+ &array->AnchorRecord[i].Anchor[j]) < 0)
return -1;
RESTORE_STREAM (stream, state);
return 0;
@@ -2437,7 +2438,7 @@
unsigned ClassCount, OTF_LigatureAttach *attach)
{
char *errfmt = "LigatureAttach%s";
- int errret = 1;
+ int errret = -1;
int i, j;
SEEK_STREAM (stream, offset + attach->offset);
@@ -2483,8 +2484,10 @@
for (i = 0; i < array->LigatureCount; i++)
READ_OFFSET (stream, array->LigatureAttach[i].offset);
for (i = 0; i < array->LigatureCount; i++)
- read_ligature_attach (otf, stream, offset + array->offset,
- class_count, array->LigatureAttach + i);
+ if (array->LigatureAttach[i].offset > 0
+ && read_ligature_attach (otf, stream, offset + array->offset,
+ class_count, array->LigatureAttach + i) < 0)
+ return -1;
RESTORE_STREAM (stream, state);
return 0;
}
@@ -2625,7 +2628,7 @@
read_coverage (otf, stream, offset, &subtable->Coverage);
read_coverage (otf, stream, offset,
&subtable->u.mark_mark1.Mark2Coverage);
- READ_UINT16 (stream, subtable->u.mark_base1.ClassCount);
+ READ_UINT16 (stream, subtable->u.mark_mark1.ClassCount);
read_mark_array (otf, stream, offset,
&subtable->u.mark_mark1.Mark1Array);
read_anchor_array (otf, stream, offset,