2000-07-19 22:02:14 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* ahmodule.c */
|
|
|
|
/* */
|
2000-07-26 16:11:15 +02:00
|
|
|
/* Auto-hinting module implementation (declaration). */
|
2000-07-19 22:02:14 +02:00
|
|
|
/* */
|
2000-07-26 16:11:15 +02:00
|
|
|
/* Copyright 2000 Catharon Productions Inc. */
|
2000-07-19 22:02:14 +02:00
|
|
|
/* Author: David Turner */
|
|
|
|
/* */
|
|
|
|
/* This file is part of the Catharon Typography Project and shall only */
|
|
|
|
/* be used, modified, and distributed under the terms of the Catharon */
|
|
|
|
/* Open Source License that should come with this file under the name */
|
2000-07-26 16:11:15 +02:00
|
|
|
/* `CatharonLicense.txt'. By continuing to use, modify, or distribute */
|
2000-07-19 22:02:14 +02:00
|
|
|
/* this file you indicate that you have read the license and */
|
|
|
|
/* understand and accept it fully. */
|
|
|
|
/* */
|
2000-07-26 16:11:15 +02:00
|
|
|
/* Note that this license is compatible with the FreeType license. */
|
2000-07-19 22:02:14 +02:00
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
2000-07-26 16:11:15 +02:00
|
|
|
|
2000-12-08 03:42:29 +01:00
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_MODULE_H
|
|
|
|
#include FT_SOURCE_FILE(autohint,ahhint.h)
|
2000-07-19 22:02:14 +02:00
|
|
|
|
|
|
|
|
2000-07-26 16:11:15 +02:00
|
|
|
typedef struct FT_AutoHinterRec_
|
2000-07-19 22:02:14 +02:00
|
|
|
{
|
2000-07-26 16:11:15 +02:00
|
|
|
FT_ModuleRec root;
|
|
|
|
AH_Hinter* hinter;
|
2000-07-19 22:02:14 +02:00
|
|
|
|
|
|
|
} FT_AutoHinterRec;
|
|
|
|
|
|
|
|
|
2000-11-04 02:55:49 +01:00
|
|
|
FT_CALLBACK_DEF
|
2000-07-19 22:02:14 +02:00
|
|
|
FT_Error ft_autohinter_init( FT_AutoHinter module )
|
|
|
|
{
|
|
|
|
return ah_hinter_new( module->root.library, &module->hinter );
|
|
|
|
}
|
|
|
|
|
2000-07-26 16:11:15 +02:00
|
|
|
|
2000-11-04 02:55:49 +01:00
|
|
|
FT_CALLBACK_DEF
|
2000-07-26 16:11:15 +02:00
|
|
|
void ft_autohinter_done( FT_AutoHinter module )
|
2000-07-19 22:02:14 +02:00
|
|
|
{
|
|
|
|
ah_hinter_done( module->hinter );
|
|
|
|
}
|
|
|
|
|
2000-07-26 16:11:15 +02:00
|
|
|
|
2000-11-04 02:55:49 +01:00
|
|
|
FT_CALLBACK_DEF
|
2000-07-19 22:02:14 +02:00
|
|
|
FT_Error ft_autohinter_load( FT_AutoHinter module,
|
|
|
|
FT_GlyphSlot slot,
|
2000-07-26 16:11:15 +02:00
|
|
|
FT_Size size,
|
|
|
|
FT_UInt glyph_index,
|
|
|
|
FT_ULong load_flags )
|
2000-07-19 22:02:14 +02:00
|
|
|
{
|
|
|
|
return ah_hinter_load_glyph( module->hinter,
|
|
|
|
slot, size, glyph_index, load_flags );
|
|
|
|
}
|
|
|
|
|
2000-07-26 16:11:15 +02:00
|
|
|
|
2000-11-04 02:55:49 +01:00
|
|
|
FT_CALLBACK_DEF
|
2000-07-19 22:02:14 +02:00
|
|
|
void ft_autohinter_reset( FT_AutoHinter module,
|
|
|
|
FT_Face face )
|
|
|
|
{
|
2000-07-26 16:11:15 +02:00
|
|
|
UNUSED( module );
|
|
|
|
|
|
|
|
if ( face->autohint.data )
|
|
|
|
ah_hinter_done_face_globals( (AH_Face_Globals*)(face->autohint.data) );
|
2000-07-19 22:02:14 +02:00
|
|
|
}
|
|
|
|
|
2000-07-26 16:11:15 +02:00
|
|
|
|
2000-11-04 02:55:49 +01:00
|
|
|
FT_CALLBACK_DEF
|
2000-07-19 22:02:14 +02:00
|
|
|
void ft_autohinter_get_globals( FT_AutoHinter module,
|
|
|
|
FT_Face face,
|
2000-07-26 16:11:15 +02:00
|
|
|
void** global_hints,
|
|
|
|
long* global_len )
|
2000-07-19 22:02:14 +02:00
|
|
|
{
|
|
|
|
ah_hinter_get_global_hints( module->hinter, face,
|
|
|
|
global_hints, global_len );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-11-04 02:55:49 +01:00
|
|
|
FT_CALLBACK_DEF
|
2000-07-19 22:02:14 +02:00
|
|
|
void ft_autohinter_done_globals( FT_AutoHinter module,
|
|
|
|
void* global_hints )
|
|
|
|
{
|
|
|
|
ah_hinter_done_global_hints( module->hinter, global_hints );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-11-04 02:55:49 +01:00
|
|
|
FT_CALLBACK_TABLE_DEF
|
2000-07-19 22:02:14 +02:00
|
|
|
const FT_AutoHinter_Interface autohinter_interface =
|
|
|
|
{
|
|
|
|
ft_autohinter_reset,
|
|
|
|
ft_autohinter_load,
|
|
|
|
ft_autohinter_get_globals,
|
|
|
|
ft_autohinter_done_globals
|
|
|
|
};
|
|
|
|
|
2000-07-26 16:11:15 +02:00
|
|
|
|
2000-11-04 02:55:49 +01:00
|
|
|
FT_CALLBACK_TABLE_DEF
|
|
|
|
const FT_Module_Class autohint_module_class =
|
2000-07-19 22:02:14 +02:00
|
|
|
{
|
|
|
|
ft_module_hinter,
|
2000-07-26 16:11:15 +02:00
|
|
|
sizeof ( FT_AutoHinterRec ),
|
2000-07-19 22:02:14 +02:00
|
|
|
|
|
|
|
"autohinter",
|
2000-07-26 16:11:15 +02:00
|
|
|
0x10000L, /* version 1.0 of the autohinter */
|
|
|
|
0x20000L, /* requires FreeType 2.0 or above */
|
2000-07-19 22:02:14 +02:00
|
|
|
|
|
|
|
(const void*)&autohinter_interface,
|
|
|
|
|
2000-07-26 16:11:15 +02:00
|
|
|
(FT_Module_Constructor)ft_autohinter_init,
|
|
|
|
(FT_Module_Destructor) ft_autohinter_done,
|
|
|
|
(FT_Module_Requester) 0
|
2000-07-19 22:02:14 +02:00
|
|
|
};
|
2000-07-26 16:11:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|