8b84c9d19f
This fixes FreeDesktop bug #21197. * src/autofit/afglobal.c (AF_DIGIT): New macro. (af_face_globals_compute_script_coverage): Mark ASCII digits in `glyph_scripts' array. (af_face_globals_get_metrics): Updated. (af_face_globals_is_digit): New function. * src/autofit/afglobal.h: Updated. (AF_ScriptMetricsRec): Add `digits_have_same_width' flag. * src/autofit/aflatin.c: Include FT_ADVANCES_H. (af_latin_metrics_check_digits): New function. (af_latin_metrics_init): Use it. * src/autofit/aflatin.h: Updated. * src/autofit/afcjk.c (af_cjk_metrics_init): Updated. * src/autofit/aflatin2.c: Similar changes as with aflatin.c. * src/autofit/afloader.c (af_loader_load_g): Test digit width. * docs/CHANGES: Document it.
72 lines
2.7 KiB
C
72 lines
2.7 KiB
C
/***************************************************************************/
|
|
/* */
|
|
/* afglobal.h */
|
|
/* */
|
|
/* Auto-fitter routines to compute global hinting values */
|
|
/* (specification). */
|
|
/* */
|
|
/* Copyright 2003, 2004, 2005, 2007, 2009 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 __AF_GLOBAL_H__
|
|
#define __AF_GLOBAL_H__
|
|
|
|
|
|
#include "aftypes.h"
|
|
|
|
|
|
FT_BEGIN_HEADER
|
|
|
|
|
|
/************************************************************************/
|
|
/************************************************************************/
|
|
/***** *****/
|
|
/***** F A C E G L O B A L S *****/
|
|
/***** *****/
|
|
/************************************************************************/
|
|
/************************************************************************/
|
|
|
|
|
|
/*
|
|
* model the global hints data for a given face, decomposed into
|
|
* script-specific items
|
|
*/
|
|
typedef struct AF_FaceGlobalsRec_* AF_FaceGlobals;
|
|
|
|
|
|
FT_LOCAL( FT_Error )
|
|
af_face_globals_new( FT_Face face,
|
|
AF_FaceGlobals *aglobals );
|
|
|
|
FT_LOCAL( FT_Error )
|
|
af_face_globals_get_metrics( AF_FaceGlobals globals,
|
|
FT_UInt gindex,
|
|
FT_UInt options,
|
|
AF_ScriptMetrics *ametrics );
|
|
|
|
FT_LOCAL( void )
|
|
af_face_globals_free( AF_FaceGlobals globals );
|
|
|
|
FT_LOCAL_DEF( FT_Bool )
|
|
af_face_globals_is_digit( AF_FaceGlobals globals,
|
|
FT_UInt gindex );
|
|
|
|
/* */
|
|
|
|
|
|
FT_END_HEADER
|
|
|
|
#endif /* __AF_GLOBALS_H__ */
|
|
|
|
|
|
/* END */
|