update freetype2 to version 2.12.1

This commit is contained in:
Kalamatee 2022-05-06 22:37:19 +01:00 committed by deadwood
parent 77819aed6c
commit 65d01898df
7 changed files with 84 additions and 706 deletions

View File

@ -1,6 +1,6 @@
diff -ruN ft2demos-2.10.4/graph/aros/graros.c ft2demos-2.10.4.aros/graph/aros/graros.c
--- ft2demos-2.10.4/graph/aros/graros.c 1970-01-01 00:00:00.000000000 +0000
+++ ft2demos-2.10.4.aros/graph/aros/graros.c 2021-01-08 23:10:06.320000000 +0000
diff -ruN ft2demos-2.12.1/graph/aros/graros.c ft2demos-2.12.1.aros/graph/aros/graros.c
--- ft2demos-2.12.1/graph/aros/graros.c 1970-01-01 00:00:00.000000000 +0000
+++ ft2demos-2.12.1.aros/graph/aros/graros.c 2021-01-08 23:10:06.320000000 +0000
@@ -0,0 +1,293 @@
+#include "graros.h"
+
@ -295,9 +295,9 @@ diff -ruN ft2demos-2.10.4/graph/aros/graros.c ft2demos-2.10.4.aros/graph/aros/gr
+
+ };
+
diff -ruN ft2demos-2.10.4/graph/aros/graros.h ft2demos-2.10.4.aros/graph/aros/graros.h
--- ft2demos-2.10.4/graph/aros/graros.h 1970-01-01 00:00:00.000000000 +0000
+++ ft2demos-2.10.4.aros/graph/aros/graros.h 2021-01-08 23:10:06.330000000 +0000
diff -ruN ft2demos-2.12.1/graph/aros/graros.h ft2demos-2.12.1.aros/graph/aros/graros.h
--- ft2demos-2.12.1/graph/aros/graros.h 1970-01-01 00:00:00.000000000 +0000
+++ ft2demos-2.12.1.aros/graph/aros/graros.h 2021-01-08 23:10:06.330000000 +0000
@@ -0,0 +1,24 @@
+#ifndef GRAROS_H
+#define GRAROS_H

View File

@ -19,7 +19,14 @@ include $(SRCDIR)/config/aros.cfg
#MM freetype2-demos-fetch \
#MM includes \
#MM linklibs \
#MM test-freetype-lib-graph
#MM test-freetype-lib-graph \
#MM test-freetype-lib-common \
#MM test-freetype-lib-ftcommon
#MM- test-freetype-common-deps-quick : \
#MM test-freetype-lib-graph-quick \
#MM test-freetype-lib-common-quick \
#MM test-freetype-lib-ftcommon-quick
#MM- test-freetype-deps : \
#MM test-freetype-common-deps \
@ -37,8 +44,8 @@ include $(SRCDIR)/config/aros.cfg
#MM test-freetype-ftviewstatic : test-freetype-static-deps
FT2DEMOS := ftdmo
FT2VERS := 2104
FT2VERSION := 2.10.4
FT2VERS := 2121
FT2VERSION := 2.12.1
ARCHBASE := $(FT2DEMOS)$(FT2VERS)
ARCHDIR := ft2demos-$(FT2VERSION)
FT2SRCDIR := $(PORTSDIR)/$(FT2DEMOS)/$(ARCHDIR)
@ -57,14 +64,13 @@ REPOSITORIES := https://download.savannah.gnu.org/releases/freetype
#MM test-freetype-lib-graph : freetype2-demos-fetch includes linklibs
FILES := \
grblit \
gblender \
gblblit \
grobjs \
gblender\
grdevice\
grfill \
grfont \
grdevice \
grinit \
grobjs \
grswizzle \
aros/graros
@ -82,29 +88,42 @@ USER_CFLAGS += $(NOWARN_FLAGS)
FREETYPETEST_COMMON := \
common \
strbuf \
md5
%build_linklib mmake=test-freetype-lib-common \
libname=common files="$(addprefix $(FT2SRCDIR)/src/,$(FREETYPETEST_COMMON))" sdk="misc"
FREETYPETEST_FTCOMMON := \
ftcommon \
strbuf
ftpngout \
rsvg-port
%build_linklib mmake=test-freetype-lib-ftcommon \
libname=ftcommon files="$(addprefix $(FT2SRCDIR)/src/,$(FREETYPETEST_FTCOMMON))" sdk="misc"
USER_LDFLAGS := -L$(GENDIR)/$(CURDIR)/lib -lftcommon
%build_prog mmake=test-freetype-ftstring \
progname=ftstring targetdir=$(EXEDIR) \
files="$(addprefix $(FT2SRCDIR)/src/,ftstring $(FREETYPETEST_COMMON))" \
uselibs="freetype2 graph png" usesdks="misc"
files="$(addprefix $(FT2SRCDIR)/src/,ftstring)" \
uselibs="ftcommon graph common freetype2 png" usesdks="misc"
%build_prog mmake=test-freetype-ftstring-static \
progname=ftstring-static targetdir=$(EXEDIR) \
files="$(addprefix $(FT2SRCDIR)/src/,ftstring $(FREETYPETEST_COMMON))" \
uselibs="freetype2.static graph png z1 " objdir="$(GENDIR)/$(CURDIR)/static" usesdks="misc"
files="$(addprefix $(FT2SRCDIR)/src/,ftstring)" \
uselibs="ftcommon graph common freetype2.static png z1" objdir="$(GENDIR)/$(CURDIR)/static" usesdks="misc"
USER_CPPFLAGS += -DFT2_BUILD_LIBRARY
%build_prog mmake=test-freetype-ftview \
progname=ftview targetdir=$(EXEDIR) \
files="$(addprefix $(FT2SRCDIR)/src/,ftview $(FREETYPETEST_COMMON))" \
uselibs="freetype2 graph png" usesdks="misc"
files="$(addprefix $(FT2SRCDIR)/src/,ftview)" \
uselibs="ftcommon graph common freetype2 png" usesdks="misc"
%build_prog mmake=test-freetype-ftview-static \
progname=ftview-static targetdir=$(EXEDIR) \
files="$(addprefix $(FT2SRCDIR)/src/,ftview $(FREETYPETEST_COMMON))" \
uselibs="freetype2.static png z1 graph" objdir="$(GENDIR)/$(CURDIR)/static" usesdks="misc"
files="$(addprefix $(FT2SRCDIR)/src/,ftview)" \
uselibs="ftcommon graph common freetype2.static png z1" objdir="$(GENDIR)/$(CURDIR)/static" usesdks="misc"
%common

