2005-03-03 18:09:08 +01:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* afdummy.c */
|
|
|
|
/* */
|
|
|
|
/* Auto-fitter dummy routines to be used if no hinting should be */
|
|
|
|
/* performed (body). */
|
|
|
|
/* */
|
2013-03-14 11:21:17 +01:00
|
|
|
/* Copyright 2003-2005, 2011, 2013 by */
|
2005-03-03 18:09:08 +01: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. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
|
2004-03-27 09:43:17 +01:00
|
|
|
#include "afdummy.h"
|
2004-06-09 22:18:35 +02:00
|
|
|
#include "afhints.h"
|
2011-02-03 19:47:13 +01:00
|
|
|
#include "aferrors.h"
|
2004-03-27 09:43:17 +01:00
|
|
|
|
|
|
|
|
|
|
|
static FT_Error
|
2013-12-18 12:59:35 +01:00
|
|
|
af_dummy_hints_init( AF_GlyphHints hints,
|
|
|
|
AF_StyleMetrics metrics )
|
2004-03-27 09:43:17 +01:00
|
|
|
{
|
2013-08-26 09:22:27 +02:00
|
|
|
af_glyph_hints_rescale( hints, metrics );
|
|
|
|
|
|
|
|
hints->x_scale = metrics->scaler.x_scale;
|
|
|
|
hints->y_scale = metrics->scaler.y_scale;
|
|
|
|
hints->x_delta = metrics->scaler.x_delta;
|
|
|
|
hints->y_delta = metrics->scaler.y_delta;
|
|
|
|
|
2013-03-14 11:21:17 +01:00
|
|
|
return FT_Err_Ok;
|
2004-03-27 09:43:17 +01:00
|
|
|
}
|
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
|
2004-03-27 09:43:17 +01:00
|
|
|
static FT_Error
|
|
|
|
af_dummy_hints_apply( AF_GlyphHints hints,
|
|
|
|
FT_Outline* outline )
|
|
|
|
{
|
2013-08-26 09:22:27 +02:00
|
|
|
FT_Error error;
|
2004-06-04 19:41:59 +02:00
|
|
|
|
2013-08-26 09:22:27 +02:00
|
|
|
|
|
|
|
error = af_glyph_hints_reload( hints, outline );
|
|
|
|
if ( !error )
|
|
|
|
af_glyph_hints_save( hints, outline );
|
|
|
|
|
|
|
|
return error;
|
2004-03-27 09:43:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-31 22:49:29 +02:00
|
|
|
AF_DEFINE_WRITING_SYSTEM_CLASS(
|
|
|
|
af_dummy_writing_system_class,
|
|
|
|
|
|
|
|
AF_WRITING_SYSTEM_DUMMY,
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2013-12-18 12:59:35 +01:00
|
|
|
sizeof ( AF_StyleMetricsRec ),
|
2004-03-27 09:43:17 +01:00
|
|
|
|
2013-12-17 13:29:53 +01:00
|
|
|
(AF_WritingSystem_InitMetricsFunc) NULL,
|
|
|
|
(AF_WritingSystem_ScaleMetricsFunc)NULL,
|
|
|
|
(AF_WritingSystem_DoneMetricsFunc) NULL,
|
2005-03-03 18:09:08 +01:00
|
|
|
|
2013-12-17 13:29:53 +01:00
|
|
|
(AF_WritingSystem_InitHintsFunc) af_dummy_hints_init,
|
|
|
|
(AF_WritingSystem_ApplyHintsFunc) af_dummy_hints_apply
|
2009-04-05 17:23:38 +02:00
|
|
|
)
|
2005-03-02 12:24:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|