-/***************************************************************************/\r
-/* */\r
-/* ftoutln.h */\r
-/* */\r
-/* Support for the FT_Outline type used to store glyph shapes of */\r
-/* most scalable font formats (specification). */\r
-/* */\r
-/* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007 by */\r
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */\r
-/* */\r
-/* This file is part of the FreeType project, and may only be used, */\r
-/* modified, and distributed under the terms of the FreeType project */\r
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */\r
-/* this file you indicate that you have read the license and */\r
-/* understand and accept it fully. */\r
-/* */\r
-/***************************************************************************/\r
-\r
-\r
-#ifndef __FTOUTLN_H__\r
-#define __FTOUTLN_H__\r
-\r
-\r
-#include <ft2build.h>\r
-#include FT_FREETYPE_H\r
-\r
-#ifdef FREETYPE_H\r
-#error "freetype.h of FreeType 1 has been loaded!"\r
-#error "Please fix the directory search order for header files"\r
-#error "so that freetype.h of FreeType 2 is found first."\r
-#endif\r
-\r
-\r
-FT_BEGIN_HEADER\r
-\r
-\r
- /*************************************************************************/\r
- /* */\r
- /* <Section> */\r
- /* outline_processing */\r
- /* */\r
- /* <Title> */\r
- /* Outline Processing */\r
- /* */\r
- /* <Abstract> */\r
- /* Functions to create, transform, and render vectorial glyph images. */\r
- /* */\r
- /* <Description> */\r
- /* This section contains routines used to create and destroy scalable */\r
- /* glyph images known as `outlines'. These can also be measured, */\r
- /* transformed, and converted into bitmaps and pixmaps. */\r
- /* */\r
- /* <Order> */\r
- /* FT_Outline */\r
- /* FT_OUTLINE_FLAGS */\r
- /* FT_Outline_New */\r
- /* FT_Outline_Done */\r
- /* FT_Outline_Copy */\r
- /* FT_Outline_Translate */\r
- /* FT_Outline_Transform */\r
- /* FT_Outline_Embolden */\r
- /* FT_Outline_Reverse */\r
- /* FT_Outline_Check */\r
- /* */\r
- /* FT_Outline_Get_CBox */\r
- /* FT_Outline_Get_BBox */\r
- /* */\r
- /* FT_Outline_Get_Bitmap */\r
- /* FT_Outline_Render */\r
- /* */\r
- /* FT_Outline_Decompose */\r
- /* FT_Outline_Funcs */\r
- /* FT_Outline_MoveTo_Func */\r
- /* FT_Outline_LineTo_Func */\r
- /* FT_Outline_ConicTo_Func */\r
- /* FT_Outline_CubicTo_Func */\r
- /* */\r
- /*************************************************************************/\r
-\r
-\r
- /*************************************************************************/\r
- /* */\r
- /* <Function> */\r
- /* FT_Outline_Decompose */\r
- /* */\r
- /* <Description> */\r
- /* Walks over an outline's structure to decompose it into individual */\r
- /* segments and Bézier arcs. This function is also able to emit */\r
- /* `move to' and `close to' operations to indicate the start and end */\r
- /* of new contours in the outline. */\r
- /* */\r
- /* <Input> */\r
- /* outline :: A pointer to the source target. */\r
- /* */\r
- /* func_interface :: A table of `emitters', i.e,. function pointers */\r
- /* called during decomposition to indicate path */\r
- /* operations. */\r
- /* */\r
- /* <InOut> */\r
- /* user :: A typeless pointer which is passed to each */\r
- /* emitter during the decomposition. It can be */\r
- /* used to store the state during the */\r
- /* decomposition. */\r
- /* */\r
- /* <Return> */\r
- /* FreeType error code. 0 means success. */\r
- /* */\r
- FT_EXPORT( FT_Error )\r
- FT_Outline_Decompose( FT_Outline* outline,\r
- const FT_Outline_Funcs* func_interface,\r
- void* user );\r
-\r
-\r
- /*************************************************************************/\r
- /* */\r
- /* <Function> */\r
- /* FT_Outline_New */\r
- /* */\r
- /* <Description> */\r
- /* Creates a new outline of a given size. */\r
- /* */\r
- /* <Input> */\r
- /* library :: A handle to the library object from where the */\r
- /* outline is allocated. Note however that the new */\r
- /* outline will *not* necessarily be *freed*, when */\r
- /* destroying the library, by @FT_Done_FreeType. */\r
- /* */\r
- /* numPoints :: The maximal number of points within the outline. */\r
- /* */\r
- /* numContours :: The maximal number of contours within the outline. */\r
- /* */\r
- /* <Output> */\r
- /* anoutline :: A handle to the new outline. NULL in case of */\r
- /* error. */\r
- /* */\r
- /* <Return> */\r
- /* FreeType error code. 0 means success. */\r
- /* */\r
- /* <Note> */\r
- /* The reason why this function takes a `library' parameter is simply */\r
- /* to use the library's memory allocator. */\r
- /* */\r
- FT_EXPORT( FT_Error )\r
- FT_Outline_New( FT_Library library,\r
- FT_UInt numPoints,\r
- FT_Int numContours,\r
- FT_Outline *anoutline );\r
-\r
-\r
- FT_EXPORT( FT_Error )\r
- FT_Outline_New_Internal( FT_Memory memory,\r
- FT_UInt numPoints,\r
- FT_Int numContours,\r
- FT_Outline *anoutline );\r
-\r
-\r
- /*************************************************************************/\r
- /* */\r
- /* <Function> */\r
- /* FT_Outline_Done */\r
- /* */\r
- /* <Description> */\r
- /* Destroys an outline created with @FT_Outline_New. */\r
- /* */\r
- /* <Input> */\r
- /* library :: A handle of the library object used to allocate the */\r
- /* outline. */\r
- /* */\r
- /* outline :: A pointer to the outline object to be discarded. */\r
- /* */\r
- /* <Return> */\r
- /* FreeType error code. 0 means success. */\r
- /* */\r
- /* <Note> */\r
- /* If the outline's `owner' field is not set, only the outline */\r
- /* descriptor will be released. */\r
- /* */\r
- /* The reason why this function takes an `library' parameter is */\r
- /* simply to use ft_mem_free(). */\r
- /* */\r
- FT_EXPORT( FT_Error )\r
- FT_Outline_Done( FT_Library library,\r
- FT_Outline* outline );\r
-\r
-\r
- FT_EXPORT( FT_Error )\r
- FT_Outline_Done_Internal( FT_Memory memory,\r
- FT_Outline* outline );\r
-\r
-\r
- /*************************************************************************/\r
- /* */\r
- /* <Function> */\r
- /* FT_Outline_Check */\r
- /* */\r
- /* <Description> */\r
- /* Check the contents of an outline descriptor. */\r
- /* */\r
- /* <Input> */\r
- /* outline :: A handle to a source outline. */\r
- /* */\r
- /* <Return> */\r
- /* FreeType error code. 0 means success. */\r
- /* */\r
- FT_EXPORT( FT_Error )\r
- FT_Outline_Check( FT_Outline* outline );\r
-\r
-\r
- /*************************************************************************/\r
- /* */\r
- /* <Function> */\r
- /* FT_Outline_Get_CBox */\r
- /* */\r
- /* <Description> */\r
- /* Returns an outline's `control box'. The control box encloses all */\r
- /* the outline's points, including Bézier control points. Though it */\r
- /* coincides with the exact bounding box for most glyphs, it can be */\r
- /* slightly larger in some situations (like when rotating an outline */\r
- /* which contains Bézier outside arcs). */\r
- /* */\r
- /* Computing the control box is very fast, while getting the bounding */\r
- /* box can take much more time as it needs to walk over all segments */\r
- /* and arcs in the outline. To get the latter, you can use the */\r
- /* `ftbbox' component which is dedicated to this single task. */\r
- /* */\r
- /* <Input> */\r
- /* outline :: A pointer to the source outline descriptor. */\r
- /* */\r
- /* <Output> */\r
- /* acbox :: The outline's control box. */\r
- /* */\r
- FT_EXPORT( void )\r
- FT_Outline_Get_CBox( const FT_Outline* outline,\r
- FT_BBox *acbox );\r
-\r
-\r
- /*************************************************************************/\r
- /* */\r
- /* <Function> */\r
- /* FT_Outline_Translate */\r
- /* */\r
- /* <Description> */\r
- /* Applies a simple translation to the points of an outline. */\r
- /* */\r
- /* <InOut> */\r
- /* outline :: A pointer to the target outline descriptor. */\r
- /* */\r
- /* <Input> */\r
- /* xOffset :: The horizontal offset. */\r
- /* */\r
- /* yOffset :: The vertical offset. */\r
- /* */\r
- FT_EXPORT( void )\r
- FT_Outline_Translate( const FT_Outline* outline,\r
- FT_Pos xOffset,\r
- FT_Pos yOffset );\r
-\r
-\r
- /*************************************************************************/\r
- /* */\r
- /* <Function> */\r
- /* FT_Outline_Copy */\r
- /* */\r
- /* <Description> */\r
- /* Copies an outline into another one. Both objects must have the */\r
- /* same sizes (number of points & number of contours) when this */\r
- /* function is called. */\r
- /* */\r
- /* <Input> */\r
- /* source :: A handle to the source outline. */\r
- /* */\r
- /* <Output> */\r
- /* target :: A handle to the target outline. */\r
- /* */\r
- /* <Return> */\r
- /* FreeType error code. 0 means success. */\r
- /* */\r
- FT_EXPORT( FT_Error )\r
- FT_Outline_Copy( const FT_Outline* source,\r
- FT_Outline *target );\r
-\r
-\r
- /*************************************************************************/\r
- /* */\r
- /* <Function> */\r
- /* FT_Outline_Transform */\r
- /* */\r
- /* <Description> */\r
- /* Applies a simple 2x2 matrix to all of an outline's points. Useful */\r
- /* for applying rotations, slanting, flipping, etc. */\r
- /* */\r
- /* <InOut> */\r
- /* outline :: A pointer to the target outline descriptor. */\r
- /* */\r
- /* <Input> */\r
- /* matrix :: A pointer to the transformation matrix. */\r
- /* */\r
- /* <Note> */\r
- /* You can use @FT_Outline_Translate if you need to translate the */\r
- /* outline's points. */\r
- /* */\r
- FT_EXPORT( void )\r
- FT_Outline_Transform( const FT_Outline* outline,\r
- const FT_Matrix* matrix );\r
-\r
-\r
- /*************************************************************************/\r
- /* */\r
- /* <Function> */\r
- /* FT_Outline_Embolden */\r
- /* */\r
- /* <Description> */\r
- /* Emboldens an outline. The new outline will be at most 4 times */\r
- /* `strength' pixels wider and higher. You may think of the left and */\r
- /* bottom borders as unchanged. */\r
- /* */\r
- /* Negative `strength' values to reduce the outline thickness are */\r
- /* possible also. */\r
- /* */\r
- /* <InOut> */\r
- /* outline :: A handle to the target outline. */\r
- /* */\r
- /* <Input> */\r
- /* strength :: How strong the glyph is emboldened. Expressed in */\r
- /* 26.6 pixel format. */\r
- /* */\r
- /* <Return> */\r
- /* FreeType error code. 0 means success. */\r
- /* */\r
- /* <Note> */\r
- /* The used algorithm to increase or decrease the thickness of the */\r
- /* glyph doesn't change the number of points; this means that certain */\r
- /* situations like acute angles or intersections are sometimes */\r
- /* handled incorrectly. */\r
- /* */\r
- /* Example call: */\r
- /* */\r
- /* { */\r
- /* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */\r
- /* if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE ) */\r
- /* FT_Outline_Embolden( &face->slot->outline, strength ); */\r
- /* } */\r
- /* */\r
- FT_EXPORT( FT_Error )\r
- FT_Outline_Embolden( FT_Outline* outline,\r
- FT_Pos strength );\r
-\r
-\r
- /*************************************************************************/\r
- /* */\r
- /* <Function> */\r
- /* FT_Outline_Reverse */\r
- /* */\r
- /* <Description> */\r
- /* Reverses the drawing direction of an outline. This is used to */\r
- /* ensure consistent fill conventions for mirrored glyphs. */\r
- /* */\r
- /* <InOut> */\r
- /* outline :: A pointer to the target outline descriptor. */\r
- /* */\r
- /* <Note> */\r
- /* This functions toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */\r
- /* the outline's `flags' field. */\r
- /* */\r
- /* It shouldn't be used by a normal client application, unless it */\r
- /* knows what it is doing. */\r
- /* */\r
- FT_EXPORT( void )\r
- FT_Outline_Reverse( FT_Outline* outline );\r
-\r
-\r
- /*************************************************************************/\r
- /* */\r
- /* <Function> */\r
- /* FT_Outline_Get_Bitmap */\r
- /* */\r
- /* <Description> */\r
- /* Renders an outline within a bitmap. The outline's image is simply */\r
- /* OR-ed to the target bitmap. */\r
- /* */\r
- /* <Input> */\r
- /* library :: A handle to a FreeType library object. */\r
- /* */\r
- /* outline :: A pointer to the source outline descriptor. */\r
- /* */\r
- /* <InOut> */\r
- /* abitmap :: A pointer to the target bitmap descriptor. */\r
- /* */\r
- /* <Return> */\r
- /* FreeType error code. 0 means success. */\r
- /* */\r
- /* <Note> */\r
- /* This function does NOT CREATE the bitmap, it only renders an */\r
- /* outline image within the one you pass to it! */\r
- /* */\r
- /* It will use the raster corresponding to the default glyph format. */\r
- /* */\r
- FT_EXPORT( FT_Error )\r
- FT_Outline_Get_Bitmap( FT_Library library,\r
- FT_Outline* outline,\r
- const FT_Bitmap *abitmap );\r
-\r
-\r
- /*************************************************************************/\r
- /* */\r
- /* <Function> */\r
- /* FT_Outline_Render */\r
- /* */\r
- /* <Description> */\r
- /* Renders an outline within a bitmap using the current scan-convert. */\r
- /* This functions uses an @FT_Raster_Params structure as an argument, */\r
- /* allowing advanced features like direct composition, translucency, */\r
- /* etc. */\r
- /* */\r
- /* <Input> */\r
- /* library :: A handle to a FreeType library object. */\r
- /* */\r
- /* outline :: A pointer to the source outline descriptor. */\r
- /* */\r
- /* <InOut> */\r
- /* params :: A pointer to an @FT_Raster_Params structure used to */\r
- /* describe the rendering operation. */\r
- /* */\r
- /* <Return> */\r
- /* FreeType error code. 0 means success. */\r
- /* */\r
- /* <Note> */\r
- /* You should know what you are doing and how @FT_Raster_Params works */\r
- /* to use this function. */\r
- /* */\r
- /* The field `params.source' will be set to `outline' before the scan */\r
- /* converter is called, which means that the value you give to it is */\r
- /* actually ignored. */\r
- /* */\r
- FT_EXPORT( FT_Error )\r
- FT_Outline_Render( FT_Library library,\r
- FT_Outline* outline,\r
- FT_Raster_Params* params );\r
-\r
-\r
- /**************************************************************************\r
- *\r
- * @enum:\r
- * FT_Orientation\r
- *\r
- * @description:\r
- * A list of values used to describe an outline's contour orientation.\r
- *\r
- * The TrueType and Postscript specifications use different conventions\r
- * to determine whether outline contours should be filled or unfilled.\r
- *\r
- * @values:\r
- * FT_ORIENTATION_TRUETYPE ::\r
- * According to the TrueType specification, clockwise contours must\r
- * be filled, and counter-clockwise ones must be unfilled.\r
- *\r
- * FT_ORIENTATION_POSTSCRIPT ::\r
- * According to the Postscript specification, counter-clockwise contours\r
- * must be filled, and clockwise ones must be unfilled.\r
- *\r
- * FT_ORIENTATION_FILL_RIGHT ::\r
- * This is identical to @FT_ORIENTATION_TRUETYPE, but is used to\r
- * remember that in TrueType, everything that is to the right of\r
- * the drawing direction of a contour must be filled.\r
- *\r
- * FT_ORIENTATION_FILL_LEFT ::\r
- * This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to\r
- * remember that in Postscript, everything that is to the left of\r
- * the drawing direction of a contour must be filled.\r
- *\r
- * FT_ORIENTATION_NONE ::\r
- * The orientation cannot be determined. That is, different parts of\r
- * the glyph have different orientation.\r
- *\r
- */\r
- typedef enum\r
- {\r
- FT_ORIENTATION_TRUETYPE = 0,\r
- FT_ORIENTATION_POSTSCRIPT = 1,\r
- FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,\r
- FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT,\r
- FT_ORIENTATION_NONE\r
-\r
- } FT_Orientation;\r
-\r
-\r
- /**************************************************************************\r
- *\r
- * @function:\r
- * FT_Outline_Get_Orientation\r
- *\r
- * @description:\r
- * This function analyzes a glyph outline and tries to compute its\r
- * fill orientation (see @FT_Orientation). This is done by computing\r
- * the direction of each global horizontal and/or vertical extrema\r
- * within the outline.\r
- *\r
- * Note that this will return @FT_ORIENTATION_TRUETYPE for empty\r
- * outlines.\r
- *\r
- * @input:\r
- * outline ::\r
- * A handle to the source outline.\r
- *\r
- * @return:\r
- * The orientation.\r
- *\r
- */\r
- FT_EXPORT( FT_Orientation )\r
- FT_Outline_Get_Orientation( FT_Outline* outline );\r
-\r
-\r
- /* */\r
-\r
-\r
-FT_END_HEADER\r
-\r
-#endif /* __FTOUTLN_H__ */\r
-\r
-\r
-/* END */\r
-\r
-\r
-/* Local Variables: */\r
-/* coding: utf-8 */\r
-/* End: */\r
+/***************************************************************************/
+/* */
+/* ftoutln.h */
+/* */
+/* Support for the FT_Outline type used to store glyph shapes of */
+/* most scalable font formats (specification). */
+/* */
+/* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007 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 __FTOUTLN_H__
+#define __FTOUTLN_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* outline_processing */
+ /* */
+ /* <Title> */
+ /* Outline Processing */
+ /* */
+ /* <Abstract> */
+ /* Functions to create, transform, and render vectorial glyph images. */
+ /* */
+ /* <Description> */
+ /* This section contains routines used to create and destroy scalable */
+ /* glyph images known as `outlines'. These can also be measured, */
+ /* transformed, and converted into bitmaps and pixmaps. */
+ /* */
+ /* <Order> */
+ /* FT_Outline */
+ /* FT_OUTLINE_FLAGS */
+ /* FT_Outline_New */
+ /* FT_Outline_Done */
+ /* FT_Outline_Copy */
+ /* FT_Outline_Translate */
+ /* FT_Outline_Transform */
+ /* FT_Outline_Embolden */
+ /* FT_Outline_Reverse */
+ /* FT_Outline_Check */
+ /* */
+ /* FT_Outline_Get_CBox */
+ /* FT_Outline_Get_BBox */
+ /* */
+ /* FT_Outline_Get_Bitmap */
+ /* FT_Outline_Render */
+ /* */
+ /* FT_Outline_Decompose */
+ /* FT_Outline_Funcs */
+ /* FT_Outline_MoveTo_Func */
+ /* FT_Outline_LineTo_Func */
+ /* FT_Outline_ConicTo_Func */
+ /* FT_Outline_CubicTo_Func */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Decompose */
+ /* */
+ /* <Description> */
+ /* Walks over an outline's structure to decompose it into individual */
+ /* segments and Bézier arcs. This function is also able to emit */
+ /* `move to' and `close to' operations to indicate the start and end */
+ /* of new contours in the outline. */
+ /* */
+ /* <Input> */
+ /* outline :: A pointer to the source target. */
+ /* */
+ /* func_interface :: A table of `emitters', i.e,. function pointers */
+ /* called during decomposition to indicate path */
+ /* operations. */
+ /* */
+ /* <InOut> */
+ /* user :: A typeless pointer which is passed to each */
+ /* emitter during the decomposition. It can be */
+ /* used to store the state during the */
+ /* decomposition. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Decompose( FT_Outline* outline,
+ const FT_Outline_Funcs* func_interface,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_New */
+ /* */
+ /* <Description> */
+ /* Creates a new outline of a given size. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to the library object from where the */
+ /* outline is allocated. Note however that the new */
+ /* outline will *not* necessarily be *freed*, when */
+ /* destroying the library, by @FT_Done_FreeType. */
+ /* */
+ /* numPoints :: The maximal number of points within the outline. */
+ /* */
+ /* numContours :: The maximal number of contours within the outline. */
+ /* */
+ /* <Output> */
+ /* anoutline :: A handle to the new outline. NULL in case of */
+ /* error. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* The reason why this function takes a `library' parameter is simply */
+ /* to use the library's memory allocator. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_New( FT_Library library,
+ FT_UInt numPoints,
+ FT_Int numContours,
+ FT_Outline *anoutline );
+
+
+ FT_EXPORT( FT_Error )
+ FT_Outline_New_Internal( FT_Memory memory,
+ FT_UInt numPoints,
+ FT_Int numContours,
+ FT_Outline *anoutline );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Done */
+ /* */
+ /* <Description> */
+ /* Destroys an outline created with @FT_Outline_New. */
+ /* */
+ /* <Input> */
+ /* library :: A handle of the library object used to allocate the */
+ /* outline. */
+ /* */
+ /* outline :: A pointer to the outline object to be discarded. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* If the outline's `owner' field is not set, only the outline */
+ /* descriptor will be released. */
+ /* */
+ /* The reason why this function takes an `library' parameter is */
+ /* simply to use ft_mem_free(). */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Done( FT_Library library,
+ FT_Outline* outline );
+
+
+ FT_EXPORT( FT_Error )
+ FT_Outline_Done_Internal( FT_Memory memory,
+ FT_Outline* outline );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Check */
+ /* */
+ /* <Description> */
+ /* Check the contents of an outline descriptor. */
+ /* */
+ /* <Input> */
+ /* outline :: A handle to a source outline. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Check( FT_Outline* outline );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Get_CBox */
+ /* */
+ /* <Description> */
+ /* Returns an outline's `control box'. The control box encloses all */
+ /* the outline's points, including Bézier control points. Though it */
+ /* coincides with the exact bounding box for most glyphs, it can be */
+ /* slightly larger in some situations (like when rotating an outline */
+ /* which contains Bézier outside arcs). */
+ /* */
+ /* Computing the control box is very fast, while getting the bounding */
+ /* box can take much more time as it needs to walk over all segments */
+ /* and arcs in the outline. To get the latter, you can use the */
+ /* `ftbbox' component which is dedicated to this single task. */
+ /* */
+ /* <Input> */
+ /* outline :: A pointer to the source outline descriptor. */
+ /* */
+ /* <Output> */
+ /* acbox :: The outline's control box. */
+ /* */
+ FT_EXPORT( void )
+ FT_Outline_Get_CBox( const FT_Outline* outline,
+ FT_BBox *acbox );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Translate */
+ /* */
+ /* <Description> */
+ /* Applies a simple translation to the points of an outline. */
+ /* */
+ /* <InOut> */
+ /* outline :: A pointer to the target outline descriptor. */
+ /* */
+ /* <Input> */
+ /* xOffset :: The horizontal offset. */
+ /* */
+ /* yOffset :: The vertical offset. */
+ /* */
+ FT_EXPORT( void )
+ FT_Outline_Translate( const FT_Outline* outline,
+ FT_Pos xOffset,
+ FT_Pos yOffset );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Copy */
+ /* */
+ /* <Description> */
+ /* Copies an outline into another one. Both objects must have the */
+ /* same sizes (number of points & number of contours) when this */
+ /* function is called. */
+ /* */
+ /* <Input> */
+ /* source :: A handle to the source outline. */
+ /* */
+ /* <Output> */
+ /* target :: A handle to the target outline. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Copy( const FT_Outline* source,
+ FT_Outline *target );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Transform */
+ /* */
+ /* <Description> */
+ /* Applies a simple 2x2 matrix to all of an outline's points. Useful */
+ /* for applying rotations, slanting, flipping, etc. */
+ /* */
+ /* <InOut> */
+ /* outline :: A pointer to the target outline descriptor. */
+ /* */
+ /* <Input> */
+ /* matrix :: A pointer to the transformation matrix. */
+ /* */
+ /* <Note> */
+ /* You can use @FT_Outline_Translate if you need to translate the */
+ /* outline's points. */
+ /* */
+ FT_EXPORT( void )
+ FT_Outline_Transform( const FT_Outline* outline,
+ const FT_Matrix* matrix );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Embolden */
+ /* */
+ /* <Description> */
+ /* Emboldens an outline. The new outline will be at most 4 times */
+ /* `strength' pixels wider and higher. You may think of the left and */
+ /* bottom borders as unchanged. */
+ /* */
+ /* Negative `strength' values to reduce the outline thickness are */
+ /* possible also. */
+ /* */
+ /* <InOut> */
+ /* outline :: A handle to the target outline. */
+ /* */
+ /* <Input> */
+ /* strength :: How strong the glyph is emboldened. Expressed in */
+ /* 26.6 pixel format. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* The used algorithm to increase or decrease the thickness of the */
+ /* glyph doesn't change the number of points; this means that certain */
+ /* situations like acute angles or intersections are sometimes */
+ /* handled incorrectly. */
+ /* */
+ /* Example call: */
+ /* */
+ /* { */
+ /* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */
+ /* if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE ) */
+ /* FT_Outline_Embolden( &face->slot->outline, strength ); */
+ /* } */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Embolden( FT_Outline* outline,
+ FT_Pos strength );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Reverse */
+ /* */
+ /* <Description> */
+ /* Reverses the drawing direction of an outline. This is used to */
+ /* ensure consistent fill conventions for mirrored glyphs. */
+ /* */
+ /* <InOut> */
+ /* outline :: A pointer to the target outline descriptor. */
+ /* */
+ /* <Note> */
+ /* This functions toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */
+ /* the outline's `flags' field. */
+ /* */
+ /* It shouldn't be used by a normal client application, unless it */
+ /* knows what it is doing. */
+ /* */
+ FT_EXPORT( void )
+ FT_Outline_Reverse( FT_Outline* outline );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Get_Bitmap */
+ /* */
+ /* <Description> */
+ /* Renders an outline within a bitmap. The outline's image is simply */
+ /* OR-ed to the target bitmap. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a FreeType library object. */
+ /* */
+ /* outline :: A pointer to the source outline descriptor. */
+ /* */
+ /* <InOut> */
+ /* abitmap :: A pointer to the target bitmap descriptor. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* This function does NOT CREATE the bitmap, it only renders an */
+ /* outline image within the one you pass to it! */
+ /* */
+ /* It will use the raster corresponding to the default glyph format. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Get_Bitmap( FT_Library library,
+ FT_Outline* outline,
+ const FT_Bitmap *abitmap );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Render */
+ /* */
+ /* <Description> */
+ /* Renders an outline within a bitmap using the current scan-convert. */
+ /* This functions uses an @FT_Raster_Params structure as an argument, */
+ /* allowing advanced features like direct composition, translucency, */
+ /* etc. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a FreeType library object. */
+ /* */
+ /* outline :: A pointer to the source outline descriptor. */
+ /* */
+ /* <InOut> */
+ /* params :: A pointer to an @FT_Raster_Params structure used to */
+ /* describe the rendering operation. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* You should know what you are doing and how @FT_Raster_Params works */
+ /* to use this function. */
+ /* */
+ /* The field `params.source' will be set to `outline' before the scan */
+ /* converter is called, which means that the value you give to it is */
+ /* actually ignored. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Render( FT_Library library,
+ FT_Outline* outline,
+ FT_Raster_Params* params );
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * FT_Orientation
+ *
+ * @description:
+ * A list of values used to describe an outline's contour orientation.
+ *
+ * The TrueType and Postscript specifications use different conventions
+ * to determine whether outline contours should be filled or unfilled.
+ *
+ * @values:
+ * FT_ORIENTATION_TRUETYPE ::
+ * According to the TrueType specification, clockwise contours must
+ * be filled, and counter-clockwise ones must be unfilled.
+ *
+ * FT_ORIENTATION_POSTSCRIPT ::
+ * According to the Postscript specification, counter-clockwise contours
+ * must be filled, and clockwise ones must be unfilled.
+ *
+ * FT_ORIENTATION_FILL_RIGHT ::
+ * This is identical to @FT_ORIENTATION_TRUETYPE, but is used to
+ * remember that in TrueType, everything that is to the right of
+ * the drawing direction of a contour must be filled.
+ *
+ * FT_ORIENTATION_FILL_LEFT ::
+ * This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to
+ * remember that in Postscript, everything that is to the left of
+ * the drawing direction of a contour must be filled.
+ *
+ * FT_ORIENTATION_NONE ::
+ * The orientation cannot be determined. That is, different parts of
+ * the glyph have different orientation.
+ *
+ */
+ typedef enum
+ {
+ FT_ORIENTATION_TRUETYPE = 0,
+ FT_ORIENTATION_POSTSCRIPT = 1,
+ FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,
+ FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT,
+ FT_ORIENTATION_NONE
+
+ } FT_Orientation;
+
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Outline_Get_Orientation
+ *
+ * @description:
+ * This function analyzes a glyph outline and tries to compute its
+ * fill orientation (see @FT_Orientation). This is done by computing
+ * the direction of each global horizontal and/or vertical extrema
+ * within the outline.
+ *
+ * Note that this will return @FT_ORIENTATION_TRUETYPE for empty
+ * outlines.
+ *
+ * @input:
+ * outline ::
+ * A handle to the source outline.
+ *
+ * @return:
+ * The orientation.
+ *
+ */
+ FT_EXPORT( FT_Orientation )
+ FT_Outline_Get_Orientation( FT_Outline* outline );
+
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTOUTLN_H__ */
+
+
+/* END */
+
+
+/* Local Variables: */
+/* coding: utf-8 */
+/* End: */