View File

@ -1,4 +1,4 @@
# AROS Freetype2 Readme for v6.1 (freetype 2.9.1)
# AROS Freetype2 Readme for v6.5 (freetype 2.12.1)
#
To make the freetype link lib:

View File

@ -1,592 +0,0 @@
diff -ruN freetype-2.10.0/builds/aros/src/base/ftsystem.c freetype-2.10.0.aros/builds/aros/src/base/ftsystem.c
--- freetype-2.10.0/builds/aros/src/base/ftsystem.c 1970-01-01 01:00:00.000000000 +0100
+++ freetype-2.10.0.aros/builds/aros/src/base/ftsystem.c 2019-04-11 14:31:03.250183154 +0200
@@ -0,0 +1,359 @@
+/***************************************************************************/
+/* */
+/* ftsystem.c */
+/* */
+/* ANSI-specific FreeType low-level system interface (body). */
+/* */
+/* Copyright 1996-2018 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* This file contains the default interface used by FreeType to access */
+ /* low-level, i.e. memory management, i/o access as well as thread */
+ /* synchronisation. It can be replaced by user-specific routines if */
+ /* necessary. */
+ /* */
+ /*************************************************************************/
+
+
+#include <ft2build.h>
+#include FT_CONFIG_CONFIG_H
+#include FT_INTERNAL_DEBUG_H
+#include FT_SYSTEM_H
+#include FT_ERRORS_H
+#include FT_TYPES_H
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <exec/types.h>
+#include <exec/memory.h>
+#include <dos/dos.h>
+#include <proto/exec.h>
+#include <proto/dos.h>
+
+//#define DEBUG 1
+#include <aros/debug.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* MEMORY MANAGEMENT INTERFACE */
+ /* */
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* It is not necessary to do any error checking for the */
+ /* allocation-related functions. This will be done by the higher level */
+ /* routines like FT_Alloc() or FT_Realloc(). */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* ft_alloc */
+ /* */
+ /* <Description> */
+ /* The memory allocation function. */
+ /* */
+ /* <Input> */
+ /* memory :: A pointer to the memory object. */
+ /* */
+ /* size :: The requested size in bytes. */
+ /* */
+ /* <Return> */
+ /* The address of newly allocated block. */
+ /* */
+ FT_CALLBACK_DEF( void* )
+ ft_alloc( FT_Memory memory,
+ long size )
+ {
+ ULONG memsize = size + sizeof(ULONG);
+ void* retval;
+ APTR MemPool = (APTR)memory->user;
+
+ D(bug("Entering ft_alloc(memory=%x,size=%ld)\n", memory, size));
+
+ retval = AllocPooled(MemPool, memsize);
+
+ D(bug("Allocated retval=%x\n", (void*)retval));
+
+ *((ULONG *)retval) = memsize;
+
+ D(bug("Leaving ft_alloc retval=%x\n", (void*)((ULONG*)retval + 1)));
+
+ return (void*)((ULONG*)retval + 1);
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* ft_free */
+ /* */
+ /* <Description> */
+ /* The memory release function. */
+ /* */
+ /* <Input> */
+ /* memory :: A pointer to the memory object. */
+ /* */
+ /* block :: The address of block in memory to be freed. */
+ /* */
+ FT_CALLBACK_DEF( void )
+ ft_free( FT_Memory memory,
+ void* block )
+ {
+ APTR mem = (APTR)((char*)block - sizeof(ULONG));
+ APTR MemPool = (APTR)memory->user;
+
+ D(bug("Entering ft_free(memory=%x, block=%x)\n", memory, block));
+
+ FreePooled( MemPool, mem, *((ULONG*)mem) );
+
+ D(bug("Leaving ft_free\n"));
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* ft_realloc */
+ /* */
+ /* <Description> */
+ /* The memory reallocation function. */
+ /* */
+ /* <Input> */
+ /* memory :: A pointer to the memory object. */
+ /* */
+ /* cur_size :: The current size of the allocated memory block. */
+ /* */
+ /* new_size :: The newly requested size in bytes. */
+ /* */
+ /* block :: The current address of the block in memory. */
+ /* */
+ /* <Return> */
+ /* The address of the reallocated memory block. */
+ /* */
+ FT_CALLBACK_DEF( void* )
+ ft_realloc( FT_Memory memory,
+ long cur_size,
+ long new_size,
+ void* block )
+ {
+ void* retval;
+
+ D(bug("Entering ft_free(memory=%x, cur_size=%ld, new_size=%ld, block=%x)\n",
+ memory, cur_size, new_size, block));
+
+ if ((retval = ft_alloc( memory, new_size )) != NULL)
+ {
+ CopyMem( block, retval, cur_size );
+ ft_free( memory, block );
+ }
+
+ D(bug("Leaving ft_free retval=%x\n", retval));
+
+ return retval;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* RESOURCE MANAGEMENT INTERFACE */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
+ /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
+ /* messages during execution. */
+ /* */
+#undef FT_COMPONENT
+#define FT_COMPONENT trace_io
+
+ /* We use the macro STREAM_FILE for convenience to extract the */
+ /* system-specific stream handle from a given FreeType stream object */
+#define STREAM_FILE( stream ) ( (BPTR)stream->descriptor.pointer )
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* ft_ansi_stream_close */
+ /* */
+ /* <Description> */
+ /* The function to close a stream. */
+ /* */
+ /* <Input> */
+ /* stream :: A pointer to the stream object. */
+ /* */
+ FT_CALLBACK_DEF( void )
+ ft_ansi_stream_close( FT_Stream stream )
+ {
+ D(bug("Entering ft_ansi_stream_close(stream=%x)\n", stream));
+
+ Close( STREAM_FILE( stream ) );
+
+ stream->descriptor.pointer = NULL;
+ stream->size = 0;
+ stream->base = 0;
+
+ D(bug("Entering ft_ansi_stream_close\n"));
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* ft_ansi_stream_io */
+ /* */
+ /* <Description> */
+ /* The function to open a stream. */
+ /* */
+ /* <Input> */
+ /* stream :: A pointer to the stream object. */
+ /* */
+ /* offset :: The position in the data stream to start reading. */
+ /* */
+ /* buffer :: The address of buffer to store the read data. */
+ /* */
+ /* count :: The number of bytes to read from the stream. */
+ /* */
+ /* <Return> */
+ /* The number of bytes actually read. */
+ /* */
+ FT_CALLBACK_DEF( unsigned long )
+ ft_ansi_stream_io( FT_Stream stream,
+ unsigned long offset,
+ unsigned char* buffer,
+ unsigned long count )
+ {
+ BPTR file;
+ unsigned long actcount;
+
+ D(bug("Entering ft_ansi_stream_io(stream=%x,offset=%ld,buffer=%x,count=%ld)\n",
+ stream, offset, buffer, count));
+ file = STREAM_FILE( stream );
+
+ Seek( file, offset, OFFSET_BEGINNING );
+ if (count>0)
+ actcount = (unsigned long)Read( file, buffer, count );
+ else
+ actcount = 0;
+
+ D(bug("Leaving ft_ansi_stream_io actcount=%ld",actcount));
+
+ return actcount;
+ }
+
+
+ /* documentation is in ftobjs.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Stream_Open( FT_Stream stream,
+ const char* filepathname )
+ {
+ BPTR file;
+
+ if ( !stream )
+ return FT_Err_Invalid_Stream_Handle;
+
+ file = Open( filepathname, MODE_OLDFILE );
+ if ( !file )
+ {
+ FT_ERROR(( "FT_Stream_Open:" ));
+ FT_ERROR(( " could not open `%s'\n", filepathname ));
+
+ return FT_Err_Cannot_Open_Resource;
+ }
+
+ Seek( file, 0, OFFSET_END );
+ stream->size = Seek( file, 0, OFFSET_BEGINNING );
+
+ stream->descriptor.pointer = (APTR)file;
+ stream->pathname.pointer = (char*)filepathname;
+ stream->pos = 0;
+
+ stream->read = ft_ansi_stream_io;
+ stream->close = ft_ansi_stream_close;
+
+ FT_TRACE1(( "FT_Stream_Open:" ));
+ FT_TRACE1(( " opened `%s' (%d bytes) successfully\n",
+ filepathname, stream->size ));
+
+ return FT_Err_Ok;
+ }
+
+
+#ifdef FT_DEBUG_MEMORY
+
+ extern FT_Int
+ ft_mem_debug_init( FT_Memory memory );
+
+ extern void
+ ft_mem_debug_done( FT_Memory memory );
+
+#endif
+
+
+ /* documentation is in ftobjs.h */
+
+ FT_EXPORT_DEF( FT_Memory )
+ FT_New_Memory( void )
+ {
+ FT_Memory memory;
+ APTR MemPool;
+
+ D(bug("Entering FT_New_Memory\n"));
+
+ MemPool = CreatePool(MEMF_ANY, 2048, 256);
+ if (MemPool)
+ {
+ memory = (FT_Memory)AllocPooled( MemPool, sizeof ( *memory ) );
+ if ( memory )
+ {
+ memory->user = (void*)MemPool;
+ memory->alloc = ft_alloc;
+ memory->realloc = ft_realloc;
+ memory->free = ft_free;
+#ifdef FT_DEBUG_MEMORY
+ ft_mem_debug_init( memory );
+#endif
+ }
+ }
+ else
+ memory=NULL;
+
+ D(bug("Leaving FT_New_Memory memory=%x\n", memory));
+
+ return memory;
+ }
+
+
+ /* documentation is in ftobjs.h */
+
+ FT_EXPORT_DEF( void )
+ FT_Done_Memory( FT_Memory memory )
+ {
+#ifdef FT_DEBUG_MEMORY
+ ft_mem_debug_done( memory );
+#endif
+ DeletePool((APTR)memory->user);
+ }
+
+
+/* END */
diff -ruN freetype-2.10.0/include/freetype/config/ftconfig.h freetype-2.10.0.aros/include/freetype/config/ftconfig.h
--- freetype-2.10.0/include/freetype/config/ftconfig.h 2019-02-23 10:06:06.000000000 +0100
+++ freetype-2.10.0.aros/include/freetype/config/ftconfig.h 2020-01-06 17:36:26.695475526 +0100
@@ -461,6 +461,8 @@
#if defined( _WIN32 ) && defined( DLL_EXPORT )
#define FT_EXPORT( x ) __declspec( dllexport ) x
+#elif defined(__AROS__)
+#define FT_EXPORT( x ) x
#elif defined( __GNUC__ ) && __GNUC__ >= 4
#define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x
#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550
diff -ruN freetype-2.10.0/src/autofit/afcjk.c freetype-2.10.0.aros/src/autofit/afcjk.c
--- freetype-2.10.0/src/autofit/afcjk.c 2019-02-23 10:06:07.000000000 +0100
+++ freetype-2.10.0.aros/src/autofit/afcjk.c 2019-04-11 14:31:46.282454489 +0200
@@ -22,6 +22,9 @@
*
*/
+#include <exec/exec.h>
+#include <proto/exec.h>
+
#include <ft2build.h>
#include FT_ADVANCES_H
#include FT_INTERNAL_DEBUG_H
@@ -70,8 +73,13 @@
FT_Face face )
{
/* scan the array of segments in each direction */
- AF_GlyphHintsRec hints[1];
-
+ //AF_GlyphHintsRec hints[1];
+ AF_GlyphHintsRec *hints = (AF_GlyphHintsRec *)AllocVec(sizeof(AF_GlyphHintsRec) * 2, MEMF_ANY);
+ if(!hints)
+ {
+ /* no reasonable error handling possible */
+ return;
+ }
FT_TRACE5(( "\n"
"cjk standard widths computation (style `%s')\n"
@@ -88,7 +96,12 @@
FT_Error error;
FT_ULong glyph_index;
int dim;
- AF_CJKMetricsRec dummy[1];
+ //AF_CJKMetricsRec dummy[1];
+ AF_CJKMetricsRec *dummy = (AF_CJKMetricsRec *) AllocVec(sizeof(AF_CJKMetricsRec) * 2, MEMF_ANY);
+ if(!dummy)
+ {
+ goto ErrorExit;
+ }
AF_Scaler scaler = &dummy->root.scaler;
AF_StyleClass style_class = metrics->root.style_class;
@@ -269,11 +282,15 @@
}
#endif
}
+ FreeVec(dummy);
+ ErrorExit:
+ ;
}
FT_TRACE5(( "\n" ));
af_glyph_hints_done( hints );
+ FreeVec(hints);
}
diff -ruN freetype-2.10.0/src/autofit/aflatin2.c freetype-2.10.0.aros/src/autofit/aflatin2.c
--- freetype-2.10.0/src/autofit/aflatin2.c 2019-02-23 10:06:07.000000000 +0100
+++ freetype-2.10.0.aros/src/autofit/aflatin2.c 2019-04-11 14:31:46.282454489 +0200
@@ -20,7 +20,6 @@
*
*/
-
#include FT_ADVANCES_H
@@ -68,8 +67,13 @@
FT_Face face )
{
/* scan the array of segments in each direction */
- AF_GlyphHintsRec hints[1];
-
+ //AF_GlyphHintsRec hints[1];
+ AF_GlyphHintsRec *hints = (AF_GlyphHintsRec *)AllocVec(sizeof(AF_GlyphHintsRec) * 2, MEMF_ANY);
+ if(!hints)
+ {
+ /* no reasonable error handling possible */
+ return;
+ }
af_glyph_hints_init( hints, face->memory );
@@ -80,7 +84,12 @@
FT_Error error;
FT_UInt glyph_index;
int dim;
- AF_LatinMetricsRec dummy[1];
+ //AF_LatinMetricsRec dummy[1];
+ AF_LatinMetricsRec *dummy = (AF_LatinMetricsRec *) AllocVec(sizeof(AF_LatinMetricsRec) * 2, MEMF_ANY);
+ if(!dummy)
+ {
+ goto ErrorExit;
+ }
AF_Scaler scaler = &dummy->root.scaler;
@@ -167,9 +176,12 @@
axis->standard_width = stdw;
axis->extra_light = 0;
}
+ ErrorExit:
+ FreeVec(dummy);
}
af_glyph_hints_done( hints );
+ FreeVec(hints);
}
diff -ruN freetype-2.10.0/src/autofit/aflatin.c freetype-2.10.0.aros/src/autofit/aflatin.c
--- freetype-2.10.0/src/autofit/aflatin.c 2019-02-23 10:06:07.000000000 +0100
+++ freetype-2.10.0.aros/src/autofit/aflatin.c 2019-04-11 14:31:46.282454489 +0200
@@ -15,6 +15,8 @@
*
*/
+#include <exec/exec.h>
+#include <proto/exec.h>
#include <ft2build.h>
#include FT_ADVANCES_H
@@ -61,8 +63,8 @@
FT_Face face )
{
/* scan the array of segments in each direction */
- AF_GlyphHintsRec hints[1];
-
+ //AF_GlyphHintsRec hints[1];
+ AF_GlyphHintsRec *hints;
FT_TRACE5(( "\n"
"latin standard widths computation (style `%s')\n"
@@ -70,6 +72,13 @@
"\n",
af_style_names[metrics->root.style_class->style] ));
+ hints = (AF_GlyphHintsRec *)AllocVec(sizeof(AF_GlyphHintsRec) * 2, MEMF_ANY);
+ if(!hints)
+ {
+ /* no reasonable error handling possible */
+ return;
+ }
+
af_glyph_hints_init( hints, face->memory );
metrics->axis[AF_DIMENSION_HORZ].width_count = 0;
@@ -79,7 +88,12 @@
FT_Error error;
FT_ULong glyph_index;
int dim;
- AF_LatinMetricsRec dummy[1];
+ //AF_LatinMetricsRec dummy[1];
+ AF_LatinMetricsRec *dummy = (AF_LatinMetricsRec *) AllocVec(sizeof(AF_LatinMetricsRec) * 2, MEMF_ANY);
+
+ if(!dummy)
+ goto ErrorExit;
+
AF_Scaler scaler = &dummy->root.scaler;
AF_StyleClass style_class = metrics->root.style_class;
@@ -261,12 +275,17 @@
FT_TRACE5(( "\n" ));
}
#endif
+
}
+ FreeVec(dummy);
+ ErrorExit:
+ ;
}
FT_TRACE5(( "\n" ));
af_glyph_hints_done( hints );
+ FreeVec(hints);
}
diff -ruN freetype-2.10.0/src/autofit/afmodule.c freetype-2.10.0.aros/src/autofit/afmodule.c
--- freetype-2.10.0/src/autofit/afmodule.c 2019-02-23 10:06:07.000000000 +0100
+++ freetype-2.10.0.aros/src/autofit/afmodule.c 2019-04-11 14:31:46.282454489 +0200
@@ -523,8 +523,19 @@
#else /* !FT_DEBUG_AUTOFIT */
- AF_GlyphHintsRec hints[1];
- AF_LoaderRec loader[1];
+ //AF_GlyphHintsRec hints[1];
+ AF_GlyphHintsRec *hints = (AF_GlyphHintsRec *)AllocVec(sizeof(AF_GlyphHintsRec) * 2, MEMF_ANY);
+ if(!hints)
+ {
+ return !FT_Err_Ok; /* ? */
+ }
+ //AF_LoaderRec loader[1];
+ AF_LoaderRec *loader = (AF_LoaderRec *)AllocVec(sizeof(AF_LoaderRec) * 2, MEMF_ANY);
+ if(!loader)
+ {
+ FreeVec(hints);
+ return !FT_Err_Ok; /* ? */
+ }
FT_UNUSED( size );
@@ -538,6 +549,9 @@
af_loader_done( loader );
af_glyph_hints_done( hints );
+ FreeVec(hints);
+ FreeVec(loader);
+
return error;
#endif /* !FT_DEBUG_AUTOFIT */

