Formatting, fixing descriptions.
This commit is contained in:
parent
b1677a87ca
commit
a519b3b7a3
|
@ -458,9 +458,9 @@
|
|||
/* glyph from the font. Thus, bbox.yMax can */
|
||||
/* be seen as the `maximal ascender', */
|
||||
/* bbox.yMin as the `minimal descender', and */
|
||||
/* the maximum glyph width is given by */
|
||||
/* the maximal glyph width is given by */
|
||||
/* `bbox.xMax-bbox.xMin' (not to be confused */
|
||||
/* with the maximum _advance_width_). Only */
|
||||
/* with the maximal _advance_width_). Only */
|
||||
/* relevant for scalable formats. */
|
||||
/* */
|
||||
/* units_per_EM :: The number of font units per EM square for */
|
||||
|
@ -496,13 +496,13 @@
|
|||
/* `external leading'. Only relevant for */
|
||||
/* scalable formats. */
|
||||
/* */
|
||||
/* max_advance_width :: The maximum advance width, in font units, */
|
||||
/* max_advance_width :: The maximal advance width, in font units, */
|
||||
/* for all glyphs in this face. This can be */
|
||||
/* used to make word wrapping computations */
|
||||
/* faster. Only relevant for scalable */
|
||||
/* formats. */
|
||||
/* */
|
||||
/* max_advance_height :: The maximum advance height, in font units, */
|
||||
/* max_advance_height :: The maximal advance height, in font units, */
|
||||
/* for all glyphs in this face. This is only */
|
||||
/* relevant for vertical layouts, and should */
|
||||
/* be set to the `height' for fonts that do */
|
||||
|
@ -536,14 +536,14 @@
|
|||
/* */
|
||||
/* sizes_list :: The list of child sizes for this face. */
|
||||
/* */
|
||||
/* max_points :: The maximum number of points used to store */
|
||||
/* max_points :: The maximal number of points used to store */
|
||||
/* the vectorial outline of any glyph in this */
|
||||
/* face. If this value cannot be known in */
|
||||
/* advance, or if the face isn't scalable, */
|
||||
/* this should be set to 0. Only relevant for */
|
||||
/* scalable formats. */
|
||||
/* */
|
||||
/* max_contours :: The maximum number of contours used to */
|
||||
/* max_contours :: The maximal number of contours used to */
|
||||
/* store the vectorial outline of any glyph in */
|
||||
/* this face. If this value cannot be known */
|
||||
/* in advance, or if the face isn't scalable, */
|
||||
|
@ -1730,7 +1730,7 @@
|
|||
/* */
|
||||
/* <Description> */
|
||||
/* A very simple function used to perform the computation `(A*B)/C' */
|
||||
/* with maximum accuracy (it uses a 64-bit intermediate integer */
|
||||
/* with maximal accuracy (it uses a 64-bit intermediate integer */
|
||||
/* whenever necessary). */
|
||||
/* */
|
||||
/* This function isn't necessarily as fast as some processor specific */
|
||||
|
@ -1758,7 +1758,7 @@
|
|||
/* */
|
||||
/* <Description> */
|
||||
/* A very simple function used to perform the computation */
|
||||
/* `(A*B)/0x10000' with maximum accuracy. Most of the time, this is */
|
||||
/* `(A*B)/0x10000' with maximal accuracy. Most of the time, this is */
|
||||
/* used to multiply a given value by a 16.16 fixed float factor. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
|
@ -1791,7 +1791,7 @@
|
|||
/* */
|
||||
/* <Description> */
|
||||
/* A very simple function used to perform the computation */
|
||||
/* `(A*0x10000)/B' with maximum accuracy. Most of the time, this is */
|
||||
/* `(A*0x10000)/B' with maximal accuracy. Most of the time, this is */
|
||||
/* used to divide a given value by a 16.16 fixed float factor. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
|
@ -1921,9 +1921,9 @@
|
|||
/* outline will NOT necessarily be FREED when */
|
||||
/* destroying the library, by FT_Done_FreeType(). */
|
||||
/* */
|
||||
/* numPoints :: The maximum number of points within the outline. */
|
||||
/* numPoints :: The maximal number of points within the outline. */
|
||||
/* */
|
||||
/* numContours :: The maximum number of contours within the outline. */
|
||||
/* numContours :: The maximal number of contours within the outline. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* outline :: A handle to the new outline. NULL in case of */
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#include <freetype/internal/ftcalc.h>
|
||||
#include <freetype/internal/ftdebug.h>
|
||||
#include <freetype/internal/ftobjs.h> /* for ABS() */
|
||||
|
@ -53,7 +54,9 @@
|
|||
536870912, 759250125, 1073741824, 1518500250,
|
||||
2147483647
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
|
@ -75,7 +78,7 @@
|
|||
|
||||
|
||||
root = 0;
|
||||
mask = 0x40000000;
|
||||
mask = 0x40000000L;
|
||||
val = (FT_ULong)x;
|
||||
|
||||
do
|
||||
|
@ -94,10 +97,11 @@
|
|||
|
||||
return root;
|
||||
}
|
||||
|
||||
#endif /* OLD_CALCS */
|
||||
|
||||
#ifdef LONG64
|
||||
|
||||
#ifdef LONG64
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
|
@ -106,7 +110,7 @@
|
|||
/* */
|
||||
/* <Description> */
|
||||
/* A very simple function used to perform the computation `(a*b)/c' */
|
||||
/* with maximum accuracy (it uses a 64-bit intermediate integer */
|
||||
/* with maximal accuracy (it uses a 64-bit intermediate integer */
|
||||
/* whenever necessary). */
|
||||
/* */
|
||||
/* This function isn't necessarily as fast as some processor specific */
|
||||
|
@ -119,7 +123,7 @@
|
|||
/* */
|
||||
/* <Return> */
|
||||
/* The result of `(a*b)/c'. This function never traps when trying to */
|
||||
/* divide by zero, it simply returns `MaxInt' or `MinInt' depending */
|
||||
/* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
|
||||
/* on the signs of `a' and `b'. */
|
||||
/* */
|
||||
FT_EXPORT_FUNC( FT_Long ) FT_MulDiv( FT_Long a,
|
||||
|
@ -145,7 +149,7 @@
|
|||
/* */
|
||||
/* <Description> */
|
||||
/* A very simple function used to perform the computation */
|
||||
/* `(a*b)/0x10000' with maximum accuracy. Most of the time this is */
|
||||
/* `(a*b)/0x10000' with maximal accuracy. Most of the time this is */
|
||||
/* used to multiply a given value by a 16.16 fixed float factor. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
|
@ -188,7 +192,7 @@
|
|||
/* */
|
||||
/* <Description> */
|
||||
/* A very simple function used to perform the computation */
|
||||
/* `(a*0x10000)/b' with maximum accuracy. Most of the time, this is */
|
||||
/* `(a*0x10000)/b' with maximal accuracy. Most of the time, this is */
|
||||
/* used to divide a given value by a 16.16 fixed float factor. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
|
@ -216,8 +220,7 @@
|
|||
|
||||
if ( b == 0 )
|
||||
/* check for divide by 0 */
|
||||
q = 0x7FFFFFFF;
|
||||
|
||||
q = 0x7FFFFFFFL;
|
||||
else
|
||||
/* compute result directly */
|
||||
q = ((FT_Int64)a << 16) / b;
|
||||
|
@ -227,28 +230,15 @@
|
|||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_CALCS
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Sqrt64 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Computes the square root of a 64-bits value ! Yeah, that sounds */
|
||||
/* stupid, but it's needed to obtain maximum accuracy in the */
|
||||
/* TrueType bytecode interpreter.. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* l :: 64-bits integer */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The 32-bit square-root. */
|
||||
/* */
|
||||
|
||||
/* a helper function for FT_Sqrt64() */
|
||||
|
||||
static
|
||||
int ft_order64( FT_Int64 z )
|
||||
{
|
||||
int j = 0;
|
||||
|
||||
|
||||
while ( z )
|
||||
{
|
||||
z = (unsigned INT64)z >> 1;
|
||||
|
@ -258,10 +248,27 @@
|
|||
}
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Sqrt64 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Computes the square root of a 64-bit value. That sounds stupid, */
|
||||
/* but it is needed to obtain maximal accuracy in the TrueType */
|
||||
/* bytecode interpreter. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* l :: 64-bit integer */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The 32-bit square-root. */
|
||||
/* */
|
||||
FT_EXPORT_FUNC( FT_Int32 ) FT_Sqrt64( FT_Int64 l )
|
||||
{
|
||||
FT_Int64 r, s;
|
||||
|
||||
|
||||
if ( l <= 0 ) return 0;
|
||||
if ( l == 1 ) return 1;
|
||||
|
||||
|
@ -276,7 +283,8 @@
|
|||
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_CALCS */
|
||||
|
||||
|
||||
#else /* LONG64 */
|
||||
|
@ -289,7 +297,7 @@
|
|||
/* */
|
||||
/* <Description> */
|
||||
/* A very simple function used to perform the computation `(a*b)/c' */
|
||||
/* with maximum accuracy (it uses a 64-bit intermediate integer */
|
||||
/* with maximal accuracy (it uses a 64-bit intermediate integer */
|
||||
/* whenever necessary). */
|
||||
/* */
|
||||
/* This function isn't necessarily as fast as some processor specific */
|
||||
|
@ -302,7 +310,7 @@
|
|||
/* */
|
||||
/* <Return> */
|
||||
/* The result of `(a*b)/c'. This function never traps when trying to */
|
||||
/* divide by zero, it simply returns `MaxInt' or `MinInt' depending */
|
||||
/* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
|
||||
/* on the signs of `a' and `b'. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
|
@ -363,7 +371,7 @@
|
|||
/* */
|
||||
/* <Description> */
|
||||
/* A very simple function used to perform the computation */
|
||||
/* `(a*b)/0x10000' with maximum accuracy. Most of the time, this is */
|
||||
/* `(a*b)/0x10000' with maximal accuracy. Most of the time, this is */
|
||||
/* used to multiply a given value by a 16.16 fixed float factor. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
|
@ -393,6 +401,7 @@
|
|||
FT_Long s;
|
||||
FT_ULong ua, ub;
|
||||
|
||||
|
||||
if ( a == 0 || b == 0x10000L )
|
||||
return a;
|
||||
|
||||
|
@ -425,7 +434,7 @@
|
|||
/* */
|
||||
/* <Description> */
|
||||
/* A very simple function used to perform the computation */
|
||||
/* `(a*0x10000)/b' with maximum accuracy. Most of the time, this is */
|
||||
/* `(a*0x10000)/b' with maximal accuracy. Most of the time, this is */
|
||||
/* used to divide a given value by a 16.16 fixed float factor. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
|
@ -453,8 +462,7 @@
|
|||
|
||||
if ( b == 0 )
|
||||
/* check for divide by 0 */
|
||||
q = 0x7FFFFFFF;
|
||||
|
||||
q = 0x7FFFFFFFL;
|
||||
else if ( (a >> 16) == 0 )
|
||||
{
|
||||
/* compute result directly */
|
||||
|
@ -508,6 +516,7 @@
|
|||
{
|
||||
register FT_Word32 lo, hi;
|
||||
|
||||
|
||||
lo = x->lo + y->lo;
|
||||
hi = x->hi + y->hi + ( lo < x->lo );
|
||||
|
||||
|
@ -522,7 +531,7 @@
|
|||
/* FT_MulTo64 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Multiplies two Int32 integers. Returns a Int64 integer. */
|
||||
/* Multiplies two Int32 integers. Returns an Int64 integer. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* x :: The first multiplier. */
|
||||
|
@ -649,8 +658,13 @@
|
|||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_CALCS
|
||||
|
||||
|
||||
/* two helper functions for FT_Sqrt64() */
|
||||
|
||||
static
|
||||
void FT_Sub64( FT_Int64* x, FT_Int64* y, FT_Int64* z )
|
||||
void FT_Sub64( FT_Int64* x,
|
||||
FT_Int64* y,
|
||||
FT_Int64* z )
|
||||
{
|
||||
register FT_Word32 lo, hi;
|
||||
|
||||
|
@ -662,29 +676,13 @@
|
|||
z->hi = hi;
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Sqrt64 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Computes the square root of a 64-bits value ! Yeah, that sounds */
|
||||
/* stupid, but it's needed to obtain maximum accuracy in the */
|
||||
/* TrueType bytecode interpreter.. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* z :: pointer to 64-bits integer */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The 32-bit square-root. */
|
||||
/* */
|
||||
|
||||
static
|
||||
int ft_order64( FT_Int64* z )
|
||||
{
|
||||
FT_Word32 i;
|
||||
int j;
|
||||
|
||||
|
||||
i = z->lo;
|
||||
j = 0;
|
||||
if ( z->hi )
|
||||
|
@ -701,6 +699,22 @@
|
|||
return j - 1;
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Sqrt64 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Computes the square root of a 64-bits value. That sounds stupid, */
|
||||
/* but it is needed to obtain maximal accuracy in the TrueType */
|
||||
/* bytecode interpreter. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* z :: A pointer to a 64-bit integer. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The 32-bit square-root. */
|
||||
/* */
|
||||
FT_EXPORT_FUNC( FT_Int32 ) FT_Sqrt64( FT_Int64* l )
|
||||
{
|
||||
FT_Int64 l2;
|
||||
|
@ -708,7 +722,8 @@
|
|||
|
||||
|
||||
if ( (FT_Int32)l->hi < 0 ||
|
||||
(l->hi == 0 && l->lo == 0) ) return 0;
|
||||
(l->hi == 0 && l->lo == 0) )
|
||||
return 0;
|
||||
|
||||
s = ft_order64( l );
|
||||
if ( s == 0 ) return 1;
|
||||
|
|
Loading…
Reference in New Issue