[GSoC] src/*.*: Convert block comments to `light' style.
This monster commit was created by applying Nikhil's scripts `docconverter.py' and `markify.py' to all C header and source files, followed up by minor manual clean-up. No change in functionality, of course. I used commit f7419907bc6044b9b7057f9789866426c804ba82 from https://github.com/nikramakrishnan/freetype-docs.git.
This commit is contained in:
parent
ae24803410
commit
9ac9060df0
|
@ -1,28 +1,28 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afangles.c */
|
* afangles.c
|
||||||
/* */
|
*
|
||||||
/* Routines used to compute vector angles with limited accuracy */
|
* Routines used to compute vector angles with limited accuracy
|
||||||
/* and very high speed. It also contains sorting routines (body). */
|
* and very high speed. It also contains sorting routines (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "aftypes.h"
|
#include "aftypes.h"
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We are not using `af_angle_atan' anymore, but we keep the source
|
* We are not using `af_angle_atan' anymore, but we keep the source
|
||||||
* code below just in case...
|
* code below just in case...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,16 +30,16 @@
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The trick here is to realize that we don't need a very accurate angle
|
* The trick here is to realize that we don't need a very accurate angle
|
||||||
* approximation. We are going to use the result of `af_angle_atan' to
|
* approximation. We are going to use the result of `af_angle_atan' to
|
||||||
* only compare the sign of angle differences, or check whether its
|
* only compare the sign of angle differences, or check whether its
|
||||||
* magnitude is very small.
|
* magnitude is very small.
|
||||||
*
|
*
|
||||||
* The approximation
|
* The approximation
|
||||||
*
|
*
|
||||||
* dy * PI / (|dx|+|dy|)
|
* dy * PI / (|dx|+|dy|)
|
||||||
*
|
*
|
||||||
* should be enough, and much faster to compute.
|
* should be enough, and much faster to compute.
|
||||||
*/
|
*/
|
||||||
FT_LOCAL_DEF( AF_Angle )
|
FT_LOCAL_DEF( AF_Angle )
|
||||||
af_angle_atan( FT_Fixed dx,
|
af_angle_atan( FT_Fixed dx,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* afangles.h
|
* afangles.h
|
||||||
*
|
*
|
||||||
* This is a dummy file, used to please the build system. It is never
|
* This is a dummy file, used to please the build system. It is never
|
||||||
* included by the auto-fitter sources.
|
* included by the auto-fitter sources.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
/* This file has been generated by the Perl script `afblue.pl', */
|
/* This file has been generated by the Perl script `afblue.pl', */
|
||||||
/* using data from file `afblue.dat'. */
|
/* using data from file `afblue.dat'. */
|
||||||
|
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afblue.c */
|
* afblue.c
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter data for blue strings (body). */
|
* Auto-fitter data for blue strings (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2013-2018 by */
|
* Copyright 2013-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "aftypes.h"
|
#include "aftypes.h"
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afblue.c */
|
* afblue.c
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter data for blue strings (body). */
|
* Auto-fitter data for blue strings (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2013-2018 by */
|
* Copyright 2013-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "aftypes.h"
|
#include "aftypes.h"
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
/* This file has been generated by the Perl script `afblue.pl', */
|
/* This file has been generated by the Perl script `afblue.pl', */
|
||||||
/* using data from file `afblue.dat'. */
|
/* using data from file `afblue.dat'. */
|
||||||
|
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afblue.h */
|
* afblue.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter data for blue strings (specification). */
|
* Auto-fitter data for blue strings (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2013-2018 by */
|
* Copyright 2013-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef AFBLUE_H_
|
#ifndef AFBLUE_H_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afblue.h */
|
* afblue.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter data for blue strings (specification). */
|
* Auto-fitter data for blue strings (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2013-2018 by */
|
* Copyright 2013-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef AFBLUE_H_
|
#ifndef AFBLUE_H_
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afcjk.c */
|
* afcjk.c
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter hinting routines for CJK writing system (body). */
|
* Auto-fitter hinting routines for CJK writing system (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2006-2018 by */
|
* Copyright 2006-2018 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 algorithm is based on akito's autohint patch, archived at
|
* The algorithm is based on akito's autohint patch, archived at
|
||||||
*
|
*
|
||||||
* https://web.archive.org/web/20051219160454/http://www.kde.gr.jp:80/~akito/patch/freetype2/2.1.7/
|
* https://web.archive.org/web/20051219160454/http://www.kde.gr.jp:80/~akito/patch/freetype2/2.1.7/
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -43,12 +43,12 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_afcjk
|
#define FT_COMPONENT trace_afcjk
|
||||||
|
|
||||||
|
@ -198,10 +198,10 @@
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We assume that the glyphs selected for the stem width
|
* We assume that the glyphs selected for the stem width
|
||||||
* computation are `featureless' enough so that the linking
|
* computation are `featureless' enough so that the linking
|
||||||
* algorithm works fine without adjustments of its scoring
|
* algorithm works fine without adjustments of its scoring
|
||||||
* function.
|
* function.
|
||||||
*/
|
*/
|
||||||
af_latin_hints_link_segments( hints,
|
af_latin_hints_link_segments( hints,
|
||||||
0,
|
0,
|
||||||
|
@ -497,8 +497,8 @@
|
||||||
if ( num_flats == 0 && num_fills == 0 )
|
if ( num_flats == 0 && num_fills == 0 )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* we couldn't find a single glyph to compute this blue zone,
|
* we couldn't find a single glyph to compute this blue zone,
|
||||||
* we will simply ignore it then
|
* we will simply ignore it then
|
||||||
*/
|
*/
|
||||||
FT_TRACE5(( " empty\n" ));
|
FT_TRACE5(( " empty\n" ));
|
||||||
continue;
|
continue;
|
||||||
|
@ -914,11 +914,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* now compute the `serif' segments
|
* now compute the `serif' segments
|
||||||
*
|
*
|
||||||
* In Hanzi, some strokes are wider on one or both of the ends.
|
* In Hanzi, some strokes are wider on one or both of the ends.
|
||||||
* We either identify the stems on the ends as serifs or remove
|
* We either identify the stems on the ends as serifs or remove
|
||||||
* the linkage, depending on the length of the stems.
|
* the linkage, depending on the length of the stems.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1024,21 +1024,21 @@
|
||||||
scale = ( dim == AF_DIMENSION_HORZ ) ? hints->x_scale
|
scale = ( dim == AF_DIMENSION_HORZ ) ? hints->x_scale
|
||||||
: hints->y_scale;
|
: hints->y_scale;
|
||||||
|
|
||||||
/*********************************************************************/
|
/**********************************************************************
|
||||||
/* */
|
*
|
||||||
/* We begin by generating a sorted table of edges for the current */
|
* We begin by generating a sorted table of edges for the current
|
||||||
/* direction. To do so, we simply scan each segment and try to find */
|
* direction. To do so, we simply scan each segment and try to find
|
||||||
/* an edge in our table that corresponds to its position. */
|
* an edge in our table that corresponds to its position.
|
||||||
/* */
|
*
|
||||||
/* If no edge is found, we create and insert a new edge in the */
|
* If no edge is found, we create and insert a new edge in the
|
||||||
/* sorted table. Otherwise, we simply add the segment to the edge's */
|
* sorted table. Otherwise, we simply add the segment to the edge's
|
||||||
/* list which is then processed in the second step to compute the */
|
* list which is then processed in the second step to compute the
|
||||||
/* edge's properties. */
|
* edge's properties.
|
||||||
/* */
|
*
|
||||||
/* Note that the edges table is sorted along the segment/edge */
|
* Note that the edges table is sorted along the segment/edge
|
||||||
/* position. */
|
* position.
|
||||||
/* */
|
*
|
||||||
/*********************************************************************/
|
*/
|
||||||
|
|
||||||
edge_distance_threshold = FT_MulFix( laxis->edge_distance_threshold,
|
edge_distance_threshold = FT_MulFix( laxis->edge_distance_threshold,
|
||||||
scale );
|
scale );
|
||||||
|
@ -1138,17 +1138,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************/
|
/*******************************************************************
|
||||||
/* */
|
*
|
||||||
/* Good, we now compute each edge's properties according to the */
|
* Good, we now compute each edge's properties according to the
|
||||||
/* segments found on its position. Basically, these are */
|
* segments found on its position. Basically, these are
|
||||||
/* */
|
*
|
||||||
/* - the edge's main direction */
|
* - the edge's main direction
|
||||||
/* - stem edge, serif edge or both (which defaults to stem then) */
|
* - stem edge, serif edge or both (which defaults to stem then)
|
||||||
/* - rounded edge, straight or both (which defaults to straight) */
|
* - rounded edge, straight or both (which defaults to straight)
|
||||||
/* - link for edge */
|
* - link for edge
|
||||||
/* */
|
*
|
||||||
/******************************************************************/
|
*/
|
||||||
|
|
||||||
/* first of all, set the `edge' field in each segment -- this is */
|
/* first of all, set the `edge' field in each segment -- this is */
|
||||||
/* required in order to compute edge links */
|
/* required in order to compute edge links */
|
||||||
|
@ -1388,8 +1388,8 @@
|
||||||
af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );
|
af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* correct x_scale and y_scale when needed, since they may have
|
* correct x_scale and y_scale when needed, since they may have
|
||||||
* been modified af_cjk_scale_dim above
|
* been modified af_cjk_scale_dim above
|
||||||
*/
|
*/
|
||||||
hints->x_scale = metrics->axis[AF_DIMENSION_HORZ].scale;
|
hints->x_scale = metrics->axis[AF_DIMENSION_HORZ].scale;
|
||||||
hints->x_delta = metrics->axis[AF_DIMENSION_HORZ].delta;
|
hints->x_delta = metrics->axis[AF_DIMENSION_HORZ].delta;
|
||||||
|
@ -1408,21 +1408,21 @@
|
||||||
other_flags = 0;
|
other_flags = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We snap the width of vertical stems for the monochrome and
|
* We snap the width of vertical stems for the monochrome and
|
||||||
* horizontal LCD rendering targets only.
|
* horizontal LCD rendering targets only.
|
||||||
*/
|
*/
|
||||||
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )
|
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )
|
||||||
other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
|
other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We snap the width of horizontal stems for the monochrome and
|
* We snap the width of horizontal stems for the monochrome and
|
||||||
* vertical LCD rendering targets only.
|
* vertical LCD rendering targets only.
|
||||||
*/
|
*/
|
||||||
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )
|
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )
|
||||||
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
|
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We adjust stems to full pixels unless in `light' or `lcd' mode.
|
* We adjust stems to full pixels unless in `light' or `lcd' mode.
|
||||||
*/
|
*/
|
||||||
if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
|
if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
|
||||||
other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
|
other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
|
||||||
|
@ -2118,8 +2118,8 @@
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* now hint the remaining edges (serifs and single) in order
|
* now hint the remaining edges (serifs and single) in order
|
||||||
* to complete our processing
|
* to complete our processing
|
||||||
*/
|
*/
|
||||||
for ( edge = edges; edge < edge_limit; edge++ )
|
for ( edge = edges; edge < edge_limit; edge++ )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afcjk.h */
|
* afcjk.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter hinting routines for CJK writing system (specification). */
|
* Auto-fitter hinting routines for CJK writing system (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2006-2018 by */
|
* Copyright 2006-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef AFCJK_H_
|
#ifndef AFCJK_H_
|
||||||
|
@ -41,9 +41,9 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CJK glyphs tend to fill the square. So we have both vertical and
|
* CJK glyphs tend to fill the square. So we have both vertical and
|
||||||
* horizontal blue zones. But some glyphs have flat bounding strokes that
|
* horizontal blue zones. But some glyphs have flat bounding strokes that
|
||||||
* leave some space between neighbour glyphs.
|
* leave some space between neighbour glyphs.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define AF_CJK_IS_TOP_BLUE( b ) \
|
#define AF_CJK_IS_TOP_BLUE( b ) \
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afcover.h */
|
* afcover.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter coverages (specification only). */
|
* Auto-fitter coverages (specification only).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2013-2018 by */
|
* Copyright 2013-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* This header file can be included multiple times. */
|
/* This header file can be included multiple times. */
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afdummy.c */
|
* afdummy.c
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter dummy routines to be used if no hinting should be */
|
* Auto-fitter dummy routines to be used if no hinting should be
|
||||||
/* performed (body). */
|
* performed (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "afdummy.h"
|
#include "afdummy.h"
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afdummy.h */
|
* afdummy.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter dummy routines to be used if no hinting should be */
|
* Auto-fitter dummy routines to be used if no hinting should be
|
||||||
/* performed (specification). */
|
* performed (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef AFDUMMY_H_
|
#ifndef AFDUMMY_H_
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* aferrors.h */
|
* aferrors.h
|
||||||
/* */
|
*
|
||||||
/* Autofitter error codes (specification only). */
|
* Autofitter error codes (specification only).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2005-2018 by */
|
* Copyright 2005-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* This file is used to define the Autofitter error enumeration */
|
* This file is used to define the Autofitter error enumeration
|
||||||
/* constants. */
|
* constants.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
#ifndef AFERRORS_H_
|
#ifndef AFERRORS_H_
|
||||||
#define AFERRORS_H_
|
#define AFERRORS_H_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afglobal.c */
|
* afglobal.c
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter routines to compute global hinting values (body). */
|
* Auto-fitter routines to compute global hinting values (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "afglobal.h"
|
#include "afglobal.h"
|
||||||
|
@ -22,12 +22,12 @@
|
||||||
#include FT_INTERNAL_DEBUG_H
|
#include FT_INTERNAL_DEBUG_H
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_afglobal
|
#define FT_COMPONENT trace_afglobal
|
||||||
|
|
||||||
|
@ -167,8 +167,8 @@
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Scan all Unicode points in the range and set the corresponding
|
* Scan all Unicode points in the range and set the corresponding
|
||||||
* glyph style index.
|
* glyph style index.
|
||||||
*/
|
*/
|
||||||
if ( style_class->coverage == AF_COVERAGE_DEFAULT )
|
if ( style_class->coverage == AF_COVERAGE_DEFAULT )
|
||||||
{
|
{
|
||||||
|
@ -265,8 +265,8 @@
|
||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
/*
|
/*
|
||||||
* By default, all uncovered glyphs are set to the fallback style.
|
* By default, all uncovered glyphs are set to the fallback style.
|
||||||
* XXX: Shouldn't we disable hinting or do something similar?
|
* XXX: Shouldn't we disable hinting or do something similar?
|
||||||
*/
|
*/
|
||||||
if ( globals->module->fallback_style != AF_STYLE_UNASSIGNED )
|
if ( globals->module->fallback_style != AF_STYLE_UNASSIGNED )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afglobal.h */
|
* afglobal.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter routines to compute global hinting values */
|
* Auto-fitter routines to compute global hinting values
|
||||||
/* (specification). */
|
* (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef AFGLOBAL_H_
|
#ifndef AFGLOBAL_H_
|
||||||
|
@ -60,8 +60,8 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Default values and flags for both autofitter globals (found in
|
* Default values and flags for both autofitter globals (found in
|
||||||
* AF_ModuleRec) and face globals (in AF_FaceGlobalsRec).
|
* AF_ModuleRec) and face globals (in AF_FaceGlobalsRec).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* index of fallback style in `af_style_classes' */
|
/* index of fallback style in `af_style_classes' */
|
||||||
|
@ -98,8 +98,8 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note that glyph_styles[] maps each glyph to an index into the
|
* Note that glyph_styles[] maps each glyph to an index into the
|
||||||
* `af_style_classes' array.
|
* `af_style_classes' array.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
typedef struct AF_FaceGlobalsRec_
|
typedef struct AF_FaceGlobalsRec_
|
||||||
|
@ -140,8 +140,8 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* model the global hints data for a given face, decomposed into
|
* model the global hints data for a given face, decomposed into
|
||||||
* style-specific items
|
* style-specific items
|
||||||
*/
|
*/
|
||||||
|
|
||||||
FT_LOCAL( FT_Error )
|
FT_LOCAL( FT_Error )
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afhints.c */
|
* afhints.c
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter hinting routines (body). */
|
* Auto-fitter hinting routines (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "afhints.h"
|
#include "afhints.h"
|
||||||
|
@ -22,12 +22,12 @@
|
||||||
#include FT_INTERNAL_DEBUG_H
|
#include FT_INTERNAL_DEBUG_H
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_afhints
|
#define FT_COMPONENT trace_afhints
|
||||||
|
|
||||||
|
@ -558,8 +558,8 @@
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* note: AF_DIMENSION_HORZ corresponds to _vertical_ edges
|
* note: AF_DIMENSION_HORZ corresponds to _vertical_ edges
|
||||||
* since they have a constant X coordinate.
|
* since they have a constant X coordinate.
|
||||||
*/
|
*/
|
||||||
if ( dimension == AF_DIMENSION_HORZ )
|
if ( dimension == AF_DIMENSION_HORZ )
|
||||||
AF_DUMP(( "Table of %s edges (1px=%.2fu, 10u=%.2fpx):\n",
|
AF_DUMP(( "Table of %s edges (1px=%.2fu, 10u=%.2fpx):\n",
|
||||||
|
@ -681,8 +681,8 @@
|
||||||
memory = hints->memory;
|
memory = hints->memory;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* note that we don't need to free the segment and edge
|
* note that we don't need to free the segment and edge
|
||||||
* buffers since they are really within the hints->points array
|
* buffers since they are really within the hints->points array
|
||||||
*/
|
*/
|
||||||
for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
|
for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
|
||||||
{
|
{
|
||||||
|
@ -776,9 +776,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* then reallocate the points arrays if necessary --
|
* then reallocate the points arrays if necessary --
|
||||||
* note that we reserve two additional point positions, used to
|
* note that we reserve two additional point positions, used to
|
||||||
* hint metrics appropriately
|
* hint metrics appropriately
|
||||||
*/
|
*/
|
||||||
new_max = (FT_UInt)( outline->n_points + 2 );
|
new_max = (FT_UInt)( outline->n_points + 2 );
|
||||||
old_max = (FT_UInt)hints->max_points;
|
old_max = (FT_UInt)hints->max_points;
|
||||||
|
@ -918,15 +918,15 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Compute directions of `in' and `out' vectors.
|
* Compute directions of `in' and `out' vectors.
|
||||||
*
|
*
|
||||||
* Note that distances between points that are very near to each
|
* Note that distances between points that are very near to each
|
||||||
* other are accumulated. In other words, the auto-hinter either
|
* other are accumulated. In other words, the auto-hinter either
|
||||||
* prepends the small vectors between near points to the first
|
* prepends the small vectors between near points to the first
|
||||||
* non-near vector, or the sum of small vector lengths exceeds a
|
* non-near vector, or the sum of small vector lengths exceeds a
|
||||||
* threshold, thus `grouping' the small vectors. All intermediate
|
* threshold, thus `grouping' the small vectors. All intermediate
|
||||||
* points are tagged as weak; the directions are adjusted also to
|
* points are tagged as weak; the directions are adjusted also to
|
||||||
* be equal to the accumulated one.
|
* be equal to the accumulated one.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
FT_Int near_limit2 = 2 * near_limit - 1;
|
FT_Int near_limit2 = 2 * near_limit - 1;
|
||||||
|
@ -956,12 +956,12 @@
|
||||||
out_y = point->fy - prev->fy;
|
out_y = point->fy - prev->fy;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We use Taxicab metrics to measure the vector length.
|
* We use Taxicab metrics to measure the vector length.
|
||||||
*
|
*
|
||||||
* Note that the accumulated distances so far could have the
|
* Note that the accumulated distances so far could have the
|
||||||
* opposite direction of the distance measured here. For this
|
* opposite direction of the distance measured here. For this
|
||||||
* reason we use `near_limit2' for the comparison to get a
|
* reason we use `near_limit2' for the comparison to get a
|
||||||
* non-near point even in the worst case.
|
* non-near point even in the worst case.
|
||||||
*/
|
*/
|
||||||
if ( FT_ABS( out_x ) + FT_ABS( out_y ) >= near_limit2 )
|
if ( FT_ABS( out_x ) + FT_ABS( out_y ) >= near_limit2 )
|
||||||
break;
|
break;
|
||||||
|
@ -979,11 +979,11 @@
|
||||||
curr = first;
|
curr = first;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We abuse the `u' and `v' fields to store index deltas to the
|
* We abuse the `u' and `v' fields to store index deltas to the
|
||||||
* next and previous non-near point, respectively.
|
* next and previous non-near point, respectively.
|
||||||
*
|
*
|
||||||
* To avoid problems with not having non-near points, we point to
|
* To avoid problems with not having non-near points, we point to
|
||||||
* `first' by default as the next non-near point.
|
* `first' by default as the next non-near point.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
curr->u = (FT_Pos)( first - curr );
|
curr->u = (FT_Pos)( first - curr );
|
||||||
|
@ -1035,12 +1035,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The next step is to `simplify' an outline's topology so that we
|
* The next step is to `simplify' an outline's topology so that we
|
||||||
* can identify local extrema more reliably: A series of
|
* can identify local extrema more reliably: A series of
|
||||||
* non-horizontal or non-vertical vectors pointing into the same
|
* non-horizontal or non-vertical vectors pointing into the same
|
||||||
* quadrant are handled as a single, long vector. From a
|
* quadrant are handled as a single, long vector. From a
|
||||||
* topological point of the view, the intermediate points are of no
|
* topological point of the view, the intermediate points are of no
|
||||||
* interest and thus tagged as weak.
|
* interest and thus tagged as weak.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for ( point = points; point < point_limit; point++ )
|
for ( point = points; point < point_limit; point++ )
|
||||||
|
@ -1080,9 +1080,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Finally, check for remaining weak points. Everything else not
|
* Finally, check for remaining weak points. Everything else not
|
||||||
* collected in edges so far is then implicitly classified as strong
|
* collected in edges so far is then implicitly classified as strong
|
||||||
* points.
|
* points.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for ( point = points; point < point_limit; point++ )
|
for ( point = points; point < point_limit; point++ )
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afhints.h */
|
* afhints.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter hinting routines (specification). */
|
* Auto-fitter hinting routines (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef AFHINTS_H_
|
#ifndef AFHINTS_H_
|
||||||
|
@ -26,8 +26,8 @@
|
||||||
FT_BEGIN_HEADER
|
FT_BEGIN_HEADER
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The definition of outline glyph hints. These are shared by all
|
* The definition of outline glyph hints. These are shared by all
|
||||||
* writing system analysis routines (until now).
|
* writing system analysis routines (until now).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef enum AF_Dimension_
|
typedef enum AF_Dimension_
|
||||||
|
@ -56,153 +56,153 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following explanations are mostly taken from the article
|
* The following explanations are mostly taken from the article
|
||||||
*
|
*
|
||||||
* Real-Time Grid Fitting of Typographic Outlines
|
* Real-Time Grid Fitting of Typographic Outlines
|
||||||
*
|
*
|
||||||
* by David Turner and Werner Lemberg
|
* by David Turner and Werner Lemberg
|
||||||
*
|
*
|
||||||
* https://www.tug.org/TUGboat/Articles/tb24-3/lemberg.pdf
|
* https://www.tug.org/TUGboat/Articles/tb24-3/lemberg.pdf
|
||||||
*
|
*
|
||||||
* with appropriate updates.
|
* with appropriate updates.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Segments
|
* Segments
|
||||||
*
|
*
|
||||||
* `af_{cjk,latin,...}_hints_compute_segments' are the functions to
|
* `af_{cjk,latin,...}_hints_compute_segments' are the functions to
|
||||||
* find segments in an outline.
|
* find segments in an outline.
|
||||||
*
|
*
|
||||||
* A segment is a series of at least two consecutive points that are
|
* A segment is a series of at least two consecutive points that are
|
||||||
* approximately aligned along a coordinate axis. The analysis to do
|
* approximately aligned along a coordinate axis. The analysis to do
|
||||||
* so is specific to a writing system.
|
* so is specific to a writing system.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Edges
|
* Edges
|
||||||
*
|
*
|
||||||
* `af_{cjk,latin,...}_hints_compute_edges' are the functions to find
|
* `af_{cjk,latin,...}_hints_compute_edges' are the functions to find
|
||||||
* edges.
|
* edges.
|
||||||
*
|
*
|
||||||
* As soon as segments are defined, the auto-hinter groups them into
|
* As soon as segments are defined, the auto-hinter groups them into
|
||||||
* edges. An edge corresponds to a single position on the main
|
* edges. An edge corresponds to a single position on the main
|
||||||
* dimension that collects one or more segments (allowing for a small
|
* dimension that collects one or more segments (allowing for a small
|
||||||
* threshold).
|
* threshold).
|
||||||
*
|
*
|
||||||
* As an example, the `latin' writing system first tries to grid-fit
|
* As an example, the `latin' writing system first tries to grid-fit
|
||||||
* edges, then to align segments on the edges unless it detects that
|
* edges, then to align segments on the edges unless it detects that
|
||||||
* they form a serif.
|
* they form a serif.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* A H
|
* A H
|
||||||
* | |
|
* | |
|
||||||
* | |
|
* | |
|
||||||
* | |
|
* | |
|
||||||
* | |
|
* | |
|
||||||
* C | | F
|
* C | | F
|
||||||
* +------<-----+ +-----<------+
|
* +------<-----+ +-----<------+
|
||||||
* | B G |
|
* | B G |
|
||||||
* | |
|
* | |
|
||||||
* | |
|
* | |
|
||||||
* +--------------->------------------+
|
* +--------------->------------------+
|
||||||
* D E
|
* D E
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Stems
|
* Stems
|
||||||
*
|
*
|
||||||
* Stems are detected by `af_{cjk,latin,...}_hint_edges'.
|
* Stems are detected by `af_{cjk,latin,...}_hint_edges'.
|
||||||
*
|
*
|
||||||
* Segments need to be `linked' to other ones in order to detect stems.
|
* Segments need to be `linked' to other ones in order to detect stems.
|
||||||
* A stem is made of two segments that face each other in opposite
|
* A stem is made of two segments that face each other in opposite
|
||||||
* directions and that are sufficiently close to each other. Using
|
* directions and that are sufficiently close to each other. Using
|
||||||
* vocabulary from the TrueType specification, stem segments form a
|
* vocabulary from the TrueType specification, stem segments form a
|
||||||
* `black distance'.
|
* `black distance'.
|
||||||
*
|
*
|
||||||
* In the above ASCII drawing, the horizontal segments are BC, DE, and
|
* In the above ASCII drawing, the horizontal segments are BC, DE, and
|
||||||
* FG; the vertical segments are AB, CD, EF, and GH.
|
* FG; the vertical segments are AB, CD, EF, and GH.
|
||||||
*
|
*
|
||||||
* Each segment has at most one `best' candidate to form a black
|
* Each segment has at most one `best' candidate to form a black
|
||||||
* distance, or no candidate at all. Notice that two distinct segments
|
* distance, or no candidate at all. Notice that two distinct segments
|
||||||
* can have the same candidate, which frequently means a serif.
|
* can have the same candidate, which frequently means a serif.
|
||||||
*
|
*
|
||||||
* A stem is recognized by the following condition:
|
* A stem is recognized by the following condition:
|
||||||
*
|
*
|
||||||
* best segment_1 = segment_2 && best segment_2 = segment_1
|
* best segment_1 = segment_2 && best segment_2 = segment_1
|
||||||
*
|
*
|
||||||
* The best candidate is stored in field `link' in structure
|
* The best candidate is stored in field `link' in structure
|
||||||
* `AF_Segment'.
|
* `AF_Segment'.
|
||||||
*
|
*
|
||||||
* In the above ASCII drawing, the best candidate for both AB and CD is
|
* In the above ASCII drawing, the best candidate for both AB and CD is
|
||||||
* GH, while the best candidate for GH is AB. Similarly, the best
|
* GH, while the best candidate for GH is AB. Similarly, the best
|
||||||
* candidate for EF and GH is AB, while the best candidate for AB is
|
* candidate for EF and GH is AB, while the best candidate for AB is
|
||||||
* GH.
|
* GH.
|
||||||
*
|
*
|
||||||
* The detection and handling of stems is dependent on the writing
|
* The detection and handling of stems is dependent on the writing
|
||||||
* system.
|
* system.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Serifs
|
* Serifs
|
||||||
*
|
*
|
||||||
* Serifs are detected by `af_{cjk,latin,...}_hint_edges'.
|
* Serifs are detected by `af_{cjk,latin,...}_hint_edges'.
|
||||||
*
|
*
|
||||||
* In comparison to a stem, a serif (as handled by the auto-hinter
|
* In comparison to a stem, a serif (as handled by the auto-hinter
|
||||||
* module that takes care of the `latin' writing system) has
|
* module that takes care of the `latin' writing system) has
|
||||||
*
|
*
|
||||||
* best segment_1 = segment_2 && best segment_2 != segment_1
|
* best segment_1 = segment_2 && best segment_2 != segment_1
|
||||||
*
|
*
|
||||||
* where segment_1 corresponds to the serif segment (CD and EF in the
|
* where segment_1 corresponds to the serif segment (CD and EF in the
|
||||||
* above ASCII drawing).
|
* above ASCII drawing).
|
||||||
*
|
*
|
||||||
* The best candidate is stored in field `serif' in structure
|
* The best candidate is stored in field `serif' in structure
|
||||||
* `AF_Segment' (and `link' is set to NULL).
|
* `AF_Segment' (and `link' is set to NULL).
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Touched points
|
* Touched points
|
||||||
*
|
*
|
||||||
* A point is called `touched' if it has been processed somehow by the
|
* A point is called `touched' if it has been processed somehow by the
|
||||||
* auto-hinter. It basically means that it shouldn't be moved again
|
* auto-hinter. It basically means that it shouldn't be moved again
|
||||||
* (or moved only under certain constraints to preserve the already
|
* (or moved only under certain constraints to preserve the already
|
||||||
* applied processing).
|
* applied processing).
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Flat and round segments
|
* Flat and round segments
|
||||||
*
|
*
|
||||||
* Segments are `round' or `flat', depending on the series of points
|
* Segments are `round' or `flat', depending on the series of points
|
||||||
* that define them. A segment is round if the next and previous point
|
* that define them. A segment is round if the next and previous point
|
||||||
* of an extremum (which can be either a single point or sequence of
|
* of an extremum (which can be either a single point or sequence of
|
||||||
* points) are both conic or cubic control points. Otherwise, a
|
* points) are both conic or cubic control points. Otherwise, a
|
||||||
* segment with an extremum is flat.
|
* segment with an extremum is flat.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Strong Points
|
* Strong Points
|
||||||
*
|
*
|
||||||
* Experience has shown that points not part of an edge need to be
|
* Experience has shown that points not part of an edge need to be
|
||||||
* interpolated linearly between their two closest edges, even if these
|
* interpolated linearly between their two closest edges, even if these
|
||||||
* are not part of the contour of those particular points. Typical
|
* are not part of the contour of those particular points. Typical
|
||||||
* candidates for this are
|
* candidates for this are
|
||||||
*
|
*
|
||||||
* - angle points (i.e., points where the `in' and `out' direction
|
* - angle points (i.e., points where the `in' and `out' direction
|
||||||
* differ greatly)
|
* differ greatly)
|
||||||
*
|
*
|
||||||
* - inflection points (i.e., where the `in' and `out' angles are the
|
* - inflection points (i.e., where the `in' and `out' angles are the
|
||||||
* same, but the curvature changes sign) [currently, such points
|
* same, but the curvature changes sign) [currently, such points
|
||||||
* aren't handled specially in the auto-hinter]
|
* aren't handled specially in the auto-hinter]
|
||||||
*
|
*
|
||||||
* `af_glyph_hints_align_strong_points' is the function that takes
|
* `af_glyph_hints_align_strong_points' is the function that takes
|
||||||
* care of such situations; it is equivalent to the TrueType `IP'
|
* care of such situations; it is equivalent to the TrueType `IP'
|
||||||
* hinting instruction.
|
* hinting instruction.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Weak Points
|
* Weak Points
|
||||||
*
|
*
|
||||||
* Other points in the outline must be interpolated using the
|
* Other points in the outline must be interpolated using the
|
||||||
* coordinates of their previous and next unfitted contour neighbours.
|
* coordinates of their previous and next unfitted contour neighbours.
|
||||||
* These are called `weak points' and are touched by the function
|
* These are called `weak points' and are touched by the function
|
||||||
* `af_glyph_hints_align_weak_points', equivalent to the TrueType `IUP'
|
* `af_glyph_hints_align_weak_points', equivalent to the TrueType `IUP'
|
||||||
* hinting instruction. Typical candidates are control points and
|
* hinting instruction. Typical candidates are control points and
|
||||||
* points on the contour without a major direction.
|
* points on the contour without a major direction.
|
||||||
*
|
*
|
||||||
* The major effect is to reduce possible distortion caused by
|
* The major effect is to reduce possible distortion caused by
|
||||||
* alignment of edges and strong points, thus weak points are processed
|
* alignment of edges and strong points, thus weak points are processed
|
||||||
* after strong points.
|
* after strong points.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afindic.c */
|
* afindic.c
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter hinting routines for Indic writing system (body). */
|
* Auto-fitter hinting routines for Indic writing system (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2007-2018 by */
|
* Copyright 2007-2018 by
|
||||||
/* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>. */
|
* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.
|
||||||
/* */
|
*
|
||||||
/* 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "aftypes.h"
|
#include "aftypes.h"
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afindic.h */
|
* afindic.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter hinting routines for Indic writing system */
|
* Auto-fitter hinting routines for Indic writing system
|
||||||
/* (specification). */
|
* (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2007-2018 by */
|
* Copyright 2007-2018 by
|
||||||
/* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>. */
|
* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.
|
||||||
/* */
|
*
|
||||||
/* 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef AFINDIC_H_
|
#ifndef AFINDIC_H_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* aflatin.c */
|
* aflatin.c
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter hinting routines for latin writing system (body). */
|
* Auto-fitter hinting routines for latin writing system (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -30,12 +30,12 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_aflatin
|
#define FT_COMPONENT trace_aflatin
|
||||||
|
|
||||||
|
@ -191,10 +191,10 @@
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We assume that the glyphs selected for the stem width
|
* We assume that the glyphs selected for the stem width
|
||||||
* computation are `featureless' enough so that the linking
|
* computation are `featureless' enough so that the linking
|
||||||
* algorithm works fine without adjustments of its scoring
|
* algorithm works fine without adjustments of its scoring
|
||||||
* function.
|
* function.
|
||||||
*/
|
*/
|
||||||
af_latin_hints_link_segments( hints,
|
af_latin_hints_link_segments( hints,
|
||||||
0,
|
0,
|
||||||
|
@ -898,8 +898,8 @@
|
||||||
if ( num_flats == 0 && num_rounds == 0 )
|
if ( num_flats == 0 && num_rounds == 0 )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* we couldn't find a single glyph to compute this blue zone,
|
* we couldn't find a single glyph to compute this blue zone,
|
||||||
* we will simply ignore it then
|
* we will simply ignore it then
|
||||||
*/
|
*/
|
||||||
FT_TRACE5(( " empty\n" ));
|
FT_TRACE5(( " empty\n" ));
|
||||||
continue;
|
continue;
|
||||||
|
@ -1991,17 +1991,17 @@
|
||||||
if ( len >= len_threshold )
|
if ( len >= len_threshold )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* The score is the sum of two demerits indicating the
|
* The score is the sum of two demerits indicating the
|
||||||
* `badness' of a fit, measured along the segments' main axis
|
* `badness' of a fit, measured along the segments' main axis
|
||||||
* and orthogonal to it, respectively.
|
* and orthogonal to it, respectively.
|
||||||
*
|
*
|
||||||
* o The less overlapping along the main axis, the worse it
|
* - The less overlapping along the main axis, the worse it
|
||||||
* is, causing a larger demerit.
|
* is, causing a larger demerit.
|
||||||
*
|
*
|
||||||
* o The nearer the orthogonal distance to a stem width, the
|
* - The nearer the orthogonal distance to a stem width, the
|
||||||
* better it is, causing a smaller demerit. For simplicity,
|
* better it is, causing a smaller demerit. For simplicity,
|
||||||
* however, we only increase the demerit for values that
|
* however, we only increase the demerit for values that
|
||||||
* exceed the largest stem width.
|
* exceed the largest stem width.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
FT_Pos dist = pos2 - pos1;
|
FT_Pos dist = pos2 - pos1;
|
||||||
|
@ -2105,9 +2105,9 @@
|
||||||
top_to_bottom_hinting = script_class->top_to_bottom_hinting;
|
top_to_bottom_hinting = script_class->top_to_bottom_hinting;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We ignore all segments that are less than 1 pixel in length
|
* We ignore all segments that are less than 1 pixel in length
|
||||||
* to avoid many problems with serif fonts. We compute the
|
* to avoid many problems with serif fonts. We compute the
|
||||||
* corresponding threshold in font units.
|
* corresponding threshold in font units.
|
||||||
*/
|
*/
|
||||||
if ( dim == AF_DIMENSION_HORZ )
|
if ( dim == AF_DIMENSION_HORZ )
|
||||||
segment_length_threshold = FT_DivFix( 64, hints->y_scale );
|
segment_length_threshold = FT_DivFix( 64, hints->y_scale );
|
||||||
|
@ -2115,26 +2115,26 @@
|
||||||
segment_length_threshold = 0;
|
segment_length_threshold = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Similarly, we ignore segments that have a width delta
|
* Similarly, we ignore segments that have a width delta
|
||||||
* larger than 0.5px (i.e., a width larger than 1px).
|
* larger than 0.5px (i.e., a width larger than 1px).
|
||||||
*/
|
*/
|
||||||
segment_width_threshold = FT_DivFix( 32, scale );
|
segment_width_threshold = FT_DivFix( 32, scale );
|
||||||
|
|
||||||
/*********************************************************************/
|
/**********************************************************************
|
||||||
/* */
|
*
|
||||||
/* We begin by generating a sorted table of edges for the current */
|
* We begin by generating a sorted table of edges for the current
|
||||||
/* direction. To do so, we simply scan each segment and try to find */
|
* direction. To do so, we simply scan each segment and try to find
|
||||||
/* an edge in our table that corresponds to its position. */
|
* an edge in our table that corresponds to its position.
|
||||||
/* */
|
*
|
||||||
/* If no edge is found, we create and insert a new edge in the */
|
* If no edge is found, we create and insert a new edge in the
|
||||||
/* sorted table. Otherwise, we simply add the segment to the edge's */
|
* sorted table. Otherwise, we simply add the segment to the edge's
|
||||||
/* list which gets processed in the second step to compute the */
|
* list which gets processed in the second step to compute the
|
||||||
/* edge's properties. */
|
* edge's properties.
|
||||||
/* */
|
*
|
||||||
/* Note that the table of edges is sorted along the segment/edge */
|
* Note that the table of edges is sorted along the segment/edge
|
||||||
/* position. */
|
* position.
|
||||||
/* */
|
*
|
||||||
/*********************************************************************/
|
*/
|
||||||
|
|
||||||
/* assure that edge distance threshold is at most 0.25px */
|
/* assure that edge distance threshold is at most 0.25px */
|
||||||
edge_distance_threshold = FT_MulFix( laxis->edge_distance_threshold,
|
edge_distance_threshold = FT_MulFix( laxis->edge_distance_threshold,
|
||||||
|
@ -2256,17 +2256,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/*******************************************************************
|
||||||
/* */
|
*
|
||||||
/* Good, we now compute each edge's properties according to the */
|
* Good, we now compute each edge's properties according to the
|
||||||
/* segments found on its position. Basically, these are */
|
* segments found on its position. Basically, these are
|
||||||
/* */
|
*
|
||||||
/* - the edge's main direction */
|
* - the edge's main direction
|
||||||
/* - stem edge, serif edge or both (which defaults to stem then) */
|
* - stem edge, serif edge or both (which defaults to stem then)
|
||||||
/* - rounded edge, straight or both (which defaults to straight) */
|
* - rounded edge, straight or both (which defaults to straight)
|
||||||
/* - link for edge */
|
* - link for edge
|
||||||
/* */
|
*
|
||||||
/******************************************************************/
|
*/
|
||||||
|
|
||||||
/* first of all, set the `edge' field in each segment -- this is */
|
/* first of all, set the `edge' field in each segment -- this is */
|
||||||
/* required in order to compute edge links */
|
/* required in order to compute edge links */
|
||||||
|
@ -2565,8 +2565,8 @@
|
||||||
af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );
|
af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* correct x_scale and y_scale if needed, since they may have
|
* correct x_scale and y_scale if needed, since they may have
|
||||||
* been modified by `af_latin_metrics_scale_dim' above
|
* been modified by `af_latin_metrics_scale_dim' above
|
||||||
*/
|
*/
|
||||||
hints->x_scale = metrics->axis[AF_DIMENSION_HORZ].scale;
|
hints->x_scale = metrics->axis[AF_DIMENSION_HORZ].scale;
|
||||||
hints->x_delta = metrics->axis[AF_DIMENSION_HORZ].delta;
|
hints->x_delta = metrics->axis[AF_DIMENSION_HORZ].delta;
|
||||||
|
@ -2585,21 +2585,21 @@
|
||||||
other_flags = 0;
|
other_flags = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We snap the width of vertical stems for the monochrome and
|
* We snap the width of vertical stems for the monochrome and
|
||||||
* horizontal LCD rendering targets only.
|
* horizontal LCD rendering targets only.
|
||||||
*/
|
*/
|
||||||
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )
|
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )
|
||||||
other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
|
other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We snap the width of horizontal stems for the monochrome and
|
* We snap the width of horizontal stems for the monochrome and
|
||||||
* vertical LCD rendering targets only.
|
* vertical LCD rendering targets only.
|
||||||
*/
|
*/
|
||||||
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )
|
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )
|
||||||
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
|
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We adjust stems to full pixels unless in `light' or `lcd' mode.
|
* We adjust stems to full pixels unless in `light' or `lcd' mode.
|
||||||
*/
|
*/
|
||||||
if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
|
if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
|
||||||
other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
|
other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
|
||||||
|
@ -2608,11 +2608,11 @@
|
||||||
other_flags |= AF_LATIN_HINTS_MONO;
|
other_flags |= AF_LATIN_HINTS_MONO;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In `light' or `lcd' mode we disable horizontal hinting completely.
|
* In `light' or `lcd' mode we disable horizontal hinting completely.
|
||||||
* We also do it if the face is italic.
|
* We also do it if the face is italic.
|
||||||
*
|
*
|
||||||
* However, if warping is enabled (which only works in `light' hinting
|
* However, if warping is enabled (which only works in `light' hinting
|
||||||
* mode), advance widths get adjusted, too.
|
* mode), advance widths get adjusted, too.
|
||||||
*/
|
*/
|
||||||
if ( mode == FT_RENDER_MODE_LIGHT || mode == FT_RENDER_MODE_LCD ||
|
if ( mode == FT_RENDER_MODE_LIGHT || mode == FT_RENDER_MODE_LCD ||
|
||||||
( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
|
( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
|
||||||
|
@ -2990,12 +2990,12 @@
|
||||||
edge2 = edge->link;
|
edge2 = edge->link;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If a stem contains both a neutral and a non-neutral blue zone,
|
* If a stem contains both a neutral and a non-neutral blue zone,
|
||||||
* skip the neutral one. Otherwise, outlines with different
|
* skip the neutral one. Otherwise, outlines with different
|
||||||
* directions might be incorrectly aligned at the same vertical
|
* directions might be incorrectly aligned at the same vertical
|
||||||
* position.
|
* position.
|
||||||
*
|
*
|
||||||
* If we have two neutral blue zones, skip one of them.
|
* If we have two neutral blue zones, skip one of them.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if ( edge->blue_edge && edge2 && edge2->blue_edge )
|
if ( edge->blue_edge && edge2 && edge2->blue_edge )
|
||||||
|
@ -3358,8 +3358,8 @@
|
||||||
if ( has_serifs || !anchor )
|
if ( has_serifs || !anchor )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* now hint the remaining edges (serifs and single) in order
|
* now hint the remaining edges (serifs and single) in order
|
||||||
* to complete our processing
|
* to complete our processing
|
||||||
*/
|
*/
|
||||||
for ( edge = edges; edge < edge_limit; edge++ )
|
for ( edge = edges; edge < edge_limit; edge++ )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* aflatin.h */
|
* aflatin.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter hinting routines for latin writing system */
|
* Auto-fitter hinting routines for latin writing system
|
||||||
/* (specification). */
|
* (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef AFLATIN_H_
|
#ifndef AFLATIN_H_
|
||||||
|
@ -45,9 +45,9 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following declarations could be embedded in the file `aflatin.c';
|
* The following declarations could be embedded in the file `aflatin.c';
|
||||||
* they have been made semi-public to allow alternate writing system
|
* they have been made semi-public to allow alternate writing system
|
||||||
* hinters to re-use some of them.
|
* hinters to re-use some of them.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -161,8 +161,8 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The next functions shouldn't normally be exported. However, other
|
* The next functions shouldn't normally be exported. However, other
|
||||||
* writing systems might like to use these functions as-is.
|
* writing systems might like to use these functions as-is.
|
||||||
*/
|
*/
|
||||||
FT_LOCAL( FT_Error )
|
FT_LOCAL( FT_Error )
|
||||||
af_latin_hints_compute_segments( AF_GlyphHints hints,
|
af_latin_hints_compute_segments( AF_GlyphHints hints,
|
||||||
|
|
|
@ -3,22 +3,22 @@
|
||||||
/* marked as experimental. */
|
/* marked as experimental. */
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* aflatin2.c */
|
* aflatin2.c
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter hinting routines for latin writing system (body). */
|
* Auto-fitter hinting routines for latin writing system (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include FT_ADVANCES_H
|
#include FT_ADVANCES_H
|
||||||
|
@ -37,12 +37,12 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_aflatin2
|
#define FT_COMPONENT trace_aflatin2
|
||||||
|
|
||||||
|
@ -358,8 +358,8 @@
|
||||||
if ( num_flats == 0 && num_rounds == 0 )
|
if ( num_flats == 0 && num_rounds == 0 )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* we couldn't find a single glyph to compute this blue zone,
|
* we couldn't find a single glyph to compute this blue zone,
|
||||||
* we will simply ignore it then
|
* we will simply ignore it then
|
||||||
*/
|
*/
|
||||||
FT_TRACE5(( " empty\n" ));
|
FT_TRACE5(( " empty\n" ));
|
||||||
continue;
|
continue;
|
||||||
|
@ -1108,13 +1108,13 @@
|
||||||
: AF_DIR_RIGHT;
|
: AF_DIR_RIGHT;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We want to ignore very small (mostly serif) segments, we do that
|
* We want to ignore very small (mostly serif) segments, we do that
|
||||||
* by ignoring those that whose length is less than a given fraction
|
* by ignoring those that whose length is less than a given fraction
|
||||||
* of the standard width. If there is no standard width, we ignore
|
* of the standard width. If there is no standard width, we ignore
|
||||||
* those that are less than a given size in pixels
|
* those that are less than a given size in pixels
|
||||||
*
|
*
|
||||||
* also, unlink serif segments that are linked to segments farther
|
* also, unlink serif segments that are linked to segments farther
|
||||||
* than 50% of the standard width
|
* than 50% of the standard width
|
||||||
*/
|
*/
|
||||||
if ( dim == AF_DIMENSION_HORZ )
|
if ( dim == AF_DIMENSION_HORZ )
|
||||||
{
|
{
|
||||||
|
@ -1126,21 +1126,21 @@
|
||||||
else
|
else
|
||||||
segment_length_threshold = 0;
|
segment_length_threshold = 0;
|
||||||
|
|
||||||
/*********************************************************************/
|
/**********************************************************************
|
||||||
/* */
|
*
|
||||||
/* We will begin by generating a sorted table of edges for the */
|
* We will begin by generating a sorted table of edges for the
|
||||||
/* current direction. To do so, we simply scan each segment and try */
|
* current direction. To do so, we simply scan each segment and try
|
||||||
/* to find an edge in our table that corresponds to its position. */
|
* to find an edge in our table that corresponds to its position.
|
||||||
/* */
|
*
|
||||||
/* If no edge is found, we create and insert a new edge in the */
|
* If no edge is found, we create and insert a new edge in the
|
||||||
/* sorted table. Otherwise, we simply add the segment to the edge's */
|
* sorted table. Otherwise, we simply add the segment to the edge's
|
||||||
/* list which will be processed in the second step to compute the */
|
* list which will be processed in the second step to compute the
|
||||||
/* edge's properties. */
|
* edge's properties.
|
||||||
/* */
|
*
|
||||||
/* Note that the edges table is sorted along the segment/edge */
|
* Note that the edges table is sorted along the segment/edge
|
||||||
/* position. */
|
* position.
|
||||||
/* */
|
*
|
||||||
/*********************************************************************/
|
*/
|
||||||
|
|
||||||
edge_distance_threshold = FT_MulFix( laxis->edge_distance_threshold,
|
edge_distance_threshold = FT_MulFix( laxis->edge_distance_threshold,
|
||||||
scale );
|
scale );
|
||||||
|
@ -1230,17 +1230,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************/
|
/**********************************************************************
|
||||||
/* */
|
*
|
||||||
/* Good, we will now compute each edge's properties according to */
|
* Good, we will now compute each edge's properties according to
|
||||||
/* segments found on its position. Basically, these are: */
|
* segments found on its position. Basically, these are:
|
||||||
/* */
|
*
|
||||||
/* - edge's main direction */
|
* - edge's main direction
|
||||||
/* - stem edge, serif edge or both (which defaults to stem then) */
|
* - stem edge, serif edge or both (which defaults to stem then)
|
||||||
/* - rounded edge, straight or both (which defaults to straight) */
|
* - rounded edge, straight or both (which defaults to straight)
|
||||||
/* - link for edge */
|
* - link for edge
|
||||||
/* */
|
*
|
||||||
/*********************************************************************/
|
*/
|
||||||
|
|
||||||
/* first of all, set the `edge' field in each segment -- this is */
|
/* first of all, set the `edge' field in each segment -- this is */
|
||||||
/* required in order to compute edge links */
|
/* required in order to compute edge links */
|
||||||
|
@ -1524,8 +1524,8 @@
|
||||||
af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );
|
af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* correct x_scale and y_scale if needed, since they may have
|
* correct x_scale and y_scale if needed, since they may have
|
||||||
* been modified `af_latin2_metrics_scale_dim' above
|
* been modified `af_latin2_metrics_scale_dim' above
|
||||||
*/
|
*/
|
||||||
hints->x_scale = metrics->axis[AF_DIMENSION_HORZ].scale;
|
hints->x_scale = metrics->axis[AF_DIMENSION_HORZ].scale;
|
||||||
hints->x_delta = metrics->axis[AF_DIMENSION_HORZ].delta;
|
hints->x_delta = metrics->axis[AF_DIMENSION_HORZ].delta;
|
||||||
|
@ -1544,21 +1544,21 @@
|
||||||
other_flags = 0;
|
other_flags = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We snap the width of vertical stems for the monochrome and
|
* We snap the width of vertical stems for the monochrome and
|
||||||
* horizontal LCD rendering targets only.
|
* horizontal LCD rendering targets only.
|
||||||
*/
|
*/
|
||||||
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )
|
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )
|
||||||
other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
|
other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We snap the width of horizontal stems for the monochrome and
|
* We snap the width of horizontal stems for the monochrome and
|
||||||
* vertical LCD rendering targets only.
|
* vertical LCD rendering targets only.
|
||||||
*/
|
*/
|
||||||
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )
|
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )
|
||||||
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
|
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We adjust stems to full pixels unless in `light' or `lcd' mode.
|
* We adjust stems to full pixels unless in `light' or `lcd' mode.
|
||||||
*/
|
*/
|
||||||
if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
|
if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
|
||||||
other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
|
other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
|
||||||
|
@ -1567,8 +1567,8 @@
|
||||||
other_flags |= AF_LATIN_HINTS_MONO;
|
other_flags |= AF_LATIN_HINTS_MONO;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In `light' or `lcd' mode we disable horizontal hinting completely.
|
* In `light' or `lcd' mode we disable horizontal hinting completely.
|
||||||
* We also do it if the face is italic.
|
* We also do it if the face is italic.
|
||||||
*/
|
*/
|
||||||
if ( mode == FT_RENDER_MODE_LIGHT || mode == FT_RENDER_MODE_LCD ||
|
if ( mode == FT_RENDER_MODE_LIGHT || mode == FT_RENDER_MODE_LCD ||
|
||||||
( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
|
( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
|
||||||
|
@ -2233,8 +2233,8 @@
|
||||||
if ( has_serifs || !anchor )
|
if ( has_serifs || !anchor )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* now hint the remaining edges (serifs and single) in order
|
* now hint the remaining edges (serifs and single) in order
|
||||||
* to complete our processing
|
* to complete our processing
|
||||||
*/
|
*/
|
||||||
for ( edge = edges; edge < edge_limit; edge++ )
|
for ( edge = edges; edge < edge_limit; edge++ )
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,23 +3,23 @@
|
||||||
/* marked as experimental. */
|
/* marked as experimental. */
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* aflatin2.h */
|
* aflatin2.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter hinting routines for latin writing system */
|
* Auto-fitter hinting routines for latin writing system
|
||||||
/* (specification). */
|
* (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef AFLATIN2_H_
|
#ifndef AFLATIN2_H_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afloader.c */
|
* afloader.c
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter glyph loading routines (body). */
|
* Auto-fitter glyph loading routines (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "afglobal.h"
|
#include "afglobal.h"
|
||||||
|
@ -118,9 +118,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We depend on the writing system (script analyzers) to supply
|
* We depend on the writing system (script analyzers) to supply
|
||||||
* standard widths for the script of the glyph we are looking at. If
|
* standard widths for the script of the glyph we are looking at. If
|
||||||
* it can't deliver, stem darkening is disabled.
|
* it can't deliver, stem darkening is disabled.
|
||||||
*/
|
*/
|
||||||
writing_system_class =
|
writing_system_class =
|
||||||
af_writing_system_classes[style_metrics->style_class->writing_system];
|
af_writing_system_classes[style_metrics->style_class->writing_system];
|
||||||
|
@ -173,22 +173,22 @@
|
||||||
globals->darken_y = af_fixedToInt( darken_y );
|
globals->darken_y = af_fixedToInt( darken_y );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Scale outlines down on the Y-axis to keep them inside their blue
|
* Scale outlines down on the Y-axis to keep them inside their blue
|
||||||
* zones. The stronger the emboldening, the stronger the downscaling
|
* zones. The stronger the emboldening, the stronger the downscaling
|
||||||
* (plus heuristical padding to prevent outlines still falling out
|
* (plus heuristical padding to prevent outlines still falling out
|
||||||
* their zones due to rounding).
|
* their zones due to rounding).
|
||||||
*
|
*
|
||||||
* Reason: `FT_Outline_Embolden' works by shifting the rightmost
|
* Reason: `FT_Outline_Embolden' works by shifting the rightmost
|
||||||
* points of stems farther to the right, and topmost points farther
|
* points of stems farther to the right, and topmost points farther
|
||||||
* up. This positions points on the Y-axis outside their
|
* up. This positions points on the Y-axis outside their
|
||||||
* pre-computed blue zones and leads to distortion when applying the
|
* pre-computed blue zones and leads to distortion when applying the
|
||||||
* hints in the code further below. Code outside this emboldening
|
* hints in the code further below. Code outside this emboldening
|
||||||
* block doesn't know we are presenting it with modified outlines the
|
* block doesn't know we are presenting it with modified outlines the
|
||||||
* analyzer didn't see!
|
* analyzer didn't see!
|
||||||
*
|
*
|
||||||
* An unfortunate side effect of downscaling is that the emboldening
|
* An unfortunate side effect of downscaling is that the emboldening
|
||||||
* effect is slightly decreased. The loss becomes more pronounced
|
* effect is slightly decreased. The loss becomes more pronounced
|
||||||
* versus the CFF driver at smaller sizes, e.g., at 9ppem and below.
|
* versus the CFF driver at smaller sizes, e.g., at 9ppem and below.
|
||||||
*/
|
*/
|
||||||
globals->scale_down_factor =
|
globals->scale_down_factor =
|
||||||
FT_DivFix( em_size - ( darken_by_font_units_y + af_intToFixed( 8 ) ),
|
FT_DivFix( em_size - ( darken_by_font_units_y + af_intToFixed( 8 ) ),
|
||||||
|
@ -277,13 +277,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO: This code currently doesn't support fractional advance widths,
|
* TODO: This code currently doesn't support fractional advance widths,
|
||||||
* i.e., placing hinted glyphs at anything other than integer
|
* i.e., placing hinted glyphs at anything other than integer
|
||||||
* x-positions. This is only relevant for the warper code, which
|
* x-positions. This is only relevant for the warper code, which
|
||||||
* scales and shifts glyphs to optimize blackness of stems (hinting on
|
* scales and shifts glyphs to optimize blackness of stems (hinting on
|
||||||
* the x-axis by nature places things on pixel integers, hinting on the
|
* the x-axis by nature places things on pixel integers, hinting on the
|
||||||
* y-axis only, i.e., LIGHT mode, doesn't touch the x-axis). The delta
|
* y-axis only, i.e., LIGHT mode, doesn't touch the x-axis). The delta
|
||||||
* values of the scaler would need to be adjusted.
|
* values of the scaler would need to be adjusted.
|
||||||
*/
|
*/
|
||||||
scaler.face = face;
|
scaler.face = face;
|
||||||
scaler.x_scale = size_internal->autohint_metrics.x_scale;
|
scaler.x_scale = size_internal->autohint_metrics.x_scale;
|
||||||
|
@ -307,10 +307,10 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Glyphs (really code points) are assigned to scripts. Script
|
* Glyphs (really code points) are assigned to scripts. Script
|
||||||
* analysis is done lazily: For each glyph that passes through here,
|
* analysis is done lazily: For each glyph that passes through here,
|
||||||
* the corresponding script analyzer is called, but returns immediately
|
* the corresponding script analyzer is called, but returns immediately
|
||||||
* if it has been run already.
|
* if it has been run already.
|
||||||
*/
|
*/
|
||||||
error = af_face_globals_get_metrics( loader->globals, glyph_index,
|
error = af_face_globals_get_metrics( loader->globals, glyph_index,
|
||||||
style_options, &style_metrics );
|
style_options, &style_metrics );
|
||||||
|
@ -337,11 +337,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do the main work of `af_loader_load_glyph'. Note that we never have
|
* Do the main work of `af_loader_load_glyph'. Note that we never have
|
||||||
* to deal with composite glyphs as those get loaded into
|
* to deal with composite glyphs as those get loaded into
|
||||||
* FT_GLYPH_FORMAT_OUTLINE by the recursed `FT_Load_Glyph' function.
|
* FT_GLYPH_FORMAT_OUTLINE by the recursed `FT_Load_Glyph' function.
|
||||||
* In the rare cases where FT_LOAD_NO_RECURSE is set, it implies
|
* In the rare cases where FT_LOAD_NO_RECURSE is set, it implies
|
||||||
* FT_LOAD_NO_SCALE and as such the auto-hinter is never called.
|
* FT_LOAD_NO_SCALE and as such the auto-hinter is never called.
|
||||||
*/
|
*/
|
||||||
load_flags |= FT_LOAD_NO_SCALE |
|
load_flags |= FT_LOAD_NO_SCALE |
|
||||||
FT_LOAD_IGNORE_TRANSFORM |
|
FT_LOAD_IGNORE_TRANSFORM |
|
||||||
|
@ -353,26 +353,26 @@
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Apply stem darkening (emboldening) here before hints are applied to
|
* Apply stem darkening (emboldening) here before hints are applied to
|
||||||
* the outline. Glyphs are scaled down proportionally to the
|
* the outline. Glyphs are scaled down proportionally to the
|
||||||
* emboldening so that curve points don't fall outside their
|
* emboldening so that curve points don't fall outside their
|
||||||
* precomputed blue zones.
|
* precomputed blue zones.
|
||||||
*
|
*
|
||||||
* Any emboldening done by the font driver (e.g., the CFF driver)
|
* Any emboldening done by the font driver (e.g., the CFF driver)
|
||||||
* doesn't reach here because the autohinter loads the unprocessed
|
* doesn't reach here because the autohinter loads the unprocessed
|
||||||
* glyphs in font units for analysis (functions `af_*_metrics_init_*')
|
* glyphs in font units for analysis (functions `af_*_metrics_init_*')
|
||||||
* and then above to prepare it for the rasterizers by itself,
|
* and then above to prepare it for the rasterizers by itself,
|
||||||
* independently of the font driver. So emboldening must be done here,
|
* independently of the font driver. So emboldening must be done here,
|
||||||
* within the autohinter.
|
* within the autohinter.
|
||||||
*
|
*
|
||||||
* All glyphs to be autohinted pass through here one by one. The
|
* All glyphs to be autohinted pass through here one by one. The
|
||||||
* standard widths can therefore change from one glyph to the next,
|
* standard widths can therefore change from one glyph to the next,
|
||||||
* depending on what script a glyph is assigned to (each script has its
|
* depending on what script a glyph is assigned to (each script has its
|
||||||
* own set of standard widths and other metrics). The darkening amount
|
* own set of standard widths and other metrics). The darkening amount
|
||||||
* must therefore be recomputed for each size and
|
* must therefore be recomputed for each size and
|
||||||
* `standard_{vertical,horizontal}_width' change.
|
* `standard_{vertical,horizontal}_width' change.
|
||||||
*
|
*
|
||||||
* Ignore errors and carry on without emboldening.
|
* Ignore errors and carry on without emboldening.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afloader.h */
|
* afloader.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter glyph loading routines (specification). */
|
* Auto-fitter glyph loading routines (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef AFLOADER_H_
|
#ifndef AFLOADER_H_
|
||||||
|
@ -27,11 +27,11 @@
|
||||||
FT_BEGIN_HEADER
|
FT_BEGIN_HEADER
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The autofitter module's (global) data structure to communicate with
|
* The autofitter module's (global) data structure to communicate with
|
||||||
* actual fonts. If necessary, `local' data like the current face, the
|
* actual fonts. If necessary, `local' data like the current face, the
|
||||||
* current face's auto-hint data, or the current glyph's parameters
|
* current face's auto-hint data, or the current glyph's parameters
|
||||||
* relevant to auto-hinting are `swapped in'. Cf. functions like
|
* relevant to auto-hinting are `swapped in'. Cf. functions like
|
||||||
* `af_loader_reset' and `af_loader_load_g'.
|
* `af_loader_reset' and `af_loader_load_g'.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct AF_LoaderRec_
|
typedef struct AF_LoaderRec_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afmodule.c */
|
* afmodule.c
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter module implementation (body). */
|
* Auto-fitter module implementation (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "afglobal.h"
|
#include "afglobal.h"
|
||||||
|
@ -59,12 +59,12 @@
|
||||||
#include FT_SERVICE_PROPERTIES_H
|
#include FT_SERVICE_PROPERTIES_H
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_afmodule
|
#define FT_COMPONENT trace_afmodule
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afmodule.h */
|
* afmodule.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter module implementation (specification). */
|
* Auto-fitter module implementation (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef AFMODULE_H_
|
#ifndef AFMODULE_H_
|
||||||
|
@ -28,8 +28,8 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the `extended' FT_Module structure that holds the
|
* This is the `extended' FT_Module structure that holds the
|
||||||
* autofitter's global data.
|
* autofitter's global data.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct AF_ModuleRec_
|
typedef struct AF_ModuleRec_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afranges.c */
|
* afranges.c
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter Unicode script ranges (body). */
|
* Auto-fitter Unicode script ranges (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2013-2018 by */
|
* Copyright 2013-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "afranges.h"
|
#include "afranges.h"
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afranges.h */
|
* afranges.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter Unicode script ranges (specification). */
|
* Auto-fitter Unicode script ranges (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2013-2018 by */
|
* Copyright 2013-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef AFRANGES_H_
|
#ifndef AFRANGES_H_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afscript.h */
|
* afscript.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter scripts (specification only). */
|
* Auto-fitter scripts (specification only).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2013-2018 by */
|
* Copyright 2013-2018 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 following part can be included multiple times. */
|
/* The following part can be included multiple times. */
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afshaper.c */
|
* afshaper.c
|
||||||
/* */
|
*
|
||||||
/* HarfBuzz interface for accessing OpenType features (body). */
|
* HarfBuzz interface for accessing OpenType features (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2013-2018 by */
|
* Copyright 2013-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -26,12 +26,12 @@
|
||||||
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
|
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_afshaper
|
#define FT_COMPONENT trace_afshaper
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afshaper.h */
|
* afshaper.h
|
||||||
/* */
|
*
|
||||||
/* HarfBuzz interface for accessing OpenType features (specification). */
|
* HarfBuzz interface for accessing OpenType features (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2013-2018 by */
|
* Copyright 2013-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef AFSHAPER_H_
|
#ifndef AFSHAPER_H_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afstyles.h */
|
* afstyles.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter styles (specification only). */
|
* Auto-fitter styles (specification only).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2013-2018 by */
|
* Copyright 2013-2018 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 following part can be included multiple times. */
|
/* The following part can be included multiple times. */
|
||||||
|
|
|
@ -1,30 +1,30 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* aftypes.h */
|
* aftypes.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter types (specification only). */
|
* Auto-fitter types (specification only).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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 auto-fitter is a complete rewrite of the old auto-hinter.
|
* The auto-fitter is a complete rewrite of the old auto-hinter.
|
||||||
* Its main feature is the ability to differentiate between different
|
* Its main feature is the ability to differentiate between different
|
||||||
* writing systems and scripts in order to apply specific rules.
|
* writing systems and scripts in order to apply specific rules.
|
||||||
*
|
*
|
||||||
* The code has also been compartmentalized into several entities that
|
* The code has also been compartmentalized into several entities that
|
||||||
* should make algorithmic experimentation easier than with the old
|
* should make algorithmic experimentation easier than with the old
|
||||||
* code.
|
* code.
|
||||||
*
|
*
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
|
@ -102,9 +102,9 @@ extern void* _af_debug_hints;
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The auto-fitter doesn't need a very high angular accuracy;
|
* The auto-fitter doesn't need a very high angular accuracy;
|
||||||
* this allows us to speed up some computations considerably with a
|
* this allows us to speed up some computations considerably with a
|
||||||
* light Cordic algorithm (see afangles.c).
|
* light Cordic algorithm (see afangles.c).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef FT_Int AF_Angle;
|
typedef FT_Int AF_Angle;
|
||||||
|
@ -118,7 +118,7 @@ extern void* _af_debug_hints;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/*
|
/*
|
||||||
* compute the angle of a given 2-D vector
|
* compute the angle of a given 2-D vector
|
||||||
*/
|
*/
|
||||||
FT_LOCAL( AF_Angle )
|
FT_LOCAL( AF_Angle )
|
||||||
af_angle_atan( FT_Pos dx,
|
af_angle_atan( FT_Pos dx,
|
||||||
|
@ -126,8 +126,8 @@ extern void* _af_debug_hints;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* compute `angle2 - angle1'; the result is always within
|
* compute `angle2 - angle1'; the result is always within
|
||||||
* the range [-AF_ANGLE_PI .. AF_ANGLE_PI - 1]
|
* the range [-AF_ANGLE_PI .. AF_ANGLE_PI - 1]
|
||||||
*/
|
*/
|
||||||
FT_LOCAL( AF_Angle )
|
FT_LOCAL( AF_Angle )
|
||||||
af_angle_diff( AF_Angle angle1,
|
af_angle_diff( AF_Angle angle1,
|
||||||
|
@ -150,8 +150,9 @@ extern void* _af_debug_hints;
|
||||||
FT_END_STMNT
|
FT_END_STMNT
|
||||||
|
|
||||||
|
|
||||||
/* opaque handle to glyph-specific hints -- see `afhints.h' for more
|
/*
|
||||||
* details
|
* opaque handle to glyph-specific hints -- see `afhints.h' for more
|
||||||
|
* details
|
||||||
*/
|
*/
|
||||||
typedef struct AF_GlyphHintsRec_* AF_GlyphHints;
|
typedef struct AF_GlyphHintsRec_* AF_GlyphHints;
|
||||||
|
|
||||||
|
@ -165,8 +166,8 @@ extern void* _af_debug_hints;
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A scaler models the target pixel device that will receive the
|
* A scaler models the target pixel device that will receive the
|
||||||
* auto-hinted glyph image.
|
* auto-hinted glyph image.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define AF_SCALER_FLAG_NO_HORIZONTAL 1U /* disable horizontal hinting */
|
#define AF_SCALER_FLAG_NO_HORIZONTAL 1U /* disable horizontal hinting */
|
||||||
|
@ -197,8 +198,9 @@ extern void* _af_debug_hints;
|
||||||
|
|
||||||
typedef struct AF_StyleMetricsRec_* AF_StyleMetrics;
|
typedef struct AF_StyleMetricsRec_* AF_StyleMetrics;
|
||||||
|
|
||||||
/* This function parses an FT_Face to compute global metrics for
|
/*
|
||||||
* a specific style.
|
* This function parses an FT_Face to compute global metrics for
|
||||||
|
* a specific style.
|
||||||
*/
|
*/
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
(*AF_WritingSystem_InitMetricsFunc)( AF_StyleMetrics metrics,
|
(*AF_WritingSystem_InitMetricsFunc)( AF_StyleMetrics metrics,
|
||||||
|
@ -237,22 +239,22 @@ extern void* _af_debug_hints;
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For the auto-hinter, a writing system consists of multiple scripts that
|
* For the auto-hinter, a writing system consists of multiple scripts that
|
||||||
* can be handled similarly *in a typographical way*; the relationship is
|
* can be handled similarly *in a typographical way*; the relationship is
|
||||||
* not based on history. For example, both the Greek and the unrelated
|
* not based on history. For example, both the Greek and the unrelated
|
||||||
* Armenian scripts share the same features like ascender, descender,
|
* Armenian scripts share the same features like ascender, descender,
|
||||||
* x-height, etc. Essentially, a writing system is covered by a
|
* x-height, etc. Essentially, a writing system is covered by a
|
||||||
* submodule of the auto-fitter; it contains
|
* submodule of the auto-fitter; it contains
|
||||||
*
|
*
|
||||||
* - a specific global analyzer that computes global metrics specific to
|
* - a specific global analyzer that computes global metrics specific to
|
||||||
* the script (based on script-specific characters to identify ascender
|
* the script (based on script-specific characters to identify ascender
|
||||||
* height, x-height, etc.),
|
* height, x-height, etc.),
|
||||||
*
|
*
|
||||||
* - a specific glyph analyzer that computes segments and edges for each
|
* - a specific glyph analyzer that computes segments and edges for each
|
||||||
* glyph covered by the script,
|
* glyph covered by the script,
|
||||||
*
|
*
|
||||||
* - a specific grid-fitting algorithm that distorts the scaled glyph
|
* - a specific grid-fitting algorithm that distorts the scaled glyph
|
||||||
* outline according to the results of the glyph analyzer.
|
* outline according to the results of the glyph analyzer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define AFWRTSYS_H_ /* don't load header files */
|
#define AFWRTSYS_H_ /* don't load header files */
|
||||||
|
@ -300,12 +302,12 @@ extern void* _af_debug_hints;
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Each script is associated with two sets of Unicode ranges to test
|
* Each script is associated with two sets of Unicode ranges to test
|
||||||
* whether the font face supports the script, and which non-base
|
* whether the font face supports the script, and which non-base
|
||||||
* characters the script contains.
|
* characters the script contains.
|
||||||
*
|
*
|
||||||
* We use four-letter script tags from the OpenType specification,
|
* We use four-letter script tags from the OpenType specification,
|
||||||
* extended by `NONE', which indicates `no script'.
|
* extended by `NONE', which indicates `no script'.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef SCRIPT
|
#undef SCRIPT
|
||||||
|
@ -361,41 +363,41 @@ extern void* _af_debug_hints;
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Usually, a font contains more glyphs than can be addressed by its
|
* Usually, a font contains more glyphs than can be addressed by its
|
||||||
* character map.
|
* character map.
|
||||||
*
|
*
|
||||||
* In the PostScript font world, encoding vectors specific to a given
|
* In the PostScript font world, encoding vectors specific to a given
|
||||||
* task are used to select such glyphs, and these glyphs can be often
|
* task are used to select such glyphs, and these glyphs can be often
|
||||||
* recognized by having a suffix in its glyph names. For example, a
|
* recognized by having a suffix in its glyph names. For example, a
|
||||||
* superscript glyph `A' might be called `A.sup'. Unfortunately, this
|
* superscript glyph `A' might be called `A.sup'. Unfortunately, this
|
||||||
* naming scheme is not standardized and thus unusable for us.
|
* naming scheme is not standardized and thus unusable for us.
|
||||||
*
|
*
|
||||||
* In the OpenType world, a better solution was invented, namely
|
* In the OpenType world, a better solution was invented, namely
|
||||||
* `features', which cleanly separate a character's input encoding from
|
* `features', which cleanly separate a character's input encoding from
|
||||||
* the corresponding glyph's appearance, and which don't use glyph names
|
* the corresponding glyph's appearance, and which don't use glyph names
|
||||||
* at all. For our purposes, and slightly generalized, an OpenType
|
* at all. For our purposes, and slightly generalized, an OpenType
|
||||||
* feature is a name of a mapping that maps character codes to
|
* feature is a name of a mapping that maps character codes to
|
||||||
* non-standard glyph indices (features get used for other things also).
|
* non-standard glyph indices (features get used for other things also).
|
||||||
* For example, the `sups' feature provides superscript glyphs, thus
|
* For example, the `sups' feature provides superscript glyphs, thus
|
||||||
* mapping character codes like `A' or `B' to superscript glyph
|
* mapping character codes like `A' or `B' to superscript glyph
|
||||||
* representation forms. How this mapping happens is completely
|
* representation forms. How this mapping happens is completely
|
||||||
* uninteresting to us.
|
* uninteresting to us.
|
||||||
*
|
*
|
||||||
* For the auto-hinter, a `coverage' represents all glyphs of an OpenType
|
* For the auto-hinter, a `coverage' represents all glyphs of an OpenType
|
||||||
* feature collected in a set (as listed below) that can be hinted
|
* feature collected in a set (as listed below) that can be hinted
|
||||||
* together. To continue the above example, superscript glyphs must not
|
* together. To continue the above example, superscript glyphs must not
|
||||||
* be hinted together with normal glyphs because the blue zones
|
* be hinted together with normal glyphs because the blue zones
|
||||||
* completely differ.
|
* completely differ.
|
||||||
*
|
*
|
||||||
* Note that FreeType itself doesn't compute coverages; it only provides
|
* Note that FreeType itself doesn't compute coverages; it only provides
|
||||||
* the glyphs addressable by the default Unicode character map. Instead,
|
* the glyphs addressable by the default Unicode character map. Instead,
|
||||||
* we use the HarfBuzz library (if available), which has many functions
|
* we use the HarfBuzz library (if available), which has many functions
|
||||||
* exactly for this purpose.
|
* exactly for this purpose.
|
||||||
*
|
*
|
||||||
* AF_COVERAGE_DEFAULT is special: It should cover everything that isn't
|
* AF_COVERAGE_DEFAULT is special: It should cover everything that isn't
|
||||||
* listed separately (including the glyphs addressable by the character
|
* listed separately (including the glyphs addressable by the character
|
||||||
* map). In case HarfBuzz isn't available, it exactly covers the glyphs
|
* map). In case HarfBuzz isn't available, it exactly covers the glyphs
|
||||||
* addressable by the character map.
|
* addressable by the character map.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -423,8 +425,8 @@ extern void* _af_debug_hints;
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The topmost structure for modelling the auto-hinter glyph input data
|
* The topmost structure for modelling the auto-hinter glyph input data
|
||||||
* is a `style class', grouping everything together.
|
* is a `style class', grouping everything together.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef STYLE
|
#undef STYLE
|
||||||
|
|
|
@ -1,38 +1,38 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afwarp.c */
|
* afwarp.c
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter warping algorithm (body). */
|
* Auto-fitter warping algorithm (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2006-2018 by */
|
* Copyright 2006-2018 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 idea of the warping code is to slightly scale and shift a glyph
|
* The idea of the warping code is to slightly scale and shift a glyph
|
||||||
* within a single dimension so that as much of its segments are aligned
|
* within a single dimension so that as much of its segments are aligned
|
||||||
* (more or less) on the grid. To find out the optimal scaling and
|
* (more or less) on the grid. To find out the optimal scaling and
|
||||||
* shifting value, various parameter combinations are tried and scored.
|
* shifting value, various parameter combinations are tried and scored.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "afwarp.h"
|
#include "afwarp.h"
|
||||||
|
|
||||||
#ifdef AF_CONFIG_OPTION_USE_WARPER
|
#ifdef AF_CONFIG_OPTION_USE_WARPER
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_afwarp
|
#define FT_COMPONENT trace_afwarp
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afwarp.h */
|
* afwarp.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter warping algorithm (specification). */
|
* Auto-fitter warping algorithm (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2006-2018 by */
|
* Copyright 2006-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef AFWARP_H_
|
#ifndef AFWARP_H_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* afwrtsys.h */
|
* afwrtsys.h
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter writing systems (specification only). */
|
* Auto-fitter writing systems (specification only).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2013-2018 by */
|
* Copyright 2013-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef AFWRTSYS_H_
|
#ifndef AFWRTSYS_H_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* autofit.c */
|
* autofit.c
|
||||||
/* */
|
*
|
||||||
/* Auto-fitter module (body). */
|
* Auto-fitter module (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define FT_MAKE_OPTION_SINGLE_OBJECT
|
#define FT_MAKE_OPTION_SINGLE_OBJECT
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftadvanc.c */
|
* ftadvanc.c
|
||||||
/* */
|
*
|
||||||
/* Quick computation of advance widths (body). */
|
* Quick computation of advance widths (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2008-2018 by */
|
* Copyright 2008-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftapi.c */
|
* ftapi.c
|
||||||
/* */
|
*
|
||||||
/* The FreeType compatibility functions (body). */
|
* The FreeType compatibility functions (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2002-2018 by */
|
* Copyright 2002-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftbase.c */
|
* ftbase.c
|
||||||
/* */
|
*
|
||||||
/* Single object library component (body only). */
|
* Single object library component (body only).
|
||||||
/* */
|
*
|
||||||
/* Copyright 1996-2018 by */
|
* Copyright 1996-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftbase.h */
|
* ftbase.h
|
||||||
/* */
|
*
|
||||||
/* Private functions used in the `base' module (specification). */
|
* Private functions used in the `base' module (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2008-2018 by */
|
* Copyright 2008-2018 by
|
||||||
/* David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya. */
|
* David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya.
|
||||||
/* */
|
*
|
||||||
/* 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef FTBASE_H_
|
#ifndef FTBASE_H_
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftbbox.c */
|
* ftbbox.c
|
||||||
/* */
|
*
|
||||||
/* FreeType bbox computation (body). */
|
* FreeType bbox computation (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 1996-2018 by */
|
* Copyright 1996-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* This component has a _single_ role: to compute exact outline bounding */
|
* This component has a _single_ role: to compute exact outline bounding
|
||||||
/* boxes. */
|
* boxes.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -61,26 +61,28 @@
|
||||||
( p->y < bbox.yMin || p->y > bbox.yMax )
|
( p->y < bbox.yMin || p->y > bbox.yMax )
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* BBox_Move_To */
|
* BBox_Move_To
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* This function is used as a `move_to' emitter during */
|
* This function is used as a `move_to' emitter during
|
||||||
/* FT_Outline_Decompose(). It simply records the destination point */
|
* FT_Outline_Decompose(). It simply records the destination point
|
||||||
/* in `user->last'. We also update bbox in case contour starts with */
|
* in `user->last'. We also update bbox in case contour starts with
|
||||||
/* an implicit `on' point. */
|
* an implicit `on' point.
|
||||||
/* */
|
*
|
||||||
/* <Input> */
|
* @Input:
|
||||||
/* to :: A pointer to the destination vector. */
|
* to ::
|
||||||
/* */
|
* A pointer to the destination vector.
|
||||||
/* <InOut> */
|
*
|
||||||
/* user :: A pointer to the current walk context. */
|
* @InOut:
|
||||||
/* */
|
* user ::
|
||||||
/* <Return> */
|
* A pointer to the current walk context.
|
||||||
/* Always 0. Needed for the interface only. */
|
*
|
||||||
/* */
|
* @Return:
|
||||||
|
* Always 0. Needed for the interface only.
|
||||||
|
*/
|
||||||
static int
|
static int
|
||||||
BBox_Move_To( FT_Vector* to,
|
BBox_Move_To( FT_Vector* to,
|
||||||
TBBox_Rec* user )
|
TBBox_Rec* user )
|
||||||
|
@ -93,26 +95,28 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* BBox_Line_To */
|
* BBox_Line_To
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* This function is used as a `line_to' emitter during */
|
* This function is used as a `line_to' emitter during
|
||||||
/* FT_Outline_Decompose(). It simply records the destination point */
|
* FT_Outline_Decompose(). It simply records the destination point
|
||||||
/* in `user->last'; no further computations are necessary because */
|
* in `user->last'; no further computations are necessary because
|
||||||
/* bbox already contains both explicit ends of the line segment. */
|
* bbox already contains both explicit ends of the line segment.
|
||||||
/* */
|
*
|
||||||
/* <Input> */
|
* @Input:
|
||||||
/* to :: A pointer to the destination vector. */
|
* to ::
|
||||||
/* */
|
* A pointer to the destination vector.
|
||||||
/* <InOut> */
|
*
|
||||||
/* user :: A pointer to the current walk context. */
|
* @InOut:
|
||||||
/* */
|
* user ::
|
||||||
/* <Return> */
|
* A pointer to the current walk context.
|
||||||
/* Always 0. Needed for the interface only. */
|
*
|
||||||
/* */
|
* @Return:
|
||||||
|
* Always 0. Needed for the interface only.
|
||||||
|
*/
|
||||||
static int
|
static int
|
||||||
BBox_Line_To( FT_Vector* to,
|
BBox_Line_To( FT_Vector* to,
|
||||||
TBBox_Rec* user )
|
TBBox_Rec* user )
|
||||||
|
@ -123,28 +127,33 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* BBox_Conic_Check */
|
* BBox_Conic_Check
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* Find the extrema of a 1-dimensional conic Bezier curve and update */
|
* Find the extrema of a 1-dimensional conic Bezier curve and update
|
||||||
/* a bounding range. This version uses direct computation, as it */
|
* a bounding range. This version uses direct computation, as it
|
||||||
/* doesn't need square roots. */
|
* doesn't need square roots.
|
||||||
/* */
|
*
|
||||||
/* <Input> */
|
* @Input:
|
||||||
/* y1 :: The start coordinate. */
|
* y1 ::
|
||||||
/* */
|
* The start coordinate.
|
||||||
/* y2 :: The coordinate of the control point. */
|
*
|
||||||
/* */
|
* y2 ::
|
||||||
/* y3 :: The end coordinate. */
|
* The coordinate of the control point.
|
||||||
/* */
|
*
|
||||||
/* <InOut> */
|
* y3 ::
|
||||||
/* min :: The address of the current minimum. */
|
* The end coordinate.
|
||||||
/* */
|
*
|
||||||
/* max :: The address of the current maximum. */
|
* @InOut:
|
||||||
/* */
|
* min ::
|
||||||
|
* The address of the current minimum.
|
||||||
|
*
|
||||||
|
* max ::
|
||||||
|
* The address of the current maximum.
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
BBox_Conic_Check( FT_Pos y1,
|
BBox_Conic_Check( FT_Pos y1,
|
||||||
FT_Pos y2,
|
FT_Pos y2,
|
||||||
|
@ -168,32 +177,35 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* BBox_Conic_To */
|
* BBox_Conic_To
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* This function is used as a `conic_to' emitter during */
|
* This function is used as a `conic_to' emitter during
|
||||||
/* FT_Outline_Decompose(). It checks a conic Bezier curve with the */
|
* FT_Outline_Decompose(). It checks a conic Bezier curve with the
|
||||||
/* current bounding box, and computes its extrema if necessary to */
|
* current bounding box, and computes its extrema if necessary to
|
||||||
/* update it. */
|
* update it.
|
||||||
/* */
|
*
|
||||||
/* <Input> */
|
* @Input:
|
||||||
/* control :: A pointer to a control point. */
|
* control ::
|
||||||
/* */
|
* A pointer to a control point.
|
||||||
/* to :: A pointer to the destination vector. */
|
*
|
||||||
/* */
|
* to ::
|
||||||
/* <InOut> */
|
* A pointer to the destination vector.
|
||||||
/* user :: The address of the current walk context. */
|
*
|
||||||
/* */
|
* @InOut:
|
||||||
/* <Return> */
|
* user ::
|
||||||
/* Always 0. Needed for the interface only. */
|
* The address of the current walk context.
|
||||||
/* */
|
*
|
||||||
/* <Note> */
|
* @Return:
|
||||||
/* In the case of a non-monotonous arc, we compute directly the */
|
* Always 0. Needed for the interface only.
|
||||||
/* extremum coordinates, as it is sufficiently fast. */
|
*
|
||||||
/* */
|
* @Note:
|
||||||
|
* In the case of a non-monotonous arc, we compute directly the
|
||||||
|
* extremum coordinates, as it is sufficiently fast.
|
||||||
|
*/
|
||||||
static int
|
static int
|
||||||
BBox_Conic_To( FT_Vector* control,
|
BBox_Conic_To( FT_Vector* control,
|
||||||
FT_Vector* to,
|
FT_Vector* to,
|
||||||
|
@ -222,30 +234,36 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* BBox_Cubic_Check */
|
* BBox_Cubic_Check
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* Find the extrema of a 1-dimensional cubic Bezier curve and */
|
* Find the extrema of a 1-dimensional cubic Bezier curve and
|
||||||
/* update a bounding range. This version uses iterative splitting */
|
* update a bounding range. This version uses iterative splitting
|
||||||
/* because it is faster than the exact solution with square roots. */
|
* because it is faster than the exact solution with square roots.
|
||||||
/* */
|
*
|
||||||
/* <Input> */
|
* @Input:
|
||||||
/* p1 :: The start coordinate. */
|
* p1 ::
|
||||||
/* */
|
* The start coordinate.
|
||||||
/* p2 :: The coordinate of the first control point. */
|
*
|
||||||
/* */
|
* p2 ::
|
||||||
/* p3 :: The coordinate of the second control point. */
|
* The coordinate of the first control point.
|
||||||
/* */
|
*
|
||||||
/* p4 :: The end coordinate. */
|
* p3 ::
|
||||||
/* */
|
* The coordinate of the second control point.
|
||||||
/* <InOut> */
|
*
|
||||||
/* min :: The address of the current minimum. */
|
* p4 ::
|
||||||
/* */
|
* The end coordinate.
|
||||||
/* max :: The address of the current maximum. */
|
*
|
||||||
/* */
|
* @InOut:
|
||||||
|
* min ::
|
||||||
|
* The address of the current minimum.
|
||||||
|
*
|
||||||
|
* max ::
|
||||||
|
* The address of the current maximum.
|
||||||
|
*/
|
||||||
static FT_Pos
|
static FT_Pos
|
||||||
cubic_peak( FT_Pos q1,
|
cubic_peak( FT_Pos q1,
|
||||||
FT_Pos q2,
|
FT_Pos q2,
|
||||||
|
@ -361,34 +379,38 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* BBox_Cubic_To */
|
* BBox_Cubic_To
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* This function is used as a `cubic_to' emitter during */
|
* This function is used as a `cubic_to' emitter during
|
||||||
/* FT_Outline_Decompose(). It checks a cubic Bezier curve with the */
|
* FT_Outline_Decompose(). It checks a cubic Bezier curve with the
|
||||||
/* current bounding box, and computes its extrema if necessary to */
|
* current bounding box, and computes its extrema if necessary to
|
||||||
/* update it. */
|
* update it.
|
||||||
/* */
|
*
|
||||||
/* <Input> */
|
* @Input:
|
||||||
/* control1 :: A pointer to the first control point. */
|
* control1 ::
|
||||||
/* */
|
* A pointer to the first control point.
|
||||||
/* control2 :: A pointer to the second control point. */
|
*
|
||||||
/* */
|
* control2 ::
|
||||||
/* to :: A pointer to the destination vector. */
|
* A pointer to the second control point.
|
||||||
/* */
|
*
|
||||||
/* <InOut> */
|
* to ::
|
||||||
/* user :: The address of the current walk context. */
|
* A pointer to the destination vector.
|
||||||
/* */
|
*
|
||||||
/* <Return> */
|
* @InOut:
|
||||||
/* Always 0. Needed for the interface only. */
|
* user ::
|
||||||
/* */
|
* The address of the current walk context.
|
||||||
/* <Note> */
|
*
|
||||||
/* In the case of a non-monotonous arc, we don't compute directly */
|
* @Return:
|
||||||
/* extremum coordinates, we subdivide instead. */
|
* Always 0. Needed for the interface only.
|
||||||
/* */
|
*
|
||||||
|
* @Note:
|
||||||
|
* In the case of a non-monotonous arc, we don't compute directly
|
||||||
|
* extremum coordinates, we subdivide instead.
|
||||||
|
*/
|
||||||
static int
|
static int
|
||||||
BBox_Cubic_To( FT_Vector* control1,
|
BBox_Cubic_To( FT_Vector* control1,
|
||||||
FT_Vector* control2,
|
FT_Vector* control2,
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftbdf.c */
|
* ftbdf.c
|
||||||
/* */
|
*
|
||||||
/* FreeType API for accessing BDF-specific strings (body). */
|
* FreeType API for accessing BDF-specific strings (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2002-2018 by */
|
* Copyright 2002-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftbitmap.c */
|
* ftbitmap.c
|
||||||
/* */
|
*
|
||||||
/* FreeType utility functions for bitmaps (body). */
|
* FreeType utility functions for bitmaps (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2004-2018 by */
|
* Copyright 2004-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,35 +1,35 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftcalc.c */
|
* ftcalc.c
|
||||||
/* */
|
*
|
||||||
/* Arithmetic computations (body). */
|
* Arithmetic computations (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 1996-2018 by */
|
* Copyright 1996-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* Support for 1-complement arithmetic has been totally dropped in this */
|
* Support for 1-complement arithmetic has been totally dropped in this
|
||||||
/* release. You can still write your own code if you need it. */
|
* release. You can still write your own code if you need it.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* Implementing basic computation routines. */
|
* Implementing basic computation routines.
|
||||||
/* */
|
*
|
||||||
/* FT_MulDiv(), FT_MulFix(), FT_DivFix(), FT_RoundFix(), FT_CeilFix(), */
|
* FT_MulDiv(), FT_MulFix(), FT_DivFix(), FT_RoundFix(), FT_CeilFix(),
|
||||||
/* and FT_FloorFix() are declared in freetype.h. */
|
* and FT_FloorFix() are declared in freetype.h.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -58,12 +58,12 @@
|
||||||
#endif /* !FT_LONG64 */
|
#endif /* !FT_LONG64 */
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_calc
|
#define FT_COMPONENT trace_calc
|
||||||
|
|
||||||
|
@ -516,10 +516,10 @@
|
||||||
#elif 0
|
#elif 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This code is nonportable. See comment below.
|
* This code is nonportable. See comment below.
|
||||||
*
|
*
|
||||||
* However, on a platform where right-shift of a signed quantity fills
|
* However, on a platform where right-shift of a signed quantity fills
|
||||||
* the leftmost bits by copying the sign bit, it might be faster.
|
* the leftmost bits by copying the sign bit, it might be faster.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
FT_Long sa, sb;
|
FT_Long sa, sb;
|
||||||
|
@ -527,22 +527,22 @@
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is a clever way of converting a signed number `a' into its
|
* This is a clever way of converting a signed number `a' into its
|
||||||
* absolute value (stored back into `a') and its sign. The sign is
|
* absolute value (stored back into `a') and its sign. The sign is
|
||||||
* stored in `sa'; 0 means `a' was positive or zero, and -1 means `a'
|
* stored in `sa'; 0 means `a' was positive or zero, and -1 means `a'
|
||||||
* was negative. (Similarly for `b' and `sb').
|
* was negative. (Similarly for `b' and `sb').
|
||||||
*
|
*
|
||||||
* Unfortunately, it doesn't work (at least not portably).
|
* Unfortunately, it doesn't work (at least not portably).
|
||||||
*
|
*
|
||||||
* It makes the assumption that right-shift on a negative signed value
|
* It makes the assumption that right-shift on a negative signed value
|
||||||
* fills the leftmost bits by copying the sign bit. This is wrong.
|
* fills the leftmost bits by copying the sign bit. This is wrong.
|
||||||
* According to K&R 2nd ed, section `A7.8 Shift Operators' on page 206,
|
* According to K&R 2nd ed, section `A7.8 Shift Operators' on page 206,
|
||||||
* the result of right-shift of a negative signed value is
|
* the result of right-shift of a negative signed value is
|
||||||
* implementation-defined. At least one implementation fills the
|
* implementation-defined. At least one implementation fills the
|
||||||
* leftmost bits with 0s (i.e., it is exactly the same as an unsigned
|
* leftmost bits with 0s (i.e., it is exactly the same as an unsigned
|
||||||
* right shift). This means that when `a' is negative, `sa' ends up
|
* right shift). This means that when `a' is negative, `sa' ends up
|
||||||
* with the value 1 rather than -1. After that, everything else goes
|
* with the value 1 rather than -1. After that, everything else goes
|
||||||
* wrong.
|
* wrong.
|
||||||
*/
|
*/
|
||||||
sa = ( a_ >> ( sizeof ( a_ ) * 8 - 1 ) );
|
sa = ( a_ >> ( sizeof ( a_ ) * 8 - 1 ) );
|
||||||
a = ( a_ ^ sa ) - sa;
|
a = ( a_ ^ sa ) - sa;
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftcid.c */
|
* ftcid.c
|
||||||
/* */
|
*
|
||||||
/* FreeType API for accessing CID font information. */
|
* FreeType API for accessing CID font information.
|
||||||
/* */
|
*
|
||||||
/* Copyright 2007-2018 by */
|
* Copyright 2007-2018 by
|
||||||
/* Derek Clegg and Michael Toftdal. */
|
* Derek Clegg and Michael Toftdal.
|
||||||
/* */
|
*
|
||||||
/* 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftdbgmem.c */
|
* ftdbgmem.c
|
||||||
/* */
|
*
|
||||||
/* Memory debugger (body). */
|
* Memory debugger (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2001-2018 by */
|
* Copyright 2001-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -50,9 +50,9 @@
|
||||||
#define FT_MEM_VAL( addr ) ( (FT_PtrDist)(FT_Pointer)( addr ) )
|
#define FT_MEM_VAL( addr ) ( (FT_PtrDist)(FT_Pointer)( addr ) )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This structure holds statistics for a single allocation/release
|
* This structure holds statistics for a single allocation/release
|
||||||
* site. This is useful to know where memory operations happen the
|
* site. This is useful to know where memory operations happen the
|
||||||
* most.
|
* most.
|
||||||
*/
|
*/
|
||||||
typedef struct FT_MemSourceRec_
|
typedef struct FT_MemSourceRec_
|
||||||
{
|
{
|
||||||
|
@ -76,17 +76,17 @@
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We don't need a resizable array for the memory sources because
|
* We don't need a resizable array for the memory sources because
|
||||||
* their number is pretty limited within FreeType.
|
* their number is pretty limited within FreeType.
|
||||||
*/
|
*/
|
||||||
#define FT_MEM_SOURCE_BUCKETS 128
|
#define FT_MEM_SOURCE_BUCKETS 128
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This structure holds information related to a single allocated
|
* This structure holds information related to a single allocated
|
||||||
* memory block. If KEEPALIVE is defined, blocks that are freed by
|
* memory block. If KEEPALIVE is defined, blocks that are freed by
|
||||||
* FreeType are never released to the system. Instead, their `size'
|
* FreeType are never released to the system. Instead, their `size'
|
||||||
* field is set to `-size'. This is mainly useful to detect double
|
* field is set to `-size'. This is mainly useful to detect double
|
||||||
* frees, at the price of a large memory footprint during execution.
|
* frees, at the price of a large memory footprint during execution.
|
||||||
*/
|
*/
|
||||||
typedef struct FT_MemNodeRec_
|
typedef struct FT_MemNodeRec_
|
||||||
{
|
{
|
||||||
|
@ -106,8 +106,8 @@
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The global structure, containing compound statistics and all hash
|
* The global structure, containing compound statistics and all hash
|
||||||
* tables.
|
* tables.
|
||||||
*/
|
*/
|
||||||
typedef struct FT_MemTableRec_
|
typedef struct FT_MemTableRec_
|
||||||
{
|
{
|
||||||
|
@ -146,8 +146,8 @@
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prime numbers are ugly to handle. It would be better to implement
|
* Prime numbers are ugly to handle. It would be better to implement
|
||||||
* L-Hashing, which is 10% faster and doesn't require divisions.
|
* L-Hashing, which is 10% faster and doesn't require divisions.
|
||||||
*/
|
*/
|
||||||
static const FT_Int ft_mem_primes[] =
|
static const FT_Int ft_mem_primes[] =
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,44 +1,44 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftdebug.c */
|
* ftdebug.c
|
||||||
/* */
|
*
|
||||||
/* Debugging and logging component (body). */
|
* Debugging and logging component (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 1996-2018 by */
|
* Copyright 1996-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* This component contains various macros and functions used to ease the */
|
* This component contains various macros and functions used to ease the
|
||||||
/* debugging of the FreeType engine. Its main purpose is in assertion */
|
* debugging of the FreeType engine. Its main purpose is in assertion
|
||||||
/* checking, tracing, and error detection. */
|
* checking, tracing, and error detection.
|
||||||
/* */
|
*
|
||||||
/* There are now three debugging modes: */
|
* There are now three debugging modes:
|
||||||
/* */
|
*
|
||||||
/* - trace mode */
|
* - trace mode
|
||||||
/* */
|
*
|
||||||
/* Error and trace messages are sent to the log file (which can be the */
|
* Error and trace messages are sent to the log file (which can be the
|
||||||
/* standard error output). */
|
* standard error output).
|
||||||
/* */
|
*
|
||||||
/* - error mode */
|
* - error mode
|
||||||
/* */
|
*
|
||||||
/* Only error messages are generated. */
|
* Only error messages are generated.
|
||||||
/* */
|
*
|
||||||
/* - release mode: */
|
* - release mode:
|
||||||
/* */
|
*
|
||||||
/* No error message is sent or generated. The code is free from any */
|
* No error message is sent or generated. The code is free from any
|
||||||
/* debugging parts. */
|
* debugging parts.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -140,24 +140,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* Initialize the tracing sub-system. This is done by retrieving the */
|
* Initialize the tracing sub-system. This is done by retrieving the
|
||||||
/* value of the `FT2_DEBUG' environment variable. It must be a list of */
|
* value of the `FT2_DEBUG' environment variable. It must be a list of
|
||||||
/* toggles, separated by spaces, `;', or `,'. Example: */
|
* toggles, separated by spaces, `;', or `,'. Example:
|
||||||
/* */
|
*
|
||||||
/* export FT2_DEBUG="any:3 memory:7 stream:5" */
|
* export FT2_DEBUG="any:3 memory:7 stream:5"
|
||||||
/* */
|
*
|
||||||
/* This requests that all levels be set to 3, except the trace level for */
|
* This requests that all levels be set to 3, except the trace level for
|
||||||
/* the memory and stream components which are set to 7 and 5, */
|
* the memory and stream components which are set to 7 and 5,
|
||||||
/* respectively. */
|
* respectively.
|
||||||
/* */
|
*
|
||||||
/* See the file `include/freetype/internal/fttrace.h' for details of */
|
* See the file `include/freetype/internal/fttrace.h' for details of
|
||||||
/* the available toggle names. */
|
* the available toggle names.
|
||||||
/* */
|
*
|
||||||
/* The level must be between 0 and 7; 0 means quiet (except for serious */
|
* The level must be between 0 and 7; 0 means quiet (except for serious
|
||||||
/* runtime errors), and 7 means _very_ verbose. */
|
* runtime errors), and 7 means _very_ verbose.
|
||||||
/* */
|
*/
|
||||||
FT_BASE_DEF( void )
|
FT_BASE_DEF( void )
|
||||||
ft_debug_init( void )
|
ft_debug_init( void )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftfntfmt.c */
|
* ftfntfmt.c
|
||||||
/* */
|
*
|
||||||
/* FreeType utility file for font formats (body). */
|
* FreeType utility file for font formats (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2002-2018 by */
|
* Copyright 2002-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftfstype.c */
|
* ftfstype.c
|
||||||
/* */
|
*
|
||||||
/* FreeType utility file to access FSType data (body). */
|
* FreeType utility file to access FSType data (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2008-2018 by */
|
* Copyright 2008-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
#include FT_TYPE1_TABLES_H
|
#include FT_TYPE1_TABLES_H
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftgasp.c */
|
* ftgasp.c
|
||||||
/* */
|
*
|
||||||
/* Access of TrueType's `gasp' table (body). */
|
* Access of TrueType's `gasp' table (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2007-2018 by */
|
* Copyright 2007-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftgloadr.c */
|
* ftgloadr.c
|
||||||
/* */
|
*
|
||||||
/* The FreeType glyph loader (body). */
|
* The FreeType glyph loader (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2002-2018 by */
|
* Copyright 2002-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -38,31 +38,31 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The glyph loader is a simple object which is used to load a set of */
|
* The glyph loader is a simple object which is used to load a set of
|
||||||
/* glyphs easily. It is critical for the correct loading of composites. */
|
* glyphs easily. It is critical for the correct loading of composites.
|
||||||
/* */
|
*
|
||||||
/* Ideally, one can see it as a stack of abstract `glyph' objects. */
|
* Ideally, one can see it as a stack of abstract `glyph' objects.
|
||||||
/* */
|
*
|
||||||
/* loader.base Is really the bottom of the stack. It describes a */
|
* loader.base Is really the bottom of the stack. It describes a
|
||||||
/* single glyph image made of the juxtaposition of */
|
* single glyph image made of the juxtaposition of
|
||||||
/* several glyphs (those `in the stack'). */
|
* several glyphs (those `in the stack').
|
||||||
/* */
|
*
|
||||||
/* loader.current Describes the top of the stack, on which a new */
|
* loader.current Describes the top of the stack, on which a new
|
||||||
/* glyph can be loaded. */
|
* glyph can be loaded.
|
||||||
/* */
|
*
|
||||||
/* Rewind Clears the stack. */
|
* Rewind Clears the stack.
|
||||||
/* Prepare Set up `loader.current' for addition of a new glyph */
|
* Prepare Set up `loader.current' for addition of a new glyph
|
||||||
/* image. */
|
* image.
|
||||||
/* Add Add the `current' glyph image to the `base' one, */
|
* Add Add the `current' glyph image to the `base' one,
|
||||||
/* and prepare for another one. */
|
* and prepare for another one.
|
||||||
/* */
|
*
|
||||||
/* The glyph loader is now a base object. Each driver used to */
|
* The glyph loader is now a base object. Each driver used to
|
||||||
/* re-implement it in one way or the other, which wasted code and */
|
* re-implement it in one way or the other, which wasted code and
|
||||||
/* energy. */
|
* energy.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* create a new glyph loader */
|
/* create a new glyph loader */
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftglyph.c */
|
* ftglyph.c
|
||||||
/* */
|
*
|
||||||
/* FreeType convenience functions to handle glyphs (body). */
|
* FreeType convenience functions to handle glyphs (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 1996-2018 by */
|
* Copyright 1996-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* This file contains the definition of several convenience functions */
|
* This file contains the definition of several convenience functions
|
||||||
/* that can be used by client applications to easily retrieve glyph */
|
* that can be used by client applications to easily retrieve glyph
|
||||||
/* bitmaps and outlines from a given face. */
|
* bitmaps and outlines from a given face.
|
||||||
/* */
|
*
|
||||||
/* These functions should be optional if you are writing a font server */
|
* These functions should be optional if you are writing a font server
|
||||||
/* or text layout engine on top of FreeType. However, they are pretty */
|
* or text layout engine on top of FreeType. However, they are pretty
|
||||||
/* handy for many other simple uses of the library. */
|
* handy for many other simple uses of the library.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -37,12 +37,12 @@
|
||||||
#include FT_INTERNAL_OBJECTS_H
|
#include FT_INTERNAL_OBJECTS_H
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_glyph
|
#define FT_COMPONENT trace_glyph
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftgxval.c */
|
* ftgxval.c
|
||||||
/* */
|
*
|
||||||
/* FreeType API for validating TrueTypeGX/AAT tables (body). */
|
* FreeType API for validating TrueTypeGX/AAT tables (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2004-2018 by */
|
* Copyright 2004-2018 by
|
||||||
/* Masatake YAMATO, Redhat K.K, */
|
* Masatake YAMATO, Redhat K.K,
|
||||||
/* 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* gxvalid is derived from both gxlayout module and otvalid module. */
|
* gxvalid is derived from both gxlayout module and otvalid module.
|
||||||
/* Development of gxlayout is supported by the Information-technology */
|
* Development of gxlayout is supported by the Information-technology
|
||||||
/* Promotion Agency(IPA), Japan. */
|
* Promotion Agency(IPA), Japan.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* fthash.c */
|
* fthash.c
|
||||||
/* */
|
*
|
||||||
/* Hashing functions (body). */
|
* Hashing functions (body).
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2000 Computing Research Labs, New Mexico State University
|
* Copyright 2000 Computing Research Labs, New Mexico State University
|
||||||
|
@ -30,13 +30,13 @@
|
||||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* This file is based on code from bdf.c,v 1.22 2000/03/16 20:08:50 */
|
* This file is based on code from bdf.c,v 1.22 2000/03/16 20:08:50
|
||||||
/* */
|
*
|
||||||
/* taken from Mark Leisher's xmbdfed package */
|
* taken from Mark Leisher's xmbdfed package
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,40 +1,40 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftinit.c */
|
* ftinit.c
|
||||||
/* */
|
*
|
||||||
/* FreeType initialization layer (body). */
|
* FreeType initialization layer (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 1996-2018 by */
|
* Copyright 1996-2018 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 purpose of this file is to implement the following two */
|
* The purpose of this file is to implement the following two
|
||||||
/* functions: */
|
* functions:
|
||||||
/* */
|
*
|
||||||
/* FT_Add_Default_Modules(): */
|
* FT_Add_Default_Modules():
|
||||||
/* This function is used to add the set of default modules to a */
|
* This function is used to add the set of default modules to a
|
||||||
/* fresh new library object. The set is taken from the header file */
|
* fresh new library object. The set is taken from the header file
|
||||||
/* `freetype/config/ftmodule.h'. See the document `FreeType 2.0 */
|
* `freetype/config/ftmodule.h'. See the document `FreeType 2.0
|
||||||
/* Build System' for more information. */
|
* Build System' for more information.
|
||||||
/* */
|
*
|
||||||
/* FT_Init_FreeType(): */
|
* FT_Init_FreeType():
|
||||||
/* This function creates a system object for the current platform, */
|
* This function creates a system object for the current platform,
|
||||||
/* builds a library out of it, then calls FT_Default_Drivers(). */
|
* builds a library out of it, then calls FT_Default_Drivers().
|
||||||
/* */
|
*
|
||||||
/* Note that even if FT_Init_FreeType() uses the implementation of the */
|
* Note that even if FT_Init_FreeType() uses the implementation of the
|
||||||
/* system object defined at build time, client applications are still */
|
* system object defined at build time, client applications are still
|
||||||
/* able to provide their own `ftsystem.c'. */
|
* able to provide their own `ftsystem.c'.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -44,12 +44,12 @@
|
||||||
#include FT_MODULE_H
|
#include FT_MODULE_H
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_init
|
#define FT_COMPONENT trace_init
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftlcdfil.c */
|
* ftlcdfil.c
|
||||||
/* */
|
*
|
||||||
/* FreeType API for color filtering of subpixel bitmap glyphs (body). */
|
* FreeType API for color filtering of subpixel bitmap glyphs (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2006-2018 by */
|
* Copyright 2006-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
104
src/base/ftmac.c
104
src/base/ftmac.c
|
@ -1,23 +1,23 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftmac.c */
|
* ftmac.c
|
||||||
/* */
|
*
|
||||||
/* Mac FOND support. Written by just@letterror.com. */
|
* Mac FOND support. Written by just@letterror.com.
|
||||||
/* Heavily modified by mpsuzuki, George Williams, and Sean McBride. */
|
* Heavily modified by mpsuzuki, George Williams, and Sean McBride.
|
||||||
/* */
|
*
|
||||||
/* This file is for Mac OS X only; see builds/mac/ftoldmac.c for */
|
* This file is for Mac OS X only; see builds/mac/ftoldmac.c for
|
||||||
/* classic platforms built by MPW. */
|
* classic platforms built by MPW.
|
||||||
/* */
|
*
|
||||||
/* Copyright 1996-2018 by */
|
* Copyright 1996-2018 by
|
||||||
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
|
* Just van Rossum, 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -954,17 +954,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* FT_New_Face */
|
* FT_New_Face
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* This is the Mac-specific implementation of FT_New_Face. In */
|
* This is the Mac-specific implementation of FT_New_Face. In
|
||||||
/* addition to the standard FT_New_Face() functionality, it also */
|
* addition to the standard FT_New_Face() functionality, it also
|
||||||
/* accepts pathnames to Mac suitcase files. For further */
|
* accepts pathnames to Mac suitcase files. For further
|
||||||
/* documentation see the original FT_New_Face() in freetype.h. */
|
* documentation see the original FT_New_Face() in freetype.h.
|
||||||
/* */
|
*/
|
||||||
FT_EXPORT_DEF( FT_Error )
|
FT_EXPORT_DEF( FT_Error )
|
||||||
FT_New_Face( FT_Library library,
|
FT_New_Face( FT_Library library,
|
||||||
const char* pathname,
|
const char* pathname,
|
||||||
|
@ -995,17 +995,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* FT_New_Face_From_FSRef */
|
* FT_New_Face_From_FSRef
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* FT_New_Face_From_FSRef is identical to FT_New_Face except it */
|
* FT_New_Face_From_FSRef is identical to FT_New_Face except it
|
||||||
/* accepts an FSRef instead of a path. */
|
* accepts an FSRef instead of a path.
|
||||||
/* */
|
*
|
||||||
/* This function is deprecated because Carbon data types (FSRef) */
|
* This function is deprecated because Carbon data types (FSRef)
|
||||||
/* are not cross-platform, and thus not suitable for the FreeType API. */
|
*/
|
||||||
FT_EXPORT_DEF( FT_Error )
|
FT_EXPORT_DEF( FT_Error )
|
||||||
FT_New_Face_From_FSRef( FT_Library library,
|
FT_New_Face_From_FSRef( FT_Library library,
|
||||||
const FSRef* ref,
|
const FSRef* ref,
|
||||||
|
@ -1040,16 +1040,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* FT_New_Face_From_FSSpec */
|
* FT_New_Face_From_FSSpec
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* FT_New_Face_From_FSSpec is identical to FT_New_Face except it */
|
* FT_New_Face_From_FSSpec is identical to FT_New_Face except it
|
||||||
/* accepts an FSSpec instead of a path. */
|
* accepts an FSSpec instead of a path.
|
||||||
/* */
|
*
|
||||||
/* This function is deprecated because FSSpec is deprecated in Mac OS X */
|
*/
|
||||||
FT_EXPORT_DEF( FT_Error )
|
FT_EXPORT_DEF( FT_Error )
|
||||||
FT_New_Face_From_FSSpec( FT_Library library,
|
FT_New_Face_From_FSSpec( FT_Library library,
|
||||||
const FSSpec* spec,
|
const FSSpec* spec,
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftmm.c */
|
* ftmm.c
|
||||||
/* */
|
*
|
||||||
/* Multiple Master font support (body). */
|
* Multiple Master font support (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 1996-2018 by */
|
* Copyright 1996-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -25,12 +25,12 @@
|
||||||
#include FT_SERVICE_METRICS_VARIATIONS_H
|
#include FT_SERVICE_METRICS_VARIATIONS_H
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_mm
|
#define FT_COMPONENT trace_mm
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftobjs.c */
|
* ftobjs.c
|
||||||
/* */
|
*
|
||||||
/* The FreeType private base classes (body). */
|
* The FreeType private base classes (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 1996-2018 by */
|
* Copyright 1996-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -259,12 +259,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_objs
|
#define FT_COMPONENT trace_objs
|
||||||
|
|
||||||
|
@ -1185,20 +1185,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* find_unicode_charmap */
|
* find_unicode_charmap
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* This function finds a Unicode charmap, if there is one. */
|
* This function finds a Unicode charmap, if there is one.
|
||||||
/* And if there is more than one, it tries to favour the more */
|
* And if there is more than one, it tries to favour the more
|
||||||
/* extensive one, i.e., one that supports UCS-4 against those which */
|
* extensive one, i.e., one that supports UCS-4 against those which
|
||||||
/* are limited to the BMP (said UCS-2 encoding.) */
|
* are limited to the BMP (said UCS-2 encoding.)
|
||||||
/* */
|
*
|
||||||
/* This function is called from open_face() (just below), and also */
|
* This function is called from open_face() (just below), and also
|
||||||
/* from FT_Select_Charmap( ..., FT_ENCODING_UNICODE ). */
|
* from FT_Select_Charmap( ..., FT_ENCODING_UNICODE ).
|
||||||
/* */
|
*/
|
||||||
static FT_Error
|
static FT_Error
|
||||||
find_unicode_charmap( FT_Face face )
|
find_unicode_charmap( FT_Face face )
|
||||||
{
|
{
|
||||||
|
@ -1215,26 +1215,26 @@
|
||||||
return FT_THROW( Invalid_CharMap_Handle );
|
return FT_THROW( Invalid_CharMap_Handle );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The original TrueType specification(s) only specified charmap
|
* The original TrueType specification(s) only specified charmap
|
||||||
* formats that are capable of mapping 8 or 16 bit character codes to
|
* formats that are capable of mapping 8 or 16 bit character codes to
|
||||||
* glyph indices.
|
* glyph indices.
|
||||||
*
|
*
|
||||||
* However, recent updates to the Apple and OpenType specifications
|
* However, recent updates to the Apple and OpenType specifications
|
||||||
* introduced new formats that are capable of mapping 32-bit character
|
* introduced new formats that are capable of mapping 32-bit character
|
||||||
* codes as well. And these are already used on some fonts, mainly to
|
* codes as well. And these are already used on some fonts, mainly to
|
||||||
* map non-BMP Asian ideographs as defined in Unicode.
|
* map non-BMP Asian ideographs as defined in Unicode.
|
||||||
*
|
*
|
||||||
* For compatibility purposes, these fonts generally come with
|
* For compatibility purposes, these fonts generally come with
|
||||||
* *several* Unicode charmaps:
|
* *several* Unicode charmaps:
|
||||||
*
|
*
|
||||||
* - One of them in the "old" 16-bit format, that cannot access
|
* - One of them in the "old" 16-bit format, that cannot access
|
||||||
* all glyphs in the font.
|
* all glyphs in the font.
|
||||||
*
|
*
|
||||||
* - Another one in the "new" 32-bit format, that can access all
|
* - Another one in the "new" 32-bit format, that can access all
|
||||||
* the glyphs.
|
* the glyphs.
|
||||||
*
|
*
|
||||||
* This function has been written to always favor a 32-bit charmap
|
* This function has been written to always favor a 32-bit charmap
|
||||||
* when found. Otherwise, a 16-bit one is returned when found.
|
* when found. Otherwise, a 16-bit one is returned when found.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Since the `interesting' table, with IDs (3,10), is normally the */
|
/* Since the `interesting' table, with IDs (3,10), is normally the */
|
||||||
|
@ -1278,15 +1278,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* find_variant_selector_charmap */
|
* find_variant_selector_charmap
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* This function finds the variant selector charmap, if there is one. */
|
* This function finds the variant selector charmap, if there is one.
|
||||||
/* There can only be one (platform=0, specific=5, format=14). */
|
* There can only be one (platform=0, specific=5, format=14).
|
||||||
/* */
|
*/
|
||||||
static FT_CharMap
|
static FT_CharMap
|
||||||
find_variant_selector_charmap( FT_Face face )
|
find_variant_selector_charmap( FT_Face face )
|
||||||
{
|
{
|
||||||
|
@ -1317,14 +1317,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* open_face */
|
* open_face
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* This function does some work for FT_Open_Face(). */
|
* This function does some work for FT_Open_Face().
|
||||||
/* */
|
*/
|
||||||
static FT_Error
|
static FT_Error
|
||||||
open_face( FT_Driver driver,
|
open_face( FT_Driver driver,
|
||||||
FT_Stream *astream,
|
FT_Stream *astream,
|
||||||
|
@ -2205,7 +2205,7 @@
|
||||||
FT_Error error = FT_ERR( Unknown_File_Format );
|
FT_Error error = FT_ERR( Unknown_File_Format );
|
||||||
FT_UInt i;
|
FT_UInt i;
|
||||||
|
|
||||||
char * file_names[FT_RACCESS_N_RULES];
|
char* file_names[FT_RACCESS_N_RULES];
|
||||||
FT_Long offsets[FT_RACCESS_N_RULES];
|
FT_Long offsets[FT_RACCESS_N_RULES];
|
||||||
FT_Error errors[FT_RACCESS_N_RULES];
|
FT_Error errors[FT_RACCESS_N_RULES];
|
||||||
FT_Bool is_darwin_vfs, vfs_rfork_has_no_font = FALSE; /* not tested */
|
FT_Bool is_darwin_vfs, vfs_rfork_has_no_font = FALSE; /* not tested */
|
||||||
|
@ -4753,21 +4753,22 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* Destroy_Module */
|
* Destroy_Module
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* Destroys a given module object. For drivers, this also destroys */
|
* Destroys a given module object. For drivers, this also destroys
|
||||||
/* all child faces. */
|
* all child faces.
|
||||||
/* */
|
*
|
||||||
/* <InOut> */
|
* @InOut:
|
||||||
/* module :: A handle to the target driver object. */
|
* module ::
|
||||||
/* */
|
* A handle to the target driver object.
|
||||||
/* <Note> */
|
*
|
||||||
/* The driver _must_ be LOCKED! */
|
* @Note:
|
||||||
/* */
|
* The driver _must_ be LOCKED!
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
Destroy_Module( FT_Module module )
|
Destroy_Module( FT_Module module )
|
||||||
{
|
{
|
||||||
|
@ -5301,10 +5302,10 @@
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
*
|
*
|
||||||
* - the cff font driver uses the pshinter module in cff_size_done
|
* - the cff font driver uses the pshinter module in cff_size_done
|
||||||
* - if the pshinter module is destroyed before the cff font driver,
|
* - if the pshinter module is destroyed before the cff font driver,
|
||||||
* opened FT_Face objects managed by the driver are not properly
|
* opened FT_Face objects managed by the driver are not properly
|
||||||
* destroyed, resulting in a memory leak
|
* destroyed, resulting in a memory leak
|
||||||
*
|
*
|
||||||
* Some faces are dependent on other faces, like Type42 faces that
|
* Some faces are dependent on other faces, like Type42 faces that
|
||||||
* depend on TrueType faces synthesized internally.
|
* depend on TrueType faces synthesized internally.
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftotval.c */
|
* ftotval.c
|
||||||
/* */
|
*
|
||||||
/* FreeType API for validating OpenType tables (body). */
|
* FreeType API for validating OpenType tables (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2004-2018 by */
|
* Copyright 2004-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
#include FT_INTERNAL_DEBUG_H
|
#include FT_INTERNAL_DEBUG_H
|
||||||
|
|
|
@ -1,26 +1,26 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftoutln.c */
|
* ftoutln.c
|
||||||
/* */
|
*
|
||||||
/* FreeType outline management (body). */
|
* FreeType outline management (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 1996-2018 by */
|
* Copyright 1996-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* All functions are declared in freetype.h. */
|
* All functions are declared in freetype.h.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -31,12 +31,12 @@
|
||||||
#include FT_TRIGONOMETRY_H
|
#include FT_TRIGONOMETRY_H
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_outline
|
#define FT_COMPONENT trace_outline
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftpatent.c */
|
* ftpatent.c
|
||||||
/* */
|
*
|
||||||
/* FreeType API for checking patented TrueType bytecode instructions */
|
* FreeType API for checking patented TrueType bytecode instructions
|
||||||
/* (body). Obsolete, retained for backward compatibility. */
|
* (body). Obsolete, retained for backward compatibility.
|
||||||
/* */
|
*
|
||||||
/* Copyright 2007-2018 by */
|
* Copyright 2007-2018 by
|
||||||
/* David Turner. */
|
* David Turner.
|
||||||
/* */
|
*
|
||||||
/* 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
#include FT_FREETYPE_H
|
#include FT_FREETYPE_H
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftpfr.c */
|
* ftpfr.c
|
||||||
/* */
|
*
|
||||||
/* FreeType API for accessing PFR-specific data (body). */
|
* FreeType API for accessing PFR-specific data (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2002-2018 by */
|
* Copyright 2002-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
#include FT_INTERNAL_DEBUG_H
|
#include FT_INTERNAL_DEBUG_H
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftpsprop.c */
|
* ftpsprop.c
|
||||||
/* */
|
*
|
||||||
/* Get and set properties of PostScript drivers (body). */
|
* Get and set properties of PostScript drivers (body).
|
||||||
/* See `ftdriver.h' for available properties. */
|
* See `ftdriver.h' for available properties.
|
||||||
/* */
|
*
|
||||||
/* Copyright 2017-2018 by */
|
* Copyright 2017-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -25,12 +25,12 @@
|
||||||
#include FT_INTERNAL_POSTSCRIPT_PROPS_H
|
#include FT_INTERNAL_POSTSCRIPT_PROPS_H
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_psprops
|
#define FT_COMPONENT trace_psprops
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftrfork.c */
|
* ftrfork.c
|
||||||
/* */
|
*
|
||||||
/* Embedded resource forks accessor (body). */
|
* Embedded resource forks accessor (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2004-2018 by */
|
* Copyright 2004-2018 by
|
||||||
/* Masatake YAMATO and Redhat K.K. */
|
* Masatake YAMATO and Redhat K.K.
|
||||||
/* */
|
*
|
||||||
/* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are */
|
* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are
|
||||||
/* derived from ftobjs.c. */
|
* derived from ftobjs.c.
|
||||||
/* */
|
*
|
||||||
/* 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* Development of the code in this file is support of */
|
* Development of the code in this file is support of
|
||||||
/* Information-technology Promotion Agency, Japan. */
|
* Information-technology Promotion Agency, Japan.
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -438,7 +438,7 @@
|
||||||
|
|
||||||
static FT_Error
|
static FT_Error
|
||||||
raccess_guess_linux_double_from_file_name( FT_Library library,
|
raccess_guess_linux_double_from_file_name( FT_Library library,
|
||||||
char * file_name,
|
char* file_name,
|
||||||
FT_Long *result_offset );
|
FT_Long *result_offset );
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
|
@ -847,7 +847,7 @@
|
||||||
{
|
{
|
||||||
FT_Open_Args args2;
|
FT_Open_Args args2;
|
||||||
FT_Stream stream2;
|
FT_Stream stream2;
|
||||||
char * nouse = NULL;
|
char* nouse = NULL;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
|
||||||
|
|
||||||
|
@ -909,9 +909,9 @@
|
||||||
#else /* !FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */
|
#else /* !FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* Dummy function; just sets errors */
|
* Dummy function; just sets errors
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
FT_BASE_DEF( void )
|
FT_BASE_DEF( void )
|
||||||
FT_Raccess_Guess( FT_Library library,
|
FT_Raccess_Guess( FT_Library library,
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftsnames.c */
|
* ftsnames.c
|
||||||
/* */
|
*
|
||||||
/* Simple interface to access SFNT name tables (which are used */
|
* Simple interface to access SFNT name tables (which are used
|
||||||
/* to hold font names, copyright info, notices, etc.) (body). */
|
* to hold font names, copyright info, notices, etc.) (body).
|
||||||
/* */
|
*
|
||||||
/* This is _not_ used to retrieve glyph names! */
|
* This is _not_ used to retrieve glyph names!
|
||||||
/* */
|
*
|
||||||
/* Copyright 1996-2018 by */
|
* Copyright 1996-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftstream.c */
|
* ftstream.c
|
||||||
/* */
|
*
|
||||||
/* I/O stream support (body). */
|
* I/O stream support (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2000-2018 by */
|
* Copyright 2000-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -21,12 +21,12 @@
|
||||||
#include FT_INTERNAL_DEBUG_H
|
#include FT_INTERNAL_DEBUG_H
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_stream
|
#define FT_COMPONENT trace_stream
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftstroke.c */
|
* ftstroke.c
|
||||||
/* */
|
*
|
||||||
/* FreeType path stroker (body). */
|
* FreeType path stroker (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2002-2018 by */
|
* Copyright 2002-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -2082,8 +2082,8 @@
|
||||||
/* documentation is in ftstroke.h */
|
/* documentation is in ftstroke.h */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following is very similar to FT_Outline_Decompose, except
|
* The following is very similar to FT_Outline_Decompose, except
|
||||||
* that we do support opened paths, and do not scale the outline.
|
* that we do support opened paths, and do not scale the outline.
|
||||||
*/
|
*/
|
||||||
FT_EXPORT_DEF( FT_Error )
|
FT_EXPORT_DEF( FT_Error )
|
||||||
FT_Stroker_ParseOutline( FT_Stroker stroker,
|
FT_Stroker_ParseOutline( FT_Stroker stroker,
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftsynth.c */
|
* ftsynth.c
|
||||||
/* */
|
*
|
||||||
/* FreeType synthesizing code for emboldening and slanting (body). */
|
* FreeType synthesizing code for emboldening and slanting (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2000-2018 by */
|
* Copyright 2000-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -24,12 +24,12 @@
|
||||||
#include FT_BITMAP_H
|
#include FT_BITMAP_H
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_synth
|
#define FT_COMPONENT trace_synth
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftsystem.c */
|
* ftsystem.c
|
||||||
/* */
|
*
|
||||||
/* ANSI-specific FreeType low-level system interface (body). */
|
* ANSI-specific FreeType low-level system interface (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 1996-2018 by */
|
* Copyright 1996-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* This file contains the default interface used by FreeType to access */
|
* This file contains the default interface used by FreeType to access
|
||||||
/* low-level, i.e. memory management, i/o access as well as thread */
|
* low-level, i.e. memory management, i/o access as well as thread
|
||||||
/* synchronisation. It can be replaced by user-specific routines if */
|
* synchronisation. It can be replaced by user-specific routines if
|
||||||
/* necessary. */
|
* necessary.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -34,37 +34,39 @@
|
||||||
#include FT_TYPES_H
|
#include FT_TYPES_H
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* MEMORY MANAGEMENT INTERFACE */
|
* MEMORY MANAGEMENT INTERFACE
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* It is not necessary to do any error checking for the */
|
* It is not necessary to do any error checking for the
|
||||||
/* allocation-related functions. This will be done by the higher level */
|
* allocation-related functions. This will be done by the higher level
|
||||||
/* routines like ft_mem_alloc() or ft_mem_realloc(). */
|
* routines like ft_mem_alloc() or ft_mem_realloc().
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* ft_alloc */
|
* ft_alloc
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* The memory allocation function. */
|
* The memory allocation function.
|
||||||
/* */
|
*
|
||||||
/* <Input> */
|
* @Input:
|
||||||
/* memory :: A pointer to the memory object. */
|
* memory ::
|
||||||
/* */
|
* A pointer to the memory object.
|
||||||
/* size :: The requested size in bytes. */
|
*
|
||||||
/* */
|
* size ::
|
||||||
/* <Return> */
|
* The requested size in bytes.
|
||||||
/* The address of newly allocated block. */
|
*
|
||||||
/* */
|
* @Return:
|
||||||
|
* The address of newly allocated block.
|
||||||
|
*/
|
||||||
FT_CALLBACK_DEF( void* )
|
FT_CALLBACK_DEF( void* )
|
||||||
ft_alloc( FT_Memory memory,
|
ft_alloc( FT_Memory memory,
|
||||||
long size )
|
long size )
|
||||||
|
@ -75,26 +77,30 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* ft_realloc */
|
* ft_realloc
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* The memory reallocation function. */
|
* The memory reallocation function.
|
||||||
/* */
|
*
|
||||||
/* <Input> */
|
* @Input:
|
||||||
/* memory :: A pointer to the memory object. */
|
* memory ::
|
||||||
/* */
|
* A pointer to the memory object.
|
||||||
/* cur_size :: The current size of the allocated memory block. */
|
*
|
||||||
/* */
|
* cur_size ::
|
||||||
/* new_size :: The newly requested size in bytes. */
|
* The current size of the allocated memory block.
|
||||||
/* */
|
*
|
||||||
/* block :: The current address of the block in memory. */
|
* new_size ::
|
||||||
/* */
|
* The newly requested size in bytes.
|
||||||
/* <Return> */
|
*
|
||||||
/* The address of the reallocated memory block. */
|
* block ::
|
||||||
/* */
|
* The current address of the block in memory.
|
||||||
|
*
|
||||||
|
* @Return:
|
||||||
|
* The address of the reallocated memory block.
|
||||||
|
*/
|
||||||
FT_CALLBACK_DEF( void* )
|
FT_CALLBACK_DEF( void* )
|
||||||
ft_realloc( FT_Memory memory,
|
ft_realloc( FT_Memory memory,
|
||||||
long cur_size,
|
long cur_size,
|
||||||
|
@ -108,19 +114,21 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* ft_free */
|
* ft_free
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* The memory release function. */
|
* The memory release function.
|
||||||
/* */
|
*
|
||||||
/* <Input> */
|
* @Input:
|
||||||
/* memory :: A pointer to the memory object. */
|
* memory ::
|
||||||
/* */
|
* A pointer to the memory object.
|
||||||
/* block :: The address of block in memory to be freed. */
|
*
|
||||||
/* */
|
* block ::
|
||||||
|
* The address of block in memory to be freed.
|
||||||
|
*/
|
||||||
FT_CALLBACK_DEF( void )
|
FT_CALLBACK_DEF( void )
|
||||||
ft_free( FT_Memory memory,
|
ft_free( FT_Memory memory,
|
||||||
void* block )
|
void* block )
|
||||||
|
@ -131,20 +139,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* RESOURCE MANAGEMENT INTERFACE */
|
* RESOURCE MANAGEMENT INTERFACE
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT
|
#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_io
|
#define FT_COMPONENT trace_io
|
||||||
|
|
||||||
|
@ -153,17 +161,18 @@
|
||||||
#define STREAM_FILE( stream ) ( (FT_FILE*)stream->descriptor.pointer )
|
#define STREAM_FILE( stream ) ( (FT_FILE*)stream->descriptor.pointer )
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* ft_ansi_stream_close */
|
* ft_ansi_stream_close
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* The function to close a stream. */
|
* The function to close a stream.
|
||||||
/* */
|
*
|
||||||
/* <Input> */
|
* @Input:
|
||||||
/* stream :: A pointer to the stream object. */
|
* stream ::
|
||||||
/* */
|
* A pointer to the stream object.
|
||||||
|
*/
|
||||||
FT_CALLBACK_DEF( void )
|
FT_CALLBACK_DEF( void )
|
||||||
ft_ansi_stream_close( FT_Stream stream )
|
ft_ansi_stream_close( FT_Stream stream )
|
||||||
{
|
{
|
||||||
|
@ -175,28 +184,32 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* ft_ansi_stream_io */
|
* ft_ansi_stream_io
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* The function to open a stream. */
|
* The function to open a stream.
|
||||||
/* */
|
*
|
||||||
/* <Input> */
|
* @Input:
|
||||||
/* stream :: A pointer to the stream object. */
|
* stream ::
|
||||||
/* */
|
* A pointer to the stream object.
|
||||||
/* offset :: The position in the data stream to start reading. */
|
*
|
||||||
/* */
|
* offset ::
|
||||||
/* buffer :: The address of buffer to store the read data. */
|
* The position in the data stream to start reading.
|
||||||
/* */
|
*
|
||||||
/* count :: The number of bytes to read from the stream. */
|
* buffer ::
|
||||||
/* */
|
* The address of buffer to store the read data.
|
||||||
/* <Return> */
|
*
|
||||||
/* The number of bytes actually read. If `count' is zero (this is, */
|
* count ::
|
||||||
/* the function is used for seeking), a non-zero return value */
|
* The number of bytes to read from the stream.
|
||||||
/* indicates an error. */
|
*
|
||||||
/* */
|
* @Return:
|
||||||
|
* The number of bytes actually read. If `count' is zero (this is,
|
||||||
|
* the function is used for seeking), a non-zero return value
|
||||||
|
* indicates an error.
|
||||||
|
*/
|
||||||
FT_CALLBACK_DEF( unsigned long )
|
FT_CALLBACK_DEF( unsigned long )
|
||||||
ft_ansi_stream_io( FT_Stream stream,
|
ft_ansi_stream_io( FT_Stream stream,
|
||||||
unsigned long offset,
|
unsigned long offset,
|
||||||
|
|
|
@ -1,33 +1,33 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* fttrigon.c */
|
* fttrigon.c
|
||||||
/* */
|
*
|
||||||
/* FreeType trigonometric functions (body). */
|
* FreeType trigonometric functions (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2001-2018 by */
|
* Copyright 2001-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* This is a fixed-point CORDIC implementation of trigonometric */
|
* This is a fixed-point CORDIC implementation of trigonometric
|
||||||
/* functions as well as transformations between Cartesian and polar */
|
* functions as well as transformations between Cartesian and polar
|
||||||
/* coordinates. The angles are represented as 16.16 fixed-point values */
|
* coordinates. The angles are represented as 16.16 fixed-point values
|
||||||
/* in degrees, i.e., the angular resolution is 2^-16 degrees. Note that */
|
* in degrees, i.e., the angular resolution is 2^-16 degrees. Note that
|
||||||
/* only vectors longer than 2^16*180/pi (or at least 22 bits) on a */
|
* only vectors longer than 2^16*180/pi (or at least 22 bits) on a
|
||||||
/* discrete Cartesian grid can have the same or better angular */
|
* discrete Cartesian grid can have the same or better angular
|
||||||
/* resolution. Therefore, to maintain this precision, some functions */
|
* resolution. Therefore, to maintain this precision, some functions
|
||||||
/* require an interim upscaling of the vectors, whereas others operate */
|
* require an interim upscaling of the vectors, whereas others operate
|
||||||
/* with 24-bit long vectors directly. */
|
* with 24-bit long vectors directly.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
#include FT_INTERNAL_OBJECTS_H
|
#include FT_INTERNAL_OBJECTS_H
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* fttype1.c */
|
* fttype1.c
|
||||||
/* */
|
*
|
||||||
/* FreeType utility file for PS names support (body). */
|
* FreeType utility file for PS names support (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2002-2018 by */
|
* Copyright 2002-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftutil.c */
|
* ftutil.c
|
||||||
/* */
|
*
|
||||||
/* FreeType utility file for memory and list management (body). */
|
* FreeType utility file for memory and list management (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2002-2018 by */
|
* Copyright 2002-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -23,12 +23,12 @@
|
||||||
#include FT_LIST_H
|
#include FT_LIST_H
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_memory
|
#define FT_COMPONENT trace_memory
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftwinfnt.c */
|
* ftwinfnt.c
|
||||||
/* */
|
*
|
||||||
/* FreeType API for accessing Windows FNT specific info (body). */
|
* FreeType API for accessing Windows FNT specific info (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -51,11 +51,11 @@ FT_BEGIN_HEADER
|
||||||
/* end of bdfP.h */
|
/* end of bdfP.h */
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* BDF font options macros and types. */
|
* BDF font options macros and types.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define BDF_CORRECT_METRICS 0x01 /* Correct invalid metrics when loading. */
|
#define BDF_CORRECT_METRICS 0x01 /* Correct invalid metrics when loading. */
|
||||||
|
@ -93,11 +93,11 @@ FT_BEGIN_HEADER
|
||||||
void* client_data );
|
void* client_data );
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* BDF font property macros and types. */
|
* BDF font property macros and types.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define BDF_ATOM 1
|
#define BDF_ATOM 1
|
||||||
|
@ -123,11 +123,11 @@ FT_BEGIN_HEADER
|
||||||
} bdf_property_t;
|
} bdf_property_t;
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* BDF font metric and glyph types. */
|
* BDF font metric and glyph types.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
typedef struct bdf_bbx_t_
|
typedef struct bdf_bbx_t_
|
||||||
|
@ -226,11 +226,11 @@ FT_BEGIN_HEADER
|
||||||
} bdf_font_t;
|
} bdf_font_t;
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* Types for load/save callbacks. */
|
* Types for load/save callbacks.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* Error codes. */
|
/* Error codes. */
|
||||||
|
@ -247,11 +247,11 @@ FT_BEGIN_HEADER
|
||||||
#define BDF_INVALID_LINE -100
|
#define BDF_INVALID_LINE -100
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* BDF font API. */
|
* BDF font API.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
FT_LOCAL( FT_Error )
|
FT_LOCAL( FT_Error )
|
||||||
bdf_load_font( FT_Stream stream,
|
bdf_load_font( FT_Stream stream,
|
||||||
|
|
|
@ -41,12 +41,12 @@ THE SOFTWARE.
|
||||||
#include "bdferror.h"
|
#include "bdferror.h"
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_bdfdriver
|
#define FT_COMPONENT trace_bdfdriver
|
||||||
|
|
||||||
|
@ -863,7 +863,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* BDF SERVICE
|
* BDF SERVICE
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -939,7 +939,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* SERVICES LIST
|
* SERVICES LIST
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,11 @@
|
||||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* This file is used to define the BDF error enumeration constants. */
|
* This file is used to define the BDF error enumeration constants.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
#ifndef BDFERROR_H_
|
#ifndef BDFERROR_H_
|
||||||
#define BDFERROR_H_
|
#define BDFERROR_H_
|
||||||
|
|
|
@ -22,13 +22,13 @@
|
||||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* This file is based on bdf.c,v 1.22 2000/03/16 20:08:50 */
|
* This file is based on bdf.c,v 1.22 2000/03/16 20:08:50
|
||||||
/* */
|
*
|
||||||
/* taken from Mark Leisher's xmbdfed package */
|
* taken from Mark Leisher's xmbdfed package
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -42,21 +42,21 @@
|
||||||
#include "bdferror.h"
|
#include "bdferror.h"
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
||||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
||||||
/* messages during execution. */
|
* messages during execution.
|
||||||
/* */
|
*/
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_bdflib
|
#define FT_COMPONENT trace_bdflib
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* Default BDF font options. */
|
* Default BDF font options.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
static const bdf_options_t _bdf_opts =
|
static const bdf_options_t _bdf_opts =
|
||||||
|
@ -68,11 +68,11 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* Builtin BDF font properties. */
|
* Builtin BDF font properties.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
/* List of most properties that might appear in a font. Doesn't include */
|
/* List of most properties that might appear in a font. Doesn't include */
|
||||||
/* the RAW_* and AXIS_* properties in X11R6 polymorphic fonts. */
|
/* the RAW_* and AXIS_* properties in X11R6 polymorphic fonts. */
|
||||||
|
@ -219,11 +219,11 @@
|
||||||
#define DBGMSG2 " (0x%lX)\n"
|
#define DBGMSG2 " (0x%lX)\n"
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* Utility types and functions. */
|
* Utility types and functions.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* Function type for parsing lines of a BDF font. */
|
/* Function type for parsing lines of a BDF font. */
|
||||||
|
@ -900,11 +900,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* BDF font file parsing flags and functions. */
|
* BDF font file parsing flags and functions.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* Parse flags. */
|
/* Parse flags. */
|
||||||
|
@ -2196,11 +2196,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* API. */
|
* API.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Error )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftbzip2.c */
|
* ftbzip2.c
|
||||||
/* */
|
*
|
||||||
/* FreeType support for .bz2 compressed files. */
|
* FreeType support for .bz2 compressed files.
|
||||||
/* */
|
*
|
||||||
/* This optional component relies on libbz2. It should mainly be used to */
|
* This optional component relies on libbz2. It should mainly be used to
|
||||||
/* parse compressed PCF fonts, as found with many X11 server */
|
* parse compressed PCF fonts, as found with many X11 server
|
||||||
/* distributions. */
|
* distributions.
|
||||||
/* */
|
*
|
||||||
/* Copyright 2010-2018 by */
|
* Copyright 2010-2018 by
|
||||||
/* Joel Klinghed. */
|
* Joel Klinghed.
|
||||||
/* */
|
*
|
||||||
/* based on `src/gzip/ftgzip.c' */
|
* based on `src/gzip/ftgzip.c'
|
||||||
/* */
|
*
|
||||||
/* 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -471,8 +471,8 @@
|
||||||
memory = source->memory;
|
memory = source->memory;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* check the header right now; this prevents allocating unnecessary
|
* check the header right now; this prevents allocating unnecessary
|
||||||
* objects when we don't need them
|
* objects when we don't need them
|
||||||
*/
|
*/
|
||||||
error = ft_bzip2_check_header( source );
|
error = ft_bzip2_check_header( source );
|
||||||
if ( error )
|
if ( error )
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftcache.c */
|
* ftcache.c
|
||||||
/* */
|
*
|
||||||
/* The FreeType Caching sub-system (body only). */
|
* The FreeType Caching sub-system (body only).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2000-2018 by */
|
* Copyright 2000-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define FT_MAKE_OPTION_SINGLE_OBJECT
|
#define FT_MAKE_OPTION_SINGLE_OBJECT
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftcbasic.c */
|
* ftcbasic.c
|
||||||
/* */
|
*
|
||||||
/* The FreeType basic cache interface (body). */
|
* The FreeType basic cache interface (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Basic Families
|
* Basic Families
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
typedef struct FTC_BasicAttrRec_
|
typedef struct FTC_BasicAttrRec_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftccache.c */
|
* ftccache.c
|
||||||
/* */
|
*
|
||||||
/* The FreeType internal cache interface (body). */
|
* The FreeType internal cache interface (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2000-2018 by */
|
* Copyright 2000-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftccache.h */
|
* ftccache.h
|
||||||
/* */
|
*
|
||||||
/* FreeType internal cache interface (specification). */
|
* FreeType internal cache interface (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2000-2018 by */
|
* Copyright 2000-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef FTCCACHE_H_
|
#ifndef FTCCACHE_H_
|
||||||
|
@ -42,17 +42,17 @@ FT_BEGIN_HEADER
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* Each cache controls one or more cache nodes. Each node is part of */
|
* Each cache controls one or more cache nodes. Each node is part of
|
||||||
/* the global_lru list of the manager. Its `data' field however is used */
|
* the global_lru list of the manager. Its `data' field however is used
|
||||||
/* as a reference count for now. */
|
* as a reference count for now.
|
||||||
/* */
|
*
|
||||||
/* A node can be anything, depending on the type of information held by */
|
* A node can be anything, depending on the type of information held by
|
||||||
/* the cache. It can be an individual glyph image, a set of bitmaps */
|
* the cache. It can be an individual glyph image, a set of bitmaps
|
||||||
/* glyphs for a given size, some metrics, etc. */
|
* glyphs for a given size, some metrics, etc.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
/* structure size should be 20 bytes on 32-bits machines */
|
/* structure size should be 20 bytes on 32-bits machines */
|
||||||
typedef struct FTC_NodeRec_
|
typedef struct FTC_NodeRec_
|
||||||
|
@ -302,11 +302,11 @@ FT_BEGIN_HEADER
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
*
|
*
|
||||||
* {
|
* {
|
||||||
* FTC_CACHE_TRYLOOP( cache )
|
* FTC_CACHE_TRYLOOP( cache )
|
||||||
* error = load_data( ... );
|
* error = load_data( ... );
|
||||||
* FTC_CACHE_TRYLOOP_END()
|
* FTC_CACHE_TRYLOOP_END()
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define FTC_CACHE_TRYLOOP( cache ) \
|
#define FTC_CACHE_TRYLOOP( cache ) \
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftccback.h */
|
* ftccback.h
|
||||||
/* */
|
*
|
||||||
/* Callback functions of the caching sub-system (specification only). */
|
* Callback functions of the caching sub-system (specification only).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2004-2018 by */
|
* Copyright 2004-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
#ifndef FTCCBACK_H_
|
#ifndef FTCCBACK_H_
|
||||||
#define FTCCBACK_H_
|
#define FTCCBACK_H_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftccmap.c */
|
* ftccmap.c
|
||||||
/* */
|
*
|
||||||
/* FreeType CharMap cache (body) */
|
* FreeType CharMap cache (body)
|
||||||
/* */
|
*
|
||||||
/* Copyright 2000-2018 by */
|
* Copyright 2000-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -31,18 +31,18 @@
|
||||||
#define FT_COMPONENT trace_cache
|
#define FT_COMPONENT trace_cache
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* Each FTC_CMapNode contains a simple array to map a range of character */
|
* Each FTC_CMapNode contains a simple array to map a range of character
|
||||||
/* codes to equivalent glyph indices. */
|
* codes to equivalent glyph indices.
|
||||||
/* */
|
*
|
||||||
/* For now, the implementation is very basic: Each node maps a range of */
|
* For now, the implementation is very basic: Each node maps a range of
|
||||||
/* 128 consecutive character codes to their corresponding glyph indices. */
|
* 128 consecutive character codes to their corresponding glyph indices.
|
||||||
/* */
|
*
|
||||||
/* We could do more complex things, but I don't think it is really very */
|
* We could do more complex things, but I don't think it is really very
|
||||||
/* useful. */
|
* useful.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* number of glyph indices / character code per node */
|
/* number of glyph indices / character code per node */
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftcerror.h */
|
* ftcerror.h
|
||||||
/* */
|
*
|
||||||
/* Caching sub-system error codes (specification only). */
|
* Caching sub-system error codes (specification only).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2001-2018 by */
|
* Copyright 2001-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* This file is used to define the caching sub-system error enumeration */
|
* This file is used to define the caching sub-system error enumeration
|
||||||
/* constants. */
|
* constants.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
#ifndef FTCERROR_H_
|
#ifndef FTCERROR_H_
|
||||||
#define FTCERROR_H_
|
#define FTCERROR_H_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftcglyph.c */
|
* ftcglyph.c
|
||||||
/* */
|
*
|
||||||
/* FreeType Glyph Image (FT_Glyph) cache (body). */
|
* FreeType Glyph Image (FT_Glyph) cache (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2000-2018 by */
|
* Copyright 2000-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,101 +1,101 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftcglyph.h */
|
* ftcglyph.h
|
||||||
/* */
|
*
|
||||||
/* FreeType abstract glyph cache (specification). */
|
* FreeType abstract glyph cache (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2000-2018 by */
|
* Copyright 2000-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* FTC_GCache is an _abstract_ cache object optimized to store glyph
|
* FTC_GCache is an _abstract_ cache object optimized to store glyph
|
||||||
* data. It works as follows:
|
* data. It works as follows:
|
||||||
*
|
*
|
||||||
* - It manages FTC_GNode objects. Each one of them can hold one or more
|
* - It manages FTC_GNode objects. Each one of them can hold one or more
|
||||||
* glyph `items'. Item types are not specified in the FTC_GCache but
|
* glyph `items'. Item types are not specified in the FTC_GCache but
|
||||||
* in classes that extend it.
|
* in classes that extend it.
|
||||||
*
|
*
|
||||||
* - Glyph attributes, like face ID, character size, render mode, etc.,
|
* - Glyph attributes, like face ID, character size, render mode, etc.,
|
||||||
* can be grouped into abstract `glyph families'. This avoids storing
|
* can be grouped into abstract `glyph families'. This avoids storing
|
||||||
* the attributes within the FTC_GCache, since it is likely that many
|
* the attributes within the FTC_GCache, since it is likely that many
|
||||||
* FTC_GNodes will belong to the same family in typical uses.
|
* FTC_GNodes will belong to the same family in typical uses.
|
||||||
*
|
*
|
||||||
* - Each FTC_GNode is thus an FTC_Node with two additional fields:
|
* - Each FTC_GNode is thus an FTC_Node with two additional fields:
|
||||||
*
|
*
|
||||||
* * gindex: A glyph index, or the first index in a glyph range.
|
* * gindex: A glyph index, or the first index in a glyph range.
|
||||||
* * family: A pointer to a glyph `family'.
|
* * family: A pointer to a glyph `family'.
|
||||||
*
|
*
|
||||||
* - Family types are not fully specific in the FTC_Family type, but
|
* - Family types are not fully specific in the FTC_Family type, but
|
||||||
* by classes that extend it.
|
* by classes that extend it.
|
||||||
*
|
*
|
||||||
* Note that both FTC_ImageCache and FTC_SBitCache extend FTC_GCache.
|
* Note that both FTC_ImageCache and FTC_SBitCache extend FTC_GCache.
|
||||||
* They share an FTC_Family sub-class called FTC_BasicFamily which is
|
* They share an FTC_Family sub-class called FTC_BasicFamily which is
|
||||||
* used to store the following data: face ID, pixel/point sizes, load
|
* used to store the following data: face ID, pixel/point sizes, load
|
||||||
* flags. For more details see the file `src/cache/ftcbasic.c'.
|
* flags. For more details see the file `src/cache/ftcbasic.c'.
|
||||||
*
|
*
|
||||||
* Client applications can extend FTC_GNode with their own FTC_GNode
|
* Client applications can extend FTC_GNode with their own FTC_GNode
|
||||||
* and FTC_Family sub-classes to implement more complex caches (e.g.,
|
* and FTC_Family sub-classes to implement more complex caches (e.g.,
|
||||||
* handling automatic synthesis, like obliquing & emboldening, colored
|
* handling automatic synthesis, like obliquing & emboldening, colored
|
||||||
* glyphs, etc.).
|
* glyphs, etc.).
|
||||||
*
|
*
|
||||||
* See also the FTC_ICache & FTC_SCache classes in `ftcimage.h' and
|
* See also the FTC_ICache & FTC_SCache classes in `ftcimage.h' and
|
||||||
* `ftcsbits.h', which both extend FTC_GCache with additional
|
* `ftcsbits.h', which both extend FTC_GCache with additional
|
||||||
* optimizations.
|
* optimizations.
|
||||||
*
|
*
|
||||||
* A typical FTC_GCache implementation must provide at least the
|
* A typical FTC_GCache implementation must provide at least the
|
||||||
* following:
|
* following:
|
||||||
*
|
*
|
||||||
* - FTC_GNode sub-class, e.g. MyNode, with relevant methods:
|
* - FTC_GNode sub-class, e.g. MyNode, with relevant methods:
|
||||||
* my_node_new (must call FTC_GNode_Init)
|
* my_node_new (must call FTC_GNode_Init)
|
||||||
* my_node_free (must call FTC_GNode_Done)
|
* my_node_free (must call FTC_GNode_Done)
|
||||||
* my_node_compare (must call FTC_GNode_Compare)
|
* my_node_compare (must call FTC_GNode_Compare)
|
||||||
* my_node_remove_faceid (must call ftc_gnode_unselect in case
|
* my_node_remove_faceid (must call ftc_gnode_unselect in case
|
||||||
* of match)
|
* of match)
|
||||||
*
|
*
|
||||||
* - FTC_Family sub-class, e.g. MyFamily, with relevant methods:
|
* - FTC_Family sub-class, e.g. MyFamily, with relevant methods:
|
||||||
* my_family_compare
|
* my_family_compare
|
||||||
* my_family_init
|
* my_family_init
|
||||||
* my_family_reset (optional)
|
* my_family_reset (optional)
|
||||||
* my_family_done
|
* my_family_done
|
||||||
*
|
*
|
||||||
* - FTC_GQuery sub-class, e.g. MyQuery, to hold cache-specific query
|
* - FTC_GQuery sub-class, e.g. MyQuery, to hold cache-specific query
|
||||||
* data.
|
* data.
|
||||||
*
|
*
|
||||||
* - Constant structures for a FTC_GNodeClass.
|
* - Constant structures for a FTC_GNodeClass.
|
||||||
*
|
*
|
||||||
* - MyCacheNew() can be implemented easily as a call to the convenience
|
* - MyCacheNew() can be implemented easily as a call to the convenience
|
||||||
* function FTC_GCache_New.
|
* function FTC_GCache_New.
|
||||||
*
|
*
|
||||||
* - MyCacheLookup with a call to FTC_GCache_Lookup. This function will
|
* - MyCacheLookup with a call to FTC_GCache_Lookup. This function will
|
||||||
* automatically:
|
* automatically:
|
||||||
*
|
*
|
||||||
* - Search for the corresponding family in the cache, or create
|
* - Search for the corresponding family in the cache, or create
|
||||||
* a new one if necessary. Put it in FTC_GQUERY(myquery).family
|
* a new one if necessary. Put it in FTC_GQUERY(myquery).family
|
||||||
*
|
*
|
||||||
* - Call FTC_Cache_Lookup.
|
* - Call FTC_Cache_Lookup.
|
||||||
*
|
*
|
||||||
* If it returns NULL, you should create a new node, then call
|
* If it returns NULL, you should create a new node, then call
|
||||||
* ftc_cache_add as usual.
|
* ftc_cache_add as usual.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* Important: The functions defined in this file are only used to */
|
* Important: The functions defined in this file are only used to
|
||||||
/* implement an abstract glyph cache class. You need to */
|
* implement an abstract glyph cache class. You need to
|
||||||
/* provide additional logic to implement a complete cache. */
|
* provide additional logic to implement a complete cache.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
@ -125,11 +125,11 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We can group glyphs into `families'. Each family correspond to a
|
* We can group glyphs into `families'. Each family correspond to a
|
||||||
* given face ID, character size, transform, etc.
|
* given face ID, character size, transform, etc.
|
||||||
*
|
*
|
||||||
* Families are implemented as MRU list nodes. They are
|
* Families are implemented as MRU list nodes. They are
|
||||||
* reference-counted.
|
* reference-counted.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct FTC_FamilyRec_
|
typedef struct FTC_FamilyRec_
|
||||||
|
@ -167,12 +167,12 @@ FT_BEGIN_HEADER
|
||||||
#define FTC_GQUERY( x ) ( (FTC_GQuery)(x) )
|
#define FTC_GQUERY( x ) ( (FTC_GQuery)(x) )
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* These functions are exported so that they can be called from */
|
* These functions are exported so that they can be called from
|
||||||
/* user-provided cache classes; otherwise, they are really part of the */
|
* user-provided cache classes; otherwise, they are really part of the
|
||||||
/* cache sub-system internals. */
|
* cache sub-system internals.
|
||||||
/* */
|
*/
|
||||||
|
|
||||||
/* must be called by derived FTC_Node_InitFunc routines */
|
/* must be called by derived FTC_Node_InitFunc routines */
|
||||||
FT_LOCAL( void )
|
FT_LOCAL( void )
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftcimage.c */
|
* ftcimage.c
|
||||||
/* */
|
*
|
||||||
/* FreeType Image cache (body). */
|
* FreeType Image cache (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2000-2018 by */
|
* Copyright 2000-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,35 +1,35 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftcimage.h */
|
* ftcimage.h
|
||||||
/* */
|
*
|
||||||
/* FreeType Generic Image cache (specification) */
|
* FreeType Generic Image cache (specification)
|
||||||
/* */
|
*
|
||||||
/* Copyright 2000-2018 by */
|
* Copyright 2000-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FTC_ICache is an _abstract_ cache used to store a single FT_Glyph
|
* FTC_ICache is an _abstract_ cache used to store a single FT_Glyph
|
||||||
* image per cache node.
|
* image per cache node.
|
||||||
*
|
*
|
||||||
* FTC_ICache extends FTC_GCache. For an implementation example,
|
* FTC_ICache extends FTC_GCache. For an implementation example,
|
||||||
* see FTC_ImageCache in `src/cache/ftbasic.c'.
|
* see FTC_ImageCache in `src/cache/ftbasic.c'.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* Each image cache really manages FT_Glyph objects. */
|
* Each image cache really manages FT_Glyph objects.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef FTCIMAGE_H_
|
#ifndef FTCIMAGE_H_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftcmanag.c */
|
* ftcmanag.c
|
||||||
/* */
|
*
|
||||||
/* FreeType Cache Manager (body). */
|
* FreeType Cache Manager (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2000-2018 by */
|
* Copyright 2000-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,47 +1,47 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftcmanag.h */
|
* ftcmanag.h
|
||||||
/* */
|
*
|
||||||
/* FreeType Cache Manager (specification). */
|
* FreeType Cache Manager (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2000-2018 by */
|
* Copyright 2000-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* A cache manager is in charge of the following: */
|
* A cache manager is in charge of the following:
|
||||||
/* */
|
*
|
||||||
/* - Maintain a mapping between generic FTC_FaceIDs and live FT_Face */
|
* - Maintain a mapping between generic FTC_FaceIDs and live FT_Face
|
||||||
/* objects. The mapping itself is performed through a user-provided */
|
* objects. The mapping itself is performed through a user-provided
|
||||||
/* callback. However, the manager maintains a small cache of FT_Face */
|
* callback. However, the manager maintains a small cache of FT_Face
|
||||||
/* and FT_Size objects in order to speed up things considerably. */
|
* and FT_Size objects in order to speed up things considerably.
|
||||||
/* */
|
*
|
||||||
/* - Manage one or more cache objects. Each cache is in charge of */
|
* - Manage one or more cache objects. Each cache is in charge of
|
||||||
/* holding a varying number of `cache nodes'. Each cache node */
|
* holding a varying number of `cache nodes'. Each cache node
|
||||||
/* represents a minimal amount of individually accessible cached */
|
* represents a minimal amount of individually accessible cached
|
||||||
/* data. For example, a cache node can be an FT_Glyph image */
|
* data. For example, a cache node can be an FT_Glyph image
|
||||||
/* containing a vector outline, or some glyph metrics, or anything */
|
* containing a vector outline, or some glyph metrics, or anything
|
||||||
/* else. */
|
* else.
|
||||||
/* */
|
*
|
||||||
/* Each cache node has a certain size in bytes that is added to the */
|
* Each cache node has a certain size in bytes that is added to the
|
||||||
/* total amount of `cache memory' within the manager. */
|
* total amount of `cache memory' within the manager.
|
||||||
/* */
|
*
|
||||||
/* All cache nodes are located in a global LRU list, where the oldest */
|
* All cache nodes are located in a global LRU list, where the oldest
|
||||||
/* node is at the tail of the list. */
|
* node is at the tail of the list.
|
||||||
/* */
|
*
|
||||||
/* Each node belongs to a single cache, and includes a reference */
|
* Each node belongs to a single cache, and includes a reference
|
||||||
/* count to avoid destroying it (due to caching). */
|
* count to avoid destroying it (due to caching).
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
@ -72,12 +72,12 @@
|
||||||
FT_BEGIN_HEADER
|
FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Section> */
|
* @Section:
|
||||||
/* cache_subsystem */
|
* cache_subsystem
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define FTC_MAX_FACES_DEFAULT 2
|
#define FTC_MAX_FACES_DEFAULT 2
|
||||||
|
@ -110,27 +110,28 @@ FT_BEGIN_HEADER
|
||||||
} FTC_ManagerRec;
|
} FTC_ManagerRec;
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* <Function> */
|
* @Function:
|
||||||
/* FTC_Manager_Compress */
|
* FTC_Manager_Compress
|
||||||
/* */
|
*
|
||||||
/* <Description> */
|
* @Description:
|
||||||
/* This function is used to check the state of the cache manager if */
|
* This function is used to check the state of the cache manager if
|
||||||
/* its `num_bytes' field is greater than its `max_bytes' field. It */
|
* its `num_bytes' field is greater than its `max_bytes' field. It
|
||||||
/* will flush as many old cache nodes as possible (ignoring cache */
|
* will flush as many old cache nodes as possible (ignoring cache
|
||||||
/* nodes with a non-zero reference count). */
|
* nodes with a non-zero reference count).
|
||||||
/* */
|
*
|
||||||
/* <InOut> */
|
* @InOut:
|
||||||
/* manager :: A handle to the cache manager. */
|
* manager ::
|
||||||
/* */
|
* A handle to the cache manager.
|
||||||
/* <Note> */
|
*
|
||||||
/* Client applications should not call this function directly. It is */
|
* @Note:
|
||||||
/* normally invoked by specific cache implementations. */
|
* Client applications should not call this function directly. It is
|
||||||
/* */
|
* normally invoked by specific cache implementations.
|
||||||
/* The reason this function is exported is to allow client-specific */
|
*
|
||||||
/* cache classes. */
|
* The reason this function is exported is to allow client-specific
|
||||||
/* */
|
* cache classes.
|
||||||
|
*/
|
||||||
FT_LOCAL( void )
|
FT_LOCAL( void )
|
||||||
FTC_Manager_Compress( FTC_Manager manager );
|
FTC_Manager_Compress( FTC_Manager manager );
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftcmru.c */
|
* ftcmru.c
|
||||||
/* */
|
*
|
||||||
/* FreeType MRU support (body). */
|
* FreeType MRU support (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2003-2018 by */
|
* Copyright 2003-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,43 +1,43 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftcmru.h */
|
* ftcmru.h
|
||||||
/* */
|
*
|
||||||
/* Simple MRU list-cache (specification). */
|
* Simple MRU list-cache (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2000-2018 by */
|
* Copyright 2000-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* An MRU is a list that cannot hold more than a certain number of */
|
* An MRU is a list that cannot hold more than a certain number of
|
||||||
/* elements (`max_elements'). All elements in the list are sorted in */
|
* elements (`max_elements'). All elements in the list are sorted in
|
||||||
/* least-recently-used order, i.e., the `oldest' element is at the tail */
|
* least-recently-used order, i.e., the `oldest' element is at the tail
|
||||||
/* of the list. */
|
* of the list.
|
||||||
/* */
|
*
|
||||||
/* When doing a lookup (either through `Lookup()' or `Lookup_Node()'), */
|
* When doing a lookup (either through `Lookup()' or `Lookup_Node()'),
|
||||||
/* the list is searched for an element with the corresponding key. If */
|
* the list is searched for an element with the corresponding key. If
|
||||||
/* it is found, the element is moved to the head of the list and is */
|
* it is found, the element is moved to the head of the list and is
|
||||||
/* returned. */
|
* returned.
|
||||||
/* */
|
*
|
||||||
/* If no corresponding element is found, the lookup routine will try to */
|
* If no corresponding element is found, the lookup routine will try to
|
||||||
/* obtain a new element with the relevant key. If the list is already */
|
* obtain a new element with the relevant key. If the list is already
|
||||||
/* full, the oldest element from the list is discarded and replaced by a */
|
* full, the oldest element from the list is discarded and replaced by a
|
||||||
/* new one; a new element is added to the list otherwise. */
|
* new one; a new element is added to the list otherwise.
|
||||||
/* */
|
*
|
||||||
/* Note that it is possible to pre-allocate the element list nodes. */
|
* Note that it is possible to pre-allocate the element list nodes.
|
||||||
/* This is handy if `max_elements' is sufficiently small, as it saves */
|
* This is handy if `max_elements' is sufficiently small, as it saves
|
||||||
/* allocations/releases during the lookup process. */
|
* allocations/releases during the lookup process.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef FTCMRU_H_
|
#ifndef FTCMRU_H_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftcsbits.c */
|
* ftcsbits.c
|
||||||
/* */
|
*
|
||||||
/* FreeType sbits manager (body). */
|
* FreeType sbits manager (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2000-2018 by */
|
* Copyright 2000-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
@ -91,14 +91,14 @@
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function tries to load a small bitmap within a given FTC_SNode.
|
* This function tries to load a small bitmap within a given FTC_SNode.
|
||||||
* Note that it returns a non-zero error code _only_ in the case of
|
* Note that it returns a non-zero error code _only_ in the case of
|
||||||
* out-of-memory condition. For all other errors (e.g., corresponding
|
* out-of-memory condition. For all other errors (e.g., corresponding
|
||||||
* to a bad font file), this function will mark the sbit as `unavailable'
|
* to a bad font file), this function will mark the sbit as `unavailable'
|
||||||
* and return a value of 0.
|
* and return a value of 0.
|
||||||
*
|
*
|
||||||
* You should also read the comment within the @ftc_snode_compare
|
* You should also read the comment within the @ftc_snode_compare
|
||||||
* function below to see how out-of-memory is handled during a lookup.
|
* function below to see how out-of-memory is handled during a lookup.
|
||||||
*/
|
*/
|
||||||
static FT_Error
|
static FT_Error
|
||||||
ftc_snode_load( FTC_SNode snode,
|
ftc_snode_load( FTC_SNode snode,
|
||||||
|
@ -347,34 +347,34 @@
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following code illustrates what to do when you want to
|
* The following code illustrates what to do when you want to
|
||||||
* perform operations that may fail within a lookup function.
|
* perform operations that may fail within a lookup function.
|
||||||
*
|
*
|
||||||
* Here, we want to load a small bitmap on-demand; we thus
|
* Here, we want to load a small bitmap on-demand; we thus
|
||||||
* need to call the `ftc_snode_load' function which may return
|
* need to call the `ftc_snode_load' function which may return
|
||||||
* a non-zero error code only when we are out of memory (OOM).
|
* a non-zero error code only when we are out of memory (OOM).
|
||||||
*
|
*
|
||||||
* The correct thing to do is to use @FTC_CACHE_TRYLOOP and
|
* The correct thing to do is to use @FTC_CACHE_TRYLOOP and
|
||||||
* @FTC_CACHE_TRYLOOP_END in order to implement a retry loop
|
* @FTC_CACHE_TRYLOOP_END in order to implement a retry loop
|
||||||
* that is capable of flushing the cache incrementally when
|
* that is capable of flushing the cache incrementally when
|
||||||
* an OOM errors occur.
|
* an OOM errors occur.
|
||||||
*
|
*
|
||||||
* However, we need to `lock' the node before this operation to
|
* However, we need to `lock' the node before this operation to
|
||||||
* prevent it from being flushed within the loop.
|
* prevent it from being flushed within the loop.
|
||||||
*
|
*
|
||||||
* When we exit the loop, we unlock the node, then check the `error'
|
* When we exit the loop, we unlock the node, then check the `error'
|
||||||
* variable. If it is non-zero, this means that the cache was
|
* variable. If it is non-zero, this means that the cache was
|
||||||
* completely flushed and that no usable memory was found to load
|
* completely flushed and that no usable memory was found to load
|
||||||
* the bitmap.
|
* the bitmap.
|
||||||
*
|
*
|
||||||
* We then prefer to return a value of 0 (i.e., NO MATCH). This
|
* We then prefer to return a value of 0 (i.e., NO MATCH). This
|
||||||
* ensures that the caller will try to allocate a new node.
|
* ensures that the caller will try to allocate a new node.
|
||||||
* This operation consequently _fail_ and the lookup function
|
* This operation consequently _fail_ and the lookup function
|
||||||
* returns the appropriate OOM error code.
|
* returns the appropriate OOM error code.
|
||||||
*
|
*
|
||||||
* Note that `buffer == NULL && width == 255' is a hack used to
|
* Note that `buffer == NULL && width == 255' is a hack used to
|
||||||
* tag `unavailable' bitmaps in the array. We should never try
|
* tag `unavailable' bitmaps in the array. We should never try
|
||||||
* to load these.
|
* to load these.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftcsbits.h */
|
* ftcsbits.h
|
||||||
/* */
|
*
|
||||||
/* A small-bitmap cache (specification). */
|
* A small-bitmap cache (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2000-2018 by */
|
* Copyright 2000-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef FTCSBITS_H_
|
#ifndef FTCSBITS_H_
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* cff.c */
|
* cff.c
|
||||||
/* */
|
*
|
||||||
/* FreeType OpenType driver component (body only). */
|
* FreeType OpenType driver component (body only).
|
||||||
/* */
|
*
|
||||||
/* Copyright 1996-2018 by */
|
* Copyright 1996-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define FT_MAKE_OPTION_SINGLE_OBJECT
|
#define FT_MAKE_OPTION_SINGLE_OBJECT
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* cffcmap.c */
|
* cffcmap.c
|
||||||
/* */
|
*
|
||||||
/* CFF character mapping table (cmap) support (body). */
|
* CFF character mapping table (cmap) support (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2002-2018 by */
|
* Copyright 2002-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* cffcmap.h */
|
* cffcmap.h
|
||||||
/* */
|
*
|
||||||
/* CFF character mapping table (cmap) support (specification). */
|
* CFF character mapping table (cmap) support (specification).
|
||||||
/* */
|
*
|
||||||
/* Copyright 2002-2018 by */
|
* Copyright 2002-2018 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.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef CFFCMAP_H_
|
#ifndef CFFCMAP_H_
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue