Index: autogen.sh =================================================================== --- autogen.sh (revision 44270) +++ autogen.sh (working copy) @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2005, 2006, 2007 by +# Copyright 2005, 2006, 2007, 2008, 2009 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -20,12 +20,120 @@ fi } +get_major_version () +{ + echo $1 | sed -e 's/\([0-9][0-9]*\)\..*/\1/g' +} + +get_minor_version () +{ + echo $1 | sed -e 's/[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/g' +} + +get_patch_version () +{ + # tricky: some version numbers don't include a patch + # separated with a point, but something like 1.4-p6 + patch=`echo $1 | sed -e 's/[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/g'` + if test "$patch" = "$1"; then + patch=`echo $1 | sed -e 's/[0-9][0-9]*\.[0-9][0-9]*\-p\([0-9][0-9]*\).*/\1/g'` + # if there isn't any patch number, default to 0 + if test "$patch" = "$1"; then + patch=0 + fi + fi + echo $patch +} + +# $1: version to check +# $2: minimum version + +compare_to_minimum_version () +{ + MAJOR1=`get_major_version $1` + MAJOR2=`get_major_version $2` + if test $MAJOR1 -lt $MAJOR2; then + echo 0 + return + else + if test $MAJOR1 -gt $MAJOR2; then + echo 1 + return + fi + fi + + MINOR1=`get_minor_version $1` + MINOR2=`get_minor_version $2` + if test $MINOR1 -lt $MINOR2; then + echo 0 + return + else + if test $MINOR1 -gt $MINOR2; then + echo 1 + return + fi + fi + + PATCH1=`get_patch_version $1` + PATCH2=`get_patch_version $2` + if test $PATCH1 -lt $PATCH2; then + echo 0 + else + echo 1 + fi +} + +# check the version of a given tool against a minimum version number +# +# $1: tool path +# $2: tool usual name (e.g. `aclocal') +# $3: tool variable (e.g. `ACLOCAL') +# $4: minimum version to check against +# $5: option field index used to extract the tool version from the +# output of --version + +check_tool_version () +{ + field=$5 + if test "$field"x = x; then + field=4 # default to 4 for all GNU autotools + fi + version=`$1 --version | head -1 | cut -d ' ' -f $field` + version_check=`compare_to_minimum_version $version $4` + if test "$version_check"x = 0x; then + echo "ERROR: Your version of the \`$2' tool is too old." + echo " Minimum version $4 is required (yours is version $version)." + echo " Please upgrade or use the $3 variable to point to a more recent one." + echo "" + exit 1 + fi +} + if test ! -f ./builds/unix/configure.raw; then echo "You must be in the same directory as \`autogen.sh'." echo "Bootstrapping doesn't work if srcdir != builddir." exit 1 fi +# On MacOS X, the GNU libtool is named `glibtool'. +HOSTOS=`uname` +LIBTOOLIZE=libtoolize +if test "$HOSTOS"x = Darwinx; then + LIBTOOLIZE=glibtoolize +fi + +if test "$ACLOCAL"x = x; then + ACLOCAL=aclocal +fi + +if test "$AUTOCONF"x = x; then + AUTOCONF=autoconf +fi + +check_tool_version $ACLOCAL aclocal ACLOCAL 1.10.1 +check_tool_version $LIBTOOLIZE libtoolize LIBTOOLIZE 2.2.4 +check_tool_version $AUTOCONF autoconf AUTOCONF 2.62 + # This sets freetype_major, freetype_minor, and freetype_patch. eval `sed -nf version.sed include/freetype/freetype.h` @@ -38,17 +146,10 @@ echo "generating \`configure.ac'" sed -e "s;@VERSION@;$freetype_major$freetype_minor$freetype_patch;" \ - < configure.raw > configure.ac + < configure.raw > configure.ac -# On MacOS X, the GNU libtool is named `glibtool'. -HOSTOS=`uname` -LIBTOOLIZE=libtoolize -if test "$HOSTOS"x = Darwinx; then - LIBTOOLIZE=glibtoolize -fi - run aclocal -I . --force -run $LIBTOOLIZE --force --copy +run $LIBTOOLIZE --force --copy --install run autoconf --force chmod +x mkinstalldirs Index: ChangeLog =================================================================== --- ChangeLog (revision 44270) +++ ChangeLog (working copy) @@ -1,3 +1,5040 @@ +2009-10-10 Werner Lemberg + + * Version 2.3.11 released. + ========================== + + + Tag sources with `VER-2-3-11'. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.3.11. + + * README, Jamfile (RefDoc), builds/win32/visualc/index.html, + builds/win32/visualc/freetype.dsp, + builds/win32/visualc/freetype.vcproj, + builds/win32/visualce/index.html, + builds/win32/visualce/freetype.dsp, + builds/win32/visualce/freetype.vcproj: s/2.3.10/2.3.11/, s/2310/2311/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 11. + + * builds/unix/configure.raw (version_info): Set to 9:22:3. + +2009-10-10 Werner Lemberg + + * docs/CHANGES, docs/release: Updated. + +2009-10-10 suzuki toshiya + + * src/pcf/pcfread.c (pcf_get_properties): Fix a bug in the nprops + truncation. Reported by Martin von Gagern and Peter Volkov. + https://bugs.gentoo.org/288357 and https://bugs.gentoo.org/288256 + +2009-10-06 Werner Lemberg + + * Version 2.3.10 released. + ========================== + + + Tag sources with `VER-2-3-10'. + + * builds/toplevel.mk (major, minor, patch): Fix regexp to allow more + than a single digit. + (dist): We now use git. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.3.10. + + * README, Jamfile (RefDoc), builds/win32/visualc/index.html, + builds/win32/visualc/freetype.dsp, + builds/win32/visualc/freetype.vcproj, + builds/win32/visualce/index.html, + builds/win32/visualce/freetype.dsp, + builds/win32/visualce/freetype.vcproj: s/2.3.9/2.3.10/, s/239/2310/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 10. + + * builds/unix/configure.raw (version_info): Set to 9:21:3. + +2009-10-06 Werner Lemberg + + Fix `make multi'. + + * src/cache/ftccache.c, src/cache/ftcsbits.c (FT_COMPONENT): Define. + + * src/sfnt/sfdriver.c: Include FT_INTERNAL_DEBUG_H. + +2009-09-27 suzuki toshiya + + [cache] Fix Savannah bug #27441, clean up Redhat bugzilla #513582. + Tricky casts in FTC_{CACHE,GCACHE,MRULIST}_LOOKUP_CMP() are removed. + Now these functions should be called with FTC_Node or FTC_MruNode + variable, and the caller should cast them to appropriate pointers to + concrete data. These tricky casts can GCC-4.4 optimizer (-O2) + confused and the crashing binaries are generated. + + * src/cache/ftcmru.h (FTC_MRULIST_LOOKUP_CMP): Drop tricky cast. + Now the 4th argument `node' of this function should be typed as + FTC_MruNode. + + * src/cache/ftcglyph.h (FTC_GCACHE_LOOKUP_CMP): For inline + implementation, new temporal variable FTC_MruNode `_mrunode' to take + the pointer from FTC_MRULIST_LOOKUP_CMP(). For non-inline + implementation, tricky cast is dropped. + + * src/cache/ftcmanag.c (FTC_SIZE_NODE): New macro casting + to FTC_SizeNode. + (FTC_Manager_LookupSize): Replace FTC_SizeNode `node' by FTC_MruNode + `mrunode', and FTC_SIZE_NODE() is inserted. + (FTC_FACE_NODE): New macro casting to FTC_FaceNode. + (FTC_Manager_LookupFace) Replace FTC_FaceNode `node' by FTC_MruNode + `mrunode', and FTC_FACE_NODE() is inserted. + + * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): Change the type of + `node' from FTC_INode to FTC_Node. Extra casting macro FTC_NODE() + is dropped. + (FTC_ImageCache_LookupScaler): Ditto. + (FTC_SBitCache_Lookup): Change the type of `node' from FTC_SNode to + FTC_Node. Extra casting macro FTC_NODE() is dropped. FTC_SNODE() + is inserted. + (FTC_SBitCache_LookupScaler): Ditto. + + * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Change the type of + `node' from FTC_CMapNode to FTC_Node. Extra casting macro + FTC_NODE() is dropped, FTC_CMAP_NODE() is inserted. + +2009-09-25 suzuki toshiya + + [cache, psaux, type1] Fix for multi build. + In multi build, some cpp functions are left as unresolved symbols. + + * src/cache/ftcbasic.c: Include FT_INTERNAL_DEBUG_H for FT_TRACE1(). + + * src/psaux/t1decode.c: Include FT_INTERNAL_CALC_H for + FIXED_TO_INT(). + * src/type1/t1gload.c: Ditto. + * src/type1/t1objs.c: Ditto. + +2009-09-25 suzuki toshiya + + [autofit] Fix for multi build. + + * src/autofit/afmodule.h: Include FT_INTERNAL_OBJECTS_H to use + FT_DECLARE_MODULE() macro in multi build. + + * src/autofit/aflatin.c: Include to handle + FT_ADVANCES_H correctly in multi build. + +2009-09-24 suzuki toshiya + + [cache] Check the face filled by FTC_Manager_LookupFace(). + + * src/cache/ftcbasic.c (ftc_basic_family_get_count): Return + immediately if FTC_Manager_LookupFace() fills face by NULL. Such + case can occur when the code is optimized by GCC-4.2.x. + +2009-09-23 Werner Lemberg + + * docs/CHANGES: Updated. + +2009-09-12 Werner Lemberg + + [raster] Fix 5-levels grayscale output. + This was broken since version 2.3.0. + + * src/raster/ftraster.c (count_table): Use pre-2.3.0 values (which + were then computed dynamically). + (Vertical_Gray_Sweep_Step): Updated. + + (ft_black_render): Initialize `worker->gray_lines' (problem found by + valgrind). + + (FT_RASTER_OPTION_ANTI_ALIASING, DEBUG_RASTER): Dont' #undef, just + comment out. + +2009-09-12 suzuki toshiya + + Improve configure.raw for cross build. + + * builds/unix/configure.raw: Remove temporal files created by the + suffix checking for CC_BUILD. Set XX_ANSIFLAGS and XX_CFLAGS when + cross compiler is GCC. AC_PROG_CC checks whether the cross compiler + is GCC, its result is stored in GCC. + +2009-09-12 suzuki toshiya + + [BDF] Modify hash API to take size_t value instead of void *. + + The hash API in BDF driver is designed to be generic, it takes + void * typed data. But BDF driver always gives an unsigned long + integer (the index to a property). To reduce non-essential + casts from unsigned long to void* and from void* to unsigned + long, the hash API is changed to take size_t integer. + The issue of incompatible cast between unsigned long and void* + on LLP64 platform is reported by NightStrike from MinGW-Win64 + project. See + http://lists.gnu.org/archive/html/freetype/2009-09/msg00000.html + + * src/bdf/bdf.h: The type of hashnode->data is changed from + void* to size_t. + + * src/bdf/bdflib.c (hash_insert): Get size_t data, instead of + void* data. + (bdf_create_property): Get the name length of new property by + size_t variable, with a cut-off at FT_ULONG_MAX. + (_bdf_set_default_spacing): Get the name length of the face by + size_t variable, with a cut-off at 256. + (bdf_get_property): Get the property id by size_t variable to + reduce the casts between 32-bit prop ID & hashnode->data during + simple copying. + (_bdf_add_property): Ditto. + (_bdf_parse_start): Calculate the index to the property array + by size_t variable. + (bdf_get_font_property): Drop a cast to unsigned long. + +2009-09-10 suzuki toshiya + + [Win64] Improve the computation of random seed from stack address. + + On LLP64 platform, the conversion from pointer to FT_Fixed need + to drop higher 32-bit. Explict casts are required. Reported by + NightStrike from MinGW-w64 project. See + http://lists.gnu.org/archive/html/freetype/2009-09/msg00000.html + + * src/cff/cffgload.c: Convert the pointers to FT_Fixed explicitly. + + * src/psaux/t1decode.c: Ditto. + + +2009-09-03 Werner Lemberg + + [raster] Improvements for stand-alone mode. + + * src/raster/rules.mk: Don't handle ftmisc.h. It is needed for + stand-alone mode only. + + * src/raster/ftmisc.h (FT_MemoryRec , FT_Alloc_Func, FT_Free_Func, + FT_Realloc_Func): Copy declarations from ftsystem.h. + +2009-09-02 Bram Tassyns + + Improve vertical metrics calculation (Savannah bug #27364). + + The calculation of `vertBearingX' is not defined in the OTF font + spec so FreeType does a `best effort' attempt. However, this value + is defined in the PDF and PostScript specs, and that algorithm is + better than the one FreeType currently uses: + + FreeType: Use the middle of the bounding box as the X coordinate + of the vertical origin. + + Adobe PDF spec: Use the middle of the horizontal advance vector as + the X coordinate of the vertical origin. + + FreeType's algorithm goes wrong if you have a really small glyph + (like the full-width, circle-like dot at the end of the sentence, as + used in CJK scripts) with large bearings. With the FreeType + algorithm this dot gets centered on the baseline; with the PDF + algorithm it gets the correct location (in the top right). Note + that this is a serious issue, it's like printing the dot at the end + of a Roman sentence at the center of the textline instead of on the + baseline like it should. So i believe the PDF spec's algorithm + should be used in FreeType as well. + + The `vertBearingY' value for such small glyphs is also very strange + if no `vmtx' information is present, since the height of the bbox is + not representable for the height of the glyph visually (the + whitespace up to the baseline is part of the glyph). The fix also + includes some code for a better estimate of `vertBearingY'. + + * src/base/ftobjs.c (ft_synthesize_vertical_metrics): `vertBearingX' + is now calculated as described by the Adobe PDF Spec. Estimate for + `vertBearingY' now works better for small glyphs completely above or + below the baseline into account. + + * src/cff/cffgload.c (cff_slot_load): `vertBearingX' is now + calculated as described by the Adobe PDF Spec. Vertical metrics + information was always ignored when FT_CONFIG_OPTION_OLD_INTERNALS + was not defined. + + * src/truetype/ttgload.c (compute_glyph_metrics): `vertBearingX' is + now calculated as described by the Adobe PDF Spec. + +2009-09-01 John Tytgat + + Fix custom cmap for empty Type 1 font (Savannah bug #27294). + + * include/freetype/internal/t1types.h (T1_EncodingRecRec_): Update + comment to reflect revised code_last meaning. + * src/type1/t1load.c (T1_Open_Face), src/type42/t42objs.c + (T42_Open_Face): Assign max_char as highest character code + 1 and + use this for T1_EncodingRecRec_::code_last. + * src/psaux/t1cmap.c (t1_cmap_custom_init): Follow revised + T1_EncodingRecRec_::code_last meaning. + +2009-08-25 Werner Lemberg + + Fix rendering of horizontally compressed CFFs. + Bug reported by Ivan Nincic . + + * src/cff/cffgload.c (cff_slot_load): Thinko: Check `xx' element of + `font_matrix' also. + + * docs/CHANGES: Updated. + +2009-08-03 suyu0925@gmail.com + + Don't call `ft_fseek' every time when executing `ft_fread'. + + * src/base/ftstream.c (FT_Stream_Seek), src/base/ftsystem.c + (ft_ansi_stream_io): Implement it. + +2009-07-31 suzuki toshiya + + sfnt: Cast a charcode to 32-bit in cmap format 14 parser. + + * src/sfnt/ttcmap.c (tt_cmap14_char_var_index, + tt_cmap14_char_var_isdefault, tt_cmap14_char_variants, + tt_cmap14_variant_chars): Correct mismatches from + FT_CMap_CharVarIndexFunc prototype, FT_ULong arguments + are replaced by FT_UInt32 arguments. + +2009-07-31 suzuki toshiya + + sfnt: Cast a charcode to 32-bit in cmap format 12 parser. + + * src/sfnt/ttcmap.c (tt_cmap12_char_next): + Insert explicit cast from FT_UFast to FT_UInt32 + for return value. + +2009-07-31 suzuki toshiya + + psaux: Fix a few casts to FT_Int32 value. + + * src/psaux/t1decode.c (t1_decoder_parse_charstrings): + Fix a few casts setting `value' from FT_Long to FT_Int32, + because `value' is typed as FT_Int32 since 2009-06-22. + +2009-07-31 suzuki toshiya + + sfnt: Fix a data type mismatching with its source. + + * src/sfnt/ttcmap.c (tt_cmap13_char_next): Fix the + type of `gindex' from FT_ULong to FT_UInt because + it is set by FT_UInt tt_cmap13_char_map_binary() or + TT_CMap13->cur_gindex. + +2009-07-31 suzuki toshiya + + sfnt: Extend a few local variables to load 32-bit values. + + * src/sfnt/ttkern.c (tt_face_load_kern): Extend `count' + and `kern' to load 32-bit values. + +2009-07-31 suzuki toshiya + + pfr: Extend `num_aux' to take 32-bit value. + + * src/pfr/pfrload.c (pfr_phy_font_load): Extend + `num_aux' to load 32-bit value. + +2009-07-31 suzuki toshiya + + pcf: Truncate FT_ULong `nprops' to fit to int PCF_Face->nprops. + + * src/pcf/pcfread.c (pcf_get_properties): Load `nprops' + as FT_ULong value from PCF file, but truncate it as + int to fit PCF_Face->nprops. The number of truncated + properties is shown in the trace message. + +2009-07-31 suzuki toshiya + + gxvalid: Extend a few local variables to reduce the casts. + + * src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate): + Extend `type' and `rest' to take FT_ULong values. + +2009-07-31 suzuki toshiya + + gxvalid: Extend `settingTable' to take 32-bit offset. + + * src/gxvalid/gxvfeat.c (gxv_feat_name_validate): + Extend `settingTable' to take 32-bit offset. + +2009-07-31 suzuki toshiya + + autofit: Cast FT_Long glyph_count to compare with FT_UInt GID. + + * src/autofit/afglobal.c (af_face_globals_is_digit, + af_face_globals_compute_script_coverage): Cast FT_Long + globals->glyph_count to FT_ULong, to compare with FT_UInt + gindex. + +2009-07-31 suzuki toshiya + + smooth: Exclude 16-bit system in invalid pitch/height check. + + * src/smooth/ftsmooth.c (ft_smooth_render_generic): + pitch and height are typed as FT_UInt but checked to fit + 16-bit range, to avoid the overflows. On 16-bit system, + this checking inserts a conditional that never occurs. + +2009-07-03 suzuki toshiya + + cff: Type large constants > 0x7FFF as long for 16-bit systems. + + * src/cff/cffload.c (cff_charset_load): Type large + constants > 0x7FFF as long, because normal constants + are typed signed integer that is less than 0x8000 on + 16-bit systems. + +2009-07-31 suzuki toshiya + + base: Remove an unused variable. + + * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Remove an + unused variable `library'. glyph->library is used. + +2009-07-31 suzuki toshiya + + cache: Check higher bits in flags for non ILP32 systems. + + 4 public functions ought to take FT_ULong flags, but take + FT_UInt flags. To keep binary compatibility, we drop higher + bits on non ILP32 platforms, + ILP64 systems: No drop occurs. + LP64 systems: Higher bits are not used. + 16-bit systems: Drop can occur. + See + http://lists.gnu.org/archive/html/freetype-devel/2008-12/msg00065.html + These functions will be refined to take FT_ULong flags in + next bump with incompatible API change. + + * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): + Check `flags' in `type', the 2nd argument. + (FTC_SBitCache_Lookup): Ditto. + (FTC_ImageCache_LookupScaler): Check `load_flags', + the 3rd argument. + (FTC_SBitCache_LookupScaler): Ditto. + +2009-07-31 suzuki toshiya + + sfnt: Ignore invalid GIDs in glyph name lookup. + + * include/freetype/internal/fttrace.h: + New trace module for sfdriver.c is added. + + * src/sfnt/sfdriver.c (sfnt_get_name_index): + Restrict glyph name lookup to FT_UInt GID. + Genuine TrueType can hold 16-bit glyphs. + +2009-07-31 suzuki toshiya + + pcf: Fix a comparison between FT_Long and FT_ULong. + + * src/pcf/pcfread.c (pcf_get_bitmaps): Return an error + if PCF_Face->nemetrics is negative. + +2009-07-31 suzuki toshiya + + gxvalid: Guarantee `nFeatureFlags' size up to 32-bit. + + * src/gxvalid/gxvmort.c (gxv_mort_featurearray_validate): + Extend the 3rd argument `nFeatureFlags' to FT_ULong. + * src/gxvalid/gxvmort.h: Ditto. + +2009-07-31 suzuki toshiya + + sfnt: Insert explicit cast for LP64 system. + + * src/sfnt/ttkern.c (tt_face_load_kern): Insert + cast from unsigned long to FT_UInt32. + +2009-07-31 suzuki toshiya + + gxvalid: Guarantee `just' table size upto 32-bit. + + * src/gxvalid/gxvjust.c (gxv_just_validate): + The type of `offset' is changed from FT_UInt to + FT_Offset, for 16-bit platforms. + +2009-07-31 suzuki toshiya + + gxvalid: Guarantee `trak' table size upto 32-bit. + + * src/gxvalid/gxvtrak.c (gxv_trak_validate): + The type of `offset' is changed from FT_UInt to + FT_Offset, for 16-bit platforms. + +2009-07-31 suzuki toshiya + + type1: Fix a data type mismatching with its source. + + * include/freetype/internal/t1types.h: The type of + T1_Face->buildchar is matched with T1_Decorder->top. + +2009-07-31 suzuki toshiya + + pfr: Fix a data type mismatching with its source. + + * src/pfr/pfrtypes.h: The type of PFR_KernItem->offset + is extended from FT_UInt32 to FT_Offset, because it is + calculated with the pointer difference, in + pfr_extra_item_load_kerning_pairs(). + +2009-07-31 suzuki toshiya + + pfr: Fix a data type mismatching with its source. + + * src/pfr/pfrtypes.h: The type of PFR_PhysFont->chars_offset + is extended from FT_UInt32 to FT_Offset, because it is + calculated with the pointer difference in pfr_phy_font_load(). + +2009-07-31 suzuki toshiya + + pfr: Fix a data type mismatching with its source. + + * src/pfr/pfrtypes.h: The type of PFR_PhyFont->bct_offset + is extended from FT_UInt32 to FT_Long, because it is + loaded by FT_STREAM_POS() in pfr_phy_font_load(). + +2009-07-31 suzuki toshiya + + smooth: Improve the format in debug message. + + * src/smooth/ftgrays.c (gray_dump_cells): Improve the + format specifications to dump variables. + +2009-07-31 suzuki toshiya + + sfnt: Fix a data type mismatching with its source. + + * src/sfnt/sfobjs.c (sfnt_load_face): The type of + local `flags' is matched with FT_Face->face_flags. + +2009-07-31 suzuki toshiya + + psaux: Fix a data type mismatching with its source. + + * include/freetype/internal/psaux.h: The type of + T1_DecorderRec.buildchar is matched with + T1_DecorderRec.top. + +2009-07-31 suzuki toshiya + + truetype: Extend TrueType GX packed deltas to FT_Offset. + + * src/truetype/ttgxvar.c (ft_var_readpackeddeltas): + The type of 2nd argument `delta_cnt' is changed from + FT_Int to FT_Offset, because its source can be cvt + table size calculated from stream position. + +2009-07-31 suzuki toshiya + + truetype: Extend mmvar_len to hold size_t values. + + * src/truetype/ttgxvar.h: The type of + GX_BlendRec.mmvar_len is changed from FT_Int to + FT_Offset, because TT_Get_MM_Var() calculates it + by sizeof() results. + +2009-07-31 suzuki toshiya + + truetype: Check invalid function number in IDEF instruction. + + * src/truetype/ttinterp.c (Ins_IDEF): Check + if the operand fits to 8-bit opcode limitation. + +2009-07-31 suzuki toshiya + + truetype: Check invalid function number in FDEF instruction. + + * src/truetype/ttinterp.c (Ins_FDEF): Check + if the operand fits 16-bit function number. + +2009-07-31 suzuki toshiya + + truetype: Truncate the deltas of composite glyph at 16-bit values. + + * src/truetype/ttgload.c (load_truetype_glyph): + Insert cast from FT_Long (deltas[i].{x,y}) to + FT_Int16 in the summation of deltas[] for composite + glyphs. Because deltas[i] is typed as FT_Pos, + its component x, y are typed as FT_Long, but + their sources are always FT_Int16 when they are + loaded by ft_var_readpackeddeltas(). However, + the limitation about the summed deltas is unclear. + +2009-07-31 suzuki toshiya + + truetype: Truncate the instructions upto 16-bit per a glyph. + + * src/truetype/ttgload.c (TT_Hint_Glyph): Truncate + the instructions upto 16-bit length per a glyph. + +2009-07-31 suzuki toshiya + + truetype: Cast the numerical operands to 32-bit for LP64 systems. + + * src/truetype/ttinterp.c (Ins_SPHIX, INS_MIAP, + Ins_MIRP): Insert cast from long (args[], the + operands passed to TrueType operator) to FT_Int32 + (the argument of TT_MulFix14()). + +2009-07-31 suzuki toshiya + + truetype: Cast the project vector to 32-bit for LP64 system. + + * src/truetype/ttinterp.c (Project, DualProject): + Insert casts from FT_Pos (the arguments `dx', `dy') + to FT_UInt32 (the argument to TT_DotFix14()). + +2009-07-31 suzuki toshiya + + truetype: Cast the scaling params to 32-bit for LP64 system. + + * src/truetype/ttgload.c (TT_Process_Composite_Component): + Insert casts from long (return value of FT_MulFix()) to + FT_Int32 (the argument to FT_SqrtFixed()). + +2009-07-31 suzuki toshiya + + sfnt: Cast a character code to FT_UInt32 for LP64 system. + + * src/sfnt/ttcmap.c (tt_cmap14_char_map_nondef_binary, + tt_cmap14_variants, tt_cmap14_char_variants, + tt_cmap14_def_char_count, tt_cmap14_get_def_chars, + tt_cmap14_get_nondef_chars, tt_cmap14_variant_chars) + Insert casts when FT_UInt32 variable is loaded by + TT_NEXT_{UINT24|ULONG}. Because most of them are + compared with FT_UInt32 values in public API, replacing + FT_UFast is not recommended. + +2009-07-31 suzuki toshiya + + sfnt: Cast a character code to FT_UInt32 for LP64 system. + + * src/sfnt/ttcmap.c (tt_cmap4_init, tt_cmap4_next): + Insert the casts from unsigned long constant to + FT_UInt32. + +2009-07-31 suzuki toshiya + + sfnt: Extend TT_BDF->strings_size to FT_ULong for huge BDF. + + * include/freetype/internal/tttypes.h: The type + of TT_BDF->string_size is extended from FT_UInt32 + to FT_ULong, because BDF specification does not + restrict the length of string. + * src/sfnt/ttbdf.c: The scratch variable `strings' + to load TT_BDF->string_size is matched with + TT_BDF->string_size. + +2009-07-31 suzuki toshiya + + psaux: Handle the string length by FT_Offset variables. + + * src/psaux/afmparse.c (afm_parser_next_key, + afm_tokenize, afm_parse_track_kern, + afm_parse_kern_pairs, afm_parse_kern_data, + afm_parser_skip_section, afm_parser_parse): + The length of key is handled by FT_Offset, + instead of FT_UInt. Although the length of + PostScript strings or name object is 16-bit, + AFM_STREAM_KEY_LEN() calculates the length + from the pointer difference. + + * src/psaux/afmparse.h (afm_parser_next_key): + Ditto. + +2009-07-31 suzuki toshiya + + pcf: Fix some data types mismatching with their sources. + + * src/pcf/pcfread.c (pcf_get_bitmaps): The types + of `nbitmaps', `i', `sizebitmaps' are matched with + the type of area FT_Bitmap.pitch * FT_Bitmap.rows. + +2009-07-31 suzuki toshiya + + pcf: Handle the string length by size_t variables. + + * src/pcf/pcfread.c (pcf_interpret_style): The types + of nn, len, lengths[4] are changed to size_t, because + they are loaded by (or compared with) ft_strlen(). + + * src/pcf/pcfutil.c (BitOrderInvert, TwoByteSwap, + FourByteSwap): The type of the 2nd argument `nbytes' + is changed to size_t, for similarity with ANSI C + string functions. + + * src/pcf/pcfdrivr.c (PCF_Glyph_Load): The type of + `bytes' is changed to FT_Offset, because it is passed + to FT_ALLOC(), via ft_glyphslot_alloc_bitmap(). At + least, using unsigned type is better. + +2009-07-31 suzuki toshiya + + pcf: Fix some data types mismatching with their sources. + + * src/pcf/pcfread.c (pcf_seek_to_table_type, + pcf_has_table_type): The type of 3rd argument + `ntables' is matched with PCF_Toc->count. + +2009-07-31 suzuki toshiya + + otvalid: Truncate the glyph index to 16-bit. + + * src/otvalid/otvalid.c (otv_validate): Checks + face->num_glyphs does not exceed 16-bit limit, + pass FT_UInt num_glyphs to backend functions + otv_{GPOS|GSUB|GDEF|JSTF|MATH}_validate(). + +2009-07-31 suzuki toshiya + + cache: Insert explict casts for LP64 systems. + + * src/cache/ftcbasic.c (FTC_ImageCache_Lookup, + FTC_SBitCache_Lookup): The type of FTC_ImageType->width + is FT_Int, so the cast to unsigned larger type FT_ULong + is introduced for the comparisons with 0x10000L for + LP64 platform. + +2009-07-31 suzuki toshiya + + cache: Fix some data types mismatching with their sources. + + * src/cache/ftccache.h: The type of return value + by FTC_Node_WeightFunc function is changed to + FT_Offset. The type of FTC_CacheClass->cache_size + is changed to FT_Offset, too. + + * src/cache/ftccback.h (ft_inode_weight, + ftc_snode_weight): Ditto. + + * src/cache/ftccmap.c (ftc_cmap_node_weight): Ditto. + + * src/cache/ftcimage.c (ftc_inode_weight, + FTC_INode_Weight): Ditto. + + * src/cache/ftcsbits.c (ftc_snode_weight, + FTC_SNode_Weight): Ditto. + + * src/cache/ftcmru.h: The type of + FTC_MruListClass->node_size is changed to FT_Offset, + because it is passed to FT_ALLOC() to specify the + size of buffer. + +2009-07-31 suzuki toshiya + + XXX_cmap_encoding_char_next() return FT_UInt32 values. + + * include/freetype/internal/services/svpscmap.h: + The size of the charcode value returned by + the function typed PS_Unicodes_CharNextFunc is + matched with its input charcode value. + + * src/cff/cffmap.c (cff_cmap_encoding_char_next, + cff_cmap_unicode_char_next): Ditto. + + * src/pfr/pfrmap.c (pfr_cmap_encoding_char_next): + Ditto. + + * src/psaux/t1cmap.c (t1_cmap_std_char_next, + t1_cmap_custom_char_next, t1_cmap_unicode_char_next): + Ditto. + + * src/psnames/psmodule.c (ps_unicodes_char_next): + Ditto. + + * src/winfonts/winfnt.c (fnt_cmap_char_next): + Ditto. + + * src/sfnt/ttcmap.c (tt_cmap0_char_next, + tt_cmap2_char_next, tt_cmap4_char_next, + tt_cmap6_char_next, tt_cmap10_char_next, + tt_cmap12_char_next, tt_cmap13_char_next): Ditto. + (tt_cmap14_char_variants): Handle base unicode + codepoint by FT_UInt32 variable to avoid overflow + on 16-bit platforms. + (tt_cmap14_ensure): The type of `num_results' is + extend to FT_UInt32, to cover unsigned 32-bit + `numVarSelectorRecords' in cmap14 table header. + +2009-07-31 suzuki toshiya + + truetype: Extend TT_Face->num_locations for broken TTFs. + + * include/freetype/internal/tttypes.h: + TT_Face->num_locations are extended from FT_UInt + to FT_ULong, to stand with broken huge loca table. + Some people insists there are broken TTF including + the glyphs over 16-bit limitation, in PRC market. + * src/truetype/ttpload.c (tt_face_load_loca): + Remove unrequired 16-bit truncation for FT_UInt + TT_Face->num_locations. + +2009-07-31 suzuki toshiya + + smooth: Fix some data types mismatching with their sources. + + * src/smooth/ftgrays.c: The type of `TCoord' is + matched to `TPos', because they are mixed in + gray_set_cell(). The type of TCell->x is extended + to `TPos', because gray_find_cell() sets it by + TWorker.ex. The type of TCell->cover is extended + to `TCoord', because gray_render_scanline() adds + TCoord value to it. The type of TWork.cover is matched + with TCell->cover. The types of + TWork.{max_cells,num_cells} are changed to FT_PtrDist, + because they are calculated from the memory addresses. + The type of TWork.ycount is changed to TPos, because + it is calculated from TPos variables. + (gray_find_cell): The type of `x' is matched with + its initial value ras.ex. + (gray_render_scanline): The types of `mod', `lift' + and `rem' are changed to TCoord, because their values + are set with explicit casts to TCoord. When ras.area + is updated by the differential values including + `delta', they are explicitly casted to TArea, because + the type of `delta' is not TArea but TCoord. + (gray_render_line): The type of `mod' is extended + from int to TCoord, because (TCoord)dy is added to mod. + (gray_hline): The argument `acount' is extended to + TCoord, to match with the parameters in the callers. + +2009-07-31 suzuki toshiya + + cff: Fix some data types mismatching with their sources. + + * src/cff/cffobjs.c (cff_face_init): The type of + `scaling' is matched with the scaling parameter + in FT_Matrix_Multiply_Scaled() and + FT_Vector_Transform_Scaled(). + + * src/cff/cffparse.c (cff_parse_real): The type of + `power_ten', `scaling', `exponent_add', + `integer_length', `fraction_length', + `new_fraction_length' and `shift' are matched with + the type of `exponent' to avoid unexpected truncation. + (cff_parse_fixed_scaled): The type of `scaling' is + matched with the `scaling' argument to + cff_parse_real(). + (cff_parse_fixed_dynamic): Ditto. + (cff_parse_font_matrix): The type of `scaling' is + matched with the `scaling' argument to + cff_parse_dynamic(). + +2009-07-31 suzuki toshiya + + autofit: Fix some data types mismatching with their sources. + + * src/autofit/afglobal.c: Correct the type of + AF_FaceGlobalsRec.glyph_count to match with + FT_Face->num_glyphs. + (af_face_globals_compute_script_coverage): + Insert explicit cast to compare + FT_Long AF_FaceGlobalsRec.glyph_count versus + FT_UInt gindex. The type of `nn' is changed + to scan glyph index upto AF_FaceGlobalsRec.glyph_count. + (af_face_globals_get_metrics): The type of `script_max' + is changed to cover size_t value. Insert explicit cast + to compare FT_Long AF_FaceGlobalsRec.glyph_count versus + FT_UInt gindex. + + * src/autofit/afhints.c (af_axis_hints_new_segment): + Insert explicit cast to calculate `big_max' from + integer and size_t values. + (af_axis_hints_new_edge): Ditto. + + * src/autofit/aflatin.c (af_latin_metrics_init_blues): + The type of `best_y' is matched to FT_Vector.y. + (af_latin_compute_stem_width): The type of `delta' is + matched to `dist' and `org_dist'. + +2009-07-31 suzuki toshiya + + autofit: Count the size of the memory object by ptrdiff_t. + + * src/autofit/afcjk.c (af_cjk_hint_edges): The + number of edges `n_edges' should be counted by + FT_PtrDist variable instead of FT_Int. + + * src/autofit/aflatin.c (af_latin_hint_edges): + Ditto. + + * src/autofit/aftypes.h: In AF_ScriptClassRec, + the size of metric `script_metrics_size' should + be counted by FT_Offset variable instead of FT_UInt. + + * src/autofit/afhints.c + (af_glyph_hints_align_strong_points): The cursors + for the edges `min', `max', `mid' in the memory + buffer should be typed FT_PtrDist. + +2009-07-31 suzuki toshiya + + autofit: Fix for unused variable `first'. + + * src/autofit/afhints.c (af_glyph_hints_reload): Insert + FT_UNUSED() to hide the unused variable warning. + +2009-07-31 suzuki toshiya + + Improve bitmap size or pixel variables for 16-bit systems. + + * include/freetype/config/ftstdlib.h: Introduce + FT_INT_MIN, to use in signed integer overflow in + 16-bit and 64-bit platforms. + + * include/freetype/internal/fttrace.h: Add a tracer + to ftsynth.c. + + * src/base/ftbitmap.c (FT_Bitmap_Embolden): Check + invalid strength causing integer overflow on 16-bit + platform. + + * src/base/ftcalc.c (ft_corner_orientation): Change + the internal calculation from FT_Int to FT_Long, to + avoid an overflow on 16-bit platforms. The caller of + this function should use only the sign of result, + so the cast to FT_Int is acceptable. + + * src/base/ftsynth.c: Introduce a tracer for synth module. + (FT_GlyphSlot_Embolden): Check invalid strength causing + integer overflow on 16-bit platform. + + * src/bdf/bdfdrivr.c (BDF_Face_Init): The glyph index + in FT2 API is typed as FT_UInt, although BDF driver + can handle unsigned long glyph index internally. To + avoid integer overflow on 16-bit platform, too large + glyph index should be excluded. + (BDF_Glyph_Load): The glyph pitch in FT2 is typed as + FT_UInt, although BDF driver can handle unsigned long + glyph pitch internally. To avoid integer overflow on + 16-bit platform, too large glyph pitch should not be + returned. + + * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): The glyph + pitch in FT2 is typed as FT_UInt, although PFR font + format can include huge bitmap glyph with 24-bit pitch + (however, a glyph spends 16.7 pixel, it's not realistic). + To avoid integer overflow on 16-bit platform, huge + bitmap glyph should be excluded. + + * src/smooth/ftgrays.c (gray_hline): As FT_Span.x is + truncated to fit its type (16-bit short), FT_Span.y + should be truncated to fit its type (FT_Int). + + * src/cff/cffdrivr.c (cff_get_ros): CFF specification + defines the supplement in ROS as a real number. + Truncate it to fit public FT2 API. + + * src/cff/cffparse.c (cff_parse_cid_ros): Warn the + supplement if it is truncated or rounded in cff_get_ros(). + + * src/cff/cfftypes.h: Change the type of internal variable + `supplement' from FT_Long to FT_ULong to fit the signedness + to the type in public API. + +2009-07-31 suzuki toshiya + + psaux: Prevent invalid arguments to afm_parser_read_vals(). + + * src/psaux/afmparse.c (afm_parser_read_vals): Change + the type of `n' to prevent negative number how many + arguments should be parsed. + + * src/psaux/afmparse.h (afm_parser_read_vals): Ditto. + +2009-07-31 suzuki toshiya + + base: Prevent some overflows on LP64 systems. + + * src/base/ftadvance.c (FT_Get_Advances): Cast the + unsigned long constant FT_LOAD_ADVANCE_ONLY to FT_UInt32 + for LP64 platforms. + + * src/base/ftcalc.c (FT_Sqrt32): All internal variables + are changed to FT_UInt32 from FT_ULong. + (FT_MulDiv): Insert casts to FT_Int32 for LP64 platforms. + This function is designed for 32-bit integer, although + their arguments and return value are FT_Long. + + * src/base/ftobjs.c (FT_Get_Char_Index): Check `charcode' + is within unsigned 32-bit integer for LP64 platforms. + (FT_Face_GetCharVariantIndex): Check `charcode' and + `variantSelector' are within 32-bit integer for LP64 + platforms. + (FT_Face_GetCharsOfVariant): Check `variantSelector' is + within unsigned 32-bit integer for LP64 platforms. + + * src/base/fttrigon.c (ft_trig_downscale): The FT_Fixed + variable `val' and unsigned long constant FT_TRIG_SCALE + are casted to FT_UInt32, when calculates FT_UInt32. + (FT_Vector_Rotate): The long constant 1L is casted to + FT_Int32 to calculate FT_Int32 `half'. + +2009-07-31 suzuki toshiya + + cff: Cast the long variables to 32-bit for LP64 systems. + + * src/cff/cffdrivr.c (cff_get_advances): Insert + explicit cast to modify a 32-bit flag by unsigned + long constant. + + * src/cff/cffobjs.c (cff_face_init): Ditto. + + * src/cff/cffgload.c (cff_decoder_parse_charstrings): + Replace the casts to FT_Long by the casts to FT_Int32 + for LP64 platforms. + +2009-07-31 suzuki toshiya + + pcf: Improve PCF_PropertyRec.value names on LP64 platforms. + + * src/pcf/pcf.h: In PCF_PropertyRec.value, the member + `integer' is replaced by `l', `cardinal' is replaced + by `ul', to fix the difference between the name and + the types on LP64 platforms. + + * src/pcf/pcfdrivr.c (pcf_get_bdf_property): Reflect + PCF_PropertyRec.value change, with appropriate casts + to FT_Int32/FT_UInt32. Their destinations + BDF_PropertyRec.{integer|cardinal} are public and + explicitly defined as FT_Int32/FT_UInt32. + + * src/pcf/pcfread.c (pcf_get_properties, pcf_load_font): + Reflect PCF_PropertyRec.value change. + +2009-07-31 suzuki toshiya + + pcf: Fix some data types mismatching with their sources. + + * src/pcf/pcfdrivr.c (pcf_cmap_char_index): The type of + `code' is matched to PCF_Encoding->enc. + (pcf_cmap_char_next): The type of `charcode' is matched + to PCF_Encoding->enc. When *acharcode is set by charcode, + an overflow is checked and casted to unsigned 32-bit + integer. + +2009-07-31 suzuki toshiya + + bdf: Improve bdf_property_t.value names for LP64 platforms. + + * src/bdf/bdf.h: In bdf_property_t.value, the member + `int32' is replaced by `l', `card32' is replaced by + `ul', to fix the difference between the name and the + types on LP64 platforms. + + * src/bdf/bdfdrivr.c (BDF_Face_Init): Reflect + bdf_property_t.value change. + (bdf_get_bdf_property): Reflect bdf_property_t.value + change, with appropriate casts to FT_Int32/FT_UInt32. + Their destinations BDF_PropertyRec.{integer|cardinal} + are public and explicitly defined as FT_Int32/FT_UInt32. + + * src/bdf/bdflib.c (_bdf_add_property): Reflect + bdf_property_t.value change. + +2009-07-31 suzuki toshiya + + bdf: Fix some data types mismatching with their sources. + + * src/bdf/bdrdrivr.c (bdf_cmap_char_index): The type + of `code' is matched with BDF_encoding_el->enc. + (bdf_cmap_char_next): The type of `charcode' is + matched with BDF_encoding_el->enc. When *acharcode + is set by charcode, an overflow is checked and + casted to unsigned 32-bit integer. + +2009-07-31 suzuki toshiya + + autofit: Improve Unicode range definitions. + + * src/autofit/aftypes.h (AF_UNIRANGE_REC): New macro + to declare a range by two unsigned 32-bit integer, + to avoid 64-bit range definition on LP64 platforms. + + * src/autofit/aflatin.c (af_latin_uniranges): Ditto. + + * src/autofit/aflatin2.c (af_latin2_uniranges): Ditto. + + * src/autofit/afindic.c (af_indic_uniranges): Ditto. + + * src/autofit/afcjk.c (af_cjk_uniranges): Declare + the ranges by AF_UNIRANGE_REC. + +2009-07-31 suzuki toshiya + + smooth: Fix a data type mismatching with its source. + + * src/smooth/ftgrays.c (gray_sweep): The type of + `area' is matched with the 3rd argument `area' + of gray_hline(). + +2009-07-31 suzuki toshiya + + smooth: Fix a data type mismatching with its source. + + * src/smooth/ftgrays.c (gray_render_line): The type + of `area' is matched with TWorker.area. + +2009-07-31 suzuki toshiya + + cache: Disable the legacy compatibility if 16-bit system. + + * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): Exclude + the legacy behaviour from 16-bit platform, because the + current hack cannot detect the caller uses this function + via legacy convension. + (FTC_SBitCache_Lookup): Ditto. + +2009-07-31 suzuki toshiya + + cache: Check 32-bit glyph index on 16-bit systems. + + * src/cache/ftcbasic.c (ftc_basic_family_get_count): + Check overflow caused by the face including large + number of glyphs > 64k. + +2009-07-31 suzuki toshiya + + cache: Fix some data types mismatching with their sources. + + * src/cache/ftccache.c (ftc_cache_resize): The types of + `p', `mask', `count' are matched with FTC_Cache->{p,mask}. + (FTC_Cache_Clear): The type of `old_index' is matched to + FTC_Cache->{p,mask}. + + * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): The type + of `_idx' is matched with FTC_Cache->{p,mask}. + +2009-07-31 suzuki toshiya + + cache: Fix some data types mismatching with their sources. + + * src/cache/ftcsbits.c (ftc_snode_load): The types + of `xadvance' and `yadvance' are matched with + FT_GlyphSlot->advance.{x|y}. + +2009-07-31 suzuki toshiya + + cache: Cast NULL to a required function type explicitly. + + * src/cache/ftcmanag.c (FTC_Manager_RemoveFaceID): + Insert explicit cast from NULL to function type. + +2009-07-31 suzuki toshiya + + fttypes.h: Cast FT_MAKE_TAG output to FT_Tag exlicitly. + + * include/freetype/fttypes.h (FT_MAKE_TAG): + Cast the result to FT_Tag. + +2009-07-31 suzuki toshiya + + psnames: Handle Unicode codepoints by FT_UInt32 variables. + + * src/psnames/psmodule.c (BASE_GLYPH): Cast the result + to unsigned 32-bit integer for LP64 platform. + (ps_unicode_value): Return the value by unsigned 32-bit + integer instead of unsigned long. + +2009-07-31 suzuki toshiya + + psaux: Use size_t variable to pass the buffer size. + + * src/psaux/psaux.h (to_bytes): The type of `max_bytes' + (the argument to pass the buffer size) is changed to + size_t, to match with ANSI C string functions. + + * src/psaux/psconv.h (PS_Conv_StringDecode, + PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Ditto. + + * src/psaux/psconv.c (PS_Conv_StringDecode, + PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Ditto. + + * src/psaux/psobjs.h (ps_parser_to_bytes): Ditto. + + * src/psaux/psobjs.c (ps_parser_to_bytes): Ditto. + +2009-07-31 suzuki toshiya + + type1: Use size_t variable to pass the string length. + + * psaux.h: The type of `len' (the argument to pass + the buffer size to the function in AFM_ParserRec) + is changed to size_t, to match with ANSI C string + functions. + + * t1afm.c (t1_get_index): Ditto. + + * test_afm.c (dummy_get_index): Ditto. + + * afmparse.c (afm_parser_read_vals): To call + AFM_ParserRec.get_index, the length of token + `len' is casted to size_t. + +2009-07-31 suzuki toshiya + + cid: Fix some data types mismatching with their sources. + + * src/cid/cidparse.c (cid_parser_new): The types of + `read_len' and `stream_len' are matched to + FT_Stream->size. Unrequired cast is removed. + +2009-07-31 suzuki toshiya + + cff: Fix for unused variable `rest'. + + * src/cff/cffparse.c (cff_parse_real): Insert + FT_UNUSED() to hide the unused variable warning. + +2009-07-31 suzuki toshiya + + cff: Fix some data types mismatching with their sources. + + * src/cff/cffgload.c (cff_slot_load): The types of + `top_upm' and `sub_upm' are matched with + CFF_FontRecDict->units_per_em. + + * src/cff/cffobjs.c (cff_size_select): Ditto. + (cff_size_request): Ditto. + +2009-07-31 suzuki toshiya + + bdf: Fix some data types mismatching with their sources. + + * bdflib.c (_bdf_list_ensure): The type of `num_items' + is matched with _bdf_list_t.used. Also the types of + `oldsize', `newsize', `bigsize' are matched too. + (_bdf_readstream): `cursor' is used as an offset to + the pointer, it should be typed as FT_Offset. Also + the types of `bytes', `start', `end', `avail' are matched. + + * bdfdrivr.c: The type of BDF_CMap->num_encodings is + matched with FT_CMap->clazz->size. + (bdf_cmap_char_index): The types of `min', `max', `mid' + are matched with BDF_CMap->num_encodings. The type of + `result' is matched with encoding->glyph. + (bdf_cmap_char_next): Ditto, the type of `code' is + matched with BDF_encoding_el.enc. + (bdf_interpret_style): The type of `lengths' is changed + to size_t, to take the value by ft_strlen(). Also the + types of `len', `nn', `mm' are matched. + +2009-07-31 suzuki toshiya + + sfnt: Count the size of the memory object by ptrdiff_t. + + * src/sfnt/ttbdf.c (tt_face_find_bdf_prop): The type of + `peroperty_len' is changed from FT_UInt to FT_Offset, + to match with size_t, which is appropriate type for the + object in the memory buffer. + +2009-07-31 suzuki toshiya + + lzw: Count the size of the memory object by ptrdiff_t. + + * src/lzw/ftzopen.h: The types of FT_LzwState->{buf_total, + stack_size} are changed from FT_UInt to FT_Offset, to match + with size_t, which is appropriate type for the object in + the memory buffer. + + * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): The types of + `old_size' and `new_size' are changed from FT_UInt to + FT_Offset, to match with size_t, which is appropriate type + for the object in the memory buffer. + +2009-07-31 suzuki toshiya + + otvalid: Count the table size on memory by ptrdiff_t. + + * src/otvalid/otvgpos.c (otv_ValueRecord_validate): + Change the type of table size from FT_UInt to + FT_PtrDist because it is calculated by the memory + addresses. + +2009-07-31 suzuki toshiya + + otvalid: Prevent an overflow by GPOS/GSUB 32b-bit offset. + + * src/otvalid/otvgpos.c (otv_ExtensionPos_validate): + Extend ExtensionOffset from FT_UInt to FT_ULong, to + cover 32-bit offset on 16-bit platform. + + * src/otvalid/otvgsub.c (otv_ExtensionSubst_validate): + Ditto. + +2009-07-31 suzuki toshiya + + ftobjs.c: Prevent an overflow in glyph index handling. + + * src/base/ftobjs.c (FT_Face_GetCharsOfVariant): + Improve the cast in comparison to avoid the truncation. + +2009-07-31 suzuki toshiya + + Improve the variable types in raccess_make_file_name(). + + * src/base/ftrfork.c (raccess_make_file_name): + Change the type of cursor variable `tmp' to const char*, + to prevent the unexpected modification of original pathname. + (raccess_make_file_name): Change the type of new_length + to size_t. + +2009-07-31 suzuki toshiya + + ftpatent.c: Fix for unused variable `error'. + + * src/base/ftpatent.c (_tt_check_patents_in_range): + Fix warning for unused variable `error'. + +2009-07-31 suzuki toshiya + + type1: Check invalid string longer than PostScript limit. + + * src/type1/t1afm.c (t1_get_index): Check invalid string + which exceeds the limit of PostScript string/name objects. + +2009-07-31 suzuki toshiya + + gzip: Use FT2 zcalloc() & zfree() in ftgzip.c by default. + + * src/gzip/ftgzip.c (zcalloc, zcfree): Disable all + zcalloc() & zfree() by zlib in zutil.c, those in + ftgzip.c by FT2 are enabled by default. To use + zlib zcalloc() & zfree(), define USE_ZLIB_ZCALLOC. + See discussion: + http://lists.gnu.org/archive/html/freetype-devel/2009-02/msg00000.html + +2009-07-31 suzuki toshiya + + gzip: Distinguish PureC from TurboC on MSDOS. + + * src/gzip/zutil.c (zcalloc, zcfree): Enable only for + MSDOS platform. + +2009-07-31 suzuki toshiya + + gxvalid: Insert PureC pragma to allow unevaluated variables. + + * builds/atari/ATARI.H: Insert PureC pragma not to + warn against set-but-unevaluated variable in gxvalid + module. + +2009-07-31 suzuki toshiya + + gxvalid: Pass the union by the pointer instead of the value. + + * src/gxvalid/gxvcommn.h: + - Declare new type `GXV_LookupValueCPtr'. + - Update the type of the 2nd argument to pass GXV_LookupValueDesc + data to the function prototyped as GXV_Lookup_Value_Validate_Func, + from GXV_LookupValueDesc to GXV_LookupValueCPtr. + - Likewise for the function prototyped as + GXV_Lookup_Fmt4_Transit_Func. + + - Declare new type `GXV_StateTable_GlyphOffsetCPtr'. + - Update the type of the 3rd argument to pass + GXV_StateTable_GlyphOffsetDesc data to the function prototyped + as GXV_StateTable_Entry_Validate_Func, from + GXV_StateTable_GlyphOffsetDesc to GXV_StateTable_GlyphOffsetCPtr. + + - Declare new type `GXV_XStateTable_GlyphOffsetCPtr'. + - Update the type of the 3rd argument to pass + GXV_XStateTable_GlyphOffsetDesc data to the function prototyped + as GXV_XStateTable_Entry_Validate_Func, + from GXV_XStateTable_GlyphOffsetDesc + to GXV_XStateTable_GlyphOffsetCPtr. + + * src/gxvalid/gxvcommn.c (gxv_LookupTable_fmt0_validate, + gxv_XClassTable_lookupval_validate, + gxv_XClassTable_lookupfmt4_transit): + Update from GXV_LookupValueDesc to GXV_LookupValueCPtr. + + * src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate, + gxv_bsln_LookupFmt4_transit): Ditto. + + * src/gxvalid/gxvjust.c + (gxv_just_pcTable_LookupValue_entry_validate, + gxv_just_classTable_entry_validate, + gxv_just_wdcTable_LookupValue_validate): Ditto. + + * src/gxvalid/gxvkern.c + (gxv_kern_subtable_fmt1_entry_validate): Ditto. + + * src/gxvalid/gxvlcar.c (gxv_lcar_LookupValue_validate, + gxv_lcar_LookupFmt4_transit): Ditto. + + * src/gxvalid/gxvopbd.c (gxv_opbd_LookupValue_validate, + gxv_opbd_LookupFmt4_transit): Ditto. + + * src/gxvalid/gxvprop.c (gxv_prop_LookupValue_validate, + gxv_prop_LookupFmt4_transit): Ditto. + + * src/gxvalid/gxvmort4.c + (gxv_mort_subtable_type4_lookupval_validate): Ditto. + + * src/gxvalid/gxvmort0.c + (gxv_mort_subtable_type0_entry_validate): Update + from GXV_StateTable_GlyphOffsetDesc + to GXV_StateTable_GlyphOffsetCPtr. + + * src/gxvalid/gxvmort1.c + (gxv_mort_subtable_type1_entry_validate): Ditto. + + * src/gxvalid/gxvmort2.c + (gxv_mort_subtable_type2_entry_validate): Ditto. + + * src/gxvalid/gxvmort5.c + (gxv_mort_subtable_type5_entry_validate): Ditto. + + * src/gxvalid/gxvmorx2.c + (gxv_morx_subtable_type2_entry_validate): Ditto. + + * src/gxvalid/gxvmorx5.c + (gxv_morx_subtable_type5_entry_validate): Ditto. + + * src/gxvalid/gxvmorx1.c + (gxv_morx_subtable_type1_entry_validate): Ditto. + (gxv_morx_subtable_type1_LookupValue_validate, + gxv_morx_subtable_type1_LookupFmt4_transit): + Update from GXV_LookupValueDesc to GXV_LookupValueCPtr. + + * src/gxvalid/gxvmorx0.c + (gxv_morx_subtable_type0_entry_validate): Update + from GXV_XStateTable_GlyphOffsetDesc + to GXV_XStateTable_GlyphOffsetCPtr. + +2009-07-29 Fabrice Bellet + + Fix Redhat bugzilla #513582 and Savannah bug #26849. + + * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP) : Fix + aliasing bug. + +2009-07-19 Werner Lemberg + + Document recent library changes. + + * docs/CHANGES: Do it. + +2009-07-17 Werner Lemberg + + Fix Savannah bug #23786. + + * src/truetype/ttobjs.c (tt_size_init_bytecode): Don't reset x_ppem + and y_ppem. Otherwise the `*_CVT_Stretched' functions in ttinterp.c + get never called. + An anonymous guy suggested this change on Savannah, and it seems to + be the right solution. + +2009-07-15 Werner Lemberg + + * docs/release: Updated. + +2009-07-15 Werner Lemberg + + README.CVS -> README.git + + * README.CVS: Renamed to... + * README.git: This. + Updated. + +2009-07-15 suzuki toshiya + + Borland C++ compiler patch proposed by Mirco Babin. + http://lists.gnu.org/archive/html/freetype/2009-07/msg00016.html. + + * builds/exports.mk: Delete unused flags, CCexe_{CFLAGS,LDFLAGS}. + Fix APINAMES_C and APINAMES_EXE pathnames to reflect the platform + specific pathname syntax. + * builds/compiler/bcc.mk: Remove unused flag, CCexe_LDFLAGS. + Define TE = `-e' separately (bcc32 cannot specify the pathname of + binary executable by T = `-o'). + Extend the large page size in linking freetype.lib. + Add extra CLEAN target to delete bcc specific temporary files. + * builds/compiler/bcc-dev.mk: Ditto. + +2009-07-14 Werner Lemberg + + Fix Savannah bug #27026. + + * builds/win32/vc2005/freetype.sln: Use correct version number. + +2009-07-12 suzuki toshiya + + Add a script to check the undefined and unused trace macros. + + * src/tools/chktrcmp.py: A script to check trace_XXXX macros + that are used in C source but undefined in fttrace.h, or + defined in fttrace.h but unused in C sources. See + http://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00013.html. + * docs/DEBUG: Mention on chktrcmp.py. + * docs/release: Ditto. + +2009-07-09 Werner Lemberg + + [ftraster] Make it compile again with -D_STANDALONE_. + + * src/raster/ftraster.c [_STANDALONE_]: Define + FT_CONFIG_STANDARD_LIBRARY_H. + Include `string.h'. + Don't include `rastpic.h'. + Define FT_DEFINE_RASTER_FUNCS. + +2009-07-09 suzuki toshiya + + smooth: Check glyph size by width/height, instead of pitch/height. + Suggested by der Mouse . + + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Improve + the check for too large glyph. Replace the pair of `pitch' and + `height' by the pair of `width' and `height'. `pitch' cannot + be greater than `height'. The required is checking the product + `pitch' * `height' <= FT_ULONG_MAX, but we use cheap checks for + the realistic case only. + +2009-07-09 suzuki toshiya + + Register 2 missing trace components, t1afm and ttbdf. + + * include/freetype/internal/fttrace.h: Add FT_TRACE_DEF( t1afm ) + and FT_TRACE_DEF( ttbdf ). See + http://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00013.html + +2009-07-09 suzuki toshiya + + Register a trace component for ftgloadr.c. + + * include/freetype/internal/fttrace.h: Add FT_TRACE_DEF( gloader ). + The macro `trace_gloader' was already used in the initial version + on 2002-02-24. + +2009-07-08 suzuki toshiya + + Prevent the overflows by a glyph with too many points or contours. + The bug is reported by Boris Letocha . See + http://lists.gnu.org/archive/html/freetype-devel/2009-06/msg00031.html + http://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00002.html + + * include/freetype/ftimage.h (FT_OUTLINE_CONTOURS_MAX, + FT_OUTLINE_POINTS_MAX): New macros to declare the maximum + values of FT_Outline.{n_contours,n_points}. + * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Check the + total numbers of points and contours cause no overflows in + FT_Outline.{n_contours,n_points}. + + * include/freetype/internal/ftgloadr.h (FT_GLYPHLOADER_CHECK_P, + FT_GLYPHLOADER_CHECK_C): Compare the numbers of points and + contours as unsigned long number, instead of signed int, to + prevent the overflows on 16-bit systems. + +2009-07-05 Bram Tassyns + + Improve compatibility to Acroread. + This fixes Savannah bug #26944. + + * src/cff/cffload.c (cff_charset_compute_cids): For multiple GID to + single CID mappings, make the lowest value win. + +2009-06-28 suzuki toshiya + + ftpatent: Fix a bug by wrong usage of service->table_info(). + http://lists.gnu.org/archive/html/freetype-devel/2008-12/msg00039.html + + * include/freetype/internal/services/svsfnt.h: Extend + FT_SFNT_TableInfoFunc() to take new argument to obtain the offset + to the specified table. + * src/sfnt/sfdriver.c (sfnt_table_info): Extend to return the + table-offset to the caller function. + * src/base/ftpatent.c (_tt_check_patents_in_table): Use new + service->table_info(). + * src/base/ftobjs.c (FT_Sfnt_Table_Info): Synchronize to new + service->table_info(). + +2009-06-28 Werner Lemberg + + [psaux, cff] Protect against nested `seac' calls. + + * include/freetype/internal/psaux.h (T1_Decoder), src/cff/cffgload.h + (CFF_Decoder): Add `seac' boolean variable. + + * src/cff/cffgload.c (cff_operator_seac), src/psaux/t1decode.c + (t1operator_seac): Use it. + +2009-06-28 Werner Lemberg + + Thinko. + + * src/psaux/t1decode.c (t1operator_seac) + [FT_CONFIG_OPTION_INCREMENTAL]: Test for existence of incremental + interface. + +2009-06-28 Werner Lemberg + + * devel/ftoption.h [FT_CONFIG_OPTION_INCREMENTAL]: Define. + +2009-06-27 suzuki toshiya + + Add tools to preprocess the source files for AtariST PureC. + + * builds/atari/deflinejoiner.awk: New file to filter C source files + for broken C preprocessor of PureC compiler. + + * builds/atari/gen-purec-patch.sh: New file to generate a patch set + for PureC, by using deflinejoiner.awk. + +2009-06-27 suzuki toshiya + + Keep existing modules.cfg in the building tree. + + * configure: If `configure' is executed outside of the source tree, + an existing `modules.cfg' file in the build directory should be + kept, not overwritten by the version in the source tree. + +2009-06-27 suzuki toshiya + + Filter --srcdir= option before invoking builds/unix/configure. + + * configure: If builds/unix/configure is invoked with --srcdir + option, the option should take `builds/unix' directory instead of + the top source directory. Thus the configure script in the top + directory should modify the --srcdir= option if + `builds/unix/configure' is invoked. + +2009-06-27 suzuki toshiya + + Improve configure.raw for cross-building on exe-suffixed systems. + + * builds/unix/configure.raw: Fix a bug in sed script to extract + native suffix for binary executables, patch by Peter Breitenlohner. + http://lists.gnu.org/archive/html/freetype-devel/2009-04/msg00036.html + +2009-06-26 Werner Lemberg + + [truetype] Remove TT_SubGlyphRec. + + * src/truetype/ttobjs.h (TT_SubGlyphRec): Removed, unused. + +2009-06-26 Werner Lemberg + + * */*: For warning messages, replace FT_ERROR with FT_TRACE0. + + FT_ERROR is now used only if a function produces a non-zero `error' + value. + + Formatting, improving and harmonizing debug strings. + +2009-06-25 Werner Lemberg + + Provide version information better. + + * src/base/ftinit.c (FT_Init_FreeType): Don't set version here + but... + * src/base/ftobjs.c (FT_New_Library): Here. + +2009-06-22 Werner Lemberg + + Use 16.16 format while parsing Type 1 charstrings. + This fixes Savannah bug #26867. + + Previously, only integers have been used which can lead to serious + rounding errors. + + However, fractional values are only used internally; after the + charstrings (of either Type 1 or 2) have been processed, the + resulting coordinates get rounded to integers currently -- before + applying scaling. This should be fixed; at the same time a new load + flag should be introduced, to be used in combination with + FT_LOAD_NO_SCALE, which indicates that font units are returned in + 16.16 format. Similarly, the incremental interface should be + extended to allow fractional values for metrics. + + * include/freetype/internal/psaux.h (T1_BuilderRec): Remove `shift' + field. + * include/freetype/internal/pshints.h (T1_Hints_SetStemFunc, + T1_Hints_SetStem3Func): Use FT_Fixed for coordinates. + + * src/psaux/psobjs.c: Include FT_INTERNAL_CALC_H. + (t1_build_add_point): Always convert fixed to integer. + * src/psaux/t1decode.c (t1_decoder_parse_charstrings): + Use 16.16 format everywhere (except for large integers followed by a + `div'). + [CAN_HANDLE_NON_INTEGRAL_T1_OPERANDS]: Remove #ifdef and activate + code uncoditionally. + Add support for random numbers and update remaining code + accordingly; this should work now. + (t1_operator_seac): Updated. + * src/psaux/pshrec.c: Include FT_INTERNAL_CALC_H. + (ps_hints_t1stem3, t1_hints_stem): Updated. + + * src/cid/cidgload.c: Include FT_INTERNAL_CALC_H. + (cid_load_glyph) [FT_CONFIG_OPTION_INCREMENTAL], + (cid_face_compute_max_advance, cid_slot_load_glyph): Updated. + + * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String) + [FT_CONFIG_OPTION_INCREMENTAL], (T1_Get_Advances, T1_Load_Glyph): + Updated. + * src/type1/t1load.c: Include FT_INTERNAL_CALC_H. + * src/type1/t1objs.c (T1_Face_Init): Updated. + +2009-06-21 Werner Lemberg + + * src/pshinter/pshrec.c: Use PSH_Err_Ok. + +2009-06-21 Werner Lemberg + + Code beautification. + + * src/type1/t1load.c (FT_INT_TO_FIXED): Removed. + Replace everywhere with INT_TO_FIXED. + (FT_FIXED_TO_INT): Move to ... + * include/freetype/internal/ftcalc.h (FIXED_TO_INT): Here. + Update all users. + +2009-06-20 Werner Lemberg + + Remove unused variables. + + * include/freetype/internal/psaux.h (T1_BuilderRec), + src/cff/cffgload.h (CFF_Builder): Remove `last'. + Update all users. + +2009-06-20 Werner Lemberg + + [psaux] Check large integers while parsing charstrings. + + * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Large + integers must be followed by a `div' operator. + +2009-06-20 Werner Lemberg + + [cff] Revert last change. + + * src/cff/cffgload.c (cff_decoder_parse_charstrings): Do it. + Next time, don't confuse Type 2 charstring opcodes with TOP DICT + values... + +2009-06-20 Werner Lemberg + + * src/autofit/aflatin.c (af_latin_metrics_check_digits): Fix + compiler warning. + +2009-06-20 Werner Lemberg + + * builds/compiler/gcc.mk (CFLAGS): Use -O3, not -O6. + +2009-06-19 Werner Lemberg + + [cff] Fix handling of reserved byte 0xFF. + + * src/cff/cffgload.c (cff_decoder_parse_charstrings): Abort if byte + 0xFF is encountered. + +2009-06-19 Werner Lemberg + + Improve debug messages for Type1 charstrings. + + * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Emit newlines + after instructions. + Prettify output. + +2009-06-19 Werner Lemberg + + More ftgray fixes for FT_STATIC_RASTER. + Problems reported by suyu@cooee.cn. + + * src/smooth/ftgrays.c (gray_move_to, gray_raster_render): Use + RAS_VAR. + +2009-06-18 Werner Lemberg + + * docs/CHANGES: Updated. + +2009-06-18 Werner Lemberg + + Fix B/W rasterization of subglyphs with different drop-out modes. + + Normally, the SCANMODE instruction (if present) to set the drop-out + mode in a TrueType font is located in the `prep' table only and thus + valid for all glyphs. However, there are fonts like `pala.ttf' + which additionally contain this instruction in the hinting code of + some glyphs (but not all). As a result it can happen that a + composite glyph needs multiple drop-out modes for its subglyphs + since the rendering state gets reset for each subglyph. + + FreeType collects the hinted outlines from all subglyphs, then it + sends the data to the rasterizer. It also sends the drop-out mode + -- after hinting has been applied -- and here is the error: It sends + the drop-out mode of the last subglyph only; drop-out modes of all + other subglyphs are lost. + + This patch fixes the problem; it adds a second, alternative + mechanism to pass the drop-out mode: For each contour, the + rasterizer now checks the first `tags' array element. If bit 2 is + set, bits 5-7 contain the contour's drop-out mode, overriding the + global drop-out mode. + + * include/freetype/ftimage.h (FT_CURVE_TAG_HAS_SCANMODE): New macro. + + * src/truetype/ttgload.c (TT_Hint_Glyph): Store drop-out mode in + `tags[0]'. + + * src/raster/ftraster.c (Flow_Up, Overshoot_Top, Overshoot_Bottom): + Use bits 3-5 instead of 0-2. + (New_Profile): Set the drop-out mode in the profile's `flags' field. + (Decompose_Curve): Check `tags[0]' and set `dropOutControl' if + necessary. + (Vertical_Sweep_Drop, Horizontal_Sweep_Drop, + Horizontal_Gray_Sweep_Drop, Draw_Sweep): Use the profile's drop-out + mode. + +2009-06-16 Werner Lemberg + + Improve scan conversion rules 4 and 6. + + Two new constraints are introduced to better identify a `stub' -- a + concept which is only vaguely described in the OpenType + specification. The old code was too rigorous and suppressed more + pixel than it should. + + . The intersection of the two profiles with the scanline is less + than a half pixel. Code related to this was already present in + the sources but has been commented out. + + . The endpoint of the original contour forming a profile has a + distance (`overshoot') less than half a pixel to the scanline. + + Note that the two additional conditions fix almost all differences + to the Windows rasterizer, but some problematic cases remain. + + * src/raster/ftraster.c (Overshoot_Top, Overshoot_Bottom): New + macros for the `flags' field in the `TProfile' structure. + (IS_BOTTOM_OVERSHOOT, IS_TOP_OVERSHOOT): New macros. + (New_Profile, End_Profile): Pass overshoot flag as an argument and + set it accordingly. + Update callers. + (Vertical_Sweep_Drop, Horizontal_Sweep_Drop): Implement the two new + constraints. + +2009-06-11 Werner Lemberg + + Increase precision for B/W rasterizer. + + * src/raster/ftraster.c (Set_High_Precision): Add two more bits to + the precision. This corrects rendering of some small glyphs, for + example, glyph `xi' in verdana.ttf at 13 ppem. Testing with ftbench + on my GNU/Linux box I don't see a performance degradation. + +2009-06-08 Michael Zucchi + + Handle FT_STROKER_LINECAP_BUTT. + This fixes Savannah bug #26757. + + * src/base/ftstroke.c (ft_stroker_cap): Implement it. + +2009-06-07 Harald Fernengel + + Fix some potential out-of-memory crashes. + + * src/base/ftobjs.c (ft_glyphslot_done): Check `slot->internal'. + * src/base/ftstream.c (FT_Stream_ReleaseFrame): Check `stream'. + * src/truetype/ttinterp.c (TT_New_Context): Avoid double-free of + `exec' in case of failure. + +2009-06-07 Werner Lemberg + + Simplify math. + Suggested by Alexei Podtelezhnikov . + + * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop, + Horizontal_Gray_Sweep_Drop): Do it. + +2009-06-04 Werner Lemberg + + Preparation for fixing scan conversion rules 4 and 6. + + * src/raster/ftraster.c (TFlow): Replace enumeration with... + (Flow_Up): This macro. + (TProfile): Replace `flow' member with `flags' bit field. + Update all affected code. + +2009-05-29 James Cloos + + Enable autohinting for glyphs rotated by multiples of 90°. + + * src/base/ftobjs.c (FT_Load_Glyph): Alter check for permitted + matrices to allow rotations by multiples of 90°, not only unrotated, + possibly slanted matrices. + +2009-05-28 Werner Lemberg + + Remove compiler warning. + Reported by Krzysztof Kowalczyk . + + * src/autofit/aflatin2.c (af_latin2_hint_edges): Move declaration of + `n_edges' into `#if' block. + +2009-05-28 Werner Lemberg + + Make compilation work with FT_CONFIG_OPTION_USE_ZLIB not defined. + Reported by Krzysztof Kowalczyk . + + * src/pcf/pcfdrivr.c (PCF_Face_Init) [!FT_CONFIG_OPTION_USE_ZLIB]: + Make it work. + Simplify #ifdef logic. + +2009-05-22 Werner Lemberg + + Improve b/w rasterizer. + Problem reported by Krzysztof Kotlenga . + + * src/raster/raster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop, + Horizontal_Gray_Sweep_Drop): For smart drop-out mode, if + intersections are equally distant relative to next pixel center, + select the left pixel, not the right one. + +2009-05-19 Werner Lemberg + + Fix Savannah bug #26600. + + * src/type42/t42parse.c (t42_load_keyword): Handle + T1_FIELD_LOCATION_FONT_EXTRA. + +2009-04-30 Werner Lemberg + + Document recent changes to ftview. + + * docs/CHANGES: Do it. + +2009-04-27 Werner Lemberg + + autohinter: Don't change digit widths if all widths are the same. + This fixes FreeDesktop bug #21197. + + * src/autofit/afglobal.c (AF_DIGIT): New macro. + (af_face_globals_compute_script_coverage): Mark ASCII digits in + `glyph_scripts' array. + (af_face_globals_get_metrics): Updated. + (af_face_globals_is_digit): New function. + * src/autofit/afglobal.h: Updated. + (AF_ScriptMetricsRec): Add `digits_have_same_width' flag. + + * src/autofit/aflatin.c: Include FT_ADVANCES_H. + (af_latin_metrics_check_digits): New function. + (af_latin_metrics_init): Use it. + * src/autofit/aflatin.h: Updated. + * src/autofit/afcjk.c (af_cjk_metrics_init): Updated. + + * src/autofit/aflatin2.c: Similar changes as with aflatin.c. + + * src/autofit/afloader.c (af_loader_load_g): Test digit width. + + * docs/CHANGES: Document it. + +2009-04-26 Werner Lemberg + + Make ftgrays compile with _STANDALONE_ and FT_STATIC_RASTER again. + Problems reported by suyu@cooee.cn. + + * src/smooth/ftgrays.c (FT_DEFINE_OUTLINE_FUNCS, + FT_DEFINE_RASTER_FUNCS) [_STANDALONE_]: Define. + [!_STANDALONE_]: Include ftspic.h only here. + (ras): Define/declare after definition of `TWorker'. + Use `RAS_VAR_' where necessary. + +2009-04-21 Karl Berry + + Fix AC_CHECK_FT2. + + * builds/unix/freetype2.m4: Only check PATH for freetype-config if + we did not already find it from a prefix option. + +2009-04-05 Oran Agra + + Add #error to modules and files that do not support PIC yet. + + When FT_CONFIG_OPTION_PIC is defined the following files will + create #error: + * src/bdf/bdfdrivr.h + * src/cache/ftcmanag.c + * src/cid/cidriver.h + * src/gxvalid/gxvmod.h + * src/gzip/ftgzip.c + * src/lzw/ftlzw.c + * src/otvalid/otvmod.h + * src/pcf/pcfdrivr.h + * src/pfr/pfrdrivr.h + * src/psaux/psauxmod.h + * src/type1/t1driver.h + * src/type42/t42drivr.h + * src/winfonts/winfnt.h + +2009-04-05 Oran Agra + + Position Independent Code (PIC) support in autofit module. + + * include/freetype/internal/autohint.h add macros to init + instances of FT_AutoHinter_ServiceRec. + + * src/autofit/afmodule.h declare autofit_module_class + using macros from ftmodapi.h, + when FT_CONFIG_OPTION_PIC is defined create and destroy + functions will be declared. + * src/autofit/afmodule.c when FT_CONFIG_OPTION_PIC is defined + af_autofitter_service and autofit_module_class structs + will have functions to init or create and destroy them + instead of being allocated in the global scope. + And macros will be used from afpic.h in order to access them. + + * src/autofit/aftypes.h add macros to init and declare + instances of AF_ScriptClassRec. + + * src/autofit/afcjk.h declare af_cjk_script_class + using macros from aftypes.h, + when FT_CONFIG_OPTION_PIC is defined init function will be declared. + * src/autofit/afcjk.c when FT_CONFIG_OPTION_PIC is defined + af_cjk_script_class struct will have function to init it instead of + being allocated in the global scope. + + * src/autofit/afdummy.h declare af_dummy_script_class + using macros from aftypes.h, + when FT_CONFIG_OPTION_PIC is defined init function will be declared. + * src/autofit/afdummy.c when FT_CONFIG_OPTION_PIC is defined + af_dummy_script_class struct will have function to init it instead of + being allocated in the global scope. + + * src/autofit/afindic.h declare af_indic_script_class + using macros from aftypes.h, + when FT_CONFIG_OPTION_PIC is defined init function will be declared. + * src/autofit/afindic.c when FT_CONFIG_OPTION_PIC is defined + af_indic_script_class struct will have function to init it instead of + being allocated in the global scope. + + * src/autofit/aflatin.h declare af_latin_script_class + using macros from aftypes.h, + when FT_CONFIG_OPTION_PIC is defined init function will be declared. + * src/autofit/aflatin.c when FT_CONFIG_OPTION_PIC is defined + af_latin_script_class struct will have function to init it instead of + being allocated in the global scope. + Change af_latin_blue_chars to be PIC-compatible by being a two + dimentional array rather than array of pointers. + + + * src/autofit/aflatin2.h declare af_latin2_script_class + using macros from aftypes.h, + when FT_CONFIG_OPTION_PIC is defined init function will be declared. + * src/autofit/aflatin2.c when FT_CONFIG_OPTION_PIC is defined + af_latin2_script_class struct will have function to init it instead of + being allocated in the global scope. + Change af_latin2_blue_chars to be PIC-compatible by being a two + dimentional array rather than array of pointers. + + * src/autofit/afglobal.c when FT_CONFIG_OPTION_PIC is defined + af_script_classes array initialization was moved to afpic.c and + is later refered using macros defeined in afpic.h. + + New Files: + * src/autofit/afpic.h declare struct to hold PIC globals for autofit + module and macros to access them. + * src/autofit/afpic.c implement functions to allocate, destroy and + initialize PIC globals for autofit module. + + * src/autofit/autofit.c add new file to build: afpic.c. + * src/autofit/jamfile add new files to FT2_MULTI build: afpic.c. + +2009-04-05 Oran Agra + + Position Independent Code (PIC) support in pshinter module. + + * include/freetype/internal/pshints.h add macros to init + instances of PSHinter_Interface. + + * src/pshinter/pshmod.h declare pshinter_module_class + using macros from ftmodapi.h, + when FT_CONFIG_OPTION_PIC is defined create and destroy + functions will be declared. + * src/pshinter/pshmod.c when FT_CONFIG_OPTION_PIC is defined + pshinter_interface and pshinter_module_class structs + will have functions to init or create and destroy them + instead of being allocated in the global scope. + And macros will be used from pshpic.h in order to access them. + + New Files: + * src/pshinter/pshpic.h declare struct to hold PIC globals for pshinter + module and macros to access them. + * src/pshinter/pshpic.c implement functions to allocate, destroy and + initialize PIC globals for pshinter module. + + * src/pshinter/pshinter.c add new file to build: pshpic.c. + * src/pshinter/jamfile add new files to FT2_MULTI build: pshpic.c. + +2009-04-05 Oran Agra + + Position Independent Code (PIC) support in psnames module. + + * include/freetype/internal/services/svpscmap.h add macros to init + instances of FT_Service_PsCMapsRec. + + * src/psnames/psmodule.h declare psnames_module_class + using macros from ftmodapi.h, + when FT_CONFIG_OPTION_PIC is defined create and destroy + functions will be declared. + * src/psnames/psmodule.c when FT_CONFIG_OPTION_PIC is defined + pscmaps_interface and pscmaps_services structs + and psnames_module_class array + will have functions to init or create and destroy them + instead of being allocated in the global scope. + And macros will be used from pspic.h in order to access them. + + New Files: + * src/psnames/pspic.h declare struct to hold PIC globals for psnames + module and macros to access them. + * src/psnames/pspic.c implement functions to allocate, destroy and + initialize PIC globals for psnames module. + + * src/psnames/psnames.c add new file to build: pspic.c. + * src/psnames/jamfile add new files to FT2_MULTI build: pspic.c. + +2009-04-05 Oran Agra + + Position Independent Code (PIC) support in raster renderer. + + * src/raster/ftrend1.h declare ft_raster1_renderer_class + and ft_raster5_renderer_class + using macros from ftrender.h, + when FT_CONFIG_OPTION_PIC is defined create and destroy + functions will be declared. + * src/smooth/ftrend1.c when FT_CONFIG_OPTION_PIC is defined + ft_raster1_renderer_class and ft_raster5_renderer_class structs + will have functions to init or create and destroy them + instead of being allocated in the global scope. + Macros will be used from rastpic.h in order to access + ft_standard_raster from the pic_container (allocated in ftraster.c). + In ft_raster1_render when PIC is enabled, the last letter of + module_name is used to verfy the renderer class rather than the + class pointer. + + * src/raster/ftraster.c when FT_CONFIG_OPTION_PIC is defined + ft_standard_raster struct will have function to init it + instead of being allocated in the global scope. + + New Files: + * src/raster/rastpic.h declare struct to hold PIC globals for raster + renderer and macros to access them. + * src/raster/rastpic.c implement functions to allocate, destroy and + initialize PIC globals for raster renderer. + + * src/raster/raster.c add new file to build: rastpic.c. + * src/raster/jamfile add new files to FT2_MULTI build: rastpic.c. + +2009-04-05 Oran Agra + + Position Independent Code (PIC) support in smooth renderer. + + * src/smooth/ftsmooth.h declare ft_smooth_renderer_class, + ft_smooth_lcd_renderer_class and ft_smooth_lcd_v_renderer_class + using macros from ftrender.h, + when FT_CONFIG_OPTION_PIC is defined create and destroy + functions will be declared. + * src/smooth/ftsmooth.c when FT_CONFIG_OPTION_PIC is defined + the following structs: + ft_smooth_renderer_class, ft_smooth_lcd_renderer_class + and ft_smooth_lcd_v_renderer_class + will have functions to init or create and destroy them + instead of being allocated in the global scope. + And macros will be used from ftspic.h in order to access + ft_grays_raster from the pic_container (allocated in ftgrays.c). + + * src/smooth/ftgrays.h include FT_CONFIG_CONFIG_H + * src/smooth/ftgrays.c when FT_CONFIG_OPTION_PIC is NOT defined + func_interface was moved from gray_convert_glyph_inner function + to the global scope. + When FT_CONFIG_OPTION_PIC is defined + func_interface and ft_grays_raster structs + will have functions to init them + instead of being allocated in the global scope. + And func_interface will be allocated on the stack of + gray_convert_glyph_inner. + + New Files: + * src/smooth/ftspic.h declare struct to hold PIC globals for smooth + renderer and macros to access them. + * src/smooth/ftspic.c implement functions to allocate, destroy and + initialize PIC globals for smooth renderer. + + * src/smooth/smooth.c add new file to build: ftspic.c. + * src/smooth/jamfile add new files to FT2_MULTI build: ftspic.c. + +2009-04-05 Oran Agra + + Position Independent Code (PIC) support in cff driver. + + * include/freetype/internal/services/svcid.h add macros to init + instances of FT_Service_CIDRec. + * include/freetype/internal/services/svpsinfo.h add macros to init + instances of FT_Service_PsInfoRec. + + * src/cff/cffcmap.h declare cff_cmap_encoding_class_rec + and cff_cmap_unicode_class_rec using macros from + ftobjs.h, when FT_CONFIG_OPTION_PIC is defined create and destroy + functions will be declared. + * src/cff/cffcmap.c when FT_CONFIG_OPTION_PIC is defined + the following structs: + cff_cmap_encoding_class_rec and cff_cmap_unicode_class_rec + will have functions to init or create and destroy them + instead of being allocated in the global scope. + + * src/cff/cffdrivr.h declare cff_driver_class using macros from + ftdriver.h, when FT_CONFIG_OPTION_PIC is defined create and destroy + functions will be declared. + * src/cff/cffdrivr.c when FT_CONFIG_OPTION_PIC is defined + the following structs: + cff_service_glyph_dict, cff_service_ps_info, cff_service_ps_name + cff_service_get_cmap_info, cff_service_cid_info, cff_driver_class, + and cff_services array + will have functions to init or create and destroy them + instead of being allocated in the global scope. + And macros will be used from cffpic.h in order to access them + from the pic_container. + Use macros from cffpic.h in order to access the + structs allocated in cffcmap.c + + * src/cff/cffobjs.c Use macros from cffpic.h in order to access the + structs allocated in cffcmap.c + + * src/cff/parser.c when FT_CONFIG_OPTION_PIC is defined + implement functions to create and destroy cff_field_handlers array + instead of being allocated in the global scope. + And macros will be used from cffpic.h in order to access it + from the pic_container. + + New Files: + * src/cff/cffpic.h declare struct to hold PIC globals for cff + driver and macros to access them. + * src/cff/cffpic.c implement functions to allocate, destroy and + initialize PIC globals for cff driver. + + * src/cff/cff.c add new file to build: cffpic.c. + * src/cff/jamfile add new files to FT2_MULTI build: cffpic.c. + +2009-04-05 Oran Agra + + Position Independent Code (PIC) support in sfnt driver. + + * include/freetype/internal/services/svbdf.h add macros to init + instances of FT_Service_BDFRec. + * include/freetype/internal/services/svgldict.h add macros to init + instances of FT_Service_GlyphDictRec. + * include/freetype/internal/services/svpostnm.h add macros to init + instances of FT_Service_PsFontNameRec. + * include/freetype/internal/services/svsfnt.h add macros to init + instances of FT_Service_SFNT_TableRec. + * include/freetype/internal/services/svttcmap.h add macros to init + instances of FT_Service_TTCMapsRec. + * include/freetype/internal/sfnt.h add macros to init + instances of SFNT_Interface. + + * src/sfnt/sfdriver.h declare sfnt_module_class using macros from + ftmodapi.h, when FT_CONFIG_OPTION_PIC is defined create and destroy + functions will be declared. + * src/sfnt/sfdriver.c when FT_CONFIG_OPTION_PIC is defined + the following structs: + sfnt_service_sfnt_table, sfnt_service_glyph_dict, sfnt_service_ps_name + tt_service_get_cmap_info, sfnt_service_bdf, sfnt_interface, + sfnt_module_class, and sfnt_services array + will have functions to init or create and destroy them + instead of being allocated in the global scope. + And macros will be used from sfntpic.h in order to access them + from the pic_container. + + * src/sfnt/ttcmap.h add macros to init + instances of TT_CMap_ClassRec. + * src/sfnt/ttcmap.c when FT_CONFIG_OPTION_PIC is defined + the following structs: + tt_cmap0_class_rec, tt_cmap2_class_rec, tt_cmap4_class_rec + tt_cmap6_class_rec, tt_cmap8_class_rec, tt_cmap10_class_rec, + tt_cmap12_class_rec, tt_cmap14_class_rec and tt_cmap_classes array + will have functions to init or create and destroy them + instead of being allocated in the global scope. + And macros will be used from sfntpic.h in order to access them + from the pic_container. + The content of tt_cmap_classes is now described in the + new file 'ttcmapc.h'. + + New Files: + * src/sfnt/sfntpic.h declare struct to hold PIC globals for sfnt + driver and macros to access them. + * src/sfnt/sfntpic.c implement functions to allocate, destroy and + initialize PIC globals for sfnt driver. + * src/sfnt/ttcmapc.h describing the content of + tt_cmap_classes allocated in ttcmap.c + + * src/sfnt/sfnt.c add new file to build: sfntpic.c. + * src/sfnt/jamfile add new files to FT2_MULTI build: sfntpic.c. + +2009-04-05 Oran Agra + + Position Independent Code (PIC) support in truetype driver. + + * include/freetype/internal/services/svmm.h add macros to init + instances of FT_Service_MultiMastersRec. + * include/freetype/internal/services/svttglyf.h add macros to init + instances of FT_Service_TTGlyfRec. + + * src/truetype/ttdriver.h declare tt_driver_class using macros from + ftdriver.h, when FT_CONFIG_OPTION_PIC is defined create and destroy + functions will be declared. + * src/truetype/ttdriver.c when FT_CONFIG_OPTION_PIC is defined + the following structs: + tt_service_gx_multi_masters, tt_service_truetype_glyf, tt_driver_class + and tt_services array, + will have functions to init or create and destroy them + instead of being allocated in the global scope. + And macros will be used from ttpic.h in order to access them + from the pic_container. + * src/truetype/ttobjs.c change trick_names array to be + PIC-compatible by being a two dimentional array rather than array + of pointers. + + New Files: + * src/truetype/ttpic.h declare struct to hold PIC globals for truetype + driver and macros to access them. + * src/truetype/ttpic.c implement functions to allocate, destroy and + initialize PIC globals for truetype driver. + + * src/truetype/truetype.c add new file to build: ttpic.c. + * src/truetype/jamfile add new files to FT2_MULTI build: ttpic.c. + +2009-04-05 Oran Agra + + Position Independent Code (PIC) support and infrastructure in base. + + * include/freetype/config/ftoption.h add FT_CONFIG_OPTION_PIC + * include/freetype/internal/ftobjs.h Add pic_container member to + FT_LibraryRec. + Add macros to declare and init instances of FT_CMap_ClassRec. + Add macros to init instances of FT_Outline_Funcs and FT_Raster_Funcs. + Add macros to declare, allocate and initialize modules + (FT_Module_Class). + Add macros to declare, allocate and initialize renderers + (FT_Renderer_Class). + Add macro to init instances of FT_Glyph_Class. + Add macros to declare, allocate and initialize drivers + (FT_Driver_ClassRec). + * include/freetype/internal/ftpic.h new file to declare the + FT_PIC_Container struct and the functions to allocate and detroy it. + * include/freetype/internal/ftserv.h add macros to allocate and + destory arrays of FT_ServiceDescRec. + * include/freetype/internal/internal.h define macro to include + ftpic.h. + + New Files: + * src/base/ftpic.c implement functions to allocate and destory the + global pic_container. + * src/base/basepic.h declare struct to hold PIC globals for base and + macros to access them. + * src/base/basepic.c implement functions to allocate, destroy and + initialize PIC globals for base. + + * src/base/ftinit.c when FT_CONFIG_OPTION_PIC is defined implement + functions that allocate and destroy ft_default_modules according to + FT_CONFIG_MODULES_H in the pic_container instead of the global scope + and use macro from basepic.h to access it. + * src/base/ftobjs.c add calls to the functions that allocate and + destroy the global pic_container when the library is created and + destroyed. + + * src/base/jamfile add new files to FT2_MULTI build: + ftpic.c and basepic.c. + * src/base/ftbase.c add new files to build: + ftpic.c and basepic.c. + + * src/base/ftglyph.c when FT_CONFIG_OPTION_PIC is defined + ft_bitmap_glyph_class and ft_outline_glyph_class will be allocated + in the pic_container instead of the global scope and use macros from + basepic.h to access them. + * src/base/ftbbox.c allocate bbox_interface stract on the stack + instead of the global scope when FT_CONFIG_OPTION_PIC is defined. + * src/base/ftstroke.c access ft_outline_glyph_class allocated in + ftglyph.c via macros from basepic.h + +2009-04-05 Oran Agra + + Preparing changes in cff parser later needed for PIC version. + + * src/cff/cffload.c, src/cff/cffload.h, src/cff/cffobjs.c, + src/cff/cffparse.c, src/cff/cffparse.h: Add library pointer to + 'CFF_ParserRec' set by `cff_parser_init'. + Route library pointer from 'cff_face_init' to 'cff_subfont_load' + for `cff_parser_init'. + + * src/cff/cffparse.c (CFF_Field_Handler): Move it to... + * src/cff/cffparse.h: This file, to be used by other C files. + +2009-04-05 Oran Agra + + Minor change in ftstroke.c. + + * src/base/ftstroke.c (FT_StrokerRec): Replace `memory' member with + `library' needed for PIC version. + Update all callers. + +2009-04-04 Werner Lemberg + + ftnames.c -> ftsnames.c + + * src/base/ftnames.c: Rename to... + * src/base/ftsnames.c: This. + * src/base/Jamfile, src/base/rules.mk, src/base/ftbase.c: Updated. + +2009-04-04 Werner Lemberg + + Add support for cmap type 13. + + * devel/ftoption.h, include/freetype/config/ftoption.h + (TT_CONFIG_CMAP_FORMAT_13): New macro. + + * src/sfnt/ttcmap.c (TT_CMap13Rec, tt_cmap13_init, + tt_cmap13_validate, tt_cmap13_char_index, tt_cmap13_char_next, + tt_cmap13_get_info, tt_cmap13_char_map_def_binary, + tt_cmap14_class_rec): New functions and structures for cmap 13 + support. + (tt_cmap_classes): Register tt_cmap13_class_rec. + + * docs/CHANGES: Mention cmap 13 support. + +2009-04-01 Werner Lemberg + + Ignore empty contours in CFF glyphs. + + Problem reported by Albert Astals Cid . + + * src/cff/cffgload.c (cff_builder_close_contour): Synchronize with + t1_builder_close_contour. + +2009-03-21 Werner Lemberg + + Another redundant header inclusion. + + * src/truetype/ttgxvar.c: Fix Ghostscript Coverity issue #4041. + +2009-03-21 Werner Lemberg + + Remove redundant header inclusions. + + This covers many Ghostscript Coverity issues. + + * src/*: Do it. + +2009-03-21 Werner Lemberg + + Fix Ghostscript Coverity issue #3904. + + * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Protect against + invalid values of `runcnt'. + +2009-03-20 Werner Lemberg + + Fix `make multi' run. + + * src/smooth/ftsmooth.h: Include FT_INTERNAL_DEBUG_H. + +2009-03-20 Werner Lemberg + + Fix Savannah bug #25923. + + * src/cache/ftccmap.c (FTC_CMAP_HASH): Fix typo. + +2009-03-20 Werner Lemberg + + Protect against too large glyphs. + + Problem reported by Tavis Ormandy . + + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Don't allow + `pitch' or `height' to be larger than 0xFFFF. + +2009-03-20 Werner Lemberg + Tavis Ormandy + + Fix validation for various cmap table formats. + + * src/sfnt/ttcmap.c (tt_cmap8_validate, tt_cmap10_validate, + tt_cmap12_validate): Check `length' correctly. + (tt_cmap_14_validate): Check `length' and `numMappings' correctly. + +2009-03-20 Werner Lemberg + + Protect against malformed compressed data. + + * src/lzw/ftzopen.c (ft_lzwstate_io): Test whether `state->prefix' is + zero. + +2009-03-20 Werner Lemberg + + Protect against invalid SID values in CFFs. + + Problem reported by Tavis Ormandy . + + * src/cff/cffload.c (cff_charset_load): Reject SID values larger + than 64999. + +2009-03-19 Vincent Richomme + + Update WinCE Visual C project files. + + * builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2008-ce/freetype.vcproj: Add missing base extension + files. + +2009-03-19 Werner Lemberg + + Remove unused Win32 code. + + * builds/wince/ftdebug.c: Remove code guarded with `!_WIN32_WCE'. + Since Win32 is handled separately this is no longer needed. + +2009-03-19 Vincent Richomme + + Make `gzip' module compile on WinCE. + + * src/gzip/zconf.h [_WIN32_WCE]: Define NO_ERRNO_H. + +2009-03-19 Werner Lemberg + + Remove unused WinCE code. + + * builds/win32/ftdebug.c: Remove code guarded with `_WIN32_WCE'. + Since WinCE is handled separately this is no longer needed. + +2009-03-16 Werner Lemberg + + docmaker: Don't ignore single-line code blocks. + + * src/tools/docmaker/content.py (DocBlock::_init__): Fix change from + 2009-01-31. + +2009-03-15 Steve Langasek + + Use __asm__ for declaring assembly instead of asm. + + * builds/unix/ftconfig.in (FT_MulFix_arm): Use __asm__ instead of + asm on arm, fixing a build failure on armel with -pedantic. + +2009-03-14 Werner Lemberg + + Fix valgrind warning. + + * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_bit_aligned): Don't read + past the end of the frame. + +2009-03-12 Werner Lemberg + + * Version 2.3.9 released. + ========================= + + + Tag sources with `VER-2-3-9'. + +2009-03-12 Werner Lemberg + + * builds/unix/freetype2.in: Move @FT2_EXTRA_LIBS@ to `Libs.private'. + +2009-03-12 Werner Lemberg + + Fix some FreeType Coverity issues as reported for Ghostscript. + + * src/base/ftobjs.c (FT_New_Face, FT_New_Memory_Face): Initialize + `args.stream' (#3874, #3875). + (open_face_PS_from_sfnt_stream): Improve error management (#3786). + * src/base/ftmm.c (ft_face_get_mm_service): Fix check of `aservice' + (#3870). + * src/base/ftstroke.c (ft_stroke_border_get_counts): Remove dead + code (#3790). + * src/base/ftrfork.c (raccess_guess_apple_generic): Check error + value of `FT_Stream_Skip' (#3784). + + * src/type1/t1gload.c (T1_Load_Glyph): Check `size' before accessing + it (#3872) + + * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Check `face' before accessing + it (#3871). + * src/pcf/pcfread.c (pcf_get_metrics): Handle return value of + `pcf_get_metric' (#3789, #3782). + (pcf_get_properties): Use FT_STREAM_SKIP (#3783). + + * src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Fix check of + `acache' (#3797) + + * src/cff/cffdrivr.c (cff_ps_get_font_info): Fix check of `cff' + (#3796). + * src/cff/cffgload.c (cff_decoder_prepare): Check `size' (#3795). + * src/cff/cffload.c (cff_index_get_pointers): Add comment (#3794). + + * src/bdf/bdflib.c (_bdf_add_property): Check `fp->value.atom' + (#3793). + (_bdf_parse_start): Add comment (#3792). + + * src/raster/ftraster.c (Finalize_Profile_Table): Check + `ras.fProfile' (#3791). + + * src/sfnt/ttsbit.c (Load_SBit_Image): Use FT_STREAM_SKIP (#3785). + + * src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Properly ignore + seek error (#3781). + +2009-03-11 Michael Toftdal + + Extend CID service functions to handle CID-keyed CFFs as CID fonts. + + * include/freetype/ftcid.h (FT_Get_CID_Is_Internally_CID_keyed, + FT_Get_CID_From_Glyph_Index): New functions. + + * include/freetype/internal/services/svcid.h + (FT_CID_GetIsInternallyCIDKeyedFunc, + FT_CID_GetCIDFromGlyphIndexFunc): New function typedefs. + (CID Service): Use them. + + * src/base/ftcid.c: Include FT_CID_H. + (FT_Get_CID_Is_Internally_CID_keyed, FT_Get_CID_From_Glyph_Index): + New functions. + + * src/cff/cffdrivr.c (cff_get_is_cid, cff_get_cid_from_glyph_index): + New functions. + (cff_service_cid_info): Add them. + * src/cff/cffload.c (cff_font_load): Don't free `font->charset.sids' + -- it is needed for access as a CID-keyed font. It gets deleted + later on. + + * src/cid/cidriver.c (cid_get_is_cid, cid_get_cid_from_glyph_index): + New functions. + (cid_service_cid_info): Add them. + + * docs/CHANGES: Updated. + +2009-03-11 Bram Tassyns + + Fix Savannah bug #25597. + + * src/cff/cffparse.c (cff_parse_real): Don't allow fraction_length + to become larger than 9. + +2009-03-11 Werner Lemberg + + Fix Savannah bug #25814. + + * builds/unix/freetype2.in: As suggested in the bug report, move + @LIBZ@ to `Libs.private'. + +2009-03-11 Werner Lemberg + + Fix Savannah bug #25781. + We now simply check for a valid `offset', no longer handling `delta + = 1' specially. + + * src/sfnt/ttcmap.c (tt_cmap4_validate): Don't check `delta' for + last segment. + (tt_cmap4_set_range, tt_cmap4_char_map_linear, + tt_cmap4_char_map_binary): Check offset. + +2009-03-11 Werner Lemberg + + * src/base/Jamfile: Fix handling of ftadvanc.c. + Reported by Oran Agra . + +2009-03-10 Vincent Richomme + + Restructure Win32 and Wince compiler support. + + * src/builds/win32: Remove files for WinCE. + Move VC 2005 support to a separate directory. + Add directory for VC 2008 support. + + * src/builds/wince: New directory hierarchy for WinCE compilers + (VC 2005 and VC 2008). + +2009-03-09 Werner Lemberg + + More preparations for 2.3.9 release. + + * docs/CHANGES: Updated. + + * Jamfile, README: s/2.3.8/2.3.9/, s/238/239/. + +2009-03-09 Werner Lemberg + + * src/sfnt/rules.mk (SFNT_DRV_H): Add ttsbit0.c. + +2009-03-09 Alexey Kryukov + + Fix handling of EBDT formats 8 and 9 (part 2). + + This patch fixes the following problems in ttsbit0.c: + + . Bitmaps for compound glyphs were never allocated. + + . `SBitDecoder' refused to load metrics if some other metrics have + already been loaded. This condition certainly makes no sense for + recursive calls, so I've just disabled it. Another possibility + would be resetting `decoder->metrics_loaded' to false before + loading each composite component. However, we must restore the + original metrics after finishing the recursion; otherwise we can + get a misaligned glyph. + + . `tt_sbit_decoder_load_bit_aligned' incorrectly handled `x_pos', + causing some glyph components to be shifted too far to the right + (especially noticeable for small sizes). + + Note that support for grayscale bitmaps (not necessarily compound) is + completely broken in ttsbit0.c. + + * src/sfnt/tt_sbit_decoder_load_metrics: Always load metrics. + (tt_sbit_decoder_load_bit_aligned): Handle `x_pos' correctly in case + of `h == height'. + (tt_sbit_decoder_load_compound): Reset metrics after loading + components. + Allocate bitmap. + +2009-03-09 Werner Lemberg + + * builds/unix/configure.raw (version_info): Set to 9:20:3. + +2009-03-03 David Turner + + Protect SFNT kerning table parser against malformed tables. + + This closes Savannah BUG #25750. + + * src/sfnt/ttkern.c (tt_face_load_kern, tt_face_get_kerning): Fix a + bug where a malformed table would be successfully loaded but later + crash the engine during parsing. + +2009-03-03 David Turner + + Update documentation and bump version number to 2.3.9. + + * include/freetype/freetype.h: Bump patch version to 9. + * docs/CHANGES: Document the ABI break in 2.3.8. + * docs/VERSION.DLL: Update version numbers table for 2.3.9. + +2009-03-03 David Turner + + Remove ABI-breaking field in public PS_InfoFontRec definition. + + Instead, we define a new internal PS_FontExtraRec structure to + hold the additional field, then place it in various internal + positions of the corresponding FT_Face derived objects. + + * include/freetype/t1tables.h (PS_FontInfoRec): Remove the + `fs_type' field from the public structure. + * include/freetype/internal/psaux.h (T1_FieldLocation): New + enumeration `T1_FIELD_LOCATION_FONT_EXTRA'. + * include/freetype/internal/t1types.h (PS_FontExtraRec): New + structure. + (T1_FontRec, CID_FaceRec): Add it. + + * src/cid/cidload.c (cid_load_keyword): Handle + T1_FIELD_LOCATION_FONT_EXTRA. + * src/cid/cidtoken.h, src/type1/t1tokens.h, src/type42/t42parse.c: + Adjust FT_STRUCTURE and T1CODE properly to handle `FSType'. + * src/type1/t1load.c (t1_load_keyword): Handle + T1_FIELD_LOCATION_FONT_EXTRA. + + * include/freetype/internal/services/svpsinfo.h (PsInfo service): + Add `PS_GetFontExtraFunc' function typedef. + + * src/base/ftfstype.c: Include FT_INTERNAL_SERVICE_H and + FT_SERVICE_POSTSCRIPT_INFO_H. + (FT_Get_FSType_Flags): Use POSTSCRIPT_INFO service. + + * src/cff/cffdrivr.c (cff_service_ps_info): Updated. + * src/cid/cidriver.c (cid_ps_get_font_extra): New function. + (cid_service_ps_info): Updated. + * src/type1/t1driver.c (t1_ps_get_font_extra): New function. + (t1_service_ps_info): Updated. + * src/type42/t42drivr.c (t42_ps_get_font_extra): New function. + (t42_service_ps_info): Updated. + +2009-03-02 Alexey Kryukov + + Fix handling of EBDT formats 8 and 9. + + The main cycle in `blit_sbit' makes too many iterations: it actually + needs the count of lines in the source bitmap rather than in the + target image. + + * src/sfnt/ttsbit.c (blit_sbit) [FT_CONFIG_OPTION_OLD_INTERNALS]: + Add parameter `source_height' and use it for main loop. + (Load_SBit_Single) [FT_CONFIG_OPTION_OLD_INTERNALS]: Updated. + +2009-02-23 Werner Lemberg + + Fix Savannah bug #25669. + + * src/base/ftadvanc.h (FT_Get_Advances): Fix serious typo. + + * src/base/ftobjs.c (FT_Select_Metrics, FT_Request_Metrics): Fix + scaling factor for non-scalable fonts. + + * src/cff/cffdrivr.c (cff_get_advances): Use correct advance width + value to prevent incorrect scaling. + + * docs/CHANGES: Document it. + +2009-02-15 Matt Godbolt + + Fix Savannah bug #25588. + + * builds/unix/ftconfig.in (FT_MulFix_arm): Use correct syntax for + `orr' instruction. + +2009-02-11 Werner Lemberg + + * src/truetype/ttobjs.c (tt_check_trickyness): Add `DFKaiShu'. + Reported by David Bevan . + +2009-02-09 Werner Lemberg + + Fix Savannah bug #25495. + + * src/sfnt/sfobjs.c (sfnt_load_face): Test for bitmap strikes before + setting metrics and bbox values. This ensures that the check for a + font with neither a `glyf' table nor bitmap strikes can be performed + early enough to set metrics and bbox values too. + +2009-02-04 Werner Lemberg + + Fix Savannah bug #25480. + + * builds/unix/freetype-config.in: For --ftversion, don't use $prefix + but $includedir. + +2009-01-31 Werner Lemberg + + Minor docmaker improvements. + + * src/tools/docmaker/content.py (DocBlock::__init__): Ignore empty + code blocks. + +2009-01-25 Werner Lemberg + + Fix SCANCTRL handling in TTFs. + Problem reported by Alexey Kryukov . + + * src/truetype/ttinterp.c (Ins_SCANCTRL): Fix threshold handling. + +2009-01-23 Werner Lemberg + + Move FT_Get_FSType_Flags to a separate file. + Problem reported by Mickey Gabel . + + * src/base/ftobjs.c (FT_Get_FSType_Flags): Move to... + * src/base/ftfstype.c: This new file. + + * modules.cfg (BASE_EXTENSION): Add ftfstype.c. + + * docs/INSTALL.ANY: Updated. + + * builds/mac/*.txt, builds/amiga/*makefile*, + builds/win32/{visualc,visualce}/freetype.*, builds/symbian/*: + Updated. + +2009-01-22 suzuki toshiya + + * builds/unix/ftsystem.c (FT_Stream_Open): Fix 2 error + messages ending without "\n". + +2009-01-22 suzuki toshiya + + Fix Savannah bug #25347. + + * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Rewind + the stream to the original position passed to this function, + when ft_lookup_PS_in_sfnt_stream() failed. + (Mac_Read_sfnt_Resource): Rewind the stream to the head of + sfnt resource body, when open_face_PS_from_sfnt_stream() + failed. + +2009-01-19 Michael Lotz + + Fix Savannah bug #25355. + + * include/freetype/config/ftconfig.h (FT_MulFix_i386): Make + assembler code work with gcc 2.95.3 (as used by the Haiku project). + Add `cc' register to the clobber list. + +2009-01-18 Werner Lemberg + + Protect FT_Get_Next_Char. + + * src/sfnt/ttcmap.c (tt_cmap4_set_range): Apply fix similar to + change from 2008-07-22. + + Patch from Ronen Ghoshal . + +2009-01-18 Werner Lemberg + + Implement FT_Get_Name_Index for SFNT driver. + + * src/sfnt/sfdriver.c (sfnt_get_name_index): New function. + (sfnt_service_glyph_dict): Use it. + + Problem reported by Truc Truong . + +2009-01-18 Werner Lemberg + + * include/freetype/ftstroke.h (FT_Outline_GetInsideBorder): Fix + documentation. Problem reported by Truc Truong . + + * docs/CHANGES: Updated. + +2009-01-14 Werner Lemberg + + * Version 2.3.8 released. + ========================= + + + Tag sources with `VER-2-3-8'. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.3.8. + + * README, Jamfile (RefDoc), builds/win32/visualc/index.html, + builds/win32/visualc/freetype.dsp, + builds/win32/visualc/freetype.vcproj, + builds/win32/visualce/index.html, + builds/win32/visualce/freetype.dsp, + builds/win32/visualce/freetype.vcproj: s/2.3.7/2.3.8/, s/237/238/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 8. + + * builds/unix/configure.raw (version_info): Set to 9:19:3. + + * docs/release: Updated. + +2009-01-14 Werner Lemberg + + * builds/toplevel.mk (dist): Compress better. + +2009-01-13 Werner Lemberg + + * src/base/ftobjs.c (FT_Get_FSType_Flags): Cast for compilation + with C++. + +2009-01-13 Werner Lemberg + + Don't use stdlib.h and friends directly. + Reported by Mickey Gabel . + + * src/base/ftdbgmem.c: s//FT_CONFIG_STANDARD_LIBRARY_H/. + + * src/gzip/ftgzip.c, src/lzw/ftlzw.c, src/raster/ftmisc.h: + s//FT_CONFIG_STANDARD_LIBRARY_H/. + + * src/autofit/aftypes.h, src/autofit/afhints.c, + src/pshinter/pshalgo.c: s//FT_CONFIG_STANDARD_LIBRARY_H/ + + * src/lzw/ftlzw.c, src/base/ftdbgmem.c: Don't include stdio.h. + +2009-01-12 Werner Lemberg + + Avoid compiler warnings. + + * */*: s/do ; while ( 0 )/do { } while ( 0 )/. + Reported by Sean McBride . + +2009-01-12 Werner Lemberg + + Fix stdlib dependencies. + + Problem reported by Mickey Gabel . + + * include/freetype/config/ftstdlib.h (ft_exit): Removed. Unused. + + * src/autofit/afhints.c, src/base/ftlcdfil.c, src/smooth/ftsmooth.c: + s/memcpy/ft_memcpy/. + * src/psaux/t1decode.c: s/memset/ft_memset/, s/memcpy/ft_memcpy/. + +2009-01-11 Werner Lemberg + + * docs/formats.txt: Add link to PCF specification. + + * include/freetype/ftbdf.h (FT_Get_BDF_Property): Improve + documentation. + +2009-01-09 suzuki toshiya + + * src/base/ftadvanc.c (_ft_face_scale_advances, FT_Get_Advance, + FT_Get_Advances): Change the type of load_flags from FT_UInt32 to + FT_Int32, to match with the flags for FT_Load_Glyph(). + * src/cff/cffdrivr.c (cff_get_advances): Ditto. + * src/truetype/ttdriver.c (tt_get_advances): Ditto. + * include/freetype/ftadvanc.h (FT_Get_Advance, FT_Get_Advances): + Ditto. + * include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc): + Ditto. + +2009-01-09 Daniel Zimmermann + + * src/gxvalid/gxvmort.c (gxv_mort_feature_validate): Fix wrong + length check. From Savannah patch #6682. + +2009-01-09 Werner Lemberg + + Fix problem with T1_FIELD_{NUM,FIXED}_TABLE2. + + * src/psaux/psobjs.c (ps_parser_load_field_table): Don't handle + `count_offset' if it is zero (i.e., unused). Otherwise, the first + element of the structure which holds the data is erroneously + modified. Problem reported by Chi Nguyen . + +2009-01-09 suzuki toshiya + + * src/base/ftadvanc.c (_ft_face_scale_advances, FT_Get_Advance, + FT_Get_Advances): Extend the type of load_flags from FT_UInt to + FT_UInt32, to pass 32-bit flags on 16bit platforms. + * src/cff/cffdrivr.c (cff_get_advances): Ditto. + * src/truetype/ttdriver.c (tt_get_advances): Ditto. + * include/freetype/ftadvanc.h (FT_Get_Advance, FT_Get_Advances): + Ditto. + * include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc): + Ditto. + +2009-01-09 suzuki toshiya + + * src/base/ftobjs.c (FT_Done_Library): Issue an error message when + FT_Done_Face() cannot free all faces. If the list of the opened + faces includes broken face which FT_Done_Face() cannot free, + FT_Done_Library() retries FT_Done_Face() and it can fall into + an endless loop. See the discussion: + http://lists.gnu.org/archive/html/freetype-devel/2008-09/msg00047.html + http://lists.gnu.org/archive/html/freetype-devel/2008-10/msg00000.html + +2009-01-07 Werner Lemberg + + * docs/CHANGES: Document new key `a' in ftdiff. + +2009-01-06 Werner Lemberg + + * autogen.sh: Don't use GNUisms while calling sed. Problem reported + by Sean McBride. + +2009-01-06 Werner Lemberg + + * src/base/ftbitmap.c (FT_Bitmap_Convert): Handle FT_PIXEL_MODE_LCD + and FT_PIXEL_MODE_LCD_V. Problem reported by Chi Nguyen + . + +2009-01-06 Diego Pettenò + + * builds/unix/configure.raw: Don't call AC_CANONICAL_BUILD and + AC_CANONICAL_TARGET and use $host_os only. A nice explanation for + this change can be found at + http://blog.flameeyes.eu/s/canonical-target. + + From Savannah patch #6712. + +2009-01-06 Sean McBride + + * src/base/ftdbgmem.c (_debug_mem_dummy): Make it static. + + * src/base/ftmac.c: Remove some #undefs. + +2008-12-26 Werner Lemberg + + Set `face_index' field in FT_Face for all font formats. + + * cff/cffobjs.c (cff_face_init), winfonts/winfnt.c (FNT_Face_Init), + sfnt/sfobjs.c (sfnt_init_face): Do it. + + * docs/CHANGES: Document it. + +2008-12-22 Steve Grubb + + * builds/unix/ftsystem.c (FT_Stream_Open): Reject zero-length files. + Patch from Savannah bug #25151. + +2008-12-21 Werner Lemberg + + * src/pfr/pfrdrivr.c, src/winfonts/winfnt.c, src/cache/ftcmanag.c, + src/smooth/ftgrays.c, src/base/ftobjc.s, src/sfobjs.c: + s/_Err_Bad_Argument/_Err_Invalid_Argument/. The former is for + errors in the bytecode interpreter only. + +2008-12-21 Werner Lemberg + + * src/base/ftpfr.c (FT_Get_PFR_Metrics): Protect against NULL + arguments. + Fix return value for non-PFR fonts. Both problems reported by Chi + Nguyen . + +2008-12-21 anonymous + + FT_USE_MODULE declares things as: + + extern const FT_Module_Class + + (or similar for C++). However, the actual types of the variables + being declared are often different, e.g., FT_Driver_ClassRec or + FT_Renderer_Class. (Some are, indeed, FT_Module_Class.) + + This works with most C compilers (since those structs begin with an + FT_Module_Class struct), but technically it's undefined behavior. + + To quote the ISO/IEC 9899:TC2 final committee draft, section 6.2.7 + paragraph 2: + + All declarations that refer to the same object or function shall + have compatible type; otherwise, the behavior is undefined. + + (And they are not compatible types.) + + Most C compilers don't reject (or even detect!) code which has this + issue, but the GCC LTO development branch compiler does. (It + outputs the types of the objects while generating .o files, along + with a bunch of other information, then compares them when doing the + final link-time code generation pass.) + + Patch from Savannah bug #25133. + + * src/base/ftinit.c (FT_USE_MODULE): Include variable type. + + * builds/amiga/include/freetype/config/ftmodule.h, + include/freetype/config/ftmodule.h, */module.mk: Updated to declare + pass correct types to FT_USE_MODULE. + +2008-12-21 Hongbo Ni + + * src/autofit/aflatin.c (af_latin_hint_edges), + src/autofit/aflatin2.c (af_latin2_hint_edges), src/autofit/afcjk.c + (af_cjk_hint_edges): Protect against division by zero. This fixes + Savannah bug #25124. + +2008-12-18 Werner Lemberg + + * docs/CHANGES: Updated. + +2008-12-18 Bevan, David + + Provide API for accessing embedding and subsetting restriction + information. + + * include/freetype.h (FT_FSTYPE_INSTALLABLE_EMBEDDING, + FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING, + FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING, FT_FSTYPE_EDITABLE_EMBEDDING, + FT_FSTYPE_NO_SUBSETTING, FT_FSTYPE_BITMAP_EMBEDDING_ONLY): New + macros. + (FT_Get_FSType_Flags): New function declaration. + + * src/base/ftobjs.c (FT_Get_FSType_Flags): New function. + + * src/cid/cidtoken.h, src/type1/t1tokens.h, src/type42/t42parse.c + (t42_keywords): Handle `FSType'. + + * include/freetype/t1tables.h (PS_FontInfoRec): Add `fs_type' field. + +2008-12-17 Werner Lemberg + + * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Don't use internal + macros so that copying the source code into an application works + out of the box. + +2008-12-17 Werner Lemberg + + * include/freetype/ftsynth.h, src/base/ftsynth.c: Move + FT_GlyphSlot_Own_Bitmap to... + * include/freetype/ftbitmap.h, src/base/ftbitmap.c: These files. + + * docs/CHANGES: Document it. + +2008-12-10 Werner Lemberg + + Generalize the concept of `tricky' fonts by introducing + FT_FACE_FLAG_TRICKY to indicate that the font format's hinting + engine is necessary for correct rendering. + + At the same time, slightly modify the behaviour of tricky fonts: + FT_LOAD_NO_HINTING is now ignored. To really force raw loading + of tricky fonts (without hinting), both FT_LOAD_NO_HINTING and + FT_LOAD_NO_AUTOHINT must be used. + + Finally, tricky TrueType fonts always use the bytecode interpreter + even if the patented code is used. + + * include/freetype/freetype.h (FT_FACE_FLAG_TRICKY, FT_IS_TRICKY): + New macros. + + * src/truetype/ttdriver.c (Load_Glyph): Handle new load flags + semantics as described above. + + * src/truetype/ttobjs.c (tt_check_trickyness): New function, using + code of ... + (tt_face_init): This function, now simplified and updated to new + semantics. + + * src/base/ftobjs.c (FT_Load_Glyph): Don't use autohinter for tricky + fonts. + + * docs/CHANGES: Document it. + +2008-12-09 Werner Lemberg + + Really fix Savannah bug #25010: An SFNT font with neither outlines + nor bitmaps can be considered as containing space `glyphs' only. + + * src/truetype/ttpload.c (tt_face_load_loca): Handle the case where + a `glyf' table is missing. + + * src/truetype/ttgload.c (load_truetype_glyph): Abort if we have no + `glyf' table but a non-zero `loca' entry. + (tt_loader_init): Handle missing `glyf' table. + + * src/base/ftobjs.c (FT_Load_Glyph): Undo change 2008-12-05. + + * src/sfnt/sfobjs.c (sfnt_load_face): A font with neither outlines + nor bitmaps is scalable. + +2008-12-05 Werner Lemberg + + * src/autofit/aflatin.c (af_latin_uniranges): Add more ranges. This + fixes Savannah bug #21190 which also provides a basic patch. + +2008-12-05 Werner Lemberg + + * include/freetype/freetype.h (FT_LOAD_ADVANCE_ONLY): Use value + 0x100 instead of 0x10000; the latter value is already occupied by + FT_LOAD_TARGET_LIGHT. Bug reported by James Cloos. + + + Handle SFNT with neither outlines nor bitmaps. This fixes Savannah + bug #25010. + + * src/base/ftobjs.c (FT_Load_Glyph): Reject fonts with neither + outlines nor bitmaps. + + * src/sfnt/sfobjs.c (sfnt_load_face): Don't return an error if there + is no table with glyphs. + + + * src/sfnt/ttload.c (tt_face_lookup_table): Improve debugging + message. + +2008-12-01 Werner Lemberg + + GDEF tables need `glyph_count' too for validation. Problem reported + by Chi Nguyen . + + * src/otvalid/otvgdef.c (otv_GDEF_validate), src/otvalid/otvalid.h + (otv_GDEF_validate), src/otvalid/otvmod.c (otv_validate): Pass + `glyph_count'. + +2008-11-29 Werner Lemberg + + * src/autofit/afcjk.c, src/base/ftoutln.c, src/base/ftrfork.c, + src/bdf/bdfdrivr.c, src/gxvalid/gxvmorx.c, src/otvalid/otvmath.c, + src/pcf/pcfdrivr.c, src/psnames/pstables.h, src/smooth/ftgrays.c, + src/tools/glnames.py, src/truetype/ttinterp.c, src/type1/t1load.c, + src/type42/t42objs.c, src/winfonts/winfnt.c: Fix compiler warnings + (Atari PureC). + +2008-11-29 James Cloos + + * src/type/t1load.c (mm_axis_unmap): Revert previous patch and fix + it correctly by using FT_INT_TO_FIXED (FreeType expects 16.16 values + in the /BlendDesignMap space). + +2008-11-29 James Cloos + + * src/type1/t1load.c (mm_axis_unmap): `blend_points' is FT_Fixed*, + whereas `design_points' is FT_Long*. Therefore, return blend rather + than design points. + +2008-11-27 Werner Lemberg + + * src/cff/cffparse.c (cff_parse_real): Handle more than nine + significant digits correctly. This fixes Savannah bug #24953. + +2008-11-25 Daniel Zimmermann + + * src/base/ftstream.c (FT_Stream_ReadFields): Don't access stream + before the NULL check. From Savannah patch #6681. + +2008-11-24 Werner Lemberg + + Fixes from the gnuwin32 port. + + * src/base/ftlcdfil.c: s/EXPORT/EXPORT_DEF/. + + * src/base/ftotval.c: Include FT_OPENTYPE_VALIDATE_H. + + * src/psaux/psobjs.c (ps_table_add): Check `length'. + +2008-11-15 Werner Lemberg + + * src/truetype/ttinterp.c (tt_default_graphics_state): The default + value for `scan_type' is zero, as confirmed by Greg Hitchcock from + Microsoft. Problem reported by Michal Nowakowski + . + +2008-11-12 Tor Andersson + + * src/cff/cffdrivr.c (cff_get_cmap_info): Initialize `format' field. + This fixes Savannah bug #24819. + +2008-11-08 Werner Lemberg + + * src/sfnt/sfobjs.c (sfnt_load_face): Remove #if 0/#endif guards + since OpenType version 1.5 has been released. + + * include/ttnameid.h (TT_NAME_ID_WWS_FAMILY, + TT_NAME_ID_WWS_SUBFAMILY): New macros for OpenType 1.5. + (TT_URC_COPTIC, TT_URC_VAI, TT_URC_NKO, TT_URC_BALINESE, + TT_URC_PHAGSPA, TT_URC_NON_PLANE_0, TT_URC_PHOENICIAN, + TT_URC_TAI_LE, TT_URC_NEW_TAI_LUE, TT_URC_BUGINESE, + TT_URC_GLAGOLITIC, TT_URC_YIJING, TT_URC_SYLOTI_NAGRI, + TT_URC_LINEAR_B, TT_URC_ANCIENT_GREEK_NUMBERS, TT_URC_UGARITIC, + TT_URC_OLD_PERSIAN, TT_URC_SHAVIAN, TT_URC_OSMANYA, + TT_URC_CYPRIOT_SYLLABARY, TT_URC_KHAROSHTHI, TT_URC_TAI_XUAN_JING, + TT_URC_CUNEIFORM, TT_URC_COUNTING_ROD_NUMERALS, TT_URC_SUNDANESE, + TT_URC_LEPCHA, TT_URC_OL_CHIKI, TT_URC_SAURASHTRA, TT_URC_KAYAH_LI, + TT_URC_REJANG, TT_URC_CHAM, TT_URC_ANCIENT_SYMBOLS, + TT_URC_PHAISTOS_DISC, TT_URC_OLD_ANATOLIAN, TT_URC_GAME_TILES): New + macros for OpenType 1.5. + +2008-11-08 Wenlin Institute + + * src/base/ftobjs.c (ft_glyphslot_free_bitmap): Protect against + slot->internal == NULL. Reported by Graham Asher. + +2008-11-08 Werner Lemberg + + * src/sfnt/sfobjs.c (tt_face_get_name): Modified to return an error + code so that memory allocation problems can be distinguished from + missing table entries. Reported by Graham Asher. + (GET_NAME): New macro. + (sfnt_load_face): Use it. + +2008-11-05 Werner Lemberg + + * devel/ftoption.h, include/freetype/config/ftoption.h + [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Undefine + TT_CONFIG_OPTION_UNPATENTED_HINTING. This fixes the return value of + `FT_Get_TrueType_Engine_Type' (and makes it work as documented). + Reported in bug #441638 of bugzilla.novell.com. + + * docs/CHANGES: Document it. + +2008-11-03 Werner Lemberg + + * src/type1/t1load.c (parse_subrs): Use an endless loop. There are + fonts (like HELVI.PFB version 003.001, used on OS/2) which define + some `subrs' elements more than once. Problem reported by Peter + Weilbacher . + +2008-10-15 Graham Asher + + * src/sfnt/ttpost.c (tt_post_default_names): Add `const'. + +2008-10-15 David Turner + + * src/truetype/ttgxvar.c (TT_Set_MM_Blend): Disambiguate for + meddlesome compilers' warning against `for ( ...; ...; ...) ;'. + +2008-10-14 Werner Lemberg + + * src/cff/cffobjs.c (cff_face_init): Remove compiler warning. + Suggested by Bram Tassyns in Savannah patch #6651. + +2008-10-12 Graham Asher + + * src/sfnt/sfobjs.c (sfnt_load_face): Fix computation of + `underline_position'. + +2008-10-12 Werner Lemberg + + * docs/CHANGES: Updated. + +2008-10-09 suzuki toshiya + + Fix Savannah bug #24468. + + According to include/freetype/internal/ftobjs.h, the appropriate + type to interchange single character codepoint is FT_UInt32. It + should be distinguished from FT_UInt which can be 16bit integer. + + * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Change the type + of the second argument `pcharcode' from FT_UInt* to FT_UInt32*. + (tt_cmap4_char_map_binary): Ditto. + (tt_cmap14_get_nondef_chars): Change the type of return value + from FT_UInt* to FT_UInt32*. + +2008-10-08 John Tytgat + + Fix Savannah bug #24485. + + * src/type1/t1load.c (parse_charstrings): Assure that we always have + a .notdef glyph. + +2008-10-05 suzuki toshiya + + * src/base/ftmac.c: Include FT_TRUETYPE_TAGS_H for multi build. + * builds/mac/ftmac.c: Ditto. + +2008-10-05 suzuki toshiya + + * include/freetype/tttags.h (TTAG_TYP1, TTAG_typ1): Fix definitions. + * src/base/ftobjs.c: Include FT_TRUETYPE_TAGS_H. + +2008-10-05 suzuki toshiya + + * src/sfnt/sfobjs.c (sfnt_open_font): Allow `typ1' version tag in + the beginning of sfnt container. + * src/sfnt/ttload.c (check_table_dir): Return + `SFNT_Err_Table_Missing' when sfnt table directory structure is + correct but essential tables for TrueType fonts (`head', `bhed' or + `SING') are missing. Other errors are returned by + SFNT_Err_Unknown_File_Format. + + * src/base/ftobjs.c (FT_Open_Face): When TrueType driver returns + `FT_Err_Table_Missing', try `open_face_PS_from_sfnt_stream'. It is + enabled only when old mac font support is configured. + +2008-10-04 suzuki toshiya + + * include/freetype/tttags.h (TTAG_CID, TTAG_FOND, TTAG_LWFN, + TTAG_POST, TTAG_sfnt, TTAG_TYP1, TTAG_typ1): New tags to simplify + the repeated calculations of these values in ftobjs.c and ftmac.c. + * src/base/ftobjs.c: Replace all FT_MAKE_TAG by new tags. + * src/base/ftmac.c: Ditto. + * builds/mac/ftmac.c: Ditto. + +2008-10-04 suzuki toshiya + + * src/base/ftobjs.c (ft_lookup_PS_in_sfnt_stream): Remove wrong + initialization of *is_sfnt_cid. + +2008-10-04 Werner Lemberg + + * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Remove compiler + warnings. + +2008-10-04 suzuki toshiya + + * src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Replaced by... + (ft_lookup_PS_in_sfnt_stream): This. + (open_face_PS_from_sfnt_stream): New function. It checks whether + the stream is sfnt-wrapped Type1 PS font or sfnt-wrapped CID-keyed + font, then try to open a face for given face_index. + (Mac_Read_sfnt_Resource): Replace the combination of + `ft_lookup_PS_in_sfnt' and `open_face_from_buffer' by + `open_face_PS_from_sfnt_stream'. + * src/base/ftmac.c (FT_New_Face_From_SFNT): Ditto. + * builds/mac/ftmac.c (FT_New_Face_From_SFNT): Ditto. + * src/base/ftbase.h: Remove `ft_lookup_PS_in_sfnt' and add + `open_face_PS_from_sfnt_stream'. + +2008-10-03 suzuki toshiya + + * src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Set *is_sfnt_cid to + FALSE if neither `CID ' nor `TYP1' is found in the sfnt container. + +2008-10-03 suzuki toshiya + + * include/freetype/config/ftconfig.h: Define FT_MACINTOSH when SC or + MrC compiler of MPW is used. These compilers do not define the + macro __APPLE__ by themselves. + * builds/unix/ftconfig.in: Ditto. + * builds/vms/ftconfig.h: Ditto. + * src/base/ftbase.c: Use FT_MACINTOSH instead of __APPLE__, to + include ftmac.c if FreeType 2 is built by MPW. + * src/base/ftobjs.c: Use FT_MACINTOSH instead of __APPLE__, to + enable shared functions for ftmac.c if FreeType 2 is built by MPW. + + * builds/mac/ftmac.c: Include ftbase.h. + (memory_stream_close): Removed. + (new_memory_stream): Ditto. + (open_face_from_buffer): Removed. Use the implementation in + ftobjs.c. + (ft_lookup_PS_in_sfnt): Ditto. + + * builds/mac/FreeType.m68k_far.make.txt: Build ftmac.c as an + included part of ftbase.c, to share the functions in ftobjs.c. The + rule compiling ftmac.c separately is removed and the rule copying + ftbase.c from src/base/ftbase.c to builds/mac/ftbase.c is added. + * builds/mac/FreeType.m68k_cfm.make.txt: Ditto. + * builds/mac/FreeType.ppc_classic.make.txt: Ditto. + * builds/mac/FreeType.ppc_carbon.make.txt: Ditto. + +2008-10-02 Bram Tassyns + + * src/cff/cffgload.c (cff_slot_load): Map CID 0 to GID 0. This + fixes Savannah bug #24430. + +2008-10-02 Werner Lemberg + + * builds/freetype.mk (BASE_H): Rename to... + (INTERNAL_H): This. + (FREETYPE_H): Updated. + * src/base/rules.mk: (BASE_OBJ_S, OBJ_DIR/%.$O): Add BASE_H. + * src/bdf/rules.mk (BDF_DRV_H): Add bdferror.h. + * src/cache/rules.mk (CACHE_DRV_H): Add ftccache.h and ftcsbits.h. + * src/pcf/rules.mk (PCF_DRV_H): Add pcfread.h. + * src/raster/rules.mk (RASTER_DRV_H): Add ftmisc.h. + * src/type42/rules.mk (T42_DRV_H): Add t42types.h. + +2008-10-02 suzuki toshiya + + * src/base/ftbase.h: New file to declare the private utility + functions shared by the sources of base modules. Currently, + `ft_lookup_PS_in_sfnt' and `open_face_from_buffer' are declared to + share between ftobjs.c and ftmac.c. + + * src/base/rule.mk: Add ftbase.h. + + * src/base/ftobjs.c: Include ftbase.h. + (memory_stream_close): Build on any platform when old MacOS font + support is enabled. + (new_memory_stream): Ditto. + (open_face_from_buffer): Build on any platform when old MacOS font + support is enabled. The counting of the face in a font file is + slightly different between Carbon-dependent parser and Carbon-free + parser. They are merged with the platform-specific conditional. + (ft_lookup_PS_in_sfnt): Ditto. + + * src/base/ftmac.c: Include ftbase.h. + (memory_stream_close): Removed. + (new_memory_stream): Ditto. + (open_face_from_buffer): Removed. Use the implementation in + ftobjs.c. + (ft_lookup_PS_in_sfnt): Ditto. + +2008-10-02 Werner Lemberg + + * src/sfnt/sfobjs.c (sfnt_load_face): `psnames_error' is only needed + if TT_CONFIG_OPTION_POSTSCRIPT_NAMES is defined. + +2008-10-01 Werner Lemberg + + * src/truetype/ttobjs.c (tt_face_done), src/cff/cffobjs.c + (cff_face_done), src/pfr/pfrobjs.c (pfr_face_done), + src/pcf/pcfdrivr.c (PCF_Face_Done), src/cid/cidobjs.c + (cid_face_done), src/bdf/bdfdrivr. (BDF_Face_Done), + src/sfnt/sfobjs.c (sfnt_face_done): Protect against face == 0. + Reported by Graham Asher. + +2008-09-30 suzuki toshiya + + * src/base/rules.mk: Add conditional source to BASE_SRC, for `make + multi' on Mac OS X. If the macro $(ftmac_c) is defined, + $(BASE_DIR)/$(ftmac_c) is added to BASE_SRC. In a normal build, the + lack of ftmac.c in BASE_SRC is not serious because ftbase.c includes + ftmac.c. + * builds/unix/unix-def.in: Add a macro definition of $(ftmac_c). + * builds/unix/configure.raw: Add procedure to set up appropriate + value of $(ftmac_c) with the consideration of the availability of + Carbon framework. + +2008-09-30 suzuki toshiya + + * src/base/Jamfile: Add target for multi build by jam on Mac OS X. + * src/base/ftobjs.c (FT_New_Face): Fix the condition to include this + function for MPW building. It is synchronized the condition to + include ftmac.c source into ftbase.c. + +2008-09-22 Werner Lemberg + + * src/cff/cffgload.c (CFF_Operator, cff_argument_counts, + cff_decoder_parse_charstrings): Handle (invalid) + `callothersubr' and `pop' instructions. + +2008-09-22 John Tytgat + + Fix Savannah bug #24307. + + * include/freetype/internal/t1types.h (CID_FaceRec), + src/type42/t42types.h (T42_FaceRec): Comment out `afm_data'. + +2008-09-21 Werner Lemberg + + * src/smooth/ftgrays.c (gray_raster_render): Don't dereference + `target_map' if FT_RASTER_FLAG_DIRECT is set. Problem reported by + Stephan T. Lavavej . + +2008-09-21 suzuki toshiya + + * src/otvalid/Jamfile: Add missing target `otvmath' for multi build + by jam. + * src/sfnt/Jamfile: Add missing target `ttmtx' for multi build by + jam. + +2008-09-20 Werner Lemberg + + * src/smooth/ftgrays.c (gray_find_cell): Fix threshold. The values + passed to this function are already `normalized'. Problem reported + by Stephan T. Lavavej . + + * docs/CHANGES: Document it. + +2008-09-20 Werner Lemberg + + * src/base/ftoutln.c: Include FT_INTERNAL_DEBUG_H. + (FT_Outline_Decompose): Decorate with tracing messages. + + * src/smooth/ftgrays.c [DEBUG_GRAYS]: Replace with + FT_DEBUG_LEVEL_TRACE. + [_STANDALONE_ && FT_DEBUG_LEVEL_TRACE]: Include stdio.h and + stdarg.h. + + (FT_TRACE) [_STANDALONE_]: Remove. + (FT_Message) [_STANDALONE_ && FT_DEBUG_LEVEL_TRACE]: New function. + (FT_TRACE5, FT_TRACE7) [_STANDALONE_]: New macros. + (FT_ERROR) [_STANDALONE_]: Updated. + + (gray_hline) [FT_DEBUG_LEVEL_TRACE]: Fix condition. + Use FT_TRACE7. + (gray_dump_cells): Make it `static void'. + (gray_convert_glyph): Use FT_TRACE7. + + (FT_Outline_Decompose) [_STANDALONE_]: Synchronize with version in + ftoutln.c. + + * src/base/ftadvanc.c (FT_Get_Advance, FT_Get_Advances): Use + FT_ERROR_BASE. + + * docs/formats.txt: Updated. + +2008-09-19 suzuki toshiya + + * src/base/ftmac.c: Import sfnt-wrapped Type1 and sfnt-wrapped + CID-keyed font support. + * builds/mac/ftmac.c: Ditto. + +2008-09-19 suzuki toshiya + + * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Fix double free bug in + sfnt-wrapped Type1 and sfnt-wrapped CID-keyed font support code. + `open_face_from_buffer' frees the passed buffer if it cannot open a + face from the buffer, so the caller must not free it. + +2008-09-19 suzuki toshiya + + * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Add initial support + for sfnt-wrapped Type1 and sfnt-wrapped CID-keyed font. + (ft_lookup_PS_in_sfnt): New function to look up `TYP1' or `CID ' + table in sfnt table directory. It is used before loading TrueType + font driver. + + * docs/CHANGES: Add note about the current status of sfnt-wrapped + Type1 and sfnt-wrapped CID-keyed font support. + +2008-09-18 Werner Lemberg + + * src/base/ftsystem.c (FT_Done_Memory): Use ft_sfree directly for + orthogonality (ft_free and ft_sfree could belong to different memory + pools). This fixes Savannah bug #24297. + +2008-09-18 suzuki toshiya + + * src/cff/cffobjs.c (cff_face_init): Use TTAG_OTTO defined + in ttags.h instead of numerical value 0x4F54544FL. + +2008-09-16 Werner Lemberg + + * src/cff/cffgload.h, src/cff/cffgload.c + (cff_decoder_set_width_only): Eliminate function call. + +2008-09-15 George Williams + + Fix Savannah bug #24179, reported by Bram Tassyns. + + * src/type1/t1load.c (mm_axis_unmap, T1_Get_MM_Var): Fix computation + of default values. + +2008-09-15 Werner Lemberg + + * src/tools/glnames.py (main): Surround `ft_get_adobe_glyph_index' + and `ft_adobe_glyph_list' with FT_CONFIG_OPTION_ADOBE_GLYPH_LIST to + prevent unconditional definition. This fixes Savannah bug #24241. + + * src/psnames/pstables.h: Regenerated. + +2008-09-13 Werner Lemberg + + * autogen.sh, builds/unix/configure.raw, + include/freetype/config/ftconfig.h, builds/unix/ftconfig.in: Minor + beautifying. + + * include/freetype/ftadvanc.h, include/freetype/ftgasp.h, + include/freetype/ftlcdfil.h: Protect against FreeType 1. + Some other minor fixes. + + * devel/ftoption.h: Synchronize with + include/freetype/config/ftoption.h. + +2008-09-11 Werner Lemberg + + * src/base/ftbase.c: Include ftadvanc.c. + +2008-09-11 suzuki toshiya + + * builds/unix/ftconfig.in: Duplicate the cpp computation of + FT_SIZEOF_{INT|LONG} from include/freetype/config/ftconfig.h. + (FT_USE_AUTOCONF_SIZEOF_TYPES): New macro. If defined, the cpp + computation is disabled and the statically configured sizes are + used. This fixes Savannah bug #21250. + + * builds/unix/configure.raw: Add the checks to compare the cpp + computation results of the bit length of int and long versus the + sizes detected by running `configure'. If the results are + different, FT_USE_AUTOCONF_SIZEOF_TYPES is defined to prioritize the + results. + New option --{enable|disable}-biarch-config is added to define or + undefine FT_USE_AUTOCONF_SIZEOF_TYPES manually. + +2008-09-05 suzuki toshiya + + * builds/unix/configure.raw: Clear FT2_EXTRA_LIBS when Carbon or + ApplicationService framework is missing. Although this value is not + used in building of FreeType2, it is written in `freetype2.pc' and + `freetype-config'. + +2008-09-01 david turner + + * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Accept a negative cmap + index to mean `use default cached FT_Face's charmap'. This fixes + Savannah bug #22625. + * include/freetype/ftcache.h: Document it. + + + Make FT_MulFix an inlined function. This is done to speed up + FreeType a little (on x86 3% when loading+hinting, 10% when + rendering, ARM savings are more important though). Disable this by + undefining FT_CONFIG_OPTION_INLINE_MULFIX. + + Use of assembler code can now be controlled with + FT_CONFIG_OPTION_NO_ASSEMBLER. + + * include/freetype/config/ftconfig.h, builds/unix/ftconfig.in + [!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MulFix_arm): New assembler + implementation. + [!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MulFix_i386): Assembler + implementation taken from `ftcalc.c'. + [!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MULFIX_ASSEMBLER): New macro + which is defined to the platform-specific assembler implementation + of FT_MulFix. + [FT_CONFIG_OPTION_INLINE_MULFIX && FT_MULFIX_ASSEMBLER] + (FT_MULFIX_INLINED): New macro. + + * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_NO_ASSEMBLER, + FT_CONFIG_OPTION_INLINE_MULFIX): New macros. + + * include/freetype/freetype.h: Updated to handle FT_MULFIX_INLINED. + + * src/base/ftcalc.c: Updated to use FT_MULFIX_ASSEMBLER and + FT_MULFIX_INLINED. + + + Add a new header named FT_ADVANCES_H declaring some new APIs to + extract the advances of one or more glyphs without necessarily + loading their outlines. Also provide `fast loaders' for the + TrueType, Type1, and CFF font drivers (more to come later). + + * src/base/ftadvanc.c, include/freetype/ftadvanc.h: New files. + + * include/freetype/config/ftheader.h (FT_ADVANCES_H): New macro. + * include/freetype/freetype.h (FT_LOAD_ADVANCE_ONLY): New macro. + + * include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc): + `flags' and `advances' are now of type `FT_UInt' and `FT_Fixed', + respectively. + + * src/base/Jamfile (_sources), src/base/rules.mk (BASE_SRC): Add + ftadvanc.c. + + * src/cff/cffdrivr.c (cff_get_advances): New function. + (cff_driver_class): Register it. + + * src/cff/cffgload.c (cff_decoder_set_width_only): New function. + (cff_decoder_parse_charstrings): Handle `width_only'. + (cff_slot_load): Handle FT_LOAD_ADVANCE_ONLY. + + * src/cff/cffgload.h (cff_decoder): New element `width_only'. + (cff_decoder_set_width_only): New declaration. + + * src/truetype/ttdriver.c (tt_get_advances): New function. + (tt_driver_class): Register it. + + * src/truetype/ttgload.c (Get_HMetrics, Get_VMetrics): Renamed to... + (TT_Get_HMetrics, TT_Get_VMetrics): This. + Update callers. + * src/truetype/ttgload.h: Declare them. + + * src/type1/t1gload.h, src/type1/t1gload.c (T1_Get_Advances): New + function. + * src/type1/t1driver.c (t1_driver_class): Register T1_Get_Advances. + + + Add checks for minimum version of the `autotools' stuff. + + * autogen.sh: Implement it. + (get_major_version, get_minor_version, get_patch_version, + compare_to_minimum_version, check_tool_version): New auxiliary + functions. + + * README.CVS: Document it. + +2008-08-29 suzuki toshiya + + * src/sfnt/sfobjs.c (sfnt_open_font): Use TTAG_OTTO defined in + ttags.h instead of FT_MAKE_TAG( 'O', 'T', 'T', 'O' ). + +2008-08-28 Werner Lemberg + + * src/type1/t1load.c (parse_encoding): Protect against infinite + loop. This fixes Savannah bug #24150 (where a patch has been posted + too). + +2008-08-23 Werner Lemberg + + * src/type/t1afm.c (compare_kern_pairs), src/pxaux/afmparse.c + (afm_compare_kern_pairs): Fix comparison. This fixes Savannah bug + #24119. + +2008-08-19 suzuki toshiya + + * src/base/ftobjs.c (FT_Stream_New): Initialize *astream always, + even if passed library or arguments are invalid. This fixes a bug + that an uninitialized stream is freed when an invalid library handle + is passed. Originally proposed by Mike Fabian, 2008/08/18 on + freetype-devel. + (FT_Open_Face): Ditto (stream). + (load_face_in_embedded_rfork): Ditto (stream2). + +2008-08-18 suzuki toshiya + + * src/base/ftmac.c: Add a fallback to guess the availability of the + `ResourceIndex' type. It is used when built without configure + (e.g., a build with Jam). + * builds/mac/ftmac.c: Ditto. + * builds/unix/configure.raw: Set HAVE_TYPE_RESOURCE_INDEX to 1 or 0 + explicitly, even if `ResourceIndex' is unavailable. + +2008-08-18 suzuki toshiya + + * builds/unix/configure.raw: In checking of Mac OS X features, + all-in-one header file `Carbon.h' is replaced by the minimum + header file `CoreServices.h', similar to current src/base/ftmac.c. + +2008-08-18 suzuki toshiya + + * src/sfnt/ttcmap.c (tt_cmap2_validate): Skip the validation of + sub-header when its code_count is 0. Many Japanese Dynalab fonts + include such an empty sub-header (code_count == 0, first_code == 0 + delta == 0, but offset != 0) as the second sub-header in SJIS cmap. + +2008-08-04 Werner Lemberg + + * src/type1/t1tokens.h: Handle `ForceBold' keyword. This fixes + Savannah bug #23995. + + * src/cid/cidload.c (parse_expansion_factor): New callback function. + (cid_field_records): Use it for `ExpansionFactor'. + * src/cod/cidtoken.h: Handle `ForceBold' keyword. + Don't handle `ExpansionFactor'. + +2008-08-04 Bram Tassyns + + * src/cff/cffparse.c (cff_parse_fixed_scaled): Fix thinko which + resulted in incorrect scaling. This fixes Savannah bug #23973. + +2008-08-04 Werner Lemberg + + Be more tolerant w.r.t. invalid entries in SFNT table directory. + + * src/sfnt/ttload.c (check_table_dir): Ignore invalid entries and + adjust table count. + Add more trace messages. + (tt_face_load_font_dir): Updated. + +2008-07-30 Werner Lemberg + + * src/cff/cffgload.c (cff_decoder_parse_charstrings): No longer + assume that the first argument on the stack is the bottom-most + element. Two reasons: + + o According to people from Adobe it is missing in the Type 2 + specification that pushing of additional, superfluous arguments + on the stack is prohibited. + + o Acroread in general handles fonts differently, namely by popping + the number of arguments needed for a particular operand (as a PS + interpreter would do). In case of buggy fonts this causes a + different interpretation which of the elements on the stack are + superfluous and which not. + + Since there are CFF subfonts (embedded in PDFs) which rely on + Acroread's behaviour, FreeType now does the same. + +2008-07-27 Werner Lemberg + + Add extra mappings for `Tcommaaccent' and `tcommaaccent'. This + fixes Savannah bug #23940. + + * src/psnames/psmodule.c (WGL_EXTRA_LIST_SIZE): Rename to... + (EXTRA_GLYPH_LIST_SIZE): This. + Increase by 2. + (ft_wgl_extra_unicodes): Rename to... + (ft_extra_glyph_unicodes): This. + Add two code values. + (ft_wgl_extra_glyph_names): Rename to... + (ft_extra_glyph_names): This. + Add two glyphs. + (ft_wgl_extra_glyph_name_offsets): Rename to... + (ft_extra_glyph_name_offsets): This. + Add two offsets. + + (ps_check_wgl_name, ps_check_wgl_unicode): Rename to... + (ps_check_extra_glyph_name, ps_check_extra_glyph_unicode): This. + Updated. + (ps_unicodes_init): Updated. + +2008-07-26 Werner Lemberg + + * src/cff/cffgload.c (cff_decoder_prepare, + cff_decoder_parse_charstrings): Improve debug output. + +2008-07-22 Martin McBride + + * src/sfnt/ttcmap.c (tt_cmap4_validate, tt_cmap4_char_map_linear, + tt_cmap4_char_map_binary): Handle fonts which treat the last segment + specially. According to the specification, such fonts would be + invalid but acroread accepts them. + +2008-07-16 Jon Foster + + * src/pfr/pfrdrivr.c (pfr_get_advance): Fix off-by-one error. + + * src/base/ftcalc.c (FT_MulFix): Fix portability issue. + + * src/sfnt/ttpost.c (MAC_NAME) [!FT_CONFIG_OPTION_POSTSCRIPT_NAMES]: + Fix compiler warning. + +2008-07-16 Werner Lemberg + + Handle CID-keyed fonts wrapped in an SFNT (with cmaps) correctly. + + * src/cff/cffload.c (cff_font_load): Pass `pure_cff'. + Invert sids table only if `pure_cff' is set. + * src/cff/cffload.h: Udpated. + + * src/cff/cffobjs.c (cff_face_init): Updated. + Set FT_FACE_FLAG_CID_KEYED only if pure_cff is set. + + * docs/CHANGES: Updated. + +2008-07-09 Werner Lemberg + + * src/truetype/ttpload.c (tt_face_load_loca): Handle buggy fonts + where num_locations < num_glyphs. Problem reported by Ding Li. + +2008-07-05 Werner Lemberg + + Since FreeType uses `$(value ...)', we now need GNU make 3.80 or + newer. This fixes Savannah bug #23648. + + * configure: zsh doesn't like ${1+"$@"}. + Update needed GNU make version. + * builds/toplevel.mk: Check for `$(eval ...)'. + * docs/INSTALL.GNU, docs/INSTALL.CROSS, docs/INSTALL.UNIX: Document + it. + +2008-07-04 Werner Lemberg + + * src/raster/ftraster.c (Draw_Sweep): If span is smaller than one + pixel, only check for dropouts if neither start nor end point lies + on a pixel center. This fixes Savannah bug #23762. + +2008-06-29 Werner Lemberg + + * Version 2.3.7 released. + ========================= + + + Tag sources with `VER-2-3-7'. + + * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump + version number to 2.3.7. + + * README, Jamfile (RefDoc), builds/win32/visualc/index.html, + builds/win32/visualc/freetype.dsp, + builds/win32/visualc/freetype.vcproj, + builds/win32/visualce/index.html, + builds/win32/visualce/freetype.dsp, + builds/win32/visualce/freetype.vcproj: s/2.3.6/2.3.7/, s/236/237/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 7. + + * builds/unix/configure.raw (version_info): Set to 9:18:3. + + * docs/release: Updated. + +2008-06-28 Werner Lemberg + + * src/ftglyph.c (FT_Matrix_Multiply, FT_Matrix_Invert): Move to... + * src/ftcalc.c: Here. This fixes Savannah bug #23729. + +2008-06-27 Werner Lemberg + + * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop, + Horizontal_Gray_Sweep_Drop): Test for intersections which + degenerate to a single point can be ignored; this has been confirmed + by Greg Hitchcock from Microsoft. (This was commented out code.) + +2008-06-26 Werner Lemberg + + Improve navigation in API reference. + + * src/tools/docmaker/tohtml.py (html_header_3): Renamed to... + (html_header_6): This. + (html_header_3, html_header_3i, html_header_4, html_header_5, + html_header_5t): New strings. + (toc_footer_start, toc_footer_end): New strings. + (HtmlFormatter::html_header): Updated. + (HtmlFormatter::html_index_header, HtmlFormatter::html_toc_header): + New strings. + (HtmlFormatter::index_enter): Use `html_index_header'. + (HtmlFormatter::index_exit): Print `html_footer'. + (HtmlFormatter::toc_enter): Use `html_toc_header'. + (HtmlFormatter::toc_exit): Print proper footer. + + Convert ~ to non-breakable space. + + * src/tools/docmaker/tohtml.py (make_html_para): Implement it. + Update header files accordingly. + +2008-06-24 suzuki toshiya + + * builds/unix/configure.raw: Check type `ResourceIndex' explicitly + and define HAVE_TYPE_RESOURCE_INDEX if it is defined. Mac OS X 10.5 + bundles 10.4u SDK with MAC_OS_X_VERSION_10_5 macro but without + ResourceIndex type definition. The macro does not inform the type + availability. + * src/base/ftmac.c: More parentheses are inserted to clarify the + conditionals to disable legacy APIs in `10.5 and later' cases. If + HAVE_TYPE_RESOURCE_INDEX is not defined, ResourceIndex is defined. + +2008-06-24 Werner Lemberg + + * src/truetype/ttinterp.c (Ins_SCANTYPE): Don't check rendering + mode. + + * src/raster/ftraster.c (Render_Glyph, Render_Gray_Glyph, + Draw_Sweep): No-dropout mode is value 2, not value 0. + (Draw_Sweep): Really skip dropout handling for no-dropout mode. + +2008-06-24 Werner Lemberg + + * src/psaux/psobjs.c (t1_builder_close_contour): Don't add contour + if it consists of one point only. Based on a patch from Savannah + bug #23683 (from John Tytgat). + +2008-06-22 Werner Lemberg + + * src/truetype/ttgload.c (TT_Load_Glyph): Protect bytecode stuff + with IS_HINTED. + + * docs/CHANGES: Updated. + +2008-06-22 suzuki toshiya + + * builds/unix/configure.raw: If CFLAGS has `-isysroot XXX' option + but LDFLAGS does not, import it to LDFLAGS. The option is used to + specify non-default SDK on Mac OS X (e.g., universal binary SDK for + Mac OS X 10.4 on PowerPC platform). Although Apple TechNote 2137 + recommends to add the option only to CFLAGS, LDFLAGS should include + it because libfreetype.la is built with -no-undefined. This fixes a + bug reported by Ryan Schmidt in MacPorts, + http://trac.macports.org/ticket/15331. + +2008-06-21 Werner Lemberg + + Enable access to the various dropout rules of the B&W rasterizer. + Pass dropout rules from the TT bytecode interpreter to the + rasterizer. + + * include/freetype/ftimage.h (FT_OUTLINE_SMART_DROPOUTS, + FT_OUTLINE_EXCLUDE_STUBS): New flags for for FT_Outline. + + * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop, + Horizontal_Gray_Sweep_Drop): Use same mode numbers as given in the + OpenType specification. + Fix mode 4 computation. + (Render_Glyph, Render_Gray_Glyph): Handle new outline flags. + + * src/truetype/ttgload.c (TT_Load_Glyph) Convert scan conversion + mode to FT_OUTLINE_XXX flags. + + * src/truetype/ttinterp.c (Ins_SCANCTRL): Enable ppem check. + +2008-06-19 Werner Lemberg + + * src/cff/cffobjs.c (cff_face_init): Compute final + `dict->units_per_em' value before assigning it to + `cffface->units_per_EM'. Otherwise, CFFs without subfonts are + scaled incorrectly if the font matrix is non-standard. This fixes + Savannah bug #23630. + + * docs/CHANGES: Updated. + +2008-06-19 Werner Lemberg + + * src/type/t1objs.c (T1_Face_Init): Slightly improve algorithm fix + from 2008-06-19. + +2008-06-18 Werner Lemberg + + * src/type/t1objs.c (T1_Face_Init): Fix change from 2008-03-21. + Reported by Peter Weilbacher . + + * docs/CHANGES: Updated. + +2008-06-15 George Williams + + * src/otvalid/otvgpos.c (otv_MarkBasePos_validate): Set + `valid->extra2' to 1. This is undocumented in the OpenType 1.5 + specification. + +2008-06-15 Werner Lemberg + + * src/base/ftcalc.c (FT_MulFix) : Protect registers correctly + from clobbering. Patch from Savannah bug report #23556. + + * docs/CHANGES: Document it. + +2008-06-10 Werner Lemberg + + * autogen.sh: Add option `--install' to libtoolize. + +2008-06-10 Werner Lemberg + + * Version 2.3.6 released. + ========================= + + + Tag sources with `VER-2-3-6'. + + * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump + version number to 2.3.6. + + * README, Jamfile (RefDoc), builds/win32/visualc/index.html, + builds/win32/visualc/freetype.dsp, + builds/win32/visualc/freetype.vcproj, + builds/win32/visualce/index.html, + builds/win32/visualce/freetype.dsp, + builds/win32/visualce/freetype.vcproj: s/2.3.5/2.3.6/, s/235/236/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 6. + + * builds/unix/configure.raw (version_info): Set to 9:17:3. + + + * include/freetype/internal/psaux.h (T1_BuilderRec): Remove `scale_x' + and `scale_y'. + * src/cff/cffgload.h (CFF_Builder): Remove `scale_x' and `scale_y'. + + + * src/cff/cffparse.c: Include FT_INTERNAL_DEBUG_H. + * src/cff/cffobjs.h: Include FT_INTERNAL_POSTSCRIPT_HINTS_H. + +2008-06-10 Werner Lemberg + + * src/base/ftobjs.c (open_face): Check `clazz->init_face' and + `clazz->done_face'. + +2008-06-09 VaDiM + + Support debugging on WinCE. From Savannah patch #6536; this fixes + bug #23497. + + * builds/win32/ftdebug.c (OutputDebugStringEx): New function/macro + as a replacement for OutputDebugStringA (which WinCE doesn't have). + Update all callers. + (ft_debug_init) [_WIN32_CE]: WinCE apparently doesn't have + environment variables. + +2008-06-09 Werner Lemberg + + * README.CVS: Updated. + + * builds/unix/configure.raw, builds/unix/freetype-config.in: Updated + for newer versions of autoconf and friends. + +2008-06-08 Werner Lemberg + + * src/type1/t1parse.h (T1_ParserRec): Make `base_len' and + `private_len' unsigned. + + * src/type1/t1parse.c (read_pfb_tag): Make `asize' unsigned and read + it as such. + (T1_New_Parser, T1_Get_Private_Dict): Make `size' unsigned. + + + * src/base/ftstream.c (FT_Stream_Skip): Reject negative values. + + + * src/type1/t1load.c (parse_blend_design_positions): Check `n_axis' + for sane value. + Fix typo. + + + * src/psaux/psobjs.c (ps_table_add): Check `idx' correctly. + + + * src/truetype/ttinterp (Ins_SHC): Use BOUNDS() to check + `last_point'. + + + * src/sfnt/ttload.c (tt_face_load_max_profile): Limit + `maxTwilightPoints'. + +2008-06-06 Werner Lemberg + + * src/truetype/ttinterp.c (Ins_IP): Handle case `org_dist == 0' + correctly. This fixes glyphs `t' and `h' of Arial Narrow at 12ppem. + +2008-06-03 Werner Lemberg + + * include/freetype/ftcache.h (FTC_FaceID): Change type back to + FT_Pointer. Reported by Ian Britten . + +2008-06-02 Werner Lemberg + + Emit header info for defined FreeType objects in reference. + + * src/tools/docmaker/content.py (re_header_macro): New regexp. + (ContentProcessor::__init__): Initialize new dictionary `headers'. + (DocBlock::__init__): Collect macro header definitions. + + * src/tools/docmaker/tohtml.py (header_location_header, + header_location_footer): New strings. + (HtmlFormatter::__init__): Pass `headers' dictionary. + (HtmlFormatter::print_html_field): Don't emit paragraph tags. + (HtmlFormatter::print_html_field_list): Emit empty paragraph. + (HtmlFormatter::block_enter): Emit header info. + +2008-06-01 Werner Lemberg + + * include/freetype/config/ftheader.h (FT_UNPATENTED_HINTING_H, + FT_INCREMENTAL_H): Added. + +2008-05-28 Werner Lemberg + + * src/tools/docmaker/sources.py (SourceBlock::__init__): While + looking for markup tags, return immediately as soon a single one is + found. + +2008-05-28 Werner Lemberg + + * src/truetype/ttinterp.c (Ins_MD): The MD instruction also uses + original, unscaled input values. Confirmed by Greg Hitchcock from + Microsoft. + +2008-05-27 Werner Lemberg + + * src/tools/docmaker/tohtml.py (block_footer_start, + block_footer_middle): Beautify output. + +2008-05-25 Werner Lemberg + + * src/raster/ftraster.c (fc_black_render): Return 0 when we are + trying to render into a zero-width/height bitmap, not an error code. + + * src/truetype/ttgload.c (load_truetype_glyph): Move initialization + of the graphics state for subglyphs to... + (TT_Hint_Glyph): This function. + Hinting instructions for a composite glyph apparently refer to the + just hinted subglyphs, not the unhinted, unscaled outline. This + seems to fix Savannah bugs #20973 and (at least partially) #23310. + +2008-05-20 suzuki toshiya + + * src/base/ftmac.c (FT_New_Face_From_Suitcase): Check if valid + `aface' is returned by FT_New_Face_From_FOND(). The patch was + proposed by an anonymous reporter of Savannah bug #23204. + +2008-05-18 Werner Lemberg + + * src/pshinter/pshalgo.c (ps_hints_apply): Reset scale values after + correction for pixel boundary. Without this patch, the effect can + be cumulative under certain circumstances, making glyphs taller and + taller after each call. This fixes Savannah bug #19976. + +2008-05-18 Werner Lemberg + + * src/base/ftdebug.c (FT_Message, FT_Panic): Send output to stderr. + This fixes Savannah bug #23280. + + * docs/CHANGES: Updated. + +2008-05-18 David Turner + + * src/psnames/psmodule.c (ft_wgl_extra_unicodes, + ft_wgl_extra_glyph_names, ft_wgl_extra_glyph_name_offsets, + ps_check_wgl_name, ps_check_wgl_unicode): Use `static' to make + declarations non-global. + + * src/type1/t1load.c: Add missing comment. + +2008-05-17 Sam Hocevar + + * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Handle zero-contour + glyphs correctly. Patch from Savannah bug #23277. + +2008-05-16 Werner Lemberg + + * docs/CHANGES: Updated. + +2008-05-16 Sergey Tolstov + + Improve support for WGL4 encoded fonts. + + * src/psnames/psmodule.c (WGL_EXTRA_LIST_SIZE): New macro. + (ft_wgl_extra_unicodes, ft_wgl_extra_glyph_names, + ft_wgl_extra_glyph_name_offsets): New arrays. + (ps_check_wgl_name, ps_check_wgl_unicode): New functions. + (ps_unicodes_init): Use them to add additional Unicode mappings. + +2008-05-15 Werner Lemberg + + * src/psaux/t1decode.c (t1_decoder_parse_charstrings) + : `closepath' without a path is a no-op, not an error + (cf. the PS reference manual). + + Reported by Martin McBride. + +2008-05-15 Werner Lemberg + + * builds/toplevel.mk (CONFIG_GUESS, CONFIG_SUB): Updated. + +2008-05-15 Werner Lemberg + + * src/type1/t1load.c (parse_subrs): Accept fonts with a subrs array + which contains a single but empty entry. This is technically + invalid (since it must end with `return'), but... + + Reported by Martin McBride. + +2008-05-14 Werner Lemberg + + Finish fix of scaling bug of CID-keyed CFF subfonts. + + * include/freetype/internal/ftcalc.h, src/base/ftcalc.c + (FT_Matrix_Multiply_Scaled, FT_Vector_Transform_Scaled): New + functions. + + * src/cff/cffobjs.h (CFF_Internal): New struct. It is used to + provide global hinting data for both the top-font and all subfonts + (with proper scaling). + + * src/cff/cffobjs.c (cff_make_private_dict): New function, using + code from `cff_size_init'. + (cff_size_init, cff_size_done, cff_size_select, cff_size_request): + Use CFF_Internal and handle subfonts. + (cff_face_init): Handle top-dict and subfont matrices correctly; + apply some heuristic in case of unlikely matrix concatenation + results. This has been discussed with people from Adobe (thanks + goes mainly to David Lemon) who confirm that the CFF specs are fuzzy + and not correct. + + * src/cff/cffgload.h (cff_decoder_prepare): Add `size' argument. + + * src/cff/cffgload.c (cff_builder_init): Updated. + (cff_decoder_prepare): Handle hints globals for subfonts. + Update all callers. + (cff_slot_load): Handling scaling of subfonts properly. + + * src/cff/cffparse.c (cff_parse_fixed_dynamic): New function. + (cff_parse_font_matrix): Use it. + + * src/cff/cfftypes.h (CFF_FontDictRec): Make `units_per_em' + FT_ULong. + + * docs/CHANGES: Document it. + +2008-05-13 Werner Lemberg + + * src/winfonts/winfnt.c (fnt_face_get_dll_font, FNT_Face_Init): + Handle case `face_index < 0'. + * docs/CHANGES: Document it. + +2008-05-04 Werner Lemberg + + First steps to fix the scaling bug of CID-keyed CFF subfonts, + reported by Ding Li on 2008/03/28 on freetype-devel. + + * src/base/cff/cffparse.c (power_tens): New array. + (cff_parse_real): Rewritten to introduce a fourth parameter which + returns the `scaling' of the real number so that we have no + precision loss. This is not used yet. + Update all callers. + (cff_parse_fixed_thousand): Replace with... + (cff_parse_fixed_scaled): This function. Update all callers. + +2008-05-03 Werner Lemberg + + * src/base/ftobjs.c (FT_Load_Glyph): Call the auto-hinter without + transformation since it recursively calls FT_Load_Glyph. This fixes + Savannah bug #23143. + +2008-04-26 Werner Lemberg + + * include/freetype/internal/psaux.h (T1_BuilderRec): Mark `scale_x' + and `scale_y' as obsolete since they aren't used. + * src/psaux/psobjs.c (t1_builder_init): Updated. + + * src/cff/cffgload.h (CFF_Builder): Mark `scale_x' and `scale_y' as + obsolete since they aren't used. + * src/cff/cffgload.c (cff_builder_init): Updated. + +2008-04-14 Werner Lemberg + + * src/pcf/pcfdrivr.c (PCF_Face_Init): Protect call to + `FT_Stream_OpenLZW' with `FT_CONFIG_OPTION_USE_LZ'. From Savannah + bug #22909. + +2008-04-13 Werner Lemberg + + * src/psaux/psconv.c (PS_Conv_ToFixed): Increase precision if + integer part is zero. + +2008-04-01 Werner Lemberg + + Fix compilation with g++ 4.1 (with both `single' and `multi' + targets). + + * src/base/ftobjs.c (FT_Open_Face): Don't define a variable in block + which is crossed by a `goto'. + + * src/otvalid/otvalid.h (otv_MATH_validate): Add prototype. + +2008-03-31 Werner Lemberg + + Fix support for subsetted CID-keyed CFFs. + + * include/freetype/freetype.h (FT_FACE_FLAG_CID_KEYED, + FT_IS_CID_KEYED): New macros. + + * src/cff/cffobjs.c (cff_face_init): Set number of glyphs to the + maximum CID value in CID-keyed CFFs. + Handle FT_FACE_FLAG_CID_KEYED flag. + + * docs/CHANGES: Document it. + + + Fix CFF font matrix calculation and improve precision. + + * src/cff/cffparse.c (cff_parse_real): Increase precision if integer + part is zero. + (cff_parse_font_matrix): Simplify computation of `units_per_em'; + this prevents overflow also. + + + Support FT_Get_CID_Registry_Ordering_Supplement for PS CID fonts. + + * src/cid/cidriver.c: Include FT_SERVICE_CID_H. + (cid_get_ros): New function. + (cid_service_cid_info): New service structure. + (cid_services): Register it. + +2008-03-23 Werner Lemberg + + Adjustments for Visual C++ 8.0, as reported by Rainer Deyke. + + * builds/compiler/visualc.mk (CFLAGS): Remove /W5. + (ANSIFLAGS): Add _CRT_SECURE_NO_DEPRECATE. + +2008-03-21 Laurence Darby + + * src/type1/t1objs.c (T1_Face_Init): Use `/Weight'. Patch from + Savannah bug #22675. + +2008-03-13 Derek Clegg + + * src/truetype/ttgxvar.c (TT_Get_MM_Var): Fix named style loop. + Patch from Savannah bug #22541. + +2008-03-03 Masatoshi Kimura + + * src/sfnt/ttcmap.c (tt_cmap14_char_map_nondef_binary, + tt_cmap14_find_variant): Return correct value. + (tt_cmap14_variant_chars): Fix check for `di'. + +2008-02-29 Wermer Lemberg + + * docs/CHANGES: Updated. + +2008-02-29 Wolf + + Add build support for symbian platform. From Savannah bug #22440. + + * builds/symbian/*: New files. + +2008-02-21 suzuki toshiya + + * src/base/ftmac.c (parse_fond): Fix a bug of PostScript font name + synthesis. For any face of a specified FOND, always the name for + the first face was used. Except of a FOND that refers multiple + Type1 font files, wrong synthesized font names are not used at all, + so this is an invisible bug. A few limit checks are added too. + + * builds/mac/ftmac.c: Ditto. + +2008-02-21 suzuki toshiya + + * builds/unix/configure.raw: Split compiler option to link Carbon + frameworks to one option for CoreServices framework and another + option for ApplicationServices framework. The split options can be + managed by GNU libtool to avoid unrequired duplication when FreeType + is linked with other applications. Suggested by Daniel Macks, + Savannah bug #22366. + +2008-02-18 Victor Stinner + + * src/truetype/ttinterp.c (Ins_IUP): Check number of points. Fix + from Savannah bug #22356. + +2008-02-17 Jonathan Blow + + * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph): + Check for valid callback pointers. + +2008-02-15 suzuki toshiya + + * src/base/ftmac.c (FT_New_Face_From_SFNT): Check the sfnt resource + handle by its value instead of ResError(), fix provided by Deron + Kazmaier. According to the Resource Manager Reference, + GetResource(), Get1Resource(), GetNamedResource(), + Get1NamedResource() and RGetResource() set noErr but return NULL + handle when they can not find the requested resource. These + functions never return undefined values, so it is sufficient to + check if the handle is not NULL. + + * builds/mac/ftmac.c (FT_New_Face_From_SFNT): Ditto. + +2008-02-14 suzuki toshiya + + * src/base/ftbase.c: is replaced by "ftmac.c" as other + inclusion styles. Now it always includes src/base/ftmac.c; + builds/mac/ftmac.c is never included in any configuration. + + * builds/unix/configure.raw: Print warning if configure is executed + with options to specify Carbon functionalities explicitly. + + * docs/INSTALL.MAC: Note that legacy builds/mac/ftmac.c is not + included automatically and manual replacement is required. + +2008-02-11 Werner Lemberg + + * builds/modules.mk (CLOSE_MODULE, REMOVE_MODULE), builds/detect.mk + (dos_setup), builds/freetype.mk (clean_project_dos, + distclean_project_dos): Don't use \ but $(SEP). Reported by Duncan + Murdoch. + +2008-01-18 Sylvain Pasche + + * src/base/ftlcdfil.c (_ft_lcd_filter_legacy): Updated comment to + mention intra-pixel algorithm. + + * include/freetype/freetype.h (FT_Render_Mode): Mention that + FT_Library_SetLcdFilter can be used to reduce fringes. + +2008-01-16 Werner Lemberg + + * src/raster/ftraster.c (ft_black_render): Check `outline' before + using it. Reported by Allan Yang. + +2008-01-12 Werner Lemberg + + * src/raster/ftraster.c (FT_CONFIG_OPTION_5_GRAY_LEVELS): Remove. + +2008-01-12 Allan Yang, Jian Hua - SH + + * src/raster/ftraster.c (ft_black_init) + [FT_RASTER_OPTION_ANTI_ALIASING]: Fix compilation. + +2008-01-10 Werner Lemberg + + * src/truetype/ttgload.c (load_truetype_glyph): Handle the case + where the number of contours in a simple glyph is zero (and which + does contain an entry in the `glyf' table). This fixes Savannah bug + #21990. + +2008-01-04 suzuki toshiya + + Formatting suggested by Sean McBride. + + * builds/mac/ftmac.c: Formatting (tab expanded). + * src/autofit/afindic.c: Ditto. + * src/base/ftcid.c: Ditto. + * src/base/ftmac.c: Ditto. + +2007-12-30 Werner Lemberg + + * src/smooth/ftgrays.c (gray_raster_render): Check `outline' + correctly. + +2007-12-21 suzuki toshiya + + Improvement of POSIX resource-fork accessor to load unsorted + references in a resource. In HelveLTMM (resource-fork PostScript + Type1 font bundled with Mac OS X since 10.3.x), the appearance order + of PFB chunks is not sorted; sorting the chunks by reference IDs is + required. + + * include/freetype/internal/ftrfork.h (FT_RFork_Ref): New structure + type to store a pair of reference ID and offset to the chunk. + + * src/base/ftrfork.c (ft_raccess_sort_ref_by_id): New function to + sort FT_RFork_Ref by their reference IDs. + + (FT_Raccess_Get_DataOffsets): Returns an array of offsets that is + sorted by reference ID. + +2007-12-14 Werner Lemberg + + * src/cff/cffparse.c (cff_parse_real): Don't apply `power_ten' + division too early; otherwise the most significant digit(s) of the + final result are lost as the value is truncated to an integer. This + fixes Savannah bug #21794 (where the patch has been posted too). + +2007-12-06 Fix <4d876b82@gmail.com> + + Pass options from one configure script to another as-is (not + expanded). This is needed for options like + --includedir='${prefix}/include'. + + * builds/unix/detect.mk, configure: Prevent argument expansion in + call to the (real) `configure' script. + +2007-12-06 Werner Lemberg + + * src/truetype/ttgload.c (load_truetype_glyph): Fix compilation if + TT_USE_BYTECODE_INTERPRETER isn't defined. + +2007-12-06 Werner Lemberg + + There exist CFFs which contain opcodes for the Type 1 operators + `hsbw' and `closepath' which are both invalid in Type 2 charstrings. + However, it doesn't harm to support them. + + * src/cff/cffgload.c (CFF_Operator): Add `cff_op_hsbw' and + `cff_op_closepath.' + (cff_argument_counts): Ditto. + + (cff_decoder_parse_charstrings): Handle Type 1 opcodes 9 (closepath) + and 13 (hsbw) which are invalid in Type 2 charstrings. + +2007-12-06 suzuki toshiya + + * src/base/ftrfork.c (raccess_guess_darwin_newvfs): New function to + support new pathname syntax `..namedfork/rsrc' to access a resource + fork on Mac OS X. The legacy syntax `/rsrc' does not work on + case-sensitive HFS+. + (raccess_guess_darwin_hfsplus): Fix a bug in the calculation of + buffer size to store a pathname. + * include/freetype/internal/ftrfork.h: Increment the number of + resource fork guessing rule. + +2007-12-06 suzuki toshiya + + * builds/unix/configure.raw: Improve the compile tests to search + Carbon functions. + * builds/mac/ftmac.c: Import fixes for Carbon incompatibilities + proposed by Sean McBride from src/base/ftmac.c (see 2007-11-16). + +2007-12-06 suzuki toshiya + + The documents and comments for Mac OS X are improved by Sean + McBride. + + * src/base/ftmac.c: Fix a comment. + * include/freetype/ftmac.h: Ditto. + * docs/INSTALL.MAC: Improve English and add comment on lowest + system version specified by MACOSX_DEPLOYMENT_TARGET. + +2007-12-04 Werner Lemberg + + * src/cff/cffload.c (cff_subfont_load): Don't use logical OR to + concatenate error codes. + * src/sfnt/ttsbit.c (Load_SBit_Range): Ditto. + +2007-12-04 Graham Asher + + * src/truetype/ttobjs.c (tt_face_init): Don't use logical OR to + concatenate error codes. + +2007-12-04 Sean McBride + + * src/pfr/pfrgload.c (pfr_glyph_load_compound): Remove compiler + warning. + +2007-11-20 suzuki toshiya + + Fix MacOS legacy font support by Masatake Yamato on Mac OS X. It is + not working since 2.3.5. In FT_Open_New(), if FT_New_Stream() + cannot mmap() the specified file and cannot seek to head of the + specified file, it returns NULL stream and FT_Open_New() returns the + error immediately. On MacOS, most legacy MacOS fonts fall into such + a scenario because their data forks are zero-sized and cannot be + sought. To proceed to guessing of resource fork fonts, the + functions for legacy MacOS font must properly handle the NULL stream + returned by FT_New_Stream(). + + * src/base/ftobjs.c (IsMacBinary): Return error + FT_Err_Invalid_Stream_Operation immediately when NULL stream is + passed. + (FT_Open_Face): Even when FT_New_Stream() returns an error, proceed + to fallback. Originally, legacy MacOS font is tested in the cases + of FT_Err_Invalid_Stream_Operation (occurs when data fork is empty) + or FT_Err_Unknown_File_Format (occurs when AppleSingle header or + .dfont header is combined). Now the case of + FT_Err_Cannot_Open_Stream is included. + + * src/base/ftrfork.c (FT_Raccess_Guess): When passed stream is NULL, + skip FT_Stream_Seek(), which seeks to the head of stream, and + proceed to unit testing of raccess_guess_XXX(). FT_Stream_Seek() + for a NULL stream causes a Bus error on Mac OS X. + (raccess_guess_apple_double): Return FT_Err_Cannot_Open_Stream + immediately if passed stream is NULL. + (raccess_guess_apple_single): Ditto. + +2007-11-16 suzuki toshiya + + Fix for Carbon incompatibilities since Mac OS X 10.5, + proposed by Sean McBride. + + * doc/INSTALL.MAC: Comment on MACOSX_DEPLOYMENT_TARGET. + + * include/freetype/ftmac.h: Deprecate FT_New_Face_From_FOND and + FT_GetFilePath_From_Mac_ATS_Name. Since Mac OS X 10.5, calling + Carbon functions from a forked process is classified as unsafe + by Apple. All Carbon-dependent functions should be deprecated. + + * src/base/ftmac.c: Use essential header files + and + instead of + all-in-one header file . + + Include and replace HFS_MAXPATHLEN by Apple + genuine macro PATH_MAX. + + Add fallback macro for kATSOptionFlagsUnRestrictedScope which + is not found in Mac OS X 10.0. + + Multi-character constants ('POST', 'sfnt' etc) are replaced by + 64bit constants calculated by FT_MAKE_TAG() macro. + + For the index in the segment of resource fork, new portable + type ResourceIndex is introduced for better compatibility. + This type is since Mac OS X 10.5, so it is defined as short + when built on older platforms. + + (FT_ATSFontGetFileReference): If build target is only the systems + 10.5 and newer, it calls Apple genuine ATSFontGetFileReference(). + + (FT_GetFile_From_Mac_ATS_Name): Return an error if system is 10.5 + and newer or 64bit platform, because legacy type FSSpec type is + removed completely. + + (FT_New_Face_From_FSSpec): Ditto. + +2007-11-01 Werner Lemberg + + * src/sfnt/sfobjs.c (sfnt_done_face): Check `sfnt' everywhere. This + fixes Savannah bug #21485. + +2007-10-29 Daniel Svoboda + + * src/winfonts/winfnt.c (FNT_Face_Init): Check first that the driver + can handle the font at all, then check `face_index'. Otherwise, the + driver might return the wrong error code. This fixes Savannah bug + #21468. + +2007-10-21 Werner Lemberg + + * src/sfnt/sfobjs.c (sfnt_load_face): Support bit 9 and prepare + support for bit 8 of the `fsSelection' field in the `OS/2' table. + MS is already using this; hopefully, this becomes part of OpenType + 1.5. + Prepare also support for `name' IDs 21 (WWS_FAMILY) and 22 + (WWS_SUBFAMILY). + +2007-10-20 Werner Lemberg + + * src/tools/docmaker/tohtml.py (html_header_2): Fix typo. + Add `td.left' element to CSS. + (toc_section_enter): Use it. + +2007-10-18 David Turner + + * include/freetype/freetype.h, src/base/ftobjs.c: Rename API + functions related to cmap type 14 support to the + `FT_Object_ActionName' scheme: + + FT_Get_Char_Variant_index -> FT_Face_GetCharVariantIndex + FT_Get_Char_Variant_IsDefault -> FT_Face_GetCharVariantIsDefault + FT_Get_Variant_Selectors -> FT_Face_GetVariantSelectors + FT_Get_Variants_Of_Char -> FT_Face_GetVariantsOfChar + FT_Get_Chars_Of_Variant -> FT_Face_GetCharsOfVariant + + Update documentation accordingly. + + * src/sfnt/ttcmap.c: Stronger cmap 14 validation. + Make the code a little more consistent with FreeType coding + conventions and modify the cmap14 functions that returned a newly + allocated array to use a persistent vector from the TT_CMap14 object + instead. + + (TT_CMap14Rec): Provide array and auxiliary data for result. + (tt_cmap14_done, tt_cmap14_ensure): New functions. + + (tt_cmap14_init, tt_cmap14_validate, tt_cmap14_char_map_def_binary, + tt_cmap14_char_map_nondef_binary, tt_cmap14_find_variant, + tt_cmap14_char_var_index, tt_cmap14_variants, + tt_cmap14_char_variants, tt_cmap14_def_char_count, + tt_cmap14_get_def_chars, tt_cmap14_get_nondef_chars, + tt_cmap14_variant_chars, tt_cmap14_class_rec): Updated and improved. + +2007-10-15 George Williams + + Add support for cmap type 14. + + * devel/ftoption.h, include/freetype/config/ftoption.h + (TT_CONFIG_CMAP_FORMAT_14): New macro. + + * include/freetype/internal/ftobjs.h (FT_CMap_CharVarIndexFunc, + FT_CMap_CharVarIsDefaultFunc, FT_CMap_VariantListFunc, + FT_CMap_CharVariantListFunc, FT_CMap_VariantCharListFunc): New + support function prototypes. + (FT_CMap_ClassRec): Add them. + Update all users. + + * include/freetype/ttnameid.h (TT_APPLE_ID_VARIANT_SELECTOR): New + macro. + + * include/freetype/freetype.h (FT_Get_Char_Variant_Index, + FT_Get_Char_Variant_IsDefault, FT_Get_Variant_Selectors, + FT_Get_Variants_Of_Char, FT_Get_Chars_Of_Variant): New API + functions. + + * src/base/ftobjs.c (find_variant_selector_charmap): New auxiliary + function. + (FT_Set_Charmap): Disallow cmaps of type 14. + (FT_Get_Char_Variant_Index, FT_Get_Char_Variant_IsDefault, + FT_Get_Variant_Selectors, FT_Get_Variants_Of_Char, + FT_Get_Chars_Of_Variant): New API functions. + + * src/sfnt/ttcmap.c (TT_PEEK_UINT24, TT_NEXT_UINT24): New macros. + + (TT_CMap14Rec, tt_cmap14_init, tt_cmap14_validate, + tt_cmap14_char_index, tt_cmap14_char_next, tt_cmap14_get_info, + tt_cmap14_char_map_def_binary, tt_cmap14_char_map_nondef_binary, + tt_cmap14_find_variant, tt_cmap14_char_var_index, + tt_cmap14_char_var_isdefault, tt_cmap14_variants, + tt_cmap14_char_variants, tt_cmap14_def_char_count, + tt_cmap14_get_def_chars, tt_cmap14_get_nondef_chars, + tt_cmap14_variant_chars, tt_cmap14_class_rec): New functions and + structures for cmap 14 support. + (tt_cmap_classes): Register tt_cmap14_class_rec. + (tt_face_build_cmaps): One more error message. + + * docs/CHANGES: Mention cmap 14 support. + +2007-10-01 Werner Lemberg + + * src/base/ftobjs.c (find_unicode_charmap): If search for a UCS-4 + charmap fails, do the loop again while searching a UCS-2 charmap. + This favours MS charmaps over Apple ones. + +2007-08-29 suzuki toshiya + + * src/base/ftmac.c: Introduction of abstract `short' data types, + ResFileRefNum and ResID. These types were introduced for Copland, + then backported to MPW. The variables exchanged with FileManager + QuickDraw frameworks are redefined by these data types. Patch was + proposed by Sean McBride. + * builds/mac/ftmac.c: Ditto. + +2007-08-18 Werner Lemberg + + * src/otvalid/otvcmmn.c (otv_x_y_ux_sy): Skip context glyphs. Found + by Imran Yousaf. Fixes Savannah bug #20773. + + (otv_Lookup_validate): Correct handling of LookupType. Found by + Imran Yousaf. Fixes Savannah bug #20782. + +2007-08-17 George Williams + + * src/otvalid/otvgsub.c (otv_SingleSubst_validate): Fix handling of + SingleSubstFormat1. + +2007-08-11 suzuki toshiya + + * builds/unix/configure.raw: Fix a bug which sets CC_BUILD by + ${build-gcc} (unchecked) instead of by ${build}-gcc (checked). + Found by Ryan Hill. + +2007-08-11 George Williams + + * src/otvalid/otvcommn.c, src/otvalid/otvcommn.h + (otv_Coverage_validate): Add fourth argument to pass an expected + count value. Update all users. + Check glyph IDs. + (otv_ClassDef_validate): Check `StartGlyph'. + + * src/otvalid/otvgsub.c (otv_SingleSubst_validate): More glyph ID + checks. + + * src/otvalid/otvmath.c (otv_MathConstants_validate): There are only + 56 constants. + (otv_GlyphAssembly_validate, otv_MathGlyphConstruction_validate): + Check glyph IDs. + +2007-08-08 Werner Lemberg + + * src/otvalid/otvbase.c, src/otvalid/otvcommn.c, + src/otvalid/otvgdef.c, src/otvalid/otvgpos.c, src/otvalid/otvgsub.c, + src/otvalid/otvjstf.c: s/FT_INVALID_DATA/FT_INVALID_FORMAT/ where + appropriate. Reported by George. + + * include/freetype/internal/fttrace.h: Define `trace_otvmath'. + + * src/otvalid/rules.mk (OTV_DRV_SRC): Add otvmath.c. + + * docs/CHANGES: Updated. + +2007-08-08 George Williams + + Add `MATH' validating support to otvalid module. + + * include/freetype/tttags.h (TTAG_MATH): New macro. + * include/freetype/ftotval.h (FT_VALIDATE_MATH): New macro. + (FT_VALIDATE_OT): Updated. + + * src/otvalid/otmath.c: New file. + + * src/otvalid/otvalid.c: Include otvmath.c. + * src/otvalid/otvmod.c (otv_validate): Handle `MATH' table. + +2007-08-04 Werner Lemberg + + * builds/unix/configure.raw: Add call to AC_LIBTOOL_WIN32_DLL. + Fixes Savannah bug #20686. + +2007-08-03 Werner Lemberg + + * src/psnames/psmodule.c: Fix usage of + FT_CONFIG_OPTION_POSTSCRIPT_NAMES macro. Reported by Graham Asher. + +2007-07-31 suzuki toshiya + + * src/base/ftmac.c (open_face_from_buffer): The argument + `driver_name' is typed as `const char*' to match with the + callers in FT_New_Face_From_LWFN and FT_New_Face_From_SFNT. + This is same with open_face_from_buffer in src/base/ftobjs.c. + Found and fixed by Sean McBride. + +2007-07-28 Werner Lemberg + + * src/raster/ftraster.c (count_table): Make it conditional. + * src/base/ftobjs.c (FT_New_Library): Check FT_RENDER_POOL_SIZE with + a preprocessor statement. + +2007-07-27 Werner Lemberg + + * src/base/ftoutln.c (FT_Outline_Translate): Check `outline' before + first usage. From Savannah patch #6115. + +2007-07-16 Werner Lemberg + + * docs/CHANGES: Updated. + +2007-07-16 Derek Clegg + + Add new service for getting the ROS from a CID font. + + * include/freetype/config/ftheader.h (FT_CID_H): New macro. + * include/freetype/ftcid.h: New file. + + * include/freetype/internal/ftserv.h (FT_SERVIVE_CID_H): New macro. + * include/freetype/internal/services/svcid.h: New file. + + * src/base/ftcid.c: New file. + + * src/cff/cffdrivr.c: Include FT_SERVICE_CID_H. + (cff_get_ros): New function. + (cff_service_cid_info): New service structure. + (cff_services): Register it. + + * src/cff/cffload.c (cff_font_done): Free registry and ordering. + + * src/cff/cfftypes.h (CFF_FontRec): Add `registry' and `ordering'. + + * modules.cfg (BASE_EXTENSIONS): Add ftcid.c. + +2007-07-11 Derek Clegg + + Add support for postscript name service to CFF driver. + + * src/cff/cffdrivr.c: Include FT_SERVICE_POSTSCRIPT_NAME_H. + (cff_get_ps_name): New function. + (cff_service_ps_name): New service structure. + (cff_services): Register it. + +2007-07-07 Werner Lemberg + + * src/base/ftglyph.c (FT_Glyph_Copy): Fix initialization of + `target'. Reported by Sean McBride. + +2007-07-06 Werner Lemberg + + * src/pfr/pfrcmap.c: Include pfrerror.h. + + * src/autofit/afindic.c: Add some external declarations to pacify + `make multi' compilation. + + * src/cid/cidgload.c (cid_load_glyph): Pacify compiler. + + * src/cff/cffdrivr.c (cff_ps_get_font_info), src/cff/cffobjs.c + (cff_strcpy), include/freetype/internal/ftmemory.h (FT_MEM_STRDUP), + src/autofit/aflatin.c (af_latin_hints_compute_edges), + src/autofit/afcjk.c (af_cjk_hints_compute_edges), src/sfnt/ttmtx.c + (tt_face_get_metrics), src/base/ftobjs.c (open_face) + [FT_CONFIG_OPTION_INCREMENTAL]: Fix compilation with C++ compiler. + + * docs/release: Mention test compilation targets. + +2007-07-04 Werner Lemberg + + * docs/PROBLEMS: Mention that some PS based fonts can't be + handled correctly by FreeType. + + * src/truetype/ttgload.c (load_truetype_glyph): Always allow a + recursion depth of 1. This was the maximum value in TrueType 1.0, + and some older fonts don't set this field correctly. + + * src/gxvalid/gxvmort1.c + (gxv_mort_subtable_type1_substTable_validate): Fix tracing message. + +2007-07-03 Werner Lemberg + + * src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize + `round' to pacify compiler. + 2007-07-02 Werner Lemberg @@ -564,7 +5601,7 @@ * src/base/ftglyph.c (FT_Glyph_Copy): Always set second argument to zero in case of error. This fixes Savannah bug #19689. -2007-04-25 Boris Letocha +2007-04-25 Boris Letocha * src/truetype/ttobjs.c: Fix a typo that created a speed regression in the TrueType bytecode loader. @@ -1363,7 +6400,7 @@ * src/base/ftmac.c: Specialized for Mac OS X only. * builds/unix/ftconfig.in: Fixed for ppc64 missing Carbon framework. - * builds/unix/configure.raw: Ditto. When explicit switches for + * builds/unix/configure.raw: Ditto. When explicit switches for FSSpec/FSRef/QuickDraw/ATS availability are given to configure, builds/mac/ftmac.c is used instead of default src/base/ftmac.c. @@ -1922,22 +6959,22 @@ Fix miscellaneous compiler warnings. - * freetype2/include/freetype/internal/ftobjs.h: Close comment with - `*/' to avoid `/* in comment' compiler warning. + * include/freetype/internal/ftobjs.h: Close comment with `*/' to + avoid `/* in comment' compiler warning. - * freetype2/src/base/ftdbgmem.c (ft_mem_table_get_source): Turn cast + * src/base/ftdbgmem.c (ft_mem_table_get_source): Turn cast `(FT_UInt32)(void*)' into `(FT_UInt32)(FT_PtrDist)(void*)' since on 64-bit platforms void* is larger than FT_UInt32. - * freetype2/src/base/ftobjs.c (t_validator_error): Cast away + * src/base/ftobjs.c (t_validator_error): Cast away volatileness of argument to ft_longjmp. Spotted by Werner `Putzfrau' Lemberg. - * freetype2/src/bdf/bdflib.c (bdf_load_font): Initialize local + * src/bdf/bdflib.c (bdf_load_font): Initialize local variable `lineno'. - * freetype2/src/gxvalid/gxvmod.c (classic_kern_validate): Mark local - variable `error' as volatile. + * src/gxvalid/gxvmod.c (classic_kern_validate): Mark local variable + `error' as volatile. 2006-08-27 Werner Lemberg @@ -1950,30 +6987,29 @@ about addresses of volatile objects passed as function arguments as non-volatile pointers. - * freetype2/include/freetype/internal/ftvalid.h: Make FT_Validator - typedef a pointer to a volatile object. + * include/freetype/internal/ftvalid.h: Make FT_Validator typedef a + pointer to a volatile object. - * freetype2/src/gxvalid/gxvmod.c (gxv_load_table): Make function - argument `table' a pointer to a volatile object. + * src/gxvalid/gxvmod.c (gxv_load_table): Make function argument + `table' a pointer to a volatile object. - * freetype2/src/otvalid/otvmod.c (otv_load_table): Make function - argument `table' a pointer to a volatile object. + * src/otvalid/otvmod.c (otv_load_table): Make function argument + `table' a pointer to a volatile object. 2006-08-18 Jens Claudius - * freetype2/src/gxvalid/gxvmod.c (GXV_TABLE_DECL): Mark local - variable `_sfnt' as volatile since it must keep its value across - a call to ft_setjmp. + * src/gxvalid/gxvmod.c (GXV_TABLE_DECL): Mark local variable `_sfnt' + as volatile since it must keep its value across a call to ft_setjmp. (gxv_validate): Same for local variables `memory' and `valid'. (classic_kern_validate): Same for local variables `memory', `ckern', and `valid'. - * freetype2/src/otvalid/otvmod.c (otv_validate): Same for function - parameter `face' and local variables `base', `gdef', `gpos', `gsub', - `jstf', and 'valid'. + * src/otvalid/otvmod.c (otv_validate): Same for function parameter + `face' and local variables `base', `gdef', `gpos', `gsub', `jstf', + and 'valid'. - * freetype2/src/sfnt/ttcmap.c (tt_face_build_cmaps): Same for - local variable `cmap'. + * src/sfnt/ttcmap.c (tt_face_build_cmaps): Same for local variable + `cmap'. 2006-08-16 David Turner @@ -1984,7 +7020,7 @@ buggy by design. Always return -1. - Improvements to native TrueType hinting. This is a first try, + Improvements to native TrueType hinting. This is a first try, controlled by the FIX_BYTECODE macro in src/truetype/ttinterp.c. * include/freetype/internal/ftgloadr.h (FT_GlyphLoadRec): Add member @@ -2030,45 +7066,44 @@ `ft_validator_run' wrapping `setjmp' can cause a crash, as found by Jens: - http://lists.nongnu.org/archive/html/freetype-devel/2006-08/msg00004.htm. + http://lists.gnu.org/archive/html/freetype-devel/2006-08/msg00004.htm. - * freetype2/src/otvalid/otvmod.c: Replace `ft_validator_run' by - `ft_setjmp'. It reverts the change introduced on 2005-08-20. + * src/otvalid/otvmod.c: Replace `ft_validator_run' by `ft_setjmp'. + It reverts the change introduced on 2005-08-20. - * freetype2/src/gxvalid/gxvmod.c: Ditto. + * src/gxvalid/gxvmod.c: Ditto. 2006-08-13 Jens Claudius - * freetype2/include/freetype/internal/psaux.h: (T1_TokenType): Add + * finclude/freetype/internal/psaux.h: (T1_TokenType): Add T1_TOKEN_TYPE_KEY. (T1_FieldRec): Add `dict'. (T1_FIELD_DICT_FONTDICT, T1_FIELD_DICT_PRIVATE): New macros. (T1_NEW_XXX, T1_FIELD_XXX): Update to take the dictionary where a PS keyword is expected as an additional argument. - * freetype2/src/cid/cidload.c: (cid_field_records): Adjust - invocations of T1_FIELD_XXX. + * src/cid/cidload.c: (cid_field_records): Adjust invocations of + T1_FIELD_XXX. - * freetype2/src/cid/cidtoken.h: Adjust invocations of T1_FIELD_XXX. + * src/cid/cidtoken.h: Adjust invocations of T1_FIELD_XXX. - * freetype2/src/psaux/psobjs.c: Add macro FT_COMPONENT for tracing. + * src/psaux/psobjs.c: Add macro FT_COMPONENT for tracing. (ps_parser_to_token): Report a PostScript key as T1_TOKEN_TYPE_KEY, not T1_TOKEN_TYPE_ANY. (ps_parser_load_field): Make sure a token that should be a string or name is really a string or name. Avoid memory leak if a keyword has been already encountered and its value is overwritten. - * freetype2/src/type1/t1load.c: (t1_keywords): Adjust invocations of + * src/type1/t1load.c: (t1_keywords): Adjust invocations of T1_FIELD_XXX. (parse_dict): Ignore keywords that occur in the wrong dictionary (e.g., in `Private' instead of `FontDict'). - * freetype2/src/type1/t1tokens.h: Adjust invocations of + * src/type1/t1tokens.h: Adjust invocations of T1_FIELD_XXX. + + * src/type42/t42parse.c: (t42_keywords): Adjust invocations of T1_FIELD_XXX. - * freetype2/src/type42/t42parse.c: (t42_keywords): Adjust - invocations of T1_FIELD_XXX. - 2006-07-18 Jens Claudius Move creation of field `buildchar' of T1_DecoderRec out of @@ -2078,19 +7113,18 @@ Call the finisher for T1_Decoder in `cid_face_compute_max_advance' and `T1_Compute_Max_Advance'. - * freetype2/include/freetype/internal/psaux.h (T1_DecoderRec): - Remove field `face', add `len_buildchar'. + * include/freetype/internal/psaux.h (T1_DecoderRec): Remove field + `face', add `len_buildchar'. - * freetype2/include/freetype/internal/t1types.h (T1_FaceRec): Add - field `buildchar'. + * include/freetype/internal/t1types.h (T1_FaceRec): Add field + `buildchar'. - * freetype2/src/cid/cidgload.c (cid_face_compute_max_advance): Call - finisher for T1_Decoder. + * src/cid/cidgload.c (cid_face_compute_max_advance): Call finisher + for T1_Decoder. (cid_slot_load_glyph): Do not ignore failure when initializing the T1_Decoder. - * freetype2/src/psaux/t1decode.c (t1_decoder_parse_charstrings): - Updated. + * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Updated. (t1_decoder_init): Remove initialization of fields `buildchar' and `len_buildchar'. (t1_decoder_done): Remove deallocation of field `buildchar'. @@ -2102,46 +7136,45 @@ `len_buildchar'; make sure to call finisher for T1_Decoder even in case of error. - * freetype2/src/type1/t1load.c (T1_Open_Face): Allocate new field - `buildchar' of T1_FaceRec. + * src/type1/t1load.c (T1_Open_Face): Allocate new field `buildchar' + of T1_FaceRec. - * freetype2/src/type1/t1objs.c (T1_Face_Done): Free new field - `buildchar' of T1_FaceRec. + * src/type1/t1objs.c (T1_Face_Done): Free new field `buildchar' of + T1_FaceRec. 2006-07-14 Jens Claudius - * freetype2/include/freetype/internal/psaux.h: New macros - IS_PS_NEWLINE, IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, - IS_PS_XDIGIT, and IS_PS_BASE85 (from freetype2/src/psaux/psconv.h). + * include/freetype/internal/psaux.h: New macros IS_PS_NEWLINE, + IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT, + and IS_PS_BASE85 (from src/psaux/psconv.h). (T1_FieldLocation): Add T1_FIELD_LOCATION_LOADER, T1_FIELD_LOCATION_FACE, and T1_FIELD_LOCATION_BLEND. (T1_DecoderRec): New fields `buildchar' and `face'. (IS_PS_TOKEN): New macro. - * freetype2/include/freetype/internal/t1types.h (T1_FaceRec): New - fields `ndv_idx', `cdv_idx', and `len_buildchar'. + * include/freetype/internal/t1types.h (T1_FaceRec): New fields + `ndv_idx', `cdv_idx', and `len_buildchar'. - * freetype2/include/freetype/t1tables.h (PS_BlendRec): New fields + * include/freetype/t1tables.h (PS_BlendRec): New fields `default_design_vector' and `num_default_design_vector'. - * freetype2/src/psaux/psconv.h: Move macros IS_PS_NEWLINE, - IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT, - and IS_PS_BASE85 to freetype2/include/freetype/internal/psaux.h. + * src/psaux/psconv.h: Move macros IS_PS_NEWLINE, IS_PS_SPACE, + IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT, and + IS_PS_BASE85 to include/freetype/internal/psaux.h. - * freetype2/src/psaux/psobjs.c (ps_parser_to_token_array): Allow - `token' argument to be NULL if we want only to count the number of - tokens. + * src/psaux/psobjs.c (ps_parser_to_token_array): Allow `token' + argument to be NULL if we want only to count the number of tokens. (ps_tocoordarray): Allow `coords' argument to be NULL if we just want to skip the array. (ps_tofixedarray): Allow `values' argument to be NULL if we just want to skip the array. - * freetype2/src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add - support for (partially commented out) othersubrs 19-25, 27, and 28. + * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add support + for (partially commented out) othersubrs 19-25, 27, and 28. (t1_decoder_init): Initialize new fields `face' and `buildchar'. (t1_decoder_done): Release new field `buildchar'. - * freetype2/src/type1/t1load.c (parse_buildchar, parse_private): New + * src/type1/t1load.c (parse_buildchar, parse_private): New functions. (t1_keywords): Register them. (t1_allocate_blend): Updated. @@ -2156,12 +7189,12 @@ `len_buildchar'. Remove `keywords_flags'. - * freetype2/src/type1/t1load.h (T1_LoaderRect): New field + * src/type1/t1load.h (T1_LoaderRect): New field `keywords_encountered'. (T1_PRIVATE, T1_FONTDIR_AFTER_PRIVATE): New macros. - * freetype2/src/type1/t1tokens.h [!T1_CONFIG_OPTION_NO_MM_SUPPORT]: - New entries for parsing /NDV, /CDV, and /DesignVector. + * src/type1/t1tokens.h [!T1_CONFIG_OPTION_NO_MM_SUPPORT]: New + entries for parsing /NDV, /CDV, and /DesignVector. 2006-07-07 Werner Lemberg @@ -2230,7 +7263,7 @@ 2006-06-24 Eugeniy Meshcheryakov Fix two hinting bugs as reported in - http://lists.nongnu.org/archive/html/freetype-devel/2006-06/msg00057.html. + http://lists.gnu.org/archive/html/freetype-devel/2006-06/msg00057.html. * include/freetype/internal/tttypes.h (TT_GlyphZoneRec): Add `first_point' member. @@ -2441,7 +7474,7 @@ ---------------------------------------------------------------------------- -Copyright 2006, 2007 by +Copyright 2006, 2007, 2008, 2009 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, modified, Index: ChangeLog.21 =================================================================== --- ChangeLog.21 (revision 44270) +++ ChangeLog.21 (working copy) @@ -922,7 +922,7 @@ (tt_driver_class): Updated. * src/truetype/ttgload.c (TT_Get_Metrics): Renamed to... - (tt_face_get_metrics): This. Provide version for FT_OPTIMIZE_MEMORY. + (tt_face_get_metrics): This. Provide version for FT_OPTIMIZE_MEMORY. Update all callers. (Get_Advance_Widths): Replaced with... (Get_Advance_WidthPtr): This. Provide version for @@ -1221,7 +1221,7 @@ 2004-11-16 Owen Taylor * builds/unix/freetype-config.in: Suppress -L$libdir for - /usr/lib64 as well as /usr/lib. (Reported by Dan Winship - + /usr/lib64 as well as /usr/lib. (Reported by Dan Winship - https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=139199) 2004-11-11 Werner Lemberg @@ -3554,7 +3554,7 @@ - the image and sbit cache are now abstract classes, that can be extended much more easily by client applications - - better performance in certain areas. Further optimizations + - better performance in certain areas. Further optimizations to come shortly anyway... - the FTC_CMapCache_Lookup function has changed its signature, @@ -9423,7 +9423,7 @@ ---------------------------------------------------------------------------- -Copyright 2002, 2003, 2004, 2005, 2007 by +Copyright 2002, 2003, 2004, 2005, 2007, 2008 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, modified, Index: ChangeLog.22 =================================================================== --- ChangeLog.22 (revision 44270) +++ ChangeLog.22 (working copy) @@ -199,7 +199,7 @@ * src/base/ftmac.c (read_lwfn): Catch integer overflow. * src/base/ftrfork.c (raccess_guess_darwin_hfsplus): Ditto. * src/base/ftutil.c: Remove special code for FT_STRICT_ALIASING. - (ft_mem_alloc. ft_mem_realloc, ft_mem_qrealloc): Rewrite. + (ft_mem_alloc, ft_mem_realloc, ft_mem_qrealloc): Rewrite. * include/freetype/ftstream.h (FT_FRAME_ENTER, FT_FRAME_EXIT, @@ -2301,7 +2301,7 @@ 2005-09-19 David Somers - * freetype2/src/sfnt/ttload.c (sfnt_dir_check): Modified to allow a + * src/sfnt/ttload.c (sfnt_dir_check): Modified to allow a font to have no `head' table if tables `SING' and `META' are present; this is to support `SING Glyphlet'. @@ -2320,9 +2320,9 @@ http://www.adobe.com/products/indesign/sing_gaiji.html - * freetype2/include/freetype/ttags.h (TTAG_SING, TTAG_META): New - macros for the OpenType tables `SING' and `META'. These two tables - are used in SING Glyphlet Format fonts. + * include/freetype/ttags.h (TTAG_SING, TTAG_META): New macros for + the OpenType tables `SING' and `META'. These two tables are used in + SING Glyphlet Format fonts. 2005-09-09 Werner Lemberg @@ -2808,7 +2808,7 @@ . loader->pp3.y and loader->pp4.y are in 26.6 format, not in font units. . As we use the glyph's cbox to calculate the top bearing now - there iss no need to adjust `top'. + there is no need to adjust `top'. 2005-06-15 Werner Lemberg @@ -2821,7 +2821,7 @@ ---------------------------------------------------------------------------- -Copyright 2005, 2006, 2007 by +Copyright 2005, 2006, 2007, 2008 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, modified, Index: configure =================================================================== --- configure (revision 44270) +++ configure (working copy) @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright 2002, 2003, 2004, 2005, 2006 by +# Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -21,7 +21,7 @@ if test -z "`$GNUMAKE -v 2>/dev/null | grep GNU`"; then if test -z "`$GNUMAKE -v 2>/dev/null | grep makepp`"; then - echo "GNU make (>= 3.79.1) or makepp (>= 1.19) is required to build FreeType2." >&2 + echo "GNU make (>= 3.80) or makepp (>= 1.19) is required to build FreeType2." >&2 echo "Please try" >&2 echo " \`GNUMAKE= $0'." >&2 echo "or >&2" @@ -67,12 +67,25 @@ abs_curr_dir=`pwd` abs_ft2_dir=`cd "$ft2_dir" && pwd` +# `--srcdir=' option can override abs_ft2_dir + +if test $# -gt 0; then + for x in "$@"; do + case x"$x" in + x--srcdir=*) + abs_ft2_dir=`echo $x | sed 's/^--srcdir=//'` ;; + esac + done +fi + # build a dummy Makefile if we are not building in the source tree if test "$abs_curr_dir" != "$abs_ft2_dir"; then mkdir reference - echo "Copying \`modules.cfg'" - cp $abs_ft2_dir/modules.cfg $abs_curr_dir + if test ! -r $abs_curr_dir/modules.cfg; then + echo "Copying \`modules.cfg'" + cp $abs_ft2_dir/modules.cfg $abs_curr_dir + fi echo "Generating \`Makefile'" echo "TOP_DIR := $abs_ft2_dir" > Makefile echo "OBJ_DIR := $abs_curr_dir" >> Makefile @@ -92,9 +105,16 @@ # call make CFG= -for x in ${1+"$@"}; do - CFG="$CFG \"$x\"" -done +# work around zsh bug which doesn't like `${1+"$@"}' +case $# in +0) ;; +*) for x in "$@"; do + case x"$x" in + x--srcdir=* ) CFG="$CFG '$x'/builds/unix" ;; + *) CFG="$CFG '$x'" ;; + esac + done ;; +esac CFG=$CFG $GNUMAKE setup unix # eof Index: devel/ftoption.h =================================================================== --- devel/ftoption.h (revision 44270) +++ devel/ftoption.h (working copy) @@ -4,7 +4,7 @@ /* */ /* User-selectable configuration macros (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -112,11 +112,32 @@ /* file `ftconfig.h' either statically or through the */ /* `configure' script on supported platforms. */ /* */ -#undef FT_CONFIG_OPTION_FORCE_INT64 +#undef FT_CONFIG_OPTION_FORCE_INT64 /*************************************************************************/ /* */ + /* If this macro is defined, do not try to use an assembler version of */ + /* performance-critical functions (e.g. FT_MulFix). You should only do */ + /* that to verify that the assembler function works properly, or to */ + /* execute benchmark tests of the various implementations. */ +/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */ + + + /*************************************************************************/ + /* */ + /* If this macro is defined, try to use an inlined assembler version of */ + /* the `FT_MulFix' function, which is a `hotspot' when loading and */ + /* hinting glyphs, and which should be executed as fast as possible. */ + /* */ + /* Note that if your compiler or CPU is not supported, this will default */ + /* to the standard and portable implementation found in `ftcalc.c'. */ + /* */ +#define FT_CONFIG_OPTION_INLINE_MULFIX + + + /*************************************************************************/ + /* */ /* LZW-compressed file support. */ /* */ /* FreeType now handles font files that have been compressed with the */ @@ -163,7 +184,7 @@ /* Do not #undef this macro here since the build system might define */ /* it for certain configurations only. */ /* */ -/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ +/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ /*************************************************************************/ @@ -204,27 +225,27 @@ /* Do not #undef these macros here since the build system might define */ /* them for certain configurations only. */ /* */ -/* #define FT_EXPORT(x) extern x */ -/* #define FT_EXPORT_DEF(x) x */ +/* #define FT_EXPORT(x) extern x */ +/* #define FT_EXPORT_DEF(x) x */ /*************************************************************************/ /* */ /* Glyph Postscript Names handling */ /* */ - /* By default, FreeType 2 is compiled with the `PSNames' module. This */ + /* By default, FreeType 2 is compiled with the `psnames' module. This */ /* module is in charge of converting a glyph name string into a */ /* Unicode value, or return a Macintosh standard glyph name for the */ /* use with the TrueType `post' table. */ /* */ - /* Undefine this macro if you do not want `PSNames' compiled in your */ + /* Undefine this macro if you do not want `psnames' compiled in your */ /* build of FreeType. This has the following effects: */ /* */ /* - The TrueType driver will provide its own set of glyph names, */ /* if you build it to support postscript names in the TrueType */ /* `post' table. */ /* */ - /* - The Type 1 driver will not be able to synthetize a Unicode */ + /* - The Type 1 driver will not be able to synthesize a Unicode */ /* charmap out of the glyphs found in the fonts. */ /* */ /* You would normally undefine this configuration macro when building */ @@ -240,12 +261,12 @@ /* By default, FreeType 2 is built with the `PSNames' module compiled */ /* in. Among other things, the module is used to convert a glyph name */ /* into a Unicode value. This is especially useful in order to */ - /* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */ + /* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */ /* through a big table named the `Adobe Glyph List' (AGL). */ /* */ /* Undefine this macro if you do not want the Adobe Glyph List */ /* compiled in your `PSNames' module. The Type 1 driver will not be */ - /* able to synthetize a Unicode charmap out of the glyphs found in the */ + /* able to synthesize a Unicode charmap out of the glyphs found in the */ /* fonts. */ /* */ #define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST @@ -294,7 +315,7 @@ /* This allows FreeType to be used with the PostScript language, using */ /* the GhostScript interpreter. */ /* */ -/* #define FT_CONFIG_OPTION_INCREMENTAL */ +#define FT_CONFIG_OPTION_INCREMENTAL /*************************************************************************/ @@ -418,7 +439,7 @@ /* does not contain any glyph name though. */ /* */ /* Accessing SFNT names is done through the functions declared in */ - /* `freetype/ftnames.h'. */ + /* `freetype/ftsnames.h'. */ /* */ #define TT_CONFIG_OPTION_SFNT_NAMES @@ -436,6 +457,8 @@ #define TT_CONFIG_CMAP_FORMAT_8 #define TT_CONFIG_CMAP_FORMAT_10 #define TT_CONFIG_CMAP_FORMAT_12 +#define TT_CONFIG_CMAP_FORMAT_13 +#define TT_CONFIG_CMAP_FORMAT_14 /*************************************************************************/ @@ -466,9 +489,9 @@ /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */ /* of the TrueType bytecode interpreter is used that doesn't implement */ /* any of the patented opcodes and algorithms. Note that the */ - /* the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you */ - /* define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; with other words, */ - /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ + /* TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you define */ + /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, either define */ + /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */ /* */ /* This macro is only useful for a small number of font files (mostly */ @@ -624,11 +647,11 @@ /*************************************************************************/ /* */ - /* Compile autofit module with CJK script support. */ + /* Compile autofit module with CJK (Chinese, Japanese, Korean) script */ + /* support. */ /* */ #define AF_CONFIG_OPTION_CJK - /*************************************************************************/ /* */ /* Compile autofit module with Indic script support. */ @@ -648,15 +671,16 @@ * is recommended to disable the macro since it reduces the library's code * size and activates a few memory-saving optimizations as well. */ -#undef FT_CONFIG_OPTION_OLD_INTERNALS +/* #define FT_CONFIG_OPTION_OLD_INTERNALS */ /* - * This variable is defined if either unpatented or native TrueType + * This macro is defined if either unpatented or native TrueType * hinting is requested by the definitions above. */ #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER #define TT_USE_BYTECODE_INTERPRETER +#undef TT_CONFIG_OPTION_UNPATENTED_HINTING #elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING #define TT_USE_BYTECODE_INTERPRETER #endif Index: freetype.def =================================================================== --- freetype.def (revision 44270) +++ freetype.def (working copy) @@ -40,13 +40,19 @@ FT_Face_CheckTrueTypePatents FT_Face_SetUnpatentedHinting FT_FloorFix + FT_Get_Advance + FT_Get_Advances FT_Get_BDF_Charset_ID FT_Get_BDF_Property FT_Get_CMap_Format FT_Get_CMap_Language_ID FT_Get_Char_Index FT_Get_Charmap_Index + FT_Get_CID_From_Glyph_Index + FT_Get_CID_Is_Internally_CID_keyed + FT_Get_CID_Registry_Ordering_Supplement FT_Get_First_Char + FT_Get_FSType_Flags FT_Get_Glyph FT_Get_Glyph_Name FT_Get_Kerning Index: freetype.rbuild =================================================================== --- freetype.rbuild (revision 44270) +++ freetype.rbuild (working copy) @@ -17,23 +17,26 @@ - ftsystem.c - ftinit.c - ftdebug.c - _ftbase_ros.c + ftbase.c ftbbox.c - ftglyph.c ftbdf.c ftbitmap.c + ftdebug.c + ftgasp.c + ftglyph.c ftgxval.c + ftinit.c + ftlcdfil.c ftmm.c ftotval.c ftpatent.c ftpfr.c ftstroke.c ftsynth.c + ftsystem.c fttype1.c ftwinfnt.c + ftxf86.c autofit.c Index: include/freetype/config/ftconfig.h =================================================================== --- include/freetype/config/ftconfig.h (revision 44270) +++ include/freetype/config/ftconfig.h (working copy) @@ -4,7 +4,7 @@ /* */ /* ANSI-specific configuration file (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -43,6 +43,7 @@ #include FT_CONFIG_OPTIONS_H #include FT_CONFIG_STANDARD_LIBRARY_H + FT_BEGIN_HEADER @@ -134,18 +135,78 @@ #else #define FT_MACINTOSH 1 #endif + +#elif defined( __SC__ ) || defined( __MRC__ ) + /* Classic MacOS compilers */ +#include "ConditionalMacros.h" +#if TARGET_OS_MAC +#define FT_MACINTOSH 1 #endif +#endif + /*************************************************************************/ /* */ - /* IntN types */ + /*
*/ + /* basic_types */ /* */ - /* Used to guarantee the size of some specific integers. */ + /*************************************************************************/ + + + /*************************************************************************/ /* */ - typedef signed short FT_Int16; + /* */ + /* FT_Int16 */ + /* */ + /* */ + /* A typedef for a 16bit signed integer type. */ + /* */ + typedef signed short FT_Int16; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_UInt16 */ + /* */ + /* */ + /* A typedef for a 16bit unsigned integer type. */ + /* */ typedef unsigned short FT_UInt16; + /* */ + + + /* this #if 0 ... #endif clause is for documentation purposes */ +#if 0 + + /*************************************************************************/ + /* */ + /* */ + /* FT_Int32 */ + /* */ + /* */ + /* A typedef for a 32bit signed integer type. The size depends on */ + /* the configuration. */ + /* */ + typedef signed XXX FT_Int32; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_UInt32 */ + /* */ + /* A typedef for a 32bit unsigned integer type. The size depends on */ + /* the configuration. */ + /* */ + typedef unsigned XXX FT_UInt32; + + /* */ + +#endif + #if FT_SIZEOF_INT == (32 / FT_CHAR_BIT) typedef signed int FT_Int32; @@ -160,6 +221,7 @@ #error "no 32bit type found -- please check your configuration files" #endif + /* look up an integer type that is at least 32 bits */ #if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT) @@ -215,17 +277,12 @@ #endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */ -#define FT_BEGIN_STMNT do { -#define FT_END_STMNT } while ( 0 ) -#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT - - /*************************************************************************/ /* */ /* A 64-bit data type will create compilation problems if you compile */ - /* in strict ANSI mode. To avoid them, we disable their use if */ - /* __STDC__ is defined. You can however ignore this rule by */ - /* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ + /* in strict ANSI mode. To avoid them, we disable its use if __STDC__ */ + /* is defined. You can however ignore this rule by defining the */ + /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ /* */ #if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 ) @@ -240,6 +297,86 @@ #endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */ +#define FT_BEGIN_STMNT do { +#define FT_END_STMNT } while ( 0 ) +#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT + + +#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER + /* Provide assembler fragments for performance-critical functions. */ + /* These must be defined `static __inline__' with GCC. */ + +#ifdef __GNUC__ + +#if defined( __arm__ ) && !defined( __thumb__ ) +#define FT_MULFIX_ASSEMBLER FT_MulFix_arm + + /* documentation is in freetype.h */ + + static __inline__ FT_Int32 + FT_MulFix_arm( FT_Int32 a, + FT_Int32 b ) + { + register FT_Int32 t, t2; + + + asm __volatile__ ( + "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ + "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */ + "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ + "adds %1, %1, %0\n\t" /* %1 += %0 */ + "adc %2, %2, #0\n\t" /* %2 += carry */ + "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */ + "orr %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */ + : "=r"(a), "=&r"(t2), "=&r"(t) + : "r"(a), "r"(b) ); + return a; + } + +#endif /* __arm__ && !__thumb__ */ + +#if defined( i386 ) +#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 + + /* documentation is in freetype.h */ + + static __inline__ FT_Int32 + FT_MulFix_i386( FT_Int32 a, + FT_Int32 b ) + { + register FT_Int32 result; + + + __asm__ __volatile__ ( + "imul %%edx\n" + "movl %%edx, %%ecx\n" + "sarl $31, %%ecx\n" + "addl $0x8000, %%ecx\n" + "addl %%ecx, %%eax\n" + "adcl $0, %%edx\n" + "shrl $16, %%eax\n" + "shll $16, %%edx\n" + "addl %%edx, %%eax\n" + : "=a"(result), "=d"(b) + : "a"(a), "d"(b) + : "%ecx", "cc" ); + return result; + } + +#endif /* i386 */ + +#endif /* __GNUC__ */ + +#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ + + +#ifdef FT_CONFIG_OPTION_INLINE_MULFIX +#ifdef FT_MULFIX_ASSEMBLER +#define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER +#endif +#endif + + #ifdef FT_MAKE_OPTION_SINGLE_OBJECT #define FT_LOCAL( x ) static x Index: include/freetype/config/ftheader.h =================================================================== --- include/freetype/config/ftheader.h (revision 44270) +++ include/freetype/config/ftheader.h (working copy) @@ -4,7 +4,7 @@ /* */ /* Build macros of the FreeType 2 library. */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -74,7 +74,7 @@ /* */ /* */ /* The following macros are defined to the name of specific */ - /* FreeType 2 header files. They can be used directly in #include */ + /* FreeType~2 header files. They can be used directly in #include */ /* statements as in: */ /* */ /* { */ @@ -85,11 +85,11 @@ /* */ /* There are several reasons why we are now using macros to name */ /* public header files. The first one is that such macros are not */ - /* limited to the infamous 8.3 naming rule required by DOS (and */ + /* limited to the infamous 8.3~naming rule required by DOS (and */ /* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */ /* */ /* The second reason is that it allows for more flexibility in the */ - /* way FreeType 2 is installed on a given system. */ + /* way FreeType~2 is installed on a given system. */ /* */ /*************************************************************************/ @@ -103,7 +103,7 @@ * * @description: * A macro used in #include statements to name the file containing - * FreeType 2 configuration data. + * FreeType~2 configuration data. * */ #ifndef FT_CONFIG_CONFIG_H @@ -118,7 +118,7 @@ * * @description: * A macro used in #include statements to name the file containing - * FreeType 2 interface to the standard C library functions. + * FreeType~2 interface to the standard C library functions. * */ #ifndef FT_CONFIG_STANDARD_LIBRARY_H @@ -133,7 +133,7 @@ * * @description: * A macro used in #include statements to name the file containing - * FreeType 2 project-specific configuration options. + * FreeType~2 project-specific configuration options. * */ #ifndef FT_CONFIG_OPTIONS_H @@ -148,7 +148,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * list of FreeType 2 modules that are statically linked to new library + * list of FreeType~2 modules that are statically linked to new library * instances in @FT_Init_FreeType. * */ @@ -156,6 +156,7 @@ #define FT_CONFIG_MODULES_H #endif + /* */ /* public headers */ @@ -166,7 +167,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * base FreeType 2 API. + * base FreeType~2 API. * */ #define FT_FREETYPE_H @@ -179,7 +180,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * list of FreeType 2 error codes (and messages). + * list of FreeType~2 error codes (and messages). * * It is included by @FT_FREETYPE_H. * @@ -194,7 +195,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * list of FreeType 2 module error offsets (and messages). + * list of FreeType~2 module error offsets (and messages). * */ #define FT_MODULE_ERRORS_H @@ -207,7 +208,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * FreeType 2 interface to low-level operations (i.e., memory management + * FreeType~2 interface to low-level operations (i.e., memory management * and stream i/o). * * It is included by @FT_FREETYPE_H. @@ -239,7 +240,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * basic data types defined by FreeType 2. + * basic data types defined by FreeType~2. * * It is included by @FT_FREETYPE_H. * @@ -254,7 +255,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * list management API of FreeType 2. + * list management API of FreeType~2. * * (Most applications will never need to include this file.) * @@ -269,7 +270,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * scalable outline management API of FreeType 2. + * scalable outline management API of FreeType~2. * */ #define FT_OUTLINE_H @@ -295,7 +296,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * module management API of FreeType 2. + * module management API of FreeType~2. * */ #define FT_MODULE_H @@ -308,7 +309,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * renderer module management API of FreeType 2. + * renderer module management API of FreeType~2. * */ #define FT_RENDER_H @@ -321,7 +322,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * types and API specific to the Type 1 format. + * types and API specific to the Type~1 format. * */ #define FT_TYPE1_TABLES_H @@ -386,6 +387,20 @@ /************************************************************************* * * @macro: + * FT_CID_H + * + * @description: + * A macro used in #include statements to name the file containing the + * definitions of an API which access CID font information from a + * face. + * + */ +#define FT_CID_H + + + /************************************************************************* + * + * @macro: * FT_GZIP_H * * @description: @@ -468,7 +483,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * API of the optional FreeType 2 cache sub-system. + * API of the optional FreeType~2 cache sub-system. * */ #define FT_CACHE_H @@ -481,7 +496,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * `glyph image' API of the FreeType 2 cache sub-system. + * `glyph image' API of the FreeType~2 cache sub-system. * * It is used to define a cache for @FT_Glyph elements. You can also * use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to @@ -501,7 +516,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * `small bitmaps' API of the FreeType 2 cache sub-system. + * `small bitmaps' API of the FreeType~2 cache sub-system. * * It is used to define a cache for small glyph bitmaps in a relatively * memory-efficient way. You can also use the API defined in @@ -522,7 +537,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * `charmap' API of the FreeType 2 cache sub-system. + * `charmap' API of the FreeType~2 cache sub-system. * * This macro is deprecated. Simply include @FT_CACHE_H to have all * charmap-based cache declarations. @@ -538,7 +553,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * Macintosh-specific FreeType 2 API. The latter is used to access + * Macintosh-specific FreeType~2 API. The latter is used to access * fonts embedded in resource forks. * * This header file must be explicitly included by client applications @@ -555,7 +570,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * optional multiple-masters management API of FreeType 2. + * optional multiple-masters management API of FreeType~2. * */ #define FT_MULTIPLE_MASTERS_H @@ -568,7 +583,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * optional FreeType 2 API which accesses embedded `name' strings in + * optional FreeType~2 API which accesses embedded `name' strings in * SFNT-based font formats (i.e., TrueType and OpenType). * */ @@ -582,7 +597,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * optional FreeType 2 API which validates OpenType tables (BASE, GDEF, + * optional FreeType~2 API which validates OpenType tables (BASE, GDEF, * GPOS, GSUB, JSTF). * */ @@ -596,7 +611,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * optional FreeType 2 API which validates TrueTypeGX/AAT tables (feat, + * optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat, * mort, morx, bsln, just, kern, opbd, trak, prop). * */ @@ -610,7 +625,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * FreeType 2 API which accesses PFR-specific data. + * FreeType~2 API which accesses PFR-specific data. * */ #define FT_PFR_H @@ -623,7 +638,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * FreeType 2 API which provides functions to stroke outline paths. + * FreeType~2 API which provides functions to stroke outline paths. */ #define FT_STROKER_H @@ -635,7 +650,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * FreeType 2 API which performs artificial obliquing and emboldening. + * FreeType~2 API which performs artificial obliquing and emboldening. */ #define FT_SYNTHESIS_H @@ -647,7 +662,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * FreeType 2 API which provides functions specific to the XFree86 and + * FreeType~2 API which provides functions specific to the XFree86 and * X.Org X11 servers. */ #define FT_XFREE86_H @@ -660,7 +675,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * FreeType 2 API which performs trigonometric computations (e.g., + * FreeType~2 API which performs trigonometric computations (e.g., * cosines and arc tangents). */ #define FT_TRIGONOMETRY_H @@ -673,7 +688,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * FreeType 2 API which performs color filtering for subpixel rendering. + * FreeType~2 API which performs color filtering for subpixel rendering. */ #define FT_LCD_FILTER_H @@ -681,15 +696,51 @@ /************************************************************************* * * @macro: + * FT_UNPATENTED_HINTING_H + * + * @description: + * A macro used in #include statements to name the file containing the + * FreeType~2 API which performs color filtering for subpixel rendering. + */ +#define FT_UNPATENTED_HINTING_H + + + /************************************************************************* + * + * @macro: + * FT_INCREMENTAL_H + * + * @description: + * A macro used in #include statements to name the file containing the + * FreeType~2 API which performs color filtering for subpixel rendering. + */ +#define FT_INCREMENTAL_H + + + /************************************************************************* + * + * @macro: * FT_GASP_H * * @description: * A macro used in #include statements to name the file containing the - * FreeType 2 API which returns entries from the TrueType GASP table. + * FreeType~2 API which returns entries from the TrueType GASP table. */ #define FT_GASP_H + /************************************************************************* + * + * @macro: + * FT_ADVANCES_H + * + * @description: + * A macro used in #include statements to name the file containing the + * FreeType~2 API which returns individual and ranged glyph advances. + */ +#define FT_ADVANCES_H + + /* */ #define FT_ERROR_DEFINITIONS_H Index: include/freetype/config/ftmodule.h =================================================================== --- include/freetype/config/ftmodule.h (revision 44270) +++ include/freetype/config/ftmodule.h (working copy) @@ -10,23 +10,23 @@ * */ -FT_USE_MODULE(autofit_module_class) -FT_USE_MODULE(tt_driver_class) -FT_USE_MODULE(t1_driver_class) -FT_USE_MODULE(cff_driver_class) -FT_USE_MODULE(t1cid_driver_class) -FT_USE_MODULE(pfr_driver_class) -FT_USE_MODULE(t42_driver_class) -FT_USE_MODULE(winfnt_driver_class) -FT_USE_MODULE(pcf_driver_class) -FT_USE_MODULE(psaux_module_class) -FT_USE_MODULE(psnames_module_class) -FT_USE_MODULE(pshinter_module_class) -FT_USE_MODULE(ft_raster1_renderer_class) -FT_USE_MODULE(sfnt_module_class) -FT_USE_MODULE(ft_smooth_renderer_class) -FT_USE_MODULE(ft_smooth_lcd_renderer_class) -FT_USE_MODULE(ft_smooth_lcdv_renderer_class) -FT_USE_MODULE(bdf_driver_class) +FT_USE_MODULE( FT_Module_Class, autofit_module_class ) +FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class ) +FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) +FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class ) +FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class ) +FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class ) +FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) +FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) +FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) +FT_USE_MODULE( FT_Module_Class, psaux_module_class ) +FT_USE_MODULE( FT_Module_Class, psnames_module_class ) +FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) +FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) +FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) +FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) +FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class ) +FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class ) +FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) /* EOF */ Index: include/freetype/config/ftoption.h =================================================================== --- include/freetype/config/ftoption.h (revision 44270) +++ include/freetype/config/ftoption.h (working copy) @@ -4,7 +4,7 @@ /* */ /* User-selectable configuration macros (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -112,11 +112,32 @@ /* file `ftconfig.h' either statically or through the */ /* `configure' script on supported platforms. */ /* */ -#undef FT_CONFIG_OPTION_FORCE_INT64 +#undef FT_CONFIG_OPTION_FORCE_INT64 /*************************************************************************/ /* */ + /* If this macro is defined, do not try to use an assembler version of */ + /* performance-critical functions (e.g. FT_MulFix). You should only do */ + /* that to verify that the assembler function works properly, or to */ + /* execute benchmark tests of the various implementations. */ +/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */ + + + /*************************************************************************/ + /* */ + /* If this macro is defined, try to use an inlined assembler version of */ + /* the `FT_MulFix' function, which is a `hotspot' when loading and */ + /* hinting glyphs, and which should be executed as fast as possible. */ + /* */ + /* Note that if your compiler or CPU is not supported, this will default */ + /* to the standard and portable implementation found in `ftcalc.c'. */ + /* */ +#define FT_CONFIG_OPTION_INLINE_MULFIX + + + /*************************************************************************/ + /* */ /* LZW-compressed file support. */ /* */ /* FreeType now handles font files that have been compressed with the */ @@ -163,7 +184,7 @@ /* Do not #undef this macro here since the build system might define */ /* it for certain configurations only. */ /* */ -/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ +/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ /*************************************************************************/ @@ -204,27 +225,27 @@ /* Do not #undef these macros here since the build system might define */ /* them for certain configurations only. */ /* */ -/* #define FT_EXPORT(x) extern x */ -/* #define FT_EXPORT_DEF(x) x */ +/* #define FT_EXPORT(x) extern x */ +/* #define FT_EXPORT_DEF(x) x */ /*************************************************************************/ /* */ /* Glyph Postscript Names handling */ /* */ - /* By default, FreeType 2 is compiled with the `PSNames' module. This */ + /* By default, FreeType 2 is compiled with the `psnames' module. This */ /* module is in charge of converting a glyph name string into a */ /* Unicode value, or return a Macintosh standard glyph name for the */ /* use with the TrueType `post' table. */ /* */ - /* Undefine this macro if you do not want `PSNames' compiled in your */ + /* Undefine this macro if you do not want `psnames' compiled in your */ /* build of FreeType. This has the following effects: */ /* */ /* - The TrueType driver will provide its own set of glyph names, */ /* if you build it to support postscript names in the TrueType */ /* `post' table. */ /* */ - /* - The Type 1 driver will not be able to synthetize a Unicode */ + /* - The Type 1 driver will not be able to synthesize a Unicode */ /* charmap out of the glyphs found in the fonts. */ /* */ /* You would normally undefine this configuration macro when building */ @@ -240,12 +261,12 @@ /* By default, FreeType 2 is built with the `PSNames' module compiled */ /* in. Among other things, the module is used to convert a glyph name */ /* into a Unicode value. This is especially useful in order to */ - /* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */ + /* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */ /* through a big table named the `Adobe Glyph List' (AGL). */ /* */ /* Undefine this macro if you do not want the Adobe Glyph List */ /* compiled in your `PSNames' module. The Type 1 driver will not be */ - /* able to synthetize a Unicode charmap out of the glyphs found in the */ + /* able to synthesize a Unicode charmap out of the glyphs found in the */ /* fonts. */ /* */ #define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST @@ -375,7 +396,21 @@ #undef FT_CONFIG_OPTION_USE_MODULE_ERRORS + /*************************************************************************/ + /* */ + /* Position Independent Code */ + /* */ + /* If this macro is set (which is _not_ the default), FreeType2 will */ + /* avoid creating constants that require address fixups. Instead the */ + /* constants will be moved into a struct and additional intialization */ + /* code will be used. */ + /* */ + /* Setting this macro is needed for systems that prohibit address */ + /* fixups, such as BREW. */ + /* */ +/* #define FT_CONFIG_OPTION_PIC */ + /*************************************************************************/ /*************************************************************************/ /**** ****/ @@ -418,7 +453,7 @@ /* does not contain any glyph name though. */ /* */ /* Accessing SFNT names is done through the functions declared in */ - /* `freetype/ftnames.h'. */ + /* `freetype/ftsnames.h'. */ /* */ #define TT_CONFIG_OPTION_SFNT_NAMES @@ -436,6 +471,8 @@ #define TT_CONFIG_CMAP_FORMAT_8 #define TT_CONFIG_CMAP_FORMAT_10 #define TT_CONFIG_CMAP_FORMAT_12 +#define TT_CONFIG_CMAP_FORMAT_13 +#define TT_CONFIG_CMAP_FORMAT_14 /*************************************************************************/ @@ -466,9 +503,9 @@ /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */ /* of the TrueType bytecode interpreter is used that doesn't implement */ /* any of the patented opcodes and algorithms. Note that the */ - /* the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you */ - /* define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; with other words, */ - /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ + /* TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you define */ + /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, either define */ + /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */ /* */ /* This macro is only useful for a small number of font files (mostly */ @@ -505,7 +542,7 @@ /* ... */ /* } */ /* */ -/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */ +//#define TT_CONFIG_OPTION_UNPATENTED_HINTING /*************************************************************************/ @@ -624,7 +661,8 @@ /*************************************************************************/ /* */ - /* Compile autofit module with CJK script support. */ + /* Compile autofit module with CJK (Chinese, Japanese, Korean) script */ + /* support. */ /* */ #define AF_CONFIG_OPTION_CJK @@ -632,7 +670,7 @@ /* */ /* Compile autofit module with Indic script support. */ /* */ -/* #define AF_CONFIG_OPTION_INDIC */ +#define AF_CONFIG_OPTION_INDIC /* */ @@ -651,11 +689,12 @@ /* - * This variable is defined if either unpatented or native TrueType + * This macro is defined if either unpatented or native TrueType * hinting is requested by the definitions above. */ #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER #define TT_USE_BYTECODE_INTERPRETER +#undef TT_CONFIG_OPTION_UNPATENTED_HINTING #elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING #define TT_USE_BYTECODE_INTERPRETER #endif Index: include/freetype/config/ftstdlib.h =================================================================== --- include/freetype/config/ftstdlib.h (revision 44270) +++ include/freetype/config/ftstdlib.h (working copy) @@ -5,7 +5,7 @@ /* ANSI-specific library and header configuration file (specification */ /* only). */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -54,12 +54,6 @@ /* In these case, `ftconfig.h' will refuse to compile anyway with a */ /* message like `couldn't find 32-bit type' or something similar. */ /* */ - /* IMPORTANT NOTE: We do not define aliases for heap management and */ - /* i/o routines (i.e. malloc/free/fopen/fread/...) */ - /* since these functions should all be encapsulated */ - /* by platform-specific implementations of */ - /* `ftsystem.c'. */ - /* */ /**********************************************************************/ @@ -67,6 +61,7 @@ #define FT_CHAR_BIT CHAR_BIT #define FT_INT_MAX INT_MAX +#define FT_INT_MIN INT_MIN #define FT_UINT_MAX UINT_MAX #define FT_ULONG_MAX ULONG_MAX @@ -124,9 +119,7 @@ #define ft_qsort qsort -#define ft_exit exit /* only used to exit from unhandled exceptions */ - /**********************************************************************/ /* */ /* memory allocation */ Index: include/freetype/freetype.h =================================================================== --- include/freetype/freetype.h (revision 44270) +++ include/freetype/freetype.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType high-level API and common types (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -25,14 +25,6 @@ #endif - /*************************************************************************/ - /* */ - /* The `raster' component duplicates some of the declarations in */ - /* freetype.h for stand-alone use if _FREETYPE_ isn't defined. */ - /* */ - /*************************************************************************/ - - #ifndef __FREETYPE_H__ #define __FREETYPE_H__ @@ -60,8 +52,8 @@ /* */ /* */ /* FreeType assumes that structures allocated by the user and passed */ - /* as arguments are zeroed out except for the actual data. With */ - /* other words, it is recommended to use `calloc' (or variants of it) */ + /* as arguments are zeroed out except for the actual data. In other */ + /* words, it is recommended to use `calloc' (or variants of it) */ /* instead of `malloc' for allocation. */ /* */ /*************************************************************************/ @@ -86,10 +78,10 @@ /* Base Interface */ /* */ /* */ - /* The FreeType 2 base font interface. */ + /* The FreeType~2 base font interface. */ /* */ /* */ - /* This section describes the public high-level API of FreeType 2. */ + /* This section describes the public high-level API of FreeType~2. */ /* */ /* */ /* FT_Library */ @@ -191,6 +183,15 @@ /* FT_Set_Charmap */ /* FT_Get_Charmap_Index */ /* */ + /* FT_FSTYPE_INSTALLABLE_EMBEDDING */ + /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING */ + /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING */ + /* FT_FSTYPE_EDITABLE_EMBEDDING */ + /* FT_FSTYPE_NO_SUBSETTING */ + /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY */ + /* */ + /* FT_Get_FSType_Flags */ + /* */ /*************************************************************************/ @@ -386,8 +387,8 @@ /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */ /* */ /* */ - /* The @FT_FaceRec details the publicly accessible fields of a given */ - /* face object. */ + /* See @FT_FaceRec for the publicly accessible fields of a given face */ + /* object. */ /* */ typedef struct FT_FaceRec_* FT_Face; @@ -416,8 +417,8 @@ /* activated at any given time per face. */ /* */ /* */ - /* The @FT_SizeRec structure details the publicly accessible fields */ - /* of a given size object. */ + /* See @FT_SizeRec for the publicly accessible fields of a given size */ + /* object. */ /* */ typedef struct FT_SizeRec_* FT_Size; @@ -429,7 +430,7 @@ /* */ /* */ /* A handle to a given `glyph slot'. A slot is a container where it */ - /* is possible to load any one of the glyphs contained in its parent */ + /* is possible to load any of the glyphs contained in its parent */ /* face. */ /* */ /* In other words, each time you call @FT_Load_Glyph or */ @@ -438,7 +439,7 @@ /* other control information. */ /* */ /* */ - /* @FT_GlyphSlotRec details the publicly accessible glyph fields. */ + /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */ /* */ typedef struct FT_GlyphSlotRec_* FT_GlyphSlot; @@ -469,8 +470,8 @@ /* the list and automatically activates it. */ /* */ /* */ - /* The @FT_CharMapRec details the publicly accessible fields of a */ - /* given character map. */ + /* See @FT_CharMapRec for the publicly accessible fields of a given */ + /* character map. */ /* */ typedef struct FT_CharMapRec_* FT_CharMap; @@ -485,7 +486,7 @@ /* used to define `encoding' identifiers (see @FT_Encoding). */ /* */ /* */ - /* Since many 16bit compilers don't like 32bit enumerations, you */ + /* Since many 16-bit compilers don't like 32-bit enumerations, you */ /* should redefine this macro in case of problems to something like */ /* this: */ /* */ @@ -518,131 +519,132 @@ /* */ /* Despite the name, this enumeration lists specific character */ /* repertories (i.e., charsets), and not text encoding methods (e.g., */ - /* UTF-8, UTF-16, GB2312_EUC, etc.). */ + /* UTF-8, UTF-16, etc.). */ /* */ - /* Because of 32-bit charcodes defined in Unicode (i.e., surrogates), */ - /* all character codes must be expressed as FT_Longs. */ - /* */ /* Other encodings might be defined in the future. */ /* */ /* */ - /* FT_ENCODING_NONE :: */ - /* The encoding value 0 is reserved. */ + /* FT_ENCODING_NONE :: */ + /* The encoding value~0 is reserved. */ /* */ - /* FT_ENCODING_UNICODE :: */ - /* Corresponds to the Unicode character set. This value covers */ - /* all versions of the Unicode repertoire, including ASCII and */ - /* Latin-1. Most fonts include a Unicode charmap, but not all */ - /* of them. */ + /* FT_ENCODING_UNICODE :: */ + /* Corresponds to the Unicode character set. This value covers */ + /* all versions of the Unicode repertoire, including ASCII and */ + /* Latin-1. Most fonts include a Unicode charmap, but not all */ + /* of them. */ /* */ - /* FT_ENCODING_MS_SYMBOL :: */ - /* Corresponds to the Microsoft Symbol encoding, used to encode */ - /* mathematical symbols in the 32..255 character code range. For */ - /* more information, see `http://www.ceviz.net/symbol.htm'. */ + /* For example, if you want to access Unicode value U+1F028 (and */ + /* the font contains it), use value 0x1F028 as the input value for */ + /* @FT_Get_Char_Index. */ /* */ - /* FT_ENCODING_SJIS :: */ - /* Corresponds to Japanese SJIS encoding. More info at */ - /* at `http://langsupport.japanreference.com/encoding.shtml'. */ - /* See note on multi-byte encodings below. */ + /* FT_ENCODING_MS_SYMBOL :: */ + /* Corresponds to the Microsoft Symbol encoding, used to encode */ + /* mathematical symbols in the 32..255 character code range. For */ + /* more information, see `http://www.ceviz.net/symbol.htm'. */ /* */ - /* FT_ENCODING_GB2312 :: */ - /* Corresponds to an encoding system for Simplified Chinese as used */ - /* used in mainland China. */ + /* FT_ENCODING_SJIS :: */ + /* Corresponds to Japanese SJIS encoding. More info at */ + /* at `http://langsupport.japanreference.com/encoding.shtml'. */ + /* See note on multi-byte encodings below. */ /* */ - /* FT_ENCODING_BIG5 :: */ - /* Corresponds to an encoding system for Traditional Chinese as used */ - /* in Taiwan and Hong Kong. */ + /* FT_ENCODING_GB2312 :: */ + /* Corresponds to an encoding system for Simplified Chinese as used */ + /* used in mainland China. */ /* */ - /* FT_ENCODING_WANSUNG :: */ - /* Corresponds to the Korean encoding system known as Wansung. */ - /* For more information see */ - /* `http://www.microsoft.com/typography/unicode/949.txt'. */ + /* FT_ENCODING_BIG5 :: */ + /* Corresponds to an encoding system for Traditional Chinese as */ + /* used in Taiwan and Hong Kong. */ /* */ - /* FT_ENCODING_JOHAB :: */ - /* The Korean standard character set (KS C-5601-1992), which */ - /* corresponds to MS Windows code page 1361. This character set */ - /* includes all possible Hangeul character combinations. */ + /* FT_ENCODING_WANSUNG :: */ + /* Corresponds to the Korean encoding system known as Wansung. */ + /* For more information see */ + /* `http://www.microsoft.com/typography/unicode/949.txt'. */ /* */ - /* FT_ENCODING_ADOBE_LATIN_1 :: */ - /* Corresponds to a Latin-1 encoding as defined in a Type 1 */ - /* Postscript font. It is limited to 256 character codes. */ + /* FT_ENCODING_JOHAB :: */ + /* The Korean standard character set (KS~C 5601-1992), which */ + /* corresponds to MS Windows code page 1361. This character set */ + /* includes all possible Hangeul character combinations. */ /* */ - /* FT_ENCODING_ADOBE_STANDARD :: */ - /* Corresponds to the Adobe Standard encoding, as found in Type 1, */ - /* CFF, and OpenType/CFF fonts. It is limited to 256 character */ - /* codes. */ + /* FT_ENCODING_ADOBE_LATIN_1 :: */ + /* Corresponds to a Latin-1 encoding as defined in a Type~1 */ + /* PostScript font. It is limited to 256 character codes. */ /* */ - /* FT_ENCODING_ADOBE_EXPERT :: */ - /* Corresponds to the Adobe Expert encoding, as found in Type 1, */ - /* CFF, and OpenType/CFF fonts. It is limited to 256 character */ - /* codes. */ + /* FT_ENCODING_ADOBE_STANDARD :: */ + /* Corresponds to the Adobe Standard encoding, as found in Type~1, */ + /* CFF, and OpenType/CFF fonts. It is limited to 256 character */ + /* codes. */ /* */ - /* FT_ENCODING_ADOBE_CUSTOM :: */ - /* Corresponds to a custom encoding, as found in Type 1, CFF, and */ - /* OpenType/CFF fonts. It is limited to 256 character codes. */ + /* FT_ENCODING_ADOBE_EXPERT :: */ + /* Corresponds to the Adobe Expert encoding, as found in Type~1, */ + /* CFF, and OpenType/CFF fonts. It is limited to 256 character */ + /* codes. */ /* */ - /* FT_ENCODING_APPLE_ROMAN :: */ - /* Corresponds to the 8-bit Apple roman encoding. Many TrueType and */ - /* OpenType fonts contain a charmap for this encoding, since older */ - /* versions of Mac OS are able to use it. */ + /* FT_ENCODING_ADOBE_CUSTOM :: */ + /* Corresponds to a custom encoding, as found in Type~1, CFF, and */ + /* OpenType/CFF fonts. It is limited to 256 character codes. */ /* */ - /* FT_ENCODING_OLD_LATIN_2 :: */ - /* This value is deprecated and was never used nor reported by */ - /* FreeType. Don't use or test for it. */ + /* FT_ENCODING_APPLE_ROMAN :: */ + /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */ + /* and OpenType fonts contain a charmap for this encoding, since */ + /* older versions of Mac OS are able to use it. */ /* */ - /* FT_ENCODING_MS_SJIS :: */ - /* Same as FT_ENCODING_SJIS. Deprecated. */ + /* FT_ENCODING_OLD_LATIN_2 :: */ + /* This value is deprecated and was never used nor reported by */ + /* FreeType. Don't use or test for it. */ /* */ - /* FT_ENCODING_MS_GB2312 :: */ - /* Same as FT_ENCODING_GB2312. Deprecated. */ + /* FT_ENCODING_MS_SJIS :: */ + /* Same as FT_ENCODING_SJIS. Deprecated. */ /* */ - /* FT_ENCODING_MS_BIG5 :: */ - /* Same as FT_ENCODING_BIG5. Deprecated. */ + /* FT_ENCODING_MS_GB2312 :: */ + /* Same as FT_ENCODING_GB2312. Deprecated. */ /* */ - /* FT_ENCODING_MS_WANSUNG :: */ - /* Same as FT_ENCODING_WANSUNG. Deprecated. */ + /* FT_ENCODING_MS_BIG5 :: */ + /* Same as FT_ENCODING_BIG5. Deprecated. */ /* */ - /* FT_ENCODING_MS_JOHAB :: */ - /* Same as FT_ENCODING_JOHAB. Deprecated. */ + /* FT_ENCODING_MS_WANSUNG :: */ + /* Same as FT_ENCODING_WANSUNG. Deprecated. */ /* */ + /* FT_ENCODING_MS_JOHAB :: */ + /* Same as FT_ENCODING_JOHAB. Deprecated. */ + /* */ /* */ - /* By default, FreeType automatically synthetizes a Unicode charmap */ - /* for Postscript fonts, using their glyph names dictionaries. */ - /* 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. */ + /* By default, FreeType automatically synthesizes a Unicode charmap */ + /* for PostScript fonts, using their glyph names dictionaries. */ + /* 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 */ - /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */ - /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out which */ - /* encoding is really present. If, for example, the `cs_registry' */ - /* field is `KOI8' and the `cs_encoding' field is `R', the font is */ - /* encoded in KOI8-R. */ + /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */ + /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */ + /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */ + /* which encoding is really present. If, for example, the */ + /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */ + /* the font is encoded in KOI8-R. */ /* */ - /* FT_ENCODING_NONE is always set (with a single exception) by the */ - /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */ - /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */ - /* which encoding is really present. For example, */ - /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */ - /* Russian). */ + /* FT_ENCODING_NONE is always set (with a single exception) by the */ + /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */ + /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */ + /* which encoding is really present. For example, */ + /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */ + /* Russian). */ /* */ - /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */ - /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */ - /* FT_ENCODING_APPLE_ROMAN). */ + /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */ + /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */ + /* FT_ENCODING_APPLE_ROMAN). */ /* */ - /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function c */ - /* @FT_Get_CMap_Language_ID to query the Mac language ID which may be */ - /* needed to be able to distinguish Apple encoding variants. See */ + /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */ + /* @FT_Get_CMap_Language_ID to query the Mac language ID which may */ + /* be needed to be able to distinguish Apple encoding variants. See */ /* */ - /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */ + /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */ /* */ - /* to get an idea how to do that. Basically, if the language ID is 0, */ - /* don't use it, otherwise subtract 1 from the language ID. Then */ - /* examine `encoding_id'. If, for example, `encoding_id' is */ - /* @TT_MAC_ID_ROMAN and the language ID (minus 1) is */ - /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */ - /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */ - /* variant the Arabic encoding. */ + /* to get an idea how to do that. Basically, if the language ID */ + /* is~0, don't use it, otherwise subtract 1 from the language ID. */ + /* Then examine `encoding_id'. If, for example, `encoding_id' is */ + /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */ + /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */ + /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */ + /* variant the Arabic encoding. */ /* */ typedef enum FT_Encoding_ { @@ -753,7 +755,7 @@ /* An opaque handle to an `FT_Face_InternalRec' structure, used to */ /* model private data of a given @FT_Face object. */ /* */ - /* This structure might change between releases of FreeType 2 and is */ + /* This structure might change between releases of FreeType~2 and is */ /* not generally available to client applications. */ /* */ typedef struct FT_Face_InternalRec_* FT_Face_Internal; @@ -774,7 +776,7 @@ /* a font file. */ /* */ /* face_index :: The index of the face in the font file. It */ - /* is set to 0 if there is only one face in */ + /* is set to~0 if there is only one face in */ /* the font file. */ /* */ /* face_flags :: A set of bit flags that give important */ @@ -790,6 +792,9 @@ /* `num_fixed_sizes'), it is set to the number */ /* of outline glyphs. */ /* */ + /* For CID-keyed fonts, this value gives the */ + /* highest CID used in the font. */ + /* */ /* family_name :: The face's family name. This is an ASCII */ /* string, usually in English, which describes */ /* the typeface's family (like `Times New */ @@ -799,6 +804,8 @@ /* provide localized and Unicode versions of */ /* this string. Applications should use the */ /* format specific interface to access them. */ + /* Can be NULL (e.g., in fonts embedded in a */ + /* PDF file). */ /* */ /* style_name :: The face's style name. This is an ASCII */ /* string, usually in English, which describes */ @@ -836,9 +843,13 @@ /* descender'. Only relevant for scalable */ /* formats. */ /* */ + /* Note that the bounding box might be off by */ + /* (at least) one pixel for hinted fonts. See */ + /* @FT_Size_Metrics for further discussion. */ + /* */ /* units_per_EM :: The number of font units per EM square for */ /* this face. This is typically 2048 for */ - /* TrueType fonts, and 1000 for Type 1 fonts. */ + /* TrueType fonts, and 1000 for Type~1 fonts. */ /* Only relevant for scalable formats. */ /* */ /* ascender :: The typographic ascender of the face, */ @@ -874,7 +885,7 @@ /* scalable formats. */ /* */ /* underline_position :: The position, in font units, of the */ - /* underline line for this face. It's the */ + /* underline line for this face. It is the */ /* center of the underlining stem. Only */ /* relevant for scalable formats. */ /* */ @@ -889,8 +900,8 @@ /* charmap :: The current active charmap for this face. */ /* */ /* */ - /* Fields may be changed after a call to @FT_Attach_File or */ - /* @FT_Attach_Stream. */ + /* Fields may be changed after a call to @FT_Attach_File or */ + /* @FT_Attach_Stream. */ /* */ typedef struct FT_FaceRec_ { @@ -1019,6 +1030,36 @@ /* the SFNT `gasp' table only if the native TrueType hinting engine */ /* (with the bytecode interpreter) is available and active. */ /* */ + /* FT_FACE_FLAG_CID_KEYED :: */ + /* Set if the font is CID-keyed. In that case, the font is not */ + /* accessed by glyph indices but by CID values. For subsetted */ + /* CID-keyed fonts this has the consequence that not all index */ + /* values are a valid argument to FT_Load_Glyph. Only the CID */ + /* values for which corresponding glyphs in the subsetted font */ + /* exist make FT_Load_Glyph return successfully; in all other cases */ + /* you get an `FT_Err_Invalid_Argument' error. */ + /* */ + /* Note that CID-keyed fonts which are in an SFNT wrapper don't */ + /* have this flag set since the glyphs are accessed in the normal */ + /* way (using contiguous indices); the `CID-ness' isn't visible to */ + /* the application. */ + /* */ + /* FT_FACE_FLAG_TRICKY :: */ + /* Set if the font is `tricky', this is, it always needs the */ + /* font format's native hinting engine to get a reasonable result. */ + /* A typical example is the Chinese font `mingli.ttf' which uses */ + /* TrueType bytecode instructions to move and scale all of its */ + /* subglyphs. */ + /* */ + /* It is not possible to autohint such fonts using */ + /* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */ + /* @FT_LOAD_NO_HINTING. You have to set both FT_LOAD_NO_HINTING */ + /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */ + /* probably never want this except for demonstration purposes. */ + /* */ + /* Currently, there are six TrueType fonts in the list of tricky */ + /* fonts; they are hard-coded in file `ttobjs.c'. */ + /* */ #define FT_FACE_FLAG_SCALABLE ( 1L << 0 ) #define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 ) #define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 ) @@ -1031,10 +1072,10 @@ #define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 ) #define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 ) #define FT_FACE_FLAG_HINTER ( 1L << 11 ) +#define FT_FACE_FLAG_CID_KEYED ( 1L << 12 ) +#define FT_FACE_FLAG_TRICKY ( 1L << 13 ) - /* */ - /************************************************************************* * * @macro: @@ -1087,7 +1128,7 @@ * * @description: * A macro that returns true whenever a face object contains a scalable - * font face (true for TrueType, Type 1, Type 42, CID, OpenType/CFF, + * font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF, * and PFR font formats. * */ @@ -1143,9 +1184,7 @@ #define FT_HAS_FIXED_SIZES( face ) \ ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES ) - /* */ - /************************************************************************* * * @macro: @@ -1187,9 +1226,41 @@ ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) + /************************************************************************* + * + * @macro: + * FT_IS_CID_KEYED( face ) + * + * @description: + * A macro that returns true whenever a face object contains a CID-keyed + * font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more + * details. + * + * If this macro is true, all functions defined in @FT_CID_H are + * available. + * + */ +#define FT_IS_CID_KEYED( face ) \ + ( face->face_flags & FT_FACE_FLAG_CID_KEYED ) + + + /************************************************************************* + * + * @macro: + * FT_IS_TRICKY( face ) + * + * @description: + * A macro that returns true whenever a face represents a `tricky' font. + * See the discussion of @FT_FACE_FLAG_TRICKY for more details. + * + */ +#define FT_IS_TRICKY( face ) \ + ( face->face_flags & FT_FACE_FLAG_TRICKY ) + + /*************************************************************************/ /* */ - /* */ + /* */ /* FT_STYLE_FLAG_XXX */ /* */ /* */ @@ -1198,11 +1269,17 @@ /* */ /* */ /* FT_STYLE_FLAG_ITALIC :: */ - /* Indicates that a given face is italicized. */ + /* Indicates that a given face style is italic or oblique. */ /* */ /* FT_STYLE_FLAG_BOLD :: */ /* Indicates that a given face is bold. */ /* */ + /* */ + /* The style information as provided by FreeType is very basic. More */ + /* details are beyond the scope and should be done on a higher level */ + /* (for example, by analyzing various fields of the `OS/2' table in */ + /* SFNT based fonts). */ + /* */ #define FT_STYLE_FLAG_ITALIC ( 1 << 0 ) #define FT_STYLE_FLAG_BOLD ( 1 << 1 ) @@ -1214,7 +1291,7 @@ /* */ /* */ /* An opaque handle to an `FT_Size_InternalRec' structure, used to */ - /* model private data of a given FT_Size object. */ + /* model private data of a given @FT_Size object. */ /* */ typedef struct FT_Size_InternalRec_* FT_Size_Internal; @@ -1345,7 +1422,7 @@ /* */ /* */ /* An opaque handle to an `FT_Slot_InternalRec' structure, used to */ - /* model private data of a given FT_GlyphSlot object. */ + /* model private data of a given @FT_GlyphSlot object. */ /* */ typedef struct FT_Slot_InternalRec_* FT_Slot_Internal; @@ -1401,7 +1478,7 @@ /* Only relevant for outline glyphs. */ /* */ /* advance :: This is the transformed advance width for the */ - /* glyph. */ + /* glyph (in 26.6 fractional pixel format). */ /* */ /* format :: This field indicates the format of the image */ /* contained in the glyph slot. Typically */ @@ -1425,7 +1502,7 @@ /* bitmap_top :: This is the bitmap's top bearing expressed in */ /* integer pixels. Remember that this is the */ /* distance from the baseline to the top-most */ - /* glyph scanline, upwards y-coordinates being */ + /* glyph scanline, upwards y~coordinates being */ /* *positive*. */ /* */ /* outline :: The outline descriptor for the current glyph */ @@ -1448,7 +1525,7 @@ /* */ /* control_data :: Certain font drivers can also return the */ /* control data for a given glyph image (e.g. */ - /* TrueType bytecode, Type 1 charstrings, etc.). */ + /* TrueType bytecode, Type~1 charstrings, etc.). */ /* This field is a pointer to such data. */ /* */ /* control_len :: This is the length in bytes of the control */ @@ -1470,15 +1547,15 @@ /* */ /* If @FT_Load_Glyph is called with default flags (see */ /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */ - /* its native format (e.g., an outline glyph for TrueType and Type 1 */ + /* its native format (e.g., an outline glyph for TrueType and Type~1 */ /* formats). */ /* */ /* This image can later be converted into a bitmap by calling */ /* @FT_Render_Glyph. This function finds the current renderer for */ - /* the native image's format then invokes it. */ + /* the native image's format, then invokes it. */ /* */ /* The renderer is in charge of transforming the native image through */ - /* the slot's face transformation fields, then convert it into a */ + /* the slot's face transformation fields, then converting it into a */ /* bitmap that is returned in `slot->bitmap'. */ /* */ /* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */ @@ -1573,8 +1650,13 @@ /* alibrary :: A handle to a new library object. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ + /* */ + /* In case you want to provide your own memory allocating routines, */ + /* use @FT_New_Library instead, followed by a call to */ + /* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */ + /* */ FT_EXPORT( FT_Error ) FT_Init_FreeType( FT_Library *alibrary ); @@ -1592,7 +1674,7 @@ /* library :: A handle to the target library object. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Done_FreeType( FT_Library library ); @@ -1608,26 +1690,26 @@ /* @FT_Open_Args structure. */ /* */ /* */ - /* FT_OPEN_MEMORY :: This is a memory-based stream. */ + /* FT_OPEN_MEMORY :: This is a memory-based stream. */ /* */ - /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */ + /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */ /* */ - /* FT_OPEN_PATHNAME :: Create a new input stream from a C */ - /* path name. */ + /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */ + /* name. */ /* */ - /* FT_OPEN_DRIVER :: Use the `driver' field. */ + /* FT_OPEN_DRIVER :: Use the `driver' field. */ /* */ - /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */ + /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */ /* */ - /* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */ + /* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */ /* */ - /* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */ + /* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */ /* */ - /* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */ + /* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */ /* */ - /* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */ + /* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */ /* */ - /* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */ + /* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */ /* */ /* */ /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */ @@ -1652,8 +1734,8 @@ /* FT_Parameter */ /* */ /* */ - /* A simple structure used to pass more or less generic parameters */ - /* to @FT_Open_Face. */ + /* A simple structure used to pass more or less generic parameters to */ + /* @FT_Open_Face. */ /* */ /* */ /* tag :: A four-byte identification tag. */ @@ -1695,7 +1777,7 @@ /* */ /* 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 tries to load the */ + /* 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. */ @@ -1726,7 +1808,7 @@ /* `num_params' and `params' is used. They are ignored otherwise. */ /* */ /* Ideally, both the `pathname' and `params' fields should be tagged */ - /* as `const'; this is missing for API backwards compatibility. With */ + /* as `const'; this is missing for API backwards compatibility. In */ /* other words, applications should treat them as read-only. */ /* */ typedef struct FT_Open_Args_ @@ -1758,7 +1840,7 @@ /* pathname :: A path to the font file. */ /* */ /* face_index :: The index of the face within the font. The first */ - /* face has index 0. */ + /* face has index~0. */ /* */ /* */ /* aface :: A handle to a new face object. If `face_index' is */ @@ -1766,7 +1848,7 @@ /* See @FT_Open_Face for more details. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_New_Face( FT_Library library, @@ -1793,7 +1875,7 @@ /* file_size :: The size of the memory chunk used by the font data. */ /* */ /* face_index :: The index of the face within the font. The first */ - /* face has index 0. */ + /* face has index~0. */ /* */ /* */ /* aface :: A handle to a new face object. If `face_index' is */ @@ -1801,7 +1883,7 @@ /* See @FT_Open_Face for more details. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* */ /* You must not deallocate the memory before calling @FT_Done_Face. */ @@ -1831,7 +1913,7 @@ /* be filled by the caller. */ /* */ /* face_index :: The index of the face within the font. The first */ - /* face has index 0. */ + /* face has index~0. */ /* */ /* */ /* aface :: A handle to a new face object. If `face_index' is */ @@ -1839,7 +1921,7 @@ /* See note below. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* */ /* Unlike FreeType 1.x, this function automatically creates a glyph */ @@ -1848,7 +1930,7 @@ /* */ /* FT_Open_Face can be used to quickly check whether the font */ /* format of a given font resource is supported by FreeType. If the */ - /* `face_index' field is negative, the function's return value is 0 */ + /* `face_index' field is negative, the function's return value is~0 */ /* if the font format is recognized, or non-zero otherwise; */ /* the function returns a more or less empty face handle in `*aface' */ /* (if `aface' isn't NULL). The only useful field in this special */ @@ -1881,7 +1963,7 @@ /* filepathname :: The pathname. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Attach_File( FT_Face face, @@ -1896,7 +1978,7 @@ /* */ /* `Attach' data to a face object. Normally, this is used to read */ /* additional information for the face object. For example, you can */ - /* attach an AFM file that comes with a Type 1 font to get the */ + /* attach an AFM file that comes with a Type~1 font to get the */ /* kerning values and other metrics. */ /* */ /* */ @@ -1907,7 +1989,7 @@ /* the caller. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* */ /* The meaning of the `attach' (i.e., what really happens when the */ @@ -1936,7 +2018,7 @@ /* face :: A handle to a target face object. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Done_Face( FT_Face face ); @@ -1958,7 +2040,7 @@ /* `available_sizes' field of @FT_FaceRec structure. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Select_Size( FT_Face face, @@ -2044,8 +2126,8 @@ /* value. */ /* */ /* */ - /* If `width' is zero, then the horizontal scaling value is set */ - /* equal to the vertical scaling value, and vice versa. */ + /* If `width' is zero, then the horizontal scaling value is set equal */ + /* to the vertical scaling value, and vice versa. */ /* */ typedef struct FT_Size_RequestRec_ { @@ -2055,11 +2137,22 @@ FT_UInt horiResolution; FT_UInt vertResolution; - } FT_Size_RequestRec, *FT_Size_Request; + } FT_Size_RequestRec; /*************************************************************************/ /* */ + /* */ + /* FT_Size_Request */ + /* */ + /* */ + /* A handle to a size request structure. */ + /* */ + typedef struct FT_Size_RequestRec_ *FT_Size_Request; + + + /*************************************************************************/ + /* */ /* */ /* FT_Request_Size */ /* */ @@ -2073,7 +2166,7 @@ /* req :: A pointer to a @FT_Size_RequestRec. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* */ /* Although drivers may select the bitmap strike matching the */ @@ -2108,7 +2201,7 @@ /* vert_resolution :: The vertical resolution in dpi. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* */ /* If either the character width or height is zero, it is set equal */ @@ -2120,7 +2213,8 @@ /* A character width or height smaller than 1pt is set to 1pt; if */ /* both resolution values are zero, they are set to 72dpi. */ /* */ - + /* Don't use this function if you are using the FreeType cache API. */ + /* */ FT_EXPORT( FT_Error ) FT_Set_Char_Size( FT_Face face, FT_F26Dot6 char_width, @@ -2147,7 +2241,7 @@ /* pixel_height :: The nominal height, in pixels. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Set_Pixel_Sizes( FT_Face face, @@ -2180,12 +2274,17 @@ /* whether to hint the outline, etc). */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* */ /* The loaded glyph may be transformed. See @FT_Set_Transform for */ /* the details. */ /* */ + /* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is */ + /* returned for invalid CID values (this is, for CID values which */ + /* don't have a corresponding glyph in the font). See the discussion */ + /* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */ + /* */ FT_EXPORT( FT_Error ) FT_Load_Glyph( FT_Face face, FT_UInt glyph_index, @@ -2216,7 +2315,7 @@ /* whether to hint the outline, etc). */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* */ /* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */ @@ -2238,7 +2337,7 @@ * * @values: * FT_LOAD_DEFAULT :: - * Corresponding to 0, this value is used as the default glyph load + * Corresponding to~0, this value is used as the default glyph load * operation. In this case, the following happens: * * 1. FreeType looks for a bitmap for the glyph corresponding to the @@ -2328,10 +2427,10 @@ * FT_LOAD_MONOCHROME :: * This flag is used with @FT_LOAD_RENDER to indicate that you want to * render an outline glyph to a 1-bit monochrome bitmap glyph, with - * 8 pixels packed into each byte of the bitmap data. + * 8~pixels packed into each byte of the bitmap data. * * Note that this has no effect on the hinting algorithm used. You - * should use @FT_LOAD_TARGET_MONO instead so that the + * should rather use @FT_LOAD_TARGET_MONO so that the * monochrome-optimized hinting algorithm is used. * * FT_LOAD_LINEAR_DESIGN :: @@ -2350,8 +2449,12 @@ * @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be * used at all. * + * See the description of @FT_FACE_FLAG_TRICKY for a special exception + * (affecting only a handful of Asian fonts). + * * Besides deciding which hinter to use, you can also decide which * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details. + * */ #define FT_LOAD_DEFAULT 0x0 #define FT_LOAD_NO_SCALE 0x1 @@ -2367,14 +2470,15 @@ #define FT_LOAD_IGNORE_TRANSFORM 0x800 #define FT_LOAD_MONOCHROME 0x1000 #define FT_LOAD_LINEAR_DESIGN 0x2000 - - /* temporary hack! */ -#define FT_LOAD_SBITS_ONLY 0x4000 #define FT_LOAD_NO_AUTOHINT 0x8000U /* */ + /* used internally only by certain font drivers! */ +#define FT_LOAD_ADVANCE_ONLY 0x100 +#define FT_LOAD_SBITS_ONLY 0x4000 + /************************************************************************** * * @enum: @@ -2401,7 +2505,7 @@ * FT_LOAD_TARGET_LIGHT :: * A lighter hinting algorithm for non-monochrome modes. Many * generated glyphs are more fuzzy but better resemble its original - * shape. A bit like rendering on Mac OS X. + * shape. A bit like rendering on Mac OS~X. * * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT. * @@ -2437,31 +2541,30 @@ * * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD ); * } + * */ +#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 ) -#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 ) +#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ) +#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ) +#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO ) +#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD ) +#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V ) -#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ) -#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ) -#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO ) -#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD ) -#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V ) - - /* + /************************************************************************** + * * @macro: * FT_LOAD_TARGET_MODE * * @description: * Return the @FT_Render_Mode corresponding to a given * @FT_LOAD_TARGET_XXX value. + * */ - #define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) ) - /* */ - /*************************************************************************/ /* */ /* */ @@ -2476,9 +2579,9 @@ /* face :: A handle to the source face object. */ /* */ /* */ - /* matrix :: A pointer to the transformation's 2x2 matrix. Use 0 for */ + /* matrix :: A pointer to the transformation's 2x2 matrix. Use~0 for */ /* the identity matrix. */ - /* delta :: A pointer to the translation vector. Use 0 for the null */ + /* delta :: A pointer to the translation vector. Use~0 for the null */ /* vector. */ /* */ /* */ @@ -2503,17 +2606,19 @@ /* */ /* */ /* An enumeration type that lists the render modes supported by */ - /* FreeType 2. Each mode corresponds to a specific type of scanline */ + /* FreeType~2. Each mode corresponds to a specific type of scanline */ /* conversion performed on the outline. */ /* */ - /* For bitmap fonts the `bitmap->pixel_mode' field in the */ - /* @FT_GlyphSlotRec structure gives the format of the returned */ - /* bitmap. */ + /* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */ + /* field in the @FT_GlyphSlotRec structure gives the format of the */ + /* returned bitmap. */ /* */ + /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */ + /* */ /* */ /* FT_RENDER_MODE_NORMAL :: */ /* This is the default render mode; it corresponds to 8-bit */ - /* anti-aliased bitmaps, using 256 levels of opacity. */ + /* anti-aliased bitmaps. */ /* */ /* FT_RENDER_MODE_LIGHT :: */ /* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */ @@ -2522,25 +2627,33 @@ /* @FT_LOAD_TARGET_XXX for details. */ /* */ /* FT_RENDER_MODE_MONO :: */ - /* This mode corresponds to 1-bit bitmaps. */ + /* This mode corresponds to 1-bit bitmaps (with 2~levels of */ + /* opacity). */ /* */ /* FT_RENDER_MODE_LCD :: */ /* This mode corresponds to horizontal RGB and BGR sub-pixel */ - /* displays, like LCD-screens. It produces 8-bit bitmaps that are */ - /* 3 times the width of the original glyph outline in pixels, and */ + /* displays like LCD screens. It produces 8-bit bitmaps that are */ + /* 3~times the width of the original glyph outline in pixels, and */ /* which use the @FT_PIXEL_MODE_LCD mode. */ /* */ /* FT_RENDER_MODE_LCD_V :: */ /* This mode corresponds to vertical RGB and BGR sub-pixel displays */ /* (like PDA screens, rotated LCD displays, etc.). It produces */ - /* 8-bit bitmaps that are 3 times the height of the original */ + /* 8-bit bitmaps that are 3~times the height of the original */ /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */ /* */ /* */ - /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph are */ - /* _not_ _filtered_ to reduce color-fringes. It is up to the caller */ - /* to perform this pass. */ + /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */ + /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */ + /* (not active in the default builds). It is up to the caller to */ + /* either call @FT_Library_SetLcdFilter (if available) or do the */ + /* filtering itself. */ /* */ + /* The selected render mode only affects vector glyphs of a font. */ + /* Embedded bitmaps often have a different pixel mode like */ + /* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */ + /* them into 8-bit pixmaps. */ + /* */ typedef enum FT_Render_Mode_ { FT_RENDER_MODE_NORMAL = 0, @@ -2564,8 +2677,8 @@ /* @FT_Render_Mode values instead. */ /* */ /* */ - /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */ - /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */ + /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */ + /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */ /* */ #define ft_render_mode_normal FT_RENDER_MODE_NORMAL #define ft_render_mode_mono FT_RENDER_MODE_MONO @@ -2591,7 +2704,7 @@ /* list of possible values. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Render_Glyph( FT_GlyphSlot slot, @@ -2609,7 +2722,7 @@ /* */ /* */ /* FT_KERNING_DEFAULT :: Return scaled and grid-fitted kerning */ - /* distances (value is 0). */ + /* distances (value is~0). */ /* */ /* FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning */ /* distances. */ @@ -2687,7 +2800,7 @@ /* and in pixels for fixed-sizes formats. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* */ /* Only horizontal layouts (left-to-right & right-to-left) are */ @@ -2712,17 +2825,17 @@ /* Return the track kerning for a given face object at a given size. */ /* */ /* */ - /* face :: A handle to a source face object. */ + /* face :: A handle to a source face object. */ /* */ - /* point_size :: The point size in 16.16 fractional points. */ + /* point_size :: The point size in 16.16 fractional points. */ /* */ - /* degree :: The degree of tightness. */ + /* degree :: The degree of tightness. */ /* */ /* */ - /* akerning :: The kerning in 16.16 fractional points. */ + /* akerning :: The kerning in 16.16 fractional points. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Get_Track_Kerning( FT_Face face, @@ -2738,7 +2851,7 @@ /* */ /* */ /* Retrieve the ASCII name of a given glyph in a face. This only */ - /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns 1. */ + /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1. */ /* */ /* */ /* face :: A handle to a source face object. */ @@ -2753,12 +2866,12 @@ /* copied to. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* */ /* 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' is 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. */ @@ -2780,14 +2893,14 @@ /* FT_Get_Postscript_Name */ /* */ /* */ - /* Retrieve the ASCII Postscript name of a given face, if available. */ - /* This only works with Postscript and TrueType fonts. */ + /* Retrieve the ASCII PostScript name of a given face, if available. */ + /* This only works with PostScript and TrueType fonts. */ /* */ /* */ /* face :: A handle to the source face object. */ /* */ /* */ - /* A pointer to the face's Postscript name. NULL if unavailable. */ + /* A pointer to the face's PostScript name. NULL if unavailable. */ /* */ /* */ /* The returned pointer is owned by the face and is destroyed with */ @@ -2813,7 +2926,7 @@ /* encoding :: A handle to the selected encoding. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* */ /* This function returns an error if no charmap in the face */ @@ -2821,7 +2934,8 @@ /* */ /* Because many fonts contain more than a single cmap for Unicode */ /* encoding, this function has some special code to select the one */ - /* which covers Unicode best. It is thus preferable to */ + /* which covers Unicode best (`best' in the sense that a UCS-4 cmap */ + /* is preferred to a UCS-2 cmap). It is thus preferable to */ /* @FT_Set_Charmap in this case. */ /* */ FT_EXPORT( FT_Error ) @@ -2844,13 +2958,15 @@ /* charmap :: A handle to the selected charmap. */ /* */ /* */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* */ /* 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). */ /* */ + /* It also fails if a type~14 charmap is selected. */ + /* */ FT_EXPORT( FT_Error ) FT_Set_Charmap( FT_Face face, FT_CharMap charmap ); @@ -2892,13 +3008,13 @@ /* charcode :: The character code. */ /* */ /* */ - /* The glyph index. 0 means `undefined character code'. */ + /* The glyph index. 0~means `undefined character code'. */ /* */ /* */ /* If you use FreeType to manipulate the contents of font files */ /* directly, be aware that the glyph index returned by this function */ /* doesn't always correspond to the internal indices used within */ - /* the file. This is done to ensure that value 0 always corresponds */ + /* the file. This is done to ensure that value~0 always corresponds */ /* to the `missing glyph'. */ /* */ FT_EXPORT( FT_UInt ) @@ -2920,7 +3036,7 @@ /* face :: A handle to the source face object. */ /* */ /* */ - /* agindex :: Glyph index of first character code. 0 if charmap is */ + /* agindex :: Glyph index of first character code. 0~if charmap is */ /* empty. */ /* */ /* */ @@ -2945,9 +3061,9 @@ /* } */ /* } */ /* */ - /* 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. */ + /* 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 */ + /* if the value~0 is the first valid character code. */ /* */ FT_EXPORT( FT_ULong ) FT_Get_First_Char( FT_Face face, @@ -2969,7 +3085,7 @@ /* char_code :: The starting character code. */ /* */ /* */ - /* agindex :: Glyph index of first character code. 0 if charmap */ + /* agindex :: Glyph index of next character code. 0~if charmap */ /* is empty. */ /* */ /* */ @@ -2980,7 +3096,7 @@ /* over all character codes available in a given charmap. See the */ /* note for this function for a simple code example. */ /* */ - /* Note that `*agindex' is set to 0 when there are no more codes in */ + /* Note that `*agindex' is set to~0 when there are no more codes in */ /* the charmap. */ /* */ FT_EXPORT( FT_ULong ) @@ -3004,7 +3120,7 @@ /* glyph_name :: The glyph name. */ /* */ /* */ - /* The glyph index. 0 means `undefined character code'. */ + /* The glyph index. 0~means `undefined character code'. */ /* */ FT_EXPORT( FT_UInt ) FT_Get_Name_Index( FT_Face face, @@ -3046,15 +3162,16 @@ * * @description: * Retrieve a description of a given subglyph. Only use it if - * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE, or an error is - * returned. + * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is + * returned otherwise. * * @input: * glyph :: * The source glyph slot. * * sub_index :: - * The index of subglyph. Must be less than `glyph->num_subglyphs'. + * The index of the subglyph. Must be less than + * `glyph->num_subglyphs'. * * @output: * p_index :: @@ -3073,7 +3190,7 @@ * The subglyph transformation (if any). * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * The values of `*p_arg1', `*p_arg2', and `*p_transform' must be @@ -3093,7 +3210,306 @@ /*************************************************************************/ /* */ + /* */ + /* FT_FSTYPE_XXX */ + /* */ + /* */ + /* A list of bit flags used in the `fsType' field of the OS/2 table */ + /* in a TrueType or OpenType font and the `FSType' entry in a */ + /* PostScript font. These bit flags are returned by */ + /* @FT_Get_FSType_Flags; they inform client applications of embedding */ + /* and subsetting restrictions associated with a font. */ + /* */ + /* See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for */ + /* more details. */ + /* */ + /* */ + /* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */ + /* Fonts with no fsType bit set may be embedded and permanently */ + /* installed on the remote system by an application. */ + /* */ + /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */ + /* Fonts that have only this bit set must not be modified, embedded */ + /* or exchanged in any manner without first obtaining permission of */ + /* the font software copyright owner. */ + /* */ + /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */ + /* If this bit is set, the font may be embedded and temporarily */ + /* loaded on the remote system. Documents containing Preview & */ + /* Print fonts must be opened `read-only'; no edits can be applied */ + /* to the document. */ + /* */ + /* FT_FSTYPE_EDITABLE_EMBEDDING :: */ + /* If this bit is set, the font may be embedded but must only be */ + /* installed temporarily on other systems. In contrast to Preview */ + /* & Print fonts, documents containing editable fonts may be opened */ + /* for reading, editing is permitted, and changes may be saved. */ + /* */ + /* FT_FSTYPE_NO_SUBSETTING :: */ + /* If this bit is set, the font may not be subsetted prior to */ + /* embedding. */ + /* */ + /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */ + /* If this bit is set, only bitmaps contained in the font may be */ + /* embedded; no outline data may be embedded. If there are no */ + /* bitmaps available in the font, then the font is unembeddable. */ + /* */ + /* */ + /* While the fsType flags can indicate that a font may be embedded, a */ + /* license with the font vendor may be separately required to use the */ + /* font in this way. */ + /* */ +#define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000 +#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002 +#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004 +#define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008 +#define FT_FSTYPE_NO_SUBSETTING 0x0100 +#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200 + + + /*************************************************************************/ + /* */ + /* */ + /* FT_Get_FSType_Flags */ + /* */ + /* */ + /* Return the fsType flags for a font. */ + /* */ + /* */ + /* face :: A handle to the source face object. */ + /* */ + /* */ + /* The fsType flags, @FT_FSTYPE_XXX. */ + /* */ + /* */ + /* Use this function rather than directly reading the `fs_type' field */ + /* in the @PS_FontInfoRec structure which is only guaranteed to */ + /* return the correct results for Type~1 fonts. */ + /* */ + FT_EXPORT( FT_UShort ) + FT_Get_FSType_Flags( FT_Face face ); + + + /*************************************************************************/ + /* */ /*
*/ + /* glyph_variants */ + /* */ + /* */ + /* Glyph Variants */ + /* */ + /* <Abstract> */ + /* The FreeType~2 interface to Unicode Ideographic Variation */ + /* Sequences (IVS), using the SFNT cmap format~14. */ + /* */ + /* <Description> */ + /* Many CJK characters have variant forms. They are a sort of grey */ + /* area somewhere between being totally irrelevant and semantically */ + /* distinct; for this reason, the Unicode consortium decided to */ + /* introduce Ideographic Variation Sequences (IVS), consisting of a */ + /* Unicode base character and one of 240 variant selectors */ + /* (U+E0100-U+E01EF), instead of further extending the already huge */ + /* code range for CJK characters. */ + /* */ + /* An IVS is registered and unique; for further details please refer */ + /* to Unicode Technical Report #37, the Ideographic Variation */ + /* Database. To date (October 2007), the character with the most */ + /* variants is U+908A, having 8~such IVS. */ + /* */ + /* Adobe and MS decided to support IVS with a new cmap subtable */ + /* (format~14). It is an odd subtable because it is not a mapping of */ + /* input code points to glyphs, but contains lists of all variants */ + /* supported by the font. */ + /* */ + /* A variant may be either `default' or `non-default'. A default */ + /* variant is the one you will get for that code point if you look it */ + /* up in the standard Unicode cmap. A non-default variant is a */ + /* different glyph. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Face_GetCharVariantIndex */ + /* */ + /* <Description> */ + /* Return the glyph index of a given character code as modified by */ + /* the variation selector. */ + /* */ + /* <Input> */ + /* face :: */ + /* A handle to the source face object. */ + /* */ + /* charcode :: */ + /* The character code point in Unicode. */ + /* */ + /* variantSelector :: */ + /* The Unicode code point of the variation selector. */ + /* */ + /* <Return> */ + /* The glyph index. 0~means either `undefined character code', or */ + /* `undefined selector code', or `no variation selector cmap */ + /* subtable', or `current CharMap is not Unicode'. */ + /* */ + /* <Note> */ + /* If you use FreeType to manipulate the contents of font files */ + /* directly, be aware that the glyph index returned by this function */ + /* doesn't always correspond to the internal indices used within */ + /* the file. This is done to ensure that value~0 always corresponds */ + /* to the `missing glyph'. */ + /* */ + /* This function is only meaningful if */ + /* a) the font has a variation selector cmap sub table, */ + /* and */ + /* b) the current charmap has a Unicode encoding. */ + /* */ + /* <Since> */ + /* 2.3.6 */ + /* */ + FT_EXPORT( FT_UInt ) + FT_Face_GetCharVariantIndex( FT_Face face, + FT_ULong charcode, + FT_ULong variantSelector ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Face_GetCharVariantIsDefault */ + /* */ + /* <Description> */ + /* Check whether this variant of this Unicode character is the one to */ + /* be found in the `cmap'. */ + /* */ + /* <Input> */ + /* face :: */ + /* A handle to the source face object. */ + /* */ + /* charcode :: */ + /* The character codepoint in Unicode. */ + /* */ + /* variantSelector :: */ + /* The Unicode codepoint of the variation selector. */ + /* */ + /* <Return> */ + /* 1~if found in the standard (Unicode) cmap, 0~if found in the */ + /* variation selector cmap, or -1 if it is not a variant. */ + /* */ + /* <Note> */ + /* This function is only meaningful if the font has a variation */ + /* selector cmap subtable. */ + /* */ + /* <Since> */ + /* 2.3.6 */ + /* */ + FT_EXPORT( FT_Int ) + FT_Face_GetCharVariantIsDefault( FT_Face face, + FT_ULong charcode, + FT_ULong variantSelector ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Face_GetVariantSelectors */ + /* */ + /* <Description> */ + /* Return a zero-terminated list of Unicode variant selectors found */ + /* in the font. */ + /* */ + /* <Input> */ + /* face :: */ + /* A handle to the source face object. */ + /* */ + /* <Return> */ + /* A pointer to an array of selector code points, or NULL if there is */ + /* no valid variant selector cmap subtable. */ + /* */ + /* <Note> */ + /* The last item in the array is~0; the array is owned by the */ + /* @FT_Face object but can be overwritten or released on the next */ + /* call to a FreeType function. */ + /* */ + /* <Since> */ + /* 2.3.6 */ + /* */ + FT_EXPORT( FT_UInt32* ) + FT_Face_GetVariantSelectors( FT_Face face ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Face_GetVariantsOfChar */ + /* */ + /* <Description> */ + /* Return a zero-terminated list of Unicode variant selectors found */ + /* for the specified character code. */ + /* */ + /* <Input> */ + /* face :: */ + /* A handle to the source face object. */ + /* */ + /* charcode :: */ + /* The character codepoint in Unicode. */ + /* */ + /* <Return> */ + /* A pointer to an array of variant selector code points which are */ + /* active for the given character, or NULL if the corresponding list */ + /* is empty. */ + /* */ + /* <Note> */ + /* The last item in the array is~0; the array is owned by the */ + /* @FT_Face object but can be overwritten or released on the next */ + /* call to a FreeType function. */ + /* */ + /* <Since> */ + /* 2.3.6 */ + /* */ + FT_EXPORT( FT_UInt32* ) + FT_Face_GetVariantsOfChar( FT_Face face, + FT_ULong charcode ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Face_GetCharsOfVariant */ + /* */ + /* <Description> */ + /* Return a zero-terminated list of Unicode character codes found for */ + /* the specified variant selector. */ + /* */ + /* <Input> */ + /* face :: */ + /* A handle to the source face object. */ + /* */ + /* variantSelector :: */ + /* The variant selector code point in Unicode. */ + /* */ + /* <Return> */ + /* A list of all the code points which are specified by this selector */ + /* (both default and non-default codes are returned) or NULL if there */ + /* is no valid cmap or the variant selector is invalid. */ + /* */ + /* <Note> */ + /* The last item in the array is~0; the array is owned by the */ + /* @FT_Face object but can be overwritten or released on the next */ + /* call to a FreeType function. */ + /* */ + /* <Since> */ + /* 2.3.6 */ + /* */ + FT_EXPORT( FT_UInt32* ) + FT_Face_GetCharsOfVariant( FT_Face face, + FT_ULong variantSelector ); + + + /*************************************************************************/ + /* */ + /* <Section> */ /* computations */ /* */ /* <Title> */ @@ -3149,6 +3565,12 @@ FT_Long c ); + /* */ + + /* The following #if 0 ... #endif is for the documentation formatter, */ + /* hiding the internal `FT_MULFIX_INLINED' macro. */ + +#if 0 /*************************************************************************/ /* */ /* <Function> */ @@ -3182,7 +3604,18 @@ FT_MulFix( FT_Long a, FT_Long b ); + /* */ +#endif +#ifdef FT_MULFIX_INLINED +#define FT_MulFix( a, b ) FT_MULFIX_INLINED( a, b ) +#else + FT_EXPORT( FT_Long ) + FT_MulFix( FT_Long a, + FT_Long b ); +#endif + + /*************************************************************************/ /* */ /* <Function> */ @@ -3202,8 +3635,8 @@ /* The result of `(a*0x10000)/b'. */ /* */ /* <Note> */ - /* The optimization for FT_DivFix() is simple: If (a << 16) fits in */ - /* 32 bits, then the division is computed directly. Otherwise, we */ + /* The optimization for FT_DivFix() is simple: If (a~<<~16) fits in */ + /* 32~bits, then the division is computed directly. Otherwise, we */ /* use a specialized version of @FT_MulDiv. */ /* */ FT_EXPORT( FT_Long ) @@ -3310,26 +3743,27 @@ /************************************************************************* * - * @enum: - * FREETYPE_XXX + * @enum: + * FREETYPE_XXX * - * @description: - * These three macros identify the FreeType source code version. - * Use @FT_Library_Version to access them at runtime. + * @description: + * These three macros identify the FreeType source code version. + * Use @FT_Library_Version to access them at runtime. * - * @values: - * FREETYPE_MAJOR :: The major version number. - * FREETYPE_MINOR :: The minor version number. - * FREETYPE_PATCH :: The patch level. + * @values: + * FREETYPE_MAJOR :: The major version number. + * FREETYPE_MINOR :: The minor version number. + * FREETYPE_PATCH :: The patch level. * - * @note: - * The version number of FreeType if built as a dynamic link library - * with the `libtool' package is _not_ controlled by these three - * macros. + * @note: + * The version number of FreeType if built as a dynamic link library + * with the `libtool' package is _not_ controlled by these three + * macros. + * */ #define FREETYPE_MAJOR 2 #define FREETYPE_MINOR 3 -#define FREETYPE_PATCH 5 +#define FREETYPE_PATCH 11 /*************************************************************************/ @@ -3386,8 +3820,8 @@ /* face :: A face handle. */ /* */ /* <Return> */ - /* 1 if this is a TrueType font that uses one of the patented */ - /* opcodes, 0 otherwise. */ + /* 1~if this is a TrueType font that uses one of the patented */ + /* opcodes, 0~otherwise. */ /* */ /* <Since> */ /* 2.3.5 */ @@ -3413,7 +3847,7 @@ /* */ /* <Return> */ /* The old setting value. This will always be false if this is not */ - /* a SFNT font, or if the unpatented hinter is not compiled in this */ + /* an SFNT font, or if the unpatented hinter is not compiled in this */ /* instance of the library. */ /* */ /* <Since> */ Index: include/freetype/ftadvanc.h =================================================================== --- include/freetype/ftadvanc.h (revision 0) +++ include/freetype/ftadvanc.h (revision 0) @@ -0,0 +1,179 @@ +/***************************************************************************/ +/* */ +/* ftadvanc.h */ +/* */ +/* Quick computation of advance widths (specification only). */ +/* */ +/* Copyright 2008 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 __FTADVANC_H__ +#define __FTADVANC_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /************************************************************************** + * + * @section: + * quick_advance + * + * @title: + * Quick retrieval of advance values + * + * @abstract: + * Retrieve horizontal and vertical advance values without processing + * glyph outlines, if possible. + * + * @description: + * This section contains functions to quickly extract advance values + * without handling glyph outlines, if possible. + */ + + + /*************************************************************************/ + /* */ + /* <Const> */ + /* FT_ADVANCE_FLAG_FAST_ONLY */ + /* */ + /* <Description> */ + /* A bit-flag to be OR-ed with the `flags' parameter of the */ + /* @FT_Get_Advance and @FT_Get_Advances functions. */ + /* */ + /* If set, it indicates that you want these functions to fail if the */ + /* corresponding hinting mode or font driver doesn't allow for very */ + /* quick advance computation. */ + /* */ + /* Typically, glyphs which are either unscaled, unhinted, bitmapped, */ + /* or light-hinted can have their advance width computed very */ + /* quickly. */ + /* */ + /* Normal and bytecode hinted modes, which require loading, scaling, */ + /* and hinting of the glyph outline, are extremely slow by */ + /* comparison. */ + /* */ +#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Advance */ + /* */ + /* <Description> */ + /* Retrieve the advance value of a given glyph outline in an */ + /* @FT_Face. By default, the unhinted advance is returned in font */ + /* units. */ + /* */ + /* <Input> */ + /* face :: The source @FT_Face handle. */ + /* */ + /* gindex :: The glyph index. */ + /* */ + /* load_flags :: A set of bit flags similar to those used when */ + /* calling @FT_Load_Glyph, used to determine what kind */ + /* of advances you need. */ + /* <Output> */ + /* padvance :: The advance value, in either font units or 16.16 */ + /* format. */ + /* */ + /* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */ + /* vertical advance corresponding to a vertical layout. */ + /* Otherwise, it is the horizontal advance in a */ + /* horizontal layout. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ + /* if the corresponding font backend doesn't have a quick way to */ + /* retrieve the advances. */ + /* */ + /* A scaled advance is returned in 16.16 format but isn't transformed */ + /* by the affine transformation specified by @FT_Set_Transform. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Get_Advance( FT_Face face, + FT_UInt gindex, + FT_Int32 load_flags, + FT_Fixed *padvance ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Advances */ + /* */ + /* <Description> */ + /* Retrieve the advance values of several glyph outlines in an */ + /* @FT_Face. By default, the unhinted advances are returned in font */ + /* units. */ + /* */ + /* <Input> */ + /* face :: The source @FT_Face handle. */ + /* */ + /* start :: The first glyph index. */ + /* */ + /* count :: The number of advance values you want to retrieve. */ + /* */ + /* load_flags :: A set of bit flags similar to those used when */ + /* calling @FT_Load_Glyph. */ + /* */ + /* <Output> */ + /* padvance :: The advances, in either font units or 16.16 format. */ + /* This array must contain at least `count' elements. */ + /* */ + /* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */ + /* vertical advances corresponding to a vertical layout. */ + /* Otherwise, they are the horizontal advances in a */ + /* horizontal layout. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ + /* if the corresponding font backend doesn't have a quick way to */ + /* retrieve the advances. */ + /* */ + /* Scaled advances are returned in 16.16 format but aren't */ + /* transformed by the affine transformation specified by */ + /* @FT_Set_Transform. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Get_Advances( FT_Face face, + FT_UInt start, + FT_UInt count, + FT_Int32 load_flags, + FT_Fixed *padvances ); + +/* */ + + +FT_END_HEADER + +#endif /* __FTADVANC_H__ */ + + +/* END */ Index: include/freetype/ftbbox.h =================================================================== --- include/freetype/ftbbox.h (revision 44270) +++ include/freetype/ftbbox.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType exact bbox computation (specification). */ /* */ -/* Copyright 1996-2001, 2003 by */ +/* Copyright 1996-2001, 2003, 2007 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -58,10 +58,10 @@ /* FT_Outline_Get_BBox */ /* */ /* <Description> */ - /* Computes the exact bounding box of an outline. This is slower */ + /* Compute the exact bounding box of an outline. This is slower */ /* than computing the control box. However, it uses an advanced */ /* algorithm which returns _very_ quickly when the two boxes */ - /* coincide. Otherwise, the outline Bézier arcs are walked over to */ + /* coincide. Otherwise, the outline Bézier arcs are traversed to */ /* extract their extrema. */ /* */ /* <Input> */ @@ -71,7 +71,7 @@ /* abbox :: The outline's exact bounding box. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Outline_Get_BBox( FT_Outline* outline, Index: include/freetype/ftbdf.h =================================================================== --- include/freetype/ftbdf.h (revision 44270) +++ include/freetype/ftbdf.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType API for accessing BDF-specific strings (specification). */ /* */ -/* Copyright 2002, 2003, 2004, 2006 by */ +/* Copyright 2002, 2003, 2004, 2006, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -38,38 +38,39 @@ /* bdf_fonts */ /* */ /* <Title> */ - /* BDF Files */ + /* BDF and PCF Files */ /* */ /* <Abstract> */ - /* BDF specific API. */ + /* BDF and PCF specific API. */ /* */ /* <Description> */ - /* This section contains the declaration of BDF specific functions. */ + /* This section contains the declaration of functions specific to BDF */ + /* and PCF fonts. */ /* */ /*************************************************************************/ - /********************************************************************** - * - * @enum: - * FT_PropertyType - * - * @description: - * A list of BDF property types. - * - * @values: - * BDF_PROPERTY_TYPE_NONE :: - * Value 0 is used to indicate a missing property. - * - * BDF_PROPERTY_TYPE_ATOM :: - * Property is a string atom. - * - * BDF_PROPERTY_TYPE_INTEGER :: - * Property is a 32-bit signed integer. - * - * BDF_PROPERTY_TYPE_CARDINAL :: - * Property is a 32-bit unsigned integer. - */ + /********************************************************************** + * + * @enum: + * FT_PropertyType + * + * @description: + * A list of BDF property types. + * + * @values: + * BDF_PROPERTY_TYPE_NONE :: + * Value~0 is used to indicate a missing property. + * + * BDF_PROPERTY_TYPE_ATOM :: + * Property is a string atom. + * + * BDF_PROPERTY_TYPE_INTEGER :: + * Property is a 32-bit signed integer. + * + * BDF_PROPERTY_TYPE_CARDINAL :: + * Property is a 32-bit unsigned integer. + */ typedef enum BDF_PropertyType_ { BDF_PROPERTY_TYPE_NONE = 0, @@ -80,15 +81,15 @@ } BDF_PropertyType; - /********************************************************************** - * - * @type: - * BDF_Property - * - * @description: - * A handle to a @BDF_PropertyRec structure to model a given - * BDF/PCF property. - */ + /********************************************************************** + * + * @type: + * BDF_Property + * + * @description: + * A handle to a @BDF_PropertyRec structure to model a given + * BDF/PCF property. + */ typedef struct BDF_PropertyRec_* BDF_Property; @@ -132,7 +133,7 @@ * FT_Get_BDF_Charset_ID * * @description: - * Retrieves a BDF font character set identity, according to + * Retrieve a BDF font character set identity, according to * the BDF specification. * * @input: @@ -141,13 +142,13 @@ * * @output: * acharset_encoding :: - * Charset encoding, as a C string, owned by the face. + * Charset encoding, as a C~string, owned by the face. * * acharset_registry :: - * Charset registry, as a C string, owned by the face. + * Charset registry, as a C~string, owned by the face. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * This function only works with BDF faces, returning an error otherwise. @@ -164,7 +165,7 @@ * FT_Get_BDF_Property * * @description: - * Retrieves a BDF property from a BDF or PCF font file. + * Retrieve a BDF property from a BDF or PCF font file. * * @input: * face :: A handle to the input face. @@ -175,13 +176,21 @@ * aproperty :: The property. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * This function works with BDF _and_ PCF fonts. It returns an error * otherwise. It also returns an error if the property is not in the * font. * + * A `property' is a either key-value pair within the STARTPROPERTIES + * ... ENDPROPERTIES block of a BDF font or a key-value pair from the + * `info->props' array within a `FontRec' structure of a PCF font. + * + * Integer properties are always stored as `signed' within PCF fonts; + * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value + * for BDF fonts only. + * * In case of error, `aproperty->type' is always set to * @BDF_PROPERTY_TYPE_NONE. */ Index: include/freetype/ftbitmap.h =================================================================== --- include/freetype/ftbitmap.h (revision 44270) +++ include/freetype/ftbitmap.h (working copy) @@ -2,10 +2,9 @@ /* */ /* ftbitmap.h */ /* */ -/* FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */ -/* bitmaps into 8bpp format (specification). */ +/* FreeType utility functions for bitmaps (specification). */ /* */ -/* Copyright 2004, 2005, 2006 by */ +/* Copyright 2004, 2005, 2006, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -72,7 +71,7 @@ /* FT_Bitmap_Copy */ /* */ /* <Description> */ - /* Copies an bitmap into another one. */ + /* Copy a bitmap into another one. */ /* */ /* <Input> */ /* library :: A handle to a library object. */ @@ -83,7 +82,7 @@ /* target :: A handle to the target bitmap. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Bitmap_Copy( FT_Library library, @@ -114,14 +113,14 @@ /* bitmap :: A handle to the target bitmap. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The current implementation restricts `xStrength' to be less than */ - /* or equal to 8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */ + /* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */ /* */ /* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */ - /* you should call `FT_GlyphSlot_Own_Bitmap' on the slot first. */ + /* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */ /* */ FT_EXPORT( FT_Error ) FT_Bitmap_Embolden( FT_Library library, @@ -152,7 +151,7 @@ /* target :: The target bitmap. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* It is possible to call @FT_Bitmap_Convert multiple times without */ @@ -173,6 +172,28 @@ /*************************************************************************/ /* */ /* <Function> */ + /* FT_GlyphSlot_Own_Bitmap */ + /* */ + /* <Description> */ + /* Make sure that a glyph slot owns `slot->bitmap'. */ + /* */ + /* <Input> */ + /* slot :: The glyph slot. */ + /* */ + /* <Return> */ + /* FreeType error code. 0~means success. */ + /* */ + /* <Note> */ + /* This function is to be used in combination with */ + /* @FT_Bitmap_Embolden. */ + /* */ + FT_EXPORT( FT_Error ) + FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot ); + + + /*************************************************************************/ + /* */ + /* <Function> */ /* FT_Bitmap_Done */ /* */ /* <Description> */ @@ -184,7 +205,7 @@ /* bitmap :: The bitmap object to be freed. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The `library' argument is taken to have access to FreeType's */ Index: include/freetype/ftcache.h =================================================================== --- include/freetype/ftcache.h (revision 44270) +++ include/freetype/ftcache.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType Cache subsystem (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -36,10 +36,10 @@ * Cache Sub-System * * <Abstract> - * How to cache face, size, and glyph data with FreeType 2. + * How to cache face, size, and glyph data with FreeType~2. * * <Description> - * This section describes the FreeType 2 cache sub-system, which is used + * This section describes the FreeType~2 cache sub-system, which is used * to limit the number of concurrently opened @FT_Face and @FT_Size * objects, as well as caching information like character maps and glyph * images while limiting their maximum memory usage. @@ -165,7 +165,7 @@ * Failure to do so will result in incorrect behaviour or even * memory leaks and crashes. */ - typedef struct FTC_FaceIDRec_* FTC_FaceID; + typedef FT_Pointer FTC_FaceID; /************************************************************************ @@ -193,7 +193,7 @@ * A new @FT_Face handle. * * <Return> - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * <Note> * The third parameter `req_data' is the same as the one passed by the @@ -260,7 +260,7 @@ /* */ /* <Description> */ /* An opaque handle to a cache node object. Each cache node is */ - /* reference-counted. A node with a count of 0 might be flushed */ + /* reference-counted. A node with a count of~0 might be flushed */ /* out of a full cache whenever a lookup request is performed. */ /* */ /* If you lookup nodes, you have the ability to `acquire' them, i.e., */ @@ -279,19 +279,19 @@ /* FTC_Manager_New */ /* */ /* <Description> */ - /* Creates a new cache manager. */ + /* Create a new cache manager. */ /* */ /* <Input> */ /* library :: The parent FreeType library handle to use. */ /* */ /* max_faces :: Maximum number of opened @FT_Face objects managed by */ - /* this cache instance. Use 0 for defaults. */ + /* this cache instance. Use~0 for defaults. */ /* */ /* max_sizes :: Maximum number of opened @FT_Size objects managed by */ - /* this cache instance. Use 0 for defaults. */ + /* this cache instance. 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 */ + /* 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 */ @@ -301,11 +301,11 @@ /* each time it is called (see @FTC_Face_Requester). */ /* */ /* <Output> */ - /* amanager :: A handle to a new manager object. 0 in case of */ + /* amanager :: A handle to a new manager object. 0~in case of */ /* failure. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FTC_Manager_New( FT_Library library, @@ -323,7 +323,7 @@ /* FTC_Manager_Reset */ /* */ /* <Description> */ - /* Empties a given cache manager. This simply gets rid of all the */ + /* Empty a given cache manager. This simply gets rid of all the */ /* currently cached @FT_Face and @FT_Size objects within the manager. */ /* */ /* <InOut> */ @@ -339,7 +339,7 @@ /* FTC_Manager_Done */ /* */ /* <Description> */ - /* Destroys a given manager after emptying it. */ + /* Destroy a given manager after emptying it. */ /* */ /* <Input> */ /* manager :: A handle to the target cache manager object. */ @@ -354,7 +354,7 @@ /* FTC_Manager_LookupFace */ /* */ /* <Description> */ - /* Retrieves the @FT_Face object that corresponds to a given face ID */ + /* Retrieve the @FT_Face object that corresponds to a given face ID */ /* through a cache manager. */ /* */ /* <Input> */ @@ -366,7 +366,7 @@ /* aface :: A handle to the face object. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The returned @FT_Face object is always owned by the manager. You */ @@ -415,10 +415,10 @@ /* interpreted as integer pixel character sizes. */ /* Otherwise, they are expressed as 1/64th of points. */ /* */ - /* x_res :: Only used when `pixel' is value 0 to indicate the */ + /* x_res :: Only used when `pixel' is value~0 to indicate the */ /* horizontal resolution in dpi. */ /* */ - /* y_res :: Only used when `pixel' is value 0 to indicate the */ + /* y_res :: Only used when `pixel' is value~0 to indicate the */ /* vertical resolution in dpi. */ /* */ /* <Note> */ @@ -434,11 +434,22 @@ FT_UInt x_res; FT_UInt y_res; - } FTC_ScalerRec, *FTC_Scaler; + } FTC_ScalerRec; /*************************************************************************/ /* */ + /* <Struct> */ + /* FTC_Scaler */ + /* */ + /* <Description> */ + /* A handle to an @FTC_ScalerRec structure. */ + /* */ + typedef struct FTC_ScalerRec_* FTC_Scaler; + + + /*************************************************************************/ + /* */ /* <Function> */ /* FTC_Manager_LookupSize */ /* */ @@ -455,7 +466,7 @@ /* asize :: A handle to the size object. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The returned @FT_Size object is always owned by the manager. You */ @@ -569,7 +580,7 @@ * A new cache handle. NULL in case of error. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * Like all other caches, this one will be destroyed with the cache @@ -598,13 +609,14 @@ * The source face ID. * * cmap_index :: - * The index of the charmap in the source face. + * The index of the charmap in the source face. Any negative value + * means to use the cache @FT_Face's default charmap. * * char_code :: * The character code (in the corresponding charmap). * * @return: - * Glyph index. 0 means `no glyph'. + * Glyph index. 0~means `no glyph'. * */ FT_EXPORT( FT_UInt ) @@ -710,7 +722,7 @@ /* FTC_ImageCache_New */ /* */ /* <Description> */ - /* Creates a new glyph image cache. */ + /* Create a new glyph image cache. */ /* */ /* <Input> */ /* manager :: The parent manager for the image cache. */ @@ -719,7 +731,7 @@ /* acache :: A handle to the new glyph image cache object. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FTC_ImageCache_New( FTC_Manager manager, @@ -732,7 +744,7 @@ /* FTC_ImageCache_Lookup */ /* */ /* <Description> */ - /* Retrieves a given glyph image from a glyph image cache. */ + /* Retrieve a given glyph image from a glyph image cache. */ /* */ /* <Input> */ /* cache :: A handle to the source glyph image cache. */ @@ -742,7 +754,7 @@ /* gindex :: The glyph index to retrieve. */ /* */ /* <Output> */ - /* aglyph :: The corresponding @FT_Glyph object. 0 in case of */ + /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */ /* failure. */ /* */ /* anode :: Used to return the address of of the corresponding cache */ @@ -750,7 +762,7 @@ /* below). */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The returned glyph is owned and managed by the glyph image cache. */ @@ -795,7 +807,7 @@ /* gindex :: The glyph index to retrieve. */ /* */ /* <Output> */ - /* aglyph :: The corresponding @FT_Glyph object. 0 in case of */ + /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */ /* failure. */ /* */ /* anode :: Used to return the address of of the corresponding */ @@ -803,7 +815,7 @@ /* (see note below). */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The returned glyph is owned and managed by the glyph image cache. */ @@ -821,6 +833,9 @@ /* call to one of the caching sub-system APIs. Don't assume that it */ /* is persistent! */ /* */ + /* Calls to @FT_Set_Char_Size and friends have no effect on cached */ + /* glyphs; you should always use the FreeType cache API instead. */ + /* */ FT_EXPORT( FT_Error ) FTC_ImageCache_LookupScaler( FTC_ImageCache cache, FTC_Scaler scaler, @@ -862,11 +877,11 @@ /* top :: The vertical distance from the pen position (on the */ /* baseline) to the upper bitmap border (a.k.a. `top */ /* side bearing'). The distance is positive for upwards */ - /* Y coordinates. */ + /* y~coordinates. */ /* */ /* format :: The format of the glyph bitmap (monochrome or gray). */ /* */ - /* max_grays :: Maximum gray level value (in the range 1 to 255). */ + /* max_grays :: Maximum gray level value (in the range 1 to~255). */ /* */ /* pitch :: The number of bytes per bitmap line. May be positive */ /* or negative. */ @@ -915,7 +930,7 @@ /* FTC_SBitCache_New */ /* */ /* <Description> */ - /* Creates a new cache to store small glyph bitmaps. */ + /* Create a new cache to store small glyph bitmaps. */ /* */ /* <Input> */ /* manager :: A handle to the source cache manager. */ @@ -924,7 +939,7 @@ /* acache :: A handle to the new sbit cache. NULL in case of error. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FTC_SBitCache_New( FTC_Manager manager, @@ -937,7 +952,7 @@ /* FTC_SBitCache_Lookup */ /* */ /* <Description> */ - /* Looks up a given small glyph bitmap in a given sbit cache and */ + /* Look up a given small glyph bitmap in a given sbit cache and */ /* `lock' it to prevent its flushing from the cache until needed. */ /* */ /* <Input> */ @@ -955,7 +970,7 @@ /* below). */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The small bitmap descriptor and its bit buffer are owned by the */ @@ -963,7 +978,7 @@ /* as well disappear from memory on the next cache lookup, so don't */ /* treat them as persistent data. */ /* */ - /* The descriptor's `buffer' field is set to 0 to indicate a missing */ + /* The descriptor's `buffer' field is set to~0 to indicate a missing */ /* glyph bitmap. */ /* */ /* If `anode' is _not_ NULL, it receives the address of the cache */ @@ -1010,7 +1025,7 @@ /* (see note below). */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The small bitmap descriptor and its bit buffer are owned by the */ @@ -1018,7 +1033,7 @@ /* as well disappear from memory on the next cache lookup, so don't */ /* treat them as persistent data. */ /* */ - /* The descriptor's `buffer' field is set to 0 to indicate a missing */ + /* The descriptor's `buffer' field is set to~0 to indicate a missing */ /* glyph bitmap. */ /* */ /* If `anode' is _not_ NULL, it receives the address of the cache */ Index: include/freetype/ftchapters.h =================================================================== --- include/freetype/ftchapters.h (revision 44270) +++ include/freetype/ftchapters.h (working copy) @@ -32,6 +32,7 @@ /* version */ /* basic_types */ /* base_interface */ +/* glyph_variants */ /* glyph_management */ /* mac_specific */ /* sizes_management */ @@ -54,6 +55,7 @@ /* type1_tables */ /* sfnt_names */ /* bdf_fonts */ +/* cid_fonts */ /* pfr_fonts */ /* winfnt_fonts */ /* font_formats */ @@ -88,6 +90,7 @@ /* computations */ /* list_processing */ /* outline_processing */ +/* quick_advance */ /* bitmap_handling */ /* raster */ /* glyph_stroker */ Index: include/freetype/ftcid.h =================================================================== --- include/freetype/ftcid.h (revision 0) +++ include/freetype/ftcid.h (revision 0) @@ -0,0 +1,166 @@ +/***************************************************************************/ +/* */ +/* ftcid.h */ +/* */ +/* FreeType API for accessing CID font information (specification). */ +/* */ +/* Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal. */ +/* */ +/* 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 __FTCID_H__ +#define __FTCID_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* cid_fonts */ + /* */ + /* <Title> */ + /* CID Fonts */ + /* */ + /* <Abstract> */ + /* CID-keyed font specific API. */ + /* */ + /* <Description> */ + /* This section contains the declaration of CID-keyed font specific */ + /* functions. */ + /* */ + /*************************************************************************/ + + + /********************************************************************** + * + * @function: + * FT_Get_CID_Registry_Ordering_Supplement + * + * @description: + * Retrieve the Registry/Ordering/Supplement triple (also known as the + * "R/O/S") from a CID-keyed font. + * + * @input: + * face :: + * A handle to the input face. + * + * @output: + * registry :: + * The registry, as a C~string, owned by the face. + * + * ordering :: + * The ordering, as a C~string, owned by the face. + * + * supplement :: + * The supplement. + * + * @return: + * FreeType error code. 0~means success. + * + * @note: + * This function only works with CID faces, returning an error + * otherwise. + * + * @since: + * 2.3.6 + */ + FT_EXPORT( FT_Error ) + FT_Get_CID_Registry_Ordering_Supplement( FT_Face face, + const char* *registry, + const char* *ordering, + FT_Int *supplement); + + + /********************************************************************** + * + * @function: + * FT_Get_CID_Is_Internally_CID_Keyed + * + * @description: + * Retrieve the type of the input face, CID keyed or not. In + * constrast to the @FT_IS_CID_KEYED macro this function returns + * successfully also for CID-keyed fonts in an SNFT wrapper. + * + * @input: + * face :: + * A handle to the input face. + * + * @output: + * is_cid :: + * The type of the face as an @FT_Bool. + * + * @return: + * FreeType error code. 0~means success. + * + * @note: + * This function only works with CID faces and OpenType fonts, + * returning an error otherwise. + * + * @since: + * 2.3.9 + */ + FT_EXPORT( FT_Error ) + FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face, + FT_Bool *is_cid ); + + + /********************************************************************** + * + * @function: + * FT_Get_CID_From_Glyph_Index + * + * @description: + * Retrieve the CID of the input glyph index. + * + * @input: + * face :: + * A handle to the input face. + * + * glyph_index :: + * The input glyph index. + * + * @output: + * cid :: + * The CID as an @FT_UInt. + * + * @return: + * FreeType error code. 0~means success. + * + * @note: + * This function only works with CID faces and OpenType fonts, + * returning an error otherwise. + * + * @since: + * 2.3.9 + */ + FT_EXPORT( FT_Error ) + FT_Get_CID_From_Glyph_Index( FT_Face face, + FT_UInt glyph_index, + FT_UInt *cid ); + + /* */ + +FT_END_HEADER + +#endif /* __FTCID_H__ */ + + +/* END */ Index: include/freetype/ftgasp.h =================================================================== --- include/freetype/ftgasp.h (revision 44270) +++ include/freetype/ftgasp.h (working copy) @@ -4,7 +4,7 @@ /* */ /* Access of TrueType's `gasp' table (specification). */ /* */ -/* Copyright 2007 by */ +/* Copyright 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -22,6 +22,13 @@ #include <ft2build.h> #include FT_FREETYPE_H +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + /*************************************************************************** * * @section: @@ -31,11 +38,11 @@ * Gasp Table * * @abstract: - * Retrieving TrueType `gasp' table entries + * Retrieving TrueType `gasp' table entries. * * @description: * The function @FT_Get_Gasp can be used to query a TrueType or OpenType - * font for specific entries in their `gasp' table, if any. This is + * font for specific entries in its `gasp' table, if any. This is * mainly useful when implementing native TrueType hinting with the * bytecode interpreter to duplicate the Windows text rendering results. */ @@ -95,7 +102,7 @@ * ppem :: The vertical character pixel size. * * @return: - * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE is there is no + * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no * `gasp' table in the face. * * @since: Index: include/freetype/ftglyph.h =================================================================== --- include/freetype/ftglyph.h (revision 44270) +++ include/freetype/ftglyph.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType convenience functions to handle glyphs (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2006 by */ +/* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -145,7 +145,7 @@ /* */ /* top :: The top-side bearing, i.e., the vertical distance from */ /* the current pen position to the top border of the glyph */ - /* bitmap. This distance is positive for upwards-y! */ + /* bitmap. This distance is positive for upwards~y! */ /* */ /* bitmap :: A descriptor for the bitmap. */ /* */ @@ -194,7 +194,7 @@ /* outline :: A descriptor for the outline. */ /* */ /* <Note> */ - /* You can typecast a @FT_Glyph to @FT_OutlineGlyph if you have */ + /* You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have */ /* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */ /* the outline's content easily. */ /* */ @@ -219,7 +219,8 @@ /* FT_Get_Glyph */ /* */ /* <Description> */ - /* A function used to extract a glyph image from a slot. */ + /* A function used to extract a glyph image from a slot. Note that */ + /* the created @FT_Glyph object must be released with @FT_Done_Glyph. */ /* */ /* <Input> */ /* slot :: A handle to the source glyph slot. */ @@ -228,7 +229,7 @@ /* aglyph :: A handle to the glyph object. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Get_Glyph( FT_GlyphSlot slot, @@ -248,11 +249,11 @@ /* source :: A handle to the source glyph object. */ /* */ /* <Output> */ - /* target :: A handle to the target glyph object. 0 in case of */ + /* target :: A handle to the target glyph object. 0~in case of */ /* error. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Glyph_Copy( FT_Glyph source, @@ -265,7 +266,7 @@ /* FT_Glyph_Transform */ /* */ /* <Description> */ - /* Transforms a glyph image if its format is scalable. */ + /* Transform a glyph image if its format is scalable. */ /* */ /* <InOut> */ /* glyph :: A handle to the target glyph object. */ @@ -375,7 +376,7 @@ /* expressed in 1/64th of pixels if it is grid-fitted. */ /* */ /* <Note> */ - /* Coordinates are relative to the glyph origin, using the Y-upwards */ + /* Coordinates are relative to the glyph origin, using the y~upwards */ /* convention. */ /* */ /* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */ @@ -421,17 +422,17 @@ /* FT_Glyph_To_Bitmap */ /* */ /* <Description> */ - /* Converts a given glyph object to a bitmap glyph object. */ + /* Convert a given glyph object to a bitmap glyph object. */ /* */ /* <InOut> */ /* the_glyph :: A pointer to a handle to the target glyph. */ /* */ /* <Input> */ - /* render_mode :: An enumeration that describe how the data is */ + /* render_mode :: An enumeration that describes how the data is */ /* rendered. */ /* */ /* origin :: A pointer to a vector used to translate the glyph */ - /* image before rendering. Can be 0 (if no */ + /* image before rendering. Can be~0 (if no */ /* translation). The origin is expressed in */ /* 26.6 pixels. */ /* */ @@ -440,15 +441,17 @@ /* never destroyed in case of error. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ + /* This function does nothing if the glyph format isn't scalable. */ + /* */ /* The glyph image is translated with the `origin' vector before */ /* rendering. */ /* */ /* The first parameter is a pointer to an @FT_Glyph handle, that will */ - /* be replaced by this function. Typically, you would use (omitting */ - /* error handling): */ + /* be _replaced_ by this function (with newly allocated data). */ + /* Typically, you would use (omitting error handling): */ /* */ /* */ /* { */ @@ -462,12 +465,12 @@ /* // extract glyph image */ /* error = FT_Get_Glyph( face->glyph, &glyph ); */ /* */ - /* // convert to a bitmap (default render mode + destroy old) */ + /* // convert to a bitmap (default render mode + destroying old) */ /* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */ /* { */ /* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_DEFAULT, */ /* 0, 1 ); */ - /* if ( error ) // glyph unchanged */ + /* if ( error ) // `glyph' unchanged */ /* ... */ /* } */ /* */ @@ -482,8 +485,43 @@ /* } */ /* */ /* */ - /* This function does nothing if the glyph format isn't scalable. */ + /* Here another example, again without error handling: */ /* */ + /* */ + /* { */ + /* FT_Glyph glyphs[MAX_GLYPHS] */ + /* */ + /* */ + /* ... */ + /* */ + /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */ + /* error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) || */ + /* FT_Get_Glyph ( face->glyph, &glyph[idx] ); */ + /* */ + /* ... */ + /* */ + /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */ + /* { */ + /* FT_Glyph bitmap = glyphs[idx]; */ + /* */ + /* */ + /* ... */ + /* */ + /* // after this call, `bitmap' no longer points into */ + /* // the `glyphs' array (and the old value isn't destroyed) */ + /* FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 ); */ + /* */ + /* ... */ + /* */ + /* FT_Done_Glyph( bitmap ); */ + /* } */ + /* */ + /* ... */ + /* */ + /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */ + /* FT_Done_Glyph( glyphs[idx] ); */ + /* } */ + /* */ FT_EXPORT( FT_Error ) FT_Glyph_To_Bitmap( FT_Glyph* the_glyph, FT_Render_Mode render_mode, @@ -497,7 +535,7 @@ /* FT_Done_Glyph */ /* */ /* <Description> */ - /* Destroys a given glyph. */ + /* Destroy a given glyph. */ /* */ /* <Input> */ /* glyph :: A handle to the target glyph object. */ @@ -524,7 +562,7 @@ /* FT_Matrix_Multiply */ /* */ /* <Description> */ - /* Performs the matrix operation `b = a*b'. */ + /* Perform the matrix operation `b = a*b'. */ /* */ /* <Input> */ /* a :: A pointer to matrix `a'. */ @@ -537,7 +575,7 @@ /* */ FT_EXPORT( void ) FT_Matrix_Multiply( const FT_Matrix* a, - FT_Matrix* b ); + FT_Matrix* b ); /*************************************************************************/ @@ -546,14 +584,14 @@ /* FT_Matrix_Invert */ /* */ /* <Description> */ - /* Inverts a 2x2 matrix. Returns an error if it can't be inverted. */ + /* Invert a 2x2 matrix. Return an error if it can't be inverted. */ /* */ /* <InOut> */ /* matrix :: A pointer to the target matrix. Remains untouched in */ /* case of error. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Matrix_Invert( FT_Matrix* matrix ); Index: include/freetype/ftgxval.h =================================================================== --- include/freetype/ftgxval.h (revision 44270) +++ include/freetype/ftgxval.h (working copy) @@ -202,7 +202,7 @@ * The array itself must be allocated by a client. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * This function only works with TrueTypeGX fonts, returning an error @@ -285,14 +285,14 @@ * FT_ClassicKern_Validate * * @description: - * Validate classic (16bit format) kern table to assure that the offsets + * Validate classic (16-bit format) kern table to assure that the offsets * and indices are valid. The idea is that a higher-level library which * actually does the text layout can access those tables without error * checking (which can be quite time consuming). * * The `kern' table validator in @FT_TrueTypeGX_Validate deals with both - * the new 32bit format and the classic 16bit format, while - * FT_ClassicKern_Validate only supports the classic 16bit format. + * the new 32-bit format and the classic 16-bit format, while + * FT_ClassicKern_Validate only supports the classic 16-bit format. * * @input: * face :: @@ -307,7 +307,7 @@ * A pointer to the kern table. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * After use, the application should deallocate the buffers pointed to by Index: include/freetype/ftgzip.h =================================================================== --- include/freetype/ftgzip.h (revision 44270) +++ include/freetype/ftgzip.h (working copy) @@ -66,7 +66,7 @@ * The source stream. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * The source stream must be opened _before_ calling this function. Index: include/freetype/ftimage.h =================================================================== --- include/freetype/ftimage.h (revision 44270) +++ include/freetype/ftimage.h (working copy) @@ -5,7 +5,7 @@ /* FreeType glyph image formats and default raster interface */ /* (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -28,7 +28,7 @@ #define __FTIMAGE_H__ -/* _STANDALONE_ is from ftgrays.c */ + /* _STANDALONE_ is from ftgrays.c */ #ifndef _STANDALONE_ #include <ft2build.h> #endif @@ -53,7 +53,7 @@ /* <Description> */ /* The type FT_Pos is a 32-bit integer used to store vectorial */ /* coordinates. Depending on the context, these can represent */ - /* distances in integer font units, or 16,16, or 26.6 fixed float */ + /* distances in integer font units, or 16.16, or 26.6 fixed float */ /* pixel coordinates. */ /* */ typedef signed long FT_Pos; @@ -119,39 +119,40 @@ /* */ /* <Values> */ /* FT_PIXEL_MODE_NONE :: */ - /* Value 0 is reserved. */ + /* Value~0 is reserved. */ /* */ /* FT_PIXEL_MODE_MONO :: */ - /* A monochrome bitmap, using 1 bit per pixel. Note that pixels */ + /* A monochrome bitmap, using 1~bit per pixel. Note that pixels */ /* are stored in most-significant order (MSB), which means that */ /* the left-most pixel in a byte has value 128. */ /* */ /* FT_PIXEL_MODE_GRAY :: */ /* An 8-bit bitmap, generally used to represent anti-aliased glyph */ /* images. Each pixel is stored in one byte. Note that the number */ - /* of value `gray' levels is stored in the `num_bytes' field of */ - /* the @FT_Bitmap structure (it generally is 256). */ + /* of `gray' levels is stored in the `num_grays' field of the */ + /* @FT_Bitmap structure (it generally is 256). */ /* */ /* FT_PIXEL_MODE_GRAY2 :: */ - /* A 2-bit/pixel bitmap, used to represent embedded anti-aliased */ - /* bitmaps in font files according to the OpenType specification. */ - /* We haven't found a single font using this format, however. */ + /* A 2-bit per pixel bitmap, used to represent embedded */ + /* anti-aliased bitmaps in font files according to the OpenType */ + /* specification. We haven't found a single font using this */ + /* format, however. */ /* */ /* FT_PIXEL_MODE_GRAY4 :: */ - /* A 4-bit/pixel bitmap, used to represent embedded anti-aliased */ + /* A 4-bit per pixel bitmap, representing embedded anti-aliased */ /* bitmaps in font files according to the OpenType specification. */ /* We haven't found a single font using this format, however. */ /* */ /* FT_PIXEL_MODE_LCD :: */ - /* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */ - /* images used for display on LCD displays; the bitmap is three */ - /* times wider than the original glyph image. See also */ + /* An 8-bit bitmap, representing RGB or BGR decimated glyph images */ + /* used for display on LCD displays; the bitmap is three times */ + /* wider than the original glyph image. See also */ /* @FT_RENDER_MODE_LCD. */ /* */ /* FT_PIXEL_MODE_LCD_V :: */ - /* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */ - /* images used for display on rotated LCD displays; the bitmap */ - /* is three times taller than the original glyph image. See also */ + /* An 8-bit bitmap, representing RGB or BGR decimated glyph images */ + /* used for display on rotated LCD displays; the bitmap is three */ + /* times taller than the original glyph image. See also */ /* @FT_RENDER_MODE_LCD_V. */ /* */ typedef enum FT_Pixel_Mode_ @@ -206,11 +207,11 @@ /* An enumeration type to describe the format of a bitmap palette, */ /* used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */ /* */ - /* <Fields> */ - /* ft_palette_mode_rgb :: The palette is an array of 3-bytes RGB */ + /* <Values> */ + /* ft_palette_mode_rgb :: The palette is an array of 3-byte RGB */ /* records. */ /* */ - /* ft_palette_mode_rgba :: The palette is an array of 4-bytes RGBA */ + /* ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA */ /* records. */ /* */ /* <Note> */ @@ -222,7 +223,7 @@ ft_palette_mode_rgb = 0, ft_palette_mode_rgba, - ft_palettte_mode_max /* do not remove */ + ft_palette_mode_max /* do not remove */ } FT_Palette_Mode; @@ -317,14 +318,23 @@ /* elements, giving the outline's point coordinates. */ /* */ /* tags :: A pointer to an array of `n_points' chars, giving */ - /* each outline point's type. If bit 0 is unset, the */ - /* point is `off' the curve, i.e., a Bézier control */ - /* point, while it is `on' when set. */ + /* each outline point's type. */ /* */ - /* Bit 1 is meaningful for `off' points only. If set, */ + /* If bit~0 is unset, the point is `off' the curve, */ + /* i.e., a Bézier control point, while it is `on' if */ + /* set. */ + /* */ + /* Bit~1 is meaningful for `off' points only. If set, */ /* it indicates a third-order Bézier arc control point; */ /* and a second-order control point if unset. */ /* */ + /* If bit~2 is set, bits 5-7 contain the drop-out mode */ + /* (as defined in the OpenType specification; the value */ + /* is the same as the argument to the SCANMODE */ + /* instruction). */ + /* */ + /* Bits 3 and~4 are reserved for internal purposes. */ + /* */ /* contours :: An array of `n_contours' shorts, giving the end */ /* point of each contour within the outline. For */ /* example, the first contour is defined by the points */ @@ -335,6 +345,12 @@ /* and give hints to the scan-converter and hinter on */ /* how to convert/grid-fit it. See @FT_OUTLINE_FLAGS. */ /* */ + /* <Note> */ + /* The B/W rasterizer only checks bit~2 in the `tags' array for the */ + /* first point of each contour. The drop-out mode as given with */ + /* @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and */ + /* @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden. */ + /* */ typedef struct FT_Outline_ { short n_contours; /* number of contours in glyph */ @@ -348,71 +364,91 @@ } FT_Outline; + /* Following limits must be consistent with */ + /* FT_Outline.{n_contours,n_points} */ +#define FT_OUTLINE_CONTOURS_MAX SHRT_MAX +#define FT_OUTLINE_POINTS_MAX SHRT_MAX + /*************************************************************************/ /* */ /* <Enum> */ - /* FT_OUTLINE_FLAGS */ + /* FT_OUTLINE_FLAGS */ /* */ /* <Description> */ /* A list of bit-field constants use for the flags in an outline's */ /* `flags' field. */ /* */ /* <Values> */ - /* FT_OUTLINE_NONE :: Value 0 is reserved. */ + /* FT_OUTLINE_NONE :: */ + /* Value~0 is reserved. */ /* */ - /* FT_OUTLINE_OWNER :: If set, this flag indicates that the */ - /* outline's field arrays (i.e., */ - /* `points', `flags' & `contours') are */ - /* `owned' by the outline object, and */ - /* should thus be freed when it is */ - /* destroyed. */ + /* FT_OUTLINE_OWNER :: */ + /* If set, this flag indicates that the outline's field arrays */ + /* (i.e., `points', `flags', and `contours') are `owned' by the */ + /* outline object, and should thus be freed when it is destroyed. */ /* */ - /* FT_OUTLINE_EVEN_ODD_FILL :: By default, outlines are filled using */ - /* the non-zero winding rule. If set to */ - /* 1, the outline will be filled using */ - /* the even-odd fill rule (only works */ - /* with the smooth raster). */ + /* FT_OUTLINE_EVEN_ODD_FILL :: */ + /* By default, outlines are filled using the non-zero winding rule. */ + /* If set to 1, the outline will be filled using the even-odd fill */ + /* rule (only works with the smooth rasterizer). */ /* */ - /* FT_OUTLINE_REVERSE_FILL :: By default, outside contours of an */ - /* outline are oriented in clock-wise */ - /* direction, as defined in the TrueType */ - /* specification. This flag is set if */ - /* the outline uses the opposite */ - /* direction (typically for Type 1 */ - /* fonts). This flag is ignored by the */ - /* scan-converter. */ + /* FT_OUTLINE_REVERSE_FILL :: */ + /* By default, outside contours of an outline are oriented in */ + /* clock-wise direction, as defined in the TrueType specification. */ + /* This flag is set if the outline uses the opposite direction */ + /* (typically for Type~1 fonts). This flag is ignored by the scan */ + /* converter. */ /* */ - /* FT_OUTLINE_IGNORE_DROPOUTS :: By default, the scan converter will */ - /* try to detect drop-outs in an outline */ - /* and correct the glyph bitmap to */ - /* ensure consistent shape continuity. */ - /* If set, this flag hints the scan-line */ - /* converter to ignore such cases. */ + /* FT_OUTLINE_IGNORE_DROPOUTS :: */ + /* By default, the scan converter will try to detect drop-outs in */ + /* an outline and correct the glyph bitmap to ensure consistent */ + /* shape continuity. If set, this flag hints the scan-line */ + /* converter to ignore such cases. See below for more information. */ /* */ - /* FT_OUTLINE_HIGH_PRECISION :: This flag indicates that the */ - /* scan-line converter should try to */ - /* convert this outline to bitmaps with */ - /* the highest possible quality. It is */ - /* typically set for small character */ - /* sizes. Note that this is only a */ - /* hint, that might be completely */ - /* ignored by a given scan-converter. */ + /* FT_OUTLINE_SMART_DROPOUTS :: */ + /* Select smart dropout control. If unset, use simple dropout */ + /* control. Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See */ + /* below for more information. */ /* */ - /* FT_OUTLINE_SINGLE_PASS :: This flag is set to force a given */ - /* scan-converter to only use a single */ - /* pass over the outline to render a */ - /* bitmap glyph image. Normally, it is */ - /* set for very large character sizes. */ - /* It is only a hint, that might be */ - /* completely ignored by a given */ - /* scan-converter. */ + /* FT_OUTLINE_INCLUDE_STUBS :: */ + /* If set, turn pixels on for `stubs', otherwise exclude them. */ + /* Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for */ + /* more information. */ /* */ + /* FT_OUTLINE_HIGH_PRECISION :: */ + /* This flag indicates that the scan-line converter should try to */ + /* convert this outline to bitmaps with the highest possible */ + /* quality. It is typically set for small character sizes. Note */ + /* that this is only a hint that might be completely ignored by a */ + /* given scan-converter. */ + /* */ + /* FT_OUTLINE_SINGLE_PASS :: */ + /* This flag is set to force a given scan-converter to only use a */ + /* single pass over the outline to render a bitmap glyph image. */ + /* Normally, it is set for very large character sizes. It is only */ + /* a hint that might be completely ignored by a given */ + /* scan-converter. */ + /* */ + /* <Note> */ + /* The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */ + /* and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth */ + /* rasterizer. */ + /* */ + /* There exists a second mechanism to pass the drop-out mode to the */ + /* B/W rasterizer; see the `tags' field in @FT_Outline. */ + /* */ + /* Please refer to the description of the `SCANTYPE' instruction in */ + /* the OpenType specification (in file `ttinst1.doc') how simple */ + /* drop-outs, smart drop-outs, and stubs are defined. */ + /* */ #define FT_OUTLINE_NONE 0x0 #define FT_OUTLINE_OWNER 0x1 #define FT_OUTLINE_EVEN_ODD_FILL 0x2 #define FT_OUTLINE_REVERSE_FILL 0x4 #define FT_OUTLINE_IGNORE_DROPOUTS 0x8 +#define FT_OUTLINE_SMART_DROPOUTS 0x10 +#define FT_OUTLINE_INCLUDE_STUBS 0x20 #define FT_OUTLINE_HIGH_PRECISION 0x100 #define FT_OUTLINE_SINGLE_PASS 0x200 @@ -448,22 +484,25 @@ #define FT_CURVE_TAG( flag ) ( flag & 3 ) -#define FT_CURVE_TAG_ON 1 -#define FT_CURVE_TAG_CONIC 0 -#define FT_CURVE_TAG_CUBIC 2 +#define FT_CURVE_TAG_ON 1 +#define FT_CURVE_TAG_CONIC 0 +#define FT_CURVE_TAG_CUBIC 2 -#define FT_CURVE_TAG_TOUCH_X 8 /* reserved for the TrueType hinter */ -#define FT_CURVE_TAG_TOUCH_Y 16 /* reserved for the TrueType hinter */ +#define FT_CURVE_TAG_HAS_SCANMODE 4 -#define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \ - FT_CURVE_TAG_TOUCH_Y ) +#define FT_CURVE_TAG_TOUCH_X 8 /* reserved for the TrueType hinter */ +#define FT_CURVE_TAG_TOUCH_Y 16 /* reserved for the TrueType hinter */ -#define FT_Curve_Tag_On FT_CURVE_TAG_ON -#define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC -#define FT_Curve_Tag_Cubic FT_CURVE_TAG_CUBIC -#define FT_Curve_Tag_Touch_X FT_CURVE_TAG_TOUCH_X -#define FT_Curve_Tag_Touch_Y FT_CURVE_TAG_TOUCH_Y +#define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \ + FT_CURVE_TAG_TOUCH_Y ) +#define FT_Curve_Tag_On FT_CURVE_TAG_ON +#define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC +#define FT_Curve_Tag_Cubic FT_CURVE_TAG_CUBIC +#define FT_Curve_Tag_Touch_X FT_CURVE_TAG_TOUCH_X +#define FT_Curve_Tag_Touch_Y FT_CURVE_TAG_TOUCH_Y + + /*************************************************************************/ /* */ /* <FuncType> */ @@ -482,7 +521,7 @@ /* decomposition function. */ /* */ /* <Return> */ - /* Error code. 0 means success. */ + /* Error code. 0~means success. */ /* */ typedef int (*FT_Outline_MoveToFunc)( const FT_Vector* to, @@ -490,6 +529,7 @@ #define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc + /*************************************************************************/ /* */ /* <FuncType> */ @@ -508,14 +548,15 @@ /* decomposition function. */ /* */ /* <Return> */ - /* Error code. 0 means success. */ + /* Error code. 0~means success. */ /* */ typedef int (*FT_Outline_LineToFunc)( const FT_Vector* to, void* user ); -#define FT_Outline_LineTo_Func FT_Outline_LineToFunc +#define FT_Outline_LineTo_Func FT_Outline_LineToFunc + /*************************************************************************/ /* */ /* <FuncType> */ @@ -538,15 +579,16 @@ /* the decomposition function. */ /* */ /* <Return> */ - /* Error code. 0 means success. */ + /* Error code. 0~means success. */ /* */ typedef int (*FT_Outline_ConicToFunc)( const FT_Vector* control, const FT_Vector* to, void* user ); -#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc +#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc + /*************************************************************************/ /* */ /* <FuncType> */ @@ -569,7 +611,7 @@ /* the decomposition function. */ /* */ /* <Return> */ - /* Error code. 0 means success. */ + /* Error code. 0~means success. */ /* */ typedef int (*FT_Outline_CubicToFunc)( const FT_Vector* control1, @@ -577,7 +619,7 @@ const FT_Vector* to, void* user ); -#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc +#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc /*************************************************************************/ @@ -615,7 +657,7 @@ /* y' = (x << shift) - delta */ /* } */ /* */ - /* Set the value of `shift' and `delta' to 0 to get the original */ + /* Set the value of `shift' and `delta' to~0 to get the original */ /* point coordinates. */ /* */ typedef struct FT_Outline_Funcs_ @@ -648,7 +690,7 @@ /* This macro converts four-letter tags to an unsigned long type. */ /* */ /* <Note> */ - /* Since many 16bit compilers don't like 32bit enumerations, you */ + /* Since many 16-bit compilers don't like 32-bit enumerations, you */ /* should redefine this macro in case of problems to something like */ /* this: */ /* */ @@ -680,7 +722,7 @@ /* */ /* <Values> */ /* FT_GLYPH_FORMAT_NONE :: */ - /* The value 0 is reserved. */ + /* The value~0 is reserved. */ /* */ /* FT_GLYPH_FORMAT_COMPOSITE :: */ /* The glyph image is a composite of several other images. This */ @@ -700,7 +742,7 @@ /* */ /* FT_GLYPH_FORMAT_PLOTTER :: */ /* The glyph image is a vectorial path with no inside and outside */ - /* contours. Some Type 1 fonts, like those in the Hershey family, */ + /* contours. Some Type~1 fonts, like those in the Hershey family, */ /* contain glyphs in this format. These are described as */ /* @FT_Outline, but FreeType isn't currently capable of rendering */ /* them correctly. */ @@ -812,10 +854,11 @@ /* */ /* <Note> */ /* This structure is used by the span drawing callback type named */ - /* @FT_SpanFunc which takes the y-coordinate of the span as a */ + /* @FT_SpanFunc which takes the y~coordinate of the span as a */ /* a parameter. */ /* */ - /* The coverage value is always between 0 and 255. */ + /* The coverage value is always between 0 and 255. If you want less */ + /* gray values, the callback function has to reduce them. */ /* */ typedef struct FT_Span_ { @@ -837,7 +880,7 @@ /* spans on each scan line. */ /* */ /* <Input> */ - /* y :: The scanline's y-coordinate. */ + /* y :: The scanline's y~coordinate. */ /* */ /* count :: The number of spans to draw on this scanline. */ /* */ @@ -854,8 +897,8 @@ /* */ /* Note that the `count' field cannot be greater than a fixed value */ /* defined by the `FT_MAX_GRAY_SPANS' configuration macro in */ - /* `ftoption.h'. By default, this value is set to 32, which means */ - /* that if there are more than 32 spans on a given scanline, the */ + /* `ftoption.h'. By default, this value is set to~32, which means */ + /* that if there are more than 32~spans on a given scanline, the */ /* callback is called several times with the same `y' parameter in */ /* order to draw all callbacks. */ /* */ @@ -868,7 +911,7 @@ const FT_Span* spans, void* user ); -#define FT_Raster_Span_Func FT_SpanFunc +#define FT_Raster_Span_Func FT_SpanFunc /*************************************************************************/ @@ -885,14 +928,14 @@ /* per-se the TrueType spec. */ /* */ /* <Input> */ - /* y :: The pixel's y-coordinate. */ + /* y :: The pixel's y~coordinate. */ /* */ - /* x :: The pixel's x-coordinate. */ + /* x :: The pixel's x~coordinate. */ /* */ /* user :: User-supplied data that is passed to the callback. */ /* */ /* <Return> */ - /* 1 if the pixel is `set', 0 otherwise. */ + /* 1~if the pixel is `set', 0~otherwise. */ /* */ typedef int (*FT_Raster_BitTest_Func)( int y, @@ -913,14 +956,14 @@ /* drop-out control according to the TrueType specification. */ /* */ /* <Input> */ - /* y :: The pixel's y-coordinate. */ + /* y :: The pixel's y~coordinate. */ /* */ - /* x :: The pixel's x-coordinate. */ + /* x :: The pixel's x~coordinate. */ /* */ /* user :: User-supplied data that is passed to the callback. */ /* */ /* <Return> */ - /* 1 if the pixel is `set', 0 otherwise. */ + /* 1~if the pixel is `set', 0~otherwise. */ /* */ typedef void (*FT_Raster_BitSet_Func)( int y, @@ -999,7 +1042,7 @@ /* */ /* gray_spans :: The gray span drawing callback. */ /* */ - /* black_spans :: The black span drawing callback. */ + /* black_spans :: The black span drawing callback. UNIMPLEMENTED! */ /* */ /* bit_test :: The bit test callback. UNIMPLEMENTED! */ /* */ @@ -1036,7 +1079,7 @@ const void* source; int flags; FT_SpanFunc gray_spans; - FT_SpanFunc black_spans; + FT_SpanFunc black_spans; /* doesn't work! */ FT_Raster_BitTest_Func bit_test; /* doesn't work! */ FT_Raster_BitSet_Func bit_set; /* doesn't work! */ void* user; @@ -1060,7 +1103,7 @@ /* raster :: A handle to the new raster object. */ /* */ /* <Return> */ - /* Error code. 0 means success. */ + /* Error code. 0~means success. */ /* */ /* <Note> */ /* The `memory' parameter is a typeless pointer in order to avoid */ @@ -1073,8 +1116,9 @@ (*FT_Raster_NewFunc)( void* memory, FT_Raster* raster ); -#define FT_Raster_New_Func FT_Raster_NewFunc +#define FT_Raster_New_Func FT_Raster_NewFunc + /*************************************************************************/ /* */ /* <FuncType> */ @@ -1089,8 +1133,9 @@ typedef void (*FT_Raster_DoneFunc)( FT_Raster raster ); -#define FT_Raster_Done_Func FT_Raster_DoneFunc +#define FT_Raster_Done_Func FT_Raster_DoneFunc + /*************************************************************************/ /* */ /* <FuncType> */ @@ -1123,8 +1168,9 @@ unsigned char* pool_base, unsigned long pool_size ); -#define FT_Raster_Reset_Func FT_Raster_ResetFunc +#define FT_Raster_Reset_Func FT_Raster_ResetFunc + /*************************************************************************/ /* */ /* <FuncType> */ @@ -1148,16 +1194,17 @@ unsigned long mode, void* args ); -#define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc +#define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc + /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Raster_RenderFunc */ /* */ /* <Description> */ - /* Invokes a given raster to scan-convert a given glyph image into a */ - /* target bitmap. */ + /* Invoke a given raster to scan-convert a given glyph image into a */ + /* target bitmap. */ /* */ /* <Input> */ /* raster :: A handle to the raster object. */ @@ -1166,7 +1213,7 @@ /* store the rendering parameters. */ /* */ /* <Return> */ - /* Error code. 0 means success. */ + /* Error code. 0~means success. */ /* */ /* <Note> */ /* The exact format of the source image depends on the raster's glyph */ @@ -1188,8 +1235,9 @@ (*FT_Raster_RenderFunc)( FT_Raster raster, const FT_Raster_Params* params ); -#define FT_Raster_Render_Func FT_Raster_RenderFunc +#define FT_Raster_Render_Func FT_Raster_RenderFunc + /*************************************************************************/ /* */ /* <Struct> */ @@ -1211,12 +1259,12 @@ /* */ typedef struct FT_Raster_Funcs_ { - FT_Glyph_Format glyph_format; - FT_Raster_NewFunc raster_new; - FT_Raster_ResetFunc raster_reset; - FT_Raster_SetModeFunc raster_set_mode; - FT_Raster_RenderFunc raster_render; - FT_Raster_DoneFunc raster_done; + FT_Glyph_Format glyph_format; + FT_Raster_NewFunc raster_new; + FT_Raster_ResetFunc raster_reset; + FT_Raster_SetModeFunc raster_set_mode; + FT_Raster_RenderFunc raster_render; + FT_Raster_DoneFunc raster_done; } FT_Raster_Funcs; Index: include/freetype/ftincrem.h =================================================================== --- include/freetype/ftincrem.h (revision 44270) +++ include/freetype/ftincrem.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType incremental loading (specification). */ /* */ -/* Copyright 2002, 2003, 2006, 2007 by */ +/* Copyright 2002, 2003, 2006, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -31,192 +31,208 @@ FT_BEGIN_HEADER - /*************************************************************************** - * - * @section: - * incremental - * - * @title: - * Incremental Loading - * - * @abstract: - * Custom Glyph Loading. - * - * @description: - * This section contains various functions used to perform so-called - * `incremental' glyph loading. This is a mode where all glyphs loaded - * from a given @FT_Face are provided by the client application, - * - * Apart from that, all other tables are loaded normally from the font - * file. This mode is useful when FreeType is used within another - * engine, e.g., a Postscript Imaging Processor. - * - * To enable this mode, you must use @FT_Open_Face, passing an - * @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an - * @FT_Incremental_Interface value. See the comments for - * @FT_Incremental_InterfaceRec for an example. - * - */ + /*************************************************************************** + * + * @section: + * incremental + * + * @title: + * Incremental Loading + * + * @abstract: + * Custom Glyph Loading. + * + * @description: + * This section contains various functions used to perform so-called + * `incremental' glyph loading. This is a mode where all glyphs loaded + * from a given @FT_Face are provided by the client application, + * + * Apart from that, all other tables are loaded normally from the font + * file. This mode is useful when FreeType is used within another + * engine, e.g., a PostScript Imaging Processor. + * + * To enable this mode, you must use @FT_Open_Face, passing an + * @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an + * @FT_Incremental_Interface value. See the comments for + * @FT_Incremental_InterfaceRec for an example. + * + */ - /*************************************************************************** - * - * @type: - * FT_Incremental - * - * @description: - * An opaque type describing a user-provided object used to implement - * `incremental' glyph loading within FreeType. This is used to support - * embedded fonts in certain environments (e.g., Postscript interpreters), - * where the glyph data isn't in the font file, or must be overridden by - * different values. - * - * @note: - * It is up to client applications to create and implement @FT_Incremental - * objects, as long as they provide implementations for the methods - * @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc - * and @FT_Incremental_GetGlyphMetricsFunc. - * - * See the description of @FT_Incremental_InterfaceRec to understand how - * to use incremental objects with FreeType. - */ + /*************************************************************************** + * + * @type: + * FT_Incremental + * + * @description: + * An opaque type describing a user-provided object used to implement + * `incremental' glyph loading within FreeType. This is used to support + * embedded fonts in certain environments (e.g., PostScript interpreters), + * where the glyph data isn't in the font file, or must be overridden by + * different values. + * + * @note: + * It is up to client applications to create and implement @FT_Incremental + * objects, as long as they provide implementations for the methods + * @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc + * and @FT_Incremental_GetGlyphMetricsFunc. + * + * See the description of @FT_Incremental_InterfaceRec to understand how + * to use incremental objects with FreeType. + * + */ typedef struct FT_IncrementalRec_* FT_Incremental; - /*************************************************************************** - * - * @struct: - * FT_Incremental_Metrics - * - * @description: - * A small structure used to contain the basic glyph metrics returned - * by the @FT_Incremental_GetGlyphMetricsFunc method. - * - * @fields: - * bearing_x :: - * Left bearing, in font units. - * - * bearing_y :: - * Top bearing, in font units. - * - * advance :: - * Glyph advance, in font units. - * - * @note: - * These correspond to horizontal or vertical metrics depending on the - * value of the `vertical' argument to the function - * @FT_Incremental_GetGlyphMetricsFunc. - */ + /*************************************************************************** + * + * @struct: + * FT_Incremental_MetricsRec + * + * @description: + * A small structure used to contain the basic glyph metrics returned + * by the @FT_Incremental_GetGlyphMetricsFunc method. + * + * @fields: + * bearing_x :: + * Left bearing, in font units. + * + * bearing_y :: + * Top bearing, in font units. + * + * advance :: + * Glyph advance, in font units. + * + * @note: + * These correspond to horizontal or vertical metrics depending on the + * value of the `vertical' argument to the function + * @FT_Incremental_GetGlyphMetricsFunc. + * + */ typedef struct FT_Incremental_MetricsRec_ { FT_Long bearing_x; FT_Long bearing_y; FT_Long advance; - } FT_Incremental_MetricsRec, *FT_Incremental_Metrics; + } FT_Incremental_MetricsRec; - /*************************************************************************** - * - * @type: - * FT_Incremental_GetGlyphDataFunc - * - * @description: - * A function called by FreeType to access a given glyph's data bytes - * during @FT_Load_Glyph or @FT_Load_Char if incremental loading is - * enabled. - * - * Note that the format of the glyph's data bytes depends on the font - * file format. For TrueType, it must correspond to the raw bytes within - * the `glyf' table. For Postscript formats, it must correspond to the - * *unencrypted* charstring bytes, without any `lenIV' header. It is - * undefined for any other format. - * - * @input: - * incremental :: - * Handle to an opaque @FT_Incremental handle provided by the client - * application. - * - * glyph_index :: - * Index of relevant glyph. - * - * @output: - * adata :: - * A structure describing the returned glyph data bytes (which will be - * accessed as a read-only byte block). - * - * @return: - * FreeType error code. 0 means success. - * - * @note: - * If this function returns successfully the method - * @FT_Incremental_FreeGlyphDataFunc will be called later to release - * the data bytes. - * - * Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for - * compound glyphs. - */ + /*************************************************************************** + * + * @struct: + * FT_Incremental_Metrics + * + * @description: + * A handle to an @FT_Incremental_MetricsRec structure. + * + */ + typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics; + + + /*************************************************************************** + * + * @type: + * FT_Incremental_GetGlyphDataFunc + * + * @description: + * A function called by FreeType to access a given glyph's data bytes + * during @FT_Load_Glyph or @FT_Load_Char if incremental loading is + * enabled. + * + * Note that the format of the glyph's data bytes depends on the font + * file format. For TrueType, it must correspond to the raw bytes within + * the `glyf' table. For PostScript formats, it must correspond to the + * *unencrypted* charstring bytes, without any `lenIV' header. It is + * undefined for any other format. + * + * @input: + * incremental :: + * Handle to an opaque @FT_Incremental handle provided by the client + * application. + * + * glyph_index :: + * Index of relevant glyph. + * + * @output: + * adata :: + * A structure describing the returned glyph data bytes (which will be + * accessed as a read-only byte block). + * + * @return: + * FreeType error code. 0~means success. + * + * @note: + * If this function returns successfully the method + * @FT_Incremental_FreeGlyphDataFunc will be called later to release + * the data bytes. + * + * Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for + * compound glyphs. + * + */ typedef FT_Error (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental, FT_UInt glyph_index, FT_Data* adata ); - /*************************************************************************** - * - * @type: - * FT_Incremental_FreeGlyphDataFunc - * - * @description: - * A function used to release the glyph data bytes returned by a - * successful call to @FT_Incremental_GetGlyphDataFunc. - * - * @input: - * incremental :: - * A handle to an opaque @FT_Incremental handle provided by the client - * application. - * - * data :: - * A structure describing the glyph data bytes (which will be accessed - * as a read-only byte block). - */ + /*************************************************************************** + * + * @type: + * FT_Incremental_FreeGlyphDataFunc + * + * @description: + * A function used to release the glyph data bytes returned by a + * successful call to @FT_Incremental_GetGlyphDataFunc. + * + * @input: + * incremental :: + * A handle to an opaque @FT_Incremental handle provided by the client + * application. + * + * data :: + * A structure describing the glyph data bytes (which will be accessed + * as a read-only byte block). + * + */ typedef void (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental, FT_Data* data ); - /*************************************************************************** - * - * @type: - * FT_Incremental_GetGlyphMetricsFunc - * - * @description: - * A function used to retrieve the basic metrics of a given glyph index - * before accessing its data. This is necessary because, in certain - * formats like TrueType, the metrics are stored in a different place from - * the glyph images proper. - * - * @input: - * incremental :: - * A handle to an opaque @FT_Incremental handle provided by the client - * application. - * - * glyph_index :: - * Index of relevant glyph. - * - * vertical :: - * If true, return vertical metrics. - * - * ametrics :: - * This parameter is used for both input and output. - * The original glyph metrics, if any, in font units. If metrics are - * not available all the values must be set to zero. - * - * @output: - * ametrics :: - * The replacement glyph metrics in font units. - * - */ + /*************************************************************************** + * + * @type: + * FT_Incremental_GetGlyphMetricsFunc + * + * @description: + * A function used to retrieve the basic metrics of a given glyph index + * before accessing its data. This is necessary because, in certain + * formats like TrueType, the metrics are stored in a different place from + * the glyph images proper. + * + * @input: + * incremental :: + * A handle to an opaque @FT_Incremental handle provided by the client + * application. + * + * glyph_index :: + * Index of relevant glyph. + * + * vertical :: + * If true, return vertical metrics. + * + * ametrics :: + * This parameter is used for both input and output. + * The original glyph metrics, if any, in font units. If metrics are + * not available all the values must be set to zero. + * + * @output: + * ametrics :: + * The replacement glyph metrics in font units. + * + */ typedef FT_Error (*FT_Incremental_GetGlyphMetricsFunc) ( FT_Incremental incremental, @@ -244,6 +260,7 @@ * get_glyph_metrics :: * The function to get glyph metrics. May be null if the font does * not provide overriding glyph metrics. + * */ typedef struct FT_Incremental_FuncsRec_ { @@ -254,41 +271,42 @@ } FT_Incremental_FuncsRec; - /*************************************************************************** - * - * @struct: - * FT_Incremental_InterfaceRec - * - * @description: - * A structure to be used with @FT_Open_Face to indicate that the user - * wants to support incremental glyph loading. You should use it with - * @FT_PARAM_TAG_INCREMENTAL as in the following example: - * - * { - * FT_Incremental_InterfaceRec inc_int; - * FT_Parameter parameter; - * FT_Open_Args open_args; - * - * - * // set up incremental descriptor - * inc_int.funcs = my_funcs; - * inc_int.object = my_object; - * - * // set up optional parameter - * parameter.tag = FT_PARAM_TAG_INCREMENTAL; - * parameter.data = &inc_int; - * - * // set up FT_Open_Args structure - * open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; - * open_args.pathname = my_font_pathname; - * open_args.num_params = 1; - * open_args.params = ¶meter; // we use one optional argument - * - * // open the font - * error = FT_Open_Face( library, &open_args, index, &face ); - * ... - * } - */ + /*************************************************************************** + * + * @struct: + * FT_Incremental_InterfaceRec + * + * @description: + * A structure to be used with @FT_Open_Face to indicate that the user + * wants to support incremental glyph loading. You should use it with + * @FT_PARAM_TAG_INCREMENTAL as in the following example: + * + * { + * FT_Incremental_InterfaceRec inc_int; + * FT_Parameter parameter; + * FT_Open_Args open_args; + * + * + * // set up incremental descriptor + * inc_int.funcs = my_funcs; + * inc_int.object = my_object; + * + * // set up optional parameter + * parameter.tag = FT_PARAM_TAG_INCREMENTAL; + * parameter.data = &inc_int; + * + * // set up FT_Open_Args structure + * open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; + * open_args.pathname = my_font_pathname; + * open_args.num_params = 1; + * open_args.params = ¶meter; // we use one optional argument + * + * // open the font + * error = FT_Open_Face( library, &open_args, index, &face ); + * ... + * } + * + */ typedef struct FT_Incremental_InterfaceRec_ { const FT_Incremental_FuncsRec* funcs; @@ -297,31 +315,31 @@ } FT_Incremental_InterfaceRec; - /*************************************************************************** - * - * @type: - * FT_Incremental_Interface - * - * @description: - * A pointer to an @FT_Incremental_InterfaceRec structure. - * - */ + /*************************************************************************** + * + * @type: + * FT_Incremental_Interface + * + * @description: + * A pointer to an @FT_Incremental_InterfaceRec structure. + * + */ typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface; - /*************************************************************************** - * - * @constant: - * FT_PARAM_TAG_INCREMENTAL - * - * @description: - * A constant used as the tag of @FT_Parameter structures to indicate - * an incremental loading object to be used by FreeType. - * - */ + /*************************************************************************** + * + * @constant: + * FT_PARAM_TAG_INCREMENTAL + * + * @description: + * A constant used as the tag of @FT_Parameter structures to indicate + * an incremental loading object to be used by FreeType. + * + */ #define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' ) - /* */ + /* */ FT_END_HEADER Index: include/freetype/ftlcdfil.h =================================================================== --- include/freetype/ftlcdfil.h (revision 44270) +++ include/freetype/ftlcdfil.h (working copy) @@ -5,7 +5,7 @@ /* FreeType API for color filtering of subpixel bitmap glyphs */ /* (specification). */ /* */ -/* Copyright 2006, 2007 by */ +/* Copyright 2006, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -23,7 +23,13 @@ #include <ft2build.h> #include FT_FREETYPE_H +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + FT_BEGIN_HEADER /*************************************************************************** @@ -85,7 +91,7 @@ * @since: * 2.3.0 */ - typedef enum + typedef enum FT_LcdFilter_ { FT_LCD_FILTER_NONE = 0, FT_LCD_FILTER_DEFAULT = 1, @@ -119,7 +125,7 @@ * well on most LCD screens. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * This feature is always disabled by default. Clients must make an @@ -141,8 +147,8 @@ * If this feature is activated, the dimensions of LCD glyph bitmaps are * either larger or taller than the dimensions of the corresponding * outline with regards to the pixel grid. For example, for - * @FT_RENDER_MODE_LCD, the filter adds up to 3 pixels to the left, and - * up to 3 pixels to the right. + * @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and + * up to 3~pixels to the right. * * The bitmap offset values are adjusted correctly, so clients shouldn't * need to modify their layout and glyph positioning code when enabling Index: include/freetype/ftlist.h =================================================================== --- include/freetype/ftlist.h (revision 44270) +++ include/freetype/ftlist.h (working copy) @@ -81,7 +81,7 @@ /* FT_List_Find */ /* */ /* <Description> */ - /* Finds the list node for a given listed object. */ + /* Find the list node for a given listed object. */ /* */ /* <Input> */ /* list :: A pointer to the parent list. */ @@ -101,7 +101,7 @@ /* FT_List_Add */ /* */ /* <Description> */ - /* Appends an element to the end of a list. */ + /* Append an element to the end of a list. */ /* */ /* <InOut> */ /* list :: A pointer to the parent list. */ @@ -118,7 +118,7 @@ /* FT_List_Insert */ /* */ /* <Description> */ - /* Inserts an element at the head of a list. */ + /* Insert an element at the head of a list. */ /* */ /* <InOut> */ /* list :: A pointer to parent list. */ @@ -135,7 +135,7 @@ /* FT_List_Remove */ /* */ /* <Description> */ - /* Removes a node from a list. This function doesn't check whether */ + /* Remove a node from a list. This function doesn't check whether */ /* the node is in the list! */ /* */ /* <Input> */ @@ -155,7 +155,7 @@ /* FT_List_Up */ /* */ /* <Description> */ - /* Moves a node to the head/top of a list. Used to maintain LRU */ + /* Move a node to the head/top of a list. Used to maintain LRU */ /* lists. */ /* */ /* <InOut> */ @@ -193,7 +193,7 @@ /* FT_List_Iterate */ /* */ /* <Description> */ - /* Parses a list and calls a given iterator function on each element. */ + /* Parse a list and calls a given iterator function on each element. */ /* Note that parsing is stopped as soon as one of the iterator calls */ /* returns a non-zero value. */ /* */ @@ -242,7 +242,7 @@ /* FT_List_Finalize */ /* */ /* <Description> */ - /* Destroys all elements in the list as well as the list itself. */ + /* Destroy all elements in the list as well as the list itself. */ /* */ /* <Input> */ /* list :: A handle to the list. */ Index: include/freetype/ftlzw.h =================================================================== --- include/freetype/ftlzw.h (revision 44270) +++ include/freetype/ftlzw.h (working copy) @@ -63,7 +63,7 @@ * source :: The source stream. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * The source stream must be opened _before_ calling this function. Index: include/freetype/ftmac.h =================================================================== --- include/freetype/ftmac.h (revision 44270) +++ include/freetype/ftmac.h (working copy) @@ -18,9 +18,9 @@ /***************************************************************************/ /* */ -/* NOTE: Include this file after <freetype/freetype.h> and after the */ -/* Mac-specific <Types.h> header (or any other Mac header that */ -/* includes <Types.h>); we use Handle type. */ +/* NOTE: Include this file after <freetype/freetype.h> and after any */ +/* Mac-specific headers (because this header uses Mac types such as */ +/* Handle, FSSpec, FSRef, etc.) */ /* */ /***************************************************************************/ @@ -85,7 +85,7 @@ /* aface :: A handle to a new face object. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Notes> */ /* This function can be used to create @FT_Face objects from fonts */ @@ -100,7 +100,8 @@ FT_New_Face_From_FOND( FT_Library library, Handle fond, FT_Long face_index, - FT_Face *aface ); + FT_Face *aface ) + FT_DEPRECATED_ATTRIBUTE; /*************************************************************************/ @@ -123,7 +124,7 @@ /* @FT_New_Face_From_FSSpec. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_GetFile_From_Mac_Name( const char* fontName, @@ -151,7 +152,7 @@ /* @FT_New_Face_From_FSSpec. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_GetFile_From_Mac_ATS_Name( const char* fontName, @@ -182,13 +183,14 @@ /* face_index :: Index of the face. For passing to @FT_New_Face. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_GetFilePath_From_Mac_ATS_Name( const char* fontName, UInt8* path, UInt32 maxPathSize, - FT_Long* face_index ); + FT_Long* face_index ) + FT_DEPRECATED_ATTRIBUTE; /*************************************************************************/ @@ -207,12 +209,12 @@ /* spec :: FSSpec to the font file. */ /* */ /* face_index :: The index of the face within the resource. The */ - /* first face has index 0. */ + /* first face has index~0. */ /* <Output> */ /* aface :: A handle to a new face object. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */ @@ -242,12 +244,12 @@ /* spec :: FSRef to the font file. */ /* */ /* face_index :: The index of the face within the resource. The */ - /* first face has index 0. */ + /* first face has index~0. */ /* <Output> */ /* aface :: A handle to a new face object. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */ Index: include/freetype/ftmm.h =================================================================== --- include/freetype/ftmm.h (revision 44270) +++ include/freetype/ftmm.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType Multiple Master font interface (specification). */ /* */ -/* Copyright 1996-2001, 2003, 2004, 2006 by */ +/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -44,7 +44,7 @@ /* setting design axis coordinates. */ /* */ /* George Williams has extended this interface to make it work with */ - /* both Type 1 Multiple Masters fonts and GX distortable (var) */ + /* both Type~1 Multiple Masters fonts and GX distortable (var) */ /* fonts. Some of these routines only work with MM fonts, others */ /* will work with both types. They are similar enough that a */ /* consistent interface makes sense. */ @@ -91,12 +91,12 @@ /* This structure can't be used for GX var fonts. */ /* */ /* <Fields> */ - /* num_axis :: Number of axes. Cannot exceed 4. */ + /* num_axis :: Number of axes. Cannot exceed~4. */ /* */ /* num_designs :: Number of designs; should be normally 2^num_axis */ - /* even though the Type 1 specification strangely */ + /* even though the Type~1 specification strangely */ /* allows for intermediate designs to be present. This */ - /* number cannot exceed 16. */ + /* number cannot exceed~16. */ /* */ /* axis :: A table of axis descriptors. */ /* */ @@ -187,7 +187,7 @@ /* Some fields are specific to one format and not to the other. */ /* */ /* <Fields> */ - /* num_axis :: The number of axes. The maximum value is 4 for */ + /* num_axis :: The number of axes. The maximum value is~4 for */ /* MM; no limit in GX. */ /* */ /* num_designs :: The number of designs; should be normally */ @@ -227,7 +227,7 @@ /* FT_Get_Multi_Master */ /* */ /* <Description> */ - /* Retrieves the Multiple Master descriptor of a given font. */ + /* Retrieve the Multiple Master descriptor of a given font. */ /* */ /* This function can't be used with GX fonts. */ /* */ @@ -238,7 +238,7 @@ /* amaster :: The Multiple Masters descriptor. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Get_Multi_Master( FT_Face face, @@ -251,18 +251,18 @@ /* FT_Get_MM_Var */ /* */ /* <Description> */ - /* Retrieves the Multiple Master/GX var descriptor of a given font. */ + /* Retrieve the Multiple Master/GX var descriptor of a given font. */ /* */ /* <Input> */ /* face :: A handle to the source face. */ /* */ /* <Output> */ - /* amaster :: The Multiple Masters descriptor. */ + /* amaster :: The Multiple Masters/GX var descriptor. */ /* Allocates a data structure, which the user must free */ /* (a single call to FT_FREE will do it). */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Get_MM_Var( FT_Face face, @@ -290,7 +290,7 @@ /* coords :: An array of design coordinates. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Set_MM_Design_Coordinates( FT_Face face, @@ -317,7 +317,7 @@ /* coords :: An array of design coordinates. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Set_Var_Design_Coordinates( FT_Face face, @@ -345,7 +345,7 @@ /* between 0 and 1.0). */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Set_MM_Blend_Coordinates( FT_Face face, Index: include/freetype/ftmodapi.h =================================================================== --- include/freetype/ftmodapi.h (revision 44270) +++ include/freetype/ftmodapi.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType modules public interface (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2006 by */ +/* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -78,12 +78,50 @@ typedef FT_Pointer FT_Module_Interface; + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Module_Constructor */ + /* */ + /* <Description> */ + /* A function used to initialize (not create) a new module object. */ + /* */ + /* <Input> */ + /* module :: The module to initialize. */ + /* */ typedef FT_Error (*FT_Module_Constructor)( FT_Module module ); + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Module_Destructor */ + /* */ + /* <Description> */ + /* A function used to finalize (not destroy) a given module object. */ + /* */ + /* <Input> */ + /* module :: The module to finalize. */ + /* */ typedef void (*FT_Module_Destructor)( FT_Module module ); + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Module_Requester */ + /* */ + /* <Description> */ + /* A function used to query a given module for a specific interface. */ + /* */ + /* <Input> */ + /* module :: The module to finalize. */ + /* */ + /* name :: The name of the interface in the module. */ + /* */ typedef FT_Module_Interface (*FT_Module_Requester)( FT_Module module, const char* name ); @@ -112,14 +150,11 @@ /* as a 16.16 fixed number (major.minor). Starts */ /* at version 2.0, i.e., 0x20000. */ /* */ - /* module_init :: A function used to initialize (not create) a */ - /* new module object. */ + /* module_init :: The initializing function. */ /* */ - /* module_done :: A function used to finalize (not destroy) a */ - /* given module object */ + /* module_done :: The finalizing function. */ /* */ - /* get_interface :: Queries a given module for a specific */ - /* interface by name. */ + /* get_interface :: The interface requesting function. */ /* */ typedef struct FT_Module_Class_ { @@ -144,7 +179,7 @@ /* FT_Add_Module */ /* */ /* <Description> */ - /* Adds a new module to a given library instance. */ + /* Add a new module to a given library instance. */ /* */ /* <InOut> */ /* library :: A handle to the library object. */ @@ -153,7 +188,7 @@ /* clazz :: A pointer to class descriptor for the module. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* An error will be returned if a module already exists by that name, */ @@ -170,7 +205,7 @@ /* FT_Get_Module */ /* */ /* <Description> */ - /* Finds a module by its name. */ + /* Find a module by its name. */ /* */ /* <Input> */ /* library :: A handle to the library object. */ @@ -178,7 +213,7 @@ /* module_name :: The module's name (as an ASCII string). */ /* */ /* <Return> */ - /* A module handle. 0 if none was found. */ + /* A module handle. 0~if none was found. */ /* */ /* <Note> */ /* FreeType's internal modules aren't documented very well, and you */ @@ -195,7 +230,7 @@ /* FT_Remove_Module */ /* */ /* <Description> */ - /* Removes a given module from a library instance. */ + /* Remove a given module from a library instance. */ /* */ /* <InOut> */ /* library :: A handle to a library object. */ @@ -204,7 +239,7 @@ /* module :: A handle to a module object. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The module object is destroyed by the function in case of success. */ @@ -224,6 +259,10 @@ /* from a given memory object. It is thus possible to use libraries */ /* with distinct memory allocators within the same program. */ /* */ + /* Normally, you would call this function (followed by a call to */ + /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */ + /* instead of @FT_Init_FreeType to initialize the FreeType library. */ + /* */ /* <Input> */ /* memory :: A handle to the original memory object. */ /* */ @@ -231,7 +270,7 @@ /* alibrary :: A pointer to handle of a new library object. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_New_Library( FT_Memory memory, @@ -244,14 +283,14 @@ /* FT_Done_Library */ /* */ /* <Description> */ - /* Discards a given library object. This closes all drivers and */ + /* Discard a given library object. This closes all drivers and */ /* discards all resource objects. */ /* */ /* <Input> */ /* library :: A handle to the target library. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Done_Library( FT_Library library ); @@ -268,7 +307,7 @@ /* FT_Set_Debug_Hook */ /* */ /* <Description> */ - /* Sets a debug hook function for debugging the interpreter of a font */ + /* Set a debug hook function for debugging the interpreter of a font */ /* format. */ /* */ /* <InOut> */ @@ -283,7 +322,7 @@ /* */ /* <Note> */ /* Currently, four debug hook slots are available, but only two (for */ - /* the TrueType and the Type 1 interpreter) are defined. */ + /* the TrueType and the Type~1 interpreter) are defined. */ /* */ /* Since the internal headers of FreeType are no longer installed, */ /* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */ @@ -301,7 +340,7 @@ /* FT_Add_Default_Modules */ /* */ /* <Description> */ - /* Adds the set of default drivers to a given library object. */ + /* Add the set of default drivers to a given library object. */ /* This is only useful when you create a library object with */ /* @FT_New_Library (usually to plug a custom memory manager). */ /* */ @@ -362,7 +401,7 @@ * 2.2 * */ - typedef enum + typedef enum FT_TrueTypeEngineType_ { FT_TRUETYPE_ENGINE_TYPE_NONE = 0, FT_TRUETYPE_ENGINE_TYPE_UNPATENTED, @@ -377,7 +416,7 @@ * FT_Get_TrueType_Engine_Type * * @description: - * Return a @FT_TrueTypeEngineType value to indicate which level of + * Return an @FT_TrueTypeEngineType value to indicate which level of * the TrueType virtual machine a given library instance supports. * * @input: Index: include/freetype/ftotval.h =================================================================== --- include/freetype/ftotval.h (revision 44270) +++ include/freetype/ftotval.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType API for validating OpenType tables (specification). */ /* */ -/* Copyright 2004, 2005, 2006 by */ +/* Copyright 2004, 2005, 2006, 2007 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -56,7 +56,7 @@ /* */ /* <Description> */ /* This section contains the declaration of functions to validate */ - /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF). */ + /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */ /* */ /*************************************************************************/ @@ -86,8 +86,11 @@ * FT_VALIDATE_JSTF :: * Validate JSTF table. * + * FT_VALIDATE_MATH :: + * Validate MATH table. + * * FT_VALIDATE_OT :: - * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF). + * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). * */ #define FT_VALIDATE_BASE 0x0100 @@ -95,12 +98,14 @@ #define FT_VALIDATE_GPOS 0x0400 #define FT_VALIDATE_GSUB 0x0800 #define FT_VALIDATE_JSTF 0x1000 +#define FT_VALIDATE_MATH 0x2000 #define FT_VALIDATE_OT FT_VALIDATE_BASE | \ FT_VALIDATE_GDEF | \ FT_VALIDATE_GPOS | \ FT_VALIDATE_GSUB | \ - FT_VALIDATE_JSTF + FT_VALIDATE_JSTF | \ + FT_VALIDATE_MATH /* */ @@ -140,7 +145,7 @@ * A pointer to the JSTF table. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * This function only works with OpenType fonts, returning an error Index: include/freetype/ftoutln.h =================================================================== --- include/freetype/ftoutln.h (revision 44270) +++ include/freetype/ftoutln.h (working copy) @@ -5,7 +5,7 @@ /* Support for the FT_Outline type used to store glyph shapes of */ /* most scalable font formats (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -84,7 +84,7 @@ /* FT_Outline_Decompose */ /* */ /* <Description> */ - /* Walks over an outline's structure to decompose it into individual */ + /* Walk over an outline's structure to decompose it into individual */ /* segments and Bézier arcs. This function is also able to emit */ /* `move to' and `close to' operations to indicate the start and end */ /* of new contours in the outline. */ @@ -92,7 +92,7 @@ /* <Input> */ /* outline :: A pointer to the source target. */ /* */ - /* func_interface :: A table of `emitters', i.e,. function pointers */ + /* func_interface :: A table of `emitters', i.e., function pointers */ /* called during decomposition to indicate path */ /* operations. */ /* */ @@ -103,7 +103,7 @@ /* decomposition. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Outline_Decompose( FT_Outline* outline, @@ -117,7 +117,7 @@ /* FT_Outline_New */ /* */ /* <Description> */ - /* Creates a new outline of a given size. */ + /* Create a new outline of a given size. */ /* */ /* <Input> */ /* library :: A handle to the library object from where the */ @@ -130,11 +130,10 @@ /* numContours :: The maximal number of contours within the outline. */ /* */ /* <Output> */ - /* anoutline :: A handle to the new outline. NULL in case of */ - /* error. */ + /* anoutline :: A handle to the new outline. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The reason why this function takes a `library' parameter is simply */ @@ -160,7 +159,7 @@ /* FT_Outline_Done */ /* */ /* <Description> */ - /* Destroys an outline created with @FT_Outline_New. */ + /* Destroy an outline created with @FT_Outline_New. */ /* */ /* <Input> */ /* library :: A handle of the library object used to allocate the */ @@ -169,7 +168,7 @@ /* outline :: A pointer to the outline object to be discarded. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* If the outline's `owner' field is not set, only the outline */ @@ -200,7 +199,7 @@ /* outline :: A handle to a source outline. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Outline_Check( FT_Outline* outline ); @@ -212,7 +211,7 @@ /* FT_Outline_Get_CBox */ /* */ /* <Description> */ - /* Returns an outline's `control box'. The control box encloses all */ + /* Return an outline's `control box'. The control box encloses all */ /* the outline's points, including Bézier control points. Though it */ /* coincides with the exact bounding box for most glyphs, it can be */ /* slightly larger in some situations (like when rotating an outline */ @@ -240,7 +239,7 @@ /* FT_Outline_Translate */ /* */ /* <Description> */ - /* Applies a simple translation to the points of an outline. */ + /* Apply a simple translation to the points of an outline. */ /* */ /* <InOut> */ /* outline :: A pointer to the target outline descriptor. */ @@ -262,7 +261,7 @@ /* FT_Outline_Copy */ /* */ /* <Description> */ - /* Copies an outline into another one. Both objects must have the */ + /* Copy an outline into another one. Both objects must have the */ /* same sizes (number of points & number of contours) when this */ /* function is called. */ /* */ @@ -273,7 +272,7 @@ /* target :: A handle to the target outline. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Outline_Copy( const FT_Outline* source, @@ -286,7 +285,7 @@ /* FT_Outline_Transform */ /* */ /* <Description> */ - /* Applies a simple 2x2 matrix to all of an outline's points. Useful */ + /* Apply a simple 2x2 matrix to all of an outline's points. Useful */ /* for applying rotations, slanting, flipping, etc. */ /* */ /* <InOut> */ @@ -310,7 +309,7 @@ /* FT_Outline_Embolden */ /* */ /* <Description> */ - /* Emboldens an outline. The new outline will be at most 4 times */ + /* Embolden an outline. The new outline will be at most 4~times */ /* `strength' pixels wider and higher. You may think of the left and */ /* bottom borders as unchanged. */ /* */ @@ -325,7 +324,7 @@ /* 26.6 pixel format. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The used algorithm to increase or decrease the thickness of the */ @@ -333,6 +332,9 @@ /* situations like acute angles or intersections are sometimes */ /* handled incorrectly. */ /* */ + /* If you need `better' metrics values you should call */ + /* @FT_Outline_Get_CBox ot @FT_Outline_Get_BBox. */ + /* */ /* Example call: */ /* */ /* { */ @@ -352,14 +354,14 @@ /* FT_Outline_Reverse */ /* */ /* <Description> */ - /* Reverses the drawing direction of an outline. This is used to */ + /* Reverse the drawing direction of an outline. This is used to */ /* ensure consistent fill conventions for mirrored glyphs. */ /* */ /* <InOut> */ /* outline :: A pointer to the target outline descriptor. */ /* */ /* <Note> */ - /* This functions toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */ + /* This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */ /* the outline's `flags' field. */ /* */ /* It shouldn't be used by a normal client application, unless it */ @@ -375,7 +377,7 @@ /* FT_Outline_Get_Bitmap */ /* */ /* <Description> */ - /* Renders an outline within a bitmap. The outline's image is simply */ + /* Render an outline within a bitmap. The outline's image is simply */ /* OR-ed to the target bitmap. */ /* */ /* <Input> */ @@ -387,14 +389,19 @@ /* abitmap :: A pointer to the target bitmap descriptor. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* This function does NOT CREATE the bitmap, it only renders an */ - /* outline image within the one you pass to it! */ + /* outline image within the one you pass to it! Consequently, the */ + /* various fields in `abitmap' should be set accordingly. */ /* */ /* It will use the raster corresponding to the default glyph format. */ /* */ + /* The value of the `num_grays' field in `abitmap' is ignored. If */ + /* you select the gray-level rasterizer, and you want less than 256 */ + /* gray levels, you have to use @FT_Outline_Render directly. */ + /* */ FT_EXPORT( FT_Error ) FT_Outline_Get_Bitmap( FT_Library library, FT_Outline* outline, @@ -407,8 +414,8 @@ /* FT_Outline_Render */ /* */ /* <Description> */ - /* Renders an outline within a bitmap using the current scan-convert. */ - /* This functions uses an @FT_Raster_Params structure as an argument, */ + /* Render an outline within a bitmap using the current scan-convert. */ + /* This function uses an @FT_Raster_Params structure as an argument, */ /* allowing advanced features like direct composition, translucency, */ /* etc. */ /* */ @@ -422,7 +429,7 @@ /* describe the rendering operation. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* You should know what you are doing and how @FT_Raster_Params works */ @@ -432,6 +439,11 @@ /* converter is called, which means that the value you give to it is */ /* actually ignored. */ /* */ + /* The gray-level rasterizer always uses 256 gray levels. If you */ + /* want less gray levels, you have to provide your own span callback. */ + /* See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the */ + /* @FT_Raster_Params structure for more details. */ + /* */ FT_EXPORT( FT_Error ) FT_Outline_Render( FT_Library library, FT_Outline* outline, @@ -446,7 +458,7 @@ * @description: * A list of values used to describe an outline's contour orientation. * - * The TrueType and Postscript specifications use different conventions + * The TrueType and PostScript specifications use different conventions * to determine whether outline contours should be filled or unfilled. * * @values: @@ -455,7 +467,7 @@ * be filled, and counter-clockwise ones must be unfilled. * * FT_ORIENTATION_POSTSCRIPT :: - * According to the Postscript specification, counter-clockwise contours + * According to the PostScript specification, counter-clockwise contours * must be filled, and clockwise ones must be unfilled. * * FT_ORIENTATION_FILL_RIGHT :: @@ -465,7 +477,7 @@ * * FT_ORIENTATION_FILL_LEFT :: * This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to - * remember that in Postscript, everything that is to the left of + * remember that in PostScript, everything that is to the left of * the drawing direction of a contour must be filled. * * FT_ORIENTATION_NONE :: @@ -473,7 +485,7 @@ * the glyph have different orientation. * */ - typedef enum + typedef enum FT_Orientation_ { FT_ORIENTATION_TRUETYPE = 0, FT_ORIENTATION_POSTSCRIPT = 1, Index: include/freetype/ftpfr.h =================================================================== --- include/freetype/ftpfr.h (revision 44270) +++ include/freetype/ftpfr.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType API for accessing PFR-specific data (specification only). */ /* */ -/* Copyright 2002, 2003, 2004, 2006 by */ +/* Copyright 2002, 2003, 2004, 2006, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -62,8 +62,8 @@ * * @output: * aoutline_resolution :: - * Outline resolution. This is equivalent to `face->units_per_EM'. - * Optional (parameter can be NULL). + * Outline resolution. This is equivalent to `face->units_per_EM' + * for non-PFR fonts. Optional (parameter can be NULL). * * ametrics_resolution :: * Metrics resolution. This is equivalent to `outline_resolution' @@ -73,14 +73,14 @@ * A 16.16 fixed-point number used to scale distance expressed * in metrics units to device sub-pixels. This is equivalent to * `face->size->x_scale', but for metrics only. Optional (parameter - * can be NULL) + * can be NULL). * * ametrics_y_scale :: * Same as `ametrics_x_scale' but for the vertical direction. - * optional (parameter can be NULL) + * optional (parameter can be NULL). * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * If the input face is not a PFR, this function will return an error. @@ -115,7 +115,7 @@ * avector :: A kerning vector. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * This function always return distances in original PFR metrics @@ -150,7 +150,7 @@ * aadvance :: The glyph advance in metrics units. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics Index: include/freetype/ftrender.h =================================================================== --- include/freetype/ftrender.h (revision 44270) +++ include/freetype/ftrender.h (working copy) @@ -124,27 +124,32 @@ /* The renderer module class descriptor. */ /* */ /* <Fields> */ - /* root :: The root @FT_Module_Class fields. */ + /* root :: The root @FT_Module_Class fields. */ /* */ - /* glyph_format :: The glyph image format this renderer handles. */ + /* glyph_format :: The glyph image format this renderer handles. */ /* */ - /* render_glyph :: A method used to render the image that is in a */ - /* given glyph slot into a bitmap. */ + /* render_glyph :: A method used to render the image that is in a */ + /* given glyph slot into a bitmap. */ /* */ - /* set_mode :: A method used to pass additional parameters. */ + /* transform_glyph :: A method used to transform the image that is in */ + /* a given glyph slot. */ /* */ - /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. This */ - /* is a pointer to its raster's class. */ + /* get_glyph_cbox :: A method used to access the glyph's cbox. */ /* */ - /* raster :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. This */ - /* is a pointer to the corresponding raster object, */ - /* if any. */ + /* set_mode :: A method used to pass additional parameters. */ /* */ + /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */ + /* This is a pointer to its raster's class. */ + /* */ + /* raster :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */ + /* This is a pointer to the corresponding raster */ + /* object, if any. */ + /* */ typedef struct FT_Renderer_Class_ { - FT_Module_Class root; + FT_Module_Class root; - FT_Glyph_Format glyph_format; + FT_Glyph_Format glyph_format; FT_Renderer_RenderFunc render_glyph; FT_Renderer_TransformFunc transform_glyph; @@ -162,7 +167,7 @@ /* FT_Get_Renderer */ /* */ /* <Description> */ - /* Retrieves the current renderer for a given glyph format. */ + /* Retrieve the current renderer for a given glyph format. */ /* */ /* <Input> */ /* library :: A handle to the library object. */ @@ -170,7 +175,7 @@ /* format :: The glyph format. */ /* */ /* <Return> */ - /* A renderer handle. 0 if none found. */ + /* A renderer handle. 0~if none found. */ /* */ /* <Note> */ /* An error will be returned if a module already exists by that name, */ @@ -190,7 +195,7 @@ /* FT_Set_Renderer */ /* */ /* <Description> */ - /* Sets the current renderer to use, and set additional mode. */ + /* Set the current renderer to use, and set additional mode. */ /* */ /* <InOut> */ /* library :: A handle to the library object. */ @@ -203,7 +208,7 @@ /* parameters :: Additional parameters. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* In case of success, the renderer will be used to convert glyph */ Index: include/freetype/ftsizes.h =================================================================== --- include/freetype/ftsizes.h (revision 44270) +++ include/freetype/ftsizes.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType size objects management (specification). */ /* */ -/* Copyright 1996-2001, 2003, 2004, 2006 by */ +/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -89,7 +89,7 @@ /* asize :: A handle to a new size object. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* You need to call @FT_Activate_Size in order to select the new size */ @@ -115,7 +115,7 @@ /* size :: A handle to a target size object. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Done_Size( FT_Size size ); @@ -129,8 +129,8 @@ /* <Description> */ /* Even though it is possible to create several size objects for a */ /* given face (see @FT_New_Size for details), functions like */ - /* @FT_Load_Glyph or @FT_Load_Char only use the last-created one to */ - /* determine the `current character pixel size'. */ + /* @FT_Load_Glyph or @FT_Load_Char only use the one which has been */ + /* activated last to determine the `current character pixel size'. */ /* */ /* This function can be used to `activate' a previously created size */ /* object. */ @@ -139,7 +139,7 @@ /* size :: A handle to a target size object. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* If `face' is the size's parent face object, this function changes */ Index: include/freetype/ftsnames.h =================================================================== --- include/freetype/ftsnames.h (revision 44270) +++ include/freetype/ftsnames.h (working copy) @@ -7,7 +7,7 @@ /* */ /* This is _not_ used to retrieve glyph names! */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2006 by */ +/* Copyright 1996-2001, 2002, 2003, 2006, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -48,7 +48,7 @@ /* Access the names embedded in TrueType and OpenType files. */ /* */ /* <Description> */ - /* The TrueType and OpenType specification allow the inclusion of */ + /* The TrueType and OpenType specifications allow the inclusion of */ /* a special `names table' in font files. This table contains */ /* textual (and internationalized) information regarding the font, */ /* like family name, copyright, version, etc. */ @@ -114,7 +114,7 @@ /* FT_Get_Sfnt_Name_Count */ /* */ /* <Description> */ - /* Retrieves the number of name strings in the SFNT `name' table. */ + /* Retrieve the number of name strings in the SFNT `name' table. */ /* */ /* <Input> */ /* face :: A handle to the source face. */ @@ -132,7 +132,7 @@ /* FT_Get_Sfnt_Name */ /* */ /* <Description> */ - /* Retrieves a string of the SFNT `name' table for a given index. */ + /* Retrieve a string of the SFNT `name' table for a given index. */ /* */ /* <Input> */ /* face :: A handle to the source face. */ @@ -143,11 +143,12 @@ /* aname :: The indexed @FT_SfntName structure. */ /* */ /* <Return> */ - /* FreeType error code. 0 means success. */ + /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The `string' array returned in the `aname' structure is not */ - /* null-terminated. */ + /* null-terminated. The application should deallocate it if it is no */ + /* longer in use. */ /* */ /* Use @FT_Get_Sfnt_Name_Count to get the total number of available */ /* `name' table entries, then do a loop until you get the right */ Index: include/freetype/ftstroke.h =================================================================== --- include/freetype/ftstroke.h (revision 44270) +++ include/freetype/ftstroke.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType path stroker (specification). */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2006 by */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -84,7 +84,7 @@ * is too closed (this is useful to avoid unpleasant spikes * in beveled rendering). */ - typedef enum + typedef enum FT_Stroker_LineJoin_ { FT_STROKER_LINEJOIN_ROUND = 0, FT_STROKER_LINEJOIN_BEVEL, @@ -115,7 +115,7 @@ * The end of lines is rendered as a square around the * last point. */ - typedef enum + typedef enum FT_Stroker_LineCap_ { FT_STROKER_LINECAP_BUTT = 0, FT_STROKER_LINECAP_ROUND, @@ -149,7 +149,7 @@ * You can however use @FT_Outline_GetInsideBorder and * @FT_Outline_GetOutsideBorder to get these. */ - typedef enum + typedef enum FT_StrokerBorder_ { FT_STROKER_BORDER_LEFT = 0, FT_STROKER_BORDER_RIGHT @@ -171,7 +171,7 @@ * The source outline handle. * * @return: - * The border index. @FT_STROKER_BORDER_LEFT for empty or invalid + * The border index. @FT_STROKER_BORDER_RIGHT for empty or invalid * outlines. */ FT_EXPORT( FT_StrokerBorder ) @@ -216,7 +216,7 @@ * A new stroker object handle. NULL in case of error. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. */ FT_EXPORT( FT_Error ) FT_Stroker_New( FT_Library library, @@ -249,7 +249,7 @@ * expressed as 16.16 fixed point value. * * @note: - * The radius is expressed in the same units that the outline + * The radius is expressed in the same units as the outline * coordinates. */ FT_EXPORT( void ) @@ -297,18 +297,18 @@ * The source outline. * * opened :: - * A boolean. If 1, the outline is treated as an open path instead + * A boolean. If~1, the outline is treated as an open path instead * of a closed one. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: - * If `opened' is 0 (the default), the outline is treated as a closed - * path, and the stroker will generate two distinct `border' outlines. + * If `opened' is~0 (the default), the outline is treated as a closed + * path, and the stroker generates two distinct `border' outlines. * - * If `opened' is 1, the outline is processed as an open path, and the - * stroker will generate a single `stroke' outline. + * If `opened' is~1, the outline is processed as an open path, and the + * stroker generates a single `stroke' outline. * * This function calls @FT_Stroker_Rewind automatically. */ @@ -334,10 +334,10 @@ * A pointer to the start vector. * * open :: - * A boolean. If 1, the sub-path is treated as an open one. + * A boolean. If~1, the sub-path is treated as an open one. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * This function is useful when you need to stroke a path that is @@ -362,11 +362,11 @@ * The target stroker handle. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * You should call this function after @FT_Stroker_BeginSubPath. - * If the subpath was not `opened', this function will `draw' a + * If the subpath was not `opened', this function `draws' a * single line segment to the start position when needed. */ FT_EXPORT( FT_Error ) @@ -390,7 +390,7 @@ * A pointer to the destination point. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * You should call this function between @FT_Stroker_BeginSubPath and @@ -421,7 +421,7 @@ * A pointer to the destination point. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * You should call this function between @FT_Stroker_BeginSubPath and @@ -456,7 +456,7 @@ * A pointer to the destination point. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * You should call this function between @FT_Stroker_BeginSubPath and @@ -476,7 +476,7 @@ * * @description: * Call this function once you have finished parsing your paths - * with the stroker. It will return the number of points and + * with the stroker. It returns the number of points and * contours necessary to export one of the `border' or `stroke' * outlines generated by the stroker. * @@ -495,7 +495,7 @@ * The number of contours. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * When an outline, or a sub-path, is `closed', the stroker generates @@ -525,8 +525,8 @@ * export the corresponding border to your own @FT_Outline * structure. * - * Note that this function will append the border points and - * contours to your outline, but will not try to resize its + * Note that this function appends the border points and + * contours to your outline, but does not try to resize its * arrays. * * @input: @@ -583,7 +583,7 @@ * The number of contours. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. */ FT_EXPORT( FT_Error ) FT_Stroker_GetCounts( FT_Stroker stroker, @@ -598,10 +598,10 @@ * * @description: * Call this function after @FT_Stroker_GetBorderCounts to - * export the all borders to your own @FT_Outline structure. + * export all borders to your own @FT_Outline structure. * - * Note that this function will append the border points and - * contours to your outline, but will not try to resize its + * Note that this function appends the border points and + * contours to your outline, but does not try to resize its * arrays. * * @input: @@ -649,11 +649,11 @@ * A stroker handle. * * destroy :: - * A Boolean. If 1, the source glyph object is destroyed + * A Boolean. If~1, the source glyph object is destroyed * on success. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * The source glyph is untouched in case of error. @@ -682,15 +682,15 @@ * A stroker handle. * * inside :: - * A Boolean. If 1, return the inside border, otherwise + * A Boolean. If~1, return the inside border, otherwise * the outside border. * * destroy :: - * A Boolean. If 1, the source glyph object is destroyed + * A Boolean. If~1, the source glyph object is destroyed * on success. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * The source glyph is untouched in case of error. Index: include/freetype/ftsynth.h =================================================================== --- include/freetype/ftsynth.h (revision 44270) +++ include/freetype/ftsynth.h (working copy) @@ -5,7 +5,7 @@ /* FreeType synthesizing code for emboldening and slanting */ /* (specification). */ /* */ -/* Copyright 2000-2001, 2003, 2006 by */ +/* Copyright 2000-2001, 2003, 2006, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -23,7 +23,7 @@ /*************************************************************************/ /*************************************************************************/ /********* *********/ - /********* WARNING, THIS IS ALPHA CODE, THIS API *********/ + /********* WARNING, THIS IS ALPHA CODE! THIS API *********/ /********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/ /********* FREETYPE DEVELOPMENT TEAM *********/ /********* *********/ @@ -34,6 +34,13 @@ /*************************************************************************/ + /* Main reason for not lifting the functions in this module to a */ + /* `standard' API is that the used parameters for emboldening and */ + /* slanting are not configurable. Consider the functions as a */ + /* code resource which should be copied into the application and */ + /* adapted to the particular needs. */ + + #ifndef __FTSYNTH_H__ #define __FTSYNTH_H__ @@ -50,20 +57,20 @@ FT_BEGIN_HEADER - /* Make sure slot owns slot->bitmap. */ - FT_EXPORT( FT_Error ) - FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot ); - - /* Do not use this function directly! Copy the code to */ - /* your application and modify it to suit your need. */ + /* Embolden a glyph by a `reasonable' value (which is highly a matter of */ + /* taste). This function is actually a convenience function, providing */ + /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */ + /* */ + /* For emboldened outlines the metrics are estimates only; if you need */ + /* precise values you should call @FT_Outline_Get_CBox. */ FT_EXPORT( void ) FT_GlyphSlot_Embolden( FT_GlyphSlot slot ); - + /* Slant an outline glyph to the right by about 12 degrees. */ FT_EXPORT( void ) FT_GlyphSlot_Oblique( FT_GlyphSlot slot ); - /* */ + /* */ FT_END_HEADER Index: include/freetype/ftsystem.h =================================================================== --- include/freetype/ftsystem.h (revision 44270) +++ include/freetype/ftsystem.h (working copy) @@ -82,7 +82,7 @@ * The size in bytes to allocate. * * @return: - * Address of new memory block. 0 in case of failure. + * Address of new memory block. 0~in case of failure. * */ typedef void* @@ -133,7 +133,7 @@ * The block's current address. * * @return: - * New block address. 0 in case of memory shortage. + * New block address. 0~in case of memory shortage. * * @note: * In case of error, the old block must still be available. @@ -152,7 +152,7 @@ * FT_MemoryRec * * @description: - * A structure used to describe a given memory manager to FreeType 2. + * A structure used to describe a given memory manager to FreeType~2. * * @fields: * user :: @@ -240,7 +240,7 @@ * * @note: * This function might be called to perform a seek or skip operation - * with a `count' of 0. + * with a `count' of~0. * */ typedef unsigned long Index: include/freetype/fttypes.h =================================================================== --- include/freetype/fttypes.h (revision 44270) +++ include/freetype/fttypes.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType simple types definitions (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2004, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -43,7 +43,7 @@ /* The basic data types defined by the library. */ /* */ /* <Description> */ - /* This section contains the basic data types defined by FreeType 2, */ + /* This section contains the basic data types defined by FreeType~2, */ /* ranging from simple scalar types to bitmap descriptors. More */ /* font-specific structures are defined in a different section. */ /* */ @@ -53,6 +53,10 @@ /* FT_Char */ /* FT_Int */ /* FT_UInt */ + /* FT_Int16 */ + /* FT_UInt16 */ + /* FT_Int32 */ + /* FT_UInt32 */ /* FT_Short */ /* FT_UShort */ /* FT_Long */ @@ -95,7 +99,7 @@ /* */ /* <Description> */ /* A typedef of unsigned char, used for simple booleans. As usual, */ - /* values 1 and 0 represent true and false, respectively. */ + /* values 1 and~0 represent true and false, respectively. */ /* */ typedef unsigned char FT_Bool; @@ -163,7 +167,7 @@ /* FT_Tag */ /* */ /* <Description> */ - /* A typedef for 32bit tags (as used in the SFNT format). */ + /* A typedef for 32-bit tags (as used in the SFNT format). */ /* */ typedef FT_UInt32 FT_Tag; @@ -286,7 +290,7 @@ /* FT_Error */ /* */ /* <Description> */ - /* The FreeType error code type. A value of 0 is always interpreted */ + /* The FreeType error code type. A value of~0 is always interpreted */ /* as a successful operation. */ /* */ typedef int FT_Error; @@ -309,7 +313,7 @@ /* FT_Offset */ /* */ /* <Description> */ - /* This is equivalent to the ANSI C `size_t' type, i.e., the largest */ + /* This is equivalent to the ANSI~C `size_t' type, i.e., the largest */ /* _unsigned_ integer type used to express a file size or position, */ /* or a memory block size. */ /* */ @@ -322,7 +326,7 @@ /* FT_PtrDist */ /* */ /* <Description> */ - /* This is equivalent to the ANSI C `ptrdiff_t' type, i.e., the */ + /* This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the */ /* largest _signed_ integer type used to express the distance */ /* between two pointers. */ /* */ @@ -409,7 +413,7 @@ /* FT_Generic_Finalizer */ /* */ /* <Description> */ - /* Describes a function used to destroy the `client' data of any */ + /* Describe a function used to destroy the `client' data of any */ /* FreeType object. See the description of the @FT_Generic type for */ /* details of usage. */ /* */ @@ -466,10 +470,11 @@ /* TrueType tables into an unsigned long to be used within FreeType. */ /* */ /* <Note> */ - /* The produced values *must* be 32bit integers. Don't redefine this */ - /* macro. */ + /* The produced values *must* be 32-bit integers. Don't redefine */ + /* this macro. */ /* */ #define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \ + (FT_Tag) \ ( ( (FT_ULong)_x1 << 24 ) | \ ( (FT_ULong)_x2 << 16 ) | \ ( (FT_ULong)_x3 << 8 ) | \ Index: include/freetype/ftwinfnt.h =================================================================== --- include/freetype/ftwinfnt.h (revision 44270) +++ include/freetype/ftwinfnt.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType API for accessing Windows fnt-specific data. */ /* */ -/* Copyright 2003, 2004 by */ +/* Copyright 2003, 2004, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -111,11 +111,11 @@ * ordering and minor deviations). * * FT_WinFNT_ID_CP949 :: - * A superset of Korean Hangul KS C 5601-1987 (with different + * A superset of Korean Hangul KS~C 5601-1987 (with different * ordering and minor deviations). * * FT_WinFNT_ID_CP950 :: - * A superset of traditional Chinese Big 5 ETen (with different + * A superset of traditional Chinese Big~5 ETen (with different * ordering and minor deviations). * * FT_WinFNT_ID_CP1250 :: @@ -219,36 +219,47 @@ FT_UShort color_table_offset; FT_ULong reserved1[4]; - } FT_WinFNT_HeaderRec, *FT_WinFNT_Header; + } FT_WinFNT_HeaderRec; - /********************************************************************** - * - * @function: - * FT_Get_WinFNT_Header - * - * @description: - * Retrieve a Windows FNT font info header. - * - * @input: - * face :: A handle to the input face. - * - * @output: - * aheader :: The WinFNT header. - * - * @return: - * FreeType error code. 0 means success. - * - * @note: - * This function only works with Windows FNT faces, returning an error - * otherwise. - */ + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_WinFNT_Header */ + /* */ + /* <Description> */ + /* A handle to an @FT_WinFNT_HeaderRec structure. */ + /* */ + typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header; + + + /********************************************************************** + * + * @function: + * FT_Get_WinFNT_Header + * + * @description: + * Retrieve a Windows FNT font info header. + * + * @input: + * face :: A handle to the input face. + * + * @output: + * aheader :: The WinFNT header. + * + * @return: + * FreeType error code. 0~means success. + * + * @note: + * This function only works with Windows FNT faces, returning an error + * otherwise. + */ FT_EXPORT( FT_Error ) FT_Get_WinFNT_Header( FT_Face face, FT_WinFNT_HeaderRec *aheader ); - /* */ + /* */ FT_END_HEADER Index: include/freetype/ftxf86.h =================================================================== --- include/freetype/ftxf86.h (revision 44270) +++ include/freetype/ftxf86.h (working copy) @@ -49,6 +49,9 @@ /* however, there are special cases (like in PDF devices) where it is */ /* important to differentiate, in spite of FreeType's uniform API. */ /* */ + /* This function is in the X11/xf86 namespace for historical reasons */ + /* and in no way depends on that windowing system. */ + /* */ /*************************************************************************/ @@ -60,8 +63,8 @@ /* <Description> */ /* Return a string describing the format of a given face, using values */ /* which can be used as an X11 FONT_PROPERTY. Possible values are */ - /* `TrueType', `Type 1', `BDF', `PCF', `Type 42', `CID Type 1', `CFF', */ - /* `PFR', and `Windows FNT'. */ + /* `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */ + /* `PFR', and `Windows~FNT'. */ /* */ /* <Input> */ /* face :: */ Index: include/freetype/internal/autohint.h =================================================================== --- include/freetype/internal/autohint.h (revision 44270) +++ include/freetype/internal/autohint.h (working copy) @@ -196,7 +196,33 @@ } FT_AutoHinter_ServiceRec, *FT_AutoHinter_Service; +#ifndef FT_CONFIG_OPTION_PIC +#define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \ + done_global_hints_, load_glyph_) \ + FT_CALLBACK_TABLE_DEF \ + const FT_AutoHinter_ServiceRec class_ = \ + { \ + reset_face_, get_global_hints_, done_global_hints_, load_glyph_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \ + done_global_hints_, load_glyph_) \ + void \ + FT_Init_Class_##class_( FT_Library library, \ + FT_AutoHinter_ServiceRec* clazz) \ + { \ + FT_UNUSED(library); \ + clazz->reset_face = reset_face_; \ + clazz->get_global_hints = get_global_hints_; \ + clazz->done_global_hints = done_global_hints_; \ + clazz->load_glyph = load_glyph_; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + FT_END_HEADER #endif /* __AUTOHINT_H__ */ Index: include/freetype/internal/ftcalc.h =================================================================== --- include/freetype/internal/ftcalc.h (revision 44270) +++ include/freetype/internal/ftcalc.h (working copy) @@ -4,7 +4,7 @@ /* */ /* Arithmetic computations (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -112,6 +112,31 @@ /* + * A variant of FT_Matrix_Multiply which scales its result afterwards. + * The idea is that both `a' and `b' are scaled by factors of 10 so that + * the values are as precise as possible to get a correct result during + * the 64bit multiplication. Let `sa' and `sb' be the scaling factors of + * `a' and `b', respectively, then the scaling factor of the result is + * `sa*sb'. + */ + FT_BASE( void ) + FT_Matrix_Multiply_Scaled( const FT_Matrix* a, + FT_Matrix *b, + FT_Long scaling ); + + + /* + * A variant of FT_Vector_Transform. See comments for + * FT_Matrix_Multiply_Scaled. + */ + + FT_BASE( void ) + FT_Vector_Transform_Scaled( FT_Vector* vector, + const FT_Matrix* matrix, + FT_Long scaling ); + + + /* * Return -1, 0, or +1, depending on the orientation of a given corner. * We use the Cartesian coordinate system, with positive vertical values * going upwards. The function returns +1 if the corner turns to the @@ -140,6 +165,7 @@ #define INT_TO_FIXED( x ) ( (FT_Long)(x) << 16 ) #define F2DOT14_TO_FIXED( x ) ( (FT_Long)(x) << 2 ) #define FLOAT_TO_FIXED( x ) ( (FT_Long)( x * 65536.0 ) ) +#define FIXED_TO_INT( x ) ( FT_RoundFix( x ) >> 16 ) #define ROUND_F26DOT6( x ) ( x >= 0 ? ( ( (x) + 32 ) & -64 ) \ : ( -( ( 32 - (x) ) & -64 ) ) ) Index: include/freetype/internal/ftdebug.h =================================================================== --- include/freetype/internal/ftdebug.h (revision 44270) +++ include/freetype/internal/ftdebug.h (working copy) @@ -4,7 +4,7 @@ /* */ /* Debugging and logging component (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2004, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -54,7 +54,7 @@ #define FT_TRACE_DEF( x ) trace_ ## x , /* defining the enumeration */ - typedef enum + typedef enum FT_Trace_ { #include FT_INTERNAL_TRACE_H trace_count @@ -92,7 +92,7 @@ #else /* !FT_DEBUG_LEVEL_TRACE */ -#define FT_TRACE( level, varformat ) do ; while ( 0 ) /* nothing */ +#define FT_TRACE( level, varformat ) do { } while ( 0 ) /* nothing */ #endif /* !FT_DEBUG_LEVEL_TRACE */ @@ -146,10 +146,12 @@ /*************************************************************************/ /* */ - /* You need two opening resp. closing parentheses! */ + /* You need two opening and closing parentheses! */ /* */ /* Example: FT_TRACE0(( "Value is %i", foo )) */ /* */ + /* Output of the FT_TRACEX macros is sent to stderr. */ + /* */ /*************************************************************************/ #define FT_TRACE0( varformat ) FT_TRACE( 0, varformat ) @@ -164,8 +166,10 @@ /*************************************************************************/ /* */ - /* Define the FT_ERROR macro */ + /* Define the FT_ERROR macro. */ /* */ + /* Output of this macro is sent to stderr. */ + /* */ /*************************************************************************/ #ifdef FT_DEBUG_LEVEL_ERROR @@ -174,14 +178,14 @@ #else /* !FT_DEBUG_LEVEL_ERROR */ -#define FT_ERROR( varformat ) do ; while ( 0 ) /* nothing */ +#define FT_ERROR( varformat ) do { } while ( 0 ) /* nothing */ #endif /* !FT_DEBUG_LEVEL_ERROR */ /*************************************************************************/ /* */ - /* Define the FT_ASSERT macro */ + /* Define the FT_ASSERT macro. */ /* */ /*************************************************************************/ @@ -197,28 +201,30 @@ #else /* !FT_DEBUG_LEVEL_ERROR */ -#define FT_ASSERT( condition ) do ; while ( 0 ) +#define FT_ASSERT( condition ) do { } while ( 0 ) #endif /* !FT_DEBUG_LEVEL_ERROR */ /*************************************************************************/ /* */ - /* Define `FT_Message' and `FT_Panic' when needed */ + /* Define `FT_Message' and `FT_Panic' when needed. */ /* */ /*************************************************************************/ #ifdef FT_DEBUG_LEVEL_ERROR -#include "stdio.h" /* for vprintf() */ +#include "stdio.h" /* for vfprintf() */ /* print a message */ FT_BASE( void ) - FT_Message( const char* fmt, ... ); + FT_Message( const char* fmt, + ... ); /* print a message and exit */ FT_BASE( void ) - FT_Panic( const char* fmt, ... ); + FT_Panic( const char* fmt, + ... ); #endif /* FT_DEBUG_LEVEL_ERROR */ @@ -229,8 +235,8 @@ #if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */ - /* we disable the warning `conditional expression is constant' here */ - /* in order to compile cleanly with the maximum level of warnings */ + /* We disable the warning `conditional expression is constant' here */ + /* in order to compile cleanly with the maximum level of warnings. */ #pragma warning( disable : 4127 ) #endif /* _MSC_VER */ Index: include/freetype/internal/ftdriver.h =================================================================== --- include/freetype/internal/ftdriver.h (revision 44270) +++ include/freetype/internal/ftdriver.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType font driver interface (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2006 by */ +/* Copyright 1996-2001, 2002, 2003, 2006, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -91,6 +91,7 @@ (*FT_CharMap_CharNextFunc)( FT_CharMap charmap, FT_Long charcode ); + typedef FT_Error (*FT_Face_GetKerningFunc)( FT_Face face, FT_UInt left_glyph, @@ -104,11 +105,11 @@ typedef FT_Error - (*FT_Face_GetAdvancesFunc)( FT_Face face, - FT_UInt first, - FT_UInt count, - FT_Bool vertical, - FT_UShort* advances ); + (*FT_Face_GetAdvancesFunc)( FT_Face face, + FT_UInt first, + FT_UInt count, + FT_Int32 flags, + FT_Fixed* advances ); /*************************************************************************/ @@ -145,10 +146,6 @@ /* load_glyph :: A function handle to load a glyph to a slot. */ /* This field is mandatory! */ /* */ - /* get_char_index :: A function handle to return the glyph index of */ - /* a given character for a given charmap. This */ - /* field is mandatory! */ - /* */ /* get_kerning :: A function handle to return the unscaled */ /* kerning for a given pair of glyphs. Can be */ /* set to 0 if the format doesn't support */ @@ -180,8 +177,8 @@ /* to 0 if the scaling done in the base layer */ /* suffices. */ /* <Note> */ - /* Most function pointers, with the exception of `load_glyph' and */ - /* `get_char_index' can be set to 0 to indicate a default behaviour. */ + /* Most function pointers, with the exception of `load_glyph', can be */ + /* set to 0 to indicate a default behaviour. */ /* */ typedef struct FT_Driver_ClassRec_ { @@ -243,7 +240,180 @@ #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ + /*************************************************************************/ + /* */ + /* <Macro> */ + /* FT_DECLARE_DRIVER */ + /* */ + /* <Description> */ + /* Used to create a forward declaration of a */ + /* FT_Driver_ClassRec stract instance. */ + /* */ + /* <Macro> */ + /* FT_DEFINE_DRIVER */ + /* */ + /* <Description> */ + /* Used to initialize an instance of FT_Driver_ClassRec struct. */ + /* */ + /* When FT_CONFIG_OPTION_PIC is defined a Create funtion will need */ + /* to called with a pointer where the allocated stracture is returned.*/ + /* And when it is no longer needed a Destroy function needs */ + /* to be called to release that allocation. */ + /* fcinit.c (ft_create_default_module_classes) already contains */ + /* a mechanism to call these functions for the default modules */ + /* described in ftmodule.h */ + /* */ + /* Notice that the created Create and Destroy functions call */ + /* pic_init and pic_free function to allow you to manually allocate */ + /* and initialize any additional global data, like module specific */ + /* interface, and put them in the global pic container defined in */ + /* ftpic.h. if you don't need them just implement the functions as */ + /* empty to resolve the link error. */ + /* */ + /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ + /* allocated in the global scope (or the scope where the macro */ + /* is used). */ + /* */ +#ifndef FT_CONFIG_OPTION_PIC +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS +#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) \ + a_, b_, +#else + #define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) +#endif + +#define FT_DECLARE_DRIVER(class_) \ + FT_CALLBACK_TABLE \ + const FT_Driver_ClassRec class_; + +#define FT_DEFINE_DRIVER(class_, \ + flags_, size_, name_, version_, requires_, \ + interface_, init_, done_, get_interface_, \ + face_object_size_, size_object_size_, \ + slot_object_size_, init_face_, done_face_, \ + init_size_, done_size_, init_slot_, done_slot_, \ + old_set_char_sizes_, old_set_pixel_sizes_, \ + load_glyph_, get_kerning_, attach_file_, \ + get_advances_, request_size_, select_size_ ) \ + FT_CALLBACK_TABLE_DEF \ + const FT_Driver_ClassRec class_ = \ + { \ + FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,interface_, \ + init_,done_,get_interface_) \ + \ + face_object_size_, \ + size_object_size_, \ + slot_object_size_, \ + \ + init_face_, \ + done_face_, \ + \ + init_size_, \ + done_size_, \ + \ + init_slot_, \ + done_slot_, \ + \ + FT_DEFINE_DRIVERS_OLD_INTERNALS(old_set_char_sizes_, old_set_pixel_sizes_) \ + \ + load_glyph_, \ + \ + get_kerning_, \ + attach_file_, \ + get_advances_, \ + \ + request_size_, \ + select_size_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS +#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) \ + clazz->set_char_sizes = a_; \ + clazz->set_pixel_sizes = b_; +#else + #define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) +#endif + +#define FT_DECLARE_DRIVER(class_) FT_DECLARE_MODULE(class_) + +#define FT_DEFINE_DRIVER(class_, \ + flags_, size_, name_, version_, requires_, \ + interface_, init_, done_, get_interface_, \ + face_object_size_, size_object_size_, \ + slot_object_size_, init_face_, done_face_, \ + init_size_, done_size_, init_slot_, done_slot_, \ + old_set_char_sizes_, old_set_pixel_sizes_, \ + load_glyph_, get_kerning_, attach_file_, \ + get_advances_, request_size_, select_size_ ) \ + void class_##_pic_free( FT_Library library ); \ + FT_Error class_##_pic_init( FT_Library library ); \ + \ + void \ + FT_Destroy_Class_##class_( FT_Library library, \ + FT_Module_Class* clazz ) \ + { \ + FT_Memory memory = library->memory; \ + FT_Driver_Class dclazz = (FT_Driver_Class)clazz; \ + class_##_pic_free( library ); \ + if ( dclazz ) \ + FT_FREE( dclazz ); \ + } \ + \ + FT_Error \ + FT_Create_Class_##class_( FT_Library library, \ + FT_Module_Class** output_class ) \ + { \ + FT_Driver_Class clazz; \ + FT_Error error; \ + FT_Memory memory = library->memory; \ + \ + if ( FT_ALLOC( clazz, sizeof(*clazz) ) ) \ + return error; \ + \ + error = class_##_pic_init( library ); \ + if(error) \ + { \ + FT_FREE( clazz ); \ + return error; \ + } \ + \ + FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,interface_, \ + init_,done_,get_interface_) \ + \ + clazz->face_object_size = face_object_size_; \ + clazz->size_object_size = size_object_size_; \ + clazz->slot_object_size = slot_object_size_; \ + \ + clazz->init_face = init_face_; \ + clazz->done_face = done_face_; \ + \ + clazz->init_size = init_size_; \ + clazz->done_size = done_size_; \ + \ + clazz->init_slot = init_slot_; \ + clazz->done_slot = done_slot_; \ + \ + FT_DEFINE_DRIVERS_OLD_INTERNALS(old_set_char_sizes_, old_set_pixel_sizes_) \ + \ + clazz->load_glyph = load_glyph_; \ + \ + clazz->get_kerning = get_kerning_; \ + clazz->attach_file = attach_file_; \ + clazz->get_advances = get_advances_; \ + \ + clazz->request_size = request_size_; \ + clazz->select_size = select_size_; \ + \ + *output_class = (FT_Module_Class*)clazz; \ + return FT_Err_Ok; \ + } + + +#endif /* FT_CONFIG_OPTION_PIC */ + FT_END_HEADER #endif /* __FTDRIVER_H__ */ Index: include/freetype/internal/ftgloadr.h =================================================================== --- include/freetype/internal/ftgloadr.h (revision 44270) +++ include/freetype/internal/ftgloadr.h (working copy) @@ -67,11 +67,11 @@ typedef struct FT_GlyphLoadRec_ { - FT_Outline outline; /* outline */ - FT_Vector* extra_points; /* extra points table */ + FT_Outline outline; /* outline */ + FT_Vector* extra_points; /* extra points table */ FT_Vector* extra_points2; /* second extra points table */ - FT_UInt num_subglyphs; /* number of subglyphs */ - FT_SubGlyph subglyphs; /* subglyphs */ + FT_UInt num_subglyphs; /* number of subglyphs */ + FT_SubGlyph subglyphs; /* subglyphs */ } FT_GlyphLoadRec, *FT_GlyphLoad; @@ -121,15 +121,15 @@ FT_UInt n_contours ); -#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \ - ( (_count) == 0 || (int)((_loader)->base.outline.n_points + \ - (_loader)->current.outline.n_points + \ - (_count)) <= (int)(_loader)->max_points ) +#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \ + ( (_count) == 0 || ((_loader)->base.outline.n_points + \ + (_loader)->current.outline.n_points + \ + (unsigned long)(_count)) <= (_loader)->max_points ) -#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \ - ( (_count) == 0 || (int)((_loader)->base.outline.n_contours + \ - (_loader)->current.outline.n_contours + \ - (_count)) <= (int)(_loader)->max_contours ) +#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \ + ( (_count) == 0 || ((_loader)->base.outline.n_contours + \ + (_loader)->current.outline.n_contours + \ + (unsigned long)(_count)) <= (_loader)->max_contours ) #define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours ) \ ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \ Index: include/freetype/internal/ftmemory.h =================================================================== --- include/freetype/internal/ftmemory.h (revision 44270) +++ include/freetype/internal/ftmemory.h (working copy) @@ -333,8 +333,8 @@ FT_ULong size, FT_Error *p_error ); -#define FT_MEM_STRDUP( dst, str ) \ - (dst) = ft_mem_strdup( memory, (const char*)(str), &error ) +#define FT_MEM_STRDUP( dst, str ) \ + (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error ) #define FT_STRDUP( dst, str ) \ FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) ) Index: include/freetype/internal/ftobjs.h =================================================================== --- include/freetype/internal/ftobjs.h (revision 44270) +++ include/freetype/internal/ftobjs.h (working copy) @@ -4,7 +4,7 @@ /* */ /* The FreeType private base classes (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -35,6 +35,7 @@ #include FT_INTERNAL_DRIVER_H #include FT_INTERNAL_AUTOHINT_H #include FT_INTERNAL_SERVICE_H +#include FT_INTERNAL_PIC_H #ifdef FT_CONFIG_OPTION_INCREMENTAL #include FT_INCREMENTAL_H @@ -160,7 +161,32 @@ (*FT_CMap_CharNextFunc)( FT_CMap cmap, FT_UInt32 *achar_code ); + typedef FT_UInt + (*FT_CMap_CharVarIndexFunc)( FT_CMap cmap, + FT_CMap unicode_cmap, + FT_UInt32 char_code, + FT_UInt32 variant_selector ); + typedef FT_Bool + (*FT_CMap_CharVarIsDefaultFunc)( FT_CMap cmap, + FT_UInt32 char_code, + FT_UInt32 variant_selector ); + + typedef FT_UInt32 * + (*FT_CMap_VariantListFunc)( FT_CMap cmap, + FT_Memory mem ); + + typedef FT_UInt32 * + (*FT_CMap_CharVariantListFunc)( FT_CMap cmap, + FT_Memory mem, + FT_UInt32 char_code ); + + typedef FT_UInt32 * + (*FT_CMap_VariantCharListFunc)( FT_CMap cmap, + FT_Memory mem, + FT_UInt32 variant_selector ); + + typedef struct FT_CMap_ClassRec_ { FT_ULong size; @@ -169,9 +195,57 @@ FT_CMap_CharIndexFunc char_index; FT_CMap_CharNextFunc char_next; + /* Subsequent entries are special ones for format 14 -- the variant */ + /* selector subtable which behaves like no other */ + + FT_CMap_CharVarIndexFunc char_var_index; + FT_CMap_CharVarIsDefaultFunc char_var_default; + FT_CMap_VariantListFunc variant_list; + FT_CMap_CharVariantListFunc charvariant_list; + FT_CMap_VariantCharListFunc variantchar_list; + } FT_CMap_ClassRec; +#ifndef FT_CONFIG_OPTION_PIC +#define FT_DECLARE_CMAP_CLASS(class_) \ + FT_CALLBACK_TABLE const FT_CMap_ClassRec class_; + +#define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_, \ + char_next_, char_var_index_, char_var_default_, variant_list_, \ + charvariant_list_, variantchar_list_) \ + FT_CALLBACK_TABLE_DEF \ + const FT_CMap_ClassRec class_ = \ + { \ + size_, init_, done_, char_index_, char_next_, char_var_index_, \ + char_var_default_, variant_list_, charvariant_list_, variantchar_list_ \ + }; +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DECLARE_CMAP_CLASS(class_) \ + void FT_Init_Class_##class_( FT_Library library, FT_CMap_ClassRec* clazz); + +#define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_, \ + char_next_, char_var_index_, char_var_default_, variant_list_, \ + charvariant_list_, variantchar_list_) \ + void \ + FT_Init_Class_##class_( FT_Library library, \ + FT_CMap_ClassRec* clazz) \ + { \ + FT_UNUSED(library); \ + clazz->size = size_; \ + clazz->init = init_; \ + clazz->done = done_; \ + clazz->char_index = char_index_; \ + clazz->char_next = char_next_; \ + clazz->char_var_index = char_var_index_; \ + clazz->char_var_default = char_var_default_; \ + clazz->variant_list = variant_list_; \ + clazz->charvariant_list = charvariant_list_; \ + clazz->variantchar_list = variantchar_list_; \ + } +#endif /* FT_CONFIG_OPTION_PIC */ + /* create a new charmap and add it to charmap->face */ FT_BASE( FT_Error ) FT_CMap_New( FT_CMap_Class clazz, @@ -306,9 +380,30 @@ } FT_GlyphSlot_InternalRec; +#if 0 + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_Size_InternalRec */ + /* */ + /* <Description> */ + /* This structure contains the internal fields of each FT_Size */ + /* object. Currently, it's empty. */ + /* */ /*************************************************************************/ + + typedef struct FT_Size_InternalRec_ + { + /* empty */ + + } FT_Size_InternalRec; + +#endif + + /*************************************************************************/ + /*************************************************************************/ /**** ****/ /**** ****/ /**** M O D U L E S ****/ @@ -710,6 +805,10 @@ /* */ /* debug_hooks :: XXX */ /* */ + /* pic_container :: Contains global structs and tables, instead */ + /* of defining them globallly. */ + /* */ + typedef struct FT_LibraryRec_ { FT_Memory memory; /* library's memory manager */ @@ -740,6 +839,10 @@ FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */ #endif +#ifdef FT_CONFIG_OPTION_PIC + FT_PIC_Container pic_container; +#endif + } FT_LibraryRec; @@ -811,7 +914,485 @@ FT_EXPORT_VAR( FT_Raster_Funcs ) ft_default_raster; #endif + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** ****/ + /**** PIC-Support Macros for ftimage.h ****/ + /**** ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* <Macro> */ + /* FT_DEFINE_OUTLINE_FUNCS */ + /* */ + /* <Description> */ + /* Used to initialize an instance of FT_Outline_Funcs struct. */ + /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */ + /* called with a pre-allocated stracture to be filled. */ + /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ + /* allocated in the global scope (or the scope where the macro */ + /* is used). */ + /* */ +#ifndef FT_CONFIG_OPTION_PIC + +#define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_, \ + cubic_to_, shift_, delta_) \ + static const FT_Outline_Funcs class_ = \ + { \ + move_to_, line_to_, conic_to_, cubic_to_, shift_, delta_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_, \ + cubic_to_, shift_, delta_) \ + static FT_Error \ + Init_Class_##class_( FT_Outline_Funcs* clazz ) \ + { \ + clazz->move_to = move_to_; \ + clazz->line_to = line_to_; \ + clazz->conic_to = conic_to_; \ + clazz->cubic_to = cubic_to_; \ + clazz->shift = shift_; \ + clazz->delta = delta_; \ + return FT_Err_Ok; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + + /*************************************************************************/ + /* */ + /* <Macro> */ + /* FT_DEFINE_RASTER_FUNCS */ + /* */ + /* <Description> */ + /* Used to initialize an instance of FT_Raster_Funcs struct. */ + /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */ + /* called with a pre-allocated stracture to be filled. */ + /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ + /* allocated in the global scope (or the scope where the macro */ + /* is used). */ + /* */ +#ifndef FT_CONFIG_OPTION_PIC + +#define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_, \ + raster_reset_, raster_set_mode_, \ + raster_render_, raster_done_) \ + const FT_Raster_Funcs class_ = \ + { \ + glyph_format_, raster_new_, raster_reset_, \ + raster_set_mode_, raster_render_, raster_done_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_, \ + raster_reset_, raster_set_mode_, raster_render_, raster_done_) \ + void \ + FT_Init_Class_##class_( FT_Raster_Funcs* clazz ) \ + { \ + clazz->glyph_format = glyph_format_; \ + clazz->raster_new = raster_new_; \ + clazz->raster_reset = raster_reset_; \ + clazz->raster_set_mode = raster_set_mode_; \ + clazz->raster_render = raster_render_; \ + clazz->raster_done = raster_done_; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** ****/ + /**** PIC-Support Macros for ftrender.h ****/ + /**** ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + + + /*************************************************************************/ + /* */ + /* <Macro> */ + /* FT_DEFINE_GLYPH */ + /* */ + /* <Description> */ + /* Used to initialize an instance of FT_Glyph_Class struct. */ + /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */ + /* called with a pre-allocated stracture to be filled. */ + /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ + /* allocated in the global scope (or the scope where the macro */ + /* is used). */ + /* */ +#ifndef FT_CONFIG_OPTION_PIC + +#define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_, \ + transform_, bbox_, prepare_) \ + FT_CALLBACK_TABLE_DEF \ + const FT_Glyph_Class class_ = \ + { \ + size_, format_, init_, done_, copy_, transform_, bbox_, prepare_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_, \ + transform_, bbox_, prepare_) \ + void \ + FT_Init_Class_##class_( FT_Glyph_Class* clazz ) \ + { \ + clazz->glyph_size = size_; \ + clazz->glyph_format = format_; \ + clazz->glyph_init = init_; \ + clazz->glyph_done = done_; \ + clazz->glyph_copy = copy_; \ + clazz->glyph_transform = transform_; \ + clazz->glyph_bbox = bbox_; \ + clazz->glyph_prepare = prepare_; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + + /*************************************************************************/ + /* */ + /* <Macro> */ + /* FT_DECLARE_RENDERER */ + /* */ + /* <Description> */ + /* Used to create a forward declaration of a */ + /* FT_Renderer_Class stract instance. */ + /* */ + /* <Macro> */ + /* FT_DEFINE_RENDERER */ + /* */ + /* <Description> */ + /* Used to initialize an instance of FT_Renderer_Class struct. */ + /* */ + /* When FT_CONFIG_OPTION_PIC is defined a Create funtion will need */ + /* to called with a pointer where the allocated stracture is returned.*/ + /* And when it is no longer needed a Destroy function needs */ + /* to be called to release that allocation. */ + /* fcinit.c (ft_create_default_module_classes) already contains */ + /* a mechanism to call these functions for the default modules */ + /* described in ftmodule.h */ + /* */ + /* Notice that the created Create and Destroy functions call */ + /* pic_init and pic_free function to allow you to manually allocate */ + /* and initialize any additional global data, like module specific */ + /* interface, and put them in the global pic container defined in */ + /* ftpic.h. if you don't need them just implement the functions as */ + /* empty to resolve the link error. */ + /* */ + /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ + /* allocated in the global scope (or the scope where the macro */ + /* is used). */ + /* */ +#ifndef FT_CONFIG_OPTION_PIC + +#define FT_DECLARE_RENDERER(class_) \ + FT_EXPORT_VAR( const FT_Renderer_Class ) class_; + +#define FT_DEFINE_RENDERER(class_, \ + flags_, size_, name_, version_, requires_, \ + interface_, init_, done_, get_interface_, \ + glyph_format_, render_glyph_, transform_glyph_, \ + get_glyph_cbox_, set_mode_, raster_class_ ) \ + FT_CALLBACK_TABLE_DEF \ + const FT_Renderer_Class class_ = \ + { \ + FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_, \ + interface_,init_,done_,get_interface_) \ + glyph_format_, \ + \ + render_glyph_, \ + transform_glyph_, \ + get_glyph_cbox_, \ + set_mode_, \ + \ + raster_class_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DECLARE_RENDERER(class_) FT_DECLARE_MODULE(class_) + +#define FT_DEFINE_RENDERER(class_, \ + flags_, size_, name_, version_, requires_, \ + interface_, init_, done_, get_interface_, \ + glyph_format_, render_glyph_, transform_glyph_, \ + get_glyph_cbox_, set_mode_, raster_class_ ) \ + void class_##_pic_free( FT_Library library ); \ + FT_Error class_##_pic_init( FT_Library library ); \ + \ + void \ + FT_Destroy_Class_##class_( FT_Library library, \ + FT_Module_Class* clazz ) \ + { \ + FT_Renderer_Class* rclazz = (FT_Renderer_Class*)clazz; \ + FT_Memory memory = library->memory; \ + class_##_pic_free( library ); \ + if ( rclazz ) \ + FT_FREE( rclazz ); \ + } \ + \ + FT_Error \ + FT_Create_Class_##class_( FT_Library library, \ + FT_Module_Class** output_class ) \ + { \ + FT_Renderer_Class* clazz; \ + FT_Error error; \ + FT_Memory memory = library->memory; \ + \ + if ( FT_ALLOC( clazz, sizeof(*clazz) ) ) \ + return error; \ + \ + error = class_##_pic_init( library ); \ + if(error) \ + { \ + FT_FREE( clazz ); \ + return error; \ + } \ + \ + FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_, \ + interface_,init_,done_,get_interface_) \ + \ + clazz->glyph_format = glyph_format_; \ + \ + clazz->render_glyph = render_glyph_; \ + clazz->transform_glyph = transform_glyph_; \ + clazz->get_glyph_cbox = get_glyph_cbox_; \ + clazz->set_mode = set_mode_; \ + \ + clazz->raster_class = raster_class_; \ + \ + *output_class = (FT_Module_Class*)clazz; \ + return FT_Err_Ok; \ + } + + + +#endif /* FT_CONFIG_OPTION_PIC */ + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** ****/ + /**** PIC-Support Macros for ftmodapi.h ****/ + /**** ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + +#ifdef FT_CONFIG_OPTION_PIC + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Module_Creator */ + /* */ + /* <Description> */ + /* A function used to create (allocate) a new module class object. */ + /* The object's members are initialized, but the module itself is */ + /* not. */ + /* */ + /* <Input> */ + /* memory :: A handle to the memory manager. */ + /* output_class :: Initialized with the newly allocated class. */ + /* */ + typedef FT_Error + (*FT_Module_Creator)( FT_Memory memory, + FT_Module_Class** output_class ); + + /*************************************************************************/ + /* */ + /* <FuncType> */ + /* FT_Module_Destroyer */ + /* */ + /* <Description> */ + /* A function used to destroy (deallocate) a module class object. */ + /* */ + /* <Input> */ + /* memory :: A handle to the memory manager. */ + /* clazz :: Module class to destroy. */ + /* */ + typedef void + (*FT_Module_Destroyer)( FT_Memory memory, + FT_Module_Class* clazz ); + +#endif + + /*************************************************************************/ + /* */ + /* <Macro> */ + /* FT_DECLARE_MODULE */ + /* */ + /* <Description> */ + /* Used to create a forward declaration of a */ + /* FT_Module_Class stract instance. */ + /* */ + /* <Macro> */ + /* FT_DEFINE_MODULE */ + /* */ + /* <Description> */ + /* Used to initialize an instance of FT_Module_Class struct. */ + /* */ + /* When FT_CONFIG_OPTION_PIC is defined a Create funtion will need */ + /* to called with a pointer where the allocated stracture is returned.*/ + /* And when it is no longer needed a Destroy function needs */ + /* to be called to release that allocation. */ + /* fcinit.c (ft_create_default_module_classes) already contains */ + /* a mechanism to call these functions for the default modules */ + /* described in ftmodule.h */ + /* */ + /* Notice that the created Create and Destroy functions call */ + /* pic_init and pic_free function to allow you to manually allocate */ + /* and initialize any additional global data, like module specific */ + /* interface, and put them in the global pic container defined in */ + /* ftpic.h. if you don't need them just implement the functions as */ + /* empty to resolve the link error. */ + /* */ + /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ + /* allocated in the global scope (or the scope where the macro */ + /* is used). */ + /* */ + /* <Macro> */ + /* FT_DEFINE_ROOT_MODULE */ + /* */ + /* <Description> */ + /* Used to initialize an instance of FT_Module_Class struct inside */ + /* another stract that contains it or in a function that initializes */ + /* that containing stract */ + /* */ +#ifndef FT_CONFIG_OPTION_PIC + +#define FT_DECLARE_MODULE(class_) \ + FT_CALLBACK_TABLE \ + const FT_Module_Class class_; \ + +#define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_, \ + interface_, init_, done_, get_interface_) \ + { \ + flags_, \ + size_, \ + \ + name_, \ + version_, \ + requires_, \ + \ + interface_, \ + \ + init_, \ + done_, \ + get_interface_, \ + }, + +#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_, \ + interface_, init_, done_, get_interface_) \ + FT_CALLBACK_TABLE_DEF \ + const FT_Module_Class class_ = \ + { \ + flags_, \ + size_, \ + \ + name_, \ + version_, \ + requires_, \ + \ + interface_, \ + \ + init_, \ + done_, \ + get_interface_, \ + }; + + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DECLARE_MODULE(class_) \ + FT_Error FT_Create_Class_##class_( FT_Library library, \ + FT_Module_Class** output_class ); \ + void FT_Destroy_Class_##class_( FT_Library library, \ + FT_Module_Class* clazz ); + +#define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_, \ + interface_, init_, done_, get_interface_) \ + clazz->root.module_flags = flags_; \ + clazz->root.module_size = size_; \ + clazz->root.module_name = name_; \ + clazz->root.module_version = version_; \ + clazz->root.module_requires = requires_; \ + \ + clazz->root.module_interface = interface_; \ + \ + clazz->root.module_init = init_; \ + clazz->root.module_done = done_; \ + clazz->root.get_interface = get_interface_; + +#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_, \ + interface_, init_, done_, get_interface_) \ + void class_##_pic_free( FT_Library library ); \ + FT_Error class_##_pic_init( FT_Library library ); \ + \ + void \ + FT_Destroy_Class_##class_( FT_Library library, \ + FT_Module_Class* clazz ) \ + { \ + FT_Memory memory = library->memory; \ + class_##_pic_free( library ); \ + if ( clazz ) \ + FT_FREE( clazz ); \ + } \ + \ + FT_Error \ + FT_Create_Class_##class_( FT_Library library, \ + FT_Module_Class** output_class ) \ + { \ + FT_Memory memory = library->memory; \ + FT_Module_Class* clazz; \ + FT_Error error; \ + \ + if ( FT_ALLOC( clazz, sizeof(*clazz) ) ) \ + return error; \ + error = class_##_pic_init( library ); \ + if(error) \ + { \ + FT_FREE( clazz ); \ + return error; \ + } \ + \ + clazz->module_flags = flags_; \ + clazz->module_size = size_; \ + clazz->module_name = name_; \ + clazz->module_version = version_; \ + clazz->module_requires = requires_; \ + \ + clazz->module_interface = interface_; \ + \ + clazz->module_init = init_; \ + clazz->module_done = done_; \ + clazz->get_interface = get_interface_; \ + \ + *output_class = clazz; \ + return FT_Err_Ok; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + + FT_END_HEADER #endif /* __FTOBJS_H__ */ Index: include/freetype/internal/ftpic.h =================================================================== --- include/freetype/internal/ftpic.h (revision 0) +++ include/freetype/internal/ftpic.h (revision 0) @@ -0,0 +1,67 @@ +/***************************************************************************/ +/* */ +/* ftpic.h */ +/* */ +/* The FreeType position independent code services (declaration). */ +/* */ +/* Copyright 2009 by */ +/* Oran Agra and Mickey Gabel. */ +/* */ +/* 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. */ +/* */ +/***************************************************************************/ + + /*************************************************************************/ + /* */ + /* Modules that ordinarily have const global data that need address */ + /* can instead define pointers here. */ + /* */ + /*************************************************************************/ + + +#ifndef __FTPIC_H__ +#define __FTPIC_H__ + + +FT_BEGIN_HEADER + +#ifdef FT_CONFIG_OPTION_PIC + + typedef struct FT_PIC_Container_ + { + /* pic containers for base */ + void* base; + /* pic containers for modules */ + void* autofit; + void* cff; + void* pshinter; + void* psnames; + void* raster; + void* sfnt; + void* smooth; + void* truetype; + } FT_PIC_Container; + + /* Initialize the various function tables, structs, etc. stored in the container. */ + FT_BASE( FT_Error ) + ft_pic_container_init( FT_Library library ); + + + /* Destroy the contents of the container. */ + FT_BASE( void ) + ft_pic_container_destroy( FT_Library library ); + +#endif /* FT_CONFIG_OPTION_PIC */ + + /* */ + +FT_END_HEADER + +#endif /* __FTPIC_H__ */ + + +/* END */ Index: include/freetype/internal/ftrfork.h =================================================================== --- include/freetype/internal/ftrfork.h (revision 44270) +++ include/freetype/internal/ftrfork.h (working copy) @@ -4,7 +4,7 @@ /* */ /* Embedded resource forks accessor (specification). */ /* */ -/* Copyright 2004, 2006 by */ +/* Copyright 2004, 2006, 2007 by */ /* Masatake YAMATO and Redhat K.K. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -34,9 +34,21 @@ /* Number of guessing rules supported in `FT_Raccess_Guess'. */ /* Don't forget to increment the number if you add a new guessing rule. */ -#define FT_RACCESS_N_RULES 8 +#define FT_RACCESS_N_RULES 9 + /* A structure to describe a reference in a resource by its resource ID */ + /* and internal offset. The `POST' resource expects to be concatenated */ + /* by the order of resource IDs instead of its appearance in the file. */ + + typedef struct FT_RFork_Ref_ + { + FT_UShort res_id; + FT_ULong offset; + + } FT_RFork_Ref; + + /*************************************************************************/ /* */ /* <Function> */ Index: include/freetype/internal/ftserv.h =================================================================== --- include/freetype/internal/ftserv.h (revision 44270) +++ include/freetype/internal/ftserv.h (working copy) @@ -163,7 +163,299 @@ typedef const FT_ServiceDescRec* FT_ServiceDesc; + /*************************************************************************/ + /* */ + /* <Macro> */ + /* FT_DEFINE_SERVICEDESCREC1 .. FT_DEFINE_SERVICEDESCREC6 */ + /* */ + /* <Description> */ + /* Used to initialize an array of FT_ServiceDescRec structs. */ + /* */ + /* When FT_CONFIG_OPTION_PIC is defined a Create funtion will need */ + /* to called with a pointer where the allocated array is returned. */ + /* And when it is no longer needed a Destroy function needs */ + /* to be called to release that allocation. */ + /* */ + /* These functions should be manyally called from the pic_init and */ + /* pic_free functions of your module (see FT_DEFINE_MODULE) */ + /* */ + /* When FT_CONFIG_OPTION_PIC is not defined the array will be */ + /* allocated in the global scope (or the scope where the macro */ + /* is used). */ + /* */ +#ifndef FT_CONFIG_OPTION_PIC +#define FT_DEFINE_SERVICEDESCREC1(class_, serv_id_1, serv_data_1) \ + static const FT_ServiceDescRec class_[] = \ + { \ + {serv_id_1, serv_data_1}, \ + {NULL, NULL} \ + }; +#define FT_DEFINE_SERVICEDESCREC2(class_, serv_id_1, serv_data_1, \ + serv_id_2, serv_data_2) \ + static const FT_ServiceDescRec class_[] = \ + { \ + {serv_id_1, serv_data_1}, \ + {serv_id_2, serv_data_2}, \ + {NULL, NULL} \ + }; +#define FT_DEFINE_SERVICEDESCREC3(class_, serv_id_1, serv_data_1, \ + serv_id_2, serv_data_2, serv_id_3, serv_data_3) \ + static const FT_ServiceDescRec class_[] = \ + { \ + {serv_id_1, serv_data_1}, \ + {serv_id_2, serv_data_2}, \ + {serv_id_3, serv_data_3}, \ + {NULL, NULL} \ + }; +#define FT_DEFINE_SERVICEDESCREC4(class_, serv_id_1, serv_data_1, \ + serv_id_2, serv_data_2, serv_id_3, serv_data_3, \ + serv_id_4, serv_data_4) \ + static const FT_ServiceDescRec class_[] = \ + { \ + {serv_id_1, serv_data_1}, \ + {serv_id_2, serv_data_2}, \ + {serv_id_3, serv_data_3}, \ + {serv_id_4, serv_data_4}, \ + {NULL, NULL} \ + }; +#define FT_DEFINE_SERVICEDESCREC5(class_, serv_id_1, serv_data_1, \ + serv_id_2, serv_data_2, serv_id_3, serv_data_3, \ + serv_id_4, serv_data_4, serv_id_5, serv_data_5) \ + static const FT_ServiceDescRec class_[] = \ + { \ + {serv_id_1, serv_data_1}, \ + {serv_id_2, serv_data_2}, \ + {serv_id_3, serv_data_3}, \ + {serv_id_4, serv_data_4}, \ + {serv_id_5, serv_data_5}, \ + {NULL, NULL} \ + }; +#define FT_DEFINE_SERVICEDESCREC6(class_, serv_id_1, serv_data_1, \ + serv_id_2, serv_data_2, serv_id_3, serv_data_3, \ + serv_id_4, serv_data_4, serv_id_5, serv_data_5, \ + serv_id_6, serv_data_6) \ + static const FT_ServiceDescRec class_[] = \ + { \ + {serv_id_1, serv_data_1}, \ + {serv_id_2, serv_data_2}, \ + {serv_id_3, serv_data_3}, \ + {serv_id_4, serv_data_4}, \ + {serv_id_5, serv_data_5}, \ + {serv_id_6, serv_data_6}, \ + {NULL, NULL} \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_SERVICEDESCREC1(class_, serv_id_1, serv_data_1) \ + void \ + FT_Destroy_Class_##class_( FT_Library library, \ + FT_ServiceDescRec* clazz ) \ + { \ + FT_Memory memory = library->memory; \ + if ( clazz ) \ + FT_FREE( clazz ); \ + } \ + \ + FT_Error \ + FT_Create_Class_##class_( FT_Library library, \ + FT_ServiceDescRec** output_class) \ + { \ + FT_ServiceDescRec* clazz; \ + FT_Error error; \ + FT_Memory memory = library->memory; \ + \ + if ( FT_ALLOC( clazz, sizeof(*clazz)*2 ) ) \ + return error; \ + clazz[0].serv_id = serv_id_1; \ + clazz[0].serv_data = serv_data_1; \ + clazz[1].serv_id = NULL; \ + clazz[1].serv_data = NULL; \ + *output_class = clazz; \ + return FT_Err_Ok; \ + } + +#define FT_DEFINE_SERVICEDESCREC2(class_, serv_id_1, serv_data_1, \ + serv_id_2, serv_data_2) \ + void \ + FT_Destroy_Class_##class_( FT_Library library, \ + FT_ServiceDescRec* clazz ) \ + { \ + FT_Memory memory = library->memory; \ + if ( clazz ) \ + FT_FREE( clazz ); \ + } \ + \ + FT_Error \ + FT_Create_Class_##class_( FT_Library library, \ + FT_ServiceDescRec** output_class) \ + { \ + FT_ServiceDescRec* clazz; \ + FT_Error error; \ + FT_Memory memory = library->memory; \ + \ + if ( FT_ALLOC( clazz, sizeof(*clazz)*3 ) ) \ + return error; \ + clazz[0].serv_id = serv_id_1; \ + clazz[0].serv_data = serv_data_1; \ + clazz[1].serv_id = serv_id_2; \ + clazz[1].serv_data = serv_data_2; \ + clazz[2].serv_id = NULL; \ + clazz[2].serv_data = NULL; \ + *output_class = clazz; \ + return FT_Err_Ok; \ + } + +#define FT_DEFINE_SERVICEDESCREC3(class_, serv_id_1, serv_data_1, \ + serv_id_2, serv_data_2, serv_id_3, serv_data_3) \ + void \ + FT_Destroy_Class_##class_( FT_Library library, \ + FT_ServiceDescRec* clazz ) \ + { \ + FT_Memory memory = library->memory; \ + if ( clazz ) \ + FT_FREE( clazz ); \ + } \ + \ + FT_Error \ + FT_Create_Class_##class_( FT_Library library, \ + FT_ServiceDescRec** output_class) \ + { \ + FT_ServiceDescRec* clazz; \ + FT_Error error; \ + FT_Memory memory = library->memory; \ + \ + if ( FT_ALLOC( clazz, sizeof(*clazz)*4 ) ) \ + return error; \ + clazz[0].serv_id = serv_id_1; \ + clazz[0].serv_data = serv_data_1; \ + clazz[1].serv_id = serv_id_2; \ + clazz[1].serv_data = serv_data_2; \ + clazz[2].serv_id = serv_id_3; \ + clazz[2].serv_data = serv_data_3; \ + clazz[3].serv_id = NULL; \ + clazz[3].serv_data = NULL; \ + *output_class = clazz; \ + return FT_Err_Ok; \ + } + +#define FT_DEFINE_SERVICEDESCREC4(class_, serv_id_1, serv_data_1, \ + serv_id_2, serv_data_2, serv_id_3, serv_data_3, \ + serv_id_4, serv_data_4) \ + void \ + FT_Destroy_Class_##class_( FT_Library library, \ + FT_ServiceDescRec* clazz ) \ + { \ + FT_Memory memory = library->memory; \ + if ( clazz ) \ + FT_FREE( clazz ); \ + } \ + \ + FT_Error \ + FT_Create_Class_##class_( FT_Library library, \ + FT_ServiceDescRec** output_class) \ + { \ + FT_ServiceDescRec* clazz; \ + FT_Error error; \ + FT_Memory memory = library->memory; \ + \ + if ( FT_ALLOC( clazz, sizeof(*clazz)*5 ) ) \ + return error; \ + clazz[0].serv_id = serv_id_1; \ + clazz[0].serv_data = serv_data_1; \ + clazz[1].serv_id = serv_id_2; \ + clazz[1].serv_data = serv_data_2; \ + clazz[2].serv_id = serv_id_3; \ + clazz[2].serv_data = serv_data_3; \ + clazz[3].serv_id = serv_id_4; \ + clazz[3].serv_data = serv_data_4; \ + clazz[4].serv_id = NULL; \ + clazz[4].serv_data = NULL; \ + *output_class = clazz; \ + return FT_Err_Ok; \ + } + +#define FT_DEFINE_SERVICEDESCREC5(class_, serv_id_1, serv_data_1, \ + serv_id_2, serv_data_2, serv_id_3, serv_data_3, serv_id_4, \ + serv_data_4, serv_id_5, serv_data_5) \ + void \ + FT_Destroy_Class_##class_( FT_Library library, \ + FT_ServiceDescRec* clazz ) \ + { \ + FT_Memory memory = library->memory; \ + if ( clazz ) \ + FT_FREE( clazz ); \ + } \ + \ + FT_Error \ + FT_Create_Class_##class_( FT_Library library, \ + FT_ServiceDescRec** output_class) \ + { \ + FT_ServiceDescRec* clazz; \ + FT_Error error; \ + FT_Memory memory = library->memory; \ + \ + if ( FT_ALLOC( clazz, sizeof(*clazz)*6 ) ) \ + return error; \ + clazz[0].serv_id = serv_id_1; \ + clazz[0].serv_data = serv_data_1; \ + clazz[1].serv_id = serv_id_2; \ + clazz[1].serv_data = serv_data_2; \ + clazz[2].serv_id = serv_id_3; \ + clazz[2].serv_data = serv_data_3; \ + clazz[3].serv_id = serv_id_4; \ + clazz[3].serv_data = serv_data_4; \ + clazz[4].serv_id = serv_id_5; \ + clazz[4].serv_data = serv_data_5; \ + clazz[5].serv_id = NULL; \ + clazz[5].serv_data = NULL; \ + *output_class = clazz; \ + return FT_Err_Ok; \ + } + +#define FT_DEFINE_SERVICEDESCREC6(class_, serv_id_1, serv_data_1, \ + serv_id_2, serv_data_2, serv_id_3, serv_data_3, \ + serv_id_4, serv_data_4, serv_id_5, serv_data_5, \ + serv_id_6, serv_data_6) \ + void \ + FT_Destroy_Class_##class_( FT_Library library, \ + FT_ServiceDescRec* clazz ) \ + { \ + FT_Memory memory = library->memory; \ + if ( clazz ) \ + FT_FREE( clazz ); \ + } \ + \ + FT_Error \ + FT_Create_Class_##class_( FT_Library library, \ + FT_ServiceDescRec** output_class) \ + { \ + FT_ServiceDescRec* clazz; \ + FT_Error error; \ + FT_Memory memory = library->memory; \ + \ + if ( FT_ALLOC( clazz, sizeof(*clazz)*7 ) ) \ + return error; \ + clazz[0].serv_id = serv_id_1; \ + clazz[0].serv_data = serv_data_1; \ + clazz[1].serv_id = serv_id_2; \ + clazz[1].serv_data = serv_data_2; \ + clazz[2].serv_id = serv_id_3; \ + clazz[2].serv_data = serv_data_3; \ + clazz[3].serv_id = serv_id_4; \ + clazz[3].serv_data = serv_data_4; \ + clazz[4].serv_id = serv_id_5; \ + clazz[4].serv_data = serv_data_5; \ + clazz[5].serv_id = serv_id_6; \ + clazz[5].serv_data = serv_data_6; \ + clazz[6].serv_id = NULL; \ + clazz[6].serv_data = NULL; \ + *output_class = clazz; \ + return FT_Err_Ok; \ + } +#endif /* FT_CONFIG_OPTION_PIC */ + /* * Parse a list of FT_ServiceDescRec descriptors and look for * a specific service by ID. Note that the last element in the @@ -301,6 +593,7 @@ */ #define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h> +#define FT_SERVICE_CID_H <freetype/internal/services/svcid.h> #define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h> #define FT_SERVICE_GX_VALIDATE_H <freetype/internal/services/svgxval.h> #define FT_SERVICE_KERNING_H <freetype/internal/services/svkern.h> Index: include/freetype/internal/fttrace.h =================================================================== --- include/freetype/internal/fttrace.h (revision 44270) +++ include/freetype/internal/fttrace.h (working copy) @@ -4,7 +4,7 @@ /* */ /* Tracing handling (specification only). */ /* */ -/* Copyright 2002, 2004, 2005, 2006 by */ +/* Copyright 2002, 2004, 2005, 2006, 2007 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -31,16 +31,19 @@ FT_TRACE_DEF( objs ) /* base objects (ftobjs.c) */ FT_TRACE_DEF( outline ) /* outline management (ftoutln.c) */ FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */ +FT_TRACE_DEF( gloader ) /* glyph loader (ftgloadr.c) */ FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */ FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */ FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */ FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */ +FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */ /* Cache sub-system */ FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */ /* SFNT driver components */ +FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */ FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */ FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */ FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */ @@ -48,6 +51,7 @@ FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */ FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */ FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */ +FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */ /* TrueType driver components */ FT_TRACE_DEF( ttdriver ) /* TT font driver (ttdriver.c) */ @@ -58,6 +62,7 @@ FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */ /* Type 1 driver components */ +FT_TRACE_DEF( t1afm ) FT_TRACE_DEF( t1driver ) FT_TRACE_DEF( t1gload ) FT_TRACE_DEF( t1hint ) @@ -114,6 +119,7 @@ FT_TRACE_DEF( otvgpos ) FT_TRACE_DEF( otvgsub ) FT_TRACE_DEF( otvjstf ) +FT_TRACE_DEF( otvmath ) /* TrueTypeGX/AAT validation components */ FT_TRACE_DEF( gxvmodule ) Index: include/freetype/internal/internal.h =================================================================== --- include/freetype/internal/internal.h (revision 44270) +++ include/freetype/internal/internal.h (working copy) @@ -25,6 +25,7 @@ #define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h> +#define FT_INTERNAL_PIC_H <freetype/internal/ftpic.h> #define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h> #define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h> #define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h> Index: include/freetype/internal/psaux.h =================================================================== --- include/freetype/internal/psaux.h (revision 44270) +++ include/freetype/internal/psaux.h (working copy) @@ -5,7 +5,7 @@ /* Auxiliary functions and data structures related to PostScript fonts */ /* (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -197,6 +197,7 @@ { T1_FIELD_LOCATION_CID_INFO, T1_FIELD_LOCATION_FONT_DICT, + T1_FIELD_LOCATION_FONT_EXTRA, T1_FIELD_LOCATION_FONT_INFO, T1_FIELD_LOCATION_PRIVATE, T1_FIELD_LOCATION_BBOX, @@ -227,7 +228,11 @@ FT_UInt array_max; /* maximal number of elements for */ /* array */ FT_UInt count_offset; /* offset of element count for */ - /* arrays */ + /* arrays; must not be zero if in */ + /* use -- in other words, a */ + /* `num_FOO' element must not */ + /* start the used structure if we */ + /* parse a `FOO' array */ FT_UInt dict; /* where we expect it */ } T1_FieldRec; @@ -355,7 +360,7 @@ FT_Error (*to_bytes)( PS_Parser parser, FT_Byte* bytes, - FT_Long max_bytes, + FT_Offset max_bytes, FT_Long* pnum_bytes, FT_Bool delimiters ); @@ -528,13 +533,6 @@ /* */ /* max_contours :: Maximal number of contours in builder outline. */ /* */ - /* last :: The last point position. */ - /* */ - /* scale_x :: The horizontal scaling value (FUnits to */ - /* sub-pixels). */ - /* */ - /* scale_y :: The vertical scaling value (FUnits to sub-pixels). */ - /* */ /* pos_x :: The horizontal translation (if composite glyph). */ /* */ /* pos_y :: The vertical translation (if composite glyph). */ @@ -567,11 +565,6 @@ FT_Outline* base; FT_Outline* current; - FT_Vector last; - - FT_Fixed scale_x; - FT_Fixed scale_y; - FT_Pos pos_x; FT_Pos pos_y; @@ -582,7 +575,6 @@ T1_ParseState parse_state; FT_Bool load_points; FT_Bool no_recurse; - FT_Bool shift; FT_Bool metrics_only; @@ -697,9 +689,11 @@ T1_Decoder_Callback parse_callback; T1_Decoder_FuncsRec funcs; - FT_Int* buildchar; + FT_Long* buildchar; FT_UInt len_buildchar; + FT_Bool seac; + } T1_DecoderRec; @@ -761,7 +755,7 @@ FT_Int (*get_index)( const char* name, - FT_UInt len, + FT_Offset len, void* user_data ); void* user_data; Index: include/freetype/internal/pshints.h =================================================================== --- include/freetype/internal/pshints.h (revision 44270) +++ include/freetype/internal/pshints.h (working copy) @@ -6,7 +6,7 @@ /* recorders (specification only). These are used to support native */ /* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */ /* */ -/* Copyright 2001, 2002, 2003, 2005, 2006, 2007 by */ +/* Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -157,7 +157,8 @@ * 0 for horizontal stems (hstem), 1 for vertical ones (vstem). * * coords :: - * Array of 2 integers, used as (position,length) stem descriptor. + * Array of 2 coordinates in 16.16 format, used as (position,length) + * stem descriptor. * * @note: * Use vertical coordinates (y) for horizontal stems (dim=0). Use @@ -175,9 +176,9 @@ * */ typedef void - (*T1_Hints_SetStemFunc)( T1_Hints hints, - FT_UInt dimension, - FT_Long* coords ); + (*T1_Hints_SetStemFunc)( T1_Hints hints, + FT_UInt dimension, + FT_Fixed* coords ); /************************************************************************* @@ -197,8 +198,8 @@ * 0 for horizontal stems, 1 for vertical ones. * * coords :: - * An array of 6 integers, holding 3 (position,length) pairs for the - * counter-controlled stems. + * An array of 6 values in 16.16 format, holding 3 (position,length) + * pairs for the counter-controlled stems. * * @note: * Use vertical coordinates (y) for horizontal stems (dim=0). Use @@ -209,9 +210,9 @@ * */ typedef void - (*T1_Hints_SetStem3Func)( T1_Hints hints, - FT_UInt dimension, - FT_Long* coords ); + (*T1_Hints_SetStem3Func)( T1_Hints hints, + FT_UInt dimension, + FT_Fixed* coords ); /************************************************************************* @@ -446,7 +447,7 @@ * The number of stems. * * coords :: - * An array of `count' (position,length) pairs. + * An array of `count' (position,length) pairs in 16.16 format. * * @note: * Use vertical coordinates (y) for horizontal stems (dim=0). Use @@ -678,7 +679,31 @@ typedef PSHinter_Interface* PSHinter_Service; +#ifndef FT_CONFIG_OPTION_PIC +#define FT_DEFINE_PSHINTER_INTERFACE(class_, get_globals_funcs_, \ + get_t1_funcs_, get_t2_funcs_) \ + static const PSHinter_Interface class_ = \ + { \ + get_globals_funcs_, get_t1_funcs_, get_t2_funcs_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_PSHINTER_INTERFACE(class_, get_globals_funcs_, \ + get_t1_funcs_, get_t2_funcs_) \ + void \ + FT_Init_Class_##class_( FT_Library library, \ + PSHinter_Interface* clazz) \ + { \ + FT_UNUSED(library); \ + clazz->get_globals_funcs = get_globals_funcs_; \ + clazz->get_t1_funcs = get_t1_funcs_; \ + clazz->get_t2_funcs = get_t2_funcs_; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + FT_END_HEADER #endif /* __PSHINTS_H__ */ Index: include/freetype/internal/services/svbdf.h =================================================================== --- include/freetype/internal/services/svbdf.h (revision 44270) +++ include/freetype/internal/services/svbdf.h (working copy) @@ -45,6 +45,26 @@ FT_BDF_GetPropertyFunc get_property; }; +#ifndef FT_CONFIG_OPTION_PIC + +#define FT_DEFINE_SERVICE_BDFRec(class_, get_charset_id_, get_property_) \ + static const FT_Service_BDFRec class_ = \ + { \ + get_charset_id_, get_property_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_SERVICE_BDFRec(class_, get_charset_id_, get_property_) \ + void \ + FT_Init_Class_##class_( FT_Service_BDFRec* clazz ) \ + { \ + clazz->get_charset_id = get_charset_id_; \ + clazz->get_property = get_property_; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + /* */ Index: include/freetype/internal/services/svcid.h =================================================================== --- include/freetype/internal/services/svcid.h (revision 0) +++ include/freetype/internal/services/svcid.h (revision 0) @@ -0,0 +1,83 @@ +/***************************************************************************/ +/* */ +/* svcid.h */ +/* */ +/* The FreeType CID font services (specification). */ +/* */ +/* Copyright 2007, 2009 by Derek Clegg, Michael Toftdal. */ +/* */ +/* 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 __SVCID_H__ +#define __SVCID_H__ + +#include FT_INTERNAL_SERVICE_H + + +FT_BEGIN_HEADER + + +#define FT_SERVICE_ID_CID "CID" + + typedef FT_Error + (*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face face, + const char* *registry, + const char* *ordering, + FT_Int *supplement ); + typedef FT_Error + (*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face face, + FT_Bool *is_cid ); + typedef FT_Error + (*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face face, + FT_UInt glyph_index, + FT_UInt *cid ); + + FT_DEFINE_SERVICE( CID ) + { + FT_CID_GetRegistryOrderingSupplementFunc get_ros; + FT_CID_GetIsInternallyCIDKeyedFunc get_is_cid; + FT_CID_GetCIDFromGlyphIndexFunc get_cid_from_glyph_index; + }; + +#ifndef FT_CONFIG_OPTION_PIC + +#define FT_DEFINE_SERVICE_CIDREC(class_, get_ros_, \ + get_is_cid_, get_cid_from_glyph_index_ ) \ + static const FT_Service_CIDRec class_ = \ + { \ + get_ros_, get_is_cid_, get_cid_from_glyph_index_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_SERVICE_CIDREC(class_, get_ros_, \ + get_is_cid_, get_cid_from_glyph_index_ ) \ + void \ + FT_Init_Class_##class_( FT_Library library, \ + FT_Service_CIDRec* clazz) \ + { \ + FT_UNUSED(library); \ + clazz->get_ros = get_ros_; \ + clazz->get_is_cid = get_is_cid_; \ + clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + + /* */ + + +FT_END_HEADER + + +#endif /* __SVCID_H__ */ + + +/* END */ Index: include/freetype/internal/services/svgldict.h =================================================================== --- include/freetype/internal/services/svgldict.h (revision 44270) +++ include/freetype/internal/services/svgldict.h (working copy) @@ -51,6 +51,28 @@ FT_GlyphDict_NameIndexFunc name_index; /* optional */ }; +#ifndef FT_CONFIG_OPTION_PIC + +#define FT_DEFINE_SERVICE_GLYPHDICTREC(class_, get_name_, name_index_) \ + static const FT_Service_GlyphDictRec class_ = \ + { \ + get_name_, name_index_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_SERVICE_GLYPHDICTREC(class_, get_name_, name_index_) \ + void \ + FT_Init_Class_##class_( FT_Library library, \ + FT_Service_GlyphDictRec* clazz) \ + { \ + FT_UNUSED(library); \ + clazz->get_name = get_name_; \ + clazz->name_index = name_index_; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + /* */ Index: include/freetype/internal/services/svmm.h =================================================================== --- include/freetype/internal/services/svmm.h (revision 44270) +++ include/freetype/internal/services/svmm.h (working copy) @@ -68,6 +68,31 @@ FT_Set_Var_Design_Func set_var_design; }; +#ifndef FT_CONFIG_OPTION_PIC + +#define FT_DEFINE_SERVICE_MULTIMASTERSREC(class_, get_mm_, set_mm_design_, \ + set_mm_blend_, get_mm_var_, set_var_design_) \ + static const FT_Service_MultiMastersRec class_ = \ + { \ + get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_SERVICE_MULTIMASTERSREC(class_, get_mm_, set_mm_design_, \ + set_mm_blend_, get_mm_var_, set_var_design_) \ + void \ + FT_Init_Class_##class_( FT_Service_MultiMastersRec* clazz ) \ + { \ + clazz->get_mm = get_mm_; \ + clazz->set_mm_design = set_mm_design_; \ + clazz->set_mm_blend = set_mm_blend_; \ + clazz->get_mm_var = get_mm_var_; \ + clazz->set_var_design = set_var_design_; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + /* */ Index: include/freetype/internal/services/svpostnm.h =================================================================== --- include/freetype/internal/services/svpostnm.h (revision 44270) +++ include/freetype/internal/services/svpostnm.h (working copy) @@ -46,6 +46,27 @@ FT_PsName_GetFunc get_ps_font_name; }; +#ifndef FT_CONFIG_OPTION_PIC + +#define FT_DEFINE_SERVICE_PSFONTNAMEREC(class_, get_ps_font_name_) \ + static const FT_Service_PsFontNameRec class_ = \ + { \ + get_ps_font_name_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_SERVICE_PSFONTNAMEREC(class_, get_ps_font_name_) \ + void \ + FT_Init_Class_##class_( FT_Library library, \ + FT_Service_PsFontNameRec* clazz) \ + { \ + FT_UNUSED(library); \ + clazz->get_ps_font_name = get_ps_font_name_; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + /* */ Index: include/freetype/internal/services/svpscmap.h =================================================================== --- include/freetype/internal/services/svpscmap.h (revision 44270) +++ include/freetype/internal/services/svpscmap.h (working copy) @@ -98,7 +98,7 @@ (*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes, FT_UInt32 unicode ); - typedef FT_ULong + typedef FT_UInt32 (*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes, FT_UInt32 *unicode ); @@ -117,6 +117,41 @@ const unsigned short* adobe_expert_encoding; }; + +#ifndef FT_CONFIG_OPTION_PIC + +#define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \ + unicodes_char_index_, unicodes_char_next_, macintosh_name_, \ + adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_) \ + static const FT_Service_PsCMapsRec class_ = \ + { \ + unicode_value_, unicodes_init_, \ + unicodes_char_index_, unicodes_char_next_, macintosh_name_, \ + adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \ + unicodes_char_index_, unicodes_char_next_, macintosh_name_, \ + adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_) \ + void \ + FT_Init_Class_##class_( FT_Library library, \ + FT_Service_PsCMapsRec* clazz) \ + { \ + FT_UNUSED(library); \ + clazz->unicode_value = unicode_value_; \ + clazz->unicodes_init = unicodes_init_; \ + clazz->unicodes_char_index = unicodes_char_index_; \ + clazz->unicodes_char_next = unicodes_char_next_; \ + clazz->macintosh_name = macintosh_name_; \ + clazz->adobe_std_strings = adobe_std_strings_; \ + clazz->adobe_std_encoding = adobe_std_encoding_; \ + clazz->adobe_expert_encoding = adobe_expert_encoding_; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + /* */ Index: include/freetype/internal/services/svpsinfo.h =================================================================== --- include/freetype/internal/services/svpsinfo.h (revision 44270) +++ include/freetype/internal/services/svpsinfo.h (working copy) @@ -4,7 +4,7 @@ /* */ /* The FreeType PostScript info service (specification). */ /* */ -/* Copyright 2003, 2004 by */ +/* Copyright 2003, 2004, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -33,6 +33,10 @@ (*PS_GetFontInfoFunc)( FT_Face face, PS_FontInfoRec* afont_info ); + typedef FT_Error + (*PS_GetFontExtraFunc)( FT_Face face, + PS_FontExtraRec* afont_extra ); + typedef FT_Int (*PS_HasGlyphNamesFunc)( FT_Face face ); @@ -44,10 +48,38 @@ FT_DEFINE_SERVICE( PsInfo ) { PS_GetFontInfoFunc ps_get_font_info; + PS_GetFontExtraFunc ps_get_font_extra; PS_HasGlyphNamesFunc ps_has_glyph_names; PS_GetFontPrivateFunc ps_get_font_private; }; +#ifndef FT_CONFIG_OPTION_PIC + +#define FT_DEFINE_SERVICE_PSINFOREC(class_, get_font_info_, \ + ps_get_font_extra_, has_glyph_names_, get_font_private_) \ + static const FT_Service_PsInfoRec class_ = \ + { \ + get_font_info_, ps_get_font_extra_, has_glyph_names_, \ + get_font_private_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_SERVICE_PSINFOREC(class_, get_font_info_, \ + ps_get_font_extra_, has_glyph_names_, get_font_private_) \ + void \ + FT_Init_Class_##class_( FT_Library library, \ + FT_Service_PsInfoRec* clazz) \ + { \ + FT_UNUSED(library); \ + clazz->ps_get_font_info = get_font_info_; \ + clazz->ps_get_font_extra = ps_get_font_extra_; \ + clazz->ps_has_glyph_names = has_glyph_names_; \ + clazz->ps_get_font_private = get_font_private_; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + /* */ Index: include/freetype/internal/services/svsfnt.h =================================================================== --- include/freetype/internal/services/svsfnt.h (revision 44270) +++ include/freetype/internal/services/svsfnt.h (working copy) @@ -58,6 +58,7 @@ (*FT_SFNT_TableInfoFunc)( FT_Face face, FT_UInt idx, FT_ULong *tag, + FT_ULong *offset, FT_ULong *length ); @@ -68,6 +69,27 @@ FT_SFNT_TableInfoFunc table_info; }; +#ifndef FT_CONFIG_OPTION_PIC + +#define FT_DEFINE_SERVICE_SFNT_TABLEREC(class_, load_, get_, info_) \ + static const FT_Service_SFNT_TableRec class_ = \ + { \ + load_, get_, info_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_SERVICE_SFNT_TABLEREC(class_, load_, get_, info_) \ + void \ + FT_Init_Class_##class_( FT_Service_SFNT_TableRec* clazz ) \ + { \ + clazz->load_table = load_; \ + clazz->get_table = get_; \ + clazz->table_info = info_; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + /* */ Index: include/freetype/internal/services/svttcmap.h =================================================================== --- include/freetype/internal/services/svttcmap.h (revision 44270) +++ include/freetype/internal/services/svttcmap.h (working copy) @@ -1,13 +1,13 @@ /***************************************************************************/ /* */ -/* svsttcmap.h */ +/* svttcmap.h */ /* */ /* The FreeType TrueType/sfnt cmap extra information service. */ /* */ /* Copyright 2003 by */ /* Masatake YAMATO, Redhat K.K. */ /* */ -/* Copyright 2003 by */ +/* Copyright 2003, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -49,6 +49,13 @@ /* The language ID used in Mac fonts. Definitions of values are in */ /* freetype/ttnameid.h. */ /* */ + /* format :: */ + /* The cmap format. OpenType 1.5 defines the formats 0 (byte */ + /* encoding table), 2~(high-byte mapping through table), 4~(segment */ + /* mapping to delta values), 6~(trimmed table mapping), 8~(mixed */ + /* 16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented */ + /* coverage), and 14 (Unicode Variation Sequences). */ + /* */ typedef struct TT_CMapInfo_ { FT_ULong language; @@ -67,6 +74,27 @@ TT_CMap_Info_GetFunc get_cmap_info; }; +#ifndef FT_CONFIG_OPTION_PIC + +#define FT_DEFINE_SERVICE_TTCMAPSREC(class_, get_cmap_info_) \ + static const FT_Service_TTCMapsRec class_ = \ + { \ + get_cmap_info_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_SERVICE_TTCMAPSREC(class_, get_cmap_info_) \ + void \ + FT_Init_Class_##class_( FT_Library library, \ + FT_Service_TTCMapsRec* clazz) \ + { \ + FT_UNUSED(library); \ + clazz->get_cmap_info = get_cmap_info_; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + /* */ Index: include/freetype/internal/services/svttglyf.h =================================================================== --- include/freetype/internal/services/svttglyf.h (revision 44270) +++ include/freetype/internal/services/svttglyf.h (working copy) @@ -37,6 +37,25 @@ TT_Glyf_GetLocationFunc get_location; }; +#ifndef FT_CONFIG_OPTION_PIC + +#define FT_DEFINE_SERVICE_TTGLYFREC(class_, get_location_ ) \ + static const FT_Service_TTGlyfRec class_ = \ + { \ + get_location_ \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#define FT_DEFINE_SERVICE_TTGLYFREC(class_, get_location_ ) \ + void \ + FT_Init_Class_##class_( FT_Service_TTGlyfRec* clazz ) \ + { \ + clazz->get_location = get_location_; \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + /* */ Index: include/freetype/internal/sfnt.h =================================================================== --- include/freetype/internal/sfnt.h (revision 44270) +++ include/freetype/internal/sfnt.h (working copy) @@ -753,7 +753,142 @@ /* transitional */ typedef SFNT_Interface* SFNT_Service; +#ifndef FT_CONFIG_OPTION_PIC +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS +#define FT_DEFINE_DRIVERS_OLD_INTERNAL(a) \ + a, +#else + #define FT_DEFINE_DRIVERS_OLD_INTERNAL(a) +#endif +#define FT_INTERNAL(a) \ + a, + +#define FT_DEFINE_SFNT_INTERFACE(class_, \ + goto_table_, init_face_, load_face_, done_face_, get_interface_, \ + load_any_, load_sfnt_header_, load_directory_, load_head_, \ + load_hhea_, load_cmap_, load_maxp_, load_os2_, load_post_, \ + load_name_, free_name_, load_hdmx_stub_, free_hdmx_stub_, \ + load_kern_, load_gasp_, load_pclt_, load_bhed_, \ + set_sbit_strike_stub_, load_sbits_stub_, find_sbit_image_, \ + load_sbit_metrics_, load_sbit_image_, free_sbits_stub_, \ + get_psname_, free_psnames_, load_charmap_stub_, free_charmap_stub_, \ + get_kerning_, load_font_dir_, load_hmtx_, load_eblc_, free_eblc_, \ + set_sbit_strike_, load_strike_metrics_, get_metrics_ ) \ + static const SFNT_Interface class_ = \ + { \ + FT_INTERNAL(goto_table_) \ + FT_INTERNAL(init_face_) \ + FT_INTERNAL(load_face_) \ + FT_INTERNAL(done_face_) \ + FT_INTERNAL(get_interface_) \ + FT_INTERNAL(load_any_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sfnt_header_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(load_directory_) \ + FT_INTERNAL(load_head_) \ + FT_INTERNAL(load_hhea_) \ + FT_INTERNAL(load_cmap_) \ + FT_INTERNAL(load_maxp_) \ + FT_INTERNAL(load_os2_) \ + FT_INTERNAL(load_post_) \ + FT_INTERNAL(load_name_) \ + FT_INTERNAL(free_name_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(load_hdmx_stub_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(free_hdmx_stub_) \ + FT_INTERNAL(load_kern_) \ + FT_INTERNAL(load_gasp_) \ + FT_INTERNAL(load_pclt_) \ + FT_INTERNAL(load_bhed_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(set_sbit_strike_stub_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbits_stub_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(find_sbit_image_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbit_metrics_) \ + FT_INTERNAL(load_sbit_image_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(free_sbits_stub_) \ + FT_INTERNAL(get_psname_) \ + FT_INTERNAL(free_psnames_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(load_charmap_stub_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(free_charmap_stub_) \ + FT_INTERNAL(get_kerning_) \ + FT_INTERNAL(load_font_dir_) \ + FT_INTERNAL(load_hmtx_) \ + FT_INTERNAL(load_eblc_) \ + FT_INTERNAL(free_eblc_) \ + FT_INTERNAL(set_sbit_strike_) \ + FT_INTERNAL(load_strike_metrics_) \ + FT_INTERNAL(get_metrics_) \ + }; + +#else /* FT_CONFIG_OPTION_PIC */ + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS +#define FT_DEFINE_DRIVERS_OLD_INTERNAL(a, a_) \ + clazz->a = a_; +#else + #define FT_DEFINE_DRIVERS_OLD_INTERNAL(a, a_) +#endif +#define FT_INTERNAL(a, a_) \ + clazz->a = a_; + +#define FT_DEFINE_SFNT_INTERFACE(class_, \ + goto_table_, init_face_, load_face_, done_face_, get_interface_, \ + load_any_, load_sfnt_header_, load_directory_, load_head_, \ + load_hhea_, load_cmap_, load_maxp_, load_os2_, load_post_, \ + load_name_, free_name_, load_hdmx_stub_, free_hdmx_stub_, \ + load_kern_, load_gasp_, load_pclt_, load_bhed_, \ + set_sbit_strike_stub_, load_sbits_stub_, find_sbit_image_, \ + load_sbit_metrics_, load_sbit_image_, free_sbits_stub_, \ + get_psname_, free_psnames_, load_charmap_stub_, free_charmap_stub_, \ + get_kerning_, load_font_dir_, load_hmtx_, load_eblc_, free_eblc_, \ + set_sbit_strike_, load_strike_metrics_, get_metrics_ ) \ + void \ + FT_Init_Class_##class_( FT_Library library, SFNT_Interface* clazz ) \ + { \ + FT_UNUSED(library); \ + FT_INTERNAL(goto_table,goto_table_) \ + FT_INTERNAL(init_face,init_face_) \ + FT_INTERNAL(load_face,load_face_) \ + FT_INTERNAL(done_face,done_face_) \ + FT_INTERNAL(get_interface,get_interface_) \ + FT_INTERNAL(load_any,load_any_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sfnt_header,load_sfnt_header_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(load_directory,load_directory_) \ + FT_INTERNAL(load_head,load_head_) \ + FT_INTERNAL(load_hhea,load_hhea_) \ + FT_INTERNAL(load_cmap,load_cmap_) \ + FT_INTERNAL(load_maxp,load_maxp_) \ + FT_INTERNAL(load_os2,load_os2_) \ + FT_INTERNAL(load_post,load_post_) \ + FT_INTERNAL(load_name,load_name_) \ + FT_INTERNAL(free_name,free_name_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(load_hdmx_stub,load_hdmx_stub_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(free_hdmx_stub,free_hdmx_stub_) \ + FT_INTERNAL(load_kern,load_kern_) \ + FT_INTERNAL(load_gasp,load_gasp_) \ + FT_INTERNAL(load_pclt,load_pclt_) \ + FT_INTERNAL(load_bhed,load_bhed_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(set_sbit_strike_stub,set_sbit_strike_stub_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbits_stub,load_sbits_stub_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(find_sbit_image,find_sbit_image_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbit_metrics,load_sbit_metrics_) \ + FT_INTERNAL(load_sbit_image,load_sbit_image_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(free_sbits_stub,free_sbits_stub_) \ + FT_INTERNAL(get_psname,get_psname_) \ + FT_INTERNAL(free_psnames,free_psnames_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(load_charmap_stub,load_charmap_stub_) \ + FT_DEFINE_DRIVERS_OLD_INTERNAL(free_charmap_stub,free_charmap_stub_) \ + FT_INTERNAL(get_kerning,get_kerning_) \ + FT_INTERNAL(load_font_dir,load_font_dir_) \ + FT_INTERNAL(load_hmtx,load_hmtx_) \ + FT_INTERNAL(load_eblc,load_eblc_) \ + FT_INTERNAL(free_eblc,free_eblc_) \ + FT_INTERNAL(set_sbit_strike,set_sbit_strike_) \ + FT_INTERNAL(load_strike_metrics,load_strike_metrics_) \ + FT_INTERNAL(get_metrics,get_metrics_) \ + } + +#endif /* FT_CONFIG_OPTION_PIC */ + FT_END_HEADER #endif /* __SFNT_H__ */ Index: include/freetype/internal/t1types.h =================================================================== --- include/freetype/internal/t1types.h (revision 44270) +++ include/freetype/internal/t1types.h (working copy) @@ -5,7 +5,7 @@ /* Basic Type1/Type2 type definitions and interface (specification */ /* only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -58,7 +58,9 @@ /* */ /* code_first :: The lowest valid character code in the encoding. */ /* */ - /* code_last :: The highest valid character code in the encoding. */ + /* code_last :: The highest valid character code in the encoding */ + /* + 1. When equal to code_first there are no valid */ + /* character codes. */ /* */ /* char_index :: An array of corresponding glyph indices. */ /* */ @@ -87,11 +89,24 @@ } T1_EncodingType; + /* used to hold extra data of PS_FontInfoRec that + * cannot be stored in the publicly defined structure. + * + * Note these can't be blended with multiple-masters. + */ + typedef struct PS_FontExtraRec_ + { + FT_UShort fs_type; + + } PS_FontExtraRec; + + typedef struct T1_FontRec_ { - PS_FontInfoRec font_info; /* font info dictionary */ - PS_PrivateRec private_dict; /* private dictionary */ - FT_String* font_name; /* top-level dictionary */ + PS_FontInfoRec font_info; /* font info dictionary */ + PS_FontExtraRec font_extra; /* font info extra fields */ + PS_PrivateRec private_dict; /* private dictionary */ + FT_String* font_name; /* top-level dictionary */ T1_EncodingType encoding_type; T1_EncodingRec encoding; @@ -217,7 +232,7 @@ /* undocumented, optional: has the same meaning as len_buildchar */ /* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25 */ FT_UInt len_buildchar; - FT_Int* buildchar; + FT_Long* buildchar; /* since version 2.1 - interface to PostScript hinter */ const void* pshinter; @@ -231,7 +246,10 @@ void* psnames; void* psaux; CID_FaceInfoRec cid; + PS_FontExtraRec font_extra; +#if 0 void* afm_data; +#endif CID_Subrs subrs; /* since version 2.1 - interface to PostScript hinter */ Index: include/freetype/internal/tttypes.h =================================================================== --- include/freetype/internal/tttypes.h (revision 44270) +++ include/freetype/internal/tttypes.h (working copy) @@ -5,7 +5,7 @@ /* Basic SFNT/TrueType type definitions and interface (specification */ /* only). */ /* */ -/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -586,7 +586,7 @@ /* table_offset :: The offset of the index table in the `EBLC' */ /* table. Only used during strike loading. */ /* */ - typedef struct TT_SBit_RangeRec + typedef struct TT_SBit_RangeRec_ { FT_UShort first_glyph; FT_UShort last_glyph; @@ -902,7 +902,7 @@ FT_Byte* table; FT_Byte* table_end; FT_Byte* strings; - FT_UInt32 strings_size; + FT_ULong strings_size; FT_UInt num_strikes; FT_Bool loaded; @@ -1401,7 +1401,7 @@ FT_Byte* vert_metrics; FT_ULong vert_metrics_size; - FT_UInt num_locations; + FT_ULong num_locations; /* in broken TTF, gid > 0xFFFF */ FT_Byte* glyph_locations; FT_Byte* hdmx_table; Index: include/freetype/t1tables.h =================================================================== --- include/freetype/t1tables.h (revision 44270) +++ include/freetype/t1tables.h (working copy) @@ -5,7 +5,7 @@ /* Basic Type 1/Type 2 tables definitions and interface (specification */ /* only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -43,7 +43,7 @@ /* Type 1 Tables */ /* */ /* <Abstract> */ - /* Type 1 (PostScript) specific font tables. */ + /* Type~1 (PostScript) specific font tables. */ /* */ /* <Description> */ /* This section contains the definition of Type 1-specific tables, */ @@ -62,11 +62,11 @@ /* PS_FontInfoRec */ /* */ /* <Description> */ - /* A structure used to model a Type1/Type2 FontInfo dictionary. Note */ - /* that for Multiple Master fonts, each instance has its own */ + /* A structure used to model a Type~1 or Type~2 FontInfo dictionary. */ + /* Note that for Multiple Master fonts, each instance has its own */ /* FontInfo dictionary. */ /* */ - typedef struct PS_FontInfoRec + typedef struct PS_FontInfoRec_ { FT_String* version; FT_String* notice; @@ -78,12 +78,23 @@ FT_Short underline_position; FT_UShort underline_thickness; - } PS_FontInfoRec, *PS_FontInfo; + } PS_FontInfoRec; /*************************************************************************/ /* */ /* <Struct> */ + /* PS_FontInfo */ + /* */ + /* <Description> */ + /* A handle to a @PS_FontInfoRec structure. */ + /* */ + typedef struct PS_FontInfoRec_* PS_FontInfo; + + + /*************************************************************************/ + /* */ + /* <Struct> */ /* T1_FontInfo */ /* */ /* <Description> */ @@ -100,9 +111,9 @@ /* PS_PrivateRec */ /* */ /* <Description> */ - /* A structure used to model a Type1/Type2 private dictionary. Note */ - /* that for Multiple Master fonts, each instance has its own Private */ - /* dictionary. */ + /* A structure used to model a Type~1 or Type~2 private dictionary. */ + /* Note that for Multiple Master fonts, each instance has its own */ + /* Private dictionary. */ /* */ typedef struct PS_PrivateRec_ { @@ -142,12 +153,23 @@ FT_Short min_feature[2]; - } PS_PrivateRec, *PS_Private; + } PS_PrivateRec; /*************************************************************************/ /* */ /* <Struct> */ + /* PS_Private */ + /* */ + /* <Description> */ + /* A handle to a @PS_PrivateRec structure. */ + /* */ + typedef struct PS_PrivateRec_* PS_Private; + + + /*************************************************************************/ + /* */ + /* <Struct> */ /* T1_Private */ /* */ /* <Description> */ @@ -168,7 +190,7 @@ /* given blend dictionary (font info or private). Used to support */ /* Multiple Masters fonts. */ /* */ - typedef enum + typedef enum T1_Blend_Flags_ { /*# required fields in a FontInfo blend dictionary */ T1_BLEND_UNDERLINE_POSITION = 0, @@ -272,6 +294,14 @@ typedef PS_BlendRec T1_Blend; + /*************************************************************************/ + /* */ + /* <Struct> */ + /* CID_FaceDictRec */ + /* */ + /* <Description> */ + /* A structure used to represent data in a CID top-level dictionary. */ + /* */ typedef struct CID_FaceDictRec_ { PS_PrivateRec private_dict; @@ -290,9 +320,22 @@ FT_ULong subrmap_offset; FT_Int sd_bytes; - } CID_FaceDictRec, *CID_FaceDict; + } CID_FaceDictRec; + /*************************************************************************/ + /* */ + /* <Struct> */ + /* CID_FaceDict */ + /* */ + /* <Description> */ + /* A handle to a @CID_FaceDictRec structure. */ + /* */ + typedef struct CID_FaceDictRec_* CID_FaceDict; + + /* */ + + /* backwards-compatible definition */ typedef CID_FaceDictRec CID_FontDict; @@ -332,12 +375,23 @@ FT_ULong data_offset; - } CID_FaceInfoRec, *CID_FaceInfo; + } CID_FaceInfoRec; /*************************************************************************/ /* */ /* <Struct> */ + /* CID_FaceInfo */ + /* */ + /* <Description> */ + /* A handle to a @CID_FaceInfoRec structure. */ + /* */ + typedef struct CID_FaceInfoRec_* CID_FaceInfo; + + + /*************************************************************************/ + /* */ + /* <Struct> */ /* CID_Info */ /* */ /* <Description> */ @@ -347,101 +401,101 @@ /* */ typedef CID_FaceInfoRec CID_Info; - /* */ - - /************************************************************************ - * - * @function: - * FT_Has_PS_Glyph_Names - * - * @description: - * Return true if a given face provides reliable Postscript glyph - * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro, - * except that certain fonts (mostly TrueType) contain incorrect - * glyph name tables. - * - * When this function returns true, the caller is sure that the glyph - * names returned by @FT_Get_Glyph_Name are reliable. - * - * @input: - * face :: - * face handle - * - * @return: - * Boolean. True if glyph names are reliable. - */ + /************************************************************************ + * + * @function: + * FT_Has_PS_Glyph_Names + * + * @description: + * Return true if a given face provides reliable PostScript glyph + * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro, + * except that certain fonts (mostly TrueType) contain incorrect + * glyph name tables. + * + * When this function returns true, the caller is sure that the glyph + * names returned by @FT_Get_Glyph_Name are reliable. + * + * @input: + * face :: + * face handle + * + * @return: + * Boolean. True if glyph names are reliable. + * + */ FT_EXPORT( FT_Int ) FT_Has_PS_Glyph_Names( FT_Face face ); - /************************************************************************ - * - * @function: - * FT_Get_PS_Font_Info - * - * @description: - * Retrieve the @PS_FontInfoRec structure corresponding to a given - * Postscript font. - * - * @input: - * face :: - * Postscript face handle. - * - * @output: - * afont_info :: - * Output font info structure pointer. - * - * @return: - * FreeType error code. 0 means success. - * - * @note: - * The string pointers within the font info structure are owned by - * the face and don't need to be freed by the caller. - * - * If the font's format is not Postscript-based, this function will - * return the `FT_Err_Invalid_Argument' error code. - */ + /************************************************************************ + * + * @function: + * FT_Get_PS_Font_Info + * + * @description: + * Retrieve the @PS_FontInfoRec structure corresponding to a given + * PostScript font. + * + * @input: + * face :: + * PostScript face handle. + * + * @output: + * afont_info :: + * Output font info structure pointer. + * + * @return: + * FreeType error code. 0~means success. + * + * @note: + * The string pointers within the font info structure are owned by + * the face and don't need to be freed by the caller. + * + * If the font's format is not PostScript-based, this function will + * return the `FT_Err_Invalid_Argument' error code. + * + */ FT_EXPORT( FT_Error ) - FT_Get_PS_Font_Info( FT_Face face, - PS_FontInfoRec *afont_info ); + FT_Get_PS_Font_Info( FT_Face face, + PS_FontInfo afont_info ); - /************************************************************************ - * - * @function: - * FT_Get_PS_Font_Private - * - * @description: - * Retrieve the @PS_PrivateRec structure corresponding to a given - * Postscript font. - * - * @input: - * face :: - * Postscript face handle. - * - * @output: - * afont_private :: - * Output private dictionary structure pointer. - * - * @return: - * FreeType error code. 0 means success. - * - * @note: - * The string pointers within the font info structure are owned by - * the face and don't need to be freed by the caller. - * - * If the font's format is not Postscript-based, this function will - * return the `FT_Err_Invalid_Argument' error code. - */ + /************************************************************************ + * + * @function: + * FT_Get_PS_Font_Private + * + * @description: + * Retrieve the @PS_PrivateRec structure corresponding to a given + * PostScript font. + * + * @input: + * face :: + * PostScript face handle. + * + * @output: + * afont_private :: + * Output private dictionary structure pointer. + * + * @return: + * FreeType error code. 0~means success. + * + * @note: + * The string pointers within the @PS_PrivateRec structure are owned by + * the face and don't need to be freed by the caller. + * + * If the font's format is not PostScript-based, this function returns + * the `FT_Err_Invalid_Argument' error code. + * + */ FT_EXPORT( FT_Error ) - FT_Get_PS_Font_Private( FT_Face face, - PS_PrivateRec *afont_private ); + FT_Get_PS_Font_Private( FT_Face face, + PS_Private afont_private ); - /* */ + /* */ - FT_END_HEADER #endif /* __T1TABLES_H__ */ Index: include/freetype/ttnameid.h =================================================================== --- include/freetype/ttnameid.h (revision 44270) +++ include/freetype/ttnameid.h (working copy) @@ -4,7 +4,7 @@ /* */ /* TrueType name ID definitions (specification only). */ /* */ -/* Copyright 1996-2002, 2003, 2004, 2006, 2007 by */ +/* Copyright 1996-2002, 2003, 2004, 2006, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -28,6 +28,13 @@ /*************************************************************************/ /* */ + /* <Section> */ + /* truetype_tables */ + /* */ + + + /*************************************************************************/ + /* */ /* Possible values for the `platform' identifier code in the name */ /* records of the TTF `name' table. */ /* */ @@ -108,13 +115,18 @@ * * TT_APPLE_ID_UNICODE_32 :: * Unicode 3.1 and beyond, using UTF-32. + * + * TT_APPLE_ID_VARIANT_SELECTOR :: + * From Adobe, not Apple. Not a normal cmap. Specifies variations + * on a real cmap. */ -#define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */ -#define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */ -#define TT_APPLE_ID_ISO_10646 2 /* deprecated */ -#define TT_APPLE_ID_UNICODE_2_0 3 /* or later */ -#define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */ +#define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */ +#define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */ +#define TT_APPLE_ID_ISO_10646 2 /* deprecated */ +#define TT_APPLE_ID_UNICODE_2_0 3 /* or later */ +#define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */ +#define TT_APPLE_ID_VARIANT_SELECTOR 5 /* variation selector data */ /*********************************************************************** @@ -290,6 +302,8 @@ * Adobe expert encoding. * TT_ADOBE_ID_CUSTOM :: * Adobe custom encoding. + * TT_ADOBE_ID_LATIN_1 :: + * Adobe Latin~1 encoding. */ #define TT_ADOBE_ID_STANDARD 0 @@ -821,16 +835,18 @@ /* This is new in OpenType 1.3 */ #define TT_NAME_ID_CID_FINDFONT_NAME 20 + /* This is new in OpenType 1.5 */ +#define TT_NAME_ID_WWS_FAMILY 21 +#define TT_NAME_ID_WWS_SUBFAMILY 22 + /*************************************************************************/ /* */ /* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table. */ /* */ - /* Updated 02-Jul-2000. */ + /* Updated 08-Nov-2008. */ /* */ - /* General Scripts Area */ - /* Bit 0 Basic Latin */ #define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */ /* Bit 1 C1 Controls and Latin-1 Supplement */ @@ -839,27 +855,44 @@ #define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */ /* Bit 3 Latin Extended-B */ #define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */ - /* Bit 4 IPA Extensions */ + /* Bit 4 IPA Extensions */ + /* Phonetic Extensions */ + /* Phonetic Extensions Supplement */ #define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */ + /* U+1D00-U+1D7F */ + /* U+1D80-U+1DBF */ /* Bit 5 Spacing Modifier Letters */ + /* Modifier Tone Letters */ #define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */ - /* Bit 6 Combining Diacritical Marks */ + /* U+A700-U+A71F */ + /* Bit 6 Combining Diacritical Marks */ + /* Combining Diacritical Marks Supplement */ #define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */ + /* U+1DC0-U+1DFF */ /* Bit 7 Greek and Coptic */ #define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */ - /* Bit 8 is reserved (was: Greek Symbols and Coptic) */ - /* Bit 9 Cyrillic + */ - /* Cyrillic Supplementary */ + /* Bit 8 Coptic */ +#define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */ + /* Bit 9 Cyrillic */ + /* Cyrillic Supplement */ + /* Cyrillic Extended-A */ + /* Cyrillic Extended-B */ #define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */ /* U+0500-U+052F */ + /* U+2DE0-U+2DFF */ + /* U+A640-U+A69F */ /* Bit 10 Armenian */ #define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */ /* Bit 11 Hebrew */ #define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */ - /* Bit 12 is reserved (was: Hebrew Extended) */ - /* Bit 13 Arabic */ + /* Bit 12 Vai */ +#define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */ + /* Bit 13 Arabic */ + /* Arabic Supplement */ #define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */ - /* Bit 14 is reserved (was: Arabic Extended) */ + /* U+0750-U+077F */ + /* Bit 14 NKo */ +#define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */ /* Bit 15 Devanagari */ #define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */ /* Bit 16 Bengali */ @@ -882,20 +915,26 @@ #define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */ /* Bit 25 Lao */ #define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */ - /* Bit 26 Georgian */ + /* Bit 26 Georgian */ + /* Georgian Supplement */ #define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */ - /* Bit 27 is reserved (was Georgian Extended) */ + /* U+2D00-U+2D2F */ + /* Bit 27 Balinese */ +#define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */ /* Bit 28 Hangul Jamo */ #define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */ /* Bit 29 Latin Extended Additional */ + /* Latin Extended-C */ + /* Latin Extended-D */ #define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */ + /* U+2C60-U+2C7F */ + /* U+A720-U+A7FF */ /* Bit 30 Greek Extended */ #define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */ - - /* Symbols Area */ - - /* Bit 31 General Punctuation */ + /* Bit 31 General Punctuation */ + /* Supplemental Punctuation */ #define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */ + /* U+2E00-U+2E7F */ /* Bit 32 Superscripts And Subscripts */ #define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */ /* Bit 33 Currency Symbols */ @@ -906,16 +945,18 @@ #define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */ /* Bit 36 Number Forms */ #define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */ - /* Bit 37 Arrows + */ - /* Supplemental Arrows-A + */ - /* Supplemental Arrows-B */ + /* Bit 37 Arrows */ + /* Supplemental Arrows-A */ + /* Supplemental Arrows-B */ + /* Miscellaneous Symbols and Arrows */ #define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */ /* U+27F0-U+27FF */ /* U+2900-U+297F */ - /* Bit 38 Mathematical Operators + */ - /* Supplemental Mathematical Operators + */ - /* Miscellaneous Mathematical Symbols-A + */ - /* Miscellaneous Mathematical Symbols-B */ + /* U+2B00-U+2BFF */ + /* Bit 38 Mathematical Operators */ + /* Supplemental Mathematical Operators */ + /* Miscellaneous Mathematical Symbols-A */ + /* Miscellaneous Mathematical Symbols-B */ #define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */ /* U+2A00-U+2AFF */ /* U+27C0-U+27EF */ @@ -938,60 +979,53 @@ #define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */ /* Bit 47 Dingbats */ #define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */ - - /* CJK Phonetics and Symbols Area */ - /* Bit 48 CJK Symbols and Punctuation */ #define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */ /* Bit 49 Hiragana */ #define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */ - /* Bit 50 Katakana + */ - /* Katakana Phonetic Extensions */ + /* Bit 50 Katakana */ + /* Katakana Phonetic Extensions */ #define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */ /* U+31F0-U+31FF */ - /* Bit 51 Bopomofo + */ - /* Bopomofo Extended */ + /* Bit 51 Bopomofo */ + /* Bopomofo Extended */ #define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */ /* U+31A0-U+31BF */ /* Bit 52 Hangul Compatibility Jamo */ #define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */ - /* Bit 53 Kanbun */ -#define TT_UCR_CJK_MISC (1L << 21) /* U+3190-U+319F */ -#define TT_UCR_KANBUN TT_UCR_CJK_MISC + /* Bit 53 Phags-Pa */ +#define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */ +#define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */ +#define TT_UCR_PHAGSPA /* Bit 54 Enclosed CJK Letters and Months */ #define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */ /* Bit 55 CJK Compatibility */ #define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */ - - /* Hangul Syllables Area */ - - /* Bit 56 Hangul */ + /* Bit 56 Hangul Syllables */ #define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */ - - /* Surrogates Area */ - - /* Bit 57 High Surrogates + */ - /* High Private Use Surrogates + */ - /* Low Surrogates */ + /* Bit 57 High Surrogates */ + /* High Private Use Surrogates */ + /* Low Surrogates */ + /* */ + /* According to OpenType specs v.1.3+, */ + /* setting bit 57 implies that there is */ + /* at least one codepoint beyond the */ + /* Basic Multilingual Plane that is */ + /* supported by this font. So it really */ + /* means >= U+10000 */ #define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */ /* U+DB80-U+DBFF */ /* U+DC00-U+DFFF */ - /* According to OpenType specs v.1.3+, setting bit 57 implies that there */ - /* is at least one codepoint beyond the Basic Multilingual Plane that is */ - /* supported by this font. So it really means: >= U+10000 */ - - /* Bit 58 is reserved for Unicode SubRanges */ - - /* CJK Ideographs Area */ - - /* Bit 59 CJK Unified Ideographs + */ - /* CJK Radicals Supplement + */ - /* Kangxi Radicals + */ - /* Ideographic Description Characters + */ - /* CJK Unified Ideographs Extension A */ - /* CJK Unified Ideographs Extension A + */ - /* CJK Unified Ideographs Extension B + */ - /* Kanbun */ +#define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES + /* Bit 58 Phoenician */ +#define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/ + /* Bit 59 CJK Unified Ideographs */ + /* CJK Radicals Supplement */ + /* Kangxi Radicals */ + /* Ideographic Description Characters */ + /* CJK Unified Ideographs Extension A */ + /* CJK Unified Ideographs Extension B */ + /* Kanbun */ #define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */ /* U+2E80-U+2EFF */ /* U+2F00-U+2FDF */ @@ -999,17 +1033,13 @@ /* U+3400-U+4DB5 */ /*U+20000-U+2A6DF*/ /* U+3190-U+319F */ - - /* Private Use Area */ - /* Bit 60 Private Use */ #define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */ - - /* Compatibility Area and Specials */ - - /* Bit 61 CJK Compatibility Ideographs + */ - /* CJK Compatibility Ideographs Supplement */ -#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+F900-U+FAFF */ + /* Bit 61 CJK Strokes */ + /* CJK Compatibility Ideographs */ + /* CJK Compatibility Ideographs Supplement */ +#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */ + /* U+F900-U+FAFF */ /*U+2F800-U+2FA1F*/ /* Bit 62 Alphabetic Presentation Forms */ #define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */ @@ -1017,8 +1047,10 @@ #define TT_UCR_ARABIC_PRESENTATIONS_A (1L << 31) /* U+FB50-U+FDFF */ /* Bit 64 Combining Half Marks */ #define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */ - /* Bit 65 CJK Compatibility Forms */ -#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE30-U+FE4F */ + /* Bit 65 Vertical forms */ + /* CJK Compatibility Forms */ +#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */ + /* U+FE30-U+FE4F */ /* Bit 66 Small Form Variants */ #define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */ /* Bit 67 Arabic Presentation Forms-B */ @@ -1037,8 +1069,12 @@ #define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */ /* Bit 74 Myanmar */ #define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */ - /* Bit 75 Ethiopic */ + /* Bit 75 Ethiopic */ + /* Ethiopic Supplement */ + /* Ethiopic Extended */ #define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */ + /* U+1380-U+139F */ + /* U+2D80-U+2DDF */ /* Bit 76 Cherokee */ #define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */ /* Bit 77 Unified Canadian Aboriginal Syllabics */ @@ -1047,20 +1083,22 @@ #define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */ /* Bit 79 Runic */ #define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */ - /* Bit 80 Khmer */ + /* Bit 80 Khmer */ + /* Khmer Symbols */ #define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */ + /* U+19E0-U+19FF */ /* Bit 81 Mongolian */ #define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */ /* Bit 82 Braille Patterns */ #define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */ - /* Bit 83 Yi Syllables + */ - /* Yi Radicals */ + /* Bit 83 Yi Syllables */ + /* Yi Radicals */ #define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */ /* U+A490-U+A4CF */ - /* Bit 84 Tagalog + */ - /* Hanunoo + */ - /* Buhid + */ - /* Tagbanwa */ + /* Bit 84 Tagalog */ + /* Hanunoo */ + /* Buhid */ + /* Tagbanwa */ #define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */ /* U+1720-U+173F */ /* U+1740-U+175F */ @@ -1071,20 +1109,97 @@ #define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/ /* Bit 87 Deseret */ #define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/ - /* Bit 88 Byzantine Musical Symbols + */ - /* Musical Symbols */ + /* Bit 88 Byzantine Musical Symbols */ + /* Musical Symbols */ + /* Ancient Greek Musical Notation */ #define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/ /*U+1D100-U+1D1FF*/ + /*U+1D200-U+1D24F*/ /* Bit 89 Mathematical Alphanumeric Symbols */ #define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/ - /* Bit 90 Private Use (plane 15) + */ - /* Private Use (plane 16) */ + /* Bit 90 Private Use (plane 15) */ + /* Private Use (plane 16) */ #define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/ /*U+100000-U+10FFFD*/ - /* Bit 91 Variation Selectors */ + /* Bit 91 Variation Selectors */ + /* Variation Selectors Supplement */ #define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */ + /*U+E0100-U+E01EF*/ /* Bit 92 Tags */ #define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/ + /* Bit 93 Limbu */ +#define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */ + /* Bit 94 Tai Le */ +#define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */ + /* Bit 95 New Tai Lue */ +#define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */ + /* Bit 96 Buginese */ +#define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */ + /* Bit 97 Glagolitic */ +#define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */ + /* Bit 98 Tifinagh */ +#define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */ + /* Bit 99 Yijing Hexagram Symbols */ +#define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */ + /* Bit 100 Syloti Nagri */ +#define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */ + /* Bit 101 Linear B Syllabary */ + /* Linear B Ideograms */ + /* Aegean Numbers */ +#define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/ + /*U+10080-U+100FF*/ + /*U+10100-U+1013F*/ + /* Bit 102 Ancient Greek Numbers */ +#define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/ + /* Bit 103 Ugaritic */ +#define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/ + /* Bit 104 Old Persian */ +#define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/ + /* Bit 105 Shavian */ +#define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/ + /* Bit 106 Osmanya */ +#define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/ + /* Bit 107 Cypriot Syllabary */ +#define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/ + /* Bit 108 Kharoshthi */ +#define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/ + /* Bit 109 Tai Xuan Jing Symbols */ +#define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/ + /* Bit 110 Cuneiform */ + /* Cuneiform Numbers and Punctuation */ +#define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/ + /*U+12400-U+1247F*/ + /* Bit 111 Counting Rod Numerals */ +#define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/ + /* Bit 112 Sundanese */ +#define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */ + /* Bit 113 Lepcha */ +#define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */ + /* Bit 114 Ol Chiki */ +#define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */ + /* Bit 115 Saurashtra */ +#define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */ + /* Bit 116 Kayah Li */ +#define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */ + /* Bit 117 Rejang */ +#define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */ + /* Bit 118 Cham */ +#define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */ + /* Bit 119 Ancient Symbols */ +#define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/ + /* Bit 120 Phaistos Disc */ +#define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/ + /* Bit 121 Carian */ + /* Lycian */ + /* Lydian */ +#define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/ + /*U+10280-U+1029F*/ + /*U+10920-U+1093F*/ + /* Bit 122 Domino Tiles */ + /* Mahjong Tiles */ +#define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/ + /*U+1F000-U+1F02F*/ + /* Bit 123-127 Reserved for process-internal usage */ /*************************************************************************/ @@ -1103,7 +1218,7 @@ /* */ /* Here some alias #defines in order to be clearer. */ /* */ - /* These are not always #defined to stay within the 31 character limit */ + /* These are not always #defined to stay within the 31~character limit */ /* which some compilers have. */ /* */ /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern */ Index: include/freetype/tttables.h =================================================================== --- include/freetype/tttables.h (revision 44270) +++ include/freetype/tttables.h (working copy) @@ -5,7 +5,7 @@ /* Basic SFNT/TrueType tables definitions and interface */ /* (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -156,9 +156,9 @@ /* caret_Slope_Run :: The run coefficient of the cursor's */ /* slope. */ /* */ - /* Reserved :: 10 reserved bytes. */ + /* Reserved :: 8~reserved bytes. */ /* */ - /* metric_Data_Format :: Always 0. */ + /* metric_Data_Format :: Always~0. */ /* */ /* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */ /* table -- this value can be smaller than */ @@ -281,9 +281,9 @@ /* This value is `reserved' in vmtx */ /* version 1.0. */ /* */ - /* Reserved :: 8 reserved bytes. */ + /* Reserved :: 8~reserved bytes. */ /* */ - /* metric_Data_Format :: Always 0. */ + /* metric_Data_Format :: Always~0. */ /* */ /* number_Of_HMetrics :: Number of VMetrics entries in the */ /* `vmtx' table -- this value can be */ @@ -406,9 +406,9 @@ /* TT_Postscript */ /* */ /* <Description> */ - /* A structure used to model a TrueType Postscript table. All fields */ + /* A structure used to model a TrueType PostScript table. All fields */ /* comply to the TrueType specification. This structure does not */ - /* reference the Postscript glyph names, which can be nevertheless */ + /* reference the PostScript glyph names, which can be nevertheless */ /* accessed with the `ttpost' module. */ /* */ typedef struct TT_Postscript_ @@ -555,7 +555,7 @@ /* An enumeration used to specify the index of an SFNT table. */ /* Used in the @FT_Get_Sfnt_Table API function. */ /* */ - typedef enum + typedef enum FT_Sfnt_Tag_ { ft_sfnt_head = 0, ft_sfnt_maxp = 1, @@ -578,7 +578,7 @@ /* FT_Get_Sfnt_Table */ /* */ /* <Description> */ - /* Returns a pointer to a given SFNT table within a face. */ + /* Return a pointer to a given SFNT table within a face. */ /* */ /* <Input> */ /* face :: A handle to the source. */ @@ -586,7 +586,7 @@ /* tag :: The index of the SFNT table. */ /* */ /* <Return> */ - /* A type-less pointer to the table. This will be 0 in case of */ + /* A type-less pointer to the table. This will be~0 in case of */ /* error, or if the corresponding table was not found *OR* loaded */ /* from the file. */ /* */ @@ -608,14 +608,14 @@ * FT_Load_Sfnt_Table * * @description: - * Loads any font table into client memory. + * Load any font table into client memory. * * @input: * face :: * A handle to the source face. * * tag :: - * The four-byte tag of the table to load. Use the value 0 if you want + * The four-byte tag of the table to load. Use the value~0 if you want * to access the whole font file. Otherwise, you can use one of the * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new * one with @FT_MAKE_TAG. @@ -633,18 +633,18 @@ * If the `length' parameter is NULL, then try to load the whole table. * Return an error code if it fails. * - * Else, if `*length' is 0, exit immediately while returning the + * Else, if `*length' is~0, exit immediately while returning the * table's (or file) full size in it. * * Else the number of bytes to read from the table or file, from the * starting offset. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: * If you need to determine the table's length you should first call this - * function with `*length' set to 0, as in the following example: + * function with `*length' set to~0, as in the following example: * * { * FT_ULong length = 0; @@ -674,7 +674,7 @@ * FT_Sfnt_Table_Info * * @description: - * Returns information on an SFNT table. + * Return information on an SFNT table. * * @input: * face :: @@ -692,10 +692,10 @@ * The length of the SFNT table. * * @return: - * FreeType error code. 0 means success. + * FreeType error code. 0~means success. * * @note: - * SFNT tables with length zero are treated as missing by Windows. + * SFNT tables with length zero are treated as missing. * */ FT_EXPORT( FT_Error ) @@ -720,7 +720,7 @@ /* */ /* <Return> */ /* The language ID of `charmap'. If `charmap' doesn't belong to a */ - /* TrueType/sfnt face, just return 0 as the default value. */ + /* TrueType/sfnt face, just return~0 as the default value. */ /* */ FT_EXPORT( FT_ULong ) FT_Get_CMap_Language_ID( FT_CharMap charmap ); Index: include/freetype/tttags.h =================================================================== --- include/freetype/tttags.h (revision 44270) +++ include/freetype/tttags.h (working copy) @@ -4,7 +4,7 @@ /* */ /* Tags for TrueType and OpenType tables (specification only). */ /* */ -/* Copyright 1996-2001, 2004, 2005 by */ +/* Copyright 1996-2001, 2004, 2005, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -41,6 +41,7 @@ #define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' ) #define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' ) #define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' ) +#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' ) #define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' ) #define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' ) #define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' ) @@ -49,6 +50,7 @@ #define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' ) #define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' ) #define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' ) +#define TTAG_FOND FT_MAKE_TAG( 'F', 'O', 'N', 'D' ) #define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' ) #define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' ) #define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' ) @@ -67,6 +69,8 @@ #define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' ) #define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' ) #define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' ) +#define TTAG_LWFN FT_MAKE_TAG( 'L', 'W', 'F', 'N' ) +#define TTAG_MATH FT_MAKE_TAG( 'M', 'A', 'T', 'H' ) #define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' ) #define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' ) #define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' ) @@ -78,14 +82,18 @@ #define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' ) #define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' ) #define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' ) +#define TTAG_POST FT_MAKE_TAG( 'P', 'O', 'S', 'T' ) #define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' ) #define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' ) #define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' ) +#define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' ) #define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' ) #define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' ) #define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' ) #define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' ) #define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' ) +#define TTAG_TYP1 FT_MAKE_TAG( 'T', 'Y', 'P', '1' ) +#define TTAG_typ1 FT_MAKE_TAG( 't', 'y', 'p', '1' ) #define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' ) #define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' ) #define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' ) Index: Jamfile =================================================================== --- Jamfile (revision 44270) +++ Jamfile (working copy) @@ -1,6 +1,6 @@ # FreeType 2 top Jamfile. # -# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 by +# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -194,7 +194,7 @@ actions RefDoc { - python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.3.5 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h + python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.3.11 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h } RefDoc refdoc ; Index: modules.cfg =================================================================== --- modules.cfg (revision 44270) +++ modules.cfg (working copy) @@ -1,6 +1,6 @@ # modules.cfg # -# Copyright 2005, 2006, 2007 by +# Copyright 2005, 2006, 2007, 2009 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -106,7 +106,7 @@ # FreeType's cache sub-system (quite stable but still in beta -- this means # that its public API is subject to change if necessary). See -# include/freetype/ftcache.h. +# include/freetype/ftcache.h. Needs ftglyph.c. AUX_MODULES += cache # TrueType GX/AAT table validation. Needs ftgxval.c below. @@ -158,37 +158,62 @@ # See include/freetype/ftbitmap.h for the API. BASE_EXTENSIONS += ftbitmap.c -# Convenience functions to handle glyphs. +# Access CID font information. # +# See include/freetype/ftcid.h for the API. +BASE_EXTENSIONS += ftcid.c + +# Access FSType information. Needs fttype1.c. +# +# See include/freetype/freetype.h for the API. +BASE_EXTENSIONS += ftfstype.c + +# Support for GASP table queries. +# +# See include/freetype/ftgasp.h for the API. +BASE_EXTENSIONS += ftgasp.c + +# Convenience functions to handle glyphs. Needs ftbitmap.c. +# # See include/freetype/ftglyph.h for the API. BASE_EXTENSIONS += ftglyph.c -# Interface for gxvalid module (which is required). +# Interface for gxvalid module. # # See include/freetype/ftgxval.h for the API. BASE_EXTENSIONS += ftgxval.c +# Support for LCD color filtering of subpixel bitmaps. +# +# See include/freetype/ftlcdfil.h for the API. +BASE_EXTENSIONS += ftlcdfil.c + # Multiple Master font interface. # # See include/freetype/ftmm.h for the API. BASE_EXTENSIONS += ftmm.c -# Interface for otvalid module (which is required). +# Interface for otvalid module. # # See include/freetype/ftotval.h for the API. BASE_EXTENSIONS += ftotval.c +# Support for FT_Face_CheckTrueTypePatents. +# +# See include/freetype/freetype.h for the API. +BASE_EXTENSIONS += ftpatent.c + # Interface for accessing PFR-specific data. Needs PFR font driver. # # See include/freetype/ftpfr.h for the API. BASE_EXTENSIONS += ftpfr.c -# Path stroker. +# Path stroker. Needs ftglyph.c. # # See include/freetype/ftstroke.h for the API. BASE_EXTENSIONS += ftstroke.c -# Support for synthetic embolding and slanting of fonts. +# Support for synthetic embolding and slanting of fonts. Needs ftbitmap.c. # # See include/freetype/ftsynth.h for the API. BASE_EXTENSIONS += ftsynth.c @@ -210,21 +235,6 @@ # See include/freetype/ftxf86.h for the API. BASE_EXTENSIONS += ftxf86.c -# Support for LCD color filtering of subpixel bitmaps. -# -# See include/freetype/ftlcdfil.h for the API. -BASE_EXTENSIONS += ftlcdfil.c - -# Support for GASP table queries. -# -# See include/freetype/ftgasp.h for the API. -BASE_EXTENSIONS += ftgasp.c - -# Support for FT_Face_CheckTrueTypePatents. -# -# See include/freetype.h for the API. -BASE_EXTENSIONS += ftpatent.c - #### #### The components `ftsystem.c' (for memory allocation and stream I/O #### management) and `ftdebug.c' (for emitting debug messages to the user) Index: README =================================================================== --- README (revision 44270) +++ README (working copy) @@ -9,8 +9,8 @@ is called `libttf'. They are *not* compatible! - FreeType 2.3.5 - ============== + FreeType 2.3.11 + =============== Please read the docs/CHANGES file, it contains IMPORTANT INFORMATION. @@ -26,9 +26,9 @@ and download one of the following files. - freetype-doc-2.3.5.tar.bz2 - freetype-doc-2.3.5.tar.gz - ftdoc235.zip + freetype-doc-2.3.11.tar.bz2 + freetype-doc-2.3.11.tar.gz + ftdoc2311.zip Bugs @@ -51,7 +51,7 @@ ---------------------------------------------------------------------- -Copyright 2006, 2007 by +Copyright 2006, 2007, 2008, 2009 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, Index: README.CVS =================================================================== --- README.CVS (revision 44270) +++ README.CVS (working copy) @@ -1,50 +0,0 @@ -The CVS archive doesn't contain pre-built configuration scripts for -UNIXish platforms. To generate them say - - sh autogen.sh - -which in turn depends on the following packages: - - automake (1.9.6) - libtool (1.5.22) - autoconf (2.59c) - -The versions given in parentheses are known to work. Newer versions -should work too, of course. Note that autogen.sh also sets up proper -file permissions for the `configure' and auxiliary scripts. - -A very common problem is that this script complains that the `aclocal' -program doesn't accept a `--force' option: - - generating `configure.ac' - running `aclocal -I . --force' - aclocal: unrecognized option -- `--force' - Try `aclocal --help' for more information. - error while running `aclocal -I . --force' - -This means that your version of the automake package is too old. -Please update it before trying to build FreeType. - - -For static builds which don't use platform specific optimizations, no -configure script is necessary at all; saying - - make setup ansi - make - -should work on all platforms which have GNU make (or makepp). - - ----------------------------------------------------------------------- - -Copyright 2005, 2006, 2007 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. - - ---- end of README.CVS --- Index: README.git =================================================================== --- README.git (revision 0) +++ README.git (revision 0) @@ -0,0 +1,46 @@ +The git archive doesn't contain pre-built configuration scripts for +UNIXish platforms. To generate them say + + sh autogen.sh + +which in turn depends on the following packages: + + automake (1.10.1) + libtool (2.2.4) + autoconf (2.62) + +The versions given in parentheses are known to work. Newer versions +should work too, of course. Note that autogen.sh also sets up proper +file permissions for the `configure' and auxiliary scripts. + +The autogen.sh script now checks the version of above three packages +whether they match the numbers above. Otherwise it will complain and +suggest either upgrading or using an environment variable to point to +a more recent version of the required tool(s). + +Note that `aclocal' is provided by the `automake' package on Linux, +and that `libtoolize' is called `glibtoolize' on Darwin (OS X). + + +For static builds which don't use platform specific optimizations, no +configure script is necessary at all; saying + + make setup ansi + make + +should work on all platforms which have GNU make (or makepp). + + +---------------------------------------------------------------------- + +Copyright 2005, 2006, 2007, 2008, 2009 by +David Turner, Robert Wilhelm, and Werner Lemberg. + +This file is part of the FreeType project, and may only be used, +modified, and distributed under the terms of the FreeType project +license, LICENSE.TXT. By continuing to use, modify, or distribute +this file you indicate that you have read the license and understand +and accept it fully. + + +--- end of README.CVS --- Index: src/autofit/afcjk.c =================================================================== --- src/autofit/afcjk.c (revision 44270) +++ src/autofit/afcjk.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for CJK script (body). */ /* */ -/* Copyright 2006, 2007 by */ +/* Copyright 2006, 2007, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -45,7 +45,7 @@ /*************************************************************************/ /*************************************************************************/ - static FT_Error + FT_LOCAL_DEF( FT_Error ) af_cjk_metrics_init( AF_LatinMetrics metrics, FT_Face face ) { @@ -58,10 +58,13 @@ if ( FT_Select_Charmap( face, FT_ENCODING_UNICODE ) ) face->charmap = NULL; + else + { + /* latin's version would suffice */ + af_latin_metrics_init_widths( metrics, face, 0x7530 ); + af_latin_metrics_check_digits( metrics, face ); + } - /* latin's version would suffice */ - af_latin_metrics_init_widths( metrics, face, 0x7530 ); - FT_Set_Charmap( face, oldmap ); return AF_Err_Ok; @@ -91,7 +94,7 @@ } - static void + FT_LOCAL_DEF( void ) af_cjk_metrics_scale( AF_LatinMetrics metrics, AF_Scaler scaler ) { @@ -427,7 +430,9 @@ /* insert a new edge in the list and */ /* sort according to the position */ - error = af_axis_hints_new_edge( axis, seg->pos, seg->dir, memory, &edge ); + error = af_axis_hints_new_edge( axis, seg->pos, + (AF_Direction)seg->dir, + memory, &edge ); if ( error ) goto Exit; @@ -596,7 +601,7 @@ } - static FT_Error + FT_LOCAL_DEF( FT_Error ) af_cjk_hints_init( AF_GlyphHints hints, AF_LatinMetrics metrics ) { @@ -1015,7 +1020,7 @@ AF_AxisHints axis = &hints->axis[dim]; AF_Edge edges = axis->edges; AF_Edge edge_limit = edges + axis->num_edges; - FT_Int n_edges; + FT_PtrDist n_edges; AF_Edge edge; AF_Edge anchor = 0; FT_Pos delta = 0; @@ -1251,10 +1256,15 @@ else if ( after >= edge_limit ) af_cjk_align_serif_edge( hints, before, edge ); else - edge->pos = before->pos + - FT_MulDiv( edge->fpos - before->fpos, - after->pos - before->pos, - after->fpos - before->fpos ); + { + if ( after->fpos == before->fpos ) + edge->pos = before->pos; + else + edge->pos = before->pos + + FT_MulDiv( edge->fpos - before->fpos, + after->pos - before->pos, + after->fpos - before->fpos ); + } } } } @@ -1350,7 +1360,7 @@ } - static FT_Error + FT_LOCAL_DEF( FT_Error ) af_cjk_hints_apply( AF_GlyphHints hints, FT_Outline* outline, AF_LatinMetrics metrics ) @@ -1434,35 +1444,33 @@ static const AF_Script_UniRangeRec af_cjk_uniranges[] = { #if 0 - { 0x0100, 0xFFFF }, /* why this? */ + AF_UNIRANGE_REC( 0x0100UL, 0xFFFFUL ), /* why this? */ #endif - { 0x2E80, 0x2EFF }, /* CJK Radicals Supplement */ - { 0x2F00, 0x2FDF }, /* Kangxi Radicals */ - { 0x3000, 0x303F }, /* CJK Symbols and Punctuation */ - { 0x3040, 0x309F }, /* Hiragana */ - { 0x30A0, 0x30FF }, /* Katakana */ - { 0x3100, 0x312F }, /* Bopomofo */ - { 0x3130, 0x318F }, /* Hangul Compatibility Jamo */ - { 0x31A0, 0x31BF }, /* Bopomofo Extended */ - { 0x31C0, 0x31EF }, /* CJK Strokes */ - { 0x31F0, 0x31FF }, /* Katakana Phonetic Extensions */ - { 0x3200, 0x32FF }, /* Enclosed CJK Letters and Months */ - { 0x3300, 0x33FF }, /* CJK Compatibility */ - { 0x3400, 0x4DBF }, /* CJK Unified Ideographs Extension A */ - { 0x4DC0, 0x4DFF }, /* Yijing Hexagram Symbols */ - { 0x4E00, 0x9FFF }, /* CJK Unified Ideographs */ - { 0xF900, 0xFAFF }, /* CJK Compatibility Ideographs */ - { 0xFE30, 0xFE4F }, /* CJK Compatibility Forms */ - { 0xFF00, 0xFFEF }, /* Halfwidth and Fullwidth Forms */ - { 0x20000, 0x2A6DF }, /* CJK Unified Ideographs Extension B */ - { 0x2F800, 0x2FA1F }, /* CJK Compatibility Ideographs Supplement */ - { 0, 0 } + AF_UNIRANGE_REC( 0x2E80UL, 0x2EFFUL ), /* CJK Radicals Supplement */ + AF_UNIRANGE_REC( 0x2F00UL, 0x2FDFUL ), /* Kangxi Radicals */ + AF_UNIRANGE_REC( 0x3000UL, 0x303FUL ), /* CJK Symbols and Punctuation */ + AF_UNIRANGE_REC( 0x3040UL, 0x309FUL ), /* Hiragana */ + AF_UNIRANGE_REC( 0x30A0UL, 0x30FFUL ), /* Katakana */ + AF_UNIRANGE_REC( 0x3100UL, 0x312FUL ), /* Bopomofo */ + AF_UNIRANGE_REC( 0x3130UL, 0x318FUL ), /* Hangul Compatibility Jamo */ + AF_UNIRANGE_REC( 0x31A0UL, 0x31BFUL ), /* Bopomofo Extended */ + AF_UNIRANGE_REC( 0x31C0UL, 0x31EFUL ), /* CJK Strokes */ + AF_UNIRANGE_REC( 0x31F0UL, 0x31FFUL ), /* Katakana Phonetic Extensions */ + AF_UNIRANGE_REC( 0x3200UL, 0x32FFUL ), /* Enclosed CJK Letters and Months */ + AF_UNIRANGE_REC( 0x3300UL, 0x33FFUL ), /* CJK Compatibility */ + AF_UNIRANGE_REC( 0x3400UL, 0x4DBFUL ), /* CJK Unified Ideographs Extension A */ + AF_UNIRANGE_REC( 0x4DC0UL, 0x4DFFUL ), /* Yijing Hexagram Symbols */ + AF_UNIRANGE_REC( 0x4E00UL, 0x9FFFUL ), /* CJK Unified Ideographs */ + AF_UNIRANGE_REC( 0xF900UL, 0xFAFFUL ), /* CJK Compatibility Ideographs */ + AF_UNIRANGE_REC( 0xFE30UL, 0xFE4FUL ), /* CJK Compatibility Forms */ + AF_UNIRANGE_REC( 0xFF00UL, 0xFFEFUL ), /* Halfwidth and Fullwidth Forms */ + AF_UNIRANGE_REC( 0x20000UL, 0x2A6DFUL ), /* CJK Unified Ideographs Extension B */ + AF_UNIRANGE_REC( 0x2F800UL, 0x2FA1FUL ), /* CJK Compatibility Ideographs Supplement */ + AF_UNIRANGE_REC( 0UL, 0UL ) }; - FT_CALLBACK_TABLE_DEF const AF_ScriptClassRec - af_cjk_script_class = - { + AF_DEFINE_SCRIPT_CLASS(af_cjk_script_class, AF_SCRIPT_CJK, af_cjk_uniranges, @@ -1474,19 +1482,17 @@ (AF_Script_InitHintsFunc) af_cjk_hints_init, (AF_Script_ApplyHintsFunc) af_cjk_hints_apply - }; + ) #else /* !AF_CONFIG_OPTION_CJK */ static const AF_Script_UniRangeRec af_cjk_uniranges[] = { - { 0, 0 } + AF_UNIRANGE_REC( 0UL, 0UL ) }; - FT_CALLBACK_TABLE_DEF const AF_ScriptClassRec - af_cjk_script_class = - { + AF_DEFINE_SCRIPT_CLASS(af_cjk_script_class, AF_SCRIPT_CJK, af_cjk_uniranges, @@ -1498,7 +1504,7 @@ (AF_Script_InitHintsFunc) NULL, (AF_Script_ApplyHintsFunc) NULL - }; + ) #endif /* !AF_CONFIG_OPTION_CJK */ Index: src/autofit/afcjk.h =================================================================== --- src/autofit/afcjk.h (revision 44270) +++ src/autofit/afcjk.h (working copy) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for CJK script (specification). */ /* */ -/* Copyright 2006 by */ +/* Copyright 2006, 2007 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -27,10 +27,26 @@ /* the CJK-specific script class */ - FT_CALLBACK_TABLE const AF_ScriptClassRec - af_cjk_script_class; + AF_DECLARE_SCRIPT_CLASS(af_cjk_script_class) + FT_LOCAL( FT_Error ) + af_cjk_metrics_init( AF_LatinMetrics metrics, + FT_Face face ); + + FT_LOCAL( void ) + af_cjk_metrics_scale( AF_LatinMetrics metrics, + AF_Scaler scaler ); + + FT_LOCAL( FT_Error ) + af_cjk_hints_init( AF_GlyphHints hints, + AF_LatinMetrics metrics ); + + FT_LOCAL( FT_Error ) + af_cjk_hints_apply( AF_GlyphHints hints, + FT_Outline* outline, + AF_LatinMetrics metrics ); + /* */ FT_END_HEADER Index: src/autofit/afdummy.c =================================================================== --- src/autofit/afdummy.c (revision 44270) +++ src/autofit/afdummy.c (working copy) @@ -42,9 +42,7 @@ } - FT_CALLBACK_TABLE_DEF const AF_ScriptClassRec - af_dummy_script_class = - { + AF_DEFINE_SCRIPT_CLASS(af_dummy_script_class, AF_SCRIPT_NONE, NULL, @@ -56,7 +54,7 @@ (AF_Script_InitHintsFunc) af_dummy_hints_init, (AF_Script_ApplyHintsFunc) af_dummy_hints_apply - }; + ) /* END */ Index: src/autofit/afdummy.h =================================================================== --- src/autofit/afdummy.h (revision 44270) +++ src/autofit/afdummy.h (working copy) @@ -29,8 +29,7 @@ * be performed. This is the default for non-latin glyphs! */ - FT_CALLBACK_TABLE const AF_ScriptClassRec - af_dummy_script_class; + AF_DECLARE_SCRIPT_CLASS(af_dummy_script_class) /* */ Index: src/autofit/afglobal.c =================================================================== --- src/autofit/afglobal.c (revision 44270) +++ src/autofit/afglobal.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter routines to compute global hinting values (body). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -21,6 +21,7 @@ #include "aflatin.h" #include "afcjk.h" #include "afindic.h" +#include "afpic.h" #include "aferrors.h" @@ -28,6 +29,11 @@ #include "aflatin2.h" #endif +#ifndef FT_CONFIG_OPTION_PIC + +/* when updating this table, don't forget to update + AF_SCRIPT_CLASSES_COUNT and autofit_module_class_pic_init */ + /* populate this list when you add new scripts */ static AF_ScriptClass const af_script_classes[] = { @@ -37,14 +43,18 @@ #endif &af_latin_script_class, &af_cjk_script_class, - &af_indic_script_class, + &af_indic_script_class, NULL /* do not remove */ }; +#endif /* FT_CONFIG_OPTION_PIC */ + /* index of default script in `af_script_classes' */ #define AF_SCRIPT_LIST_DEFAULT 2 - /* indicates an uncovered glyph */ -#define AF_SCRIPT_LIST_NONE 255 + /* a bit mask indicating an uncovered glyph */ +#define AF_SCRIPT_LIST_NONE 0x7F + /* if this flag is set, we have an ASCII digit */ +#define AF_DIGIT 0x80 /* @@ -55,7 +65,7 @@ typedef struct AF_FaceGlobalsRec_ { FT_Face face; - FT_UInt glyph_count; /* same as face->num_glyphs */ + FT_Long glyph_count; /* same as face->num_glyphs */ FT_Byte* glyph_scripts; AF_ScriptMetrics metrics[AF_SCRIPT_MAX]; @@ -72,7 +82,7 @@ FT_Face face = globals->face; FT_CharMap old_charmap = face->charmap; FT_Byte* gscripts = globals->glyph_scripts; - FT_UInt ss; + FT_UInt ss, i; /* the value 255 means `uncovered glyph' */ @@ -84,17 +94,17 @@ if ( error ) { /* - * Ignore this error; we simply use Latin as the standard - * script. XXX: Shouldn't we rather disable hinting? + * Ignore this error; we simply use the default script. + * XXX: Shouldn't we rather disable hinting? */ error = AF_Err_Ok; goto Exit; } /* scan each script in a Unicode charmap */ - for ( ss = 0; af_script_classes[ss]; ss++ ) + for ( ss = 0; AF_SCRIPT_CLASSES_GET[ss]; ss++ ) { - AF_ScriptClass clazz = af_script_classes[ss]; + AF_ScriptClass clazz = AF_SCRIPT_CLASSES_GET[ss]; AF_Script_UniRange range; @@ -114,7 +124,7 @@ gindex = FT_Get_Char_Index( face, charcode ); if ( gindex != 0 && - gindex < globals->glyph_count && + gindex < (FT_ULong)globals->glyph_count && gscripts[gindex] == AF_SCRIPT_LIST_NONE ) { gscripts[gindex] = (FT_Byte)ss; @@ -127,7 +137,7 @@ if ( gindex == 0 || charcode > range->last ) break; - if ( gindex < globals->glyph_count && + if ( gindex < (FT_ULong)globals->glyph_count && gscripts[gindex] == AF_SCRIPT_LIST_NONE ) { gscripts[gindex] = (FT_Byte)ss; @@ -136,13 +146,23 @@ } } + /* mark ASCII digits */ + for ( i = 0x30; i <= 0x39; i++ ) + { + FT_UInt gindex = FT_Get_Char_Index( face, i ); + + + if ( gindex != 0 && gindex < (FT_ULong)globals->glyph_count ) + gscripts[gindex] |= AF_DIGIT; + } + Exit: /* * By default, all uncovered glyphs are set to the latin script. * XXX: Shouldn't we disable hinting or do something similar? */ { - FT_UInt nn; + FT_Long nn; for ( nn = 0; nn < globals->glyph_count; nn++ ) @@ -201,7 +221,7 @@ { if ( globals->metrics[nn] ) { - AF_ScriptClass clazz = af_script_classes[nn]; + AF_ScriptClass clazz = AF_SCRIPT_CLASSES_GET[nn]; FT_ASSERT( globals->metrics[nn]->clazz == clazz ); @@ -232,12 +252,12 @@ FT_UInt gidx; AF_ScriptClass clazz; FT_UInt script = options & 15; - const FT_UInt script_max = sizeof ( af_script_classes ) / - sizeof ( af_script_classes[0] ); + const FT_Offset script_max = sizeof ( AF_SCRIPT_CLASSES_GET ) / + sizeof ( AF_SCRIPT_CLASSES_GET[0] ); FT_Error error = AF_Err_Ok; - if ( gindex >= globals->glyph_count ) + if ( gindex >= (FT_ULong)globals->glyph_count ) { error = AF_Err_Invalid_Argument; goto Exit; @@ -245,9 +265,9 @@ gidx = script; if ( gidx == 0 || gidx + 1 >= script_max ) - gidx = globals->glyph_scripts[gindex]; + gidx = globals->glyph_scripts[gindex] & AF_SCRIPT_LIST_NONE; - clazz = af_script_classes[gidx]; + clazz = AF_SCRIPT_CLASSES_GET[gidx]; if ( script == 0 ) script = clazz->script; @@ -286,4 +306,15 @@ } + FT_LOCAL_DEF( FT_Bool ) + af_face_globals_is_digit( AF_FaceGlobals globals, + FT_UInt gindex ) + { + if ( gindex < (FT_ULong)globals->glyph_count ) + return (FT_Bool)( globals->glyph_scripts[gindex] & AF_DIGIT ); + + return (FT_Bool)0; + } + + /* END */ Index: src/autofit/afglobal.h =================================================================== --- src/autofit/afglobal.h (revision 44270) +++ src/autofit/afglobal.h (working copy) @@ -5,7 +5,7 @@ /* Auto-fitter routines to compute global hinting values */ /* (specification). */ /* */ -/* Copyright 2003, 2004, 2005, 2007 by */ +/* Copyright 2003, 2004, 2005, 2007, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -56,9 +56,13 @@ FT_LOCAL( void ) af_face_globals_free( AF_FaceGlobals globals ); - /* */ + FT_LOCAL_DEF( FT_Bool ) + af_face_globals_is_digit( AF_FaceGlobals globals, + FT_UInt gindex ); + /* */ + FT_END_HEADER #endif /* __AF_GLOBALS_H__ */ Index: src/autofit/afhints.c =================================================================== --- src/autofit/afhints.c (revision 44270) +++ src/autofit/afhints.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines (body). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 2003, 2004, 2005, 2006, 2007, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -34,7 +34,7 @@ { FT_Int old_max = axis->max_segments; FT_Int new_max = old_max; - FT_Int big_max = FT_INT_MAX / sizeof ( *segment ); + FT_Int big_max = (FT_Int)( FT_INT_MAX / sizeof ( *segment ) ); if ( old_max >= big_max ) @@ -77,7 +77,7 @@ { FT_Int old_max = axis->max_edges; FT_Int new_max = old_max; - FT_Int big_max = FT_INT_MAX / sizeof ( *edge ); + FT_Int big_max = (FT_Int)( FT_INT_MAX / sizeof ( *edge ) ); if ( old_max >= big_max ) @@ -127,7 +127,7 @@ #ifdef AF_DEBUG -#include <stdio.h> +#include FT_CONFIG_STANDARD_LIBRARY_H static const char* af_dir_str( AF_Direction dir ) @@ -203,14 +203,14 @@ if ( flags & AF_EDGE_ROUND ) { - memcpy( temp + pos, "round", 5 ); + ft_memcpy( temp + pos, "round", 5 ); pos += 5; } if ( flags & AF_EDGE_SERIF ) { if ( pos > 0 ) temp[pos++] = ' '; - memcpy( temp + pos, "serif", 5 ); + ft_memcpy( temp + pos, "serif", 5 ); pos += 5; } if ( pos == 0 ) @@ -645,6 +645,7 @@ FT_Int contour_index = 0; + FT_UNUSED( first ); for ( point = points; point < point_limit; point++, vec++, tag++ ) { point->fx = (FT_Short)vec->x; @@ -940,8 +941,8 @@ } { - FT_UInt min, max, mid; - FT_Pos fpos; + FT_PtrDist min, max, mid; + FT_Pos fpos; /* find enclosing edges */ @@ -952,7 +953,7 @@ /* for small edge counts, a linear search is better */ if ( max <= 8 ) { - FT_UInt nn; + FT_PtrDist nn; for ( nn = 0; nn < max; nn++ ) if ( edges[nn].fpos >= u )