More formatting.
About previous commitment: Added latest versions of (still unused) config.guess and config.sub files.
This commit is contained in:
parent
dcd2e14c58
commit
d7a046838f
|
@ -50,7 +50,7 @@
|
||||||
/* It is based on ideas that I initially found in Raph Levien's */
|
/* It is based on ideas that I initially found in Raph Levien's */
|
||||||
/* excellent LibArt graphics library (see http://www.levien.com/libart */
|
/* excellent LibArt graphics library (see http://www.levien.com/libart */
|
||||||
/* for more information, though the web pages do not tell anything */
|
/* for more information, though the web pages do not tell anything */
|
||||||
/* about the renderer; you'll have to dive into the source code to */
|
/* about the renderer; you will have to dive into the source code to */
|
||||||
/* understand how it works). */
|
/* understand how it works). */
|
||||||
/* */
|
/* */
|
||||||
/* Note, however, that this is a _very_ different implementation */
|
/* Note, however, that this is a _very_ different implementation */
|
||||||
|
@ -103,6 +103,7 @@
|
||||||
#include "ftimage.h"
|
#include "ftimage.h"
|
||||||
#include "ftgrays.h"
|
#include "ftgrays.h"
|
||||||
|
|
||||||
|
|
||||||
/* This macro is used to indicate that a function parameter is unused. */
|
/* This macro is used to indicate that a function parameter is unused. */
|
||||||
/* Its purpose is simply to reduce compiler warnings. Note also that */
|
/* Its purpose is simply to reduce compiler warnings. Note also that */
|
||||||
/* simply defining it as `(void)x' doesn't avoid warnings with certain */
|
/* simply defining it as `(void)x' doesn't avoid warnings with certain */
|
||||||
|
@ -135,6 +136,7 @@
|
||||||
/* define this to dump debugging information */
|
/* define this to dump debugging information */
|
||||||
#define xxxDEBUG_GRAYS
|
#define xxxDEBUG_GRAYS
|
||||||
|
|
||||||
|
|
||||||
/* as usual, for the speed hungry :-) */
|
/* as usual, for the speed hungry :-) */
|
||||||
|
|
||||||
#ifndef FT_STATIC_RASTER
|
#ifndef FT_STATIC_RASTER
|
||||||
|
@ -965,8 +967,8 @@
|
||||||
|
|
||||||
#ifdef SHELL_SORT
|
#ifdef SHELL_SORT
|
||||||
|
|
||||||
/* A simple shell sort algorithm that works directly on our */
|
/* a simple shell sort algorithm that works directly on our */
|
||||||
/* cells table.. */
|
/* cells table */
|
||||||
static
|
static
|
||||||
void shell_sort ( PCell cells,
|
void shell_sort ( PCell cells,
|
||||||
int count )
|
int count )
|
||||||
|
@ -1440,7 +1442,7 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* The following function should only compile in stand_alone mode, */
|
/* The following function should only compile in stand_alone mode, */
|
||||||
/* i.e., when building this component without the rest of FreeType. */
|
/* i.e., if building this component without the rest of FreeType. */
|
||||||
/* */
|
/* */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -15,23 +15,27 @@
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#ifndef FTGRAYS_H
|
#ifndef FTGRAYS_H
|
||||||
#define FTGRAYS_H
|
#define FTGRAYS_H
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef _STANDALONE_
|
#ifdef _STANDALONE_
|
||||||
#include "ftimage.h"
|
#include "ftimage.h"
|
||||||
#else
|
#else
|
||||||
#include <freetype/ftimage.h>
|
#include <freetype/ftimage.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* To make ftgrays.h independent from configuration files we check */
|
/* To make ftgrays.h independent from configuration files we check */
|
||||||
/* whether FT_EXPORT_DEF has been defined already. */
|
/* whether FT_EXPORT_VAR has been defined already. */
|
||||||
/* */
|
/* */
|
||||||
/* On some systems and compilers (Win32 mostly), an extra keyword is */
|
/* On some systems and compilers (Win32 mostly), an extra keyword is */
|
||||||
/* necessary to compile the library as a DLL. */
|
/* necessary to compile the library as a DLL. */
|
||||||
|
@ -42,8 +46,13 @@
|
||||||
|
|
||||||
FT_EXPORT_VAR( FT_Raster_Funcs ) ft_grays_raster;
|
FT_EXPORT_VAR( FT_Raster_Funcs ) ft_grays_raster;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
#endif /* FTGRAYS_H */
|
||||||
|
|
||||||
|
|
||||||
|
/* END */
|
||||||
|
|
|
@ -236,6 +236,7 @@
|
||||||
typedef unsigned char Byte, *PByte;
|
typedef unsigned char Byte, *PByte;
|
||||||
typedef char Bool;
|
typedef char Bool;
|
||||||
|
|
||||||
|
|
||||||
typedef struct TPoint_
|
typedef struct TPoint_
|
||||||
{
|
{
|
||||||
Long x;
|
Long x;
|
||||||
|
@ -303,6 +304,7 @@
|
||||||
|
|
||||||
#ifdef TT_STATIC_RASTER
|
#ifdef TT_STATIC_RASTER
|
||||||
|
|
||||||
|
|
||||||
#define RAS_ARGS /* void */
|
#define RAS_ARGS /* void */
|
||||||
#define RAS_ARG /* void */
|
#define RAS_ARG /* void */
|
||||||
|
|
||||||
|
@ -311,8 +313,10 @@
|
||||||
|
|
||||||
#define UNUSED_RASTER do ; while ( 0 )
|
#define UNUSED_RASTER do ; while ( 0 )
|
||||||
|
|
||||||
|
|
||||||
#else /* TT_STATIC_RASTER */
|
#else /* TT_STATIC_RASTER */
|
||||||
|
|
||||||
|
|
||||||
#define RAS_ARGS TRaster_Instance* raster,
|
#define RAS_ARGS TRaster_Instance* raster,
|
||||||
#define RAS_ARG TRaster_Instance* raster
|
#define RAS_ARG TRaster_Instance* raster
|
||||||
|
|
||||||
|
@ -321,6 +325,7 @@
|
||||||
|
|
||||||
#define UNUSED_RASTER UNUSED( raster )
|
#define UNUSED_RASTER UNUSED( raster )
|
||||||
|
|
||||||
|
|
||||||
#endif /* TT_STATIC_RASTER */
|
#endif /* TT_STATIC_RASTER */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
make_module_list: add_renderer_module
|
make_module_list: add_renderer_module
|
||||||
|
|
||||||
# XXX: important, the standard renderer *MUST* be first on this list..
|
# XXX: important, the standard renderer *MUST* be first on this list!
|
||||||
#
|
#
|
||||||
add_renderer_module:
|
add_renderer_module:
|
||||||
$(OPEN_DRIVER)ft_standard_renderer_class$(CLOSE_DRIVER)
|
$(OPEN_DRIVER)ft_standard_renderer_class$(CLOSE_DRIVER)
|
||||||
|
|
|
@ -1,36 +1,62 @@
|
||||||
|
/***************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* renderer.c */
|
||||||
|
/* */
|
||||||
|
/* FreeType renderer module (body). */
|
||||||
|
/* */
|
||||||
|
/* Copyright 2000 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. */
|
||||||
|
/* */
|
||||||
|
/***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#include <freetype/internal/ftobjs.h>
|
#include <freetype/internal/ftobjs.h>
|
||||||
|
|
||||||
/* initialise renderer - init its raster */
|
|
||||||
static FT_Error ft_renderer_init( FT_Renderer render )
|
/* initialize renderer - init its raster */
|
||||||
|
static
|
||||||
|
FT_Error ft_renderer_init( FT_Renderer render )
|
||||||
{
|
{
|
||||||
FT_Library library = FT_MODULE_LIBRARY( render );
|
FT_Library library = FT_MODULE_LIBRARY( render );
|
||||||
|
|
||||||
|
|
||||||
render->clazz->raster_class->raster_reset( render->raster,
|
render->clazz->raster_class->raster_reset( render->raster,
|
||||||
library->raster_pool, library->raster_pool_size );
|
library->raster_pool,
|
||||||
|
library->raster_pool_size );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* set render-specific mode */
|
||||||
/* sets render-specific mode */
|
static
|
||||||
static FT_Error ft_renderer_set_mode( FT_Renderer render,
|
FT_Error ft_renderer_set_mode( FT_Renderer render,
|
||||||
FT_ULong mode_tag,
|
FT_ULong mode_tag,
|
||||||
FT_Pointer data )
|
FT_Pointer data )
|
||||||
{
|
{
|
||||||
/* we simply pass it to the raster */
|
/* we simply pass it to the raster */
|
||||||
return render->clazz->raster_class->raster_set_mode(
|
return render->clazz->raster_class->raster_set_mode( render->raster,
|
||||||
render->raster, mode_tag, data );
|
mode_tag,
|
||||||
|
data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* transform a given glyph image */
|
/* transform a given glyph image */
|
||||||
static FT_Error ft_renderer_transform( FT_Renderer render,
|
static
|
||||||
|
FT_Error ft_renderer_transform( FT_Renderer render,
|
||||||
FT_GlyphSlot slot,
|
FT_GlyphSlot slot,
|
||||||
FT_Matrix* matrix,
|
FT_Matrix* matrix,
|
||||||
FT_Vector* delta )
|
FT_Vector* delta )
|
||||||
{
|
{
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
|
|
||||||
|
|
||||||
if ( slot->format != render->glyph_format )
|
if ( slot->format != render->glyph_format )
|
||||||
{
|
{
|
||||||
error = FT_Err_Invalid_Argument;
|
error = FT_Err_Invalid_Argument;
|
||||||
|
@ -47,8 +73,10 @@
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* return the glyph's control box */
|
/* return the glyph's control box */
|
||||||
static void ft_renderer_get_cbox( FT_Renderer render,
|
static
|
||||||
|
void ft_renderer_get_cbox( FT_Renderer render,
|
||||||
FT_GlyphSlot slot,
|
FT_GlyphSlot slot,
|
||||||
FT_BBox* cbox )
|
FT_BBox* cbox )
|
||||||
{
|
{
|
||||||
|
@ -60,7 +88,8 @@
|
||||||
|
|
||||||
|
|
||||||
/* convert a slot's glyph image into a bitmap */
|
/* convert a slot's glyph image into a bitmap */
|
||||||
static FT_Error ft_renderer_render( FT_Renderer render,
|
static
|
||||||
|
FT_Error ft_renderer_render( FT_Renderer render,
|
||||||
FT_GlyphSlot slot,
|
FT_GlyphSlot slot,
|
||||||
FT_UInt mode,
|
FT_UInt mode,
|
||||||
FT_Vector* origin )
|
FT_Vector* origin )
|
||||||
|
@ -74,6 +103,7 @@
|
||||||
|
|
||||||
FT_Raster_Params params;
|
FT_Raster_Params params;
|
||||||
|
|
||||||
|
|
||||||
/* check glyph image format */
|
/* check glyph image format */
|
||||||
if ( slot->format != render->glyph_format )
|
if ( slot->format != render->glyph_format )
|
||||||
{
|
{
|
||||||
|
@ -142,7 +172,8 @@
|
||||||
|
|
||||||
/* render outline into the bitmap */
|
/* render outline into the bitmap */
|
||||||
error = render->raster_render( render->raster, ¶ms );
|
error = render->raster_render( render->raster, ¶ms );
|
||||||
if (error) goto Exit;
|
if ( error )
|
||||||
|
goto Exit;
|
||||||
|
|
||||||
slot->format = ft_glyph_format_bitmap;
|
slot->format = ft_glyph_format_bitmap;
|
||||||
slot->bitmap_left = cbox.xMin >> 6;
|
slot->bitmap_left = cbox.xMin >> 6;
|
||||||
|
@ -152,10 +183,13 @@
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef FT_CONFIG_OPTION_NO_STD_RASTER
|
#ifndef FT_CONFIG_OPTION_NO_STD_RASTER
|
||||||
|
|
||||||
|
|
||||||
#include <ftraster.h>
|
#include <ftraster.h>
|
||||||
|
|
||||||
|
|
||||||
const FT_Renderer_Class ft_standard_renderer_class =
|
const FT_Renderer_Class ft_standard_renderer_class =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -163,8 +197,8 @@
|
||||||
sizeof ( FT_RendererRec ),
|
sizeof ( FT_RendererRec ),
|
||||||
|
|
||||||
"standard renderer",
|
"standard renderer",
|
||||||
0x10000,
|
0x10000L,
|
||||||
0x20000,
|
0x20000L,
|
||||||
|
|
||||||
0, /* module specific interface */
|
0, /* module specific interface */
|
||||||
|
|
||||||
|
@ -183,12 +217,16 @@
|
||||||
(FT_Raster_Funcs*) &ft_standard_raster
|
(FT_Raster_Funcs*) &ft_standard_raster
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* !FT_CONFIG_OPTION_NO_STD_RASTER */
|
#endif /* !FT_CONFIG_OPTION_NO_STD_RASTER */
|
||||||
|
|
||||||
|
|
||||||
#ifndef FT_CONFIG_OPTION_NO_SMOOTH_RASTER
|
#ifndef FT_CONFIG_OPTION_NO_SMOOTH_RASTER
|
||||||
|
|
||||||
|
|
||||||
#include <ftgrays.h>
|
#include <ftgrays.h>
|
||||||
|
|
||||||
|
|
||||||
const FT_Renderer_Class ft_smooth_renderer_class =
|
const FT_Renderer_Class ft_smooth_renderer_class =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -196,8 +234,8 @@
|
||||||
sizeof ( FT_RendererRec ),
|
sizeof ( FT_RendererRec ),
|
||||||
|
|
||||||
"smooth renderer",
|
"smooth renderer",
|
||||||
0x10000,
|
0x10000L,
|
||||||
0x20000,
|
0x20000L,
|
||||||
|
|
||||||
0, /* module specific interface */
|
0, /* module specific interface */
|
||||||
|
|
||||||
|
@ -216,4 +254,8 @@
|
||||||
(FT_Raster_Funcs*) &ft_grays_raster
|
(FT_Raster_Funcs*) &ft_grays_raster
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* !FT_CONFIG_OPTION_NO_SMOOTH_RASTER */
|
#endif /* !FT_CONFIG_OPTION_NO_SMOOTH_RASTER */
|
||||||
|
|
||||||
|
|
||||||
|
/* END */
|
||||||
|
|
|
@ -1,8 +1,28 @@
|
||||||
|
/***************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* renderer.h */
|
||||||
|
/* */
|
||||||
|
/* FreeType renderer module (specification). */
|
||||||
|
/* */
|
||||||
|
/* Copyright 2000 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 RENDERER_H
|
#ifndef RENDERER_H
|
||||||
#define RENDERER_H
|
#define RENDERER_H
|
||||||
|
|
||||||
|
|
||||||
#include <freetype/ftrender.h>
|
#include <freetype/ftrender.h>
|
||||||
|
|
||||||
|
|
||||||
#ifndef FT_CONFIG_OPTION_NO_STD_RASTER
|
#ifndef FT_CONFIG_OPTION_NO_STD_RASTER
|
||||||
FT_EXPORT_VAR( const FT_Renderer_Class ) ft_std_renderer_class;
|
FT_EXPORT_VAR( const FT_Renderer_Class ) ft_std_renderer_class;
|
||||||
#endif
|
#endif
|
||||||
|
@ -11,4 +31,8 @@
|
||||||
FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_renderer_class;
|
FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_renderer_class;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif /* RENDERER_H */
|
#endif /* RENDERER_H */
|
||||||
|
|
||||||
|
|
||||||
|
/* END */
|
||||||
|
|
|
@ -29,18 +29,18 @@ REND_CFLAGS := $(REND_INCLUDE:%=$I%)
|
||||||
REND_COMPILE := $(FT_COMPILE) $(REND_CFLAGS)
|
REND_COMPILE := $(FT_COMPILE) $(REND_CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
# REND driver sources (i.e., C files)
|
# renderer driver sources (i.e., C files)
|
||||||
#
|
#
|
||||||
REND_DRV_SRC := $(REND_DIR_)ftraster.c \
|
REND_DRV_SRC := $(REND_DIR_)ftraster.c \
|
||||||
$(REND_DIR_)ftgrays.c \
|
$(REND_DIR_)ftgrays.c \
|
||||||
$(REND_DIR_)renderer.c
|
$(REND_DIR_)renderer.c
|
||||||
|
|
||||||
# REND driver headers
|
# renderer driver headers
|
||||||
#
|
#
|
||||||
REND_DRV_H := $(REND_DRV_SRC:%c=%h)
|
REND_DRV_H := $(REND_DRV_SRC:%c=%h)
|
||||||
|
|
||||||
|
|
||||||
# REND driver object(s)
|
# renderer driver object(s)
|
||||||
#
|
#
|
||||||
# REND_DRV_OBJ_M is used during `multi' builds.
|
# REND_DRV_OBJ_M is used during `multi' builds.
|
||||||
# REND_DRV_OBJ_S is used during `single' builds.
|
# REND_DRV_OBJ_S is used during `single' builds.
|
||||||
|
@ -48,19 +48,19 @@ REND_DRV_H := $(REND_DRV_SRC:%c=%h)
|
||||||
REND_DRV_OBJ_M := $(REND_DRV_SRC:$(REND_DIR_)%.c=$(OBJ_)%.$O)
|
REND_DRV_OBJ_M := $(REND_DRV_SRC:$(REND_DIR_)%.c=$(OBJ_)%.$O)
|
||||||
REND_DRV_OBJ_S := $(REND_DRV_OBJ_M)
|
REND_DRV_OBJ_S := $(REND_DRV_OBJ_M)
|
||||||
|
|
||||||
# REND driver source file for single build
|
# renderer driver source file for single build
|
||||||
#
|
#
|
||||||
#REND_DRV_SRC_S := $(REND_DIR_)renderer.c
|
#REND_DRV_SRC_S := $(REND_DIR_)renderer.c
|
||||||
|
|
||||||
|
|
||||||
# REND driver - single object
|
# renderer driver - single object
|
||||||
#
|
#
|
||||||
#$(REND_DRV_OBJ_S): $(REND_DRV_SRC_S) $(REND_DRV_SRC) \
|
#$(REND_DRV_OBJ_S): $(REND_DRV_SRC_S) $(REND_DRV_SRC) \
|
||||||
# $(FREETYPE_H) $(REND_DRV_H)
|
# $(FREETYPE_H) $(REND_DRV_H)
|
||||||
# $(REND_COMPILE) $T$@ $(REND_DRV_SRC_S)
|
# $(REND_COMPILE) $T$@ $(REND_DRV_SRC_S)
|
||||||
|
|
||||||
|
|
||||||
# REND driver - multiple objects
|
# renderer driver - multiple objects
|
||||||
#
|
#
|
||||||
$(OBJ_)%.$O: $(REND_DIR_)%.c $(FREETYPE_H) $(REND_DRV_H)
|
$(OBJ_)%.$O: $(REND_DIR_)%.c $(FREETYPE_H) $(REND_DRV_H)
|
||||||
$(REND_COMPILE) $T$@ $<
|
$(REND_COMPILE) $T$@ $<
|
||||||
|
|
|
@ -1,24 +1,20 @@
|
||||||
/*******************************************************************
|
/***************************************************************************/
|
||||||
*
|
/* */
|
||||||
* t1hinter.h 1.2
|
/* t1hinter.h */
|
||||||
*
|
/* */
|
||||||
* Type1 hinter.
|
/* Type 1 hinter (body). */
|
||||||
*
|
/* */
|
||||||
* Copyright 1996-1999 by
|
/* Copyright 1996-2000 by */
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||||
*
|
/* */
|
||||||
* This file is part of the FreeType project, and may only be used
|
/* This file is part of the FreeType project, and may only be used, */
|
||||||
* modified and distributed under the terms of the FreeType project
|
/* modified, and distributed under the terms of the FreeType project */
|
||||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||||
* this file you indicate that you have read the license and
|
/* this file you indicate that you have read the license and */
|
||||||
* understand and accept it fully.
|
/* understand and accept it fully. */
|
||||||
*
|
/* */
|
||||||
*
|
/***************************************************************************/
|
||||||
* The Hinter is in charge of fitting th scaled outline to the
|
|
||||||
* pixel grid in order to considerably improve the quality of
|
|
||||||
* the Type 1 font driver's output..
|
|
||||||
*
|
|
||||||
******************************************************************/
|
|
||||||
|
|
||||||
#ifndef T1HINTER_H
|
#ifndef T1HINTER_H
|
||||||
#define T1HINTER_H
|
#define T1HINTER_H
|
||||||
|
@ -31,28 +27,29 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/*************************************************************************/
|
||||||
*
|
/* */
|
||||||
* <Struct>
|
/* <Struct> */
|
||||||
* T1_Snap_Zone
|
/* T1_Snap_Zone */
|
||||||
*
|
/* */
|
||||||
* <Description>
|
/* <Description> */
|
||||||
* A "snap zone" is used to model either a blue zone or a stem width
|
/* A `snap zone' is used to model either a blue zone or a stem width */
|
||||||
* at a given character size. It is made of a minimum and maximum
|
/* at a given character size. It is made of a minimum and maximum */
|
||||||
* edge, defined in 26.6 pixels, as well as one "original" and
|
/* edge, defined in 26.6 pixels, as well as an `original' and */
|
||||||
* "scaled" position.
|
/* `scaled' position. */
|
||||||
*
|
/* */
|
||||||
* the position corresponds to the stem width (for stem snap zones)
|
/* The position corresponds to the stem width (for stem snap zones) */
|
||||||
* or to the blue position (for blue zones)
|
/* or to the blue position (for blue zones). */
|
||||||
*
|
/* */
|
||||||
* <Fields>
|
/* <Fields> */
|
||||||
* orus :: original position in font units
|
/* orus :: The original position in font units. */
|
||||||
* pix :: current position in sub-pixel units
|
/* */
|
||||||
* min :: minimum boundary in sub-pixel units
|
/* pix :: The current position in sub-pixel units. */
|
||||||
* max :: maximim boundary in sub-pixel units
|
/* */
|
||||||
*
|
/* min :: The minimum boundary in sub-pixel units. */
|
||||||
************************************************************************/
|
/* */
|
||||||
|
/* max :: The maximum boundary in sub-pixel units. */
|
||||||
|
/* */
|
||||||
typedef struct T1_Snap_Zone_
|
typedef struct T1_Snap_Zone_
|
||||||
{
|
{
|
||||||
FT_Pos orus;
|
FT_Pos orus;
|
||||||
|
@ -63,20 +60,19 @@
|
||||||
} T1_Snap_Zone;
|
} T1_Snap_Zone;
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/*************************************************************************/
|
||||||
*
|
/* */
|
||||||
* <Struct>
|
/* <Struct> */
|
||||||
* T1_Edge
|
/* T1_Edge */
|
||||||
*
|
/* */
|
||||||
* <Description>
|
/* <Description> */
|
||||||
* A very simply structure used to model an stem edge
|
/* A very simple structure used to model a stem edge. */
|
||||||
*
|
/* */
|
||||||
* <Fields>
|
/* <Fields> */
|
||||||
* orus :: original edge position in font units
|
/* orus :: The original edge position in font units. */
|
||||||
* pix :: scaled edge position in sub-pixel units
|
/* */
|
||||||
*
|
/* pix :: The scaled edge position in sub-pixel units. */
|
||||||
************************************************************************/
|
/* */
|
||||||
|
|
||||||
typedef struct T1_Edge_
|
typedef struct T1_Edge_
|
||||||
{
|
{
|
||||||
FT_Pos orus;
|
FT_Pos orus;
|
||||||
|
@ -85,25 +81,25 @@
|
||||||
} T1_Edge;
|
} T1_Edge;
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/*************************************************************************/
|
||||||
*
|
/* */
|
||||||
* <Struct>
|
/* <Struct> */
|
||||||
* T1_Stem_Hint
|
/* T1_Stem_Hint */
|
||||||
*
|
/* */
|
||||||
* <Description>
|
/* <Description> */
|
||||||
* A simple structure used to model a stem hint
|
/* A simple structure used to model a stem hint. */
|
||||||
*
|
/* */
|
||||||
* <Fields>
|
/* <Fields> */
|
||||||
* min_edge :: the hint's minimum edge
|
/* min_edge :: The hint's minimum edge. */
|
||||||
* max_edge :: the hint's maximum edge
|
/* */
|
||||||
* hint_flags :: some flags describing the stem properties
|
/* max_edge :: The hint's maximum edge. */
|
||||||
*
|
/* */
|
||||||
* <Note>
|
/* hint_flags :: Some flags describing the stem properties. */
|
||||||
* the min and max edges of a ghost stem have the same position,
|
/* */
|
||||||
* even if they're coded in a weird way in the charstrings
|
/* <Note> */
|
||||||
*
|
/* The min and max edges of a ghost stem have the same position, */
|
||||||
************************************************************************/
|
/* even if they are coded in a weird way in the charstrings. */
|
||||||
|
/* */
|
||||||
typedef struct T1_Stem_Hint_
|
typedef struct T1_Stem_Hint_
|
||||||
{
|
{
|
||||||
T1_Edge min_edge;
|
T1_Edge min_edge;
|
||||||
|
@ -114,9 +110,8 @@
|
||||||
|
|
||||||
|
|
||||||
#define T1_HINT_FLAG_ACTIVE 1 /* indicates an active stem */
|
#define T1_HINT_FLAG_ACTIVE 1 /* indicates an active stem */
|
||||||
#define T1_HINT_FLAG_MIN_BORDER 2 /* unused for now.. */
|
#define T1_HINT_FLAG_MIN_BORDER 2 /* unused for now */
|
||||||
#define T1_HINT_FLAG_MAX_BORDER 4 /* unused for now.. */
|
#define T1_HINT_FLAG_MAX_BORDER 4 /* unused for now */
|
||||||
|
|
||||||
|
|
||||||
/* hinter's configuration constants */
|
/* hinter's configuration constants */
|
||||||
#define T1_HINTER_MAX_BLUES 24 /* maximum number of blue zones */
|
#define T1_HINTER_MAX_BLUES 24 /* maximum number of blue zones */
|
||||||
|
@ -124,34 +119,35 @@
|
||||||
#define T1_HINTER_MAX_EDGES 64 /* maximum number of stem hints */
|
#define T1_HINTER_MAX_EDGES 64 /* maximum number of stem hints */
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/*************************************************************************/
|
||||||
*
|
/* */
|
||||||
* <Struct>
|
/* <Struct> */
|
||||||
* T1_Size_Hints
|
/* T1_Size_Hints */
|
||||||
*
|
/* */
|
||||||
* <Description>
|
/* <Description> */
|
||||||
* A structure used to model the hinting information related to
|
/* A structure used to model the hinting information related to a size */
|
||||||
* a size object
|
/* object. */
|
||||||
*
|
/* */
|
||||||
* <Fields>
|
/* <Fields> */
|
||||||
* supress_overshoots :: a boolean flag to tell when overshoot
|
/* supress_overshoots :: A boolean flag to tell whether overshoot */
|
||||||
* supression should occur.
|
/* supression should occur. */
|
||||||
*
|
/* */
|
||||||
* num_blue_zones :: the total number of blue zones (top+bottom)
|
/* num_blue_zones :: The total number of blue zones (top+bottom). */
|
||||||
* num_bottom_zones :: the number of bottom zones
|
/* */
|
||||||
*
|
/* num_bottom_zones :: The number of bottom zones. */
|
||||||
* blue_zones :: the blue zones table. bottom zones are
|
/* */
|
||||||
* stored first in the table, followed by
|
/* blue_zones :: The blue zones table. Bottom zones are */
|
||||||
* all top zones
|
/* stored first in the table, followed by all */
|
||||||
*
|
/* top zones. */
|
||||||
* num_stem_snapH :: number of horizontal stem snap zones
|
/* */
|
||||||
* stem_snapH :: horizontal stem snap zones
|
/* num_snap_widths :: The number of horizontal stem snap zones. */
|
||||||
*
|
/* */
|
||||||
* num_stem_snapV :: number of vertical stem snap zones
|
/* snap_widths :: An array of horizontal stem snap zones. */
|
||||||
* stem_snapV :: vertical stem snap zones
|
/* */
|
||||||
*
|
/* num_snap_heights :: The number of vertical stem snap zones. */
|
||||||
************************************************************************/
|
/* */
|
||||||
|
/* snap_heights :: An array of vertical stem snap zones. */
|
||||||
|
/* */
|
||||||
struct T1_Size_Hints_
|
struct T1_Size_Hints_
|
||||||
{
|
{
|
||||||
FT_Bool supress_overshoots;
|
FT_Bool supress_overshoots;
|
||||||
|
@ -168,28 +164,27 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
/************************************************************************
|
/* */
|
||||||
*
|
/* <Struct> */
|
||||||
* <Struct>
|
/* T1_Stem_Table */
|
||||||
* T1_Stem_Table
|
/* */
|
||||||
*
|
/* <Description> */
|
||||||
* <Description>
|
/* A simple structure used to model a set of stem hints in a single */
|
||||||
* A simple structure used to model a set of stem hints in a
|
/* direction during the loading of a given glyph outline. Not all */
|
||||||
* single direction during the loading of a given glyph outline.
|
/* stem hints are active at a time. Moreover, stems must be sorted */
|
||||||
* Not all stem hints are active at a time. Moreover, stems must
|
/* regularly. */
|
||||||
* be sorted regularly
|
/* */
|
||||||
*
|
/* <Fields> */
|
||||||
* <Fields>
|
/* num_stems :: The total number of stems in the table. */
|
||||||
* num_stems :: total number of stems in table
|
/* */
|
||||||
* num_active :: number of active stems in table
|
/* num_active :: The number of active stems in the table. */
|
||||||
*
|
/* */
|
||||||
* stems :: the table of all stems
|
/* stems :: A table of all stems. */
|
||||||
* sort :: a table of indices into the stems table, used
|
/* */
|
||||||
* to keep a sorted list of the active stems
|
/* sort :: A table of indices into the stems table, used to */
|
||||||
*
|
/* keep a sorted list of the active stems. */
|
||||||
************************************************************************/
|
/* */
|
||||||
|
|
||||||
typedef struct T1_Stem_Table_
|
typedef struct T1_Stem_Table_
|
||||||
{
|
{
|
||||||
FT_Int num_stems;
|
FT_Int num_stems;
|
||||||
|
@ -201,22 +196,19 @@
|
||||||
} T1_Stem_Table;
|
} T1_Stem_Table;
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
/************************************************************************
|
/* */
|
||||||
*
|
/* <Struct> */
|
||||||
* <Struct>
|
/* T1_Glyph_Hints */
|
||||||
* T1_Glyph_Hints
|
/* */
|
||||||
*
|
/* <Description> */
|
||||||
* <Description>
|
/* A structure used to model the stem hints of a given glyph outline */
|
||||||
* A structure used to model the stem hints of a given glyph outline
|
/* during glyph loading. */
|
||||||
* during glyph loading.
|
/* */
|
||||||
*
|
/* <Fields> */
|
||||||
* <Fields>
|
/* hori_stems :: The horizontal stem hints table. */
|
||||||
* hori_stems :: horizontal stem hints table
|
/* vert_stems :: The vertical stem hints table. */
|
||||||
* vert_stems :: vertical stem hints table
|
/* */
|
||||||
*
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
struct T1_Glyph_Hints_
|
struct T1_Glyph_Hints_
|
||||||
{
|
{
|
||||||
T1_Stem_Table hori_stems;
|
T1_Stem_Table hori_stems;
|
||||||
|
@ -224,157 +216,48 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
/************************************************************************
|
/* */
|
||||||
*
|
/* <Data> */
|
||||||
* <Data>
|
/* t1_hinter_funcs */
|
||||||
* t1_hinter_funcs
|
/* */
|
||||||
*
|
/* <Description> */
|
||||||
* <Description>
|
/* A table containing the address of various functions used during */
|
||||||
* A table containing the address of various functions used during
|
/* the loading of an hinted scaled outline. */
|
||||||
* the loading of an hinted scaled outline
|
/* */
|
||||||
*
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
LOCAL_DEF
|
LOCAL_DEF
|
||||||
const T1_Hinter_Funcs t1_hinter_funcs;
|
const T1_Hinter_Funcs t1_hinter_funcs;
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
*
|
|
||||||
* <Function>
|
|
||||||
* T1_New_Size_Hinter
|
|
||||||
*
|
|
||||||
* <Description>
|
|
||||||
* Allocates a new hinter structure for a given size object
|
|
||||||
*
|
|
||||||
* <Input>
|
|
||||||
* size :: handle to target size object
|
|
||||||
*
|
|
||||||
* <Return>
|
|
||||||
* Error code. 0 means success
|
|
||||||
*
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
LOCAL_DEF
|
LOCAL_DEF
|
||||||
FT_Error T1_New_Size_Hinter( T1_Size size );
|
FT_Error T1_New_Size_Hinter( T1_Size size );
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
*
|
|
||||||
* <Function>
|
|
||||||
* T1_Done_Size_Hinter
|
|
||||||
*
|
|
||||||
* <Description>
|
|
||||||
* Releases a given size object's hinter structure
|
|
||||||
*
|
|
||||||
* <Input>
|
|
||||||
* size :: handle to target size object
|
|
||||||
*
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
LOCAL_DEF
|
LOCAL_DEF
|
||||||
void T1_Done_Size_Hinter( T1_Size size );
|
void T1_Done_Size_Hinter( T1_Size size );
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
*
|
|
||||||
* <Function>
|
|
||||||
* T1_Reset_Size_Hinter
|
|
||||||
*
|
|
||||||
* <Description>
|
|
||||||
* Recomputes hinting information when a given size object has
|
|
||||||
* changed its resolutions/char sizes/pixel sizes
|
|
||||||
*
|
|
||||||
* <Input>
|
|
||||||
* size :: handle to size object
|
|
||||||
*
|
|
||||||
* <Return>
|
|
||||||
* Error code. 0 means success
|
|
||||||
*
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
LOCAL_DEF
|
LOCAL_DEF
|
||||||
FT_Error T1_Reset_Size_Hinter( T1_Size size );
|
FT_Error T1_Reset_Size_Hinter( T1_Size size );
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
*
|
|
||||||
* <Function>
|
|
||||||
* T1_New_Glyph_Hinter
|
|
||||||
*
|
|
||||||
* <Description>
|
|
||||||
* Allocates a new hinter structure for a given glyph slot
|
|
||||||
*
|
|
||||||
* <Input>
|
|
||||||
* glyph :: handle to target glyph slot
|
|
||||||
*
|
|
||||||
* <Return>
|
|
||||||
* Error code. 0 means success
|
|
||||||
*
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
LOCAL_DEF
|
LOCAL_DEF
|
||||||
FT_Error T1_New_Glyph_Hinter( T1_GlyphSlot glyph );
|
FT_Error T1_New_Glyph_Hinter( T1_GlyphSlot glyph );
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
*
|
|
||||||
* <Function>
|
|
||||||
* T1_Done_Glyph_Hinter
|
|
||||||
*
|
|
||||||
* <Description>
|
|
||||||
* Releases a given glyph slot's hinter structure
|
|
||||||
*
|
|
||||||
* <Input>
|
|
||||||
* glyph :: handle to glyph slot
|
|
||||||
*
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
LOCAL_DEF
|
LOCAL_DEF
|
||||||
void T1_Done_Glyph_Hinter( T1_GlyphSlot glyph );
|
void T1_Done_Glyph_Hinter( T1_GlyphSlot glyph );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
*
|
|
||||||
* <Function>
|
|
||||||
* T1_Hint_Points
|
|
||||||
*
|
|
||||||
* <Description>
|
|
||||||
* this function grid-fits several points in a given Type 1 builder
|
|
||||||
* at once.
|
|
||||||
*
|
|
||||||
* <Input>
|
|
||||||
* builder :: handle to target Type 1 builder
|
|
||||||
*
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
LOCAL_DEF
|
LOCAL_DEF
|
||||||
void T1_Hint_Points( T1_Builder* builder );
|
void T1_Hint_Points( T1_Builder* builder );
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
*
|
|
||||||
* <Function>
|
|
||||||
* T1_Hint_Stems
|
|
||||||
*
|
|
||||||
* <Description>
|
|
||||||
* This function is used to compute the location of each stem hint
|
|
||||||
* between the first and second passes of the glyph loader on the
|
|
||||||
* charstring.
|
|
||||||
*
|
|
||||||
* <Input>
|
|
||||||
* builder :: handle to target builder
|
|
||||||
*
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
LOCAL_DEF
|
LOCAL_DEF
|
||||||
void T1_Hint_Stems( T1_Builder* builder );
|
void T1_Hint_Stems( T1_Builder* builder );
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif /* T1HINTER_H */
|
#endif /* T1HINTER_H */
|
||||||
|
|
||||||
|
|
||||||
|
/* END */
|
||||||
|
|
Loading…
Reference in New Issue