View File

@ -1,6 +1,6 @@
diff -ruN freetype-2.10.4/builds/aros/src/base/ftsystem.c freetype-2.10.4.aros/builds/aros/src/base/ftsystem.c
--- freetype-2.10.4/builds/aros/src/base/ftsystem.c 1970-01-01 00:00:00.000000000 +0000
+++ freetype-2.10.4.aros/builds/aros/src/base/ftsystem.c 2021-01-08 22:52:37.860000000 +0000
diff -ruN freetype-2.12.1/builds/aros/src/base/ftsystem.c freetype-2.12.1.aros/builds/aros/src/base/ftsystem.c
--- freetype-2.12.1/builds/aros/src/base/ftsystem.c 1970-01-01 00:00:00.000000000 +0000
+++ freetype-2.12.1.aros/builds/aros/src/base/ftsystem.c 2021-01-08 22:52:37.860000000 +0000
@@ -0,0 +1,356 @@
+/***************************************************************************/
+/* */
@ -358,9 +358,9 @@ diff -ruN freetype-2.10.4/builds/aros/src/base/ftsystem.c freetype-2.10.4.aros/b
+
+
+/* END */
diff -ruN freetype-2.10.4/include/freetype/config/public-macros.h freetype-2.10.4.aros/include/freetype/config/public-macros.h
--- freetype-2.10.4/include/freetype/config/public-macros.h 2020-08-27 06:17:20.000000000 +0000
+++ freetype-2.10.4.aros/include/freetype/config/public-macros.h 2022-03-27 05:35:05.934677526 +0000
diff -ruN freetype-2.12.1/include/freetype/config/public-macros.h freetype-2.12.1.aros/include/freetype/config/public-macros.h
--- freetype-2.12.1/include/freetype/config/public-macros.h 2020-08-27 06:17:20.000000000 +0000
+++ freetype-2.12.1.aros/include/freetype/config/public-macros.h 2022-03-27 05:35:05.934677526 +0000
@@ -71,6 +71,8 @@
#define FT_PUBLIC_FUNCTION_ATTRIBUTE __declspec( dllimport )
#endif
@ -370,9 +370,9 @@ diff -ruN freetype-2.10.4/include/freetype/config/public-macros.h freetype-2.10.
/* gcc, clang */
#elif ( defined( __GNUC__ ) && __GNUC__ >= 4 ) || defined( __clang__ )
#define FT_PUBLIC_FUNCTION_ATTRIBUTE \
diff -ruN freetype-2.10.4/src/autofit/afcjk.c freetype-2.10.4.aros/src/autofit/afcjk.c
--- freetype-2.10.4/src/autofit/afcjk.c 2020-08-27 06:17:20.000000000 +0000
+++ freetype-2.10.4.aros/src/autofit/afcjk.c 2021-01-08 22:34:15.600000000 +0000
diff -ruN freetype-2.12.1/src/autofit/afcjk.c freetype-2.12.1.aros/src/autofit/afcjk.c
--- freetype-2.12.1/src/autofit/afcjk.c 2022-01-27 07:43:19.000000000 +0000
+++ freetype-2.12.1.aros/src/autofit/afcjk.c 2022-05-06 19:37:29.628118000 +0000
@@ -22,6 +22,11 @@
*
*/
@ -385,7 +385,7 @@ diff -ruN freetype-2.10.4/src/autofit/afcjk.c freetype-2.10.4.aros/src/autofit/a
#include <freetype/ftadvanc.h>
#include <freetype/internal/ftdebug.h>
@@ -69,8 +74,16 @@
@@ -64,8 +69,16 @@
FT_Face face )
{
/* scan the array of segments in each direction */
@ -401,9 +401,9 @@ diff -ruN freetype-2.10.4/src/autofit/afcjk.c freetype-2.10.4.aros/src/autofit/a
+ }
+#endif
FT_TRACE5(( "\n"
"cjk standard widths computation (style `%s')\n"
@@ -87,7 +100,15 @@
FT_TRACE5(( "\n" ));
FT_TRACE5(( "cjk standard widths computation (style `%s')\n",
@@ -82,7 +95,15 @@
FT_Error error;
FT_ULong glyph_index;
int dim;
@ -419,7 +419,7 @@ diff -ruN freetype-2.10.4/src/autofit/afcjk.c freetype-2.10.4.aros/src/autofit/a
AF_Scaler scaler = &dummy->root.scaler;
AF_StyleClass style_class = metrics->root.style_class;
@@ -268,11 +289,19 @@
@@ -263,11 +284,19 @@
}
#endif
}
@ -439,9 +439,9 @@ diff -ruN freetype-2.10.4/src/autofit/afcjk.c freetype-2.10.4.aros/src/autofit/a
}
diff -ruN freetype-2.10.4/src/autofit/aflatin.c freetype-2.10.4.aros/src/autofit/aflatin.c
--- freetype-2.10.4/src/autofit/aflatin.c 2020-08-27 06:17:20.000000000 +0000
+++ freetype-2.10.4.aros/src/autofit/aflatin.c 2021-01-08 22:36:39.420000000 +0000
diff -ruN freetype-2.12.1/src/autofit/aflatin.c freetype-2.12.1.aros/src/autofit/aflatin.c
--- freetype-2.12.1/src/autofit/aflatin.c 2022-01-27 07:43:19.000000000 +0000
+++ freetype-2.12.1.aros/src/autofit/aflatin.c 2022-05-06 19:37:29.628118000 +0000
@@ -15,6 +15,10 @@
*
*/
@ -453,7 +453,7 @@ diff -ruN freetype-2.10.4/src/autofit/aflatin.c freetype-2.10.4.aros/src/autofit
#include <freetype/ftadvanc.h>
#include <freetype/internal/ftdebug.h>
@@ -60,8 +64,11 @@
@@ -55,8 +59,11 @@
FT_Face face )
{
/* scan the array of segments in each direction */
@ -464,11 +464,11 @@ diff -ruN freetype-2.10.4/src/autofit/aflatin.c freetype-2.10.4.aros/src/autofit
+ AF_GlyphHintsRec *hints;
+#endif
FT_TRACE5(( "\n"
"latin standard widths computation (style `%s')\n"
@@ -69,6 +76,15 @@
"\n",
af_style_names[metrics->root.style_class->style] ));
FT_TRACE5(( "\n" ));
FT_TRACE5(( "latin standard widths computation (style `%s')\n",
@@ -64,6 +71,15 @@
FT_TRACE5(( "=====================================================\n" ));
FT_TRACE5(( "\n" ));
+#if defined(__AROS__)
+ hints = (AF_GlyphHintsRec *)AllocVec(sizeof(AF_GlyphHintsRec) * 2, MEMF_ANY);
@ -482,7 +482,7 @@ diff -ruN freetype-2.10.4/src/autofit/aflatin.c freetype-2.10.4.aros/src/autofit
af_glyph_hints_init( hints, face->memory );
metrics->axis[AF_DIMENSION_HORZ].width_count = 0;
@@ -78,7 +94,13 @@
@@ -73,7 +89,13 @@
FT_Error error;
FT_ULong glyph_index;
int dim;
@ -496,7 +496,7 @@ diff -ruN freetype-2.10.4/src/autofit/aflatin.c freetype-2.10.4.aros/src/autofit
AF_Scaler scaler = &dummy->root.scaler;
AF_StyleClass style_class = metrics->root.style_class;
@@ -264,12 +286,21 @@
@@ -259,12 +281,21 @@
FT_TRACE5(( "\n" ));
}
#endif
@ -518,64 +518,10 @@ diff -ruN freetype-2.10.4/src/autofit/aflatin.c freetype-2.10.4.aros/src/autofit
}
diff -ruN freetype-2.10.4/src/autofit/aflatin2.c freetype-2.10.4.aros/src/autofit/aflatin2.c
--- freetype-2.10.4/src/autofit/aflatin2.c 2020-08-27 06:17:20.000000000 +0000
+++ freetype-2.10.4.aros/src/autofit/aflatin2.c 2021-01-08 22:38:08.640000000 +0000
@@ -68,8 +68,16 @@
FT_Face face )
{
/* scan the array of segments in each direction */
+#if !defined(__AROS__)
AF_GlyphHintsRec hints[1];
-
+#else
+ AF_GlyphHintsRec *hints = (AF_GlyphHintsRec *)AllocVec(sizeof(AF_GlyphHintsRec) * 2, MEMF_ANY);
+ if(!hints)
+ {
+ /* no reasonable error handling possible */
+ return;
+ }
+#endif
af_glyph_hints_init( hints, face->memory );
@@ -80,7 +88,15 @@
FT_Error error;
FT_UInt glyph_index;
int dim;
+#if !defined(__AROS__)
AF_LatinMetricsRec dummy[1];
+#else
+ AF_LatinMetricsRec *dummy = (AF_LatinMetricsRec *) AllocVec(sizeof(AF_LatinMetricsRec) * 2, MEMF_ANY);
+ if(!dummy)
+ {
+ goto ErrorExit;
+ }
+#endif
AF_Scaler scaler = &dummy->root.scaler;
@@ -167,9 +183,16 @@
axis->standard_width = stdw;
axis->extra_light = 0;
}
+#if defined(__AROS__)
+ ErrorExit:
+ FreeVec(dummy);
+#endif
}
af_glyph_hints_done( hints );
+#if defined(__AROS__)
+ FreeVec(hints);
+#endif
}
diff -ruN freetype-2.10.4/src/autofit/afmodule.c freetype-2.10.4.aros/src/autofit/afmodule.c
--- freetype-2.10.4/src/autofit/afmodule.c 2020-08-27 06:17:20.000000000 +0000
+++ freetype-2.10.4.aros/src/autofit/afmodule.c 2021-01-08 22:39:10.760000000 +0000
@@ -523,8 +523,25 @@
diff -ruN freetype-2.12.1/src/autofit/afmodule.c freetype-2.12.1.aros/src/autofit/afmodule.c
--- freetype-2.12.1/src/autofit/afmodule.c 2022-01-27 07:43:19.000000000 +0000
+++ freetype-2.12.1.aros/src/autofit/afmodule.c 2022-05-06 19:37:29.628118000 +0000
@@ -477,8 +477,25 @@
#else /* !FT_DEBUG_AUTOFIT */
@ -601,7 +547,7 @@ diff -ruN freetype-2.10.4/src/autofit/afmodule.c freetype-2.10.4.aros/src/autofi
FT_UNUSED( size );
@@ -538,6 +555,11 @@
@@ -492,6 +509,11 @@
af_loader_done( loader );
af_glyph_hints_done( hints );

View File

@ -1,8 +1,8 @@
##begin config
basename FreeType2
version 6.4
date 13.01.2021
copyright Copyright (C) 2000-2020, The FreeType Project, 2002-2021 The AROS Development Team
version 6.5
date 06.05.2022
copyright Copyright (C) 2000-2022, The FreeType Project, 2002-2022 The AROS Development Team
##end config
##begin cdef
@ -64,9 +64,9 @@ FT_ULong FT_Get_First_Char(FT_Face face, FT_UInt *agindex)
FT_ULong FT_Get_Next_Char(FT_Face face, FT_ULong charcode, FT_UInt *agindex)
FT_Error FT_Get_Glyph(FT_GlyphSlot slot, FT_Glyph *aglyph)
FT_Error FT_Glyph_Copy(FT_Glyph source, FT_Glyph *target)
FT_Error FT_Glyph_Transform(FT_Glyph glyph, FT_Matrix *matrix, FT_Vector *delta)
FT_Error FT_Glyph_Transform(FT_Glyph glyph, const FT_Matrix *matrix, const FT_Vector *delta)
void FT_Glyph_Get_CBox(FT_Glyph glyph, FT_UInt bbox_mode, FT_BBox *acbox)
FT_Error FT_Glyph_To_Bitmap(FT_Glyph *the_glyph, FT_Render_Mode render_mode, FT_Vector *origin, FT_Bool destroy)
FT_Error FT_Glyph_To_Bitmap(FT_Glyph *the_glyph, FT_Render_Mode render_mode, const FT_Vector *origin, FT_Bool destroy)
void FT_Done_Glyph(FT_Glyph glyph)
FT_Error FT_New_Size(FT_Face face, FT_Size *asize)
FT_Error FT_Done_Size(FT_Size size)

View File

@ -8,7 +8,7 @@ include $(SRCDIR)/config/aros.cfg
#MM workbench-libs-freetype-module : freetype2-fetch
FT2NAME := freetype
FT2VERS := 2.10.4
FT2VERS := 2.12.1
ARCHBASE := $(FT2NAME)-$(FT2VERS)
FT2SRCDIR := $(PORTSDIR)/$(FT2NAME)2/$(ARCHBASE)
@ -32,6 +32,9 @@ FT2AUXFILES := \
psaux/psaux \
psnames/psnames
FT2AUXDISFILES := \
bzip2/ftbzip2
FT2RASTFILES := \
raster/raster \
smooth/smooth
@ -46,7 +49,9 @@ FT2FONTFILES := \
pcf/pcf \
pfr/pfr \
winfonts/winfnt \
bdf/bdf
bdf/bdf \
sdf/sdf \
svg/svg
FT2HINTFILES := \
autofit/autofit