2000-07-02 03:27:32 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* ftoutln.h */
|
|
|
|
/* */
|
2000-07-14 08:16:47 +02:00
|
|
|
/* Support for the FT_Outline type used to store glyph shapes of */
|
|
|
|
/* most scalable font formats (specification). */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
2005-04-14 18:03:15 +02:00
|
|
|
/* Copyright 1996-2001, 2002, 2003, 2005 by */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
|
|
|
/* */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* This file is part of the FreeType project, and may only be used, */
|
|
|
|
/* modified, and distributed under the terms of the FreeType project */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* 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 15:53:16 +02:00
|
|
|
|
2000-12-01 00:12:33 +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
|
|
|
|
2001-01-10 07:53:49 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
2001-01-11 10:27:49 +01:00
|
|
|
/* <Section> */
|
|
|
|
/* outline_processing */
|
2001-01-10 07:53:49 +01:00
|
|
|
/* */
|
2001-01-11 10:27:49 +01:00
|
|
|
/* <Title> */
|
|
|
|
/* Outline Processing */
|
2001-01-10 07:53:49 +01:00
|
|
|
/* */
|
|
|
|
/* <Abstract> */
|
2001-01-11 10:27:49 +01:00
|
|
|
/* Functions to create, transform, and render vectorial glyph images. */
|
2001-01-10 07:53:49 +01:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2001-01-11 10:27:49 +01:00
|
|
|
/* 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. */
|
2001-01-10 07:53:49 +01:00
|
|
|
/* */
|
2001-02-13 18:42:49 +01:00
|
|
|
/* <Order> */
|
2001-03-04 22:53:08 +01:00
|
|
|
/* FT_Outline */
|
2003-07-09 17:20:32 +02:00
|
|
|
/* FT_OUTLINE_FLAGS */
|
2001-03-04 22:53:08 +01:00
|
|
|
/* FT_Outline_New */
|
|
|
|
/* FT_Outline_Done */
|
|
|
|
/* FT_Outline_Copy */
|
|
|
|
/* FT_Outline_Translate */
|
|
|
|
/* FT_Outline_Transform */
|
2005-05-25 07:51:01 +02:00
|
|
|
/* FT_Outline_Embolden */
|
2001-03-04 22:53:08 +01:00
|
|
|
/* FT_Outline_Reverse */
|
2002-01-03 23:06:13 +01:00
|
|
|
/* FT_Outline_Check */
|
2001-02-13 18:42:49 +01:00
|
|
|
/* */
|
2001-03-04 22:53:08 +01:00
|
|
|
/* FT_Outline_Get_CBox */
|
|
|
|
/* FT_Outline_Get_BBox */
|
2001-02-13 18:42:49 +01:00
|
|
|
/* */
|
2001-03-04 22:53:08 +01:00
|
|
|
/* FT_Outline_Get_Bitmap */
|
|
|
|
/* FT_Outline_Render */
|
2001-02-13 18:42:49 +01:00
|
|
|
/* */
|
2001-03-04 22:53:08 +01:00
|
|
|
/* FT_Outline_Decompose */
|
|
|
|
/* FT_Outline_Funcs */
|
|
|
|
/* FT_Outline_MoveTo_Func */
|
|
|
|
/* FT_Outline_LineTo_Func */
|
|
|
|
/* FT_Outline_ConicTo_Func */
|
2001-02-13 18:42:49 +01:00
|
|
|
/* FT_Outline_CubicTo_Func */
|
|
|
|
/* */
|
2001-01-11 10:27:49 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
|
2000-07-02 15:53:16 +02:00
|
|
|
|
2000-07-02 03:27:32 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Outline_Decompose */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Walks over an outline's structure to decompose it into individual */
|
|
|
|
/* segments and Bezier 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> */
|
2002-04-30 08:37:52 +02:00
|
|
|
/* outline :: A pointer to the source target. */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
2002-04-30 08:37:52 +02:00
|
|
|
/* func_interface :: A table of `emitters', i.e,. function pointers */
|
|
|
|
/* called during decomposition to indicate path */
|
|
|
|
/* operations. */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
2000-11-06 05:33:56 +01:00
|
|
|
/* <InOut> */
|
2002-04-30 08:37:52 +02:00
|
|
|
/* user :: A typeless pointer which is passed to each */
|
|
|
|
/* emitter during the decomposition. It can be */
|
|
|
|
/* used to store the state during the */
|
|
|
|
/* decomposition. */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means sucess. */
|
|
|
|
/* */
|
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
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <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 */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* outline will NOT necessarily be FREED, when */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* 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> */
|
2000-11-06 05:33:56 +01:00
|
|
|
/* anoutline :: A handle to the new outline. NULL in case of */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* error. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* The reason why this function takes a `library' parameter is simply */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* to use the library's memory allocator. */
|
2000-07-02 03:27:32 +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
|
|
|
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Outline_New_Internal( FT_Memory memory,
|
2000-11-04 09:33:38 +01:00
|
|
|
FT_UInt numPoints,
|
|
|
|
FT_Int numContours,
|
2000-11-06 05:33:56 +01:00
|
|
|
FT_Outline *anoutline );
|
2000-07-07 21:47:34 +02:00
|
|
|
|
2000-07-02 03:27:32 +02:00
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <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. */
|
|
|
|
/* */
|
2000-11-06 05:33:56 +01:00
|
|
|
/* The reason why this function takes an `library' parameter is */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* simply to use FT_Free(). */
|
2000-07-02 03:27:32 +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
|
|
|
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Outline_Done_Internal( FT_Memory memory,
|
|
|
|
FT_Outline* outline );
|
2000-07-07 21:47:34 +02:00
|
|
|
|
2000-07-11 08:12:20 +02:00
|
|
|
|
2002-01-03 17:56:59 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Outline_Check */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2002-01-03 23:06:13 +01:00
|
|
|
/* Check the contents of an outline descriptor. */
|
2002-01-03 17:56:59 +01:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
2002-01-03 23:06:13 +01:00
|
|
|
/* outline :: A handle to a source outline. */
|
2002-01-03 17:56:59 +01:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Outline_Check( FT_Outline* outline );
|
|
|
|
|
|
|
|
|
2000-07-02 03:27:32 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Outline_Get_CBox */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Returns an outline's `control box'. The control box encloses all */
|
|
|
|
/* the outline's points, including Bezier 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 Bezier 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> */
|
2000-11-06 05:33:56 +01:00
|
|
|
/* acbox :: The outline's control box. */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
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
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Outline_Translate */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Applies a simple translation to the points of an outline. */
|
|
|
|
/* */
|
2000-11-06 05:33:56 +01:00
|
|
|
/* <InOut> */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* outline :: A pointer to the target outline descriptor. */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* */
|
2000-11-06 05:33:56 +01:00
|
|
|
/* <Input> */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* xOffset :: The horizontal offset. */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* 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
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <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. */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* */
|
|
|
|
/* <Output> */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* target :: A handle to the target outline. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* 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
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
2000-11-07 18:21:11 +01:00
|
|
|
/* FT_Outline_Transform */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-11-07 18:21:11 +01:00
|
|
|
/* Applies a simple 2x2 matrix to all of an outline's points. Useful */
|
|
|
|
/* for applying rotations, slanting, flipping, etc. */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* */
|
|
|
|
/* <InOut> */
|
2000-11-07 18:21:11 +01:00
|
|
|
/* outline :: A pointer to the target outline descriptor. */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
2000-11-07 18:21:11 +01:00
|
|
|
/* matrix :: A pointer to the transformation matrix. */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
|
|
|
/* <Note> */
|
2000-11-07 18:21:11 +01:00
|
|
|
/* You can use FT_Outline_Translate() if you need to translate the */
|
|
|
|
/* outline's points. */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
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
|
|
|
|
2005-05-25 07:51:01 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <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. */
|
|
|
|
/* */
|
|
|
|
/* <InOut> */
|
|
|
|
/* outline :: A handle to the target outline. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* strength :: How strong the glyph is emboldened. Expressed in */
|
2005-05-30 21:22:44 +02:00
|
|
|
/* 26.6 pixel format. */
|
2005-05-25 07:51:01 +02:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
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 );
|
|
|
|
|
|
|
|
|
2000-07-02 03:27:32 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Outline_Reverse */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* Reverses the drawing direction of an outline. This is used to */
|
|
|
|
/* ensure consistent fill conventions for mirrored glyphs. */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
2000-11-06 05:33:56 +01:00
|
|
|
/* <InOut> */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* outline :: A pointer to the target outline descriptor. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
/* This functions toggles the bit flag `FT_OUTLINE_REVERSE_FILL' in */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* the outline's `flags' field. */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
|
|
|
/* It shouldn't be used by a normal client application, unless it */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* knows what it is doing. */
|
2000-07-02 03:27:32 +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
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Outline_Get_Bitmap */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Renders an outline within a bitmap. The outline's image is simply */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* OR-ed to the target bitmap. */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* library :: A handle to a FreeType library object. */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* outline :: A pointer to the source outline descriptor. */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* */
|
2005-11-17 22:32:41 +01:00
|
|
|
/* <InOut> */
|
2000-11-06 05:33:56 +01:00
|
|
|
/* abitmap :: A pointer to the target bitmap descriptor. */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
|
|
|
/* <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 correponding to the default glyph format. */
|
|
|
|
/* */
|
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
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Outline_Render */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* 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. */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* library :: A handle to a FreeType library object. */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* outline :: A pointer to the source outline descriptor. */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* */
|
2000-11-06 05:33:56 +01:00
|
|
|
/* <InOut> */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* params :: A pointer to a FT_Raster_Params structure used to */
|
|
|
|
/* describe the rendering operation. */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* You should know what you are doing and how FT_Raster_Params works */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* to use this function. */
|
|
|
|
/* */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* 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. */
|
2000-07-02 03:27:32 +02:00
|
|
|
/* */
|
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
|
|
|
|
2003-10-02 23:07:10 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2003-10-07 07:49:41 +02:00
|
|
|
* @enum:
|
|
|
|
* FT_Orientation
|
2003-10-02 23:07:10 +02:00
|
|
|
*
|
|
|
|
* @description:
|
2003-10-07 07:49:41 +02:00
|
|
|
* A list of values used to describe an outline's contour orientation.
|
2003-10-02 23:07:10 +02:00
|
|
|
*
|
2003-10-07 07:49:41 +02:00
|
|
|
* The TrueType and Postscript specifications use different conventions
|
|
|
|
* to determine whether outline contours should be filled or unfilled.
|
2003-10-02 23:07:10 +02:00
|
|
|
*
|
|
|
|
* @values:
|
|
|
|
* FT_ORIENTATION_TRUETYPE ::
|
2003-10-07 07:49:41 +02:00
|
|
|
* According to the TrueType specification, clockwise contours must
|
|
|
|
* be filled, and counter-clockwise ones must be unfilled.
|
2003-10-02 23:07:10 +02:00
|
|
|
*
|
|
|
|
* FT_ORIENTATION_POSTSCRIPT ::
|
2003-10-07 07:49:41 +02:00
|
|
|
* According to the Postscript specification, counter-clockwise contours
|
|
|
|
* must be filled, and clockwise ones must be unfilled.
|
2003-10-02 23:07:10 +02:00
|
|
|
*
|
|
|
|
* FT_ORIENTATION_FILL_RIGHT ::
|
2003-10-07 07:49:41 +02:00
|
|
|
* This is identical to @FT_ORIENTATION_TRUETYPE, but is used to
|
2003-10-02 23:07:10 +02:00
|
|
|
* remember that in TrueType, everything that is to the right of
|
|
|
|
* the drawing direction of a contour must be filled.
|
|
|
|
*
|
|
|
|
* FT_ORIENTATION_FILL_LEFT ::
|
2003-10-07 07:49:41 +02:00
|
|
|
* This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to
|
2003-10-02 23:07:10 +02:00
|
|
|
* remember that in Postscript, everything that is to the left of
|
2003-10-07 07:49:41 +02:00
|
|
|
* the drawing direction of a contour must be filled.
|
2003-10-02 23:07:10 +02:00
|
|
|
*/
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
*
|
2003-10-07 07:49:41 +02:00
|
|
|
* @function:
|
|
|
|
* FT_Outline_Get_Orientation
|
2003-10-02 23:07:10 +02:00
|
|
|
*
|
|
|
|
* @description:
|
2003-10-07 07:49:41 +02:00
|
|
|
* This function analyzes a glyph outline and tries to compute its
|
|
|
|
* fill orientation (see @FT_Orientation). This is done by computing
|
2003-10-02 23:07:10 +02:00
|
|
|
* the direction of each global horizontal and/or vertical extrema
|
|
|
|
* within the outline.
|
|
|
|
*
|
2003-10-07 07:49:41 +02:00
|
|
|
* Note that this will return @FT_ORIENTATION_TRUETYPE for empty
|
2003-10-02 23:07:10 +02:00
|
|
|
* outlines.
|
|
|
|
*
|
|
|
|
* @input:
|
2003-10-07 07:49:41 +02:00
|
|
|
* outline ::
|
|
|
|
* A handle to the source outline.
|
2003-10-02 23:07:10 +02:00
|
|
|
*
|
|
|
|
* @return:
|
2003-10-07 07:49:41 +02:00
|
|
|
* The orientation.
|
2003-10-02 23:07:10 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
FT_EXPORT( FT_Orientation )
|
|
|
|
FT_Outline_Get_Orientation( FT_Outline* outline );
|
|
|
|
|
|
|
|
|
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
|
|
|
|
2000-12-01 00:12:33 +01:00
|
|
|
#endif /* __FTOUTLN_H__ */
|
2000-07-02 15:53:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|