* MANY FILES... Mergin with main branch (HEAD)

CACHE
David Turner 19 years ago
parent 69156418a5
commit 17c5aee676
  1. 65
      ChangeLog
  2. 5
      builds/unix/freetype2.m4
  3. 20
      docs/CHANGES
  4. 108
      include/freetype/freetype.h
  5. 17
      include/freetype/ftcache.h
  6. 108
      src/autofit/afangles.c
  7. 2
      src/autofit/aflatin.c
  8. 14
      src/base/Jamfile
  9. 85
      src/cache/ftccback.h
  10. 5
      src/cff/cffobjs.c
  11. 6
      src/cid/cidobjs.c
  12. 5
      src/gxvalid/gxvbsln.c
  13. 75
      src/gxvalid/gxvcommn.c
  14. 5
      src/gxvalid/gxvfeat.c
  15. 8
      src/gxvalid/gxvjust.c
  16. 39
      src/gxvalid/gxvkern.c
  17. 5
      src/gxvalid/gxvlcar.c
  18. 7
      src/gxvalid/gxvmort.c
  19. 14
      src/gxvalid/gxvmort0.c
  20. 35
      src/gxvalid/gxvmort1.c
  21. 14
      src/gxvalid/gxvmort2.c
  22. 5
      src/gxvalid/gxvmort4.c
  23. 22
      src/gxvalid/gxvmort5.c
  24. 12
      src/gxvalid/gxvmorx.c
  25. 11
      src/gxvalid/gxvmorx0.c
  26. 26
      src/gxvalid/gxvmorx1.c
  27. 16
      src/gxvalid/gxvmorx2.c
  28. 24
      src/gxvalid/gxvmorx5.c
  29. 5
      src/gxvalid/gxvopbd.c
  30. 13
      src/gxvalid/gxvprop.c
  31. 6
      src/sfnt/sfdriver.c
  32. 6
      src/sfnt/sfobjs.c
  33. 58
      src/truetype/ttgload.c
  34. 6
      src/truetype/ttobjs.c
  35. 9
      src/type1/t1objs.c
  36. 10
      src/type42/t42objs.c

