summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/winfonts
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/winfonts')
-rw-r--r--src/3rdparty/freetype/src/winfonts/Jamfile16
-rw-r--r--src/3rdparty/freetype/src/winfonts/fnterrs.h6
-rw-r--r--src/3rdparty/freetype/src/winfonts/module.mk2
-rw-r--r--src/3rdparty/freetype/src/winfonts/rules.mk2
-rw-r--r--src/3rdparty/freetype/src/winfonts/winfnt.c101
-rw-r--r--src/3rdparty/freetype/src/winfonts/winfnt.h7
6 files changed, 68 insertions, 66 deletions
diff --git a/src/3rdparty/freetype/src/winfonts/Jamfile b/src/3rdparty/freetype/src/winfonts/Jamfile
deleted file mode 100644
index 4b92226159..0000000000
--- a/src/3rdparty/freetype/src/winfonts/Jamfile
+++ /dev/null
@@ -1,16 +0,0 @@
-# FreeType 2 src/winfonts Jamfile
-#
-# Copyright (C) 2001-2019 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.
-
-SubDir FT2_TOP $(FT2_SRC_DIR) winfonts ;
-
-Library $(FT2_LIB) : winfnt.c ;
-
-# end of src/winfonts Jamfile
diff --git a/src/3rdparty/freetype/src/winfonts/fnterrs.h b/src/3rdparty/freetype/src/winfonts/fnterrs.h
index af29307c75..dafdb07b4e 100644
--- a/src/3rdparty/freetype/src/winfonts/fnterrs.h
+++ b/src/3rdparty/freetype/src/winfonts/fnterrs.h
@@ -4,7 +4,7 @@
*
* Win FNT/FON error codes (specification only).
*
- * Copyright (C) 2001-2019 by
+ * Copyright (C) 2001-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -26,7 +26,7 @@
#ifndef FNTERRS_H_
#define FNTERRS_H_
-#include FT_MODULE_ERRORS_H
+#include <freetype/ftmoderr.h>
#undef FTERRORS_H_
@@ -34,7 +34,7 @@
#define FT_ERR_PREFIX FNT_Err_
#define FT_ERR_BASE FT_Mod_Err_Winfonts
-#include FT_ERRORS_H
+#include <freetype/fterrors.h>
#endif /* FNTERRS_H_ */
diff --git a/src/3rdparty/freetype/src/winfonts/module.mk b/src/3rdparty/freetype/src/winfonts/module.mk
index 82fb0151f8..78a2900652 100644
--- a/src/3rdparty/freetype/src/winfonts/module.mk
+++ b/src/3rdparty/freetype/src/winfonts/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2019 by
+# Copyright (C) 1996-2023 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/winfonts/rules.mk b/src/3rdparty/freetype/src/winfonts/rules.mk
index 998d49bc9f..b39c519e0c 100644
--- a/src/3rdparty/freetype/src/winfonts/rules.mk
+++ b/src/3rdparty/freetype/src/winfonts/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2019 by
+# Copyright (C) 1996-2023 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/winfonts/winfnt.c b/src/3rdparty/freetype/src/winfonts/winfnt.c
index 2d771be2cc..1160e4ef36 100644
--- a/src/3rdparty/freetype/src/winfonts/winfnt.c
+++ b/src/3rdparty/freetype/src/winfonts/winfnt.c
@@ -4,7 +4,7 @@
*
* FreeType font driver for Windows FNT/FON files
*
- * Copyright (C) 1996-2019 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
* Copyright 2003 Huw D M Davies for Codeweavers
* Copyright 2007 Dmitry Timoshkov for Codeweavers
@@ -18,17 +18,16 @@
*/
-#include <ft2build.h>
-#include FT_WINFONTS_H
-#include FT_INTERNAL_DEBUG_H
-#include FT_INTERNAL_STREAM_H
-#include FT_INTERNAL_OBJECTS_H
-#include FT_TRUETYPE_IDS_H
+#include <freetype/ftwinfnt.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/ftobjs.h>
+#include <freetype/ttnameid.h>
#include "winfnt.h"
#include "fnterrs.h"
-#include FT_SERVICE_WINFNT_H
-#include FT_SERVICE_FONT_FORMAT_H
+#include <freetype/internal/services/svwinfnt.h>
+#include <freetype/internal/services/svfntfmt.h>
/**************************************************************************
*
@@ -218,7 +217,11 @@
/* first of all, read the FNT header */
if ( FT_STREAM_SEEK( font->offset ) ||
FT_STREAM_READ_FIELDS( winfnt_header_fields, header ) )
+ {
+ FT_TRACE2(( " not a Windows FNT file\n" ));
+ error = FT_THROW( Unknown_File_Format );
goto Exit;
+ }
/* check header */
if ( header->version != 0x200 &&
@@ -285,7 +288,10 @@
/* does it begin with an MZ header? */
if ( FT_STREAM_SEEK( 0 ) ||
FT_STREAM_READ_FIELDS( winmz_header_fields, &mz_header ) )
+ {
+ error = FT_ERR( Unknown_File_Format );
goto Exit;
+ }
error = FT_ERR( Unknown_File_Format );
if ( mz_header.magic == WINFNT_MZ_MAGIC )
@@ -331,7 +337,7 @@
{
FT_TRACE2(( "invalid alignment shift count for resource data\n" ));
error = FT_THROW( Invalid_File_Format );
- goto Exit;
+ goto Exit1;
}
@@ -346,6 +352,10 @@
count = FT_GET_USHORT_LE();
+ FT_TRACE2(( type_id == 0x8007U ? "RT_FONTDIR count %hu\n" :
+ type_id == 0x8008U ? "RT_FONT count %hu\n" : "",
+ count ));
+
if ( type_id == 0x8008U )
{
font_count = count;
@@ -421,12 +431,12 @@
goto Exit;
FT_TRACE2(( "magic %04lx, machine %02x, number_of_sections %u, "
- "size_of_optional_header %02x\n"
- "magic32 %02x, rsrc_virtual_address %04lx, "
- "rsrc_size %04lx\n",
+ "size_of_optional_header %02x\n",
pe32_header.magic, pe32_header.machine,
pe32_header.number_of_sections,
- pe32_header.size_of_optional_header,
+ pe32_header.size_of_optional_header ));
+ FT_TRACE2(( "magic32 %02x, rsrc_virtual_address %04lx, "
+ "rsrc_size %04lx\n",
pe32_header.magic32, pe32_header.rsrc_virtual_address,
pe32_header.rsrc_size ));
@@ -479,7 +489,7 @@
&dir_entry1 ) )
goto Exit;
- if ( !(dir_entry1.offset & 0x80000000UL ) /* DataIsDirectory */ )
+ if ( !( dir_entry1.offset & 0x80000000UL ) /* DataIsDirectory */ )
{
error = FT_THROW( Invalid_File_Format );
goto Exit;
@@ -503,7 +513,7 @@
&dir_entry2 ) )
goto Exit;
- if ( !(dir_entry2.offset & 0x80000000UL ) /* DataIsDirectory */ )
+ if ( !( dir_entry2.offset & 0x80000000UL ) /* DataIsDirectory */ )
{
error = FT_THROW( Invalid_File_Format );
goto Exit;
@@ -597,6 +607,10 @@
Exit:
return error;
+
+ Exit1:
+ FT_FRAME_EXIT();
+ goto Exit;
}
@@ -610,31 +624,34 @@
static FT_Error
- fnt_cmap_init( FNT_CMap cmap,
+ fnt_cmap_init( FT_CMap cmap, /* FNT_CMap */
FT_Pointer pointer )
{
- FNT_Face face = (FNT_Face)FT_CMAP_FACE( cmap );
- FNT_Font font = face->font;
+ FNT_CMap fntcmap = (FNT_CMap)cmap;
+ FNT_Face face = (FNT_Face)FT_CMAP_FACE( cmap );
+ FNT_Font font = face->font;
FT_UNUSED( pointer );
- cmap->first = (FT_UInt32) font->header.first_char;
- cmap->count = (FT_UInt32)( font->header.last_char - cmap->first + 1 );
+ fntcmap->first = (FT_UInt32)font->header.first_char;
+ fntcmap->count = (FT_UInt32)( font->header.last_char -
+ fntcmap->first + 1 );
return 0;
}
static FT_UInt
- fnt_cmap_char_index( FNT_CMap cmap,
+ fnt_cmap_char_index( FT_CMap cmap, /* FNT_CMap */
FT_UInt32 char_code )
{
- FT_UInt gindex = 0;
+ FNT_CMap fntcmap = (FNT_CMap)cmap;
+ FT_UInt gindex = 0;
- char_code -= cmap->first;
- if ( char_code < cmap->count )
+ char_code -= fntcmap->first;
+ if ( char_code < fntcmap->count )
/* we artificially increase the glyph index; */
/* FNT_Load_Glyph reverts to the right one */
gindex = (FT_UInt)( char_code + 1 );
@@ -642,26 +659,27 @@
}
- static FT_UInt32
- fnt_cmap_char_next( FNT_CMap cmap,
+ static FT_UInt
+ fnt_cmap_char_next( FT_CMap cmap, /* FNT_CMap */
FT_UInt32 *pchar_code )
{
- FT_UInt gindex = 0;
- FT_UInt32 result = 0;
+ FNT_CMap fntcmap = (FNT_CMap)cmap;
+ FT_UInt gindex = 0;
+ FT_UInt32 result = 0;
FT_UInt32 char_code = *pchar_code + 1;
- if ( char_code <= cmap->first )
+ if ( char_code <= fntcmap->first )
{
- result = cmap->first;
+ result = fntcmap->first;
gindex = 1;
}
else
{
- char_code -= cmap->first;
- if ( char_code < cmap->count )
+ char_code -= fntcmap->first;
+ if ( char_code < fntcmap->count )
{
- result = cmap->first + char_code;
+ result = fntcmap->first + char_code;
gindex = (FT_UInt)( char_code + 1 );
}
}
@@ -790,7 +808,7 @@
root->style_flags |= FT_STYLE_FLAG_BOLD;
/* set up the `fixed_sizes' array */
- if ( FT_NEW_ARRAY( root->available_sizes, 1 ) )
+ if ( FT_QNEW( root->available_sizes ) )
goto Fail;
root->num_fixed_sizes = 1;
@@ -882,10 +900,10 @@
}
family_size = font->header.file_size - font->header.face_name_offset;
/* Some broken fonts don't delimit the face name with a final */
- /* NULL byte -- the frame is erroneously one byte too small. */
+ /* null byte -- the frame is erroneously one byte too small. */
/* We thus allocate one more byte, setting it explicitly to */
/* zero. */
- if ( FT_ALLOC( font->family_name, family_size + 1 ) )
+ if ( FT_QALLOC( font->family_name, family_size + 1 ) )
goto Fail;
FT_MEM_COPY( font->family_name,
@@ -894,9 +912,10 @@
font->family_name[family_size] = '\0';
- if ( FT_REALLOC( font->family_name,
- family_size,
- ft_strlen( font->family_name ) + 1 ) )
+ /* shrink it to the actual length */
+ if ( FT_QREALLOC( font->family_name,
+ family_size + 1,
+ ft_strlen( font->family_name ) + 1 ) )
goto Fail;
root->family_name = font->family_name;
@@ -1091,7 +1110,7 @@
/* note: since glyphs are stored in columns and not in rows we */
/* can't use ft_glyphslot_set_bitmap */
- if ( FT_ALLOC_MULT( bitmap->buffer, bitmap->rows, pitch ) )
+ if ( FT_QALLOC_MULT( bitmap->buffer, bitmap->rows, pitch ) )
goto Exit;
column = (FT_Byte*)bitmap->buffer;
diff --git a/src/3rdparty/freetype/src/winfonts/winfnt.h b/src/3rdparty/freetype/src/winfonts/winfnt.h
index b628ad4c42..2f75b9e86c 100644
--- a/src/3rdparty/freetype/src/winfonts/winfnt.h
+++ b/src/3rdparty/freetype/src/winfonts/winfnt.h
@@ -4,7 +4,7 @@
*
* FreeType font driver for Windows FNT/FON files
*
- * Copyright (C) 1996-2019 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
* Copyright 2007 Dmitry Timoshkov for Codeweavers
*
@@ -21,9 +21,8 @@
#define WINFNT_H_
-#include <ft2build.h>
-#include FT_WINFONTS_H
-#include FT_INTERNAL_DRIVER_H
+#include <freetype/ftwinfnt.h>
+#include <freetype/internal/ftdrv.h>
FT_BEGIN_HEADER