2018-06-03 22:00:42 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* ftoutln.h
|
|
|
|
*
|
|
|
|
* Support for the FT_Outline type used to store glyph shapes of
|
|
|
|
* most scalable font formats (specification).
|
|
|
|
*
|
2019-02-23 10:07:09 +01:00
|
|
|
* Copyright (C) 1996-2019 by
|
2018-06-03 22:00:42 +02:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
2000-07-02 03:27:32 +02:00
|
|
|
|
2000-07-02 15:53:16 +02:00
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#ifndef FTOUTLN_H_
|
|
|
|
#define FTOUTLN_H_
|
2000-07-02 03:27:32 +02:00
|
|
|
|
2000-12-09 01:45:38 +01:00
|
|
|
|
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_FREETYPE_H
|
|
|
|
|
2003-11-04 08:44:19 +01:00
|
|
|
#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
|
|
|
|
|
2000-12-01 00:12:33 +01:00
|
|
|
|
|
|
|
FT_BEGIN_HEADER
|
2000-07-02 15:53:16 +02:00
|
|
|
|
2001-01-11 10:27:49 +01:00
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @section:
|
2018-06-03 22:00:42 +02:00
|
|
|
* outline_processing
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @title:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Outline Processing
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @abstract:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Functions to create, transform, and render vectorial glyph images.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* This section contains routines used to create and destroy scalable
|
2018-08-24 18:52:30 +02:00
|
|
|
* glyph images known as 'outlines'. These can also be measured,
|
2018-06-03 22:00:42 +02:00
|
|
|
* transformed, and converted into bitmaps and pixmaps.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @order:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Outline
|
|
|
|
* FT_Outline_New
|
|
|
|
* FT_Outline_Done
|
|
|
|
* FT_Outline_Copy
|
|
|
|
* FT_Outline_Translate
|
|
|
|
* FT_Outline_Transform
|
|
|
|
* FT_Outline_Embolden
|
|
|
|
* FT_Outline_EmboldenXY
|
|
|
|
* 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_MoveToFunc
|
|
|
|
* FT_Outline_LineToFunc
|
|
|
|
* FT_Outline_ConicToFunc
|
|
|
|
* FT_Outline_CubicToFunc
|
|
|
|
*
|
|
|
|
* FT_Orientation
|
|
|
|
* FT_Outline_Get_Orientation
|
|
|
|
*
|
|
|
|
* FT_OUTLINE_XXX
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Outline_Decompose
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Walk over an outline's structure to decompose it into individual
|
2018-08-24 18:52:30 +02:00
|
|
|
* segments and Bezier arcs. This function also emits 'move to'
|
2018-06-03 22:00:42 +02:00
|
|
|
* operations to indicate the start of new contours in the outline.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* outline ::
|
|
|
|
* A pointer to the source target.
|
|
|
|
*
|
|
|
|
* func_interface ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* A table of 'emitters', i.e., function pointers called during
|
|
|
|
* decomposition to indicate path operations.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @inout:
|
2018-06-03 22:00:42 +02:00
|
|
|
* user ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* A typeless pointer that is passed to each emitter during the
|
|
|
|
* decomposition. It can be used to store the state during the
|
2018-06-03 22:00:42 +02:00
|
|
|
* decomposition.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @return:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-08-24 18:52:30 +02:00
|
|
|
* A contour that contains a single point only is represented by a 'move
|
|
|
|
* to' operation followed by 'line to' to the same point. In most cases,
|
|
|
|
* it is best to filter this out before using the outline for stroking
|
|
|
|
* purposes (otherwise it would result in a visible dot when round caps
|
|
|
|
* are used).
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* Similarly, the function returns success for an empty outline also
|
2018-08-24 18:52:30 +02:00
|
|
|
* (doing nothing, this is, not calling any emitter); if necessary, you
|
|
|
|
* should filter this out, too.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Outline_Decompose( FT_Outline* outline,
|
2002-04-30 08:37:52 +02:00
|
|
|
const FT_Outline_Funcs* func_interface,
|
2001-06-28 09:17:51 +02:00
|
|
|
void* user );
|
2000-07-02 03:27:32 +02:00
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Outline_New
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Create a new outline of a given size.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* library ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* 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.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* numPoints ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* The maximum number of points within the outline. Must be smaller
|
|
|
|
* than or equal to 0xFFFF (65535).
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* numContours ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* The maximum number of contours within the outline. This value must
|
|
|
|
* be in the range 0 to `numPoints`.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @output:
|
2018-06-03 22:00:42 +02:00
|
|
|
* anoutline ::
|
|
|
|
* A handle to the new outline.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @return:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-09-04 10:37:44 +02:00
|
|
|
* The reason why this function takes a `library` parameter is simply to
|
2018-08-24 18:52:30 +02:00
|
|
|
* use the library's memory allocator.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Outline_New( FT_Library library,
|
|
|
|
FT_UInt numPoints,
|
|
|
|
FT_Int numContours,
|
|
|
|
FT_Outline *anoutline );
|
2000-07-02 03:27:32 +02:00
|
|
|
|
2000-07-11 08:12:20 +02:00
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Outline_Done
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Destroy an outline created with @FT_Outline_New.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* library ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* A handle of the library object used to allocate the outline.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* outline ::
|
|
|
|
* A pointer to the outline object to be discarded.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @return:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-08-24 18:52:30 +02:00
|
|
|
* If the outline's 'owner' field is not set, only the outline descriptor
|
|
|
|
* will be released.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Outline_Done( FT_Library library,
|
|
|
|
FT_Outline* outline );
|
2000-07-11 08:12:20 +02:00
|
|
|
|
2000-07-02 03:27:32 +02:00
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Outline_Check
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Check the contents of an outline descriptor.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* outline ::
|
|
|
|
* A handle to a source outline.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @return:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-06-03 22:00:42 +02:00
|
|
|
* An empty outline, or an outline with a single point only is also
|
|
|
|
* valid.
|
|
|
|
*/
|
2002-01-03 17:56:59 +01:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Outline_Check( FT_Outline* outline );
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Outline_Get_CBox
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* Return an outline's 'control box'. The control box encloses all the
|
|
|
|
* outline's points, including Bezier control points. Though it
|
2018-06-03 22:00:42 +02:00
|
|
|
* coincides with the exact bounding box for most glyphs, it can be
|
2018-08-24 18:52:30 +02:00
|
|
|
* slightly larger in some situations (like when rotating an outline that
|
|
|
|
* contains Bezier outside arcs).
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* 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.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* outline ::
|
|
|
|
* A pointer to the source outline descriptor.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @output:
|
2018-06-03 22:00:42 +02:00
|
|
|
* acbox ::
|
|
|
|
* The outline's control box.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-06-03 22:00:42 +02:00
|
|
|
* See @FT_Glyph_Get_CBox for a discussion of tricky fonts.
|
|
|
|
*/
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( void )
|
2005-04-14 18:03:15 +02:00
|
|
|
FT_Outline_Get_CBox( const FT_Outline* outline,
|
|
|
|
FT_BBox *acbox );
|
2000-07-02 03:27:32 +02:00
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Outline_Translate
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Apply a simple translation to the points of an outline.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @inout:
|
2018-06-03 22:00:42 +02:00
|
|
|
* outline ::
|
|
|
|
* A pointer to the target outline descriptor.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* xOffset ::
|
|
|
|
* The horizontal offset.
|
|
|
|
*
|
|
|
|
* yOffset ::
|
|
|
|
* The vertical offset.
|
|
|
|
*/
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( void )
|
2005-05-20 08:22:20 +02:00
|
|
|
FT_Outline_Translate( const FT_Outline* outline,
|
|
|
|
FT_Pos xOffset,
|
|
|
|
FT_Pos yOffset );
|
2000-07-02 03:27:32 +02:00
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Outline_Copy
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* Copy an outline into another one. Both objects must have the same
|
|
|
|
* sizes (number of points & number of contours) when this function is
|
|
|
|
* called.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* source ::
|
|
|
|
* A handle to the source outline.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @output:
|
2018-06-03 22:00:42 +02:00
|
|
|
* target ::
|
|
|
|
* A handle to the target outline.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @return:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*/
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
2005-04-14 18:03:15 +02:00
|
|
|
FT_Outline_Copy( const FT_Outline* source,
|
|
|
|
FT_Outline *target );
|
2000-07-02 03:27:32 +02:00
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Outline_Transform
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* Apply a simple 2x2 matrix to all of an outline's points. Useful for
|
|
|
|
* applying rotations, slanting, flipping, etc.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @inout:
|
2018-06-03 22:00:42 +02:00
|
|
|
* outline ::
|
|
|
|
* A pointer to the target outline descriptor.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* matrix ::
|
|
|
|
* A pointer to the transformation matrix.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-06-03 22:00:42 +02:00
|
|
|
* You can use @FT_Outline_Translate if you need to translate the
|
|
|
|
* outline's points.
|
|
|
|
*/
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( void )
|
2005-05-20 08:22:20 +02:00
|
|
|
FT_Outline_Transform( const FT_Outline* outline,
|
|
|
|
const FT_Matrix* matrix );
|
2000-07-11 08:12:20 +02:00
|
|
|
|
2000-07-02 03:27:32 +02:00
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Outline_Embolden
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Embolden an outline. The new outline will be at most 4~times
|
2018-09-04 10:37:44 +02:00
|
|
|
* `strength` pixels wider and higher. You may think of the left and
|
2018-06-03 22:00:42 +02:00
|
|
|
* bottom borders as unchanged.
|
|
|
|
*
|
2018-09-04 10:37:44 +02:00
|
|
|
* Negative `strength` values to reduce the outline thickness are
|
2018-06-03 22:00:42 +02:00
|
|
|
* possible also.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @inout:
|
2018-06-03 22:00:42 +02:00
|
|
|
* outline ::
|
|
|
|
* A handle to the target outline.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* strength ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* How strong the glyph is emboldened. Expressed in 26.6 pixel format.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @return:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-08-24 18:52:30 +02:00
|
|
|
* 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.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* If you need 'better' metrics values you should call
|
2018-06-03 22:00:42 +02:00
|
|
|
* @FT_Outline_Get_CBox or @FT_Outline_Get_BBox.
|
|
|
|
*
|
2018-06-18 10:08:17 +02:00
|
|
|
* To get meaningful results, font scaling values must be set with
|
|
|
|
* functions like @FT_Set_Char_Size before calling FT_Render_Glyph.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-18 10:08:17 +02:00
|
|
|
* @example:
|
2018-08-24 18:52:30 +02:00
|
|
|
* ```
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT );
|
2018-06-18 10:08:17 +02:00
|
|
|
*
|
2018-06-03 22:00:42 +02:00
|
|
|
* if ( face->glyph->format == FT_GLYPH_FORMAT_OUTLINE )
|
|
|
|
* FT_Outline_Embolden( &face->glyph->outline, strength );
|
2018-08-24 18:52:30 +02:00
|
|
|
* ```
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
*/
|
2005-07-13 08:56:08 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
2005-05-25 07:51:01 +02:00
|
|
|
FT_Outline_Embolden( FT_Outline* outline,
|
|
|
|
FT_Pos strength );
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Outline_EmboldenXY
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-09-04 10:37:44 +02:00
|
|
|
* Embolden an outline. The new outline will be `xstrength` pixels wider
|
|
|
|
* and `ystrength` pixels higher. Otherwise, it is similar to
|
2018-08-24 18:52:30 +02:00
|
|
|
* @FT_Outline_Embolden, which uses the same strength in both directions.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @since:
|
2018-06-03 22:00:42 +02:00
|
|
|
* 2.4.10
|
|
|
|
*/
|
2012-05-28 22:34:58 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Outline_EmboldenXY( FT_Outline* outline,
|
|
|
|
FT_Pos xstrength,
|
|
|
|
FT_Pos ystrength );
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Outline_Reverse
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* Reverse the drawing direction of an outline. This is used to ensure
|
|
|
|
* consistent fill conventions for mirrored glyphs.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @inout:
|
2018-06-03 22:00:42 +02:00
|
|
|
* outline ::
|
|
|
|
* A pointer to the target outline descriptor.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-08-24 18:52:30 +02:00
|
|
|
* This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in the
|
2018-09-04 10:37:44 +02:00
|
|
|
* outline's `flags` field.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* It shouldn't be used by a normal client application, unless it knows
|
|
|
|
* what it is doing.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( void )
|
|
|
|
FT_Outline_Reverse( FT_Outline* outline );
|
2000-07-02 03:27:32 +02:00
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Outline_Get_Bitmap
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Render an outline within a bitmap. The outline's image is simply
|
|
|
|
* OR-ed to the target bitmap.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* library ::
|
|
|
|
* A handle to a FreeType library object.
|
|
|
|
*
|
|
|
|
* outline ::
|
|
|
|
* A pointer to the source outline descriptor.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @inout:
|
2018-06-03 22:00:42 +02:00
|
|
|
* abitmap ::
|
|
|
|
* A pointer to the target bitmap descriptor.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @return:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-09-04 10:37:44 +02:00
|
|
|
* This function does **not create** the bitmap, it only renders an
|
|
|
|
* outline image within the one you pass to it! Consequently, the
|
|
|
|
* various fields in `abitmap` should be set accordingly.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* It will use the raster corresponding to the default glyph format.
|
|
|
|
*
|
2018-09-04 10:37:44 +02:00
|
|
|
* The value of the `num_grays` field in `abitmap` is ignored. If you
|
2018-08-24 18:52:30 +02:00
|
|
|
* select the gray-level rasterizer, and you want less than 256 gray
|
|
|
|
* levels, you have to use @FT_Outline_Render directly.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
2005-04-14 18:03:15 +02:00
|
|
|
FT_Outline_Get_Bitmap( FT_Library library,
|
|
|
|
FT_Outline* outline,
|
|
|
|
const FT_Bitmap *abitmap );
|
2000-07-11 08:12:20 +02:00
|
|
|
|
2000-07-02 03:27:32 +02:00
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Outline_Render
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Render an outline within a bitmap using the current scan-convert.
|
|
|
|
* This function uses an @FT_Raster_Params structure as an argument,
|
2018-08-24 18:52:30 +02:00
|
|
|
* allowing advanced features like direct composition, translucency, etc.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* library ::
|
|
|
|
* A handle to a FreeType library object.
|
|
|
|
*
|
|
|
|
* outline ::
|
|
|
|
* A pointer to the source outline descriptor.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @inout:
|
2018-06-03 22:00:42 +02:00
|
|
|
* params ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* A pointer to an @FT_Raster_Params structure used to describe the
|
|
|
|
* rendering operation.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @return:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-08-24 18:52:30 +02:00
|
|
|
* You should know what you are doing and how @FT_Raster_Params works to
|
|
|
|
* use this function.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-09-04 10:37:44 +02:00
|
|
|
* The field `params.source` will be set to `outline` before the scan
|
2018-06-03 22:00:42 +02:00
|
|
|
* converter is called, which means that the value you give to it is
|
|
|
|
* actually ignored.
|
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* The gray-level rasterizer always uses 256 gray levels. If you want
|
|
|
|
* less gray levels, you have to provide your own span callback. See the
|
2018-09-04 10:37:44 +02:00
|
|
|
* @FT_RASTER_FLAG_DIRECT value of the `flags` field in the
|
2018-06-03 22:00:42 +02:00
|
|
|
* @FT_Raster_Params structure for more details.
|
|
|
|
*/
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Outline_Render( FT_Library library,
|
|
|
|
FT_Outline* outline,
|
|
|
|
FT_Raster_Params* params );
|
2000-07-02 03:27:32 +02:00
|
|
|
|
2000-12-09 01:45:38 +01:00
|
|
|
|
2018-06-17 11:22:37 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* @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 ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* According to the TrueType specification, clockwise contours must be
|
|
|
|
* filled, and counter-clockwise ones must be unfilled.
|
2018-06-17 11:22:37 +02:00
|
|
|
*
|
|
|
|
* FT_ORIENTATION_POSTSCRIPT ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* According to the PostScript specification, counter-clockwise
|
|
|
|
* contours must be filled, and clockwise ones must be unfilled.
|
2018-06-17 11:22:37 +02:00
|
|
|
*
|
|
|
|
* FT_ORIENTATION_FILL_RIGHT ::
|
|
|
|
* This is identical to @FT_ORIENTATION_TRUETYPE, but is used to
|
2018-08-24 18:52:30 +02:00
|
|
|
* remember that in TrueType, everything that is to the right of the
|
|
|
|
* drawing direction of a contour must be filled.
|
2018-06-17 11:22:37 +02:00
|
|
|
*
|
|
|
|
* FT_ORIENTATION_FILL_LEFT ::
|
|
|
|
* This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to
|
2018-08-24 18:52:30 +02:00
|
|
|
* remember that in PostScript, everything that is to the left of the
|
|
|
|
* drawing direction of a contour must be filled.
|
2018-06-17 11:22:37 +02:00
|
|
|
*
|
|
|
|
* FT_ORIENTATION_NONE ::
|
|
|
|
* The orientation cannot be determined. That is, different parts of
|
|
|
|
* the glyph have different orientation.
|
|
|
|
*
|
|
|
|
*/
|
2008-05-29 00:17:28 +02:00
|
|
|
typedef enum FT_Orientation_
|
2003-10-02 23:07:10 +02:00
|
|
|
{
|
|
|
|
FT_ORIENTATION_TRUETYPE = 0,
|
|
|
|
FT_ORIENTATION_POSTSCRIPT = 1,
|
|
|
|
FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,
|
2006-02-22 21:47:39 +01:00
|
|
|
FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT,
|
|
|
|
FT_ORIENTATION_NONE
|
2007-01-16 07:11:27 +01:00
|
|
|
|
2003-10-02 23:07:10 +02:00
|
|
|
} FT_Orientation;
|
|
|
|
|
|
|
|
|
2018-06-17 11:22:37 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* @function:
|
|
|
|
* FT_Outline_Get_Orientation
|
|
|
|
*
|
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* This function analyzes a glyph outline and tries to compute its fill
|
|
|
|
* orientation (see @FT_Orientation). This is done by integrating the
|
|
|
|
* total area covered by the outline. The positive integral corresponds
|
|
|
|
* to the clockwise orientation and @FT_ORIENTATION_POSTSCRIPT is
|
|
|
|
* returned. The negative integral corresponds to the counter-clockwise
|
2018-06-17 11:22:37 +02:00
|
|
|
* orientation and @FT_ORIENTATION_TRUETYPE is returned.
|
|
|
|
*
|
|
|
|
* Note that this will return @FT_ORIENTATION_TRUETYPE for empty
|
|
|
|
* outlines.
|
|
|
|
*
|
|
|
|
* @input:
|
|
|
|
* outline ::
|
|
|
|
* A handle to the source outline.
|
|
|
|
*
|
|
|
|
* @return:
|
|
|
|
* The orientation.
|
|
|
|
*
|
|
|
|
*/
|
2003-10-02 23:07:10 +02:00
|
|
|
FT_EXPORT( FT_Orientation )
|
|
|
|
FT_Outline_Get_Orientation( FT_Outline* outline );
|
|
|
|
|
2018-06-17 11:22:37 +02:00
|
|
|
|
2001-01-11 10:27:49 +01:00
|
|
|
/* */
|
|
|
|
|
|
|
|
|
2000-12-01 00:12:33 +01:00
|
|
|
FT_END_HEADER
|
2000-07-02 03:27:32 +02:00
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#endif /* FTOUTLN_H_ */
|
2000-07-02 15:53:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|
2006-05-12 16:20:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* Local Variables: */
|
|
|
|
/* coding: utf-8 */
|
|
|
|
/* End: */
|