Formatting.
Cleaning up of ChangeLog. * docs/license.txt: s/X Windows/X Window System/. * src/raster/ftraster.c: Fix definition condition of MEM_Set(). * src/smooth/ftgrays.c (M_Y): Change value to 192. * src/base/ftdbgmem.c (ft_mem_table_destroy): Fix printf() parameter. Remove unused variable. * src/cache/ftcimage.c (ftc_image_node_init, ftc_image_node_compare): Remove unused variables. * src/cache/ftcsbits.c (ftc_sbit_node_weight): Remove unused variable. * src/raster/ftraster.c (MEM_Set): Move definition down to avoid compiler warning. * src/autohint/ahhint.c (ah_hinter_hint_edges): Use UNUSED() to avoid compiler warnings. * src/pcf/pcfread.c (tableNames): Use `const'. (pcf_read_TOC): Change counter name to avoid compiler warning. Use `const'. * src/pshinter/pshrec.c (ps_hints_close): Remove redundant declaration. * src/pshinter/pshalgo1.c (psh1_hint_table_init): Rename variables to avoid shadowing. * src/pshinter/pshalgo2.c (psh2_hint_table_activate_mask): Ditto. * src/type1/t1objs.h: Remove double declarations of `T1_Size_Init()' and `T1_Size_Done()'.
This commit is contained in:
parent
d0e6ad636f
commit
c3b2160869
284
ChangeLog
284
ChangeLog
|
@ -1,121 +1,178 @@
|
|||
2001-12-05 David Krause <freetype@davidkrause.com>
|
||||
|
||||
* docs/license.txt: s/X Windows/X Window System/.
|
||||
|
||||
2001-12-04 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
* src/raster/ftraster.c: Fix definition condition of MEM_Set().
|
||||
* src/smooth/ftgrays.c (M_Y): Change value to 192.
|
||||
* src/base/ftdbgmem.c (ft_mem_table_destroy): Fix printf() parameter.
|
||||
Remove unused variable.
|
||||
* src/cache/ftcimage.c (ftc_image_node_init,
|
||||
ftc_image_node_compare): Remove unused variables.
|
||||
* src/cache/ftcsbits.c (ftc_sbit_node_weight): Remove unused
|
||||
variable.
|
||||
* src/raster/ftraster.c (MEM_Set): Move definition down to avoid
|
||||
compiler warning.
|
||||
* src/autohint/ahhint.c (ah_hinter_hint_edges): Use UNUSED() to
|
||||
avoid compiler warnings.
|
||||
* src/pcf/pcfread.c (tableNames): Use `const'.
|
||||
(pcf_read_TOC): Change counter name to avoid compiler warning.
|
||||
Use `const'.
|
||||
* src/pshinter/pshrec.c (ps_hints_close): Remove redundant
|
||||
declaration.
|
||||
* src/pshinter/pshalgo1.c (psh1_hint_table_init): Rename variables
|
||||
to avoid shadowing.
|
||||
* src/pshinter/pshalgo2.c (psh2_hint_table_activate_mask): Ditto.
|
||||
* src/type1/t1objs.h: Remove double declarations of `T1_Size_Init()'
|
||||
and `T1_Size_Done()'.
|
||||
|
||||
2001-11-20 Antoine Leca <antoineleca@multimania.com>
|
||||
|
||||
* include/freetype/ttnameid.h: Added some new Microsoft language
|
||||
codes and LCIDs as found in MSDN (Passport SDK). Also added
|
||||
comments about the meaning of bit 57 of OS/2 (TT_UCR_SURROGATES)
|
||||
which with OpenType v.1.3 now means "there is a character beyond
|
||||
FFFF in this font". Thanks to Detlef Wuerkner <TetiSoft@apg.lahn.de>
|
||||
for noticing this.
|
||||
comments about the meaning of bit 57 of the `OS/2' table
|
||||
(TT_UCR_SURROGATES) which (with OpenType v.1.3) now means "there is
|
||||
a character beyond 0xFFFF in this font". Thanks to Detlef Würkner
|
||||
<TetiSoft@apg.lahn.de> for noticing this.
|
||||
|
||||
2001-11-20 David Turner <david@freetype.org>
|
||||
|
||||
* src/pshinter/{pshalgo2.c, pshalgo1.c}: fixed stupid bug in sorting
|
||||
* src/pshinter/{pshalgo2.c, pshalgo1.c}: Fixed stupid bug in sorting
|
||||
routine that created nasty alignment artefacts.
|
||||
|
||||
* src/pshinter/pshrec.c, tests/gview.c: debugging updates..
|
||||
* src/pshinter/pshrec.c, tests/gview.c: Debugging updates.
|
||||
|
||||
* src/smooth/ftgrays.c: de-activated experimental gamme support,
|
||||
apparently, "optimal" gamma tables depend on the monitor type,
|
||||
* src/smooth/ftgrays.c: De-activated experimental gamma support.
|
||||
Apparently, `optimal' gamma tables depend on the monitor type,
|
||||
resolution and general karma, so it's better to compute them outside
|
||||
of the rasterizer itself..
|
||||
|
||||
of the rasterizer itself.
|
||||
(gray_convert_glyph): Use `volatile' keyword.
|
||||
|
||||
2001-10-29 David Turner <david@freetype.org>
|
||||
|
||||
* src/smooth/ftgrays.c: adding experimental "gamma" support. This
|
||||
produces smoother glyphs at small sizes for very little cost
|
||||
Adding experimental `gamma' support. This produces smoother glyphs
|
||||
at small sizes for very little cost.
|
||||
|
||||
* src/autohint/ahglyph.c, src/autohint/ahhint.c: various fixes to
|
||||
the auto-hinter. They merely improve the output of sans-serif fonts.
|
||||
Note that there are still problems with serifed fonts and composites
|
||||
(accented characters)
|
||||
* src/smooth/ftgrays.c (grays_init_gamma): New function.
|
||||
(gray_raster_new): Use it.
|
||||
|
||||
* tests/gview.c: updated the debugging glyph viewer to show the
|
||||
hints generated by the "autohint" module
|
||||
Various fixes to the auto-hinter. They merely improve the output of
|
||||
sans-serif fonts. Note that there are still problems with serifed
|
||||
fonts and composites (accented characters).
|
||||
|
||||
* src/autohint/ahglyph.c (ah_outline_load,
|
||||
ah_outline_link_segments): Implement it.
|
||||
Fix typos.
|
||||
(ah_outline_save, ah_outline_compute_segments): Fix typos.
|
||||
* src/autohint/ahhint.c (ah_align_serif_edge): New argument
|
||||
`vertical'. Implement improvement.
|
||||
(ah_hint_edges_3, ah_hinter_hint_edges): Implement it.
|
||||
Fix typos.
|
||||
(ah_hinter_align_strong_points, ah_hinter_align_weak_points): Fix
|
||||
typos.
|
||||
(ah_hinter_load): Set `ah_debug_hinter' if DEBUG_HINTER is defined.
|
||||
* src/autohint/ahmodule.c: Implement support for DEBUG_HINTER macro.
|
||||
* src/autohint/ahtypes.h: Ditto.
|
||||
(AH_Hinter): Remove `disable_horz_edges' and `disable_vert_edges'
|
||||
(making them global as `ah_debug_disable_horz' and
|
||||
`ah_debug_disable_vert').
|
||||
Fix typos.
|
||||
|
||||
* tests/gview.c: Updated the debugging glyph viewer to show the
|
||||
hints generated by the "autohint" module.
|
||||
|
||||
2001-10-27 David Turner <david@freetype.org>
|
||||
|
||||
* src/cache/ftchunk.c (ftc_chunk_cache_lookup): fixed a bug that
|
||||
* src/cache/ftcchunk.c (ftc_chunk_cache_lookup): Fixed a bug that
|
||||
considerably lowered the performance of the abstract chunk cache.
|
||||
|
||||
2001-10-26 David Turner <david@freetype.org>
|
||||
|
||||
* include/freetype/ftcache.h, include/freetype/cache/*.h,
|
||||
src/cache/*.c: Major re-design of the cache sub-system to provide
|
||||
better performance as well as an "Acquire"/"Release" API..
|
||||
|
||||
seems to work well here.. but probably needs a bit more testing..
|
||||
|
||||
better performance as well as an "Acquire"/"Release" API. Seems to
|
||||
work well here, but probably needs a bit more testing.
|
||||
|
||||
2001-10-26 Leonard Rosenthol <leonardr@lazerware.com>
|
||||
|
||||
* updated Mac OS README (builds/mac/) to reflect my taking over
|
||||
the project and that is now being actively maintained.
|
||||
* builds/mac/README: Updated to reflect my taking over the project
|
||||
and that is now being actively maintained.
|
||||
|
||||
* Applied patches from Paul Miller (<paulm@profoundeffects.com>)
|
||||
to /src/base/ftmac.c to support loading a face other than the
|
||||
* src/base/ftmac.c (parse_fond): Applied patches from Paul Miller
|
||||
<paulm@profoundeffects.com> to support loading a face other than the
|
||||
first from a FOND resource.
|
||||
|
||||
(FT_New_Face_From_FOND): Updated.
|
||||
|
||||
2001-10-25 Leonard Rosenthol <leonardr@lazerware.com>
|
||||
|
||||
* update CodeWarrior project for Mac OS (builds/mac/ftlib.prj)
|
||||
for latest version (7) of CWPro and for recent changes to the
|
||||
FT source tree.
|
||||
|
||||
* builds/mac/ftlib.prj: Update of CodeWarrior project file for Mac
|
||||
OS for latest version (7) of CWPro and for recent changes to the FT
|
||||
source tree.
|
||||
|
||||
2001-10-25 David Turner <david@freetype.org>
|
||||
|
||||
* include/freetype/config/ftoption.h: updated comment to explain
|
||||
* include/freetype/config/ftoption.h: Updated comments to explain
|
||||
precisely how to use project-specific macro definitions without
|
||||
modifying this file manually..
|
||||
modifying this file manually.
|
||||
|
||||
(FT_CONFIG_FORCE_INT64): Define.
|
||||
|
||||
(FT_DEBUG_MEMORY): New macro.
|
||||
|
||||
2001-10-24 Tom Kacvinsky <tkacvins@freetype.org>
|
||||
|
||||
* builds/unix/ftsystem.c (FT_New_Memory): Added a missing `{'.
|
||||
|
||||
|
||||
2001-10-23 David Turner <david@freetype.org>
|
||||
|
||||
* include/freetype/internal/ftmemory.h, src/base/ftdbgmem.c:
|
||||
improvements to the memory debugger to report more information in
|
||||
case of errors. Also, some allocations that occured through
|
||||
REALLOC couldn't be previously catched correctly..
|
||||
Improvements to the memory debugger to report more information in
|
||||
case of errors. Also, some allocations that occured through REALLOC
|
||||
couldn't be previously catched correctly.
|
||||
|
||||
* src/autohint/ahglyph.c (ah_outline_compute_segments,
|
||||
ah_outline_compute_edges), src/raster/ftraster.c (ft_black_new),
|
||||
src/smooth/ftgrays.c (gray_render_span, gray_raster_new): Replaced
|
||||
liberal uses of memset() by the MEM_Set() macro.
|
||||
|
||||
* src/autohint/ahglyph.c, src/raster/ftraster.c,
|
||||
src/smooth/ftgrays.c: replaced liberal uses of "memset" by the
|
||||
MEM_Set macro instead..
|
||||
2001-10-23 David Turner <david@freetype.org>
|
||||
|
||||
* src/raster/ftraster.c (Update): Removed to be inlined in ...
|
||||
(Sort): Updated.
|
||||
|
||||
2001-10-22 David Turner <david@freetype.org>
|
||||
|
||||
* builds/unix/ftsystem.c, builds/vms/ftsystem.c,
|
||||
builds/amiga/ftsystem.c, src/base/ftdbgmem.c: updated the memory
|
||||
debugger and platform-specific implementations of 'ftsystem' in order
|
||||
to be able to debug memory allocations on Unix, VMS and Amiga too !!
|
||||
* builds/unix/ftsystem.c (FT_New_Memory, FT_Done_Memory),
|
||||
builds/vms/ftsystem.c (FT_New_Memory, FT_Done_Memory),
|
||||
builds/amiga/ftsystem.c (FT_New_Memory, FT_Done_Memory),
|
||||
src/base/ftdbgmem.c: Updated the memory debugger and
|
||||
platform-specific implementations of `ftsystem' in order to be able
|
||||
to debug memory allocations on Unix, VMS and Amiga too!
|
||||
|
||||
* src/pshinter/pshalgo2.c (psh2_hint_table_record_mask): removed some
|
||||
bogus warnings..
|
||||
* src/pshinter/pshalgo2.c (psh2_hint_table_record_mask): Removed
|
||||
some bogus warnings.
|
||||
|
||||
* include/freetype/internal/ftmemory.h, src/base/ftdbgmem.c: modified
|
||||
the debugging memory manager to report the location (source file name
|
||||
+ line number) where leaked memory blocks are allocated in the source
|
||||
file.. funny, isn't it ??
|
||||
* include/freetype/internal/ftmemory.h, src/base/ftdbgmem.c:
|
||||
Modified the debugging memory manager to report the location (source
|
||||
file name + line number) where leaked memory blocks are allocated in
|
||||
the source file.
|
||||
|
||||
* src/base/ftdbgmem.c: new debugging memory manager. You must define
|
||||
the FT_DEBUG_MEMORY macro in "ftoption.h" to enable it. It will record
|
||||
every memory block allocated and report simple errors like memory
|
||||
leaks and double deletes.
|
||||
* src/base/ftdbgmem.c: New debugging memory manager. You must
|
||||
define the FT_DEBUG_MEMORY macro in "ftoption.h" to enable it. It
|
||||
will record every memory block allocated and report simple errors
|
||||
like memory leaks and double deletes.
|
||||
|
||||
* include/freetype/config/ftoption.h: added the FT_DEBUG_MEMORY macro
|
||||
definition
|
||||
* src/base/Jamfile: Include ftdbgmem.
|
||||
* src/base/rules.mk: Ditto.
|
||||
* src/base/ftbase.c: Include ftdbgmem.c.
|
||||
|
||||
* src/base/ftsystem.c (FT_New_Memory, FT_Done_Memory): modified the
|
||||
* include/freetype/config/ftoption.h: Added the FT_DEBUG_MEMORY
|
||||
macro definition.
|
||||
|
||||
* src/base/ftsystem.c (FT_New_Memory, FT_Done_Memory): Modified the
|
||||
base component to use the debugging memory manager when the macro
|
||||
FT_DEBUG_MEMORY is defined..
|
||||
FT_DEBUG_MEMORY is defined.
|
||||
|
||||
2001-10-21 Tom Kacvinsky <tkacvins@freetype.org>
|
||||
|
||||
|
@ -132,9 +189,8 @@
|
|||
2001-10-21 David Turner <david@freetype.org>
|
||||
|
||||
* src/pshinter/pshalgo2.c, src/pshinter/pshalgo1.c,
|
||||
src/pshinter/pshglob.c: removing compiler warnings in pedantic modes
|
||||
(in multi-object compilation mode, mainly)
|
||||
|
||||
src/pshinter/pshglob.c: Removing compiler warnings in pedantic modes
|
||||
(in multi-object compilation mode, mainly).
|
||||
|
||||
2001-10-20 Tom Kacvinsky <tkacvins@freetype.org>
|
||||
|
||||
|
@ -150,91 +206,90 @@
|
|||
objects were not deallocated when the objects were parsed the
|
||||
second time.
|
||||
|
||||
|
||||
2001-10-19 David Turner <david@freetype.org>
|
||||
|
||||
* src/smooth/ftgrays.c, src/pshinter/pshglob.h, src/pshinter/pshrec.c,
|
||||
src/pshinter/pshalgo2.c: getting rid of compiler warnings
|
||||
* src/smooth/ftgrays.c, src/pshinter/pshglob.h,
|
||||
src/pshinter/pshrec.c, src/pshinter/pshalgo2.c: Getting rid of
|
||||
compiler warnings.
|
||||
|
||||
* src/pshinter/module.mk, src/pshinter/rules.mk: adding control files
|
||||
to build the postscript hinter with the "old" build system
|
||||
* src/pshinter/module.mk, src/pshinter/rules.mk: Adding control
|
||||
files to build the PostScript hinter with the "old" build system.
|
||||
|
||||
2001-10-19 Jacob Jansen <joukj@hrem.stm.tudelft.nl>
|
||||
|
||||
* descrip.mms, src/pshinter/descrip.mms: updates to the VMS build
|
||||
* descrip.mms, src/pshinter/descrip.mms: Updates to the VMS build
|
||||
files.
|
||||
|
||||
2001-10-18 David Turner <david@freetype.org>
|
||||
|
||||
* src/psnames/pstables.h, src/tools/glnames.py: rewrote the "glnames.py"
|
||||
script used to generate the "pstables.h" header file. The old one
|
||||
contained a bug (yes !!) that made FreeType return incorrect glyph
|
||||
names for certain glyphs..
|
||||
* src/psnames/pstables.h, src/tools/glnames.py: Rewrote the
|
||||
"glnames.py" script used to generate the "pstables.h" header file.
|
||||
The old one contained a serious bug that made FreeType return
|
||||
incorrect glyph names for certain glyphs.
|
||||
|
||||
* src/truetype/ttdriver.c: changing computation of pixel size from
|
||||
character size to use rounding. This is an experiment to see if this
|
||||
gives values similar to Windows for scaled ascent/descent/etc..
|
||||
* src/truetype/ttdriver.c (Set_Char_Sizes): Changing computation of
|
||||
pixel size from character size to use rounding. This is an
|
||||
experiment to see whether this gives values similar to Windows for
|
||||
scaled ascent/descent/etc.
|
||||
|
||||
* src/base/ftcalc.c (FT_Div64by32): changed the implementation
|
||||
* src/base/ftcalc.c (FT_Div64by32): Changed the implementation
|
||||
slightly since the original code was mis-compiled on Mac machines
|
||||
using the MPW C compiler..
|
||||
using the MPW C compiler.
|
||||
|
||||
* src/base/ftobjs.c (FT_Realloc): when a memory block was grown
|
||||
through FT_Realloc, the new bytes were not set to 0, which created
|
||||
some strange bugs in the Postscript hinter
|
||||
* src/base/ftobjs.c (FT_Realloc): When a memory block was grown
|
||||
through FT_Realloc(), the new bytes were not set to 0, which created
|
||||
some strange bugs in the PostScript hinter.
|
||||
(destroy_face): Don't deallocate unconditionally.
|
||||
|
||||
* src/cid/cidgload.c: adding support to new postscript hinter
|
||||
* src/cid/cidgload.c (CID_Compute_Max_Advance, CID_Load_Glyph):
|
||||
Adding support to new PostScript hinter.
|
||||
|
||||
* include/freetype/internal/psglobal.h,
|
||||
include/freetype/internal/pshints.h,
|
||||
include/freetype/config/ftmodule.h,
|
||||
src/pshinter/Jamfile,
|
||||
src/pshinter/pshalgo.h,
|
||||
src/pshinter/pshalgo1.h,
|
||||
src/pshinter/pshalgo1.c,
|
||||
src/pshinter/pshalgo2.h,
|
||||
src/pshinter/pshalgo2.c,
|
||||
src/pshinter/pshglob.h,
|
||||
src/pshinter/pshglob.c,
|
||||
src/pshinter/pshinter.c,
|
||||
src/pshinter/pshmod.c,
|
||||
src/pshinter/pshmod.h,
|
||||
src/pshinter/pshrec.c,
|
||||
src/pshinter/pshrec.h : Adding new postscript hinter module
|
||||
include/freetype/config/ftmodule.h, src/pshinter/Jamfile,
|
||||
src/pshinter/pshalgo.h, src/pshinter/pshalgo1.h,
|
||||
src/pshinter/pshalgo1.c, src/pshinter/pshalgo2.h,
|
||||
src/pshinter/pshalgo2.c, src/pshinter/pshglob.h,
|
||||
src/pshinter/pshglob.c, src/pshinter/pshinter.c,
|
||||
src/pshinter/pshmod.c, src/pshinter/pshmod.h, src/pshinter/pshrec.c,
|
||||
src/pshinter/pshrec.h: Adding new PostScript hinter module.
|
||||
|
||||
* include/freetype/internal/ftobjs.h,
|
||||
include/freetype/internal/internal.h,
|
||||
include/freetype/internal/psaux.h,
|
||||
include/freetype/internal/t1types.h,
|
||||
src/psaux/psobjs.c,
|
||||
src/psaux/psobjs.h,
|
||||
src/psaux/t1decode.h,
|
||||
src/psaux/t1decode.c,
|
||||
src/type1/t1driver.c,
|
||||
src/type1/t1gload.c,
|
||||
src/type1/t1objs.c,
|
||||
src/type1/t1objs.h : updates to use the new postscript hinter
|
||||
include/freetype/internal/t1types.h, src/psaux/psobjs.c,
|
||||
src/psaux/psobjs.h, src/psaux/t1decode.h, src/psaux/t1decode.c,
|
||||
src/type1/t1driver.c, src/type1/t1gload.c, src/type1/t1objs.c,
|
||||
src/type1/t1objs.h: Updates to use the new PostScript hinter.
|
||||
|
||||
* tests/Jamfile, tests/gview.c: Adding a new glyph hinting
|
||||
viewer/debugger to the source tree. Note that you will _not_ be
|
||||
able to compile it since it depends on an unavailable graphics
|
||||
library named "Nirvana" to render vector images..
|
||||
|
||||
|
||||
library named "Nirvana" to render vector images.
|
||||
|
||||
2001-10-17 David Turner <david@freetype.org>
|
||||
|
||||
|
||||
* Version 2.0.5 released.
|
||||
=========================
|
||||
|
||||
|
||||
* include/freetype/freetype.h, include/internal/ftobjs.h,
|
||||
src/base/ftobjs.c, src/sfnt/sfdriver.c, type1/t1driver.c,
|
||||
cid/cidriver.c: Adding a new function named 'FT_Get_Postscript_Name' to
|
||||
retrieve the Postscript name of a given font. Should work with all
|
||||
formats except pure CFF/CEF fonts (this will be added soon).
|
||||
src/base/ftobjs.c, src/type1/t1driver.c: Adding a new function named
|
||||
'FT_Get_Postscript_Name' to retrieve the PostScript name of a given
|
||||
font. Should work with all formats except pure CFF/CEF fonts (this
|
||||
will be added soon).
|
||||
|
||||
* README, docs/CHANGES: updated for 2.0.5 release
|
||||
* src/cid/cidriver (cid_get_postscript_name): New function.
|
||||
(CID_Get_Interface): Handle `postscript_name' interface.
|
||||
|
||||
* src/sfnt/sfdriver.c (get_sfnt_postscript_name): New function.
|
||||
(SFNT_Get_Interface): Handle `postscript_name' interface.
|
||||
|
||||
* src/type1/t1driver.c (t1_get_ps_name): New function.
|
||||
(Get_Interface): Handle `postscript_name' interface.
|
||||
|
||||
* README, docs/CHANGES: Updated for 2.0.5 release.
|
||||
|
||||
2001-10-08 David Turner <david@freetype.org>
|
||||
|
||||
|
@ -1418,7 +1473,7 @@
|
|||
2001-01-01 Francesco Zappa Nardelli <francesco.zappa.nardelli@ens.fr>
|
||||
|
||||
* src/pcf/*: New driver module for PCF font format (used in
|
||||
X Windows).
|
||||
X Window System).
|
||||
* include/freetype/internal/ftdebug.h (FT_Trace): Added values for
|
||||
PCF driver.
|
||||
* include/freetype/internal/pcftypes.h: New file.
|
||||
|
@ -1665,9 +1720,11 @@
|
|||
|
||||
2000-12-01 David Turner <david.turner@freetype.org>
|
||||
|
||||
|
||||
* Version 2.0.1 released.
|
||||
=========================
|
||||
|
||||
|
||||
* builds/unix/configure.in, builds/unix/configure,
|
||||
builds/cygwin/configure.in, builds/cygwin/configure: Setting
|
||||
"version_info" to 6:1:0 for the 2.0.1 release.
|
||||
|
@ -1873,6 +1930,7 @@
|
|||
|
||||
2000-11-09 David Turner <david@freetype.org>
|
||||
|
||||
|
||||
* Version 2.0 released.
|
||||
=======================
|
||||
|
||||
|
|
1
Jamfile
1
Jamfile
|
@ -21,7 +21,6 @@ if $(DEBUG_HINTER)
|
|||
}
|
||||
|
||||
|
||||
|
||||
# We need "freetype2/include" in the current include path in order to
|
||||
# compile any part of FreeType 2.
|
||||
#
|
||||
|
|
|
@ -346,7 +346,6 @@ void FreeVecPooled(APTR poolHeader, APTR memory)
|
|||
}
|
||||
|
||||
|
||||
|
||||
#ifdef FT_DEBUG_MEMORY
|
||||
|
||||
extern FT_Int
|
||||
|
|
|
@ -7,4 +7,4 @@ The library will be built as a static lib in the obj/ folder.
|
|||
Current maintainer: Leonard Rosenthol, <leonardr@lazerware.com>
|
||||
Originally prepared by Just van Rossum, <just@letterror.com>
|
||||
|
||||
This directory is now actively maintained as part of the FreeType Project
|
||||
This directory is now actively maintained as part of the FreeType Project.
|
||||
|
|
75
docs/BUGS
75
docs/BUGS
|
@ -108,7 +108,6 @@ BAD-TT-RENDERING
|
|||
bytecode-hinted glyphs! Something seems to be really broken here!
|
||||
|
||||
|
||||
|
||||
BAD-THIN-LINES
|
||||
|
||||
It seems that the anti-aliased renderer in FreeType has problems rendering
|
||||
|
@ -116,7 +115,6 @@ BAD-THIN-LINES
|
|||
FT_Outline_Render() function.
|
||||
|
||||
|
||||
|
||||
NOT-WINDOWS-METRICS
|
||||
|
||||
FreeType doesn't always return the same metrics as Windows for ascender,
|
||||
|
@ -131,65 +129,58 @@ BAD-T1-CHARMAP
|
|||
charset. Those characters are mapped as MAC-one in glnames.py, so they
|
||||
cannot be shown in Adobe Type1 fonts.
|
||||
|
||||
(this was due to a bug in the "glnames.py" script used to generate the
|
||||
table of glyph names in 'src/psaux/pstables.h')
|
||||
(This was due to a bug in the "glnames.py" script used to generate the
|
||||
table of glyph names in 'src/psaux/pstables.h'.)
|
||||
|
||||
|
||||
BAD-UNIXXX-NAMES
|
||||
|
||||
Glyph names like uniXXXX are not recognized as they should be.
|
||||
It seems that code in psmodule.c for uniXXXX glyph names was
|
||||
never tested. The patch is very simple.
|
||||
Glyph names like uniXXXX are not recognized as they should be. It seems
|
||||
that code in psmodule.c for uniXXXX glyph names was never tested. The
|
||||
patch is very simple.
|
||||
|
||||
(a simple bug that was left un-noticed due to the fact that I don't have
|
||||
any Postscript font that use this convention, unfortunately..)
|
||||
(A simple bug that was left un-noticed due to the fact that I don't have
|
||||
any Postscript font that use this convention, unfortunately.)
|
||||
|
||||
|
||||
ADVANCED-COMPOSITES
|
||||
|
||||
Provided by George Williams <pfaedit@users.sourceforge.net>:
|
||||
|
||||
I notice that truetype/ttgload.c only supports Apple's
|
||||
definition of offsets for composit glyphs. Apple and
|
||||
Microsoft behave differently if there is a scale
|
||||
factor. OpenType defines some bits to disambiguate.
|
||||
I notice that truetype/ttgload.c only supports Apple's definition of
|
||||
offsets for composite glyphs. Apple and Microsoft behave differently if
|
||||
there is a scale factor. OpenType defines some bits to disambiguate.
|
||||
|
||||
(a problem in both 2.0.4 and 2.0.5)
|
||||
(A problem in both 2.0.4 and 2.0.5.)
|
||||
|
||||
Apple says
|
||||
(http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html)
|
||||
that if flags&ARGS_ARE_XY is set then the offsets
|
||||
should be scaled by the scale factors (as you have
|
||||
done), but they also say something very cryptic about
|
||||
what happens when the component is rotated at 45°
|
||||
(which you do not support)-- See the "Important" note
|
||||
at the bottom.
|
||||
Apple says (http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html) that if
|
||||
flags&ARGS_ARE_XY is set then the offsets should be scaled by the scale
|
||||
factors (as you have done), but they also say something very cryptic
|
||||
about what happens when the component is rotated at 45° (which you do
|
||||
not support) -- See the "Important" note at the bottom.
|
||||
|
||||
The old truetype spec from Microsoft did not mention this. The OpenType
|
||||
spec (http://www.microsoft.com/typography/otspec/glyf.htm,
|
||||
http://partners.adobe.com/asn/developer/opentype/glyf.html) defines two
|
||||
new bits to disambiguate:
|
||||
|
||||
The old truetype spec from Microsoft did not mention
|
||||
this. The OpenType spec
|
||||
(http://www.microsoft.com/typography/otspec/glyf.htm,
|
||||
http://partners.adobe.com/asn/developer/opentype/glyf.html)
|
||||
efines two new bits to disambiguate:
|
||||
SCALED_COMPONENT_OFFSET 11
|
||||
Composite designed to have the component offset scaled
|
||||
(designed for Apple rasterizer)
|
||||
UNSCALED_COMPONENT_OFFSET 12
|
||||
Composite designed not to have the component offset
|
||||
scaled (designed for the Microsoft TrueType rasterizer)
|
||||
Composite designed to have the component offset scaled (designed for
|
||||
Apple rasterizer)
|
||||
|
||||
Perhaps you could add a load_flag to allow the user to
|
||||
define the default setting?
|
||||
UNSCALED_COMPONENT_OFFSET 12
|
||||
Composite designed not to have the component offset scaled (designed
|
||||
for the Microsoft TrueType rasterizer)
|
||||
|
||||
Perhaps you could add a load_flag to allow the user to define the
|
||||
default setting?
|
||||
|
||||
David says:
|
||||
|
||||
Wow, I was not even aware of this, it will probably take a little
|
||||
time to implement since I don't have any font that implement these
|
||||
"features", and also because I believe that we're running out of
|
||||
bits for "load_flag", some other way to set preferences is probably
|
||||
needed..
|
||||
|
||||
|
||||
|
||||
Wow, I was not even aware of this, it will probably take a little time
|
||||
to implement since I don't have any font that implement these
|
||||
"features", and also because I believe that we're running out of bits
|
||||
for "load_flag", some other way to set preferences is probably needed.
|
||||
|
||||
|
||||
=== end of file ===
|
||||
|
|
14
docs/CHANGES
14
docs/CHANGES
|
@ -1,13 +1,13 @@
|
|||
LATEST CHANGES BETWEEN 2.0.6 and 2.0.5
|
||||
|
||||
- a new Postscript hinter module has been added to support native hints
|
||||
in the following formats: Postscript Type 1, Postscript CID and CFF/CEF
|
||||
- A new Postscript hinter module has been added to support native hints in
|
||||
the following formats: Postscript Type 1, Postscript CID and CFF/CEF.
|
||||
|
||||
(for now, only the Type 1 driver uses it, the "cid" and "cff" drivers
|
||||
will be updated shortly)
|
||||
(For now, only the Type 1 driver uses it; the "cid" and "cff" drivers
|
||||
will be updated shortly.)
|
||||
|
||||
- "glnames.py" still contained a bug !! that made FreeType return invalid
|
||||
names for certain glyphs..
|
||||
- "glnames.py" still contained a bug that made FreeType return invalid
|
||||
names for certain glyphs.
|
||||
|
||||
============================================================================
|
||||
|
||||
|
@ -44,7 +44,7 @@ LATEST CHANGES BETWEEN 2.0.5 and 2.0.4
|
|||
index of a given glyph name, when found in a face.
|
||||
|
||||
- Added a new function named "FT_Get_Postscript_Name" to retrieve the
|
||||
"unique" Postscript font name of a given face
|
||||
"unique" Postscript font name of a given face.
|
||||
|
||||
- Added a new public header size named FT_SIZES_H (or <freetype/ftsizes.h>)
|
||||
providing new FT_Size-management functions: FT_New_Size, FT_Activate_Size,
|
||||
|
|
|
@ -6,5 +6,6 @@ fits your needs best:
|
|||
|
||||
. The GNU General Public License, in file `docs/GPL.txt'.
|
||||
|
||||
The contributed PCF driver comes with a license similar to that of X Windows
|
||||
which is compatible to the above two licenses (see file src/pcf/readme).
|
||||
The contributed PCF driver comes with a license similar to that of X Window
|
||||
System which is compatible to the above two licenses (see file
|
||||
src/pcf/readme).
|
||||
|
|
|
@ -65,22 +65,22 @@ FT_BEGIN_HEADER
|
|||
|
||||
|
||||
/* each glyph set is caracterized by a "glyph set type" which must be */
|
||||
/* defined by sub-classes.. */
|
||||
/* defined by sub-classes */
|
||||
typedef struct FTC_GlyphSetRec_* FTC_GlyphSet;
|
||||
|
||||
/* handle to a glyph cache node */
|
||||
typedef struct FTC_GlyphNodeRec_* FTC_GlyphNode;
|
||||
|
||||
/* a glyph cache, its nodes are all glyph-specific */
|
||||
/* a glyph cache; its nodes are all glyph-specific */
|
||||
typedef struct FTC_GlyphCacheRec_* FTC_GlyphCache;
|
||||
|
||||
/* glyph sets class handle */
|
||||
typedef const struct FTC_GlyphSet_ClassRec_* FTC_GlyphSet_Class;
|
||||
|
||||
|
||||
/* size should be 24 bytes on 32-bit machines */
|
||||
/* note that the node's hash is ((gset->hash << 16) | glyph_index) */
|
||||
/* this _must_ be set properly by the glyph node initializer */
|
||||
/* Size should be 24 bytes on 32-bit machines. */
|
||||
/* Note that the node's hash is ((gset->hash << 16) | glyph_index); */
|
||||
/* this _must_ be set properly by the glyph node initializer. */
|
||||
/* */
|
||||
typedef struct FTC_GlyphNodeRec_
|
||||
{
|
||||
|
@ -93,20 +93,21 @@ FT_BEGIN_HEADER
|
|||
#define FTC_GLYPH_NODE_P( x ) ((FTC_GlyphNode*)( x ))
|
||||
|
||||
|
||||
/* the glyph set structure. each glyph set is used to model a set of */
|
||||
/* glyphs of the same "type". The type itself is defined in sub-classes */
|
||||
/* The glyph set structure. Each glyph set is used to model a set of */
|
||||
/* glyphs of the same "type". The type itself is defined in */
|
||||
/* sub-classes. */
|
||||
/* */
|
||||
/* for example, the "image cache" uses face_id + character_pixel_sizes + */
|
||||
/* image_format to characterize glyph sets.. */
|
||||
/* For example, the "image cache" uses face_id + character_pixel_sizes + */
|
||||
/* image_format to characterize glyph sets. */
|
||||
/* */
|
||||
/* a pure "master outlines" cache would only use face_id, etc.. */
|
||||
/* A pure "master outlines" cache would only use face_id, etc. */
|
||||
/* */
|
||||
typedef struct FTC_GlyphSetRec_
|
||||
{
|
||||
FT_LruNodeRec lru; /* glyph sets are LRU nodes within */
|
||||
FTC_GlyphCache gcache; /* parent cache.. */
|
||||
FT_UFast hash; /* must be set by initializer !! */
|
||||
FT_Fast num_glyphs; /* destroyed when 0.. */
|
||||
FTC_GlyphCache gcache; /* parent cache */
|
||||
FT_UFast hash; /* must be set by initializer! */
|
||||
FT_Fast num_glyphs; /* destroyed when 0 */
|
||||
|
||||
} FTC_GlyphSetRec;
|
||||
|
||||
|
@ -161,21 +162,21 @@ FT_BEGIN_HEADER
|
|||
ftc_glyph_node_done( FTC_GlyphNode node );
|
||||
|
||||
|
||||
/* can be used as a FTC_LruNode_InitFunc or called by sub-classes */
|
||||
/* can be used as an FTC_LruNode_InitFunc or called by sub-classes */
|
||||
FT_EXPORT( FT_Error )
|
||||
ftc_glyph_set_init( FTC_GlyphSet gset,
|
||||
FT_LruList list );
|
||||
|
||||
/* can be used as a FTC_LruNode_DoneFunc or called by sub-classes */
|
||||
/* can be used as an FTC_LruNode_DoneFunc or called by sub-classes */
|
||||
FT_EXPORT( void )
|
||||
ftc_glyph_set_done( FTC_GlyphSet gset );
|
||||
|
||||
|
||||
/* can be used as a FTC_Cache_DoneFunc or called by sub-classes */
|
||||
/* can be used as an FTC_Cache_DoneFunc or called by sub-classes */
|
||||
FT_EXPORT( void )
|
||||
ftc_glyph_cache_done( FTC_GlyphCache cache );
|
||||
|
||||
/* must be called in a FTC_Cache_InitFunc !! */
|
||||
/* must be called in an FTC_Cache_InitFunc! */
|
||||
FT_EXPORT( FT_Error )
|
||||
ftc_glyph_cache_init( FTC_GlyphCache cache,
|
||||
FT_LruList_Class gset_class );
|
||||
|
|
|
@ -95,6 +95,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
} FTC_Image_Desc;
|
||||
|
||||
|
||||
/* */
|
||||
#define FTC_IMAGE_DESC_COMPARE( d1, d2 ) \
|
||||
( FTC_FONT_COMPARE( &(d1)->font, &(d2)->font ) && \
|
||||
|
@ -104,6 +105,7 @@ FT_BEGIN_HEADER
|
|||
(FT_UFast)( FTC_FONT_HASH(&(d)->font) ^ \
|
||||
((d)->image_type << 4) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
|
|
|
@ -81,7 +81,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
#define FTC_MAX_FACES_DEFAULT 2
|
||||
#define FTC_MAX_SIZES_DEFAULT 4
|
||||
#define FTC_MAX_BYTES_DEFAULT 100000L /* 200kByte by default! */
|
||||
#define FTC_MAX_BYTES_DEFAULT 100000L /* 100kByte by default! */
|
||||
|
||||
/* maximum number of caches registered in a single manager */
|
||||
#define FTC_MAX_CACHES 16
|
||||
|
@ -113,7 +113,7 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
/* sizes_list :: The lru list of FT_Size objects in the cache. */
|
||||
/* */
|
||||
/* max_weight :: The maximum cache pool weight.. */
|
||||
/* max_weight :: The maximum cache pool weight. */
|
||||
/* */
|
||||
/* cur_weight :: The current cache pool weight. */
|
||||
/* */
|
||||
|
@ -200,10 +200,10 @@ FT_BEGIN_HEADER
|
|||
{
|
||||
FTC_Node mru_next; /* circular mru list pointer */
|
||||
FTC_Node mru_prev; /* circular mru list pointer */
|
||||
FTC_Node link; /* used for hashing.. */
|
||||
FT_UInt32 hash; /* used for hashing too.. */
|
||||
FTC_Node link; /* used for hashing */
|
||||
FT_UInt32 hash; /* used for hashing too */
|
||||
FT_UShort cache_index; /* index of cache the node belongs to */
|
||||
FT_Short ref_count; /* reference count for this node.. */
|
||||
FT_Short ref_count; /* reference count for this node */
|
||||
|
||||
} FTC_NodeRec;
|
||||
|
||||
|
@ -262,6 +262,7 @@ FT_BEGIN_HEADER
|
|||
(*FTC_Node_DoneFunc)( FTC_Node node,
|
||||
FTC_Cache cache );
|
||||
|
||||
|
||||
typedef struct FTC_Cache_ClassRec_
|
||||
{
|
||||
FT_UInt cache_size;
|
||||
|
@ -290,8 +291,8 @@ FT_BEGIN_HEADER
|
|||
FTC_Cache *acache );
|
||||
|
||||
|
||||
/* can be used directory as FTC_Cache_DoneFunc, or called by custom */
|
||||
/* cache finalizers.. */
|
||||
/* can be used directly as FTC_Cache_DoneFunc(), or called by custom */
|
||||
/* cache finalizers */
|
||||
FT_EXPORT( void )
|
||||
ftc_cache_done( FTC_Cache cache );
|
||||
|
||||
|
@ -300,7 +301,7 @@ FT_BEGIN_HEADER
|
|||
ftc_cache_init( FTC_Cache cache );
|
||||
|
||||
/* can be used when FTC_CACHE_RESIZE_TEST returns TRUE after a node */
|
||||
/* insertion.. */
|
||||
/* insertion */
|
||||
FT_EXPORT( void )
|
||||
ftc_cache_resize( FTC_Cache cache );
|
||||
|
||||
|
|
|
@ -75,9 +75,10 @@ FT_BEGIN_HEADER
|
|||
/* list class handle */
|
||||
typedef const struct FT_LruList_ClassRec_* FT_LruList_Class;
|
||||
|
||||
/* an list node handle */
|
||||
/* a list node handle */
|
||||
typedef struct FT_LruNodeRec_* FT_LruNode;
|
||||
|
||||
|
||||
/* the list node structure */
|
||||
typedef struct FT_LruNodeRec_
|
||||
{
|
||||
|
@ -118,7 +119,7 @@ FT_BEGIN_HEADER
|
|||
/* If defined, this method is called when the list if full */
|
||||
/* during the lookup process -- it is used to change the contents */
|
||||
/* of a list element node, instead of calling `done_element()', */
|
||||
/* then `init_element'. Set it to 0 for default behaviour. */
|
||||
/* then `init_element()'. Set it to 0 for default behaviour. */
|
||||
typedef FT_Error (*FT_LruNode_FlushFunc)( FT_LruNode node,
|
||||
FT_LruKey new_key,
|
||||
FT_LruList list );
|
||||
|
@ -131,9 +132,9 @@ FT_BEGIN_HEADER
|
|||
FT_LruList list );
|
||||
|
||||
/* A selector is used to indicate whether a given list element node */
|
||||
/* is part of a selection for FT_LruList_Remove_Selection(). The function */
|
||||
/* must return true (i.e., non-null) to indicate that the node is part */
|
||||
/* of it. */
|
||||
/* is part of a selection for FT_LruList_Remove_Selection(). The */
|
||||
/* functrion must return true (i.e., non-null) to indicate that the */
|
||||
/* node is part of it. */
|
||||
typedef FT_Bool (*FT_LruNode_SelectFunc)( FT_LruNode node,
|
||||
FT_Pointer data,
|
||||
FT_LruList list );
|
||||
|
@ -154,8 +155,8 @@ FT_BEGIN_HEADER
|
|||
} FT_LruList_ClassRec;
|
||||
|
||||
|
||||
/* the following functions must be exported in the case where applications */
|
||||
/* would want to write their own cache classes.. */
|
||||
/* The following functions must be exported in the case where */
|
||||
/* applications would want to write their own cache classes. */
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_LruList_New( FT_LruList_Class clazz,
|
||||
|
|
|
@ -30,28 +30,26 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
/* USER-SELECTABLE CONFIGURATION MACROS */
|
||||
/* */
|
||||
/* this file contains the default configuration macro definitions for */
|
||||
/* This file contains the default configuration macro definitions for */
|
||||
/* a standard build of the FreeType library. There are three ways to */
|
||||
/* use this file to build project-specific versions of the library: */
|
||||
/* */
|
||||
/* - you can modify this file by hand, but this is not recommended */
|
||||
/* in cases where you'd like to build several versions of the */
|
||||
/* library from a single source directory */
|
||||
/* - You can modify this file by hand, but this is not recommended in */
|
||||
/* cases where you would like to build several versions of the */
|
||||
/* library from a single source directory. */
|
||||
/* */
|
||||
/* */
|
||||
/* - you can put a copy of this file in your build directory, more */
|
||||
/* - You can put a copy of this file in your build directory, more */
|
||||
/* precisely in "$BUILD/freetype/config/ftoption.h", where "$BUILD" */
|
||||
/* is the name of a directory that is included _before_ the */
|
||||
/* FreeType include path during compilation. */
|
||||
/* is the name of a directory that is included _before_ the FreeType */
|
||||
/* include path during compilation. */
|
||||
/* */
|
||||
/* the default FreeType Makefiles and Jamfiles use the build */
|
||||
/* The default FreeType Makefiles and Jamfiles use the build */
|
||||
/* directory "builds/<system>" by default, but you can easily change */
|
||||
/* that for your own projects */
|
||||
/* that for your own projects. */
|
||||
/* */
|
||||
/* */
|
||||
/* - copy the file <ft2build.h> to "$BUILD/ft2build.h" and modify */
|
||||
/* it slightly to pre-define the macro FT_CONFIG_OPTIONS_H used */
|
||||
/* to locate this file during the build. For example: */
|
||||
/* - Copy the file <ft2build.h> to "$BUILD/ft2build.h" and modify it */
|
||||
/* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
|
||||
/* locate this file during the build. For example, */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
|
||||
/* #include <freetype/config/ftheader.h> */
|
||||
|
@ -59,12 +57,12 @@ FT_BEGIN_HEADER
|
|||
/* will use "$BUILD/myftoptions.h" instead of this file for macro */
|
||||
/* definitions. */
|
||||
/* */
|
||||
/* note also that you can similarly pre-define the macro */
|
||||
/* FT_CONFIG_MODULES_H used to locate the file listing the modules */
|
||||
/* that are statically linked to the library at compile time. */
|
||||
/* by default, this file is <freetype/config/ftmodule.h> */
|
||||
/* Note also that you can similarly pre-define the macro */
|
||||
/* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
|
||||
/* that are statically linked to the library at compile time. By */
|
||||
/* default, this file is <freetype/config/ftmodule.h>. */
|
||||
/* */
|
||||
/* we highly recommend using the third method whenever possible */
|
||||
/* We highly recommend using the third method whenever possible. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
@ -254,20 +252,22 @@ FT_BEGIN_HEADER
|
|||
#define FT_DEBUG_LEVEL_ERROR
|
||||
#define FT_DEBUG_LEVEL_TRACE
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Memory Debugging */
|
||||
/* */
|
||||
/* FreeType now comes with an integrated memory debugger that is */
|
||||
/* capable of detecting simple errors like memory leaks or double */
|
||||
/* deletes. To compile it within your build of the library, you should */
|
||||
/* define FT_DEBUG_MEMORY here. */
|
||||
/* deletes. To compile it within your build of the library, you */
|
||||
/* should define FT_DEBUG_MEMORY here. */
|
||||
/* */
|
||||
/* note that the memory debugger is only activated at runtime when */
|
||||
/* Note that the memory debugger is only activated at runtime when */
|
||||
/* when the _environment_ variable "FT_DEBUG_MEMORY" is also defined! */
|
||||
/* */
|
||||
#define FT_DEBUG_MEMORY
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Computation Algorithms */
|
||||
|
|
|
@ -145,6 +145,7 @@ FT_BEGIN_HEADER
|
|||
/* FT_Get_Kerning */
|
||||
/* FT_Kerning_Mode */
|
||||
/* FT_Get_Glyph_Name */
|
||||
/* FT_Get_Postscript_Name */
|
||||
/* */
|
||||
/* FT_CharMapRec */
|
||||
/* FT_Select_Charmap */
|
||||
|
@ -2292,15 +2293,14 @@ FT_BEGIN_HEADER
|
|||
/* FT_Get_Postscript_Name */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Retrieves the ASCII Postscript name of a given face, when */
|
||||
/* available. This should only work with Postscript and TrueType */
|
||||
/* fonts.. */
|
||||
/* Retrieves the ASCII Postscript name of a given face, if available. */
|
||||
/* This should only work with Postscript and TrueType fonts. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: handle to source face object. */
|
||||
/* face :: A handle to the source face object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* pointer to face's Postscript name. NULL when un-available */
|
||||
/* A pointer to the face's Postscript name. NULL if un-available. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The returned pointer is owned by the face and will be destroyed */
|
||||
|
|
|
@ -142,6 +142,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
} FTC_FontRec;
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
#define FTC_FONT_COMPARE( f1, f2 ) \
|
||||
|
@ -156,6 +157,7 @@ FT_BEGIN_HEADER
|
|||
((f)->pix_width << 8) ^ \
|
||||
((f)->pix_height) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
|
|
|
@ -108,6 +108,7 @@ FT_BEGIN_HEADER
|
|||
FT_Long size,
|
||||
void* *P );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
|
@ -171,7 +172,6 @@ FT_BEGIN_HEADER
|
|||
void** P );
|
||||
|
||||
|
||||
|
||||
/* This `#include' is needed by the MEM_xxx() macros; it should be */
|
||||
/* available on all platforms we know of. */
|
||||
#include <string.h>
|
||||
|
@ -183,7 +183,6 @@ FT_BEGIN_HEADER
|
|||
#define MEM_Move( dest, source, count ) memmove( dest, source, count )
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* We now support closures to produce completely reentrant code. This */
|
||||
|
@ -201,18 +200,21 @@ FT_BEGIN_HEADER
|
|||
#ifdef FT_DEBUG_MEMORY
|
||||
|
||||
#define MEM_Alloc( _pointer_, _size_ ) \
|
||||
FT_Alloc_Debug( memory, _size_, (void**)&(_pointer_), __FILE__, __LINE__ )
|
||||
FT_Alloc_Debug( memory, _size_, \
|
||||
(void**)&(_pointer_), __FILE__, __LINE__ )
|
||||
|
||||
#define MEM_Alloc_Array( _pointer_, _count_, _type_ ) \
|
||||
FT_Alloc_Debug( memory, (_count_)*sizeof ( _type_ ), \
|
||||
(void**)&(_pointer_), __FILE__, __LINE__ )
|
||||
|
||||
#define MEM_Realloc( _pointer_, _current_, _size_ ) \
|
||||
FT_Realloc_Debug( memory, _current_, _size_, (void**)&(_pointer_), __FILE__, __LINE__ )
|
||||
FT_Realloc_Debug( memory, _current_, _size_, \
|
||||
(void**)&(_pointer_), __FILE__, __LINE__ )
|
||||
|
||||
#define MEM_Realloc_Array( _pointer_, _current_, _new_, _type_ ) \
|
||||
FT_Realloc_Debug( memory, (_current_)*sizeof ( _type_ ), \
|
||||
(_new_)*sizeof ( _type_ ), (void**)&(_pointer_), __FILE__, __LINE__ )
|
||||
(_new_)*sizeof ( _type_ ), \
|
||||
(void**)&(_pointer_), __FILE__, __LINE__ )
|
||||
|
||||
#define MEM_Free( _pointer_ ) \
|
||||
FT_Free_Debug( memory, (void**)&(_pointer_), __FILE__, __LINE__ )
|
||||
|
|
|
@ -171,7 +171,7 @@ FT_BEGIN_HEADER
|
|||
/* glyph_delta :: The 2d translation vector corresponding to */
|
||||
/* the glyph transformation, if necessary. */
|
||||
/* */
|
||||
/* glyph_hints :: format-specific glyph hints management */
|
||||
/* glyph_hints :: Format-specific glyph hints management. */
|
||||
/* */
|
||||
typedef struct FT_Slot_InternalRec_
|
||||
{
|
||||
|
|
|
@ -426,7 +426,8 @@ FT_BEGIN_HEADER
|
|||
|
||||
typedef struct T1_Builder_Funcs_
|
||||
{
|
||||
void (*init)( T1_Builder* builder,
|
||||
void
|
||||
(*init)( T1_Builder* builder,
|
||||
FT_Face face,
|
||||
FT_Size size,
|
||||
FT_GlyphSlot slot,
|
||||
|
@ -586,7 +587,8 @@ FT_BEGIN_HEADER
|
|||
|
||||
struct T1_Decoder_Funcs_
|
||||
{
|
||||
FT_Error (*init) ( T1_Decoder* decoder,
|
||||
FT_Error
|
||||
(*init) ( T1_Decoder* decoder,
|
||||
FT_Face face,
|
||||
FT_Size size,
|
||||
FT_GlyphSlot slot,
|
||||
|
@ -595,9 +597,11 @@ FT_BEGIN_HEADER
|
|||
FT_Bool hinting,
|
||||
T1_Decoder_Callback callback );
|
||||
|
||||
void (*done) ( T1_Decoder* decoder );
|
||||
void
|
||||
(*done) ( T1_Decoder* decoder );
|
||||
|
||||
FT_Error (*parse_charstrings)( T1_Decoder* decoder,
|
||||
FT_Error
|
||||
(*parse_charstrings)( T1_Decoder* decoder,
|
||||
FT_Byte* base,
|
||||
FT_UInt len );
|
||||
};
|
||||
|
|
|
@ -1,5 +1,27 @@
|
|||
#ifndef __PSGLOBALS_H__
|
||||
#define __PSGLOBALS_H__
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* psglobal.h */
|
||||
/* */
|
||||
/* Global PostScript hinting structures (specification only). */
|
||||
/* */
|
||||
/* Copyright 2001 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 __PSGLOBAL_H__
|
||||
#define __PSGLOBAL_H__
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
|
@ -10,61 +32,73 @@
|
|||
/**********************************************************************/
|
||||
|
||||
#if 0
|
||||
/****************************************************************
|
||||
*
|
||||
* @constant: PS_GLOBALS_MAX_BLUE_ZONES
|
||||
*
|
||||
* @description:
|
||||
* the maximum number of blue zones in a font global hints
|
||||
* structure. See @PS_Globals_BluesRec
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @constant: */
|
||||
/* PS_GLOBALS_MAX_BLUE_ZONES */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The maximum number of blue zones in a font global hints structure. */
|
||||
/* See @PS_Globals_BluesRec. */
|
||||
/* */
|
||||
#define PS_GLOBALS_MAX_BLUE_ZONES 16
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @constant: PS_GLOBALS_MAX_STD_WIDTHS
|
||||
*
|
||||
* @description:
|
||||
* the maximum number of standard and snap widths in either the
|
||||
* horizontal or vertical direction. See @PS_Globals_WidthsRec
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @constant: */
|
||||
/* PS_GLOBALS_MAX_STD_WIDTHS */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The maximum number of standard and snap widths in either the */
|
||||
/* horizontal or vertical direction. See @PS_Globals_WidthsRec. */
|
||||
/* */
|
||||
#define PS_GLOBALS_MAX_STD_WIDTHS 16
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @type: PS_Globals
|
||||
*
|
||||
* @description:
|
||||
* a handle to a @PS_GlobalsRec structure used to
|
||||
* describe the global hints of a given font
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* PS_Globals */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A handle to a @PS_GlobalsRec structure used to describe the global */
|
||||
/* hints of a given font. */
|
||||
/* */
|
||||
typedef struct PS_GlobalsRec_* PS_Globals;
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @struct: PS_Globals_BluesRec
|
||||
*
|
||||
* @description:
|
||||
* a structure used to model the global blue zones of a given
|
||||
* font
|
||||
*
|
||||
* @fields:
|
||||
* count :: number of blue zones
|
||||
* zones :: an array of (count*2) coordinates describing the zones
|
||||
*
|
||||
* count_family :: number of family blue zones
|
||||
* zones_family :: an array of (count_family*2) coordinates describing
|
||||
* the family blue zones
|
||||
*
|
||||
* scale :: the blue scale to be used (fixed float)
|
||||
* shift :: the blue shift to be used
|
||||
* fuzz :: the blue fuzz to be used
|
||||
*
|
||||
* @note:
|
||||
* each blue zone is modeled by a (reference,overshoot) coordinate pair
|
||||
* in the table. zones can be placed in any order..
|
||||
*/
|
||||
typedef struct PS_Globals_BluesRec
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* PS_Globals_BluesRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A structure used to model the global blue zones of a given font. */
|
||||
/* */
|
||||
/* @fields: */
|
||||
/* count :: The number of blue zones. */
|
||||
/* */
|
||||
/* zones :: An array of (count*2) coordinates describing the */
|
||||
/* zones. */
|
||||
/* */
|
||||
/* count_family :: The number of family blue zones. */
|
||||
/* */
|
||||
/* zones_family :: An array of (count_family*2) coordinates describing */
|
||||
/* the family blue zones. */
|
||||
/* */
|
||||
/* scale :: The blue scale to be used (fixed float). */
|
||||
/* */
|
||||
/* shift :: The blue shift to be used. */
|
||||
/* */
|
||||
/* fuzz :: Te blue fuzz to be used. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* Each blue zone is modeled by a (reference,overshoot) coordinate */
|
||||
/* pair in the table. Zones can be placed in any order. */
|
||||
/* */
|
||||
typedef struct PS_Globals_BluesRec_
|
||||
{
|
||||
FT_UInt count;
|
||||
FT_Int16 zones[2 * PS_GLOBALS_MAX_BLUE_ZONES];
|
||||
|
@ -79,33 +113,36 @@
|
|||
} PS_Globals_BluesRec, *PS_Globals_Blues;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @type: PS_Global_Widths;
|
||||
*
|
||||
* @description:
|
||||
* a handle to a @PS_Globals_WidthsRec structure used to model
|
||||
* the global standard and snap widths in a given direction
|
||||
*/
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* PS_Global_Widths */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A handle to a @PS_Globals_WidthsRec structure used to model the */
|
||||
/* global standard and snap widths in a given direction. */
|
||||
/* */
|
||||
typedef struct PS_Globals_WidthsRec_* PS_Globals_Widths;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @struct: PS_Globals_WidthsRec
|
||||
*
|
||||
* @description:
|
||||
* a structure used to model the global standard and snap widths
|
||||
* in a given font
|
||||
*
|
||||
* @fields:
|
||||
* count :: number of widths
|
||||
* widths :: an array of 'count' widths in font units.
|
||||
*
|
||||
* @note:
|
||||
* 'widths[0]' must be the standard width or height, while
|
||||
* remaining elements of the array are snap widths or heights
|
||||
*/
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* PS_Globals_WidthsRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A structure used to model the global standard and snap widths in a */
|
||||
/* given font. */
|
||||
/* */
|
||||
/* @fields: */
|
||||
/* count :: The number of widths. */
|
||||
/* */
|
||||
/* widths :: An array of `count' widths in font units. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* `widths[0]' must be the standard width or height, while remaining */
|
||||
/* elements of the array are snap widths or heights. */
|
||||
/* */
|
||||
typedef struct PS_Globals_WidthsRec_
|
||||
{
|
||||
FT_UInt count;
|
||||
|
@ -114,18 +151,21 @@
|
|||
} PS_Globals_WidthsRec;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @struct: PS_Globals_GlobalsRec
|
||||
*
|
||||
* @description:
|
||||
* a structure used to model the global hints for a given font
|
||||
*
|
||||
* @fields:
|
||||
* horizontal :: horizontal widths
|
||||
* vertical :: vertical heights
|
||||
* blues :: blue zones
|
||||
*/
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* PS_GlobalsRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A structure used to model the global hints for a given font. */
|
||||
/* */
|
||||
/* @fields: */
|
||||
/* horizontal :: The horizontal widths. */
|
||||
/* */
|
||||
/* vertical :: The vertical heights. */
|
||||
/* */
|
||||
/* blues :: The blue zones. */
|
||||
/* */
|
||||
typedef struct PS_GlobalsRec_
|
||||
{
|
||||
PS_Globals_WidthsRec horizontal;
|
||||
|
@ -134,8 +174,13 @@
|
|||
|
||||
} PS_GlobalsRec;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
#endif /* __PS_GLOBALS_H__ */
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __PS_GLOBAL_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
/* pshints.h */
|
||||
/* */
|
||||
/* Interface to Postscript-specific (Type 1 and Type 2) hints */
|
||||
/* recorders. These are used to support native T1/T2 hints */
|
||||
/* in the "type1", "cid" and "cff" font drivers */
|
||||
/* recorders (specification only). These are used to support native */
|
||||
/* T1/T2 hints in the "type1", "cid" and "cff" font drivers. */
|
||||
/* */
|
||||
/* Copyright 2001 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
|
@ -17,39 +17,47 @@
|
|||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __PSHINTS_H__
|
||||
#define __PSHINTS_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_TYPE1_TABLES_H
|
||||
#include FT_INTERNAL_POSTSCRIPT_GLOBALS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** INTERNAL REPRESENTATION OF GLOBALS *****/
|
||||
/***** *****/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct PSH_GlobalsRec_* PSH_Globals;
|
||||
|
||||
typedef FT_Error (*PSH_Globals_NewFunc)( FT_Memory memory,
|
||||
typedef FT_Error
|
||||
(*PSH_Globals_NewFunc)( FT_Memory memory,
|
||||
T1_Private* private_dict,
|
||||
PSH_Globals* aglobals );
|
||||
|
||||
typedef FT_Error (*PSH_Globals_SetScaleFunc)( PSH_Globals globals,
|
||||
typedef FT_Error
|
||||
(*PSH_Globals_SetScaleFunc)( PSH_Globals globals,
|
||||
FT_Fixed x_scale,
|
||||
FT_Fixed y_scale,
|
||||
FT_Fixed x_delta,
|
||||
FT_Fixed y_delta );
|
||||
|
||||
typedef void (*PSH_Globals_DestroyFunc)( PSH_Globals globals );
|
||||
typedef void
|
||||
(*PSH_Globals_DestroyFunc)( PSH_Globals globals );
|
||||
|
||||
typedef struct
|
||||
|
||||
typedef struct PSH_Globals_FuncsRec_
|
||||
{
|
||||
PSH_Globals_NewFunc create;
|
||||
PSH_Globals_SetScaleFunc set_scale;
|
||||
|
@ -57,211 +65,248 @@ FT_BEGIN_HEADER
|
|||
|
||||
} PSH_Globals_FuncsRec, *PSH_Globals_Funcs;
|
||||
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** PUBLIC TYPE 1 HINTS RECORDER *****/
|
||||
/***** *****/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @type: T1_Hints
|
||||
*
|
||||
* @description:
|
||||
* this is a handle to an opaque structure used to record glyph
|
||||
* hints from a Type 1 character glyph character string.
|
||||
*
|
||||
* the methods used to operate on this object are defined by the
|
||||
* @T1_Hints_FuncsRec structure. Recording glyph hints is normally
|
||||
* achieved through the following scheme:
|
||||
*
|
||||
* - open a new hint recording session by calling the "open"
|
||||
* method. This will rewind the recorder and prepare it for
|
||||
* new input
|
||||
*
|
||||
* - for each hint found in the glyph charstring, call the
|
||||
* corresponding method ("stem", "stem3" or "reset").
|
||||
* note that these functions do not return an error code
|
||||
*
|
||||
* - close the recording session by calling the "close" method
|
||||
* it will return an error code if the hints were invalid or
|
||||
* something strange happened (e.g. memory shortage)
|
||||
*
|
||||
* the hints accumulated in the object can later be used by the
|
||||
* Postscript hinter
|
||||
*/
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* T1_Hints */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* This is a handle to an opaque structure used to record glyph hints */
|
||||
/* from a Type 1 character glyph character string. */
|
||||
/* */
|
||||
/* The methods used to operate on this object are defined by the */
|
||||
/* @T1_Hints_FuncsRec structure. Recording glyph hints is normally */
|
||||
/* achieved through the following scheme: */
|
||||
/* */
|
||||
/* - Open a new hint recording session by calling the "open" method. */
|
||||
/* This will rewind the recorder and prepare it for new input. */
|
||||
/* */
|
||||
/* - For each hint found in the glyph charstring, call the */
|
||||
/* corresponding method ("stem", "stem3", or "reset"). Note that */
|
||||
/* these functions do not return an error code. */
|
||||
/* */
|
||||
/* - Close the recording session by calling the "close" method. It */
|
||||
/* will return an error code if the hints were invalid or something */
|
||||
/* strange happened (e.g. memory shortage). */
|
||||
/* */
|
||||
/* The hints accumulated in the object can later be used by the */
|
||||
/* Postscript hinter. */
|
||||
/* */
|
||||
typedef struct T1_HintsRec_* T1_Hints;
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @type: T1_Hints_Funcs
|
||||
*
|
||||
* @description:
|
||||
* a pointer to the @T1_Hints_FuncsRec structure that defines the
|
||||
* API of a given @T1_Hints object
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* T1_Hints_Funcs */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A pointer to the @T1_Hints_FuncsRec structure that defines the */
|
||||
/* API of a given @T1_Hints object. */
|
||||
/* */
|
||||
typedef const struct T1_Hints_FuncsRec_* T1_Hints_Funcs;
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @functype: T1_Hints_OpenFunc
|
||||
*
|
||||
* @description:
|
||||
* a method of the @T1_Hints class used to prepare it for a new
|
||||
* Type 1 hints recording session
|
||||
*
|
||||
* @input:
|
||||
* hints :: handle to Type 1 hints recorder
|
||||
*
|
||||
* @note:
|
||||
* You should always call the @T1_Hints_CloseFunc method in order
|
||||
* to close an opened recording session
|
||||
*/
|
||||
typedef void (*T1_Hints_OpenFunc) ( T1_Hints hints );
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_OpenFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to prepare it for a new */
|
||||
/* Type 1 hints recording session. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* You should always call the @T1_Hints_CloseFunc method in order to */
|
||||
/* close an opened recording session. */
|
||||
/* */
|
||||
typedef void
|
||||
(*T1_Hints_OpenFunc)( T1_Hints hints );
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @functype: T1_Hints_SetStemFunc
|
||||
*
|
||||
* @description:
|
||||
* a method of the @T1_Hints class used to record a new horizontal or
|
||||
* vertical stem. This corresponds to the Type 1 "hstem" and "vstem"
|
||||
* operators
|
||||
*
|
||||
* @input:
|
||||
* hints :: handle to Type 1 hints recorder
|
||||
* dimension :: 0 for horizontal stems (hstem), 1 for vertical ones (vstem)
|
||||
* coords :: array of 2 integers, used as (position,length) stem descriptor
|
||||
*
|
||||
* @note:
|
||||
* use vertical coordinates (y) for horizontal stems (dim=0)
|
||||
* use horizontal coordinates (x) for vertical stems (dim=1)
|
||||
*
|
||||
* "coords[0]" is the absolute stem position (lowest coordinate)
|
||||
* "coords[1]" is the length.
|
||||
*
|
||||
* the length can be negative, in which case it must be either
|
||||
* -20 or -21 in order and will be interpreted as a "ghost" stem,
|
||||
* according to the Type 1 specification.
|
||||
*
|
||||
* if the length is -21 (corresponding to a bottom ghost stem), then
|
||||
* the real stem position is "coords[0]+coords[1]"
|
||||
*/
|
||||
typedef void (*T1_Hints_SetStemFunc) ( T1_Hints hints,
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_SetStemFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to record a new horizontal or */
|
||||
/* vertical stem. This corresponds to the Type 1 "hstem" and "vstem" */
|
||||
/* operators. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* dimension :: 0 for horizontal stems (hstem), 1 for vertical ones */
|
||||
/* (vstem). */
|
||||
/* */
|
||||
/* coords :: Array of 2 integers, used as (position,length) stem */
|
||||
/* descriptor. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* Use vertical coordinates (y) for horizontal stems (dim=0). Use */
|
||||
/* horizontal coordinates (x) for vertical stems (dim=1). */
|
||||
/* */
|
||||
/* "coords[0]" is the absolute stem position (lowest coordinate); */
|
||||
/* "coords[1]" is the length. */
|
||||
/* */
|
||||
/* The length can be negative, in which case it must be either -20 or */
|
||||
/* -21. It will be interpreted as a "ghost" stem, according to */
|
||||
/* Type 1 specification. */
|
||||
/* */
|
||||
/* If the length is -21 (corresponding to a bottom ghost stem), then */
|
||||
/* the real stem position is "coords[0]+coords[1]". */
|
||||
/* */
|
||||
typedef void
|
||||
(*T1_Hints_SetStemFunc)( T1_Hints hints,
|
||||
FT_UInt dimension,
|
||||
FT_Long* coords );
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @functype: T1_Hints_SetStem3Func
|
||||
*
|
||||
* @description:
|
||||
* a method of the @T1_Hints class used to record three counter-controlled
|
||||
* horizontal or vertical stems at once
|
||||
*
|
||||
* @input:
|
||||
* hints :: handle to Type 1 hints recorder
|
||||
* dimension :: 0 for horizontal stems, 1 for vertical ones
|
||||
* coords :: array of 6 integers, i.e. 3 (position,length) pairs
|
||||
* for the counter-controlled stems
|
||||
*
|
||||
* @note:
|
||||
* use vertical coordinates (y) for horizontal stems (dim=0)
|
||||
* use horizontal coordinates (x) for vertical stems (dim=1)
|
||||
*
|
||||
* the lengths cannot be negative (ghost stems are never counter-controlled)
|
||||
*/
|
||||
typedef void (*T1_Hints_SetStem3Func) ( T1_Hints hints,
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_SetStem3Func */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to record three */
|
||||
/* counter-controlled horizontal or vertical stems at once. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* dimension :: 0 for horizontal stems, 1 for vertical ones. */
|
||||
/* */
|
||||
/* coords :: An array of 6 integers, holding 3 (position,length) */
|
||||
/* pairs for the counter-controlled stems. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* Use vertical coordinates (y) for horizontal stems (dim=0). Use */
|
||||
/* horizontal coordinates (x) for vertical stems (dim=1). */
|
||||
/* */
|
||||
/* The lengths cannot be negative (ghost stems are never */
|
||||
/* counter-controlled). */
|
||||
/* */
|
||||
typedef void
|
||||
(*T1_Hints_SetStem3Func)( T1_Hints hints,
|
||||
FT_UInt dimension,
|
||||
FT_Long* coords );
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @functype: T1_Hints_ResetFunc
|
||||
*
|
||||
* @description:
|
||||
* a method of the @T1_Hints class used to reset the stems hints
|
||||
* in a recording session. This is equivalent to the Type 1 ...
|
||||
*
|
||||
* @input:
|
||||
* hints :: handle to Type 1 hints recorder
|
||||
* end_point :: index of last point in the input glyph in which
|
||||
* the previously defined hints apply
|
||||
*/
|
||||
typedef void (*T1_Hints_ResetFunc)( T1_Hints hints,
|
||||
FT_UInt end_point );
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @functype: T1_Hints_CloseFunc
|
||||
*
|
||||
* @description:
|
||||
* a method of the @T1_Hints class used to close a hint recording
|
||||
* session.
|
||||
*
|
||||
* @input:
|
||||
* hints :: handle to Type 1 hints recorder
|
||||
* end_point :: index of last point in the input glyph
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
*
|
||||
* @note:
|
||||
* the error code will be set to indicate that an error occured
|
||||
* during the recording session
|
||||
*/
|
||||
typedef FT_Error (*T1_Hints_CloseFunc)( T1_Hints hints,
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_ResetFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to reset the stems hints in a */
|
||||
/* recording session. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* end_point :: The index of the last point in the input glyph in */
|
||||
/* which the previously defined hints apply. */
|
||||
/* */
|
||||
typedef void
|
||||
(*T1_Hints_ResetFunc)( T1_Hints hints,
|
||||
FT_UInt end_point );
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @functype: T1_Hints_ApplyFunc
|
||||
*
|
||||
* @description:
|
||||
* a method of the @T1_Hints class used to apply hints to the
|
||||
* corresponding glyph outline. Must be called once all hints
|
||||
* have been recorded.
|
||||
*
|
||||
* @input:
|
||||
* hints :: handle to Type 1 hints recorder
|
||||
* outline :: pointer to target outline descriptor
|
||||
* globals :: the hinter globals for this font
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
*
|
||||
* @note:
|
||||
* on input, all points within the outline are in font coordinates.
|
||||
* on output, they're in 1/64th of pixels.
|
||||
*
|
||||
* the scaling transform is taken from the "globals" object, which
|
||||
* must correspond to the same font than the glyph
|
||||
*/
|
||||
typedef FT_Error (*T1_Hints_ApplyFunc)( T1_Hints hints,
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_CloseFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to close a hint recording */
|
||||
/* session. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* end_point :: The index of the last point in the input glyph. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* The error code will be set to indicate that an error occured */
|
||||
/* during the recording session. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*T1_Hints_CloseFunc)( T1_Hints hints,
|
||||
FT_UInt end_point );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_ApplyFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to apply hints to the */
|
||||
/* corresponding glyph outline. Must be called once all hints have */
|
||||
/* been recorded. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* outline :: A pointer to the target outline descriptor. */
|
||||
/* */
|
||||
/* globals :: The hinter globals for this font. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* On input, all points within the outline are in font coordinates. */
|
||||
/* On output, they are in 1/64th of pixels. */
|
||||
/* */
|
||||
/* The scaling transformation is taken from the "globals" object */
|
||||
/* which must correspond to the same font as the glyph. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*T1_Hints_ApplyFunc)( T1_Hints hints,
|
||||
FT_Outline* outline,
|
||||
PSH_Globals globals );
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @struct: T1_Hints_FuncsRec
|
||||
*
|
||||
* @description:
|
||||
* the structure used to provide the API to @T1_Hints objects
|
||||
*
|
||||
* @fields:
|
||||
* hints :: handle to T1 Hints recorder
|
||||
* open :: open recording session
|
||||
* close :: close recording session
|
||||
* stem :: set simple stem
|
||||
* stem3 :: set counter-controlled stems
|
||||
* reset :: reset stem hints
|
||||
* apply :: apply the hints to the corresponding glyph outline
|
||||
*/
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* T1_Hints_FuncsRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The structure used to provide the API to @T1_Hints objects. */
|
||||
/* */
|
||||
/* @fields: */
|
||||
/* hints :: A handle to the T1 Hints recorder. */
|
||||
/* */
|
||||
/* open :: The function to open a recording session. */
|
||||
/* */
|
||||
/* close :: The function to close a recording session. */
|
||||
/* */
|
||||
/* stem :: The function to set a simple stem. */
|
||||
/* */
|
||||
/* stem3 :: The function to set counter-controlled stems. */
|
||||
/* */
|
||||
/* reset :: The function to reset stem hints. */
|
||||
/* */
|
||||
/* apply :: The function to apply the hints to the corresponding */
|
||||
/* glyph outline. */
|
||||
/* */
|
||||
typedef struct T1_Hints_FuncsRec_
|
||||
{
|
||||
T1_Hints hints;
|
||||
|
@ -275,232 +320,271 @@ FT_BEGIN_HEADER
|
|||
} T1_Hints_FuncsRec;
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** PUBLIC TYPE 2 HINTS RECORDER *****/
|
||||
/***** *****/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @type: T2_Hints
|
||||
*
|
||||
* @description:
|
||||
* this is a handle to an opaque structure used to record glyph
|
||||
* hints from a Type 2 character glyph character string.
|
||||
*
|
||||
* the methods used to operate on this object are defined by the
|
||||
* @T2_Hints_FuncsRec structure. Recording glyph hints is normally
|
||||
* achieved through the following scheme:
|
||||
*
|
||||
* - open a new hint recording session by calling the "open"
|
||||
* method. This will rewind the recorder and prepare it for
|
||||
* new input
|
||||
*
|
||||
* - for each hint found in the glyph charstring, call the
|
||||
* corresponding method ("stems", "hintmask", "counters").
|
||||
* note that these functions do not return an error code
|
||||
*
|
||||
* - close the recording session by calling the "close" method
|
||||
* it will return an error code if the hints were invalid or
|
||||
* something strange happened (e.g. memory shortage)
|
||||
*
|
||||
* the hints accumulated in the object can later be used by the
|
||||
* Postscript hinter
|
||||
*/
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* T2_Hints */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* This is a handle to an opaque structure used to record glyph hints */
|
||||
/* from a Type 2 character glyph character string. */
|
||||
/* */
|
||||
/* The methods used to operate on this object are defined by the */
|
||||
/* @T2_Hints_FuncsRec structure. Recording glyph hints is normally */
|
||||
/* achieved through the following scheme: */
|
||||
/* */
|
||||
/* - Open a new hint recording session by calling the "open" method. */
|
||||
/* This will rewind the recorder and prepare it for new input. */
|
||||
/* */
|
||||
/* - For each hint found in the glyph charstring, call the */
|
||||
/* corresponding method ("stems", "hintmask", "counters"). Note */
|
||||
/* that these functions do not return an error code. */
|
||||
/* */
|
||||
/* - Close the recording session by calling the "close" method. It */
|
||||
/* will return an error code if the hints were invalid or something */
|
||||
/* strange happened (e.g. memory shortage). */
|
||||
/* */
|
||||
/* The hints accumulated in the object can later be used by the */
|
||||
/* Postscript hinter. */
|
||||
/* */
|
||||
typedef struct T2_HintsRec_* T2_Hints;
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @type: T2_Hints_Funcs
|
||||
*
|
||||
* @description:
|
||||
* a pointer to the @T1_Hints_FuncsRec structure that defines the
|
||||
* API of a given @T2_Hints object
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* T2_Hints_Funcs */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A pointer to the @T2_Hints_FuncsRec structure that defines the API */
|
||||
/* of a given @T2_Hints object. */
|
||||
/* */
|
||||
typedef const struct T2_Hints_FuncsRec_* T2_Hints_Funcs;
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @functype: T2_Hints_OpenFunc
|
||||
*
|
||||
* @description:
|
||||
* a method of the @T2_Hints class used to prepare it for a new
|
||||
* Type 2 hints recording session
|
||||
*
|
||||
* @input:
|
||||
* hints :: handle to Type 2 hints recorder
|
||||
*
|
||||
* @note:
|
||||
* You should always call the @T2_Hints_CloseFunc method in order
|
||||
* to close an opened recording session
|
||||
*/
|
||||
typedef void (*T2_Hints_OpenFunc) ( T2_Hints hints );
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_OpenFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to prepare it for a new */
|
||||
/* Type 2 hints recording session. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* You should always call the @T2_Hints_CloseFunc method in order to */
|
||||
/* close an opened recording session. */
|
||||
/* */
|
||||
typedef void
|
||||
(*T2_Hints_OpenFunc)( T2_Hints hints );
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @functype: T2_Hints_StemsFunc
|
||||
*
|
||||
* @description:
|
||||
* a method of the @T2_Hints class used to set the table of stems
|
||||
* in either the vertical or horizontal dimension. Equivalent to the
|
||||
* "hstem", "vstem", "hstemhm" and "vstemhm" Type 2 operators
|
||||
*
|
||||
* @input:
|
||||
* hints :: handle to Type 2 hints recorder
|
||||
* dimension :: 0 for horizontal stems (hstem), 1 for vertical ones (vstem)
|
||||
* count :: number of stems
|
||||
* coordinates :: an array of "count" (position,length) pairs
|
||||
*
|
||||
* @note:
|
||||
* use vertical coordinates (y) for horizontal stems (dim=0)
|
||||
* use horizontal coordinates (x) for vertical stems (dim=1)
|
||||
*
|
||||
* there are "2*count" elements in the "coordinates" array. Each
|
||||
* even element is an absolute position in font units, each odd
|
||||
* element is a length in font units
|
||||
*
|
||||
* a length can be negative, in which case it must be either
|
||||
* -20 or -21 in order and will be interpreted as a "ghost" stem,
|
||||
* according to the Type 1 specification.
|
||||
*/
|
||||
typedef void (*T2_Hints_StemsFunc) ( T2_Hints hints,
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_StemsFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to set the table of stems in */
|
||||
/* either the vertical or horizontal dimension. Equivalent to the */
|
||||
/* "hstem", "vstem", "hstemhm", and "vstemhm" Type 2 operators. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* dimension :: 0 for horizontal stems (hstem), 1 for vertical ones */
|
||||
/* (vstem). */
|
||||
/* */
|
||||
/* count :: The number of stems. */
|
||||
/* */
|
||||
/* coords :: An array of "count" (position,length) pairs. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* Use vertical coordinates (y) for horizontal stems (dim=0). Use */
|
||||
/* horizontal coordinates (x) for vertical stems (dim=1). */
|
||||
/* */
|
||||
/* There are "2*count" elements in the "coords" aray. Each even */
|
||||
/* element is an absolute position in font units, each odd element is */
|
||||
/* a length in font units. */
|
||||
/* */
|
||||
/* A length can be negative, in which case it must be either -20 or */
|
||||
/* -21. It will be interpreted as a "ghost" stem, according to the */
|
||||
/* Type 1 specification. */
|
||||
/* */
|
||||
typedef void
|
||||
(*T2_Hints_StemsFunc)( T2_Hints hints,
|
||||
FT_UInt dimension,
|
||||
FT_UInt count,
|
||||
FT_Fixed* coordinates );
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @functype: T2_Hints_MaskFunc
|
||||
*
|
||||
* @description:
|
||||
* a method of the @T2_Hints class used to set a given hintmask
|
||||
* (correspond to the "hintmask" Type 2 operator)
|
||||
*
|
||||
* @input:
|
||||
* hints :: handle to Type 2 hints recorder
|
||||
* end_point :: glyph index of the last point to which the previously
|
||||
* defined/active hints apply.
|
||||
* bit_count :: number of bits in the hint mask.
|
||||
* bytes :: an array of bytes modelling the hint mask
|
||||
*
|
||||
* @note:
|
||||
* if the hintmask starts the charstring (before any glyph point
|
||||
* definition), the value of "end_point" should be 0
|
||||
*
|
||||
* "bit_count" is the number of meaningful bits in the "bytes" array,
|
||||
* and must be equal to the total number of hints defined so far
|
||||
* (i.e. horizontal+verticals)
|
||||
*
|
||||
* the "bytes" array can come directly from the Type 2 charstring
|
||||
* and respect the same format.
|
||||
*/
|
||||
typedef void (*T2_Hints_MaskFunc) ( T2_Hints hints,
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_MaskFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to set a given hintmask */
|
||||
/* (this corresponds to the "hintmask" Type 2 operator). */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* end_point :: The glyph index of the last point to which the */
|
||||
/* previously defined/activated hints apply. */
|
||||
/* */
|
||||
/* bit_count :: The number of bits in the hint mask. */
|
||||
/* */
|
||||
/* bytes :: An array of bytes modelling the hint mask. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* If the hintmask starts the charstring (before any glyph point */
|
||||
/* definition), the value of "end_point" should be 0. */
|
||||
/* */
|
||||
/* "bit_count" is the number of meaningful bits in the "bytes" array; */
|
||||
/* it must be equal to the total number of hints defined so far */
|
||||
/* (i.e. horizontal+verticals). */
|
||||
/* */
|
||||
/* The "bytes" array can come directly from the Type 2 charstring and */
|
||||
/* respects the same format. */
|
||||
/* */
|
||||
typedef void
|
||||
(*T2_Hints_MaskFunc)( T2_Hints hints,
|
||||
FT_UInt end_point,
|
||||
FT_UInt bit_count,
|
||||
const FT_Byte* bytes );
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @functype: T2_Hints_CounterFunc
|
||||
*
|
||||
* @description:
|
||||
* a method of the @T2_Hints class used to set a given counter
|
||||
* mask (correspond to the "hintmask" Type 2 operator)
|
||||
*
|
||||
* @input:
|
||||
* hints :: handle to Type 2 hints recorder
|
||||
* end_point :: glyph index of the last point to which the previously
|
||||
* defined/active hints apply.
|
||||
* bit_count :: number of bits in the hint mask.
|
||||
* bytes :: an array of bytes modelling the hint mask
|
||||
*
|
||||
* @note:
|
||||
* if the hintmask starts the charstring (before any glyph point
|
||||
* definition), the value of "end_point" should be 0
|
||||
*
|
||||
* "bit_count" is the number of meaningful bits in the "bytes" array,
|
||||
* and must be equal to the total number of hints defined so far
|
||||
* (i.e. horizontal+verticals)
|
||||
*
|
||||
* the "bytes" array can come directly from the Type 2 charstring
|
||||
* and respect the same format.
|
||||
*/
|
||||
typedef void (*T2_Hints_CounterFunc)( T2_Hints hints,
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_CounterFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to set a given counter mask */
|
||||
/* (this corresponds to the "hintmask" Type 2 operator). */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* end_point :: A glyph index of the last point to which the */
|
||||
/* previously defined/active hints apply. */
|
||||
/* */
|
||||
/* bit_count :: The number of bits in the hint mask. */
|
||||
/* */
|
||||
/* bytes :: An array of bytes modelling the hint mask. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* If the hintmask starts the charstring (before any glyph point */
|
||||
/* definition), the value of "end_point" should be 0. */
|
||||
/* */
|
||||
/* "bit_count" is the number of meaningful bits in the "bytes" array; */
|
||||
/* it must be equal to the total number of hints defined so far */
|
||||
/* (i.e. horizontal+verticals). */
|
||||
/* */
|
||||
/* The "bytes" array can come directly from the Type 2 charstring and */
|
||||
/* respects the same format. */
|
||||
/* */
|
||||
typedef void
|
||||
(*T2_Hints_CounterFunc)( T2_Hints hints,
|
||||
FT_UInt bit_count,
|
||||
const FT_Byte* bytes );
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @functype: T2_Hints_CloseFunc
|
||||
*
|
||||
* @description:
|
||||
* a method of the @T2_Hints class used to close a hint recording
|
||||
* session.
|
||||
*
|
||||
* @input:
|
||||
* hints :: handle to Type 2 hints recorder
|
||||
* end_point :: index of last point in the input glyph
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
*
|
||||
* @note:
|
||||
* the error code will be set to indicate that an error occured
|
||||
* during the recording session
|
||||
*/
|
||||
typedef FT_Error (*T2_Hints_CloseFunc) ( T2_Hints hints,
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_CloseFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to close a hint recording */
|
||||
/* session. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* end_point :: The index of the last point in the input glyph. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* The error code will be set to indicate that an error occured */
|
||||
/* during the recording session. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*T2_Hints_CloseFunc)( T2_Hints hints,
|
||||
FT_UInt end_point );
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @functype: T2_Hints_ApplyFunc
|
||||
*
|
||||
* @description:
|
||||
* a method of the @T2_Hints class used to apply hints to the
|
||||
* corresponding glyph outline. Must be called after the "close" method
|
||||
*
|
||||
* @input:
|
||||
* hints :: handle to Type 2 hints recorder
|
||||
* outline :: pointer to target outline descriptor
|
||||
* globals :: the hinter globals for this font
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
*
|
||||
* @note:
|
||||
* on input, all points within the outline are in font coordinates.
|
||||
* on output, they're in 1/64th of pixels.
|
||||
*
|
||||
* the scaling transform is taken from the "globals" object, which
|
||||
* must correspond to the same font than the glyph
|
||||
*/
|
||||
typedef FT_Error (*T2_Hints_ApplyFunc)( T2_Hints hints,
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_ApplyFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to apply hints to the */
|
||||
/* corresponding glyph outline. Must be called after the "close" */
|
||||
/* method. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* outline :: A pointer to the target outline descriptor. */
|
||||
/* */
|
||||
/* globals :: The hinter globals for this font. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* On input, all points within the outline are in font coordinates. */
|
||||
/* On output, they are in 1/64th of pixels. */
|
||||
/* */
|
||||
/* The scaling transformation is taken from the "globals" object */
|
||||
/* which must correspond to the same font than the glyph. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*T2_Hints_ApplyFunc)( T2_Hints hints,
|
||||
FT_Outline* outline,
|
||||
PSH_Globals globals );
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @struct: T2_Hints_FuncsRec
|
||||
*
|
||||
* @description:
|
||||
* the structure used to provide the API to @T2_Hints objects
|
||||
*
|
||||
* @fields:
|
||||
* hints :: handle to T2 hints recorder object
|
||||
* open :: open recording session
|
||||
* close :: close recording session
|
||||
* stems :: set dimension's stems table
|
||||
* hintmask :: set hint masks
|
||||
* counter :: set counter masks
|
||||
* apply :: apply the hints on the corresponding glyph outline
|
||||
*/
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* T2_Hints_FuncsRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The structure used to provide the API to @T2_Hints objects. */
|
||||
/* */
|
||||
/* @fields: */
|
||||
/* hints :: A handle to the T2 hints recorder object. */
|
||||
/* */
|
||||
/* open :: The function to open a recording session. */
|
||||
/* */
|
||||
/* close :: The function to close a recording session. */
|
||||
/* */
|
||||
/* stems :: The function to set the dimension's stems table. */
|
||||
/* */
|
||||
/* hintmask :: The function to set hint masks. */
|
||||
/* */
|
||||
/* counter :: The function to set counter masks. */
|
||||
/* */
|
||||
/* apply :: The function to apply the hints on the corresponding */
|
||||
/* glyph outline. */
|
||||
/* */
|
||||
typedef struct T2_Hints_FuncsRec_
|
||||
{
|
||||
T2_Hints hints;
|
||||
|
@ -516,6 +600,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
/* */
|
||||
|
||||
|
||||
typedef struct PSHinter_Interface_
|
||||
{
|
||||
PSH_Globals_Funcs (*get_globals_funcs)( FT_Module module );
|
||||
|
@ -524,6 +609,10 @@ FT_BEGIN_HEADER
|
|||
|
||||
} PSHinter_Interface, *PSHinter_InterfacePtr;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __PSHINTS_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include FT_INTERNAL_POSTSCRIPT_NAMES_H
|
||||
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
|
@ -173,7 +174,7 @@ FT_BEGIN_HEADER
|
|||
/* support for Multiple Masters fonts */
|
||||
T1_Blend* blend;
|
||||
|
||||
/* since FT 2.1 - interface to Postscript hinter */
|
||||
/* since FT 2.1 - interface to PostScript hinter */
|
||||
void* pshinter;
|
||||
|
||||
} T1_FaceRec;
|
||||
|
|
|
@ -316,7 +316,7 @@ FT_BEGIN_HEADER
|
|||
#if 1 /* this used to be this value (and it still is in many places) */
|
||||
#define TT_MS_LANGID_CHINESE_MACAU 0x1404
|
||||
#else /* but beware, Microsoft may change its mind...
|
||||
the most recent Word reference has the following: :-( */
|
||||
the most recent Word reference has the following: */
|
||||
#define TT_MS_LANGID_CHINESE_MACAU TT_MS_LANGID_CHINESE_HONG_KONG
|
||||
#endif
|
||||
|
||||
|
@ -486,10 +486,10 @@ FT_BEGIN_HEADER
|
|||
#define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442
|
||||
#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450
|
||||
|
||||
/* this seems to be inconsistant... :-(
|
||||
* here is the current "official" way: */
|
||||
/* the following seems to be inconsistent;
|
||||
here is the current "official" way: */
|
||||
#define TT_MS_LANGID_TIBETAN_BHUTAN 0x0451
|
||||
/* and now here is what is used by Passport SDK */
|
||||
/* and here is what is used by Passport SDK */
|
||||
#define TT_MS_LANGID_TIBETAN_CHINA 0x0451
|
||||
#define TT_MS_LANGID_DZONGHKA_BHUTAN 0x0851
|
||||
/* end of inconsistency */
|
||||
|
@ -526,22 +526,23 @@ FT_BEGIN_HEADER
|
|||
#define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465
|
||||
/* alias declared in Windows 2000 */
|
||||
#define TT_MS_LANGID_DIVEHI_MALDIVES TT_MS_LANGID_DHIVEHI_MALDIVES
|
||||
/* for language codes from 0x0466 to 0x0471, see below */
|
||||
/* for language codes from 0x0466 to 0x0471 see below */
|
||||
#define TT_MS_LANGID_OROMO_ETHIOPIA 0x0472
|
||||
#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA 0x0473
|
||||
#define TT_MS_LANGID_TIGRIGNA_ERYTHREA 0x0873
|
||||
/* also spelled in the `Passport SDK' list as: */
|
||||
#define TT_MS_LANGID_TIGRIGNA_ERYTREA TT_MS_LANGID_TIGRIGNA_ERYTHREA
|
||||
|
||||
/* New additions from Windows Xp/Passport SDK. AL 2001-11-10. */
|
||||
/* New additions from Windows Xp/Passport SDK 2001-11-10. */
|
||||
|
||||
/* don't ask me what this one means... :-(
|
||||
* note it is currently commented out
|
||||
/* don't ask what this one means... It is commented out currently. */
|
||||
#if 0
|
||||
#define TT_MS_LANGID_GREEK_GREECE2 0x2008
|
||||
* end of comment to avoid strange code */
|
||||
#endif
|
||||
|
||||
#define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540a
|
||||
/* these following two blatently violate MS specs, by using a sublang>0x1F */
|
||||
/* The following two IDs blatantly violate MS specs by using a */
|
||||
/* sublanguage > 0x1F. */
|
||||
#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40a
|
||||
#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40c
|
||||
|
||||
|
@ -562,8 +563,9 @@ FT_BEGIN_HEADER
|
|||
#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES 0x0475
|
||||
#define TT_MS_LANGID_LATIN 0x0476
|
||||
#define TT_MS_LANGID_SOMALI_SOMALIA 0x0477
|
||||
/* Note Yi does not have a (proper) ISO639-2 code, since it is mostly not
|
||||
* written (but OTOH the peculiar writing system is worth studying). */
|
||||
/* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */
|
||||
/* not written (but OTOH the peculiar writing system is worth */
|
||||
/* studying). */
|
||||
#define TT_MS_LANGID_YI_CHINA 0x0478
|
||||
#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES 0x0479
|
||||
|
||||
|
@ -744,7 +746,7 @@ FT_BEGIN_HEADER
|
|||
/* 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 really means: U+10000-U+10FFFD */
|
||||
/* supported by this font. So it really means: >= U+10000 */
|
||||
|
||||
/* Bit 58 is reserved for Unicode SubRanges */
|
||||
|
||||
|
|
|
@ -383,6 +383,9 @@
|
|||
#if 0
|
||||
ah_debug_disable_horz = no_horz_edges;
|
||||
ah_debug_disable_vert = no_vert_edges;
|
||||
#else
|
||||
UNUSED( no_horz_edges );
|
||||
UNUSED( no_vert_edges );
|
||||
#endif
|
||||
/* AH_Interpolate_Blue_Edges( hinter ); -- doesn't seem to help */
|
||||
/* reduce the problem of the disappearing eye in the `e' of Times... */
|
||||
|
|
|
@ -511,7 +511,7 @@
|
|||
if ( s < 0 )
|
||||
{
|
||||
x->lo = (FT_UInt32)-(FT_Int32)x->lo;
|
||||
x->hi = ~x->hi + !( x->lo );
|
||||
x->hi = ~x->hi + !x->lo;
|
||||
}
|
||||
s ^= y; y = ABS( y );
|
||||
|
||||
|
@ -563,7 +563,7 @@
|
|||
if ( s < 0 )
|
||||
{
|
||||
x->lo = (FT_UInt32)-(FT_Int32)x->lo;
|
||||
x->hi = ~x->hi + !( x->lo );
|
||||
x->hi = ~x->hi + !x->lo;
|
||||
}
|
||||
s ^= y; y = ABS( y );
|
||||
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftdbgmem.c */
|
||||
/* */
|
||||
/* Memory debugger (body). */
|
||||
/* */
|
||||
/* Copyright 2001 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_CONFIG_H
|
||||
#include FT_INTERNAL_DEBUG_H
|
||||
|
@ -6,6 +24,7 @@
|
|||
#include FT_ERRORS_H
|
||||
#include FT_TYPES_H
|
||||
|
||||
|
||||
#ifdef FT_DEBUG_MEMORY
|
||||
|
||||
|
||||
|
@ -34,6 +53,7 @@
|
|||
|
||||
} FT_MemNodeRec;
|
||||
|
||||
|
||||
typedef struct FT_MemTableRec_
|
||||
{
|
||||
FT_ULong size;
|
||||
|
@ -55,11 +75,13 @@
|
|||
|
||||
} FT_MemTableRec;
|
||||
|
||||
|
||||
#define FT_MEM_SIZE_MIN 7
|
||||
#define FT_MEM_SIZE_MAX 13845163
|
||||
|
||||
#define FT_FILENAME( x ) ((x) ? (x) : "unknown file")
|
||||
|
||||
|
||||
static const FT_UInt ft_mem_primes[] =
|
||||
{
|
||||
7,
|
||||
|
@ -125,7 +147,9 @@
|
|||
{
|
||||
FT_UInt i;
|
||||
|
||||
for ( i = 0; i < sizeof(ft_mem_primes)/sizeof(ft_mem_primes[0]); i++ )
|
||||
|
||||
for ( i = 0;
|
||||
i < sizeof ( ft_mem_primes ) / sizeof ( ft_mem_primes[0] ); i++ )
|
||||
if ( ft_mem_primes[i] > num )
|
||||
return ft_mem_primes[i];
|
||||
|
||||
|
@ -140,6 +164,7 @@
|
|||
FT_Memory memory = table->memory;
|
||||
FT_Pointer block;
|
||||
|
||||
|
||||
memory->user = table->memory_user;
|
||||
block = table->alloc( memory, size );
|
||||
memory->user = table;
|
||||
|
@ -147,12 +172,14 @@
|
|||
return block;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ft_mem_table_free( FT_MemTable table,
|
||||
FT_Pointer block )
|
||||
{
|
||||
FT_Memory memory = table->memory;
|
||||
|
||||
|
||||
memory->user = table->memory_user;
|
||||
table->free( memory, block );
|
||||
memory->user = table;
|
||||
|
@ -164,13 +191,16 @@
|
|||
{
|
||||
FT_ULong new_size;
|
||||
|
||||
|
||||
new_size = ft_mem_closest_prime( table->nodes );
|
||||
if ( new_size != table->size )
|
||||
{
|
||||
FT_MemNode* new_buckets ;
|
||||
FT_ULong i;
|
||||
|
||||
new_buckets = ft_mem_table_alloc( table, new_size * sizeof(FT_MemNode) );
|
||||
|
||||
new_buckets = ft_mem_table_alloc( table,
|
||||
new_size * sizeof ( FT_MemNode ) );
|
||||
if ( new_buckets == NULL )
|
||||
return;
|
||||
|
||||
|
@ -181,6 +211,7 @@
|
|||
FT_MemNode node, next, *pnode;
|
||||
FT_ULong hash;
|
||||
|
||||
|
||||
node = table->buckets[i];
|
||||
while ( node )
|
||||
{
|
||||
|
@ -209,8 +240,10 @@
|
|||
{
|
||||
FT_MemTable table;
|
||||
|
||||
|
||||
table = memory->alloc( memory, sizeof ( *table ) );
|
||||
if ( table == NULL ) goto Exit;
|
||||
if ( table == NULL )
|
||||
goto Exit;
|
||||
|
||||
MEM_Set( table, 0, sizeof ( *table ) );
|
||||
|
||||
|
@ -225,7 +258,8 @@
|
|||
table->realloc = memory->realloc;
|
||||
table->free = memory->free;
|
||||
|
||||
table->buckets = memory->alloc( memory, table->size * sizeof(FT_MemNode) );
|
||||
table->buckets = memory->alloc( memory,
|
||||
table->size * sizeof ( FT_MemNode ) );
|
||||
if ( table->buckets )
|
||||
MEM_Set( table->buckets, 0, sizeof ( FT_MemNode ) * table->size );
|
||||
else
|
||||
|
@ -239,22 +273,23 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
ft_mem_table_destroy( FT_MemTable table )
|
||||
{
|
||||
FT_ULong i;
|
||||
|
||||
|
||||
if ( table )
|
||||
{
|
||||
FT_Memory memory = table->memory;
|
||||
FT_Long leak_count = 0;
|
||||
FT_ULong leaks = 0;
|
||||
|
||||
|
||||
for ( i = 0; i < table->size; i++ )
|
||||
{
|
||||
FT_MemNode *pnode = table->buckets + i, next, node = *pnode;
|
||||
|
||||
|
||||
while ( node )
|
||||
{
|
||||
next = node->link;
|
||||
|
@ -262,7 +297,8 @@
|
|||
|
||||
if ( node->size > 0 )
|
||||
{
|
||||
printf( "leaked memory block at address %p, size %8ld in (%s:%d)\n",
|
||||
printf(
|
||||
"leaked memory block at address %p, size %8ld in (%s:%ld)\n",
|
||||
node->address, node->size,
|
||||
FT_FILENAME( node->alloc_file_name ),
|
||||
node->alloc_line_no );
|
||||
|
@ -288,18 +324,20 @@
|
|||
table->nodes = 0;
|
||||
free( table );
|
||||
|
||||
printf( "FreeType: total memory allocations = %ld\n", table->alloc_total );
|
||||
printf( "FreeType: maximum memory footprint = %ld\n", table->alloc_max );
|
||||
printf(
|
||||
"FreeType: total memory allocations = %ld\n", table->alloc_total );
|
||||
printf(
|
||||
"FreeType: maximum memory footprint = %ld\n", table->alloc_max );
|
||||
|
||||
if ( leak_count > 0 )
|
||||
ft_mem_debug_panic( "FreeType: %ld bytes of memory leaked in %ld blocks\n",
|
||||
ft_mem_debug_panic(
|
||||
"FreeType: %ld bytes of memory leaked in %ld blocks\n",
|
||||
leaks, leak_count );
|
||||
printf( "FreeType: no memory leaks detected !!\n" );
|
||||
printf( "FreeType: No memory leaks detected!\n" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static FT_MemNode*
|
||||
ft_mem_table_get_nodep( FT_MemTable table,
|
||||
FT_Byte* address )
|
||||
|
@ -307,6 +345,7 @@
|
|||
FT_ULong hash;
|
||||
FT_MemNode *pnode, node;
|
||||
|
||||
|
||||
hash = FT_MEM_VAL( address );
|
||||
pnode = table->buckets + ( hash % table->size );
|
||||
|
||||
|
@ -325,7 +364,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
ft_mem_table_set( FT_MemTable table,
|
||||
FT_Byte* address,
|
||||
|
@ -333,6 +371,7 @@
|
|||
{
|
||||
FT_MemNode *pnode, node;
|
||||
|
||||
|
||||
if ( table )
|
||||
{
|
||||
pnode = ft_mem_table_get_nodep( table, address );
|
||||
|
@ -341,15 +380,17 @@
|
|||
{
|
||||
if ( node->size < 0 )
|
||||
{
|
||||
/* this block was already freed. this means that our memory is */
|
||||
/* now completely corrupted !! */
|
||||
ft_mem_debug_panic( "memory heap corrupted (allocating freed block)" );
|
||||
/* this block was already freed. This means that our memory is */
|
||||
/* now completely corrupted! */
|
||||
ft_mem_debug_panic(
|
||||
"memory heap corrupted (allocating freed block)" );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* this block was already allocated. this means that our memory */
|
||||
/* is also corrupted !! */
|
||||
ft_mem_debug_panic( "memory heap corrupted (re-allocating allocated block)" );
|
||||
/* this block was already allocated. This means that our memory */
|
||||
/* is also corrupted! */
|
||||
ft_mem_debug_panic(
|
||||
"memory heap corrupted (re-allocating allocated block)" );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -392,23 +433,22 @@
|
|||
{
|
||||
FT_MemNode *pnode, node;
|
||||
|
||||
|
||||
pnode = ft_mem_table_get_nodep( table, address );
|
||||
node = *pnode;
|
||||
if ( node )
|
||||
{
|
||||
if ( node->size < 0 )
|
||||
ft_mem_debug_panic( "freeing memory block at %p more than once at (%s:%ld)\n"
|
||||
ft_mem_debug_panic(
|
||||
"freeing memory block at %p more than once at (%s:%ld)\n"
|
||||
"block allocated at (%s:%ld) and released at (%s:%ld)",
|
||||
address,
|
||||
FT_FILENAME(table->file_name),
|
||||
table->line_no,
|
||||
FT_FILENAME(node->alloc_file_name),
|
||||
node->alloc_line_no,
|
||||
FT_FILENAME(node->free_file_name),
|
||||
node->free_line_no );
|
||||
FT_FILENAME( table->file_name ), table->line_no,
|
||||
FT_FILENAME( node->alloc_file_name ), node->alloc_line_no,
|
||||
FT_FILENAME( node->free_file_name ), node->free_line_no );
|
||||
|
||||
/* we simply invert the node's size to indicate that the node */
|
||||
/* was freed. We also change its content.. */
|
||||
/* was freed. We also change its contents. */
|
||||
MEM_Set( address, 0xF3, node->size );
|
||||
|
||||
table->alloc_current -= node->size;
|
||||
|
@ -417,10 +457,10 @@
|
|||
node->free_line_no = table->line_no;
|
||||
}
|
||||
else
|
||||
ft_mem_debug_panic( "trying to free unknown block at %p in (%s:%ld)\n",
|
||||
ft_mem_debug_panic(
|
||||
"trying to free unknown block at %p in (%s:%ld)\n",
|
||||
address,
|
||||
FT_FILENAME( table->file_name ),
|
||||
table->line_no );
|
||||
FT_FILENAME( table->file_name ), table->line_no );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -432,6 +472,7 @@
|
|||
FT_MemTable table = memory->user;
|
||||
FT_Byte* block;
|
||||
|
||||
|
||||
if ( size <= 0 )
|
||||
ft_mem_debug_panic( "negative block size allocation (%ld)", size );
|
||||
|
||||
|
@ -452,6 +493,7 @@
|
|||
{
|
||||
FT_MemTable table = memory->user;
|
||||
|
||||
|
||||
if ( block == NULL )
|
||||
ft_mem_debug_panic( "trying to free NULL in (%s:%ld)",
|
||||
FT_FILENAME( table->file_name ),
|
||||
|
@ -465,7 +507,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
extern FT_Pointer
|
||||
ft_mem_debug_realloc( FT_Memory memory,
|
||||
FT_Long cur_size,
|
||||
|
@ -479,24 +520,27 @@
|
|||
const char* file_name = FT_FILENAME( table->file_name );
|
||||
FT_Long line_no = table->line_no;
|
||||
|
||||
|
||||
if ( block == NULL || cur_size == 0 )
|
||||
ft_mem_debug_panic( "trying to reallocate NULL in (%s:%ld)",
|
||||
file_name, line_no );
|
||||
|
||||
if ( new_size <= 0 )
|
||||
ft_mem_debug_panic( "trying to reallocate %p to size 0 (current is %ld)"
|
||||
" in (%s:%ld)",
|
||||
ft_mem_debug_panic(
|
||||
"trying to reallocate %p to size 0 (current is %ld) in (%s:%ld)",
|
||||
block, cur_size, file_name, line_no );
|
||||
|
||||
/* check 'cur_size' value */
|
||||
pnode = ft_mem_table_get_nodep( table, (FT_Byte*)block );
|
||||
node = *pnode;
|
||||
if ( !node )
|
||||
ft_mem_debug_panic( "trying to reallocate unknown block at %p in (%s:%ld)",
|
||||
ft_mem_debug_panic(
|
||||
"trying to reallocate unknown block at %p in (%s:%ld)",
|
||||
block, file_name, line_no );
|
||||
|
||||
if ( node->size <= 0 )
|
||||
ft_mem_debug_panic( "trying to reallocate freed block at %p in (%s:%ld)",
|
||||
ft_mem_debug_panic(
|
||||
"trying to reallocate freed block at %p in (%s:%ld)",
|
||||
block, file_name, line_no );
|
||||
|
||||
if ( node->size != cur_size )
|
||||
|
@ -525,6 +569,7 @@
|
|||
FT_MemTable table;
|
||||
FT_Int result = 0;
|
||||
|
||||
|
||||
if ( getenv( "FT_DEBUG_MEMORY" ) )
|
||||
{
|
||||
table = ft_mem_table_new( memory );
|
||||
|
@ -546,6 +591,7 @@
|
|||
{
|
||||
FT_MemTable table = memory->user;
|
||||
|
||||
|
||||
if ( table )
|
||||
{
|
||||
memory->free = table->free;
|
||||
|
@ -567,6 +613,7 @@
|
|||
{
|
||||
FT_MemTable table = memory->user;
|
||||
|
||||
|
||||
if ( table )
|
||||
{
|
||||
table->file_name = file_name;
|
||||
|
@ -586,6 +633,7 @@
|
|||
{
|
||||
FT_MemTable table = memory->user;
|
||||
|
||||
|
||||
if ( table )
|
||||
{
|
||||
table->file_name = file_name;
|
||||
|
@ -603,6 +651,7 @@
|
|||
{
|
||||
FT_MemTable table = memory->user;
|
||||
|
||||
|
||||
if ( table )
|
||||
{
|
||||
table->file_name = file_name;
|
||||
|
@ -614,7 +663,10 @@
|
|||
|
||||
#else /* !FT_DEBUG_MEMORY */
|
||||
|
||||
/* ansi C doesn't like empty source files */
|
||||
/* ANSI C doesn't like empty source files */
|
||||
extern const FT_Byte _debug_mem_dummy = 0;
|
||||
|
||||
#endif /* !FT_DEBUG_MEMORY */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -244,7 +244,8 @@
|
|||
base_assoc = assoc;
|
||||
assoc += face_index; /* add on the face_index! */
|
||||
|
||||
/* if the face at this index is not scalable, fall back to the first one (old behavior) */
|
||||
/* if the face at this index is not scalable,
|
||||
fall back to the first one (old behavior) */
|
||||
if ( assoc->fontSize == 0 )
|
||||
{
|
||||
*have_sfnt = 1;
|
||||
|
|
|
@ -1920,6 +1920,7 @@
|
|||
{
|
||||
const char* result = NULL;
|
||||
|
||||
|
||||
if ( !face )
|
||||
goto Exit;
|
||||
|
||||
|
@ -1930,10 +1931,12 @@
|
|||
FT_Driver driver = face->driver;
|
||||
FT_Module_Class* clazz = FT_MODULE_CLASS( driver );
|
||||
|
||||
|
||||
if ( clazz->get_interface )
|
||||
{
|
||||
FT_PSName_Requester requester;
|
||||
|
||||
|
||||
requester = (FT_PSName_Requester)clazz->get_interface(
|
||||
FT_MODULE( driver ), "postscript_name" );
|
||||
if ( requester )
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#define FTC_CSET_CHUNK_INDEX( cset, gindex ) \
|
||||
( (gindex) / (cset)->item_count )
|
||||
|
||||
|
@ -44,6 +45,7 @@
|
|||
( (FT_UFast)( ( (cset)->hash << 16 ) | \
|
||||
( FTC_CSET_CHUNK_INDEX( cset, gindex ) & 0xFFFF ) ) )
|
||||
|
||||
|
||||
/* create a new chunk node, setting its cache index and ref count */
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
ftc_chunk_node_init( FTC_ChunkNode cnode,
|
||||
|
@ -56,6 +58,7 @@
|
|||
FT_UInt len;
|
||||
FT_UInt start = FTC_CSET_START( cset, gindex );
|
||||
|
||||
|
||||
cnode->cset = cset;
|
||||
cnode->node.hash = FTC_CSET_HASH( cset, gindex );
|
||||
cnode->item_start = start;
|
||||
|
@ -70,6 +73,7 @@
|
|||
{
|
||||
FT_Memory memory = ccache->cache.memory;
|
||||
|
||||
|
||||
error = MEM_Alloc( cnode->items, cset->item_size * cnode->item_count );
|
||||
}
|
||||
|
||||
|
@ -86,18 +90,18 @@
|
|||
FTC_ChunkSet cset = cnode->cset;
|
||||
FT_Memory memory = cset->ccache->cache.memory;
|
||||
|
||||
|
||||
/* destroy the node */
|
||||
FREE( cnode->items );
|
||||
cnode->item_count = 0;
|
||||
cnode->item_start = 0;
|
||||
|
||||
/* remove from parent set table - eventually destroy the set */
|
||||
/* remove from parent set table -- eventually destroy the set */
|
||||
if ( --cset->num_chunks <= 0 )
|
||||
FT_LruList_Remove( cset->ccache->cset_lru, (FT_LruNode)cset );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -156,15 +160,16 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
ftc_chunk_cache_init( FTC_ChunkCache ccache,
|
||||
FT_LruList_Class cset_class )
|
||||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
error = ftc_cache_init( FTC_CACHE( ccache ) );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
error = FT_LruList_New( cset_class, 0, ccache,
|
||||
ccache->cache.memory,
|
||||
|
@ -174,7 +179,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
ftc_chunk_cache_lookup( FTC_ChunkCache ccache,
|
||||
FTC_ChunkQuery query,
|
||||
|
@ -183,6 +187,7 @@
|
|||
FT_LruNode node;
|
||||
FT_Error error;
|
||||
|
||||
|
||||
error = FT_LruList_Lookup( ccache->cset_lru, query, &node );
|
||||
if ( !error )
|
||||
{
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#define FTC_GSET_HASH( gset, gindex ) \
|
||||
( (FT_UFast)( ( (gset)->hash << 16 ) | ( (gindex) & 0xFFFF ) ) )
|
||||
|
||||
|
@ -63,12 +64,12 @@
|
|||
{
|
||||
FTC_GlyphSet gset = gnode->gset;
|
||||
|
||||
|
||||
if ( --gset->num_glyphs <= 0 )
|
||||
FT_LruList_Remove( gset->gcache->gset_lru, (FT_LruNode)gset );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -77,12 +78,14 @@
|
|||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
ftc_glyph_set_init( FTC_GlyphSet gset,
|
||||
FT_LruList lru )
|
||||
{
|
||||
FTC_GlyphCache gcache = lru->user_data;
|
||||
|
||||
|
||||
gset->gcache = gcache;
|
||||
gset->num_glyphs = 0;
|
||||
|
||||
|
@ -128,8 +131,10 @@
|
|||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
error = ftc_cache_init( FTC_CACHE( gcache ) );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
error = FT_LruList_New( gset_class, 0, gcache,
|
||||
gcache->cache.memory,
|
||||
|
@ -147,6 +152,7 @@
|
|||
FT_LruNode node;
|
||||
FT_Error error;
|
||||
|
||||
|
||||
error = FT_LruList_Lookup( gcache->gset_lru, query, &node );
|
||||
if ( !error )
|
||||
{
|
||||
|
@ -160,5 +166,4 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -36,9 +36,11 @@
|
|||
|
||||
} FTC_ImageNodeRec, *FTC_ImageNode;
|
||||
|
||||
|
||||
#define FTC_IMAGE_NODE( x ) ((FTC_ImageNode)( x ))
|
||||
#define FTC_IMAGE_NODE_GINDEX( x ) FTC_GLYPH_NODE_GINDEX( x )
|
||||
|
||||
|
||||
/* the glyph image set type */
|
||||
typedef struct FTC_ImageSetRec_
|
||||
{
|
||||
|
@ -47,8 +49,8 @@
|
|||
|
||||
} FTC_ImageSetRec, *FTC_ImageSet;
|
||||
|
||||
#define FTC_IMAGE_SET(x) ((FTC_ImageSet)(x))
|
||||
|
||||
#define FTC_IMAGE_SET( x ) ((FTC_ImageSet)( x ))
|
||||
#define FTC_IMAGE_SET_MEMORY( x ) FTC_GLYPH_SET_MEMORY( &(x)->gset )
|
||||
|
||||
|
||||
|
@ -87,13 +89,14 @@
|
|||
FTC_GlyphQuery query )
|
||||
{
|
||||
FTC_ImageSet iset = FTC_IMAGE_SET( query->gset );
|
||||
FT_Memory memory = FTC_IMAGE_SET_MEMORY( iset );
|
||||
FT_Error error;
|
||||
FT_Face face;
|
||||
FT_Size size;
|
||||
|
||||
|
||||
/* initialize its inner fields */
|
||||
ftc_glyph_node_init( FTC_GLYPH_NODE(inode), query->gindex, query->gset );
|
||||
ftc_glyph_node_init( FTC_GLYPH_NODE( inode ),
|
||||
query->gindex, query->gset );
|
||||
|
||||
/* we will now load the glyph image */
|
||||
error = FTC_Manager_Lookup_Size( iset->gset.gcache->cache.manager,
|
||||
|
@ -167,6 +170,7 @@
|
|||
FT_ULong size = 0;
|
||||
FT_Glyph glyph = inode->glyph;
|
||||
|
||||
|
||||
switch ( glyph->format )
|
||||
{
|
||||
case ft_glyph_format_bitmap:
|
||||
|
@ -203,21 +207,18 @@
|
|||
|
||||
|
||||
/* this function assumes that the desired node's glyph set has been */
|
||||
/* set by a previous call to ftc_image_set_compare.. */
|
||||
/* set by a previous call to ftc_image_set_compare() */
|
||||
/* */
|
||||
FT_CALLBACK_DEF( FT_Bool )
|
||||
ftc_image_node_compare( FTC_ImageNode inode,
|
||||
FTC_ImageQuery iquery )
|
||||
{
|
||||
FTC_ImageSet iset = FTC_IMAGE_SET(inode->gnode.gset);
|
||||
|
||||
/* only if same glyph index and image set description */
|
||||
return FT_BOOL( iquery->glyph.gindex == FTC_IMAGE_NODE_GINDEX( inode ) &&
|
||||
iquery->glyph.gset == inode->gnode.gset );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -235,7 +236,7 @@
|
|||
ftc_glyph_set_init( &iset->gset, lru );
|
||||
iset->description = query->desc;
|
||||
|
||||
/* now compute hash from description - this is _very_ important */
|
||||
/* now compute hash from description -- this is _very_ important */
|
||||
iset->gset.hash = FTC_IMAGE_DESC_HASH( &query->desc );
|
||||
query->glyph.gset = FTC_GLYPH_SET( iset );
|
||||
|
||||
|
@ -249,8 +250,10 @@
|
|||
{
|
||||
FT_Bool result;
|
||||
|
||||
|
||||
/* we must set iquery.glyph.gset for faster glyph node comparisons */
|
||||
result = FT_BOOL( FTC_IMAGE_DESC_COMPARE( &iset->description, &iquery->desc ) );
|
||||
result = FT_BOOL( FTC_IMAGE_DESC_COMPARE( &iset->description,
|
||||
&iquery->desc ) );
|
||||
if ( result )
|
||||
iquery->glyph.gset = &iset->gset;
|
||||
|
||||
|
@ -285,7 +288,8 @@
|
|||
FT_CALLBACK_DEF( FT_Error )
|
||||
ftc_image_cache_init( FTC_Image_Cache cache )
|
||||
{
|
||||
return ftc_glyph_cache_init( (FTC_GlyphCache) cache, &ftc_image_set_class );
|
||||
return ftc_glyph_cache_init( (FTC_GlyphCache)cache,
|
||||
&ftc_image_set_class );
|
||||
}
|
||||
|
||||
|
||||
|
@ -330,7 +334,8 @@
|
|||
FTC_ImageNode node;
|
||||
FT_Error error;
|
||||
|
||||
/* some argument checks are delayed to ftc_glyph_cache_lookup */
|
||||
|
||||
/* some argument checks are delayed to ftc_glyph_cache_lookup() */
|
||||
if ( !cache || !desc || !aglyph )
|
||||
return FTC_Err_Invalid_Argument;
|
||||
|
||||
|
@ -368,8 +373,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
FTC_Image_Cache_Lookup( FTC_Image_Cache icache,
|
||||
FTC_Image_Desc* desc,
|
||||
|
@ -380,5 +383,4 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -43,9 +43,9 @@
|
|||
/*************************************************************************/
|
||||
|
||||
typedef struct FTC_FaceNodeRec_* FTC_FaceNode;
|
||||
|
||||
typedef struct FTC_SizeNodeRec_* FTC_SizeNode;
|
||||
|
||||
|
||||
typedef struct FTC_FaceNodeRec_
|
||||
{
|
||||
FT_LruNodeRec lru;
|
||||
|
@ -62,7 +62,6 @@
|
|||
} FTC_SizeNodeRec;
|
||||
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
ftc_face_node_init( FTC_FaceNode node,
|
||||
FTC_FaceID face_id,
|
||||
|
@ -126,7 +125,7 @@
|
|||
sizeof ( FTC_FaceNodeRec ),
|
||||
(FT_LruNode_InitFunc) ftc_face_node_init,
|
||||
(FT_LruNode_DoneFunc) ftc_face_node_done,
|
||||
(FT_LruNode_FlushFunc) 0, /* no flushing needed.. */
|
||||
(FT_LruNode_FlushFunc) 0, /* no flushing needed */
|
||||
(FT_LruNode_CompareFunc)0, /* direct comparison of FTC_FaceID handles */
|
||||
};
|
||||
|
||||
|
@ -149,7 +148,6 @@
|
|||
} FTC_SizeQueryRec, *FTC_SizeQuery;
|
||||
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
ftc_size_node_init( FTC_SizeNode node,
|
||||
FTC_SizeQuery query )
|
||||
|
@ -222,6 +220,7 @@
|
|||
{
|
||||
FT_Size size = node->size;
|
||||
|
||||
|
||||
return FT_BOOL( size->face == query->face &&
|
||||
(FT_UInt)size->metrics.x_ppem == query->width &&
|
||||
(FT_UInt)size->metrics.y_ppem == query->height );
|
||||
|
@ -308,8 +307,6 @@
|
|||
manager->request_face = requester;
|
||||
manager->request_data = req_data;
|
||||
|
||||
|
||||
|
||||
*amanager = manager;
|
||||
|
||||
Exit:
|
||||
|
@ -387,6 +384,7 @@
|
|||
FT_Error error;
|
||||
FTC_FaceNode node;
|
||||
|
||||
|
||||
if ( aface == NULL )
|
||||
return FTC_Err_Bad_Argument;
|
||||
|
||||
|
@ -451,7 +449,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* add a new node to the head of the manager's circular MRU list */
|
||||
static void
|
||||
ftc_node_mru_link( FTC_Node node,
|
||||
|
@ -459,6 +456,7 @@
|
|||
{
|
||||
FTC_Node first = manager->nodes_list;
|
||||
|
||||
|
||||
if ( first )
|
||||
{
|
||||
node->mru_prev = first->mru_prev;
|
||||
|
@ -472,6 +470,7 @@
|
|||
node->mru_next = node;
|
||||
node->mru_prev = node;
|
||||
}
|
||||
|
||||
manager->nodes_list = node;
|
||||
manager->num_nodes++;
|
||||
}
|
||||
|
@ -486,12 +485,13 @@
|
|||
FTC_Node next = node->mru_next;
|
||||
FTC_Node first = manager->nodes_list;
|
||||
|
||||
|
||||
prev->mru_next = next;
|
||||
next->mru_prev = prev;
|
||||
|
||||
if ( node->mru_next == first )
|
||||
{
|
||||
/* this is the last node in the list, update its head pointer */
|
||||
/* this is the last node in the list; update its head pointer */
|
||||
if ( node == first )
|
||||
manager->nodes_list = NULL;
|
||||
else
|
||||
|
@ -511,6 +511,7 @@
|
|||
{
|
||||
FTC_Node first = manager->nodes_list;
|
||||
|
||||
|
||||
if ( node != first )
|
||||
{
|
||||
ftc_node_mru_unlink( node, manager );
|
||||
|
@ -526,11 +527,12 @@
|
|||
{
|
||||
FTC_Node *pnode = cache->buckets + ( node->hash % cache->size );
|
||||
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if ( *pnode == NULL )
|
||||
{
|
||||
FT_ERROR(( "FreeType.cache.hash_unlink: unknown node !!\n" ));
|
||||
FT_ERROR(( "FreeType.cache.hash_unlink: unknown node!\n" ));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -555,6 +557,7 @@
|
|||
{
|
||||
FTC_Node *pnode = cache->buckets + ( node->hash % cache->size );
|
||||
|
||||
|
||||
node->link = *pnode;
|
||||
*pnode = node;
|
||||
|
||||
|
@ -562,8 +565,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* remove a node from the cache manager */
|
||||
static void
|
||||
ftc_node_destroy( FTC_Node node,
|
||||
|
@ -573,6 +574,7 @@
|
|||
FTC_Cache cache;
|
||||
FTC_Cache_Class clazz;
|
||||
|
||||
|
||||
#ifdef FT_DEBUG_ERROR
|
||||
/* find node's cache */
|
||||
if ( node->cache_index >= FTC_MAX_CACHES )
|
||||
|
@ -616,12 +618,12 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FTC_Manager_Check( FTC_Manager manager )
|
||||
{
|
||||
FTC_Node node, first;
|
||||
|
||||
|
||||
first = manager->nodes_list;
|
||||
|
||||
/* check node weights */
|
||||
|
@ -629,18 +631,22 @@
|
|||
{
|
||||
FT_ULong weight = 0;
|
||||
|
||||
|
||||
node = first;
|
||||
|
||||
do
|
||||
{
|
||||
FTC_Cache cache = manager->caches[node->cache_index];
|
||||
|
||||
|
||||
weight += cache->clazz->node_weight( node, cache );
|
||||
node = node->mru_next;
|
||||
}
|
||||
while (node != first);
|
||||
|
||||
} while ( node != first );
|
||||
|
||||
if ( weight != manager->cur_weight )
|
||||
FT_ERROR(( "FTC_Manager_Compress: invalid weight %ld instead of %ld\n",
|
||||
FT_ERROR((
|
||||
"FTC_Manager_Compress: invalid weight %ld instead of %ld\n",
|
||||
manager->cur_weight, weight ));
|
||||
}
|
||||
|
||||
|
@ -649,16 +655,18 @@
|
|||
{
|
||||
FT_UFast count = 0;
|
||||
|
||||
|
||||
node = first;
|
||||
do
|
||||
{
|
||||
count++;
|
||||
node = node->mru_next;
|
||||
}
|
||||
while (node != first);
|
||||
|
||||
} while ( node != first );
|
||||
|
||||
if ( count != manager->num_nodes )
|
||||
FT_ERROR(( "FTC_Manager_Compress: invalid cache node count %d instead of %d\n",
|
||||
FT_ERROR((
|
||||
"FTC_Manager_Compress: invalid cache node count %d instead of %d\n",
|
||||
manager->num_nodes, count ));
|
||||
}
|
||||
}
|
||||
|
@ -675,6 +683,7 @@
|
|||
{
|
||||
FTC_Node node, first;
|
||||
|
||||
|
||||
if ( !manager )
|
||||
return;
|
||||
|
||||
|
@ -684,10 +693,10 @@
|
|||
FTC_Manager_Check( manager );
|
||||
|
||||
FT_ERROR(( "compressing, weight = %ld, max = %ld, nodes = %d\n",
|
||||
manager->cur_weight, manager->max_weight, manager->num_nodes ));
|
||||
manager->cur_weight, manager->max_weight,
|
||||
manager->num_nodes ));
|
||||
#endif
|
||||
|
||||
|
||||
if ( manager->cur_weight < manager->max_weight || first == NULL )
|
||||
return;
|
||||
|
||||
|
@ -697,16 +706,16 @@
|
|||
{
|
||||
FTC_Node prev = node->mru_prev;
|
||||
|
||||
|
||||
prev = ( node == first ) ? NULL : node->mru_prev;
|
||||
|
||||
if ( node->ref_count <= 0 )
|
||||
ftc_node_destroy( node, manager );
|
||||
|
||||
node = prev;
|
||||
}
|
||||
while ( node && manager->cur_weight > manager->max_weight );
|
||||
}
|
||||
|
||||
} while ( node && manager->cur_weight > manager->max_weight );
|
||||
}
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
|
@ -829,6 +838,7 @@
|
|||
{
|
||||
FT_UInt i;
|
||||
|
||||
|
||||
for ( i = 0; i < sizeof ( ftc_primes ) / sizeof ( ftc_primes[0] ); i++ )
|
||||
if ( ftc_primes[i] > num )
|
||||
return ftc_primes[i];
|
||||
|
@ -842,6 +852,7 @@
|
|||
{
|
||||
FT_UFast new_size;
|
||||
|
||||
|
||||
new_size = ftc_prime_closest( cache->nodes );
|
||||
if ( new_size != cache->size )
|
||||
{
|
||||
|
@ -850,6 +861,7 @@
|
|||
FTC_Node* new_buckets ;
|
||||
FT_ULong i;
|
||||
|
||||
|
||||
if ( ALLOC_ARRAY( new_buckets, new_size, FTC_Node ) )
|
||||
return;
|
||||
|
||||
|
@ -858,6 +870,7 @@
|
|||
FTC_Node node, next, *pnode;
|
||||
FT_UFast hash;
|
||||
|
||||
|
||||
node = cache->buckets[i];
|
||||
while ( node )
|
||||
{
|
||||
|
@ -887,6 +900,7 @@
|
|||
FT_Memory memory = cache->memory;
|
||||
FT_Error error;
|
||||
|
||||
|
||||
cache->nodes = 0;
|
||||
cache->size = FTC_PRIMES_MIN;
|
||||
|
||||
|
@ -898,7 +912,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
ftc_cache_done( FTC_Cache cache )
|
||||
{
|
||||
|
@ -909,6 +922,7 @@
|
|||
FTC_Manager manager = cache->manager;
|
||||
FT_UFast i;
|
||||
|
||||
|
||||
for ( i = 0; i < cache->size; i++ )
|
||||
{
|
||||
FTC_Node *pnode = cache->buckets + i, next, node = *pnode;
|
||||
|
@ -941,9 +955,8 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* lookup a node in "top" of its cache's hash table */
|
||||
/* if not found, create a new node.. */
|
||||
/* Look up a node in "top" of its cache's hash table. */
|
||||
/* If not found, create a new node. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
ftc_cache_lookup_node( FTC_Cache cache,
|
||||
|
@ -955,15 +968,18 @@
|
|||
FTC_Node result = NULL;
|
||||
FTC_Node* bucket = cache->buckets + ( key_hash % cache->size );
|
||||
|
||||
|
||||
if ( *bucket )
|
||||
{
|
||||
FTC_Node* pnode = bucket;
|
||||
FTC_Node_CompareFunc compare = cache->clazz->node_compare;
|
||||
|
||||
|
||||
for (;;)
|
||||
{
|
||||
FTC_Node node;
|
||||
|
||||
|
||||
node = *pnode;
|
||||
if ( node == NULL )
|
||||
break;
|
||||
|
@ -997,6 +1013,7 @@
|
|||
FT_Memory memory = cache->memory;
|
||||
FTC_Node node;
|
||||
|
||||
|
||||
if ( ALLOC( node, clazz->node_size ) )
|
||||
goto Exit;
|
||||
|
||||
|
@ -1038,7 +1055,7 @@
|
|||
}
|
||||
|
||||
|
||||
/* maybe these functions will disappear later */
|
||||
/* maybe the next two functions will disappear eventually */
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
ftc_node_ref( FTC_Node node,
|
||||
|
@ -1049,7 +1066,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
ftc_node_unref( FTC_Node node,
|
||||
FTC_Cache cache )
|
||||
|
|
|
@ -43,8 +43,8 @@
|
|||
|
||||
} FTC_SBitSetRec;
|
||||
|
||||
#define FTC_SBIT_SET(x) ((FTC_SBitSet)(x))
|
||||
|
||||
#define FTC_SBIT_SET( x ) ( (FTC_SBitSet)(x) )
|
||||
#define FTC_SBIT_SET_MEMORY( x ) FTC_CHUNK_SET_MEMORY( &(x)->cset )
|
||||
|
||||
|
||||
|
@ -73,6 +73,7 @@
|
|||
FT_UInt count = cnode->item_count;
|
||||
FTC_SBit sbit = (FTC_SBit) cnode->items;
|
||||
|
||||
|
||||
if ( sbit )
|
||||
{
|
||||
for ( ; count > 0; sbit++, count-- )
|
||||
|
@ -107,7 +108,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
static FT_Error
|
||||
ftc_sbit_node_load( FTC_ChunkNode cnode,
|
||||
FT_UInt gindex,
|
||||
|
@ -122,6 +122,7 @@
|
|||
|
||||
FTC_SBit sbit;
|
||||
|
||||
|
||||
if ( gindex < (FT_UInt)cnode->item_start ||
|
||||
gindex >= (FT_UInt)cnode->item_start + cnode->item_count )
|
||||
{
|
||||
|
@ -154,7 +155,8 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
FT_ERROR(( "FreeType.cache.sbit_load: cannot load scalable glyphs in an"
|
||||
FT_ERROR((
|
||||
"FreeType.cache.sbit_load: cannot load scalable glyphs in an"
|
||||
" sbit cache, please check your arguments!\n" ));
|
||||
error = FTC_Err_Invalid_Argument;
|
||||
goto Exit;
|
||||
|
@ -239,7 +241,7 @@
|
|||
{
|
||||
sbit->width = 255;
|
||||
error = 0;
|
||||
/* sbit->buffer == NULL too !! */
|
||||
/* sbit->buffer == NULL too! */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -254,6 +256,7 @@
|
|||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
error = ftc_chunk_node_init( cnode,
|
||||
query->cset,
|
||||
query->gindex,
|
||||
|
@ -270,7 +273,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* this function is important because it is both part of */
|
||||
/* an FTC_ChunkSet_Class and an FTC_CacheNode_Class */
|
||||
/* */
|
||||
|
@ -278,7 +280,6 @@
|
|||
ftc_sbit_node_weight( FTC_ChunkNode cnode )
|
||||
{
|
||||
FT_ULong size;
|
||||
FTC_ChunkSet cset = cnode->cset;
|
||||
FT_UInt count = cnode->item_count;
|
||||
FT_Int pitch;
|
||||
FTC_SBit sbit = (FTC_SBit) cnode->items;
|
||||
|
@ -317,6 +318,7 @@
|
|||
FT_UInt offset = (FT_UInt)(gindex - cnode->item_start);
|
||||
FT_Bool result;
|
||||
|
||||
|
||||
result = FT_BOOL( offset < (FT_UInt)cnode->item_count &&
|
||||
creq->cset == cnode->cset );
|
||||
if ( result )
|
||||
|
@ -324,13 +326,17 @@
|
|||
/* check if we need to load the glyph bitmap now */
|
||||
FTC_SBit sbit = (FTC_SBit)cnode->items + offset;
|
||||
|
||||
|
||||
if ( sbit->buffer == NULL && sbit->width != 255 )
|
||||
{
|
||||
FT_ULong size;
|
||||
|
||||
|
||||
ftc_sbit_node_load( cnode, gindex, &size );
|
||||
cache->manager->cur_weight += size;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -354,6 +360,7 @@
|
|||
FT_Error error;
|
||||
FT_Face face;
|
||||
|
||||
|
||||
sset->desc = query->desc;
|
||||
|
||||
/* we need to compute "cquery.item_total" now */
|
||||
|
@ -368,8 +375,8 @@
|
|||
face->num_glyphs,
|
||||
FTC_CHUNK_CACHE( lru->user_data ) );
|
||||
|
||||
/* now compute hash from description - this is _very_ important */
|
||||
/* for good performance.. */
|
||||
/* now compute hash from description -- this is _very_ important */
|
||||
/* for good performance */
|
||||
sset->cset.hash = FTC_IMAGE_DESC_HASH( &sset->desc );
|
||||
query->chunk.cset = &sset->cset;
|
||||
}
|
||||
|
@ -378,15 +385,15 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Bool )
|
||||
ftc_sbit_set_compare( FTC_SBitSet sset,
|
||||
FTC_SBitQuery query )
|
||||
{
|
||||
FT_Bool result;
|
||||
|
||||
|
||||
/* we need to set the "cquery.cset" field or our query for */
|
||||
/* faster glyph comparisons in ftc_sbit_node_compare.. */
|
||||
/* faster glyph comparisons in ftc_sbit_node_compare() */
|
||||
/* */
|
||||
result = FT_BOOL( FTC_IMAGE_DESC_COMPARE( &sset->desc, &query->desc ) );
|
||||
if ( result )
|
||||
|
@ -396,7 +403,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_CALLBACK_TABLE_DEF
|
||||
const FT_LruList_ClassRec ftc_sbit_set_class =
|
||||
{
|
||||
|
@ -412,7 +418,6 @@
|
|||
};
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -429,6 +434,7 @@
|
|||
&ftc_sbit_set_class );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_TABLE_DEF
|
||||
const FTC_Cache_ClassRec ftc_sbit_cache_class =
|
||||
{
|
||||
|
@ -450,8 +456,7 @@
|
|||
FTC_SBit_Cache_New( FTC_Manager manager,
|
||||
FTC_SBit_Cache *acache )
|
||||
{
|
||||
return FTC_Manager_Register_Cache(
|
||||
manager,
|
||||
return FTC_Manager_Register_Cache( manager,
|
||||
&ftc_sbit_cache_class,
|
||||
(FTC_Cache*)acache );
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
FT_Error error;
|
||||
FT_LruList list;
|
||||
|
||||
|
||||
if ( !alist || !clazz )
|
||||
return FTC_Err_Invalid_Argument;
|
||||
|
||||
|
@ -72,6 +73,7 @@
|
|||
FT_Memory memory;
|
||||
FT_LruList_Class clazz;
|
||||
|
||||
|
||||
if ( !list )
|
||||
return;
|
||||
|
||||
|
@ -87,7 +89,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FT_LruList_Reset( FT_LruList list )
|
||||
{
|
||||
|
@ -107,6 +108,7 @@
|
|||
{
|
||||
FT_LruNode next = node->next;
|
||||
|
||||
|
||||
if ( clazz->node_done )
|
||||
clazz->node_done( node, list );
|
||||
|
||||
|
@ -193,9 +195,10 @@
|
|||
if ( list->max_nodes > 0 && list->num_nodes >= list->max_nodes )
|
||||
{
|
||||
/* this list list is full; we will now flush */
|
||||
/* the oldest node, if there's one !! */
|
||||
/* the oldest node, if there's one! */
|
||||
FT_LruNode last = *plast;
|
||||
|
||||
|
||||
if ( last )
|
||||
{
|
||||
if ( clazz->node_flush )
|
||||
|
@ -223,7 +226,7 @@
|
|||
}
|
||||
|
||||
/* in case of error during the flush or done/init cycle, */
|
||||
/* we need to discard the node.. */
|
||||
/* we need to discard the node */
|
||||
if ( clazz->node_done )
|
||||
clazz->node_done( last, list );
|
||||
|
||||
|
@ -258,13 +261,13 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FT_LruList_Remove( FT_LruList list,
|
||||
FT_LruNode node )
|
||||
{
|
||||
FT_LruNode *pnode;
|
||||
|
||||
|
||||
if ( !list || !node )
|
||||
return;
|
||||
|
||||
|
@ -276,6 +279,7 @@
|
|||
FT_Memory memory = list->memory;
|
||||
FT_LruList_Class clazz = list->clazz;
|
||||
|
||||
|
||||
*pnode = node->next;
|
||||
node->next = NULL;
|
||||
|
||||
|
@ -292,7 +296,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FT_LruList_Remove_Selection( FT_LruList list,
|
||||
FT_LruNode_SelectFunc select_func,
|
||||
|
@ -302,6 +305,7 @@
|
|||
FT_LruList_Class clazz;
|
||||
FT_Memory memory;
|
||||
|
||||
|
||||
if ( !list || !select_func )
|
||||
return;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/* */
|
||||
/* cffload.c */
|
||||
/* */
|
||||
/* OpenType and CFF data/program tables loader (body) */
|
||||
/* OpenType and CFF data/program tables loader (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
|
@ -2242,7 +2242,8 @@
|
|||
cff_done_index( &font->name_index );
|
||||
cff_done_index( &font->charstrings_index );
|
||||
|
||||
/* release font dictionaries, but only if working with a CID keyed CFF font */
|
||||
/* release font dictionaries, but only if working with */
|
||||
/* a CID keyed CFF font */
|
||||
if ( font->num_subfonts > 0 )
|
||||
{
|
||||
for ( index = 0; index < font->num_subfonts; index++ )
|
||||
|
|
|
@ -158,7 +158,7 @@
|
|||
0, /* glyph slot */
|
||||
0, /* glyph names! XXX */
|
||||
0, /* blend == 0 */
|
||||
0, /* hinting == FALSE */
|
||||
0, /* hinting == 0 */
|
||||
cid_load_glyph );
|
||||
if ( error )
|
||||
return error;
|
||||
|
|
|
@ -185,7 +185,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_CALLBACK_TABLE_DEF
|
||||
const FT_Driver_Class t1cid_driver_class =
|
||||
{
|
||||
|
|
|
@ -50,7 +50,7 @@ THE SOFTWARE.
|
|||
|
||||
|
||||
#if defined( FT_DEBUG_LEVEL_TRACE )
|
||||
static char* tableNames[] =
|
||||
static const char* tableNames[] =
|
||||
{
|
||||
"prop", "accl", "mtrcs", "bmps", "imtrcs",
|
||||
"enc", "swidth", "names", "accel"
|
||||
|
@ -95,7 +95,7 @@ THE SOFTWARE.
|
|||
PCF_Table tables;
|
||||
|
||||
FT_Memory memory = FT_FACE(face)->memory;
|
||||
unsigned int i;
|
||||
unsigned int n;
|
||||
|
||||
|
||||
if ( FILE_Seek ( 0 ) ||
|
||||
|
@ -109,7 +109,7 @@ THE SOFTWARE.
|
|||
return PCF_Err_Out_Of_Memory;
|
||||
|
||||
tables = face->toc.tables;
|
||||
for ( i = 0; i < toc->count; i++ )
|
||||
for ( n = 0; n < toc->count; n++ )
|
||||
{
|
||||
if ( READ_Fields( pcf_table_header, tables ) )
|
||||
goto Exit;
|
||||
|
@ -120,7 +120,7 @@ THE SOFTWARE.
|
|||
|
||||
{
|
||||
unsigned int i, j;
|
||||
char* name = "?";
|
||||
const char *name = "?";
|
||||
|
||||
|
||||
FT_TRACE4(( "Tables count: %ld\n", face->toc.count ));
|
||||
|
|
|
@ -177,6 +177,7 @@ FT_BEGIN_HEADER
|
|||
FT_Pos x,
|
||||
FT_Pos y );
|
||||
|
||||
|
||||
FT_LOCAL void
|
||||
T1_Builder_Close_Contour( T1_Builder* builder );
|
||||
|
||||
|
|
|
@ -141,7 +141,8 @@
|
|||
FT_String* name = (FT_String*)decoder->glyph_names[n];
|
||||
|
||||
|
||||
if ( name && name[0] == glyph_name[0] && strcmp( name,glyph_name ) == 0 )
|
||||
if ( name && name[0] == glyph_name[0] &&
|
||||
strcmp( name,glyph_name ) == 0 )
|
||||
return n;
|
||||
}
|
||||
|
||||
|
@ -290,6 +291,7 @@
|
|||
{
|
||||
FT_Outline dummy;
|
||||
|
||||
|
||||
dummy.n_points = (short)( base->n_points - n_base_points );
|
||||
dummy.points = base->points + n_base_points;
|
||||
|
||||
|
@ -337,6 +339,7 @@
|
|||
|
||||
T1_Hints_Funcs hinter;
|
||||
|
||||
|
||||
/* we don't want to touch the source code -- use macro trick */
|
||||
#define start_point T1_Builder_Start_Point
|
||||
#define check_points T1_Builder_Check_Points
|
||||
|
|
|
@ -20,4 +20,4 @@ SubDirHdrs [ FT2_SubDir src pshinter ] ;
|
|||
Library $(FT2_LIB) : $(_sources).c ;
|
||||
}
|
||||
|
||||
# end of src/psaux Jamfile
|
||||
# end of src/pshinter Jamfile
|
||||
|
|
|
@ -1,5 +1,23 @@
|
|||
#ifndef __PS_HINTER_ALGO_H__
|
||||
#define __PS_HINTER_ALGO_H__
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshalgo.h */
|
||||
/* */
|
||||
/* This header file defines the used hinting algorithm. */
|
||||
/* */
|
||||
/* Copyright 2001 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 __PSHALGO_H__
|
||||
#define __PSHALGO_H__
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
@ -7,13 +25,20 @@ FT_BEGIN_HEADER
|
|||
#define PSH_ALGORITHM_2
|
||||
|
||||
#ifdef PSH_ALGORITHM_1
|
||||
|
||||
#include "pshalgo1.h"
|
||||
#define PS_HINTS_APPLY_FUNC ps1_hints_apply
|
||||
|
||||
#else
|
||||
|
||||
#include "pshalgo2.h"
|
||||
#define PS_HINTS_APPLY_FUNC ps2_hints_apply
|
||||
|
||||
#endif
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __PS_HINTER_ALGO_H__ */
|
||||
#endif /* __PSHALGO_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -1,13 +1,33 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshalgo1.c */
|
||||
/* */
|
||||
/* PostScript hinting algorithm 1 (body). */
|
||||
/* */
|
||||
/* Copyright 2001 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include FT_INTERNAL_DEBUG_H
|
||||
#include "pshalgo1.h"
|
||||
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
extern PSH1_Hint_Table ps1_debug_hint_table = 0;
|
||||
extern PSH1_HintFunc ps1_debug_hint_func = 0;
|
||||
#endif
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -50,6 +70,7 @@
|
|||
FT_UInt count = table->max_hints;
|
||||
PSH1_Hint hint = table->hints;
|
||||
|
||||
|
||||
for ( ; count > 0; count--, hint++ )
|
||||
{
|
||||
psh1_hint_deactivate( hint );
|
||||
|
@ -65,6 +86,7 @@
|
|||
{
|
||||
PSH1_Hint hint = table->hints + index;
|
||||
|
||||
|
||||
if ( index >= table->max_hints )
|
||||
{
|
||||
FT_ERROR(( "%s.activate: invalid hint index %d\n", index ));
|
||||
|
@ -78,12 +100,13 @@
|
|||
psh1_hint_activate( hint );
|
||||
|
||||
/* now scan the current active hint set in order to determine */
|
||||
/* if we're overlapping with another segment.. */
|
||||
/* if we are overlapping with another segment */
|
||||
{
|
||||
PSH1_Hint* sorted = table->sort_global;
|
||||
FT_UInt count = table->num_hints;
|
||||
PSH1_Hint hint2;
|
||||
|
||||
|
||||
hint->parent = 0;
|
||||
for ( ; count > 0; count--, sorted++ )
|
||||
{
|
||||
|
@ -100,11 +123,9 @@
|
|||
if ( table->num_hints < table->max_hints )
|
||||
table->sort_global[table->num_hints++] = hint;
|
||||
else
|
||||
{
|
||||
FT_ERROR(( "%s.activate: too many sorted hints !! BUG !!\n",
|
||||
FT_ERROR(( "%s.activate: too many sorted hints! BUG!\n",
|
||||
"ps.fitter" ));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
|
@ -115,13 +136,12 @@
|
|||
FT_Byte* cursor = hint_mask->bytes;
|
||||
FT_UInt index, limit;
|
||||
|
||||
|
||||
limit = hint_mask->num_bits;
|
||||
|
||||
if ( limit != table->max_hints )
|
||||
{
|
||||
FT_ERROR(( "%s.activate_mask: invalid bit count (%d instead of %d)\n",
|
||||
"ps.fitter", hint_mask->num_bits, table->max_hints ));
|
||||
}
|
||||
|
||||
for ( index = 0; index < limit; index++ )
|
||||
{
|
||||
|
@ -152,6 +172,7 @@
|
|||
|
||||
FT_UNUSED( counter_masks );
|
||||
|
||||
|
||||
/* allocate our tables */
|
||||
if ( ALLOC_ARRAY( table->sort, 2 * count, PSH1_Hint ) ||
|
||||
ALLOC_ARRAY( table->hints, count, PSH1_HintRec ) ||
|
||||
|
@ -164,11 +185,12 @@
|
|||
table->num_zones = 0;
|
||||
table->zone = 0;
|
||||
|
||||
/* now, initialise the "hints" array */
|
||||
/* now, initialize the "hints" array */
|
||||
{
|
||||
PSH1_Hint write = table->hints;
|
||||
PS_Hint read = hints->hints;
|
||||
|
||||
|
||||
for ( ; count > 0; count--, write++, read++ )
|
||||
{
|
||||
write->org_pos = read->pos;
|
||||
|
@ -177,28 +199,30 @@
|
|||
}
|
||||
}
|
||||
|
||||
/* we now need to determine the initial "parent" stems, first */
|
||||
/* we now need to determine the initial "parent" stems; first */
|
||||
/* activate the hints that are given by the initial hint masks */
|
||||
if ( hint_masks )
|
||||
{
|
||||
FT_UInt count = hint_masks->num_masks;
|
||||
PS_Mask mask = hint_masks->masks;
|
||||
FT_UInt Count = hint_masks->num_masks;
|
||||
PS_Mask Mask = hint_masks->masks;
|
||||
|
||||
|
||||
table->hint_masks = hint_masks;
|
||||
|
||||
for ( ; count > 0; count--, mask++ )
|
||||
psh1_hint_table_record_mask( table, mask );
|
||||
for ( ; Count > 0; Count--, Mask++ )
|
||||
psh1_hint_table_record_mask( table, Mask );
|
||||
}
|
||||
|
||||
/* now, do a linear parse in case some hints were left alone */
|
||||
if ( table->num_hints != table->max_hints )
|
||||
{
|
||||
FT_UInt index, count;
|
||||
FT_UInt Index, Count;
|
||||
|
||||
FT_ERROR(( "%s.init: missing/incorrect hint masks !!\n" ));
|
||||
|
||||
FT_ERROR(( "%s.init: missing/incorrect hint masks!\n" ));
|
||||
count = table->max_hints;
|
||||
for ( index = 0; index < count; index++ )
|
||||
psh1_hint_table_record( table, index );
|
||||
for ( Index = 0; Index < Count; Index++ )
|
||||
psh1_hint_table_record( table, Index );
|
||||
}
|
||||
|
||||
Exit:
|
||||
|
@ -206,7 +230,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
psh1_hint_table_activate_mask( PSH1_Hint_Table table,
|
||||
PS_Mask hint_mask )
|
||||
|
@ -215,6 +238,7 @@
|
|||
FT_Byte* cursor = hint_mask->bytes;
|
||||
FT_UInt index, limit, count;
|
||||
|
||||
|
||||
limit = hint_mask->num_bits;
|
||||
count = 0;
|
||||
|
||||
|
@ -232,12 +256,14 @@
|
|||
{
|
||||
PSH1_Hint hint = &table->hints[index];
|
||||
|
||||
|
||||
if ( !psh1_hint_is_active( hint ) )
|
||||
{
|
||||
PSH1_Hint* sort = table->sort;
|
||||
FT_UInt count2;
|
||||
PSH1_Hint hint2;
|
||||
|
||||
|
||||
for ( count2 = count; count2 > 0; count2--, sort++ )
|
||||
{
|
||||
hint2 = sort[0];
|
||||
|
@ -255,30 +281,30 @@
|
|||
if ( count < table->max_hints )
|
||||
table->sort[count++] = hint;
|
||||
else
|
||||
{
|
||||
FT_ERROR(( "%s.activate_mask: too many active hints\n",
|
||||
"psf.hint" ));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mask >>= 1;
|
||||
}
|
||||
table->num_hints = count;
|
||||
|
||||
/* now, sort the hints, they're guaranteed to not overlap */
|
||||
/* so we can compare their "org_pos" field directly.. */
|
||||
/* now, sort the hints; they are guaranteed to not overlap */
|
||||
/* so we can compare their "org_pos" field directly */
|
||||
{
|
||||
FT_Int i1, i2;
|
||||
PSH1_Hint hint1, hint2;
|
||||
PSH1_Hint* sort = table->sort;
|
||||
|
||||
|
||||
/* a simple bubble sort will do, since in 99% of cases, the hints */
|
||||
/* will be already sorted.. and the sort will be linear */
|
||||
/* will be already sorted; and the sort will be linear */
|
||||
for ( i1 = 1; i1 < (FT_Int)count; i1++ )
|
||||
{
|
||||
hint1 = sort[i1];
|
||||
|
||||
for ( i2 = i1 - 1; i2 >= 0; i2-- )
|
||||
{
|
||||
hint2 = sort[i2];
|
||||
|
@ -293,18 +319,13 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** HINTS GRID-FITTING AND OPTIMISATION *****/
|
||||
/***** HINTS GRID-FITTING AND OPTIMIZATION *****/
|
||||
/***** *****/
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
void
|
||||
|
@ -316,6 +337,7 @@
|
|||
PSH1_Hint hint;
|
||||
FT_UInt count;
|
||||
|
||||
|
||||
for ( count = 0; count < table->num_hints; count++ )
|
||||
{
|
||||
hint = table->sort[count];
|
||||
|
@ -331,6 +353,7 @@
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
FT_LOCAL_DEF FT_Error
|
||||
psh1_hint_table_optimize( PSH1_Hint_Table table,
|
||||
PSH_Globals globals,
|
||||
|
@ -343,6 +366,7 @@
|
|||
|
||||
FT_UNUSED( outline );
|
||||
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
if ( ps_debug_no_vert_hints && vertical )
|
||||
{
|
||||
|
@ -358,11 +382,12 @@
|
|||
#endif
|
||||
|
||||
/* XXXX: for now, we only scale the hints to test all other aspects */
|
||||
/* of the Postscript Hinter.. */
|
||||
/* of the PostScript hinter */
|
||||
{
|
||||
PSH1_Hint hint;
|
||||
FT_UInt count;
|
||||
|
||||
|
||||
for ( count = 0; count < table->num_hints; count++ )
|
||||
{
|
||||
hint = table->sort[count];
|
||||
|
@ -377,6 +402,7 @@
|
|||
|
||||
PSH_AlignmentRec align;
|
||||
|
||||
|
||||
/* compute fitted width/height */
|
||||
fit_len = psh_dimension_snap_width( dim, hint->org_len );
|
||||
if ( fit_len < 64 )
|
||||
|
@ -400,25 +426,19 @@
|
|||
switch ( align.align )
|
||||
{
|
||||
case PSH_BLUE_ALIGN_TOP:
|
||||
{
|
||||
/* the top of the stem is aligned against a blue zone */
|
||||
hint->cur_pos = align.align_top - fit_len;
|
||||
break;
|
||||
}
|
||||
|
||||
case PSH_BLUE_ALIGN_BOT:
|
||||
{
|
||||
/* the bottom of the stem is aligned against a blue zone */
|
||||
hint->cur_pos = align.align_bot;
|
||||
break;
|
||||
}
|
||||
|
||||
case PSH_BLUE_ALIGN_TOP | PSH_BLUE_ALIGN_BOT:
|
||||
{
|
||||
/* both edges of the stem are aligned against blue zones */
|
||||
hint->cur_pos = align.align_bot;
|
||||
hint->cur_len = align.align_top - align.align_bot;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -436,9 +456,13 @@
|
|||
|
||||
hint->cur_pos = fit_center - ( fit_len >> 1 );
|
||||
}
|
||||
|
||||
# else
|
||||
hint->cur_pos = (FT_MulFix( hint->org_pos, scale ) + delta + 32) & -64;
|
||||
|
||||
hint->cur_pos = ( FT_MulFix( hint->org_pos, scale ) + delta + 32 )
|
||||
& -64;
|
||||
hint->cur_len = FT_MulFix( hint->org_len, scale );
|
||||
|
||||
# endif
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
|
@ -453,22 +477,20 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** POINTS INTERPOLATION ROUTINES *****/
|
||||
/***** *****/
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
#define PSH1_ZONE_MIN -3200000
|
||||
#define PSH1_ZONE_MAX +3200000
|
||||
|
||||
|
||||
#define xxDEBUG_ZONES
|
||||
|
||||
|
||||
#ifdef DEBUG_ZONES
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -488,7 +510,7 @@
|
|||
#endif
|
||||
|
||||
/* setup interpolation zones once the hints have been grid-fitted */
|
||||
/* by the optimizer.. */
|
||||
/* by the optimizer */
|
||||
static void
|
||||
psh1_hint_table_setup_zones( PSH1_Hint_Table table,
|
||||
FT_Fixed scale,
|
||||
|
@ -498,6 +520,7 @@
|
|||
PSH1_Zone zone;
|
||||
PSH1_Hint *sort, hint, hint2;
|
||||
|
||||
|
||||
zone = table->zones;
|
||||
|
||||
/* special case, no hints defined */
|
||||
|
@ -515,6 +538,7 @@
|
|||
|
||||
/* the first zone is before the first hint */
|
||||
/* x' = (x-x0)*s + x0' = x*s + ( x0' - x0*s ) */
|
||||
|
||||
sort = table->sort;
|
||||
hint = sort[0];
|
||||
|
||||
|
@ -531,6 +555,7 @@
|
|||
{
|
||||
FT_Fixed scale2;
|
||||
|
||||
|
||||
if ( hint->org_len > 0 )
|
||||
{
|
||||
/* setup a zone for inner-stem interpolation */
|
||||
|
@ -557,12 +582,14 @@
|
|||
/* setup zone for inter-stem interpolation */
|
||||
/* (x'-x1') = (x-x1)*(x2'-x1')/(x2-x1) */
|
||||
/* x' = x*s3 + x1' - x1*s3 */
|
||||
|
||||
scale2 = FT_DivFix( hint2->cur_pos - (hint->cur_pos + hint->cur_len),
|
||||
hint2->org_pos - (hint->org_pos + hint->org_len) );
|
||||
zone->scale = scale2;
|
||||
zone->min = hint->org_pos + hint->org_len;
|
||||
zone->max = hint2->org_pos;
|
||||
zone->delta = hint->cur_pos + hint->cur_len - FT_MulFix( zone->min, scale2 );
|
||||
zone->delta = hint->cur_pos + hint->cur_len -
|
||||
FT_MulFix( zone->min, scale2 );
|
||||
|
||||
print_zone( zone );
|
||||
|
||||
|
@ -575,7 +602,8 @@
|
|||
zone->scale = scale;
|
||||
zone->min = hint->org_pos + hint->org_len;
|
||||
zone->max = PSH1_ZONE_MAX;
|
||||
zone->delta = hint->cur_pos + hint->cur_len - FT_MulFix( zone->min, scale );
|
||||
zone->delta = hint->cur_pos + hint->cur_len -
|
||||
FT_MulFix( zone->min, scale );
|
||||
|
||||
print_zone( zone );
|
||||
|
||||
|
@ -593,6 +621,7 @@
|
|||
{
|
||||
PSH1_Zone zone;
|
||||
|
||||
|
||||
zone = table->zone;
|
||||
|
||||
if ( coord < zone->min )
|
||||
|
@ -603,8 +632,8 @@
|
|||
break;
|
||||
|
||||
zone--;
|
||||
}
|
||||
while ( coord < zone->min );
|
||||
|
||||
} while ( coord < zone->min );
|
||||
table->zone = zone;
|
||||
}
|
||||
else if ( coord > zone->max )
|
||||
|
@ -615,8 +644,8 @@
|
|||
break;
|
||||
|
||||
zone++;
|
||||
}
|
||||
while ( coord > zone->max );
|
||||
|
||||
} while ( coord > zone->max );
|
||||
table->zone = zone;
|
||||
}
|
||||
|
||||
|
@ -624,8 +653,8 @@
|
|||
}
|
||||
|
||||
|
||||
/* tune a given outline with current interpolation zones */
|
||||
/* the function only works in a single dimension.. */
|
||||
/* tune a given outline with current interpolation zones. */
|
||||
/* The function only works in a single dimension. */
|
||||
static void
|
||||
psh1_hint_table_tune_outline( PSH1_Hint_Table table,
|
||||
FT_Outline* outline,
|
||||
|
@ -640,11 +669,13 @@
|
|||
FT_Fixed scale = dim->scale_mult;
|
||||
FT_Fixed delta = dim->scale_delta;
|
||||
|
||||
|
||||
if ( hint_masks && hint_masks->num_masks > 0 )
|
||||
{
|
||||
first = 0;
|
||||
mask = hint_masks->masks;
|
||||
count = hint_masks->num_masks;
|
||||
|
||||
for ( ; count > 0; count--, mask++ )
|
||||
{
|
||||
last = mask->end_point;
|
||||
|
@ -654,6 +685,7 @@
|
|||
FT_Vector* vec;
|
||||
FT_Int count2;
|
||||
|
||||
|
||||
psh1_hint_table_activate_mask( table, mask );
|
||||
psh1_hint_table_optimize( table, globals, outline, vertical );
|
||||
psh1_hint_table_setup_zones( table, scale, delta );
|
||||
|
@ -661,10 +693,12 @@
|
|||
|
||||
vec = outline->points + first;
|
||||
count2 = last - first;
|
||||
|
||||
for ( ; count2 > 0; count2--, vec++ )
|
||||
{
|
||||
FT_Pos x, *px;
|
||||
|
||||
|
||||
px = vertical ? &vec->x : &vec->y;
|
||||
x = *px;
|
||||
|
||||
|
@ -679,6 +713,7 @@
|
|||
{
|
||||
FT_Vector* vec;
|
||||
|
||||
|
||||
vec = outline->points;
|
||||
count = outline->n_points;
|
||||
|
||||
|
@ -696,13 +731,13 @@
|
|||
}
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** HIGH-LEVEL INTERFACE *****/
|
||||
/***** *****/
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
FT_Error
|
||||
ps1_hints_apply( PS_Hints ps_hints,
|
||||
|
@ -713,18 +748,21 @@
|
|||
FT_Error error = 0;
|
||||
FT_Int dimension;
|
||||
|
||||
|
||||
for ( dimension = 1; dimension >= 0; dimension-- )
|
||||
{
|
||||
PS_Dimension dim = &ps_hints->dimension[dimension];
|
||||
|
||||
/* initialise hints table */
|
||||
|
||||
/* initialize hints table */
|
||||
memset( &hints, 0, sizeof ( hints ) );
|
||||
error = psh1_hint_table_init( &hints,
|
||||
&dim->hints,
|
||||
&dim->masks,
|
||||
&dim->counters,
|
||||
ps_hints->memory );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
psh1_hint_table_tune_outline( &hints,
|
||||
outline,
|
||||
|
@ -737,3 +775,6 @@
|
|||
Exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/* */
|
||||
/* pshalgo1.h */
|
||||
/* */
|
||||
/* First (basic) Postscript hinting routines */
|
||||
/* PostScript hinting algorithm 1 (specification). */
|
||||
/* */
|
||||
/* Copyright 2001 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
|
@ -15,8 +15,9 @@
|
|||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
#ifndef __PS_HINTER_ALGO1_H__
|
||||
#define __PS_HINTER_ALGO1_H__
|
||||
|
||||
#ifndef __PSHALGO1_H__
|
||||
#define __PSHALGO1_H__
|
||||
|
||||
#include "pshrec.h"
|
||||
|
||||
|
@ -32,8 +33,10 @@ FT_BEGIN_HEADER
|
|||
|
||||
} PSH1_Hint_Flags;
|
||||
|
||||
#define psh1_hint_is_active(x) (((x)->flags & PSH1_HINT_FLAG_ACTIVE) != 0)
|
||||
#define psh1_hint_is_ghost(x) (((x)->flags & PSH1_HINT_FLAG_GHOST ) != 0)
|
||||
#define psh1_hint_is_active( x ) \
|
||||
( ( (x)->flags & PSH1_HINT_FLAG_ACTIVE ) != 0 )
|
||||
#define psh1_hint_is_ghost( x ) \
|
||||
( ( (x)->flags & PSH1_HINT_FLAG_GHOST ) != 0 )
|
||||
|
||||
#define psh1_hint_activate( x ) (x)->flags |= PSH1_HINT_FLAG_ACTIVE
|
||||
#define psh1_hint_deactivate( x ) (x)->flags &= ~PSH1_HINT_FLAG_ACTIVE
|
||||
|
@ -53,9 +56,9 @@ FT_BEGIN_HEADER
|
|||
} PSH1_HintRec;
|
||||
|
||||
|
||||
/* this is an interpolation zone used for strong points */
|
||||
/* this is an interpolation zone used for strong points; */
|
||||
/* weak points are interpolated according to their strong */
|
||||
/* neighbours.. */
|
||||
/* neighbours */
|
||||
typedef struct PSH1_ZoneRec_
|
||||
{
|
||||
FT_Fixed scale;
|
||||
|
@ -91,10 +94,16 @@ FT_BEGIN_HEADER
|
|||
#ifdef DEBUG_HINTER
|
||||
extern PSH1_Hint_Table ps1_debug_hint_table;
|
||||
|
||||
typedef void (*PSH1_HintFunc)( PSH1_Hint hint, FT_Bool vertical );
|
||||
typedef void
|
||||
(*PSH1_HintFunc)( PSH1_Hint hint,
|
||||
FT_Bool vertical );
|
||||
|
||||
extern PSH1_HintFunc ps1_debug_hint_func;
|
||||
#endif
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __PS_HINTER_FITTER_H__ */
|
||||
#endif /* __PSHALGO1_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshalgo2.c */
|
||||
/* */
|
||||
/* PostScript hinting algorithm 2 (body). */
|
||||
/* */
|
||||
/* Copyright 2001 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include FT_INTERNAL_DEBUG_H
|
||||
|
@ -10,13 +28,14 @@
|
|||
extern PSH2_Glyph ps2_debug_glyph = 0;
|
||||
#endif
|
||||
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** BASIC HINTS RECORDINGS *****/
|
||||
/***** *****/
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* return true iff two stem hints overlap */
|
||||
static FT_Int
|
||||
|
@ -52,6 +71,7 @@
|
|||
FT_UInt count = table->max_hints;
|
||||
PSH2_Hint hint = table->hints;
|
||||
|
||||
|
||||
for ( ; count > 0; count--, hint++ )
|
||||
{
|
||||
psh2_hint_deactivate( hint );
|
||||
|
@ -67,6 +87,7 @@
|
|||
{
|
||||
PSH2_Hint hint = table->hints + index;
|
||||
|
||||
|
||||
if ( index >= table->max_hints )
|
||||
{
|
||||
FT_ERROR(( "%s.activate: invalid hint index %d\n", index ));
|
||||
|
@ -80,12 +101,13 @@
|
|||
psh2_hint_activate( hint );
|
||||
|
||||
/* now scan the current active hint set in order to determine */
|
||||
/* if we're overlapping with another segment.. */
|
||||
/* if we are overlapping with another segment */
|
||||
{
|
||||
PSH2_Hint* sorted = table->sort_global;
|
||||
FT_UInt count = table->num_hints;
|
||||
PSH2_Hint hint2;
|
||||
|
||||
|
||||
hint->parent = 0;
|
||||
for ( ; count > 0; count--, sorted++ )
|
||||
{
|
||||
|
@ -102,11 +124,9 @@
|
|||
if ( table->num_hints < table->max_hints )
|
||||
table->sort_global[table->num_hints++] = hint;
|
||||
else
|
||||
{
|
||||
FT_ERROR(( "%s.activate: too many sorted hints !! BUG !!\n",
|
||||
FT_ERROR(( "%s.activate: too many sorted hints! BUG!\n",
|
||||
"ps.fitter" ));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
|
@ -117,6 +137,7 @@
|
|||
FT_Byte* cursor = hint_mask->bytes;
|
||||
FT_UInt index, limit;
|
||||
|
||||
|
||||
limit = hint_mask->num_bits;
|
||||
|
||||
for ( index = 0; index < limit; index++ )
|
||||
|
@ -148,6 +169,7 @@
|
|||
|
||||
FT_UNUSED( counter_masks );
|
||||
|
||||
|
||||
/* allocate our tables */
|
||||
if ( ALLOC_ARRAY( table->sort, 2 * count, PSH2_Hint ) ||
|
||||
ALLOC_ARRAY( table->hints, count, PSH2_HintRec ) ||
|
||||
|
@ -160,11 +182,12 @@
|
|||
table->num_zones = 0;
|
||||
table->zone = 0;
|
||||
|
||||
/* now, initialise the "hints" array */
|
||||
/* now, initialize the "hints" array */
|
||||
{
|
||||
PSH2_Hint write = table->hints;
|
||||
PS_Hint read = hints->hints;
|
||||
|
||||
|
||||
for ( ; count > 0; count--, write++, read++ )
|
||||
{
|
||||
write->org_pos = read->pos;
|
||||
|
@ -173,28 +196,30 @@
|
|||
}
|
||||
}
|
||||
|
||||
/* we now need to determine the initial "parent" stems, first */
|
||||
/* we now need to determine the initial "parent" stems; first */
|
||||
/* activate the hints that are given by the initial hint masks */
|
||||
if ( hint_masks )
|
||||
{
|
||||
FT_UInt count = hint_masks->num_masks;
|
||||
PS_Mask mask = hint_masks->masks;
|
||||
FT_UInt Count = hint_masks->num_masks;
|
||||
PS_Mask Mask = hint_masks->masks;
|
||||
|
||||
|
||||
table->hint_masks = hint_masks;
|
||||
|
||||
for ( ; count > 0; count--, mask++ )
|
||||
psh2_hint_table_record_mask( table, mask );
|
||||
for ( ; Count > 0; Count--, Mask++ )
|
||||
psh2_hint_table_record_mask( table, Mask );
|
||||
}
|
||||
|
||||
/* now, do a linear parse in case some hints were left alone */
|
||||
if ( table->num_hints != table->max_hints )
|
||||
{
|
||||
FT_UInt index, count;
|
||||
FT_UInt Index, Count;
|
||||
|
||||
FT_ERROR(( "%s.init: missing/incorrect hint masks !!\n" ));
|
||||
|
||||
FT_ERROR(( "%s.init: missing/incorrect hint masks!\n" ));
|
||||
count = table->max_hints;
|
||||
for ( index = 0; index < count; index++ )
|
||||
psh2_hint_table_record( table, index );
|
||||
for ( Index = 0; Index < Count; Index++ )
|
||||
psh2_hint_table_record( table, Index );
|
||||
}
|
||||
|
||||
Exit:
|
||||
|
@ -202,7 +227,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
psh2_hint_table_activate_mask( PSH2_Hint_Table table,
|
||||
PS_Mask hint_mask )
|
||||
|
@ -211,6 +235,7 @@
|
|||
FT_Byte* cursor = hint_mask->bytes;
|
||||
FT_UInt index, limit, count;
|
||||
|
||||
|
||||
limit = hint_mask->num_bits;
|
||||
count = 0;
|
||||
|
||||
|
@ -228,6 +253,7 @@
|
|||
{
|
||||
PSH2_Hint hint = &table->hints[index];
|
||||
|
||||
|
||||
if ( !psh2_hint_is_active( hint ) )
|
||||
{
|
||||
FT_UInt count2;
|
||||
|
@ -240,11 +266,9 @@
|
|||
{
|
||||
hint2 = sort[0];
|
||||
if ( psh2_hint_overlap( hint, hint2 ) )
|
||||
{
|
||||
FT_ERROR(( "%s.activate_mask: found overlapping hints\n",
|
||||
"psf.hint" ));
|
||||
}
|
||||
}
|
||||
#else
|
||||
count2 = 0;
|
||||
#endif
|
||||
|
@ -255,27 +279,26 @@
|
|||
if ( count < table->max_hints )
|
||||
table->sort[count++] = hint;
|
||||
else
|
||||
{
|
||||
FT_ERROR(( "%s.activate_mask: too many active hints\n",
|
||||
"psf.hint" ));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mask >>= 1;
|
||||
}
|
||||
table->num_hints = count;
|
||||
|
||||
/* now, sort the hints, they're guaranteed to not overlap */
|
||||
/* so we can compare their "org_pos" field directly.. */
|
||||
/* now, sort the hints; they are guaranteed to not overlap */
|
||||
/* so we can compare their "org_pos" field directly */
|
||||
{
|
||||
FT_Int i1, i2;
|
||||
PSH2_Hint hint1, hint2;
|
||||
PSH2_Hint* sort = table->sort;
|
||||
|
||||
|
||||
/* a simple bubble sort will do, since in 99% of cases, the hints */
|
||||
/* will be already sorted.. and the sort will be linear */
|
||||
/* will be already sorted -- and the sort will be linear */
|
||||
for ( i1 = 1; i1 < (FT_Int)count; i1++ )
|
||||
{
|
||||
hint1 = sort[i1];
|
||||
|
@ -294,18 +317,13 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** HINTS GRID-FITTING AND OPTIMISATION *****/
|
||||
/***** HINTS GRID-FITTING AND OPTIMIZATION *****/
|
||||
/***** *****/
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
static void
|
||||
|
@ -317,6 +335,7 @@
|
|||
PSH2_Hint hint;
|
||||
FT_UInt count;
|
||||
|
||||
|
||||
for ( count = 0; count < table->max_hints; count++ )
|
||||
{
|
||||
hint = table->hints + count;
|
||||
|
@ -340,6 +359,7 @@
|
|||
FT_Fixed scale = dim->scale_mult;
|
||||
FT_Fixed delta = dim->scale_delta;
|
||||
|
||||
|
||||
if ( !psh2_hint_is_fitted(hint) )
|
||||
{
|
||||
FT_Pos pos = FT_MulFix( hint->org_pos, scale ) + delta;
|
||||
|
@ -350,6 +370,7 @@
|
|||
|
||||
PSH_AlignmentRec align;
|
||||
|
||||
|
||||
/* compute fitted width/height */
|
||||
fit_len = 0;
|
||||
if ( hint->org_len )
|
||||
|
@ -368,46 +389,40 @@
|
|||
align.align_bot = align.align_top = 0;
|
||||
|
||||
if ( !vertical )
|
||||
{
|
||||
psh_blues_snap_stem( &globals->blues,
|
||||
hint->org_pos + hint->org_len,
|
||||
hint->org_pos,
|
||||
&align );
|
||||
}
|
||||
|
||||
switch ( align.align )
|
||||
{
|
||||
case PSH_BLUE_ALIGN_TOP:
|
||||
{
|
||||
/* the top of the stem is aligned against a blue zone */
|
||||
hint->cur_pos = align.align_top - fit_len;
|
||||
break;
|
||||
}
|
||||
|
||||
case PSH_BLUE_ALIGN_BOT:
|
||||
{
|
||||
/* the bottom of the stem is aligned against a blue zone */
|
||||
hint->cur_pos = align.align_bot;
|
||||
break;
|
||||
}
|
||||
|
||||
case PSH_BLUE_ALIGN_TOP | PSH_BLUE_ALIGN_BOT:
|
||||
{
|
||||
/* both edges of the stem are aligned against blue zones */
|
||||
hint->cur_pos = align.align_bot;
|
||||
hint->cur_len = align.align_top - align.align_bot;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
PSH2_Hint parent = hint->parent;
|
||||
|
||||
|
||||
if ( parent )
|
||||
{
|
||||
FT_Pos par_org_center, par_cur_center;
|
||||
FT_Pos cur_org_center, cur_delta;
|
||||
|
||||
|
||||
/* ensure that parent is already fitted */
|
||||
if ( !psh2_hint_is_fitted( parent ) )
|
||||
psh2_hint_align( parent, globals, vertical );
|
||||
|
@ -465,6 +480,7 @@
|
|||
FT_Fixed scale = dim->scale_mult;
|
||||
FT_Fixed delta = dim->scale_delta;
|
||||
|
||||
|
||||
if ( ps_debug_no_vert_hints && vertical )
|
||||
{
|
||||
ps2_simple_scale( table, scale, delta, vertical );
|
||||
|
@ -480,25 +496,26 @@
|
|||
|
||||
hint = table->hints;
|
||||
count = table->max_hints;
|
||||
|
||||
for ( ; count > 0; count--, hint++ )
|
||||
psh2_hint_align( hint, globals, vertical );
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** POINTS INTERPOLATION ROUTINES *****/
|
||||
/***** *****/
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
#define PSH2_ZONE_MIN -3200000
|
||||
#define PSH2_ZONE_MAX +3200000
|
||||
|
||||
|
||||
#define xxDEBUG_ZONES
|
||||
|
||||
|
||||
#ifdef DEBUG_ZONES
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -514,12 +531,14 @@
|
|||
}
|
||||
|
||||
#else
|
||||
|
||||
#define print_zone( x ) do { } while ( 0 )
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* setup interpolation zones once the hints have been grid-fitted */
|
||||
/* by the optimizer.. */
|
||||
/* by the optimizer */
|
||||
static void
|
||||
psh2_hint_table_setup_zones( PSH2_Hint_Table table,
|
||||
FT_Fixed scale,
|
||||
|
@ -529,6 +548,7 @@
|
|||
PSH2_Zone zone;
|
||||
PSH2_Hint *sort, hint, hint2;
|
||||
|
||||
|
||||
zone = table->zones;
|
||||
|
||||
/* special case, no hints defined */
|
||||
|
@ -562,6 +582,7 @@
|
|||
{
|
||||
FT_Fixed scale2;
|
||||
|
||||
|
||||
if ( hint->org_len > 0 )
|
||||
{
|
||||
/* setup a zone for inner-stem interpolation */
|
||||
|
@ -588,12 +609,14 @@
|
|||
/* setup zone for inter-stem interpolation */
|
||||
/* (x'-x1') = (x-x1)*(x2'-x1')/(x2-x1) */
|
||||
/* x' = x*s3 + x1' - x1*s3 */
|
||||
|
||||
scale2 = FT_DivFix( hint2->cur_pos - (hint->cur_pos + hint->cur_len),
|
||||
hint2->org_pos - (hint->org_pos + hint->org_len) );
|
||||
zone->scale = scale2;
|
||||
zone->min = hint->org_pos + hint->org_len;
|
||||
zone->max = hint2->org_pos;
|
||||
zone->delta = hint->cur_pos + hint->cur_len - FT_MulFix( zone->min, scale2 );
|
||||
zone->delta = hint->cur_pos + hint->cur_len -
|
||||
FT_MulFix( zone->min, scale2 );
|
||||
|
||||
print_zone( zone );
|
||||
|
||||
|
@ -606,7 +629,8 @@
|
|||
zone->scale = scale;
|
||||
zone->min = hint->org_pos + hint->org_len;
|
||||
zone->max = PSH2_ZONE_MAX;
|
||||
zone->delta = hint->cur_pos + hint->cur_len - FT_MulFix( zone->min, scale );
|
||||
zone->delta = hint->cur_pos + hint->cur_len -
|
||||
FT_MulFix( zone->min, scale );
|
||||
|
||||
print_zone( zone );
|
||||
|
||||
|
@ -625,6 +649,7 @@
|
|||
{
|
||||
PSH2_Zone zone;
|
||||
|
||||
|
||||
zone = table->zone;
|
||||
|
||||
if ( coord < zone->min )
|
||||
|
@ -635,8 +660,8 @@
|
|||
break;
|
||||
|
||||
zone--;
|
||||
}
|
||||
while ( coord < zone->min );
|
||||
|
||||
} while ( coord < zone->min );
|
||||
table->zone = zone;
|
||||
}
|
||||
else if ( coord > zone->max )
|
||||
|
@ -647,8 +672,8 @@
|
|||
break;
|
||||
|
||||
zone++;
|
||||
}
|
||||
while ( coord > zone->max );
|
||||
|
||||
} while ( coord > zone->max );
|
||||
table->zone = zone;
|
||||
}
|
||||
|
||||
|
@ -673,11 +698,13 @@
|
|||
FT_Fixed scale = dim->scale_mult;
|
||||
FT_Fixed delta = dim->scale_delta;
|
||||
|
||||
|
||||
if ( hint_masks && hint_masks->num_masks > 0 )
|
||||
{
|
||||
first = 0;
|
||||
mask = hint_masks->masks;
|
||||
count = hint_masks->num_masks;
|
||||
|
||||
for ( ; count > 0; count--, mask++ )
|
||||
{
|
||||
last = mask->end_point;
|
||||
|
@ -687,6 +714,7 @@
|
|||
FT_Vector* vec;
|
||||
FT_Int count2;
|
||||
|
||||
|
||||
psh2_hint_table_activate_mask( table, mask );
|
||||
psh2_hint_table_optimize( table, globals, outline, vertical );
|
||||
psh2_hint_table_setup_zones( table, scale, delta );
|
||||
|
@ -694,10 +722,12 @@
|
|||
|
||||
vec = outline->points + first;
|
||||
count2 = last - first;
|
||||
|
||||
for ( ; count2 > 0; count2--, vec++ )
|
||||
{
|
||||
FT_Pos x, *px;
|
||||
|
||||
|
||||
px = vertical ? &vec->x : &vec->y;
|
||||
x = *px;
|
||||
|
||||
|
@ -712,6 +742,7 @@
|
|||
{
|
||||
FT_Vector* vec;
|
||||
|
||||
|
||||
vec = outline->points;
|
||||
count = outline->n_points;
|
||||
|
||||
|
@ -729,13 +760,14 @@
|
|||
}
|
||||
#endif
|
||||
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** HINTER GLYPH MANAGEMENT *****/
|
||||
/***** *****/
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
static int
|
||||
psh2_point_is_extremum( PSH2_Point point )
|
||||
|
@ -745,6 +777,7 @@
|
|||
FT_Pos d_before;
|
||||
FT_Pos d_after;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
before = before->prev;
|
||||
|
@ -752,8 +785,8 @@
|
|||
return 0;
|
||||
|
||||
d_before = before->org_u - point->org_u;
|
||||
}
|
||||
while ( d_before == 0 );
|
||||
|
||||
} while ( d_before == 0 );
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -762,20 +795,20 @@
|
|||
return 0;
|
||||
|
||||
d_after = after->org_u - point->org_u;
|
||||
}
|
||||
while ( d_after == 0 );
|
||||
|
||||
} while ( d_after == 0 );
|
||||
|
||||
return ( ( d_before > 0 && d_after > 0 ) ||
|
||||
( d_before < 0 && d_after < 0 ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
psh2_glyph_done( PSH2_Glyph glyph )
|
||||
{
|
||||
FT_Memory memory = glyph->memory;
|
||||
|
||||
|
||||
psh2_hint_table_done( &glyph->hint_tables[1], memory );
|
||||
psh2_hint_table_done( &glyph->hint_tables[0], memory );
|
||||
|
||||
|
@ -790,11 +823,13 @@
|
|||
|
||||
|
||||
static int
|
||||
psh2_compute_dir( FT_Pos dx, FT_Pos dy )
|
||||
psh2_compute_dir( FT_Pos dx,
|
||||
FT_Pos dy )
|
||||
{
|
||||
FT_Pos ax, ay;
|
||||
int result = PSH2_DIR_NONE;
|
||||
|
||||
|
||||
ax = ( dx >= 0 ) ? dx : -dx;
|
||||
ay = ( dy >= 0 ) ? dy : -dy;
|
||||
|
||||
|
@ -808,6 +843,7 @@
|
|||
/* |dx| <<< |dy| means a near-vertical segment */
|
||||
result = ( dy >= 0 ) ? PSH2_DIR_UP : PSH2_DIR_DOWN;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -821,14 +857,17 @@
|
|||
FT_Error error;
|
||||
FT_Memory memory;
|
||||
|
||||
|
||||
/* clear all fields */
|
||||
memset( glyph, 0, sizeof ( *glyph ) );
|
||||
|
||||
memory = globals->memory;
|
||||
|
||||
/* allocate and setup points + contours arrays */
|
||||
if ( ALLOC_ARRAY( glyph->points, outline->n_points, PSH2_PointRec ) ||
|
||||
ALLOC_ARRAY( glyph->contours, outline->n_contours, PSH2_ContourRec ) )
|
||||
if ( ALLOC_ARRAY( glyph->points, outline->n_points,
|
||||
PSH2_PointRec ) ||
|
||||
ALLOC_ARRAY( glyph->contours, outline->n_contours,
|
||||
PSH2_ContourRec ) )
|
||||
goto Exit;
|
||||
|
||||
glyph->num_points = outline->n_points;
|
||||
|
@ -839,11 +878,13 @@
|
|||
PSH2_Point points = glyph->points;
|
||||
PSH2_Contour contour = glyph->contours;
|
||||
|
||||
|
||||
for ( n = 0; n < glyph->num_contours; n++ )
|
||||
{
|
||||
FT_Int count;
|
||||
PSH2_Point point;
|
||||
|
||||
|
||||
next = outline->contours[n] + 1;
|
||||
count = next - first;
|
||||
|
||||
|
@ -856,6 +897,7 @@
|
|||
|
||||
point->prev = points + next - 1;
|
||||
point->contour = contour;
|
||||
|
||||
for ( ; count > 1; count-- )
|
||||
{
|
||||
point[0].next = point + 1;
|
||||
|
@ -877,12 +919,14 @@
|
|||
FT_Vector* vec = outline->points;
|
||||
FT_UInt n;
|
||||
|
||||
|
||||
for ( n = 0; n < glyph->num_points; n++, point++ )
|
||||
{
|
||||
FT_Int n_prev = point->prev - points;
|
||||
FT_Int n_next = point->next - points;
|
||||
FT_Pos dxi, dyi, dxo, dyo;
|
||||
|
||||
|
||||
if ( !( outline->tags[n] & FT_Curve_Tag_On ) )
|
||||
point->flags = PSH2_POINT_OFF;
|
||||
|
||||
|
@ -898,9 +942,7 @@
|
|||
|
||||
/* detect smooth points */
|
||||
if ( point->flags & PSH2_POINT_OFF )
|
||||
{
|
||||
point->flags |= PSH2_POINT_SMOOTH;
|
||||
}
|
||||
else if ( point->dir_in != PSH2_DIR_NONE ||
|
||||
point->dir_out != PSH2_DIR_NONE )
|
||||
{
|
||||
|
@ -911,6 +953,7 @@
|
|||
{
|
||||
FT_Angle angle_in, angle_out, diff;
|
||||
|
||||
|
||||
angle_in = FT_Atan2( dxi, dyi );
|
||||
angle_out = FT_Atan2( dxo, dyo );
|
||||
|
||||
|
@ -921,7 +964,7 @@
|
|||
if ( diff > FT_ANGLE_PI )
|
||||
diff = FT_ANGLE_2PI - diff;
|
||||
|
||||
if ( (diff < FT_ANGLE_PI/16) )
|
||||
if ( diff < FT_ANGLE_PI / 16 )
|
||||
point->flags |= PSH2_POINT_SMOOTH;
|
||||
}
|
||||
}
|
||||
|
@ -937,14 +980,16 @@
|
|||
&ps_hints->dimension[0].masks,
|
||||
&ps_hints->dimension[0].counters,
|
||||
memory );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
error = psh2_hint_table_init( &glyph->hint_tables [1],
|
||||
&ps_hints->dimension[1].hints,
|
||||
&ps_hints->dimension[1].masks,
|
||||
&ps_hints->dimension[1].counters,
|
||||
memory );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
Exit:
|
||||
return error;
|
||||
|
@ -960,6 +1005,7 @@
|
|||
PSH2_Point point = glyph->points;
|
||||
FT_UInt count = glyph->num_points;
|
||||
|
||||
|
||||
for ( ; count > 0; count--, point++, vec++ )
|
||||
{
|
||||
point->flags &= PSH2_POINT_OFF | PSH2_POINT_SMOOTH;
|
||||
|
@ -987,6 +1033,7 @@
|
|||
FT_Vector* vec = glyph->outline->points;
|
||||
char* tags = glyph->outline->tags;
|
||||
|
||||
|
||||
for ( n = 0; n < glyph->num_points; n++ )
|
||||
{
|
||||
if ( vertical )
|
||||
|
@ -1016,6 +1063,7 @@
|
|||
|
||||
#define PSH2_STRONG_THRESHOLD 10
|
||||
|
||||
|
||||
static void
|
||||
psh2_hint_table_find_strong_point( PSH2_Hint_Table table,
|
||||
PSH2_Point point,
|
||||
|
@ -1024,15 +1072,18 @@
|
|||
PSH2_Hint* sort = table->sort;
|
||||
FT_UInt num_hints = table->num_hints;
|
||||
|
||||
|
||||
for ( ; num_hints > 0; num_hints--, sort++ )
|
||||
{
|
||||
PSH2_Hint hint = sort[0];
|
||||
|
||||
|
||||
if ( ABS( point->dir_in ) == major_dir ||
|
||||
ABS( point->dir_out ) == major_dir )
|
||||
{
|
||||
FT_Pos d;
|
||||
|
||||
|
||||
d = point->org_u - hint->org_pos;
|
||||
if ( ABS( d ) < PSH2_STRONG_THRESHOLD )
|
||||
{
|
||||
|
@ -1061,7 +1112,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* find strong points in a glyph */
|
||||
static void
|
||||
psh2_glyph_find_strong_points( PSH2_Glyph glyph,
|
||||
|
@ -1076,6 +1126,7 @@
|
|||
FT_UInt first = 0;
|
||||
FT_Int major_dir = vertical ? PSH2_DIR_UP : PSH2_DIR_RIGHT;
|
||||
|
||||
|
||||
/* process secondary hints to "selected" points */
|
||||
if ( num_masks > 1 )
|
||||
{
|
||||
|
@ -1085,12 +1136,14 @@
|
|||
FT_UInt next;
|
||||
FT_Int count;
|
||||
|
||||
|
||||
next = mask->end_point;
|
||||
count = next - first;
|
||||
if ( count > 0 )
|
||||
{
|
||||
PSH2_Point point = glyph->points + first;
|
||||
|
||||
|
||||
psh2_hint_table_activate_mask( table, mask );
|
||||
|
||||
for ( ; count > 0; count--, point++ )
|
||||
|
@ -1106,6 +1159,7 @@
|
|||
FT_UInt count = glyph->num_points;
|
||||
PSH2_Point point = glyph->points;
|
||||
|
||||
|
||||
psh2_hint_table_activate_mask( table, table->hint_masks->masks );
|
||||
for ( ; count > 0; count--, point++ )
|
||||
{
|
||||
|
@ -1115,11 +1169,12 @@
|
|||
}
|
||||
|
||||
/* now, certain points may have been attached to hint and */
|
||||
/* not marked as strong, update their flags then.. */
|
||||
/* not marked as strong; update their flags then */
|
||||
{
|
||||
FT_UInt count = glyph->num_points;
|
||||
PSH2_Point point = glyph->points;
|
||||
|
||||
|
||||
for ( ; count > 0; count--, point++ )
|
||||
if ( point->hint && !psh2_point_is_strong( point ) )
|
||||
psh2_point_set_strong( point );
|
||||
|
@ -1128,7 +1183,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* interpolate strong points with the help of hinted coordinates */
|
||||
static void
|
||||
psh2_glyph_interpolate_strong_points( PSH2_Glyph glyph,
|
||||
|
@ -1137,18 +1191,22 @@
|
|||
PSH_Dimension dim = &glyph->globals->dimension[vertical];
|
||||
FT_Fixed scale = dim->scale_mult;
|
||||
|
||||
|
||||
{
|
||||
FT_UInt count = glyph->num_points;
|
||||
PSH2_Point point = glyph->points;
|
||||
|
||||
|
||||
for ( ; count > 0; count--, point++ )
|
||||
{
|
||||
PSH2_Hint hint = point->hint;
|
||||
|
||||
|
||||
if ( hint )
|
||||
{
|
||||
FT_Pos delta;
|
||||
|
||||
|
||||
delta = point->org_u - hint->org_pos;
|
||||
|
||||
if ( delta <= 0 )
|
||||
|
@ -1179,11 +1237,13 @@
|
|||
PSH_Dimension dim = &glyph->globals->dimension[vertical];
|
||||
FT_Fixed scale = dim->scale_mult;
|
||||
|
||||
|
||||
/* first technique: a point is strong if it is a local extrema */
|
||||
{
|
||||
FT_UInt count = glyph->num_points;
|
||||
PSH2_Point point = glyph->points;
|
||||
|
||||
|
||||
for ( ; count > 0; count--, point++ )
|
||||
{
|
||||
if ( psh2_point_is_strong( point ) )
|
||||
|
@ -1214,12 +1274,14 @@
|
|||
FT_Int count2 = glyph->num_points;
|
||||
PSH2_Point cur = glyph->points;
|
||||
|
||||
|
||||
for ( ; count2 > 0; count2--, cur++ )
|
||||
{
|
||||
if ( psh2_point_is_strong( cur ) )
|
||||
{
|
||||
FT_Pos diff = cur->org_u - u;;
|
||||
|
||||
|
||||
if ( diff <= 0 )
|
||||
{
|
||||
if ( diff > diff_before )
|
||||
|
@ -1244,15 +1306,15 @@
|
|||
if ( !after )
|
||||
continue;
|
||||
|
||||
/* we're before the first strong point coordinate */
|
||||
/* simply translate the point.. */
|
||||
/* we are before the first strong point coordinate; */
|
||||
/* simply translate the point */
|
||||
point->cur_u = after->cur_u +
|
||||
FT_MulFix( point->org_u - after->org_u, scale );
|
||||
}
|
||||
else if ( !after )
|
||||
{
|
||||
/* we're after the last strong point coordinate */
|
||||
/* simply translate the point.. */
|
||||
/* we are after the last strong point coordinate; */
|
||||
/* simply translate the point */
|
||||
point->cur_u = before->cur_u +
|
||||
FT_MulFix( point->org_u - before->org_u, scale );
|
||||
}
|
||||
|
@ -1279,7 +1341,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* interpolate other points */
|
||||
static void
|
||||
psh2_glyph_interpolate_other_points( PSH2_Glyph glyph,
|
||||
|
@ -1291,12 +1352,14 @@
|
|||
PSH2_Contour contour = glyph->contours;
|
||||
FT_UInt num_contours = glyph->num_contours;
|
||||
|
||||
|
||||
for ( ; num_contours > 0; num_contours--, contour++ )
|
||||
{
|
||||
PSH2_Point start = contour->start;
|
||||
PSH2_Point first, next, point;
|
||||
FT_UInt fit_count;
|
||||
|
||||
|
||||
/* count the number of strong points in this contour */
|
||||
next = start + contour->count;
|
||||
fit_count = 0;
|
||||
|
@ -1311,7 +1374,7 @@
|
|||
fit_count++;
|
||||
}
|
||||
|
||||
/* if there is less than 2 fitted points in the contour, we'll */
|
||||
/* if there are less than 2 fitted points in the contour, we */
|
||||
/* simply scale and eventually translate the contour points */
|
||||
if ( fit_count < 2 )
|
||||
{
|
||||
|
@ -1325,8 +1388,8 @@
|
|||
goto Next_Contour;
|
||||
}
|
||||
|
||||
/* there are more than 2 strong points in this contour, we'll */
|
||||
/* need to interpolate weak points between them.. */
|
||||
/* there are more than 2 strong points in this contour; we */
|
||||
/* need to interpolate weak points between them */
|
||||
start = first;
|
||||
do
|
||||
{
|
||||
|
@ -1359,6 +1422,7 @@
|
|||
FT_Pos org_c, org_ac, cur_c;
|
||||
FT_Fixed scale_ab;
|
||||
|
||||
|
||||
if ( first->org_u <= next->org_u )
|
||||
{
|
||||
org_a = first->org_u;
|
||||
|
@ -1403,27 +1467,28 @@
|
|||
point->cur_u = cur_c;
|
||||
|
||||
point = point->next;
|
||||
}
|
||||
while ( point != next );
|
||||
|
||||
} while ( point != next );
|
||||
}
|
||||
|
||||
/* keep going until all points in the contours have been processed */
|
||||
first = next;
|
||||
}
|
||||
while ( first != start );
|
||||
|
||||
} while ( first != start );
|
||||
|
||||
Next_Contour:
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** HIGH-LEVEL INTERFACE *****/
|
||||
/***** *****/
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
FT_Error
|
||||
ps2_hints_apply( PS_Hints ps_hints,
|
||||
|
@ -1436,11 +1501,11 @@
|
|||
FT_Memory memory;
|
||||
FT_Int dimension;
|
||||
|
||||
memory = globals->memory;
|
||||
|
||||
FT_UNUSED(glyphrec);
|
||||
|
||||
|
||||
memory = globals->memory;
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
if ( ps2_debug_glyph )
|
||||
{
|
||||
|
@ -1457,7 +1522,8 @@
|
|||
#endif
|
||||
|
||||
error = psh2_glyph_init( glyph, outline, ps_hints, globals );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
for ( dimension = 1; dimension >= 0; dimension-- )
|
||||
{
|
||||
|
@ -1485,3 +1551,6 @@
|
|||
#endif
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/* */
|
||||
/* pshalgo2.h */
|
||||
/* */
|
||||
/* First (basic) Postscript hinting routines */
|
||||
/* PostScript hinting algorithm 2 (specification). */
|
||||
/* */
|
||||
/* Copyright 2001 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
|
@ -15,15 +15,19 @@
|
|||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
#ifndef __PS_HINTER_ALGO2_H__
|
||||
#define __PS_HINTER_ALGO2_H__
|
||||
|
||||
#ifndef __PSHALGO2_H__
|
||||
#define __PSHALGO2_H__
|
||||
|
||||
|
||||
#include "pshrec.h"
|
||||
#include "pshglob.h"
|
||||
#include FT_TRIGONOMETRY_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef struct PSH2_HintRec_* PSH2_Hint;
|
||||
|
||||
typedef enum
|
||||
|
@ -32,8 +36,10 @@ FT_BEGIN_HEADER
|
|||
PSH2_HINT_BOTTOM = PS_HINT_FLAG_BOTTOM,
|
||||
PSH2_HINT_ACTIVE = 4,
|
||||
PSH2_HINT_FITTED = 8
|
||||
|
||||
} PSH2_Hint_Flags;
|
||||
|
||||
|
||||
#define psh2_hint_is_active( x ) ( ( (x)->flags & PSH2_HINT_ACTIVE ) != 0 )
|
||||
#define psh2_hint_is_ghost( x ) ( ( (x)->flags & PSH2_HINT_GHOST ) != 0 )
|
||||
#define psh2_hint_is_fitted( x ) ( ( (x)->flags & PSH2_HINT_FITTED ) != 0 )
|
||||
|
@ -42,6 +48,7 @@ FT_BEGIN_HEADER
|
|||
#define psh2_hint_deactivate( x ) (x)->flags &= ~PSH2_HINT_ACTIVE
|
||||
#define psh2_hint_set_fitted( x ) (x)->flags |= PSH2_HINT_FITTED
|
||||
|
||||
|
||||
typedef struct PSH2_HintRec_
|
||||
{
|
||||
FT_Int org_pos;
|
||||
|
@ -55,9 +62,9 @@ FT_BEGIN_HEADER
|
|||
} PSH2_HintRec;
|
||||
|
||||
|
||||
/* this is an interpolation zone used for strong points */
|
||||
/* this is an interpolation zone used for strong points; */
|
||||
/* weak points are interpolated according to their strong */
|
||||
/* neighbours.. */
|
||||
/* neighbours */
|
||||
typedef struct PSH2_ZoneRec_
|
||||
{
|
||||
FT_Fixed scale;
|
||||
|
@ -138,6 +145,7 @@ FT_BEGIN_HEADER
|
|||
#define psh2_point_set_fitted( p ) (p)->flags |= PSH2_POINT_FITTED
|
||||
#define psh2_point_set_smooth( p ) (p)->flags |= PSH2_POINT_SMOOTH
|
||||
|
||||
|
||||
typedef struct PSH2_ContourRec_
|
||||
{
|
||||
PSH2_Point start;
|
||||
|
@ -146,7 +154,6 @@ FT_BEGIN_HEADER
|
|||
} PSH2_ContourRec;
|
||||
|
||||
|
||||
|
||||
typedef struct PSH2_GlyphRec_
|
||||
{
|
||||
FT_UInt num_points;
|
||||
|
@ -170,7 +177,10 @@ FT_BEGIN_HEADER
|
|||
#ifdef DEBUG_HINTER
|
||||
extern PSH2_Hint_Table ps2_debug_hint_table;
|
||||
|
||||
typedef void (*PSH2_HintFunc)( PSH2_Hint hint, FT_Bool vertical );
|
||||
typedef void
|
||||
(*PSH2_HintFunc)( PSH2_Hint hint,
|
||||
FT_Bool vertical );
|
||||
|
||||
extern PSH2_HintFunc ps2_debug_hint_func;
|
||||
|
||||
extern PSH2_Glyph ps2_debug_glyph;
|
||||
|
@ -182,6 +192,11 @@ FT_BEGIN_HEADER
|
|||
FT_Outline* outline,
|
||||
PSH_Globals globals );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __PS_HINTS_ALGO_2_H__ */
|
||||
|
||||
#endif /* __PSHALGO2_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshglob.c */
|
||||
/* */
|
||||
/* PostScript hinter global hinting management (body). */
|
||||
/* Inspired by the new auto-hinter module. */
|
||||
/* */
|
||||
/* Copyright 2001 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
@ -7,7 +26,6 @@
|
|||
extern PSH_Globals ps_debug_globals = 0;
|
||||
#endif
|
||||
|
||||
/* "simple" ps hinter globals management, inspired from the new auto-hinter */
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
@ -29,6 +47,7 @@
|
|||
PSH_Width width = std->widths;
|
||||
FT_Fixed scale = dim->scale_mult;
|
||||
|
||||
|
||||
for ( ; count > 0; count--, width++ )
|
||||
{
|
||||
width->cur = FT_MulFix( width->org, scale );
|
||||
|
@ -37,7 +56,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* org_width is is font units, result in device pixels, 26.6 format */
|
||||
FT_LOCAL_DEF FT_Pos
|
||||
psh_dimension_snap_width( PSH_Dimension dimension,
|
||||
|
@ -48,11 +66,13 @@
|
|||
FT_Pos best = 64 + 32 + 2;
|
||||
FT_Pos reference = width;
|
||||
|
||||
|
||||
for ( n = 0; n < dimension->std.count; n++ )
|
||||
{
|
||||
FT_Pos w;
|
||||
FT_Pos dist;
|
||||
|
||||
|
||||
w = dimension->std.widths[n].cur;
|
||||
dist = width - w;
|
||||
if ( dist < 0 )
|
||||
|
@ -103,6 +123,7 @@
|
|||
|
||||
FT_UNUSED( target );
|
||||
|
||||
|
||||
for ( ; read_count > 0; read_count -= 2 )
|
||||
{
|
||||
FT_Int reference, delta;
|
||||
|
@ -110,6 +131,7 @@
|
|||
PSH_Blue_Zone zones, zone;
|
||||
FT_Bool top;
|
||||
|
||||
|
||||
/* read blue zone entry, and select target top/bottom zone */
|
||||
top = 0;
|
||||
if ( first || is_others )
|
||||
|
@ -142,8 +164,9 @@
|
|||
{
|
||||
FT_Int delta0 = zone->org_delta;
|
||||
|
||||
/* we have two zones on the same reference position */
|
||||
/* only keep the largest one.. */
|
||||
|
||||
/* we have two zones on the same reference position -- */
|
||||
/* only keep the largest one */
|
||||
if ( delta < 0 )
|
||||
{
|
||||
if ( delta < delta0 )
|
||||
|
@ -178,9 +201,9 @@
|
|||
}
|
||||
|
||||
|
||||
/* re-read blue zones from the original fonts, and store them into out */
|
||||
/* private structure. This function re-orders, sanitizes and fuzz-expands */
|
||||
/* the zones as well.. */
|
||||
/* Re-read blue zones from the original fonts and store them into out */
|
||||
/* private structure. This function re-orders, sanitizes and */
|
||||
/* fuzz-expands the zones as well. */
|
||||
static void
|
||||
psh_blues_set_zones( PSH_Blues target,
|
||||
FT_UInt count,
|
||||
|
@ -193,6 +216,7 @@
|
|||
PSH_Blue_Table top_table, bot_table;
|
||||
FT_Int count_top, count_bot;
|
||||
|
||||
|
||||
if ( family )
|
||||
{
|
||||
top_table = &target->family_top;
|
||||
|
@ -205,13 +229,15 @@
|
|||
}
|
||||
|
||||
/* read the input blue zones, and build two sorted tables */
|
||||
/* (one for the top zones, the other for the bottom zones */
|
||||
/* (one for the top zones, the other for the bottom zones) */
|
||||
top_table->count = 0;
|
||||
bot_table->count = 0;
|
||||
|
||||
/* first, the blues */
|
||||
psh_blues_set_zones_0( target, 0, count, blues, top_table, bot_table );
|
||||
psh_blues_set_zones_0( target, 1, count_others, other_blues, top_table, bot_table );
|
||||
psh_blues_set_zones_0( target, 0,
|
||||
count, blues, top_table, bot_table );
|
||||
psh_blues_set_zones_0( target, 1,
|
||||
count_others, other_blues, top_table, bot_table );
|
||||
|
||||
count_top = top_table->count;
|
||||
count_bot = bot_table->count;
|
||||
|
@ -221,10 +247,12 @@
|
|||
{
|
||||
PSH_Blue_Zone zone = top_table->zones;
|
||||
|
||||
|
||||
for ( count = count_top; count > 0; count--, zone++ )
|
||||
{
|
||||
FT_Int delta;
|
||||
|
||||
|
||||
if ( count > 1 )
|
||||
{
|
||||
delta = zone[1].org_ref - zone[0].org_ref;
|
||||
|
@ -242,10 +270,12 @@
|
|||
{
|
||||
PSH_Blue_Zone zone = bot_table->zones;
|
||||
|
||||
|
||||
for ( count = count_bot; count > 0; count--, zone++ )
|
||||
{
|
||||
FT_Int delta;
|
||||
|
||||
|
||||
if ( count > 1 )
|
||||
{
|
||||
delta = zone[0].org_ref - zone[1].org_ref;
|
||||
|
@ -263,6 +293,7 @@
|
|||
FT_Int dim, top, bot, delta;
|
||||
PSH_Blue_Zone zone;
|
||||
|
||||
|
||||
zone = top_table->zones;
|
||||
count = count_top;
|
||||
|
||||
|
@ -273,7 +304,7 @@
|
|||
/* expand the bottom of the lowest zone normally */
|
||||
zone->org_bottom -= fuzz;
|
||||
|
||||
/* expand the top and bottom of intermediate zones */
|
||||
/* expand the top and bottom of intermediate zones; */
|
||||
/* checking that the interval is smaller than the fuzz */
|
||||
top = zone->org_top;
|
||||
|
||||
|
@ -281,10 +312,9 @@
|
|||
{
|
||||
bot = zone[1].org_bottom;
|
||||
delta = bot - top;
|
||||
|
||||
if ( delta < 2 * fuzz )
|
||||
{
|
||||
zone[0].org_top = zone[1].org_bottom = top + delta / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
zone[0].org_top = top + fuzz;
|
||||
|
@ -305,7 +335,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* reset the blues table when the device transform changes */
|
||||
static void
|
||||
psh_blues_scale_zones( PSH_Blues blues,
|
||||
|
@ -316,16 +345,26 @@
|
|||
FT_UInt num;
|
||||
PSH_Blue_Table table = 0;
|
||||
|
||||
|
||||
for ( num = 0; num < 4; num++ )
|
||||
{
|
||||
PSH_Blue_Zone zone;
|
||||
|
||||
|
||||
switch ( num )
|
||||
{
|
||||
case 0: table = &blues->normal_top; break;
|
||||
case 1: table = &blues->normal_bottom; break;
|
||||
case 2: table = &blues->family_top; break;
|
||||
default: table = &blues->family_bottom;
|
||||
case 0:
|
||||
table = &blues->normal_top;
|
||||
break;
|
||||
case 1:
|
||||
table = &blues->normal_bottom;
|
||||
break;
|
||||
case 2:
|
||||
table = &blues->family_top;
|
||||
break;
|
||||
default:
|
||||
table = &blues->family_bottom;
|
||||
break;
|
||||
}
|
||||
|
||||
zone = table->zones;
|
||||
|
@ -349,7 +388,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
/* XXX: we should process the family / normal tables here !! */
|
||||
/* XXX: we should process the family / normal tables here! */
|
||||
}
|
||||
|
||||
|
||||
|
@ -363,12 +402,14 @@
|
|||
FT_UInt count;
|
||||
PSH_Blue_Zone zone;
|
||||
|
||||
|
||||
alignment->align = 0;
|
||||
|
||||
/* lookup stem top in top zones table */
|
||||
table = &blues->normal_top;
|
||||
count = table->count;
|
||||
zone = table->zones;
|
||||
|
||||
for ( ; count > 0; count--, zone++ )
|
||||
{
|
||||
if ( stem_top < zone->org_bottom )
|
||||
|
@ -386,6 +427,7 @@
|
|||
table = &blues->normal_bottom;
|
||||
count = table->count;
|
||||
zone = table->zones;
|
||||
|
||||
for ( ; count > 0; count--, zone++ )
|
||||
{
|
||||
if ( stem_bot < zone->org_bottom )
|
||||
|
@ -416,6 +458,7 @@
|
|||
{
|
||||
FT_Memory memory;
|
||||
|
||||
|
||||
memory = globals->memory;
|
||||
globals->dimension[0].std.count = 0;
|
||||
globals->dimension[1].std.count = 0;
|
||||
|
@ -442,11 +485,13 @@
|
|||
PSH_Globals globals;
|
||||
FT_Error error;
|
||||
|
||||
|
||||
if ( !ALLOC( globals, sizeof ( *globals ) ) )
|
||||
{
|
||||
FT_UInt count;
|
||||
FT_Short* read;
|
||||
|
||||
|
||||
globals->memory = memory;
|
||||
|
||||
/* copy standard widths */
|
||||
|
@ -454,6 +499,7 @@
|
|||
PSH_Dimension dim = &globals->dimension[1];
|
||||
PSH_Width write = dim->std.widths;
|
||||
|
||||
|
||||
write->org = priv->standard_width[1];
|
||||
write++;
|
||||
|
||||
|
@ -473,6 +519,7 @@
|
|||
PSH_Dimension dim = &globals->dimension[0];
|
||||
PSH_Width write = dim->std.widths;
|
||||
|
||||
|
||||
write->org = priv->standard_height[1];
|
||||
write++;
|
||||
|
||||
|
@ -511,7 +558,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
static FT_Error
|
||||
psh_globals_set_scale( PSH_Globals globals,
|
||||
FT_Fixed x_scale,
|
||||
|
@ -521,6 +567,7 @@
|
|||
{
|
||||
PSH_Dimension dim = &globals->dimension[0];
|
||||
|
||||
|
||||
dim = &globals->dimension[0];
|
||||
if ( x_scale != dim->scale_mult ||
|
||||
x_delta != dim->scale_delta )
|
||||
|
@ -553,3 +600,6 @@
|
|||
funcs->set_scale = psh_globals_set_scale;
|
||||
funcs->destroy = psh_globals_destroy;
|
||||
}
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/* */
|
||||
/* pshglob.h */
|
||||
/* */
|
||||
/* Postscript hinter globals hints management. */
|
||||
/* PostScript hinter global hinting management. */
|
||||
/* */
|
||||
/* Copyright 2001 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
|
@ -15,41 +15,49 @@
|
|||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
#ifndef __PS_HINTER_GLOBALS_H__
|
||||
#define __PS_HINTER_GLOBALS_H__
|
||||
|
||||
#ifndef __PSHGLOB_H__
|
||||
#define __PSHGLOB_H__
|
||||
|
||||
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_INTERNAL_POSTSCRIPT_GLOBALS_H
|
||||
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** GLOBAL HINTS INTERNALS *****/
|
||||
/***** *****/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @constant: PS_GLOBALS_MAX_BLUE_ZONES
|
||||
*
|
||||
* @description:
|
||||
* the maximum number of blue zones in a font global hints
|
||||
* structure. See @PS_Globals_BluesRec
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @constant: */
|
||||
/* PS_GLOBALS_MAX_BLUE_ZONES */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The maximum number of blue zones in a font global hints structure. */
|
||||
/* See @PS_Globals_BluesRec. */
|
||||
/* */
|
||||
#define PS_GLOBALS_MAX_BLUE_ZONES 16
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @constant: PS_GLOBALS_MAX_STD_WIDTHS
|
||||
*
|
||||
* @description:
|
||||
* the maximum number of standard and snap widths in either the
|
||||
* horizontal or vertical direction. See @PS_Globals_WidthsRec
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @constant: */
|
||||
/* PS_GLOBALS_MAX_STD_WIDTHS */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The maximum number of standard and snap widths in either the */
|
||||
/* horizontal or vertical direction. See @PS_Globals_WidthsRec. */
|
||||
/* */
|
||||
#define PS_GLOBALS_MAX_STD_WIDTHS 16
|
||||
|
||||
|
||||
|
@ -81,7 +89,6 @@ FT_BEGIN_HEADER
|
|||
} PSH_DimensionRec, *PSH_Dimension;
|
||||
|
||||
|
||||
|
||||
/* blue zone descriptor */
|
||||
typedef struct PSH_Blue_ZoneRec_
|
||||
{
|
||||
|
@ -136,7 +143,7 @@ FT_BEGIN_HEADER
|
|||
} PSH_Blue_Align;
|
||||
|
||||
|
||||
typedef struct
|
||||
typedef struct PSH_AlignmentRec_
|
||||
{
|
||||
PSH_Blue_Align align;
|
||||
FT_Pos align_top;
|
||||
|
@ -149,8 +156,8 @@ FT_BEGIN_HEADER
|
|||
psh_globals_funcs_init( PSH_Globals_FuncsRec* funcs );
|
||||
|
||||
|
||||
/* snap a stem width to fitter coordinates. org_width is in font units */
|
||||
/* result is in device pixels (26.6 format).. */
|
||||
/* snap a stem width to fitter coordinates. `org_width' is in font */
|
||||
/* units. The result is in device pixels (26.6 format). */
|
||||
FT_LOCAL FT_Pos
|
||||
psh_dimension_snap_width( PSH_Dimension dimension,
|
||||
FT_Int org_width );
|
||||
|
@ -167,6 +174,11 @@ FT_BEGIN_HEADER
|
|||
extern PSH_Globals ps_debug_globals;
|
||||
#endif
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __T1_FITTER_GLOBALS_H__ */
|
||||
|
||||
#endif /* __PSHGLOB_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
/* */
|
||||
/* pshinter.c */
|
||||
/* */
|
||||
/* FreeType Postscript Hinting module */
|
||||
/* FreeType PostScript Hinting module */
|
||||
/* */
|
||||
/* Copyright 1996-2000 by */
|
||||
/* Copyright 2001 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
/* */
|
||||
/* pshmod.c */
|
||||
/* */
|
||||
/* FreeType Postscript hinter module implementation (body). */
|
||||
/* FreeType PostScript hinter module implementation (body). */
|
||||
/* */
|
||||
/* Copyright 2000 by */
|
||||
/* Copyright 2001 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -15,13 +15,15 @@
|
|||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include "pshrec.h"
|
||||
#include "pshalgo.h"
|
||||
|
||||
|
||||
/* the Postscript Hinter module structure */
|
||||
typedef struct
|
||||
typedef struct PS_Hinter_Module_Rec_
|
||||
{
|
||||
FT_ModuleRec root;
|
||||
PS_HintsRec ps_hints;
|
||||
|
@ -44,12 +46,13 @@
|
|||
}
|
||||
|
||||
|
||||
/* initialise module, create hints recorder and the interface */
|
||||
/* initialize module, create hints recorder and the interface */
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
ps_hinter_init( PS_Hinter_Module module )
|
||||
{
|
||||
FT_Memory memory = module->root.memory;
|
||||
|
||||
|
||||
ps_hints_init( &module->ps_hints, memory );
|
||||
|
||||
psh_globals_funcs_init( &module->globals_funcs );
|
||||
|
@ -112,3 +115,6 @@
|
|||
(FT_Module_Destructor) ps_hinter_done,
|
||||
(FT_Module_Requester) 0 /* no additional interface for now */
|
||||
};
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
/* */
|
||||
/* pshmod.h */
|
||||
/* */
|
||||
/* Postscript hinter module interface */
|
||||
/* PostScript hinter module interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2000 by */
|
||||
/* Copyright 2001 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -15,8 +15,9 @@
|
|||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
#ifndef __PS_HINTER_MODULE_H__
|
||||
#define __PS_HINTER_MODULE_H__
|
||||
|
||||
#ifndef __PSHMOD_H__
|
||||
#define __PSHMOD_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
|
@ -31,7 +32,8 @@ FT_BEGIN_HEADER
|
|||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __PS_HINTER_MODULE_H__ */
|
||||
|
||||
#endif /* __PSHMOD_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshrec.c */
|
||||
/* */
|
||||
/* FreeType PostScript hints recorder (body). */
|
||||
/* */
|
||||
/* Copyright 2001 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
@ -13,13 +31,13 @@
|
|||
#endif
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
/***********************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** PS_HINT MANAGEMENT *****/
|
||||
/***** *****/
|
||||
/***********************************************************************/
|
||||
/***********************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* destroy hints table */
|
||||
static void
|
||||
|
@ -42,6 +60,7 @@
|
|||
FT_UInt new_max = count;
|
||||
FT_Error error = 0;
|
||||
|
||||
|
||||
if ( new_max > old_max )
|
||||
{
|
||||
/* try to grow the table */
|
||||
|
@ -62,13 +81,15 @@
|
|||
FT_UInt count;
|
||||
PS_Hint hint = 0;
|
||||
|
||||
|
||||
count = table->num_hints;
|
||||
count++;
|
||||
|
||||
if ( count >= table->max_hints )
|
||||
{
|
||||
error = ps_hint_table_ensure( table, count, memory );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
hint = table->hints + count - 1;
|
||||
|
@ -84,13 +105,13 @@
|
|||
}
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
/***********************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** PS_MASK MANAGEMENT *****/
|
||||
/***** *****/
|
||||
/***********************************************************************/
|
||||
/***********************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* destroy mask */
|
||||
static void
|
||||
|
@ -114,6 +135,7 @@
|
|||
FT_UInt new_max = ( count + 7 ) >> 3;
|
||||
FT_Error error = 0;
|
||||
|
||||
|
||||
if ( new_max > old_max )
|
||||
{
|
||||
new_max = ( new_max + 7 ) & -8;
|
||||
|
@ -124,7 +146,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* test a bit value in a given mask */
|
||||
static FT_Int
|
||||
ps_mask_test_bit( PS_Mask mask,
|
||||
|
@ -144,6 +165,7 @@
|
|||
{
|
||||
FT_Byte* p;
|
||||
|
||||
|
||||
if ( (FT_UInt)index >= mask->num_bits )
|
||||
return;
|
||||
|
||||
|
@ -152,7 +174,7 @@
|
|||
}
|
||||
|
||||
|
||||
/* set a given bit, eventually grow the mask */
|
||||
/* set a given bit, possibly grow the mask */
|
||||
static FT_Error
|
||||
ps_mask_set_bit( PS_Mask mask,
|
||||
FT_Int index,
|
||||
|
@ -161,13 +183,15 @@
|
|||
FT_Error error = 0;
|
||||
FT_Byte* p;
|
||||
|
||||
|
||||
if ( index < 0 )
|
||||
goto Exit;
|
||||
|
||||
if ( (FT_UInt)index >= mask->num_bits )
|
||||
{
|
||||
error = ps_mask_ensure( mask, index + 1, memory );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
mask->num_bits = index + 1;
|
||||
}
|
||||
|
@ -188,6 +212,7 @@
|
|||
FT_UInt count = table->max_masks;
|
||||
PS_Mask mask = table->masks;
|
||||
|
||||
|
||||
for ( ; count > 0; count--, mask++ )
|
||||
ps_mask_done( mask, memory );
|
||||
|
||||
|
@ -207,6 +232,7 @@
|
|||
FT_UInt new_max = count;
|
||||
FT_Error error = 0;
|
||||
|
||||
|
||||
if ( new_max > old_max )
|
||||
{
|
||||
new_max = ( new_max + 7 ) & -8;
|
||||
|
@ -227,13 +253,15 @@
|
|||
FT_Error error = 0;
|
||||
PS_Mask mask = 0;
|
||||
|
||||
|
||||
count = table->num_masks;
|
||||
count++;
|
||||
|
||||
if ( count > table->max_masks )
|
||||
{
|
||||
error = ps_mask_table_ensure( table, count, memory );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
mask = table->masks + count - 1;
|
||||
|
@ -257,11 +285,13 @@
|
|||
FT_UInt count;
|
||||
PS_Mask mask;
|
||||
|
||||
|
||||
count = table->num_masks;
|
||||
if ( count == 0 )
|
||||
{
|
||||
error = ps_mask_table_alloc( table, memory, &mask );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
}
|
||||
else
|
||||
mask = table->masks + count - 1;
|
||||
|
@ -283,12 +313,15 @@
|
|||
FT_Error error = 0;
|
||||
PS_Mask mask;
|
||||
|
||||
|
||||
/* allocate new mask, and grow it to "bit_count" bits */
|
||||
error = ps_mask_table_alloc( table, memory, &mask );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
error = ps_mask_ensure( mask, bit_count, memory );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
mask->num_bits = bit_count;
|
||||
|
||||
|
@ -300,6 +333,7 @@
|
|||
FT_Int wmask = 0x80;
|
||||
FT_Int val;
|
||||
|
||||
|
||||
for ( ; bit_count > 0; bit_count-- )
|
||||
{
|
||||
val = write[0] & ~wmask;
|
||||
|
@ -330,7 +364,7 @@
|
|||
}
|
||||
|
||||
|
||||
/* test wether two masks in a table intersect */
|
||||
/* test whether two masks in a table intersect */
|
||||
static FT_Int
|
||||
ps_mask_table_test_intersect( PS_Mask_Table table,
|
||||
FT_Int index1,
|
||||
|
@ -344,6 +378,7 @@
|
|||
FT_UInt count2 = mask2->num_bits;
|
||||
FT_UInt count;
|
||||
|
||||
|
||||
count = ( count1 <= count2 ) ? count1 : count2;
|
||||
for ( ; count >= 8; count -= 8 )
|
||||
{
|
||||
|
@ -371,6 +406,7 @@
|
|||
FT_UInt temp;
|
||||
FT_Error error = 0;
|
||||
|
||||
|
||||
/* swap index1 and index2 so that index1 < index2 */
|
||||
if ( index1 > index2 )
|
||||
{
|
||||
|
@ -382,34 +418,38 @@
|
|||
if ( index1 < index2 && index1 >= 0 && index2 < (FT_Int)table->num_masks )
|
||||
{
|
||||
/* we need to merge the bitsets of index1 and index2 with a */
|
||||
/* simple union.. */
|
||||
/* simple union */
|
||||
PS_Mask mask1 = table->masks + index1;
|
||||
PS_Mask mask2 = table->masks + index2;
|
||||
FT_UInt count1 = mask1->num_bits;
|
||||
FT_UInt count2 = mask2->num_bits;
|
||||
FT_Int delta;
|
||||
|
||||
|
||||
if ( count2 > 0 )
|
||||
{
|
||||
FT_UInt pos;
|
||||
FT_Byte* read;
|
||||
FT_Byte* write;
|
||||
|
||||
|
||||
/* if "count2" is greater than "count1", we need to grow the */
|
||||
/* first bitset, and clear the highest bits.. */
|
||||
/* first bitset, and clear the highest bits */
|
||||
if ( count2 > count1 )
|
||||
{
|
||||
error = ps_mask_ensure( mask1, count2, memory );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
for ( pos = count1; pos < count2; pos++ )
|
||||
ps_mask_clear_bit( mask1, pos );
|
||||
}
|
||||
|
||||
/* merge (union) the bitsets */
|
||||
/* merge (unite) the bitsets */
|
||||
read = mask2->bytes;
|
||||
write = mask1->bytes;
|
||||
pos = (FT_UInt)( ( count2 + 7 ) >> 3 );
|
||||
|
||||
for ( ; pos > 0; pos-- )
|
||||
{
|
||||
write[0] = (FT_Byte)( write[0] | read[0] );
|
||||
|
@ -418,8 +458,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
/* now, remove "mask2" from the list, we need to keep the masks */
|
||||
/* sorted in order of importance, so move table elements.. */
|
||||
/* Now, remove "mask2" from the list. We need to keep the masks */
|
||||
/* sorted in order of importance, so move table elements. */
|
||||
mask2->num_bits = 0;
|
||||
mask2->end_point = 0;
|
||||
|
||||
|
@ -429,6 +469,7 @@
|
|||
/* move to end of table for reuse */
|
||||
PS_MaskRec dummy = *mask2;
|
||||
|
||||
|
||||
memmove( mask2, mask2 + 1, delta * sizeof ( PS_MaskRec ) );
|
||||
|
||||
mask2[delta] = dummy;
|
||||
|
@ -439,12 +480,14 @@
|
|||
else
|
||||
FT_ERROR(( "%s: ignoring invalid indices (%d,%d)\n",
|
||||
index1, index2 ));
|
||||
|
||||
Exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
/* try to merge all masks in a given table, this is used to merge */
|
||||
/* all counter masks into independent counter "paths" */
|
||||
|
||||
/* Try to merge all masks in a given table. This is used to merge */
|
||||
/* all counter masks into independent counter "paths". */
|
||||
/* */
|
||||
static FT_Error
|
||||
ps_mask_table_merge_all( PS_Mask_Table table,
|
||||
|
@ -453,6 +496,7 @@
|
|||
FT_Int index1, index2;
|
||||
FT_Error error = 0;
|
||||
|
||||
|
||||
for ( index1 = table->num_masks - 1; index1 > 0; index1-- )
|
||||
{
|
||||
for ( index2 = index1 - 1; index2 >= 0; index2-- )
|
||||
|
@ -460,24 +504,26 @@
|
|||
if ( ps_mask_table_test_intersect( table, index1, index2 ) )
|
||||
{
|
||||
error = ps_mask_table_merge( table, index2, index1, memory );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
/***********************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** PS_DIMENSION MANAGEMENT *****/
|
||||
/***** *****/
|
||||
/***********************************************************************/
|
||||
/***********************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* finalize a given dimension */
|
||||
|
@ -491,7 +537,7 @@
|
|||
}
|
||||
|
||||
|
||||
/* initialise a given dimension */
|
||||
/* initialize a given dimension */
|
||||
static void
|
||||
ps_dimension_init( PS_Dimension dimension )
|
||||
{
|
||||
|
@ -502,6 +548,7 @@
|
|||
|
||||
|
||||
#if 0
|
||||
|
||||
/* set a bit at a given index in the current hint mask */
|
||||
static FT_Error
|
||||
ps_dimension_set_mask_bit( PS_Dimension dim,
|
||||
|
@ -511,15 +558,18 @@
|
|||
PS_Mask mask;
|
||||
FT_Error error = 0;
|
||||
|
||||
|
||||
/* get last hint mask */
|
||||
error = ps_mask_table_last( &dim->masks, memory, &mask );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
error = ps_mask_set_bit( mask, index, memory );
|
||||
|
||||
Exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* set the end point in a mask, called from "End" & "Reset" methods */
|
||||
|
@ -530,6 +580,7 @@
|
|||
FT_UInt count = dim->masks.num_masks;
|
||||
PS_Mask mask;
|
||||
|
||||
|
||||
if ( count > 0 )
|
||||
{
|
||||
mask = dim->masks.masks + count - 1;
|
||||
|
@ -547,6 +598,7 @@
|
|||
{
|
||||
PS_Mask mask;
|
||||
|
||||
|
||||
/* end current mask */
|
||||
ps_dimension_end_mask( dim, end_point );
|
||||
|
||||
|
@ -566,19 +618,21 @@
|
|||
{
|
||||
FT_Error error = 0;
|
||||
|
||||
|
||||
/* reset current mask, if any */
|
||||
error = ps_dimension_reset_mask( dim, end_point, memory );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
/* set bits in new mask */
|
||||
error = ps_mask_table_set_bits( &dim->masks, (FT_Byte*)source,
|
||||
source_pos, source_bits, memory );
|
||||
|
||||
Exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* add a new single stem (called from "T1Stem" method) */
|
||||
static FT_Error
|
||||
ps_dimension_add_t1stem( PS_Dimension dim,
|
||||
|
@ -590,6 +644,7 @@
|
|||
FT_Error error = 0;
|
||||
FT_UInt flags = 0;
|
||||
|
||||
|
||||
/* detect ghost stem */
|
||||
if ( len < 0 )
|
||||
{
|
||||
|
@ -612,6 +667,7 @@
|
|||
FT_UInt max = dim->hints.num_hints;
|
||||
PS_Hint hint = dim->hints.hints;
|
||||
|
||||
|
||||
for ( index = 0; index < max; index++, hint++ )
|
||||
{
|
||||
if ( hint->pos == pos && hint->len == len )
|
||||
|
@ -622,7 +678,8 @@
|
|||
if ( index >= max )
|
||||
{
|
||||
error = ps_hint_table_alloc( &dim->hints, memory, &hint );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
hint->pos = pos;
|
||||
hint->len = len;
|
||||
|
@ -631,14 +688,17 @@
|
|||
|
||||
/* now, store the hint in the current mask */
|
||||
error = ps_mask_table_last( &dim->masks, memory, &mask );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
error = ps_mask_set_bit( mask, index, memory );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
if ( aindex )
|
||||
*aindex = (FT_Int)index;
|
||||
}
|
||||
|
||||
Exit:
|
||||
return error;
|
||||
}
|
||||
|
@ -656,8 +716,9 @@
|
|||
FT_UInt count = dim->counters.num_masks;
|
||||
PS_Mask counter = dim->counters.masks;
|
||||
|
||||
|
||||
/* try to find an existing counter mask that already uses */
|
||||
/* one of these stems here.. */
|
||||
/* one of these stems here */
|
||||
for ( ; count > 0; count--, counter++ )
|
||||
{
|
||||
if ( ps_mask_test_bit( counter, hint1 ) ||
|
||||
|
@ -670,18 +731,22 @@
|
|||
if ( count == 0 )
|
||||
{
|
||||
error = ps_mask_table_alloc( &dim->counters, memory, &counter );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
/* now, set the bits for our hints in the counter mask */
|
||||
error = ps_mask_set_bit( counter, hint1, memory );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
error = ps_mask_set_bit( counter, hint2, memory );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
error = ps_mask_set_bit( counter, hint3, memory );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
Exit:
|
||||
return error;
|
||||
|
@ -701,14 +766,14 @@
|
|||
return ps_mask_table_merge_all( &dim->counters, memory );
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
/***********************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** PS_RECORDER MANAGEMENT *****/
|
||||
/***** *****/
|
||||
/***********************************************************************/
|
||||
/***********************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* destroy hints */
|
||||
|
@ -717,6 +782,7 @@
|
|||
{
|
||||
FT_Memory memory = hints->memory;
|
||||
|
||||
|
||||
ps_dimension_done( &hints->dimension[0], memory );
|
||||
ps_dimension_done( &hints->dimension[1], memory );
|
||||
|
||||
|
@ -724,6 +790,7 @@
|
|||
hints->memory = 0;
|
||||
}
|
||||
|
||||
|
||||
FT_LOCAL FT_Error
|
||||
ps_hints_init( PS_Hints hints,
|
||||
FT_Memory memory )
|
||||
|
@ -733,7 +800,8 @@
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* initialise a hints for a new session */
|
||||
|
||||
/* initialize a hints for a new session */
|
||||
static void
|
||||
ps_hints_open( PS_Hints hints,
|
||||
PS_Hint_Type hint_type )
|
||||
|
@ -742,25 +810,23 @@
|
|||
{
|
||||
case PS_HINT_TYPE_1:
|
||||
case PS_HINT_TYPE_2:
|
||||
{
|
||||
hints->error = 0;
|
||||
hints->hint_type = hint_type;
|
||||
|
||||
ps_dimension_init( &hints->dimension[0] );
|
||||
ps_dimension_init( &hints->dimension[1] );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
hints->error = FT_Err_Invalid_Argument;
|
||||
hints->hint_type = hint_type;
|
||||
|
||||
FT_ERROR(( "%s.init: invalid charstring type !!\n", "t1fitter.hints" ));
|
||||
FT_ERROR(( "%s.init: invalid charstring type!\n", "pshrec.hints" ));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* add one or more stems to the current hints table */
|
||||
static void
|
||||
ps_hints_stem( PS_Hints hints,
|
||||
|
@ -786,29 +852,31 @@
|
|||
{
|
||||
PS_Dimension dim = &hints->dimension[dimension];
|
||||
|
||||
|
||||
for ( ; count > 0; count--, stems += 2 )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_Memory memory = hints->memory;
|
||||
|
||||
|
||||
error = ps_dimension_add_t1stem( dim, stems[0], stems[1],
|
||||
memory, NULL );
|
||||
if ( error )
|
||||
{
|
||||
FT_ERROR(( "t1f.hints.stem: could not add stem"
|
||||
FT_ERROR(( "ps.hints.stem: could not add stem"
|
||||
" (%d,%d) to hints table\n", stems[0], stems[1] ));
|
||||
|
||||
hints->error = error;
|
||||
return;
|
||||
};
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
FT_ERROR(( "t1f.hints.stem: called with invalid hint type (%d)\n",
|
||||
FT_ERROR(( "ps.hints.stem: called with invalid hint type (%d)\n",
|
||||
hints->hint_type ));
|
||||
;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -822,6 +890,7 @@
|
|||
{
|
||||
FT_Error error = 0;
|
||||
|
||||
|
||||
if ( !hints->error )
|
||||
{
|
||||
PS_Dimension dim;
|
||||
|
@ -829,10 +898,11 @@
|
|||
FT_Int count;
|
||||
FT_Int index[3];
|
||||
|
||||
|
||||
/* limit "dimension" to 0..1 */
|
||||
if ( dimension < 0 || dimension > 1 )
|
||||
{
|
||||
FT_ERROR(( "t1f.hints.stem: invalid dimension (%d) used\n",
|
||||
FT_ERROR(( "ps.hints.stem: invalid dimension (%d) used\n",
|
||||
dimension ));
|
||||
dimension = ( dimension != 0 );
|
||||
}
|
||||
|
@ -847,17 +917,19 @@
|
|||
{
|
||||
error = ps_dimension_add_t1stem( dim, stems[0], stems[1],
|
||||
memory, &index[count] );
|
||||
if (error) goto Fail;
|
||||
if ( error )
|
||||
goto Fail;
|
||||
}
|
||||
|
||||
/* now, add the hints to the counters table */
|
||||
error = ps_dimension_add_counter( dim, index[0], index[1],
|
||||
index[2], memory );
|
||||
if (error) goto Fail;
|
||||
if ( error )
|
||||
goto Fail;
|
||||
}
|
||||
else
|
||||
{
|
||||
FT_ERROR(( "t1f.hints.stem3: called with invalid hint type !!\n" ));
|
||||
FT_ERROR(( "ps.hints.stem3: called with invalid hint type!\n" ));
|
||||
error = FT_Err_Invalid_Argument;
|
||||
goto Fail;
|
||||
}
|
||||
|
@ -866,12 +938,11 @@
|
|||
return;
|
||||
|
||||
Fail:
|
||||
FT_ERROR(( "t1f.hints.stem3: could not add counter stems to table\n" ));
|
||||
FT_ERROR(( "ps.hints.stem3: could not add counter stems to table\n" ));
|
||||
hints->error = error;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* reset hints (only with Type 1 hints) */
|
||||
static void
|
||||
ps_hints_t1reset( PS_Hints hints,
|
||||
|
@ -879,19 +950,23 @@
|
|||
{
|
||||
FT_Error error = 0;
|
||||
|
||||
|
||||
if ( !hints->error )
|
||||
{
|
||||
FT_Memory memory = hints->memory;
|
||||
|
||||
|
||||
if ( hints->hint_type == PS_HINT_TYPE_1 )
|
||||
{
|
||||
error = ps_dimension_reset_mask( &hints->dimension[0],
|
||||
end_point, memory );
|
||||
if (error) goto Fail;
|
||||
if ( error )
|
||||
goto Fail;
|
||||
|
||||
error = ps_dimension_reset_mask( &hints->dimension[1],
|
||||
end_point, memory );
|
||||
if (error) goto Fail;
|
||||
if ( error )
|
||||
goto Fail;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -916,6 +991,7 @@
|
|||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
if ( !hints->error )
|
||||
{
|
||||
PS_Dimension dim = hints->dimension;
|
||||
|
@ -923,7 +999,8 @@
|
|||
FT_UInt count1 = dim[0].hints.num_hints;
|
||||
FT_UInt count2 = dim[1].hints.num_hints;
|
||||
|
||||
/* check bit count, must be equal to current total hint count */
|
||||
|
||||
/* check bit count; must be equal to current total hint count */
|
||||
if ( bit_count != count1 + count2 )
|
||||
{
|
||||
error = FT_Err_Invalid_Argument;
|
||||
|
@ -935,11 +1012,13 @@
|
|||
/* set-up new horizontal and vertical hint mask now */
|
||||
error = ps_dimension_set_mask_bits( &dim[0], bytes, 0, count1,
|
||||
end_point, memory );
|
||||
if (error) goto Fail;
|
||||
if ( error )
|
||||
goto Fail;
|
||||
|
||||
error = ps_dimension_set_mask_bits( &dim[1], bytes, count1, count2,
|
||||
end_point, memory );
|
||||
if (error) goto Fail;
|
||||
if ( error )
|
||||
goto Fail;
|
||||
}
|
||||
return;
|
||||
|
||||
|
@ -955,6 +1034,7 @@
|
|||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
if ( !hints->error )
|
||||
{
|
||||
PS_Dimension dim = hints->dimension;
|
||||
|
@ -962,6 +1042,7 @@
|
|||
FT_UInt count1 = dim[0].hints.num_hints;
|
||||
FT_UInt count2 = dim[1].hints.num_hints;
|
||||
|
||||
|
||||
/* check bit count, must be equal to current total hint count */
|
||||
if ( bit_count != count1 + count2 )
|
||||
{
|
||||
|
@ -974,11 +1055,13 @@
|
|||
/* set-up new horizontal and vertical hint mask now */
|
||||
error = ps_dimension_set_mask_bits( &dim[0], bytes, 0, count1,
|
||||
0, memory );
|
||||
if (error) goto Fail;
|
||||
if ( error )
|
||||
goto Fail;
|
||||
|
||||
error = ps_dimension_set_mask_bits( &dim[1], bytes, count1, count2,
|
||||
0, memory );
|
||||
if (error) goto Fail;
|
||||
if ( error )
|
||||
goto Fail;
|
||||
}
|
||||
return;
|
||||
|
||||
|
@ -987,7 +1070,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* end recording session */
|
||||
static FT_Error
|
||||
ps_hints_close( PS_Hints hints,
|
||||
|
@ -995,13 +1077,14 @@
|
|||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
error = hints->error;
|
||||
if ( !error )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_Memory memory = hints->memory;
|
||||
PS_Dimension dim = hints->dimension;
|
||||
|
||||
|
||||
error = ps_dimension_end( &dim[0], end_point, memory );
|
||||
if ( !error )
|
||||
{
|
||||
|
@ -1016,13 +1099,14 @@
|
|||
return error;
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
/***********************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** TYPE 1 HINTS RECORDING INTERFACE *****/
|
||||
/***** *****/
|
||||
/***********************************************************************/
|
||||
/***********************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
static void
|
||||
t1_hints_open( T1_Hints hints )
|
||||
|
@ -1053,14 +1137,13 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
/***********************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** TYPE 2 HINTS RECORDING INTERFACE *****/
|
||||
/***** *****/
|
||||
/***********************************************************************/
|
||||
/***********************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
static void
|
||||
t2_hints_open( T2_Hints hints )
|
||||
|
@ -1068,6 +1151,7 @@
|
|||
ps_hints_open( (PS_Hints)hints, PS_HINT_TYPE_2 );
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
t2_hints_stems( T2_Hints hints,
|
||||
FT_Int dimension,
|
||||
|
@ -1076,6 +1160,7 @@
|
|||
{
|
||||
FT_Long stems[32], n, total = count;
|
||||
|
||||
|
||||
while ( total > 0 )
|
||||
{
|
||||
/* determine number of stems to write */
|
||||
|
@ -1090,7 +1175,7 @@
|
|||
/* add them to the current dimension */
|
||||
ps_hints_stem( (PS_Hints)hints, dimension, count, stems );
|
||||
|
||||
total -= (count >> 1);
|
||||
total -= count >> 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1107,3 +1192,6 @@
|
|||
funcs->counter = (T2_Hints_CounterFunc)ps_hints_t2counter;
|
||||
funcs->apply = (T2_Hints_ApplyFunc) PS_HINTS_APPLY_FUNC;
|
||||
}
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/* */
|
||||
/* pshrec.h */
|
||||
/* */
|
||||
/* Postscript (Type1/Type2) hints recorder. */
|
||||
/* Postscript (Type1/Type2) hints recorder (specification). */
|
||||
/* */
|
||||
/* Copyright 2001 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
|
@ -13,32 +13,40 @@
|
|||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/**************************************************************************/
|
||||
/* */
|
||||
/* The functions defined here are called from the Type 1, CID and CFF */
|
||||
/* font drivers to record the hints of a given character/glyph. */
|
||||
/* */
|
||||
/* The hints are recorded in a unified format, and are later processed */
|
||||
/* by the "optimiser" and "fitter" to adjust the outlines to the pixel */
|
||||
/* by the "optimizer" and "fitter" to adjust the outlines to the pixel */
|
||||
/* grid. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
/**************************************************************************/
|
||||
|
||||
|
||||
#ifndef __PSHREC_H__
|
||||
#define __PSHREC_H__
|
||||
|
||||
#ifndef __PS_HINTER_RECORD_H__
|
||||
#define __PS_HINTER_RECORD_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
|
||||
#include "pshglob.h"
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** GLYPH HINTS RECORDER INTERNALS *****/
|
||||
/***** *****/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* handle to hint record */
|
||||
typedef struct PS_HintRec_* PS_Hint;
|
||||
|
@ -134,7 +142,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
/* */
|
||||
|
||||
/* initialise hints recorder */
|
||||
/* initialize hints recorder */
|
||||
FT_LOCAL FT_Error
|
||||
ps_hints_init( PS_Hints hints,
|
||||
FT_Memory memory );
|
||||
|
@ -143,11 +151,11 @@ FT_BEGIN_HEADER
|
|||
FT_LOCAL void
|
||||
ps_hints_done( PS_Hints hints );
|
||||
|
||||
/* initialise Type1 hints recorder interface */
|
||||
/* initialize Type1 hints recorder interface */
|
||||
FT_LOCAL void
|
||||
t1_hints_funcs_init( T1_Hints_FuncsRec* funcs );
|
||||
|
||||
/* initialise Type2 hints recorder interface */
|
||||
/* initialize Type2 hints recorder interface */
|
||||
FT_LOCAL void
|
||||
t2_hints_funcs_init( T2_Hints_FuncsRec* funcs );
|
||||
|
||||
|
@ -160,6 +168,11 @@ FT_BEGIN_HEADER
|
|||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __PS_HINTER_RECORD_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 1996-2001 by
|
||||
# Copyright 2001 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
@ -38,7 +38,6 @@ PSHINTER_DRV_SRC := $(PSHINTER_DIR_)pshrec.c \
|
|||
PSHINTER_DRV_H := $(PSHINTER_DRV_SRC:%c=%h)
|
||||
|
||||
|
||||
|
||||
# PSHINTER driver object(s)
|
||||
#
|
||||
# PSHINTER_DRV_OBJ_M is used during `multi' builds.
|
||||
|
|
|
@ -105,10 +105,6 @@
|
|||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
#ifdef MEM_Set
|
||||
# define MEM_Set(d,s,c) memset(d,s,c)
|
||||
#endif
|
||||
|
||||
/* define DEBUG_RASTER if you want to compile a debugging version */
|
||||
#define xxxDEBUG_RASTER
|
||||
|
||||
|
@ -190,6 +186,11 @@
|
|||
#endif /* _STANDALONE_ */
|
||||
|
||||
|
||||
#ifndef MEM_Set
|
||||
#define MEM_Set( d, s, c ) memset( d, s, c )
|
||||
#endif
|
||||
|
||||
|
||||
/* FMulDiv means `Fast MulDiv'; it is used in case where `b' is */
|
||||
/* typically a small value and the result of a*b is known to fit into */
|
||||
/* 32 bits. */
|
||||
|
|
|
@ -116,6 +116,7 @@
|
|||
{
|
||||
FT_Int n;
|
||||
|
||||
|
||||
/* shouldn't happen, but just in case to avoid memory leaks */
|
||||
if ( face->root.internal->postscript_name )
|
||||
return face->root.internal->postscript_name;
|
||||
|
@ -126,6 +127,7 @@
|
|||
{
|
||||
TT_NameRec* name = face->name_table.names + n;
|
||||
|
||||
|
||||
if ( name->nameID == 6 )
|
||||
{
|
||||
if ( ( name->platformID == 3 &&
|
||||
|
@ -141,6 +143,7 @@
|
|||
FT_Memory memory = face->root.memory;
|
||||
FT_String* result;
|
||||
|
||||
|
||||
if ( !ALLOC( result, len + 1 ) )
|
||||
{
|
||||
memcpy( result, name->string, len );
|
||||
|
|
|
@ -88,6 +88,7 @@
|
|||
/* experimental support for gamma correction within the rasterizer */
|
||||
#define xxxGRAYS_USE_GAMMA
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
||||
|
@ -1240,6 +1241,7 @@
|
|||
{
|
||||
FT_UInt coverage = spans->coverage;
|
||||
|
||||
|
||||
#ifdef GRAYS_USE_GAMMA
|
||||
coverage = raster->gamma[(FT_Byte)coverage];
|
||||
#endif
|
||||
|
@ -1977,23 +1979,25 @@
|
|||
#ifdef GRAYS_USE_GAMMA
|
||||
|
||||
/* initialize the "gamma" table. Yes, this is really a crummy function */
|
||||
/* but the results look pretty good for something that simple.. */
|
||||
/* but the results look pretty good for something that simple. */
|
||||
/* */
|
||||
#define M_MAX 255
|
||||
#define M_X 128
|
||||
#define M_Y 96
|
||||
#define M_Y 192
|
||||
|
||||
static void
|
||||
grays_init_gamma( PRaster raster )
|
||||
{
|
||||
FT_UInt x, a;
|
||||
|
||||
|
||||
for ( x = 0; x < 256; x++ )
|
||||
{
|
||||
if ( x <= M_X )
|
||||
a = (x * M_Y + (M_X/2)) / M_X;
|
||||
a = ( x * M_Y + M_X / 2) / M_X;
|
||||
else
|
||||
a = M_Y + ((x-M_X)*(M_MAX-M_Y) + (M_MAX-M_X)/2)/(M_MAX-M_X);
|
||||
a = M_Y + ( ( x - M_X ) * ( M_MAX - M_Y ) +
|
||||
( M_MAX - M_X ) / 2 ) / ( M_MAX - M_X );
|
||||
|
||||
raster->gamma[x] = (FT_Byte)a;
|
||||
}
|
||||
|
|
|
@ -1634,22 +1634,24 @@ def main():
|
|||
|
||||
count_sid = len( sid_standard_names )
|
||||
|
||||
# mac_extras contains the list of glyph names in the Macintosh standard
|
||||
# encoding which are not in either the Adobe Glyph List or the SID Standard Names
|
||||
# 'mac_extras' contains the list of glyph names in the Macintosh standard
|
||||
# encoding which are not in either the Adobe Glyph List or the SID
|
||||
# Standard Names.
|
||||
#
|
||||
mac_extras = filter_glyph_names( mac_standard_names, adobe_glyph_names() )
|
||||
mac_extras = filter_glyph_names( mac_extras, sid_standard_names )
|
||||
|
||||
# base_list contains the first names of our final glyph names table. It consists
|
||||
# of the "mac_extras" glyph names, followed by the SID Standard names
|
||||
# 'base_list' contains the first names of our final glyph names table.
|
||||
# It consists of the 'mac_extras' glyph names, followed by the SID
|
||||
# Standard names.
|
||||
#
|
||||
mac_extras_count = len( mac_extras )
|
||||
t1_bias = mac_extras_count
|
||||
base_list = mac_extras + sid_standard_names
|
||||
|
||||
# adobe_list contains the glyph names that are in the AGL, but no in
|
||||
# the base_list, they will be placed after base_list glyph names in
|
||||
# our final table..
|
||||
# 'adobe_list' contains the glyph names that are in the AGL, but not in
|
||||
# the base_list; they will be placed after base_list glyph names in
|
||||
# our final table.
|
||||
#
|
||||
adobe_list = filter_glyph_names( adobe_glyph_names(), base_list )
|
||||
adobe_count = len( adobe_list )
|
||||
|
|
|
@ -241,9 +241,9 @@
|
|||
if ( size && size->root.metrics.y_ppem < 24 )
|
||||
glyph->root.outline.flags |= ft_outline_high_precision;
|
||||
|
||||
/* XXXX: the following needs serious work to work properly with hinting !! */
|
||||
/* XXX: the following needs serious work to work properly with hinting! */
|
||||
#if 0
|
||||
/* apply the font matrix, if any.. */
|
||||
/* apply the font matrix, if any */
|
||||
FT_Outline_Transform( &glyph->root.outline, &font_matrix );
|
||||
|
||||
FT_Outline_Translate( &glyph->root.outline,
|
||||
|
@ -261,7 +261,7 @@
|
|||
FT_Fixed y_scale = glyph->y_scale;
|
||||
|
||||
|
||||
/* First of all, scale the points, fi we're not hinting */
|
||||
/* First of all, scale the points, if we are not hinting */
|
||||
if ( !hinting )
|
||||
for ( n = cur->n_points; n > 0; n--, vec++ )
|
||||
{
|
||||
|
|
|
@ -827,6 +827,7 @@
|
|||
FT_Byte* cur2;
|
||||
FT_Byte* limit;
|
||||
|
||||
|
||||
if ( face->type1.font_name )
|
||||
/* with synthetic fonts, it's possible we get here twice */
|
||||
return;
|
||||
|
@ -959,6 +960,7 @@
|
|||
FT_Memory memory = parser->root.memory;
|
||||
FT_Error error;
|
||||
|
||||
|
||||
if ( encode->char_index )
|
||||
/* with synthetic fonts, it's possible we get here twice */
|
||||
return;
|
||||
|
@ -1101,6 +1103,7 @@
|
|||
|
||||
PSAux_Interface* psaux = (PSAux_Interface*)face->psaux;
|
||||
|
||||
|
||||
if ( loader->num_subrs )
|
||||
/* with synthetic fonts, it's possible we get here twice */
|
||||
return;
|
||||
|
|
|
@ -50,10 +50,11 @@
|
|||
/* SIZE FUNCTIONS */
|
||||
/* */
|
||||
/* note that we store the global hints in the size's "internal" root */
|
||||
/* field.. */
|
||||
/* field */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
static PSH_Globals_Funcs
|
||||
T1_Size_Get_Globals_Funcs( T1_Size size )
|
||||
{
|
||||
|
@ -61,20 +62,23 @@
|
|||
PSHinter_Interface* pshinter = face->pshinter;
|
||||
FT_Module module;
|
||||
|
||||
module = FT_Get_Module( size->root.face->driver->root.library, "pshinter" );
|
||||
|
||||
module = FT_Get_Module( size->root.face->driver->root.library,
|
||||
"pshinter" );
|
||||
return ( module && pshinter && pshinter->get_globals_funcs )
|
||||
? pshinter->get_globals_funcs( module )
|
||||
: 0 ;
|
||||
}
|
||||
|
||||
|
||||
FT_LOCAL_DEF
|
||||
void T1_Size_Done( T1_Size size )
|
||||
FT_LOCAL_DEF void
|
||||
T1_Size_Done( T1_Size size )
|
||||
{
|
||||
if ( size->root.internal )
|
||||
{
|
||||
PSH_Globals_Funcs funcs;
|
||||
|
||||
|
||||
funcs = T1_Size_Get_Globals_Funcs( size );
|
||||
if ( funcs )
|
||||
funcs->destroy( (PSH_Globals)size->root.internal );
|
||||
|
@ -84,18 +88,19 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_LOCAL_DEF
|
||||
FT_Error T1_Size_Init( T1_Size size )
|
||||
FT_LOCAL_DEF FT_Error
|
||||
T1_Size_Init( T1_Size size )
|
||||
{
|
||||
FT_Error error = 0;
|
||||
PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size );
|
||||
|
||||
|
||||
if ( funcs )
|
||||
{
|
||||
PSH_Globals globals;
|
||||
T1_Face face = (T1_Face)size->root.face;
|
||||
|
||||
|
||||
error = funcs->create( size->root.face->memory,
|
||||
&face->type1.private_dict, &globals );
|
||||
if ( !error )
|
||||
|
@ -106,13 +111,13 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_LOCAL_DEF
|
||||
FT_Error T1_Size_Reset( T1_Size size )
|
||||
FT_LOCAL_DEF FT_Error
|
||||
T1_Size_Reset( T1_Size size )
|
||||
{
|
||||
PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size );
|
||||
FT_Error error = 0;
|
||||
|
||||
|
||||
if ( funcs )
|
||||
error = funcs->set_scale( (PSH_Globals)size->root.internal,
|
||||
size->root.metrics.x_scale,
|
||||
|
@ -178,8 +183,8 @@
|
|||
/* <Input> */
|
||||
/* face :: A typeless pointer to the face object to destroy. */
|
||||
/* */
|
||||
FT_LOCAL_DEF
|
||||
void T1_Face_Done( T1_Face face )
|
||||
FT_LOCAL_DEF void
|
||||
T1_Face_Done( T1_Face face )
|
||||
{
|
||||
FT_Memory memory;
|
||||
T1_Font* type1 = &face->type1;
|
||||
|
@ -239,7 +244,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
|
|
|
@ -105,14 +105,15 @@ FT_BEGIN_HEADER
|
|||
} T1_SizeRec;
|
||||
|
||||
|
||||
FT_LOCAL
|
||||
void T1_Size_Done( T1_Size size );
|
||||
FT_LOCAL void
|
||||
T1_Size_Done( T1_Size size );
|
||||
|
||||
FT_LOCAL
|
||||
FT_Error T1_Size_Reset( T1_Size size );
|
||||
FT_LOCAL FT_Error
|
||||
T1_Size_Reset( T1_Size size );
|
||||
|
||||
FT_LOCAL FT_Error
|
||||
T1_Size_Init( T1_Size size );
|
||||
|
||||
FT_LOCAL
|
||||
FT_Error T1_Size_Init( T1_Size size );
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
|
@ -148,12 +149,6 @@ FT_BEGIN_HEADER
|
|||
FT_LOCAL void
|
||||
T1_Face_Done( T1_Face face );
|
||||
|
||||
FT_LOCAL FT_Error
|
||||
T1_Size_Init( T1_Size size );
|
||||
|
||||
FT_LOCAL void
|
||||
T1_Size_Done( T1_Size size );
|
||||
|
||||
FT_LOCAL FT_Error
|
||||
T1_GlyphSlot_Init( T1_GlyphSlot slot );
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
# FreeType 2 src Jamfile (c) 2001 David Turner
|
||||
#
|
||||
|
||||
SubDir FT2_TOP tests ;
|
||||
|
||||
test_programs = gview ;
|
||||
|
|
Loading…
Reference in New Issue