@ -21,6 +21,8 @@
moving "ftc_node_destroy" to private headers, it's now a local,
non-public, function
* MANY FILES... Mergin with main branch (HEAD)
2005-09-21 David Turner <david@freetype.org>
* massive redesign of the cache sub-system internals.
@ -28,6 +30,69 @@
performance (ftbench shows a 3% improvements in the SBit
and Image caches)
2005-09-05 Werner Lemberg <wl@gnu.org>
Add FT_FACE_FLAG_HINTER to indicate that a specific font driver has
a hinting engine of its own.
* include/freetype/freetype.h (FT_FACE_FLAG_HINTER): New macro.
* src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c
(cid_face_init), src/truetype/ttobjs.c (tt_face_init)
[TT_CONFIG_OPTION_BYTECODE_INTERPRETER], src/type1/t1objs.c
(T1_Face_Init), src/type42/t42objs.c (T42_Face_Init)
[TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Update face flags.
* docs/CHANGES: Document it.
2005-09-27 Werner Lemberg <wl@gnu.org>
* builds/unix/freetype2.m4: Add license exception so that the file
can be used in any other autoconf script.
2005-09-26 David Turner <david@freetype.org>
* src/autofit/aflatin.c (af_latin_compute_stem_width): Fix bad
computation of the `vertical' flag, causing ugly things in LCD mode
and others.
2005-09-23 David Turner <david@freetype.org>
* src/autofit/aflatin.c (af_latin_hints_init): Fix a bug that
prevented internal hint mode bitflags from being computed correctly.
* src/base/Jamfile: Adding src/base/ftgxval.c.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvfeat.c, src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c,
src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c,
src/gxvalid/gxvmort5.c, src/gxvalid/gxvmorx.c,
src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c,
src/gxvalid/gxvopbd.c, src/gxvalid/gxvprop.c,
src/truetype/ttgload.c: Remove _many_ compiler warnings when
compiling with Visual C++ at maximum level (/W4).
* src/autofit/afangles.c (af_angle_atan): Replaced CORDIC-based
implementation with one using lookup tables. This simple thing
speeds up glyph loading by 18%, according to ftbench!
* src/sfnt/sfdriver.c (sfnt_get_interface): Don't check for
`get_sfnt' and `load_sfnt' module interfaces.
2005-09-22 Werner Lemberg <wl@gnu.org>
* docs/CHANGES: Mention SING Glyphlet support.
2005-09-22 David Turner <david@freetype.org>
* src/base/Jamfile: Disable compilation of ftgxval module
temporarily.
2005-09-19 David Somers <dsomers@omz13.com>
* freetype2/src/sfnt/ttload.c (sfnt_dir_check): Modified to allow a

@ -10,6 +10,11 @@
# indicate that you have read the license and understand and accept it
# fully.
#
# As a special exception to the FreeType project license, this file may be
# distributed as part of a program that contains a configuration script
# generated by Autoconf, under the same distribution terms as the rest of
# that program.
#
# serial 2
# AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])

@ -33,6 +33,13 @@ LATEST CHANGES BETWEEN 2.2.0 and 2.1.10
III. MISCELLANEOUS
- A new face flag `FT_FACE_FLAG_HINTER' has been added which is
set if the font's driver has a hinting engine of its own. This
makes it possible to check at run-time whether the TrueType
bytecode interpreter has been activated. An example use is to
enable the interpretation of the `gasp' table only if native
TrueType hinting is available.
- The demo programs `ftview' and `ftstring' have been rewritten
for better readability.
@ -40,6 +47,19 @@ LATEST CHANGES BETWEEN 2.2.0 and 2.1.10
(meaning `left sidebearing point at x=0'). This helps with
some buggy fonts.
- Rudimentary support for Adobe's new `SING Glyphlet' format. See
http://www.adobe.com/products/indesign/sing_gaiji.html
for more information.
- The Cache API has been severely updated. However, that doesn't
change the public API located in FT_CACHE_H, only the types and
functions from FT_CACHE_INTERNAL_XXXX_H headers which should
only be included if you want to create custom caches.
The Cache API is still experimental, don't use it on production
code though !!!
======================================================================

@ -120,6 +120,7 @@ FT_BEGIN_HEADER
/* FT_FACE_FLAG_GLYPH_NAMES */
/* FT_FACE_FLAG_EXTERNAL_STREAM */
/* FT_FACE_FLAG_FAST_GLYPHS */
/* FT_FACE_FLAG_HINTER */
/* */
/* FT_STYLE_FLAG_BOLD */
/* FT_STYLE_FLAG_ITALIC */
@ -336,6 +337,9 @@ FT_BEGIN_HEADER
/* It also embeds a memory manager (see @FT_Memory), as well as a */
/* scan-line converter object (see @FT_Raster). */
/* */
/* For multi-threading applications each thread should have its own */
/* FT_Library object. */
/* */
/* <Note> */
/* Library objects are normally created by @FT_Init_FreeType, and */
/* destroyed with @FT_Done_FreeType. */
@ -419,7 +423,7 @@ FT_BEGIN_HEADER
/* */
/* <Note> */
/* Each face object owns one or more sizes. There is however a */
/* single _active_ size for the face at any time that will be used by */
/* single _active_ size for the face at any time that is used by */
/* functions like @FT_Load_Glyph, @FT_Get_Kerning, etc. */
/* */
/* You can use the @FT_Activate_Size API to change the current */
@ -616,8 +620,8 @@ FT_BEGIN_HEADER
/* <Note> */
/* By default, FreeType automatically synthetizes a Unicode charmap */
/* for Postscript fonts, using their glyph names dictionaries. */
/* However, it will also report the encodings defined explicitly in */
/* the font file, for the cases when they are needed, with the Adobe */
/* However, it also reports the encodings defined explicitly in the */
/* font file, for the cases when they are needed, with the Adobe */
/* values as well. */
/* */
/* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */
@ -1038,8 +1042,9 @@ FT_BEGIN_HEADER
/* FT_FACE_FLAG_KERNING :: */
/* Indicates that the face contains kerning information. If set, */
/* the kerning distance can be retrieved through the function */
/* @FT_Get_Kerning. Note that if unset, this function will always */
/* return the vector (0,0). */
/* @FT_Get_Kerning. Otherwise the function always return the */
/* vector (0,0). Note that FreeType doesn't handle kerning data */
/* from the `GPOS' table (as present in some OpenType fonts). */
/* */
/* FT_FACE_FLAG_FAST_GLYPHS :: */
/* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */
@ -1060,6 +1065,12 @@ FT_BEGIN_HEADER
/* provided by the client application and should not be destroyed */
/* when @FT_Done_Face is called. Don't read or test this flag. */
/* */
/* FT_FACE_FLAG_HINTER :: */
/* Set if the font driver has a hinting machine of its own. For */
/* example, with TrueType fonts, it makes sense to use data from */
/* the SFNT `gasp' table only if the native TrueType hinting engine */
/* (with the bytecode interpreter) is available and active. */
/* */
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
#define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 )
@ -1071,6 +1082,7 @@ FT_BEGIN_HEADER
#define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 )
#define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 )
#define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 )
#define FT_FACE_FLAG_HINTER ( 1L << 11 )
/* */
@ -1485,9 +1497,9 @@ FT_BEGIN_HEADER
/* data. */
/* */
/* other :: Really wicked formats can use this pointer to */
/* present their own glyph image to client apps. */
/* Note that the app will need to know about the */
/* image format. */
/* present their own glyph image to client */
/* applications. Note that the application */
/* needs to know about the image format. */
/* */
/* lsb_delta :: The difference between hinted and unhinted */
/* left side bearing while autohinting is */
@ -1761,8 +1773,8 @@ FT_BEGIN_HEADER
/* */
/* driver :: This field is exclusively used by @FT_Open_Face; */
/* it simply specifies the font driver to use to open */
/* the face. If set to 0, FreeType will try to load */
/* the face with each one of the drivers in its list. */
/* the face. If set to 0, FreeType tries to load the */
/* face with each one of the drivers in its list. */
/* */
/* num_params :: The number of extra parameters. */
/* */
@ -1782,12 +1794,11 @@ FT_BEGIN_HEADER
/* Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this */
/* is a normal file and use `pathname' to open it. */
/* */
/* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face will only try to */
/* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to */
/* open the file with the driver whose handler is in `driver'. */
/* */
/* If the `FT_OPEN_PARAMS' bit is set, the parameters given by */
/* `num_params' and `params' will be used. They are ignored */
/* otherwise. */
/* `num_params' and `params' is used. They are ignored otherwise. */
/* */
typedef struct FT_Open_Args_
{
@ -1834,7 +1845,7 @@ FT_BEGIN_HEADER
/* */
/* @FT_New_Face can be used to determine and/or check the font format */
/* of a given font resource. If the `face_index' field is negative, */
/* the function will _not_ return any face handle in `aface'; the */
/* the function does _not_ return any face handle in `aface'; the */
/* return value is 0 if the font format is recognized, or non-zero */
/* otherwise. */
/* */
@ -1886,7 +1897,7 @@ FT_BEGIN_HEADER
/* */
/* @FT_New_Memory_Face can be used to determine and/or check the font */
/* format of a given font resource. If the `face_index' field is */
/* negative, the function will _not_ return any face handle in */
/* negative, the function does _not_ return any face handle in */
/* `aface'; the return value is 0 if the font format is recognized, */
/* or non-zero otherwise. */
/* */
@ -1906,7 +1917,7 @@ FT_BEGIN_HEADER
/* <Description> */
/* Opens a face object from a given resource and typeface index using */
/* an `FT_Open_Args' structure. If the face object doesn't exist, it */
/* will be created. */
/* is created. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
@ -1931,7 +1942,7 @@ FT_BEGIN_HEADER
/* */
/* @FT_Open_Face can be used to determine and/or check the font */
/* format of a given font resource. If the `face_index' field is */
/* negative, the function will _not_ return any face handle in */
/* negative, the function does _not_ return any face handle in */
/* `*aface'; the function's return value is 0 if the font format is */
/* recognized, or non-zero otherwise. */
/* */
@ -2104,11 +2115,10 @@ FT_BEGIN_HEADER
/* */
/* The `character size' is really the size of an abstract square */
/* called the `EM', used to design the font. However, depending */
/* on the font design, glyphs will be smaller or greater than the */
/* EM. */
/* on the font design, glyphs is smaller or greater than the EM. */
/* */
/* This means that setting the pixel size to, say, 8x8 doesn't */
/* guarantee in any way that you will get glyph bitmaps that all fit */
/* guarantee in any way that you get glyph bitmaps that all fit */
/* within an 8x8 cell (sometimes even far from it). */
/* */
/* For bitmap fonts, `pixel_height' usually is a reliable value for */
@ -2136,7 +2146,7 @@ FT_BEGIN_HEADER
/* */
/* <InOut> */
/* face :: A handle to the target face object where the glyph */
/* will be loaded. */
/* is loaded. */
/* */
/* <Input> */
/* glyph_index :: The index of the glyph in the font file. For */
@ -2154,8 +2164,8 @@ FT_BEGIN_HEADER
/* */
/* <Note> */
/* If the glyph image is not a bitmap, and if the bit flag */
/* FT_LOAD_IGNORE_TRANSFORM is unset, the glyph image will be */
/* transformed with the information passed to a previous call to */
/* FT_LOAD_IGNORE_TRANSFORM is unset, the glyph image is transformed */
/* with the information passed to a previous call to */
/* @FT_Set_Transform. */
/* */
/* Note that this also transforms the `face.glyph.advance' field, but */
@ -2178,7 +2188,7 @@ FT_BEGIN_HEADER
/* */
/* <InOut> */
/* face :: A handle to a target face object where the glyph */
/* will be loaded. */
/* is loaded. */
/* */
/* <Input> */
/* char_code :: The glyph's character code, according to the */
@ -2195,11 +2205,10 @@ FT_BEGIN_HEADER
/* */
/* <Note> */
/* If the face has no current charmap, or if the character code */
/* is not defined in the charmap, this function will return an */
/* error. */
/* is not defined in the charmap, this function returns an error. */
/* */
/* If the glyph image is not a bitmap, and if the bit flag */
/* FT_LOAD_IGNORE_TRANSFORM is unset, the glyph image will be */
/* FT_LOAD_IGNORE_TRANSFORM is unset, the glyph image is */
/* transformed with the information passed to a previous call to */
/* @FT_Set_Transform. */
/* */
@ -2224,7 +2233,7 @@ FT_BEGIN_HEADER
* @values:
* FT_LOAD_DEFAULT ::
* Corresponding to 0, this value is used a default glyph load. In this
* case, the following will happen:
* case, the following happens:
*
* 1. FreeType looks for a bitmap for the glyph corresponding to the
* face's current size. If one is found, the function returns. The
@ -2264,7 +2273,7 @@ FT_BEGIN_HEADER
*
* FT_LOAD_NO_BITMAP ::
* Don't look for bitmaps when loading the glyph. Only scalable
* outlines will be loaded when available, and scaled, hinted, or
* outlines are loaded when available, and scaled, hinted, or
* rendered depending on other bit flags.
*
* This does not prevent you from rendering outlines to bitmaps
@ -2272,9 +2281,9 @@ FT_BEGIN_HEADER
*
* FT_LOAD_VERTICAL_LAYOUT ::
* Prepare the glyph image for vertical text layout. This basically
* means that `face.glyph.advance' will correspond to the vertical
* means that `face.glyph.advance' corresponds to the vertical
* advance height (instead of the default horizontal advance width),
* and that the glyph image will be translated to match the vertical
* and that the glyph image is translated to match the vertical
* bearings positions.
*
* FT_LOAD_FORCE_AUTOHINT ::
@ -2349,6 +2358,23 @@ FT_BEGIN_HEADER
*
* FT_LOAD_TARGET_LCD_V ::
* Use hinting for @FT_RENDER_MODE_LCD_V.
*
* @note:
* You should use only _one_ of the FT_LOAD_TARGET_XXX values; they
* can't be ORed.
*
* However, FreeType makes a distinction between the hinting algorithm
* being used, and the pixel mode of the target bitmaps. For example,
* it is possible to use the `light' hinting algorithm and have the
* results rendered in horizontal LCD pixel mode, with code like this:
*
* {
* FT_Load_Glyph( face, glyph_index,
* load_flags | FT_LOAD_TARGET_LIGHT );
*
* FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
* }
*
*/
#define FT_LOAD_DEFAULT 0x0
#define FT_LOAD_NO_SCALE 0x1
@ -2644,7 +2670,7 @@ FT_BEGIN_HEADER
/* buffer. */
/* */
/* <Output> */
/* buffer :: A pointer to a target buffer where the name will be */
/* buffer :: A pointer to a target buffer where the name is */
/* copied to. */
/* */
/* <Return> */
@ -2653,7 +2679,7 @@ FT_BEGIN_HEADER
/* <Note> */
/* An error is returned if the face doesn't provide glyph names or if */
/* the glyph index is invalid. In all cases of failure, the first */
/* byte of `buffer' will be set to 0 to indicate an empty name. */
/* byte of `buffer' is set to 0 to indicate an empty name. */
/* */
/* The glyph name is truncated to fit within the buffer if it is too */
/* long. The returned string is always zero-terminated. */
@ -2711,7 +2737,7 @@ FT_BEGIN_HEADER
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* This function will return an error if no charmap in the face */
/* This function returns an error if no charmap in the face */
/* corresponds to the encoding queried here. */
/* */
FT_EXPORT( FT_Error )
@ -2738,7 +2764,7 @@ FT_BEGIN_HEADER
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* This function will return an error if the charmap is not part of */
/* This function returns an error if the charmap is not part of */
/* the face (i.e., if it is not listed in the face->charmaps[] */
/* table). */
/* */
@ -2801,7 +2827,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* This function is used to return the first character code in the */
/* current charmap of a given face. It will also return the */
/* current charmap of a given face. It also returns the */
/* corresponding glyph index. */
/* */
/* <Input> */
@ -2833,9 +2859,9 @@ FT_BEGIN_HEADER
/* } */
/* } */
/* */
/* Note that `*agindex' will be set to 0 if the charmap is empty. */
/* The result itself can be 0 in two cases: if the charmap is empty */
/* or when the value 0 is the first valid character code. */
/* Note that `*agindex' is set to 0 if the charmap is empty. The */
/* result itself can be 0 in two cases: if the charmap is empty or */
/* when the value 0 is the first valid character code. */
/* */
FT_EXPORT( FT_ULong )
FT_Get_First_Char( FT_Face face,
@ -2868,8 +2894,8 @@ FT_BEGIN_HEADER
/* through all character codes available in a given charmap. See */
/* the note for this function for a simple code example. */
/* */
/* Note that `*agindex' will be set to 0 when there are no more codes */
/* in the charmap. */
/* Note that `*agindex' is set to 0 when there are no more codes in */
/* the charmap. */
/* */
FT_EXPORT( FT_ULong )
FT_Get_Next_Char( FT_Face face,

@ -4,7 +4,7 @@
/* */
/* FreeType Cache subsystem (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -272,8 +272,10 @@ FT_BEGIN_HEADER
/* <Input> */
/* library :: The parent FreeType library handle to use. */
/* */
/* max_bytes :: Maximum number of bytes to use for cached data. */
/* Use 0 for defaults. */
/* max_bytes :: Maximum number of bytes to use for cached data */
/* nodes. Use 0 for defaults. Note that this value */
/* does not account for managed FT_Face and FT_Size */
/* objects. */
/* */
/* requester :: An application-provided callback used to translate */
/* face IDs into real @FT_Face objects. */
@ -288,6 +290,15 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* When you perform a lookup, out-of-memory errors are detected */
/* _within_ the lookup and force incremental flushes of the cache */
/* until enough memory is released for the lookup to succeed. */
/* */
/* If a lookup fails with FT_Err_Out_Of_Memory the cache has already */
/* been completely flushed, and still no memory is available for the */
/* operation. */
/* */
FT_EXPORT( FT_Error )
FTC_Manager_New( FT_Library library,
FT_UInt max_faces,

@ -20,6 +20,112 @@
#include "aftypes.h"
#if 1
/* the following table has been automatically generated with */
/* the `mather.py' Python script */
#define AF_ATAN_BITS 8
static const FT_Byte af_arctan[1L << AF_ATAN_BITS] =
{
0, 0, 1, 1, 1, 2, 2, 2,
3, 3, 3, 3, 4, 4, 4, 5,
5, 5, 6, 6, 6, 7, 7, 7,
8, 8, 8, 9, 9, 9, 10, 10,
10, 10, 11, 11, 11, 12, 12, 12,
13, 13, 13, 14, 14, 14, 14, 15,
15, 15, 16, 16, 16, 17, 17, 17,
18, 18, 18, 18, 19, 19, 19, 20,
20, 20, 21, 21, 21, 21, 22, 22,
22, 23, 23, 23, 24, 24, 24, 24,
25, 25, 25, 26, 26, 26, 26, 27,
27, 27, 28, 28, 28, 28, 29, 29,
29, 30, 30, 30, 30, 31, 31, 31,
31, 32, 32, 32, 33, 33, 33, 33,
34, 34, 34, 34, 35, 35, 35, 35,
36, 36, 36, 36, 37, 37, 37, 38,
38, 38, 38, 39, 39, 39, 39, 40,
40, 40, 40, 41, 41, 41, 41, 42,
42, 42, 42, 42, 43, 43, 43, 43,
44, 44, 44, 44, 45, 45, 45, 45,
46, 46, 46, 46, 46, 47, 47, 47,
47, 48, 48, 48, 48, 48, 49, 49,
49, 49, 50, 50, 50, 50, 50, 51,
51, 51, 51, 51, 52, 52, 52, 52,
52, 53, 53, 53, 53, 53, 54, 54,
54, 54, 54, 55, 55, 55, 55, 55,
56, 56, 56, 56, 56, 57, 57, 57,
57, 57, 57, 58, 58, 58, 58, 58,
59, 59, 59, 59, 59, 59, 60, 60,
60, 60, 60, 61, 61, 61, 61, 61,
61, 62, 62, 62, 62, 62, 62, 63,
63, 63, 63, 63, 63, 64, 64, 64
};
FT_LOCAL_DEF( AF_Angle )
af_angle_atan( FT_Fixed dx,
FT_Fixed dy )
{
AF_Angle angle;
/* check trivial cases */
if ( dy == 0 )
{
angle = 0;
if ( dx < 0 )
angle = AF_ANGLE_PI;
return angle;
}
else if ( dx == 0 )
{
angle = AF_ANGLE_PI2;
if ( dy < 0 )
angle = -AF_ANGLE_PI2;
return angle;
}
angle = 0;
if ( dx < 0 )
{
dx = -dx;
dy = -dy;
angle = AF_ANGLE_PI;
}
if ( dy < 0 )
{
FT_Pos tmp;
tmp = dx;
dx = -dy;
dy = tmp;
angle -= AF_ANGLE_PI2;
}
if ( dx == 0 && dy == 0 )
return 0;
if ( dx == dy )
angle += AF_ANGLE_PI4;
else if ( dx > dy )
angle += af_arctan[FT_DivFix( dy, dx ) >> ( 16 - AF_ATAN_BITS )];
else
angle += AF_ANGLE_PI2 -
af_arctan[FT_DivFix( dx, dy ) >> ( 16 - AF_ATAN_BITS )];
if ( angle > AF_ANGLE_PI )
angle -= AF_ANGLE_2PI;
return angle;
}
#else /* 0 */
/*
* a python script used to generate the following table
*
@ -216,6 +322,8 @@ for n in r:
return v.y;
}
#endif /* 0 */
FT_LOCAL_DEF( AF_Angle )
af_angle_diff( AF_Angle angle1,

@ -1409,7 +1409,7 @@
AF_LatinAxis axis = & metrics->axis[dim];
FT_Pos dist = width;
FT_Int sign = 0;
FT_Int vertical = AF_HINTS_DO_VERTICAL( hints );
FT_Int vertical = ( dim == AF_DIMENSION_VERT );
if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) )

@ -30,11 +30,15 @@ SubDir FT2_TOP $(FT2_SRC_DIR) base ;
# Add the optional/replaceable files.
#
Library $(FT2_LIB) : ftsystem.c ftinit.c ftglyph.c ftmm.c ftbdf.c
ftbbox.c ftdebug.c ftxf86.c fttype1.c ftpfr.c
ftstroke.c ftwinfnt.c ftotval.c ftgxval.c ftbitmap.c
ftsynth.c
;
{
local _sources = system init glyph mm bdf
bbox debug xf86 type1 pfr
stroke winfnt otval bitmap synth
gxval
;
Library $(FT2_LIB) : ft$(_sources).c ;
}
# Add Macintosh-specific file to the library when necessary.
#

@ -0,0 +1,85 @@
/***************************************************************************/
/* */
/* ftccback.h */
/* */
/* Callback functions of the caching sub-system (specification only). */
/* */
/* Copyright 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTCCBACK_H__
#define __FTCCBACK_H__
#include <ft2build.h>
#include FT_CACHE_H
#include FT_CACHE_INTERNAL_MRU_H
#include FT_CACHE_INTERNAL_IMAGE_H
#include FT_CACHE_INTERNAL_MANAGER_H
#include FT_CACHE_INTERNAL_GLYPH_H
#include FT_CACHE_INTERNAL_SBITS_H
FT_LOCAL( void )
ftc_inode_free( FTC_Node inode,
FTC_Cache cache );
FT_LOCAL( FT_Error )
ftc_inode_new( FTC_Node *pinode,
FT_Pointer gquery,
FTC_Cache cache );
FT_LOCAL( FT_ULong )
ftc_inode_weight( FTC_Node inode,
FTC_Cache cache );
FT_LOCAL( void )
ftc_snode_free( FTC_Node snode,
FTC_Cache cache );
FT_LOCAL( FT_Error )
ftc_snode_new( FTC_Node *psnode,
FT_Pointer gquery,
FTC_Cache cache );
FT_LOCAL( FT_ULong )
ftc_snode_weight( FTC_Node snode,
FTC_Cache cache );
FT_LOCAL( FT_Bool )
ftc_snode_compare( FTC_Node snode,
FT_Pointer gquery,
FTC_Cache cache );
FT_LOCAL( FT_Bool )
ftc_gnode_compare( FTC_Node gnode,
FT_Pointer gquery,
FTC_Cache cache );
FT_LOCAL( FT_Error )
ftc_gcache_init( FTC_Cache cache );
FT_LOCAL( void )
ftc_gcache_done( FTC_Cache cache );
FT_LOCAL( FT_Error )
ftc_cache_init( FTC_Cache cache );
FT_LOCAL( void )
ftc_cache_done( FTC_Cache cache );
#endif /* __FTCCBACK_H__ */
/* END */

@ -636,8 +636,9 @@
/* */
/* Compute face flags. */
/* */
flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */
FT_FACE_FLAG_HORIZONTAL; /* horizontal data */
flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */
FT_FACE_FLAG_HORIZONTAL | /* horizontal data */
FT_FACE_FLAG_HINTER; /* has native hinter */
if ( sfnt_format )
flags |= FT_FACE_FLAG_SFNT;

@ -362,9 +362,9 @@
cidface->num_charmaps = 0;
cidface->face_index = face_index;
cidface->face_flags = FT_FACE_FLAG_SCALABLE;
cidface->face_flags |= FT_FACE_FLAG_HORIZONTAL;
cidface->face_flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */
FT_FACE_FLAG_HORIZONTAL | /* horizontal data */
FT_FACE_FLAG_HINTER; /* has native hinter */
if ( info->is_fixed_pitch )
cidface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;

@ -131,8 +131,9 @@
FT_UShort offset;
GXV_LookupValueDesc value;
offset = base_value.u + ( relative_gindex * sizeof ( FT_UShort ) );
/* XXX: check range ? */
offset = (FT_UShort)( base_value.u +
( relative_gindex * sizeof ( FT_UShort ) ) );
p = valid->lookuptbl_head + offset;
limit = lookuptbl_limit;

@ -94,7 +94,7 @@
if ( j == nmemb )
FT_INVALID_OFFSET;
*(length[i]) = buff[j + 1] - buff[j];
*(length[i]) = (FT_UShort)( buff[j + 1] - buff[j] );
if ( 0 != offset[i] && 0 == *(length[i]) )
FT_INVALID_OFFSET;
@ -197,8 +197,8 @@
GXV_LIMIT_CHECK( 1 );
val = FT_NEXT_BYTE( p );
*min = FT_MIN( *min, val );
*max = FT_MAX( *max, val );
*min = (FT_Byte)FT_MIN( *min, val );
*max = (FT_Byte)FT_MAX( *max, val );
}
valid->subtable_length = p - table;
@ -226,8 +226,8 @@
GXV_LIMIT_CHECK( 2 );
val = FT_NEXT_USHORT( p );
*min = FT_MIN( *min, val );
*max = FT_MAX( *max, val );
*min = (FT_Byte)FT_MIN( *min, val );
*max = (FT_Byte)FT_MAX( *max, val );
}
valid->subtable_length = p - table;
@ -282,9 +282,9 @@
;
entrySelector--;
searchRange *= binSrchHeader->unitSize;
rangeShift = binSrchHeader->nUnits * binSrchHeader->unitSize -
searchRange;
searchRange = (FT_UShort)( searchRange * binSrchHeader->unitSize );
rangeShift = (FT_UShort)( binSrchHeader->nUnits * binSrchHeader->unitSize
- searchRange );
if ( searchRange != binSrchHeader->searchRange ||
entrySelector != binSrchHeader->entrySelector ||
@ -629,8 +629,11 @@
for ( gid = firstGlyph; gid <= lastGlyph; gid++ )
{
value = valid->lookupfmt4_trans( gid - firstGlyph, base_value,
limit, valid );
value = valid->lookupfmt4_trans( (FT_UShort)( gid - firstGlyph ),
base_value,
limit,
valid );
valid->lookupval_func( gid, value, valid );
}
}
@ -739,14 +742,14 @@
glyphCount = FT_NEXT_USHORT( p );
gxv_glyphid_validate( firstGlyph, valid );
gxv_glyphid_validate( firstGlyph + glyphCount, valid );
gxv_glyphid_validate( (FT_UShort)( firstGlyph + glyphCount ), valid );
/* valueArray */
for ( i = 0; i < glyphCount; i++ )
{
GXV_LIMIT_CHECK( 2 );
value = GXV_LOOKUP_VALUE_LOAD( p, valid->lookupval_sign );
valid->lookupval_func( firstGlyph + i, value, valid );
valid->lookupval_func( (FT_UShort)( firstGlyph + i ), value, valid );
}
valid->subtable_length = p - table;
@ -913,12 +916,14 @@
GXV_TRACE(( " nameIndex = %d (UNTITLED)\n", name_index ));
FT_INVALID_DATA;
goto Exit; /* make compiler happy */
Out:
FT_TRACE1(( " nameIndex = %d (", name_index ));
GXV_TRACE_HEXDUMP_SFNTNAME( name );
FT_TRACE1(( ")\n" ));
Exit:
GXV_EXIT;
}
@ -967,7 +972,7 @@
if ( !nGlyphs )
goto Out;
gxv_glyphid_validate( firstGlyph + nGlyphs, valid );
gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs ), valid );
{
FT_Byte nGlyphInClass[256];
@ -1000,12 +1005,12 @@
break;
}
}
*length_p = p - table;
*length_p = (FT_UShort)( p - table );
/* scan max ClassID in use */
for ( i = 0; i < stateSize; i++ )
if ( ( 3 < i ) && ( nGlyphInClass[i] > 0 ) )
*maxClassID_p = i;
*maxClassID_p = (FT_Byte)i; /* XXX: Check Range? */
}
Out:
@ -1031,6 +1036,8 @@
FT_Byte clazz;
FT_Byte entry;
FT_UNUSED( stateSize ); /* for the non-debugging case */
GXV_NAME_ENTER( "StateArray" );
@ -1053,13 +1060,13 @@
for ( clazz = 0; clazz <= maxClassID; clazz++ )
{
entry = FT_NEXT_BYTE( p );
*maxEntry_p = FT_MAX( *maxEntry_p, entry );
*maxEntry_p = (FT_Byte)FT_MAX( *maxEntry_p, entry );
}
}
GXV_TRACE(( "parsed: maxState=%d, maxEntry=%d\n",
*maxState_p, *maxEntry_p ));
*length_p = p - table;
*length_p = (FT_UShort)( p - table );
GXV_EXIT;
}
@ -1097,7 +1104,7 @@
FT_INVALID_TOO_SHORT;
/* ftxvalidator and FontValidator both warn and continue */
maxEntry = *length_p / entrySize - 1;
maxEntry = (FT_Byte)( *length_p / entrySize - 1 );
GXV_TRACE(( "too large maxEntry, shrinking to %d fit EntryTable length\n",
maxEntry ));
}
@ -1132,11 +1139,12 @@
continue;
}
state = ( newState - stateArray ) / ( 1 + maxClassID );
state = (FT_Byte)( ( newState - stateArray ) / ( 1 + maxClassID ) );
switch ( GXV_GLYPHOFFSET_FMT( statetable ) )
{
case GXV_GLYPHOFFSET_NONE:
glyphOffset.uc = 0; /* make compiler happy */
break;
case GXV_GLYPHOFFSET_UCHAR:
@ -1166,6 +1174,7 @@
default:
if ( valid->root->level >= FT_VALIDATE_PARANOID )
FT_INVALID_FORMAT;
goto Exit;
}
if ( NULL != valid->statetable.entry_validate_func )
@ -1176,7 +1185,9 @@
statetable_limit,
valid );
}
*length_p = p - table;
Exit:
*length_p = (FT_UShort)( p - table );
GXV_EXIT;
}
@ -1258,7 +1269,7 @@
else
setup_func = gxv_StateTable_subtable_setup;
setup_func( limit - table,
setup_func( (FT_UShort)( limit - table ),
classTable,
stateArray,
entryTable,
@ -1276,7 +1287,7 @@
&maxClassID,
valid );
else
maxClassID = stateSize - 1;
maxClassID = (FT_Byte)( stateSize - 1 );
if ( stateArray != 0 )
gxv_StateArray_validate( table + stateArray,
@ -1389,8 +1400,9 @@
FT_UShort offset;
GXV_LookupValueDesc value;
offset = base_value.u + relative_gindex * sizeof ( FT_UShort );
/* XXX: check range? */
offset = (FT_UShort)( base_value.u +
relative_gindex * sizeof ( FT_UShort ) );
p = valid->lookuptbl_head + offset;
limit = lookuptbl_limit;
@ -1416,6 +1428,8 @@
FT_UShort clazz;
FT_UShort entry;
FT_UNUSED( stateSize ); /* for the non-debugging case */
GXV_NAME_ENTER( "XStateArray" );
@ -1438,7 +1452,7 @@
for ( clazz = 0; clazz <= maxClassID; clazz++ )
{
entry = FT_NEXT_USHORT( p );
*maxEntry_p = FT_MAX( *maxEntry_p, entry );
*maxEntry_p = (FT_UShort)FT_MAX( *maxEntry_p, entry );
}
}
GXV_TRACE(( "parsed: maxState=%d, maxEntry=%d\n",
@ -1492,7 +1506,7 @@
FT_INVALID_OFFSET;
}
state = newState_idx / ( 1 + maxClassID );
state = (FT_UShort)( newState_idx / ( 1 + maxClassID ) );
if ( 0 != ( newState_idx % ( 1 + maxClassID ) ) )
{
FT_TRACE4(( "-> new state = %d (supposed)\n"
@ -1505,6 +1519,7 @@
switch ( GXV_GLYPHOFFSET_FMT( xstatetable ) )
{
case GXV_GLYPHOFFSET_NONE:
glyphOffset.uc = 0; /* make compiler happy */
break;
case GXV_GLYPHOFFSET_UCHAR:
@ -1534,6 +1549,7 @@
default:
if ( valid->root->level >= FT_VALIDATE_PARANOID )
FT_INVALID_FORMAT;
goto Exit;
}
if ( NULL != valid->xstatetable.entry_validate_func )
@ -1545,6 +1561,7 @@
valid );
}
Exit:
*length_p = p - table;
GXV_EXIT;
@ -1622,7 +1639,11 @@
classTable_length = valid->subtable_length;
}
else
valid->xstatetable.maxClassID = valid->xstatetable.nClasses - 1;
{
/* XXX: check range? */
valid->xstatetable.maxClassID =
(FT_UShort)( valid->xstatetable.nClasses - 1 );
}
if ( stateArray != 0 )
gxv_XStateArray_validate( table + stateArray,

@ -225,14 +225,15 @@
( featureFlags & GXV_FEAT_MASK_UNUSED ) == 0 )
FT_INVALID_DATA;
exclusive = featureFlags & GXV_FEAT_MASK_EXCLUSIVE_SETTINGS;
exclusive = FT_BOOL( featureFlags & GXV_FEAT_MASK_EXCLUSIVE_SETTINGS );
if ( exclusive )
{
FT_Byte dynamic_default;
if ( featureFlags & GXV_FEAT_MASK_DYNAMIC_DEFAULT )
dynamic_default = featureFlags & GXV_FEAT_MASK_DEFAULT_SETTING;
dynamic_default = (FT_Byte)( featureFlags &
GXV_FEAT_MASK_DEFAULT_SETTING );
else
dynamic_default = 0;

@ -401,10 +401,10 @@
FT_UNUSED( valid );
setMark = ( 0x8000U & flags ) / 0x8000U;
dontAdvance = ( 0x4000 & flags ) / 0x4000;
markClass = ( 0x3F80 & flags ) / 0x0080;
currentClass = 0x007F & flags ;
setMark = (FT_UShort)( ( flags >> 15 ) & 1 );
dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
markClass = (FT_UShort)( ( flags >> 7 ) & 0x7F );
currentClass = (FT_UShort)( flags & 0x7F );
/* TODO: validate markClass & currentClass */
}

@ -234,9 +234,9 @@
FT_UNUSED( glyphOffset );
push = flags / 0x8000U;
dontAdvance = ( flags & 0x4000 ) / 0x4000;
valueOffset = flags & 0x3FFF;
push = (FT_UShort)( ( flags >> 15 ) & 1 );
dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
valueOffset = (FT_UShort)( flags & 0x3FFF );
{
GXV_kern_fmt1_StateOptRecData vt_rec =
@ -341,7 +341,7 @@
tag, firstGlyph, nGlyphs ));
gxv_glyphid_validate( firstGlyph, valid );
gxv_glyphid_validate( firstGlyph + nGlyphs - 1, valid );
gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs - 1 ), valid );
gxv_array_getlimits_ushort( p, p + ( 2 * nGlyphs ),
&( GXV_KERN_FMT2_DATA( offset_min[spec] ) ),
@ -512,15 +512,18 @@
FT_Bool kernCrossStream;
FT_Bool kernVariation;
FT_UNUSED( valid );
/* reserved bits = 0 */
if ( coverage & 0x1FFC )
return 0;
kernVertical = ( coverage >> 15 ) & 1;
kernCrossStream = ( coverage >> 14 ) & 1;
kernVariation = ( coverage >> 13 ) & 1;
*format = coverage & 0x0003;
kernVertical = FT_BOOL( ( coverage >> 15 ) & 1 );
kernCrossStream = FT_BOOL( ( coverage >> 14 ) & 1 );
kernVariation = FT_BOOL( ( coverage >> 13 ) & 1 );
*format = (FT_UShort)( coverage & 0x0003 );
GXV_TRACE(( "new Apple-dialect: "
"horizontal=%d, cross-stream=%d, variation=%d, format=%d\n",
@ -550,9 +553,10 @@
if ( coverage & 0x02FC )
return 0;
horizontal = ( coverage >> 15 ) & 1;
cross_stream = ( coverage >> 13 ) & 1;
*format = coverage & 0x0003;
horizontal = FT_BOOL( ( coverage >> 15 ) & 1 );
cross_stream = FT_BOOL( ( coverage >> 13 ) & 1 );
*format = (FT_UShort)( coverage & 0x0003 );
GXV_TRACE(( "classic Apple-dialect: "
"horizontal=%d, cross-stream=%d, format=%d\n",
@ -579,16 +583,19 @@
FT_Bool cross_stream;
FT_Bool override;
FT_UNUSED( valid );
/* reserved bits = 0 */
if ( coverage & 0xFDF0 )
return 0;
horizontal = coverage & 1;
minimum = ( coverage >> 1 ) & 1;
cross_stream = ( coverage >> 2 ) & 1;
override = ( coverage >> 3 ) & 1;
*format = ( coverage >> 8 ) & 0x0003;
horizontal = FT_BOOL( coverage & 1 );
minimum = FT_BOOL( ( coverage >> 1 ) & 1 );
cross_stream = FT_BOOL( ( coverage >> 2 ) & 1 );
override = FT_BOOL( ( coverage >> 3 ) & 1 );
*format = (FT_UShort)( ( coverage >> 8 ) & 0x0003 );
GXV_TRACE(( "classic Microsoft-dialect: "
"horizontal=%d, minimum=%d, cross-stream=%d, "

@ -157,8 +157,9 @@
FT_UNUSED( lookuptbl_limit );
offset = base_value.u + relative_gindex * sizeof ( FT_UShort );
/* XXX: check range? */
offset = (FT_UShort)( base_value.u +
relative_gindex * sizeof ( FT_UShort ) );
p = valid->root->base + offset;
limit = valid->root->limit;

@ -64,10 +64,9 @@
/* nSettings in gxvfeat.c is halved for exclusive on/off settings */
nSettings_max = gxv_feat_registry[f->featureType].nSettings;
if ( gxv_feat_registry[f->featureType].exclusive )
nSettings_max = 2 * gxv_feat_registry[f->featureType].nSettings;
else
nSettings_max = gxv_feat_registry[f->featureType].nSettings;
nSettings_max = (FT_Byte)( 2 * nSettings_max );
GXV_TRACE(( "featureType %d is registered", f->featureType ));
GXV_TRACE(( "setting %d", f->featureSetting ));
@ -125,6 +124,8 @@
gxv_mort_coverage_validate( FT_UShort coverage,
GXV_Validator valid )
{
FT_UNUSED( valid );
if ( coverage & 0x8000U )
GXV_TRACE(( " this subtable is for vertical text only\n" ));
else

@ -79,14 +79,16 @@
FT_UNUSED( table );
FT_UNUSED( limit );
FT_UNUSED( GXV_Mort_IndicScript_Msg[verb] ); /* for the non-debugging */
FT_UNUSED( glyphOffset ); /* case */
markFirst = flags / 0x8000U;
dontAdvance = ( flags & 0x4000 ) / 0x4000;
markLast = ( flags & 0x2000 ) / 0x2000;
reserved = flags & 0x1FF0;
verb = flags & 0x000F;
FT_UNUSED( GXV_Mort_IndicScript_Msg[verb] );
markFirst = (FT_UShort)( ( flags >> 15 ) & 1 );
dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
markLast = (FT_UShort)( ( flags >> 13 ) & 1 );
reserved = (FT_UShort)( flags & 0x1FF0 );
verb = (FT_UShort)( flags & 0x000F );
GXV_TRACE(( " IndicScript MorphRule for glyphOffset 0x%04x",
glyphOffset.u ));

@ -113,15 +113,19 @@
FT_UNUSED( state );
substTable = ((GXV_mort_subtable_type1_StateOptRec *)
(valid->statetable.optdata))->substitutionTable;
substTable_limit = substTable +
((GXV_mort_subtable_type1_StateOptRec *)
(valid->statetable.optdata))->substitutionTable_length;
substTable =
((GXV_mort_subtable_type1_StateOptRec *)
(valid->statetable.optdata))->substitutionTable;
substTable_limit =
(FT_UShort)( substTable +
((GXV_mort_subtable_type1_StateOptRec *)
(valid->statetable.optdata))->substitutionTable_length );
min_gid = ( substTable - wordOffset * 2 ) / 2;
max_gid = ( substTable_limit - wordOffset * 2 ) / 2;
max_gid = FT_MAX( max_gid, valid->face->num_glyphs );
min_gid = (FT_UShort)( ( substTable - wordOffset * 2 ) / 2 );
max_gid = (FT_UShort)( ( substTable_limit - wordOffset * 2 ) / 2 );
max_gid = (FT_UShort)( FT_MAX( max_gid, valid->face->num_glyphs ) );
/* XXX: check range? */
/* TODO: min_gid & max_gid comparison with ClassTable contents */
}
@ -146,11 +150,12 @@
FT_UNUSED( limit );
setMark = flags / 0x8000U;
dontAdvance = ( flags & 0x4000 ) / 0x4000;
reserved = flags & 0x3FFF;
markOffset = GXV_USHORT_TO_SHORT( glyphOffset.ul / 0x00010000UL );
currentOffset = GXV_USHORT_TO_SHORT( glyphOffset.ul & 0x0000FFFFUL );
setMark = (FT_UShort)( flags >> 15 );
dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
reserved = (FT_Short)( flags & 0x3FFF );
markOffset = (FT_Short)( glyphOffset.ul >> 16 );
currentOffset = (FT_Short)( glyphOffset.ul );
if ( 0 < reserved )
{
@ -177,9 +182,9 @@
GXV_Validator valid )
{
FT_Bytes p = table;
FT_UShort num_gids =
FT_UShort num_gids = (FT_UShort)(
((GXV_mort_subtable_type1_StateOptRec *)
(valid->statetable.optdata))->substitutionTable_length / 2;
(valid->statetable.optdata))->substitutionTable_length / 2 );
FT_UShort i;

@ -177,9 +177,10 @@
lig_action = FT_NEXT_ULONG( p );
last = (lig_action & 0x80000000UL) / 0x80000000UL;
store = (lig_action & 0x40000000UL) / 0x40000000UL;
offset = lig_action & 0x3FFFFFFFUL;
last = (FT_UShort)( ( lig_action >> 31 ) & 1 );
store = (FT_UShort)( ( lig_action >> 30 ) & 1 );
offset = lig_action & 0x3FFFFFFFUL;
}
}
@ -202,9 +203,10 @@
FT_UNUSED( limit );
setComponent = ( flags & 0x8000U ) / 0x8000U;
dontAdvance = ( flags & 0x4000 ) / 0x4000;
offset = flags & 0x3FFF;
setComponent = (FT_UShort)( ( flags >> 15 ) & 1 );
dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
offset = (FT_UShort)( flags & 0x3FFFU );
if ( 0 < offset )
gxv_mort_subtable_type2_ligActionOffset_validate( table, offset,

@ -87,8 +87,9 @@
FT_UShort offset;
GXV_LookupValueDesc value;
offset = base_value.u + relative_gindex * sizeof ( FT_UShort );
/* XXX: check range? */
offset = (FT_UShort)( base_value.u +
relative_gindex * sizeof ( FT_UShort ) );
p = valid->lookuptbl_head + offset;
limit = lookuptbl_limit;

@ -158,16 +158,18 @@
FT_UNUSED( state );
setMark = ( flags >> 15 ) & 1;
dontAdvance = ( flags >> 14 ) & 1;
currentIsKashidaLike = ( flags >> 13 ) & 1;
markedIsKashidaLike = ( flags >> 12 ) & 1;
currentInsertBefore = ( flags >> 11 ) & 1;
markedInsertBefore = ( flags >> 10 ) & 1;
currentInsertCount = ( flags & 0x03E0 ) / 0x0020;
markedInsertCount = ( flags & 0x001F );
currentInsertList = glyphOffset.ul / 0x00010000UL;
markedInsertList = glyphOffset.ul & 0x0000FFFFUL;
setMark = FT_BOOL( ( flags >> 15 ) & 1 );
dontAdvance = FT_BOOL( ( flags >> 14 ) & 1 );
currentIsKashidaLike = FT_BOOL( ( flags >> 13 ) & 1 );
markedIsKashidaLike = FT_BOOL( ( flags >> 12 ) & 1 );
currentInsertBefore = FT_BOOL( ( flags >> 11 ) & 1 );
markedInsertBefore = FT_BOOL( ( flags >> 10 ) & 1 );
currentInsertCount = (FT_Byte)( ( flags >> 5 ) & 0x1F );
markedInsertCount = (FT_Byte)( flags & 0x001F );
currentInsertList = (FT_UShort)( glyphOffset.ul >> 16 );
markedInsertList = (FT_UShort)( glyphOffset.ul );
if ( 0 != currentInsertList && 0 != currentInsertCount )
{

@ -85,8 +85,8 @@
GXV_LIMIT_CHECK( rest );
/* morx coverage consists of mort_coverage & 16bit padding */
gxv_mort_coverage_validate( ( coverage >> 16 ) | coverage, valid );
gxv_mort_coverage_validate( (FT_UShort)( ( coverage >> 16 ) | coverage ),
valid );
if ( type > 5 )
FT_INVALID_FORMAT;
@ -128,7 +128,13 @@
/* feature-array of morx is same with that of mort */
gxv_mort_featurearray_validate( p, limit, nFeatureFlags, valid );
p += valid->subtable_length;
gxv_morx_subtables_validate( p, table + chainLength, nSubtables, valid );
if ( nSubtables >= 0x10000 )
FT_INVALID_DATA;
gxv_morx_subtables_validate( p, table + chainLength,
(FT_UShort)nSubtables, valid );
valid->subtable_length = chainLength;
GXV_EXIT;

@ -59,11 +59,12 @@
FT_UNUSED( limit );
markFirst = flags / 0x8000U;
dontAdvance = ( flags & 0x4000 ) / 0x4000;
markLast = ( flags & 0x2000 ) / 0x2000;
reserved = flags & 0x1FF0;
verb = flags & 0x000F;
markFirst = (FT_UShort)( ( flags >> 15 ) & 1 );
dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
markLast = (FT_UShort)( ( flags >> 13 ) & 1 );
reserved = (FT_UShort)( flags & 0x1FF0 );
verb = (FT_UShort)( flags & 0x000F );
if ( 0 < reserved )
{

@ -122,11 +122,13 @@
FT_UNUSED( limit );
setMark = flags / 0x8000U;
dontAdvance = ( flags & 0x4000 ) / 0x4000;
reserved = flags & 0x3FFF;
markIndex = GXV_USHORT_TO_SHORT( glyphOffset.ul / 0x00010000UL );
currentIndex = GXV_USHORT_TO_SHORT( glyphOffset.ul & 0x0000FFFFUL );
setMark = (FT_UShort)( ( flags >> 15 ) & 1 );
dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
reserved = (FT_UShort)( flags & 0x3FFF );
markIndex = (FT_Short)( glyphOffset.ul >> 16 );
currentIndex = (FT_Short)( glyphOffset.ul );
GXV_TRACE(( " setMark=%01d dontAdvance=%01d\n",
setMark, dontAdvance ));
@ -142,10 +144,12 @@
markIndex, currentIndex ));
if ( optdata->substitutionTable_num_lookupTables < markIndex + 1 )
optdata->substitutionTable_num_lookupTables = markIndex + 1;
optdata->substitutionTable_num_lookupTables =
(FT_Short)( markIndex + 1 );
if ( optdata->substitutionTable_num_lookupTables < currentIndex + 1 )
optdata->substitutionTable_num_lookupTables = currentIndex + 1;
optdata->substitutionTable_num_lookupTables =
(FT_Short)( currentIndex + 1 );
}
@ -154,7 +158,10 @@
GXV_LookupValueDesc value,
GXV_Validator valid )
{
FT_UNUSED( glyph ); /* for the non-debugging case */
GXV_TRACE(( "morx subtable type1 subst.: %d -> %d\n", glyph, value.u ));
if ( value.u > valid->face->num_glyphs )
FT_INVALID_GLYPH_ID;
}
@ -172,8 +179,9 @@
FT_UShort offset;
GXV_LookupValueDesc value;
offset = base_value.u + relative_gindex * sizeof ( FT_UShort );
/* XXX: check range? */
offset = (FT_UShort)( base_value.u +
relative_gindex * sizeof ( FT_UShort ) );
p = valid->lookuptbl_head + offset;
limit = lookuptbl_limit;

@ -174,9 +174,10 @@
lig_action = FT_NEXT_ULONG( p );
last = (lig_action & 0x80000000UL) / 0x80000000UL;
store = (lig_action & 0x40000000UL) / 0x40000000UL;
offset = lig_action & 0x3FFFFFFFUL;
last = (FT_UShort)( ( lig_action >> 31 ) & 1 );
store = (FT_UShort)( ( lig_action >> 30 ) & 1 );
offset = lig_action & 0x3FFFFFFFUL;
}
}
@ -200,10 +201,11 @@
FT_UNUSED( limit );
setComponent = ( flags & 0x8000U ) / 0x8000U;
dontAdvance = ( flags & 0x4000 ) / 0x4000;
performAction = ( flags & 0x2000 ) / 0x2000;
reserved = flags & 0x1FFF;
setComponent = (FT_UShort)( ( flags >> 15 ) & 1 );
dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
performAction = (FT_UShort)( ( flags >> 13 ) & 1 );
reserved = (FT_UShort)( flags & 0x1FFF );
ligActionIndex = glyphOffset.u;
if ( reserved > 0 )

@ -147,7 +147,7 @@
FT_Bool markedIsKashidaLike;
FT_Bool currentInsertBefore;
FT_Bool markedInsertBefore;
FT_Bool currentInsertCount;
FT_Byte currentInsertCount;
FT_Byte markedInsertCount;
FT_Byte currentInsertList;
FT_UShort markedInsertList;
@ -155,16 +155,18 @@
FT_UNUSED( state );
setMark = ( flags >> 15 ) & 1;
dontAdvance = ( flags >> 14 ) & 1;
currentIsKashidaLike = ( flags >> 13 ) & 1;
markedIsKashidaLike = ( flags >> 12 ) & 1;
currentInsertBefore = ( flags >> 11 ) & 1;
markedInsertBefore = ( flags >> 10 ) & 1;
currentInsertCount = ( flags & 0x03E0 ) / 0x20;
markedInsertCount = ( flags & 0x001F );
currentInsertList = glyphOffset.ul / 0x00010000UL;
markedInsertList = glyphOffset.ul & 0x0000FFFFUL;
setMark = FT_BOOL( ( flags >> 15 ) & 1 );
dontAdvance = FT_BOOL( ( flags >> 14 ) & 1 );
currentIsKashidaLike = FT_BOOL( ( flags >> 13 ) & 1 );
markedIsKashidaLike = FT_BOOL( ( flags >> 12 ) & 1 );
currentInsertBefore = FT_BOOL( ( flags >> 11 ) & 1 );
markedInsertBefore = FT_BOOL( ( flags >> 10 ) & 1 );
currentInsertCount = (FT_Byte)( ( flags >> 5 ) & 0x1F );
markedInsertCount = (FT_Byte)( flags & 0x001F );
currentInsertList = (FT_Byte) ( glyphOffset.ul >> 16 );
markedInsertList = (FT_UShort)( glyphOffset.ul );
if ( currentInsertList && 0 != currentInsertCount )
gxv_morx_subtable_type5_InsertList_validate( currentInsertList,

@ -141,8 +141,9 @@
FT_UNUSED( lookuptbl_limit );
FT_UNUSED( valid );
value.u = base_value.u + relative_gindex * 4 * sizeof ( FT_Short );
/* XXX: check range? */
value.u = (FT_UShort)( base_value.u +
relative_gindex * 4 * sizeof ( FT_Short ) );
return value;
}

@ -117,17 +117,17 @@
char complement;
offset = property & GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET;
offset = (FT_UShort)( property & GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET );
if ( offset == 0 )
FT_INVALID_DATA;
complement = offset >> 8;
complement = (char)( offset >> 8 );
if ( complement & 0x08 )
{
/* Top bit is set: negative */
/* Calculate the absolute offset */
complement = ( complement & 0x07 ) + 1;
complement = (char)( ( complement & 0x07 ) + 1 );
/* The gid for complement must be greater than 0 */
if ( glyph <= complement )
@ -136,7 +136,7 @@
else
{
/* The gid for complement must be the face. */
gxv_glyphid_validate( glyph + complement, valid );
gxv_glyphid_validate( (FT_UShort)( glyph + complement ), valid );
}
}
else
@ -213,8 +213,9 @@
FT_UShort offset;
GXV_LookupValueDesc value;
offset = base_value.u + relative_gindex * sizeof( FT_UShort );
/* XXX: check range? */
offset = (FT_UShort)( base_value.u +
relative_gindex * sizeof( FT_UShort ) );
p = valid->lookuptbl_head + offset;
limit = lookuptbl_limit;

@ -318,12 +318,6 @@
{
FT_UNUSED( module );
if ( ft_strcmp( module_interface, "get_sfnt" ) == 0 )
return (FT_Module_Interface)get_sfnt_table;
if ( ft_strcmp( module_interface, "load_sfnt" ) == 0 )
return (FT_Module_Interface)tt_face_load_any;
return ft_service_list_lookup( sfnt_services, module_interface );
}

@ -536,9 +536,11 @@
/* Compute face flags. */
/* */
if ( has_outline == TRUE )
flags |= FT_FACE_FLAG_SCALABLE; /* scalable outlines */
flags |= FT_FACE_FLAG_SCALABLE; /* scalable outlines */
flags |= FT_FACE_FLAG_SFNT | /* SFNT file format */
/* The sfnt driver only supports bitmap fonts natively, thus we */
/* don't set FT_FACE_FLAG_HINTER. */
flags |= FT_FACE_FLAG_SFNT | /* SFNT file format */
FT_FACE_FLAG_HORIZONTAL; /* horizontal data */
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES

@ -755,20 +755,23 @@
/* */
#define cur_to_org( n, zone ) \
FT_ARRAY_COPY( (zone)->org, (zone)->cur, (n) )
static FT_Error
TT_Hint_Glyph( TT_Loader loader,
FT_Bool is_composite )
TT_Hint_Glyph( TT_Loader loader,
FT_Bool is_composite )
{
TT_GlyphZone zone = &loader->zone;
FT_Pos origin;
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
FT_UInt n_ins;
#else
FT_UNUSED( is_composite );
#endif
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
n_ins = loader->glyph->control_len;
#endif
origin = zone->cur[zone->n_points - 4].x;
@ -777,16 +780,16 @@
translate_array( zone->n_points, zone->cur, origin, 0 );
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
/* save original point positioin in org */
if ( n_ins > 0 )
cur_to_org( zone->n_points, zone );
#endif
/* round pp2 and pp4 */
zone->cur[zone->n_points - 3].x = FT_PIX_ROUND( zone->cur[zone->n_points - 3].x );
zone->cur[zone->n_points - 1].y = FT_PIX_ROUND( zone->cur[zone->n_points - 1].y );
zone->cur[zone->n_points - 3].x =
FT_PIX_ROUND( zone->cur[zone->n_points - 3].x );
zone->cur[zone->n_points - 1].y =
FT_PIX_ROUND( zone->cur[zone->n_points - 1].y );
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
@ -801,8 +804,8 @@
if ( error )
return error;
loader->exec->is_composite = is_composite;
loader->exec->pts = *zone;
loader->exec->is_composite = is_composite;
loader->exec->pts = *zone;
debug = !( loader->load_flags & FT_LOAD_NO_SCALE ) &&
( (TT_Size)loader->size )->debug;
@ -840,13 +843,13 @@
static FT_Error
TT_Process_Simple_Glyph( TT_Loader loader )
{
FT_GlyphLoader gloader = loader->gloader;
FT_Error error = TT_Err_Ok;
FT_GlyphLoader gloader = loader->gloader;
FT_Error error = TT_Err_Ok;
FT_Outline* outline;
FT_UInt n_points;
outline = &gloader->current.outline;
outline = &gloader->current.outline;
n_points = outline->n_points;
/* set phantom points */
@ -868,9 +871,9 @@
if ( ((TT_Face)loader->face)->doblend )
{
/* Deltas apply to the unscaled data. */
FT_Vector* deltas;
FT_Memory memory = loader->face->memory;
FT_UInt i;
FT_Vector* deltas;
FT_Memory memory = loader->face->memory;
FT_UInt i;
error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face),
@ -944,11 +947,11 @@
FT_UInt num_points = gloader->base.outline.n_points;
FT_Bool have_scale;
FT_Pos x, y;
have_scale = subglyph->flags & ( WE_HAVE_A_SCALE |
WE_HAVE_AN_XY_SCALE |
WE_HAVE_A_2X2 );
have_scale = FT_BOOL( subglyph->flags & ( WE_HAVE_A_SCALE |
WE_HAVE_AN_XY_SCALE |
WE_HAVE_A_2X2 ) );
/* perform the transform required for this subglyph */
if ( have_scale )
@ -1004,6 +1007,7 @@
( subglyph->flags & SCALED_COMPONENT_OFFSET ) )
#endif
{
#if 0
/*************************************************************************/
@ -1039,7 +1043,7 @@
FT_MulFix( subglyph->transform.xx,
subglyph->transform.xx ) +
FT_MulFix( subglyph->transform.xy,
subglyph->transform.xy) );
subglyph->transform.xy ) );
FT_Fixed mac_yscale = FT_SqrtFixed(
FT_MulFix( subglyph->transform.yy,
subglyph->transform.yy ) +
@ -1126,7 +1130,7 @@
/* TT_Load_Composite_Glyph only gives us the offset of instructions */
/* so we read them here */
/* so we read them here */
if ( FT_STREAM_SEEK( loader->ins_pos ) ||
FT_READ_USHORT( n_ins ) )
return error;
@ -1198,17 +1202,13 @@
FT_Bool opened_frame = 0;
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_Vector* deltas = NULL;
#endif
#ifdef FT_CONFIG_OPTION_INCREMENTAL
FT_StreamRec inc_stream;
FT_Data glyph_data;
FT_Bool glyph_data_loaded = 0;
#endif
@ -1276,9 +1276,9 @@
left_bearing = (FT_Short)metrics.bearing_x;
advance_width = (FT_UShort)metrics.advance;
# if 0
#if 0
/* GWW: Do I do the same for vertical metrics ??? */
/* GWW: Do I do the same for vertical metrics? */
metrics.bearing_x = 0;
metrics.bearing_y = top_bearing;
metrics.advance = advance_height;
@ -1290,7 +1290,7 @@
top_bearing = (FT_Short)metrics.bearing_y;
advance_height = (FT_UShort)metrics.advance;
# endif
#endif /* 0 */
}

@ -203,7 +203,11 @@
goto Bad_Format;
}
/* If we are performing a simple font format check, exit immediately */
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
face->root.face_flags |= FT_FACE_FLAG_HINTER;
#endif
/* If we are performing a simple font format check, exit immediately. */
if ( face_index < 0 )
return TT_Err_Ok;

@ -4,7 +4,7 @@
/* */
/* Type 1 objects manager (body). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -329,9 +329,10 @@
root->num_glyphs = type1->num_glyphs;
root->face_index = face_index;
root->face_flags = FT_FACE_FLAG_SCALABLE;
root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
root->face_flags = FT_FACE_FLAG_SCALABLE |
FT_FACE_FLAG_HORIZONTAL |
FT_FACE_FLAG_GLYPH_NAMES |
FT_FACE_FLAG_HINTER;
if ( info->is_fixed_pitch )
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;

@ -202,13 +202,17 @@
root->num_charmaps = 0;
root->face_index = face_index;
root->face_flags = FT_FACE_FLAG_SCALABLE;
root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
root->face_flags = FT_FACE_FLAG_SCALABLE |
FT_FACE_FLAG_HORIZONTAL |
FT_FACE_FLAG_GLYPH_NAMES;
if ( info->is_fixed_pitch )
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
root->face_flags |= FT_FACE_FLAG_HINTER;
#endif
/* XXX: TODO -- add kerning with .afm support */
/* get style name -- be careful, some broken fonts only */

Loading…
Cancel
Save