summaryrefslogtreecommitdiff
path: root/include/freetype/internal/ftgloadr.h
diff options
context:
space:
mode:
authorDavid Boddie <david@boddie.org.uk>2024-02-28 01:52:58 +0100
committerDavid Boddie <david@boddie.org.uk>2024-02-28 01:52:58 +0100
commitcbd016cda002145743d87224f0a9f9068abbfc67 (patch)
treebcfcc9b11ea078a5fa42b16f7ea98a29d112d040 /include/freetype/internal/ftgloadr.h
parent75323f4992b2b4e593bd2f548db9ac6897e894d3 (diff)
Removed libfreetype fork, replacing it with a submodule and some Inferno-specific files.
Retained the license documents and updated the header files.
Diffstat (limited to 'include/freetype/internal/ftgloadr.h')
-rw-r--r--include/freetype/internal/ftgloadr.h132
1 files changed, 63 insertions, 69 deletions
diff --git a/include/freetype/internal/ftgloadr.h b/include/freetype/internal/ftgloadr.h
index d66d10b1..f1c155b1 100644
--- a/include/freetype/internal/ftgloadr.h
+++ b/include/freetype/internal/ftgloadr.h
@@ -1,63 +1,41 @@
-/***************************************************************************/
-/* */
-/* ftgloadr.h */
-/* */
-/* The FreeType glyph loader (specification). */
-/* */
-/* Copyright 2002 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. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftgloadr.h
+ *
+ * The FreeType glyph loader (specification).
+ *
+ * Copyright (C) 2002-2024 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.
+ *
+ */
-#ifndef __FTGLOADR_H__
-#define __FTGLOADR_H__
+#ifndef FTGLOADR_H_
+#define FTGLOADR_H_
-#include <ft2build.h>
-#include FT_FREETYPE_H
+#include <freetype/freetype.h>
+#include "compiler-macros.h"
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_GlyphLoader */
- /* */
- /* <Description> */
- /* The glyph loader is an internal object used to load several glyphs */
- /* together (for example, in the case of composites). */
- /* */
- /* <Note> */
- /* The glyph loader implementation is not part of the high-level API, */
- /* hence the forward structure declaration. */
- /* */
- typedef struct FT_GlyphLoaderRec_* FT_GlyphLoader ;
-
-
-#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
-#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
-#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
-#define FT_SUBGLYPH_FLAG_SCALE 8
-#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
-#define FT_SUBGLYPH_FLAG_2X2 0x80
-#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
-
-
- enum
- {
- FT_GLYPH_OWN_BITMAP = 1
- };
-
-
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_GlyphLoader
+ *
+ * @description:
+ * The glyph loader is an internal object used to load several glyphs
+ * together (for example, in the case of composites).
+ */
typedef struct FT_SubGlyphRec_
{
FT_Int index;
@@ -65,16 +43,17 @@ FT_BEGIN_HEADER
FT_Int arg1;
FT_Int arg2;
FT_Matrix transform;
-
+
} FT_SubGlyphRec;
typedef struct FT_GlyphLoadRec_
{
- FT_Outline outline; /* outline */
- FT_Vector* extra_points; /* extra points table */
- FT_UInt num_subglyphs; /* number of subglyphs */
- FT_SubGlyph subglyphs; /* subglyphs */
+ FT_Outline outline; /* outline */
+ FT_Vector* extra_points; /* extra points table */
+ FT_Vector* extra_points2; /* second extra points table */
+ FT_UInt num_subglyphs; /* number of subglyphs */
+ FT_SubGlyph subglyphs; /* subglyphs */
} FT_GlyphLoadRec, *FT_GlyphLoad;
@@ -92,7 +71,7 @@ FT_BEGIN_HEADER
void* other; /* for possible future extension? */
- } FT_GlyphLoaderRec;
+ } FT_GlyphLoaderRec, *FT_GlyphLoader;
/* create new empty glyph loader */
@@ -116,15 +95,37 @@ FT_BEGIN_HEADER
FT_BASE( void )
FT_GlyphLoader_Rewind( FT_GlyphLoader loader );
- /* check that there is enough room to add 'n_points' and 'n_contours' */
- /* to the glyph loader */
+ /* check that there is enough space to add `n_points' and `n_contours' */
+ /* to the glyph loader */
FT_BASE( FT_Error )
FT_GlyphLoader_CheckPoints( FT_GlyphLoader loader,
FT_UInt n_points,
FT_UInt n_contours );
- /* check that there is enough room to add 'n_subs' sub-glyphs to */
- /* a glyph loader */
+
+#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \
+ ( (_count) == 0 || \
+ ( (FT_UInt)(_loader)->base.outline.n_points + \
+ (FT_UInt)(_loader)->current.outline.n_points + \
+ (FT_UInt)(_count) ) <= (_loader)->max_points )
+
+#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \
+ ( (_count) == 0 || \
+ ( (FT_UInt)(_loader)->base.outline.n_contours + \
+ (FT_UInt)(_loader)->current.outline.n_contours + \
+ (FT_UInt)(_count) ) <= (_loader)->max_contours )
+
+#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points, _contours ) \
+ ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \
+ FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \
+ ? 0 \
+ : FT_GlyphLoader_CheckPoints( (_loader), \
+ (FT_UInt)(_points), \
+ (FT_UInt)(_contours) ) )
+
+
+ /* check that there is enough space to add `n_subs' sub-glyphs to */
+ /* a glyph loader */
FT_BASE( FT_Error )
FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader loader,
FT_UInt n_subs );
@@ -137,17 +138,10 @@ FT_BEGIN_HEADER
FT_BASE( void )
FT_GlyphLoader_Add( FT_GlyphLoader loader );
- /* copy points from one glyph loader to another */
- FT_BASE( FT_Error )
- FT_GlyphLoader_CopyPoints( FT_GlyphLoader target,
- FT_GlyphLoader source );
-
- /* */
-
FT_END_HEADER
-#endif /* __FTGLOADR_H__ */
+#endif /* FTGLOADR_H_ */
/* END */