* src/base/fttrigon.c, src/base/ftgloadr.c: Inlude
FT_INTERNAL_OBJECTS_H. * src/base/ftstroke.c (FT_Outline_GetInsideBorder, FT_Outline_GetOutsideBorder): s/or/o/ to make it compile with C++ compilers. * src/cache/ftcmru.c, include/freetype/cache/ftcmru.h: s/select/selection/ to avoid compiler warning. * src/cff/cffload.h: s/select/ftselect/ to avoid potential compiler warning. Formatting.
This commit is contained in:
parent
a40b1b64a0
commit
80cfbd7073
260
ChangeLog
260
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
2003-12-25 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
* src/base/fttrigon.c, src/base/ftgloadr.c: Inlude
|
||||
FT_INTERNAL_OBJECTS_H.
|
||||
|
||||
* src/base/ftstroke.c (FT_Outline_GetInsideBorder,
|
||||
FT_Outline_GetOutsideBorder): s/or/o/ to make it compile with
|
||||
C++ compilers.
|
||||
|
||||
* src/cache/ftcmru.c, include/freetype/cache/ftcmru.h:
|
||||
s/select/selection/ to avoid compiler warning.
|
||||
* src/cff/cffload.h: s/select/ftselect/ to avoid potential
|
||||
compiler warning.
|
||||
|
||||
2003-12-24 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
* src/cache/ftcsbits.c (FTC_SNode_Weight):
|
||||
|
@ -25,8 +39,14 @@
|
|||
`(x) & ~63' instead!
|
||||
Updated all related code.
|
||||
|
||||
* include/freetype/ftstroke.h, src/base/ftstroke.c: Added support
|
||||
for extraction of "inside" and "outside" borders.
|
||||
Add support for extraction of `inside' and `outside' borders.
|
||||
|
||||
* src/base/ftstroke.c (FT_StrokerBorder): New enumeration.
|
||||
(FT_Outline_GetInsideBorder, FT_Outline_GetOutsideBorder,
|
||||
FT_Stroker_GetBorderCounts, FT_Stroker_ExportBorder): New functions.
|
||||
(FT_StrokeBorderRec): New boolean member `valid'.
|
||||
(ft_stroke_border_get_counts): Updated.
|
||||
* include/freetype/ftstroke.h: Updated.
|
||||
|
||||
2003-12-22 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
|
@ -61,11 +81,11 @@
|
|||
src/cache/ftcbasic.c (added),
|
||||
src/cache/ftclru.c (removed):
|
||||
|
||||
*Complete* rewrite of the cache sub-system to "solve" the
|
||||
*Complete* rewrite of the cache sub-system to `solve' the
|
||||
following points:
|
||||
|
||||
- all public APIs have been moved to FT_CACHE_H, everything
|
||||
under "include/freetype/cache" is only needed by client
|
||||
under `include/freetype/cache' is only needed by client
|
||||
applications that want to implement their own caches
|
||||
|
||||
- a new function named FTC_Manager_RemoveFaceID to deal
|
||||
|
@ -2292,8 +2312,8 @@
|
|||
(not defined, but in comments) for the unpatented hinting system.
|
||||
|
||||
* include/freetype/internal/tttypes.h (TT_FaceRec)
|
||||
[TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: New element "FT_Bool
|
||||
unpatented_hinting".
|
||||
[TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: New element `FT_Bool
|
||||
unpatented_hinting'.
|
||||
|
||||
* src/truetype/ttinterp.c (NO_APPLE_PATENT, APPLE_THRESHOLD):
|
||||
Removed.
|
||||
|
@ -2359,8 +2379,8 @@
|
|||
|
||||
* src/pcf/pcfread.c (pcf_load_font): Fixed the computation of
|
||||
face->num_glyphs. We must increase the value by 1 to respect the
|
||||
convention that glyph index 0 always corresponds to the "missing
|
||||
glyph".
|
||||
convention that glyph index 0 always corresponds to the `missing
|
||||
glyph'.
|
||||
|
||||
2003-04-24 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
|
@ -2456,7 +2476,7 @@
|
|||
2003-04-09 Torrey Lyons <torrey@mrcla.com>
|
||||
|
||||
* src/base/ftmac.c (open_face_from_buffer): Removed a double-free
|
||||
bug that had nasty consequences when trying to open an "invalid"
|
||||
bug that had nasty consequences when trying to open an `invalid'
|
||||
font on a Mac.
|
||||
|
||||
2003-04-09 Mike Fabian <mfabian@suse.de>
|
||||
|
@ -2475,7 +2495,7 @@
|
|||
2003-04-03 Martin Muskens <mmuskens@aurelon.com>
|
||||
|
||||
* src/type1/t1load.c (T1_Open_Face): Fixed the code to make it
|
||||
handle special cases where a font only contains a ".notdef" glyph
|
||||
handle special cases where a font only contains a `.notdef' glyph
|
||||
(happens in PDF-embedded fonts). Otherwise, FT_Panic was called.
|
||||
|
||||
2003-03-27 David Turner <david@freetype.org>
|
||||
|
@ -2584,8 +2604,8 @@
|
|||
2003-03-13 David Turner <david@freetype.org>
|
||||
|
||||
Added new environment variables to control memory debugging with
|
||||
FreeType. See the description of "FT2_DEBUG_MEMORY",
|
||||
"FT2_ALLOC_TOTAL_MAX" and "FT2_ALLOC_COUNT_MAX" in DEBUG.TXT.
|
||||
FreeType. See the description of `FT2_DEBUG_MEMORY',
|
||||
`FT2_ALLOC_TOTAL_MAX' and `FT2_ALLOC_COUNT_MAX' in DEBUG.TXT.
|
||||
|
||||
* src/base/ftdbgmem.c (FT_MemTableRec): Add `alloc_count',
|
||||
`bound_total', `alloc_total_max', `bound_count', `alloc_count_max'.
|
||||
|
@ -2630,7 +2650,7 @@
|
|||
(ftc_cmap_family_init): The cmap cache now
|
||||
supports UCS-4 charmaps when available in Asian fonts.
|
||||
|
||||
* src/sfnt/ttload.c, src/base/ftobjs.c: Changed "asian" to "Asian"
|
||||
* src/sfnt/ttload.c, src/base/ftobjs.c: Changed `asian' to `Asian'
|
||||
in comments.
|
||||
|
||||
2003-02-25 David Turner <david@freetype.org>
|
||||
|
@ -2651,7 +2671,7 @@
|
|||
|
||||
- The table loaded now scans for *undocumented* elements of a
|
||||
physical font's auxiliary data record. This is necessary to
|
||||
retrieve the "real" family and style names.
|
||||
retrieve the `real' family and style names.
|
||||
|
||||
NOTE THAT THESE CHANGES THE FAMILY NAME OF MANY PFR FONTS!
|
||||
|
||||
|
@ -2697,7 +2717,7 @@
|
|||
`exec->metrics'.
|
||||
|
||||
* src/autohint/ahhint.c (ah_hinter_load): Disabled the advance width
|
||||
"correction" which seemed to provide more trouble than benefits.
|
||||
`correction' which seemed to provide more trouble than benefits.
|
||||
|
||||
2003-02-13 Graham Asher <graham.asher@btinternet.com>
|
||||
|
||||
|
@ -2738,7 +2758,7 @@
|
|||
* src/pfr/pfrsbit.c: Removed compiler warnings.
|
||||
|
||||
* src/cache/ftccmap.c (ftc_cmap_family_init): Changed an FT_ERROR
|
||||
into an FT_TRACE1 since it caused "ftview" and others to dump too
|
||||
into an FT_TRACE1 since it caused `ftview' and others to dump too
|
||||
much junk when trying to display a waterfall with a font without a
|
||||
Unicode charmap (e.g. SYMBOL.TTF).
|
||||
|
||||
|
@ -2802,9 +2822,9 @@
|
|||
(pcf_find_property): Decorate it with FT_LOCAL_DEF.
|
||||
* src/pcf/pcfread.h: New file, providing `pcf_find_property'.
|
||||
|
||||
* src/sfnt/ttload.c (sfnt_dir_check): Relaxed the "head" table size
|
||||
* src/sfnt/ttload.c (sfnt_dir_check): Relaxed the `head' table size
|
||||
verification to accept a few broken fonts who pad the size
|
||||
incorrectly (the table should be padded, but its "size" field
|
||||
incorrectly (the table should be padded, but its `size' field
|
||||
shouldn't according to the specification).
|
||||
|
||||
2003-01-18 Werner Lemberg <wl@gnu.org>
|
||||
|
@ -2870,9 +2890,9 @@
|
|||
|
||||
Patches to the auto-hinter in order to slightly improve the output.
|
||||
Note that everything is controlled through the new
|
||||
FT_CONFIG_OPTION_CHESTER_HINTS defined in "ftoption.h". There are
|
||||
FT_CONFIG_OPTION_CHESTER_HINTS defined in `ftoption.h'. There are
|
||||
also individual FT_CONFIG_CHESTER_XXX macros to control individual
|
||||
"features".
|
||||
`features'.
|
||||
|
||||
Note that all improvements are enabled by default, but can be
|
||||
tweaked for optimization and testing purposes. The configuration
|
||||
|
@ -2914,11 +2934,11 @@
|
|||
2003-01-08 Huw Dawies <huw@codeweavers.com>
|
||||
|
||||
* src/winfonts/winfnt.c (winfnt_header_fields): Read 16 bytes into
|
||||
"reserved2", not "reserved".
|
||||
`reserved2', not `reserved'.
|
||||
|
||||
* src/base/ftobjs.c (find_unicode_charmap): Fixed the error code
|
||||
returned when the font doesn't contain a Unicode charmap. This
|
||||
allows FT2 to load "symbol.ttf" and a few others correctly since the
|
||||
allows FT2 to load `symbol.ttf' and a few others correctly since the
|
||||
last release.
|
||||
(open_face): Fix return value.
|
||||
|
||||
|
@ -2971,7 +2991,7 @@
|
|||
assertion, and changing code to avoid hash table size contraction.
|
||||
|
||||
* src/base/Jamfile, src/base/rules.mk, src/base/descrip.mms: Adding
|
||||
"ftstroker" to default build, as optional component.
|
||||
`ftstroker' to default build, as optional component.
|
||||
|
||||
2002-12-26 David Turner <david@freetype.org>
|
||||
|
||||
|
@ -3102,7 +3122,7 @@
|
|||
configuration (typically by adding -D flags at compile time).
|
||||
|
||||
* src/sfnt/ttcmap0.c (tt_face_build_cmaps): Removed compiler
|
||||
warnings in optimized mode relative to the "volatile" local
|
||||
warnings in optimized mode relative to the `volatile' local
|
||||
variables. This was not a compiler bug after all, but the fact that
|
||||
a pointer to a volatile variable is not the same as a volatile
|
||||
pointer to a variable :-)
|
||||
|
@ -3234,8 +3254,8 @@
|
|||
src/tools/docmaker/tohtml.py: Fixing a few nasty bugs.
|
||||
|
||||
* src/sfnt/ttcmap0.c (tt_cmap4_validate): The validator for format 4
|
||||
sub-tables is now capable of dealing with invalid "length" fields at
|
||||
the start of the sub-table. This allows fonts like "mg______.ttf"
|
||||
sub-tables is now capable of dealing with invalid `length' fields at
|
||||
the start of the sub-table. This allows fonts like `mg______.ttf'
|
||||
(i.e. Marriage) to return accurate charmaps.
|
||||
|
||||
* docs/CHANGES: Updated.
|
||||
|
@ -3499,7 +3519,7 @@
|
|||
Removed conditional code. This fixes a bug that prevented
|
||||
compilation in debug mode of template instantiation.
|
||||
|
||||
* include/freetype/ftimage.h: Removed incorrect "zft_" definitions
|
||||
* include/freetype/ftimage.h: Removed incorrect `zft_' definitions
|
||||
and updated constants documentation comments.
|
||||
|
||||
* src/cff/cffparse.c (cff_parser_run): Fixed the CFF table loader.
|
||||
|
@ -3507,7 +3527,7 @@
|
|||
certain fonts.
|
||||
|
||||
* include/freetype/freetype.h (FT_FaceRec): Updating documentation
|
||||
comment. The "descender" value is always *negative*, not positive.
|
||||
comment. The `descender' value is always *negative*, not positive.
|
||||
|
||||
2002-09-09 Owen Taylor <owen@redhat.com>
|
||||
|
||||
|
@ -3811,7 +3831,7 @@
|
|||
The automatic and Postscript hinter now automatically detect
|
||||
inflection points in glyph outlines and treats them specially. This
|
||||
is very useful to prevent nasty effect like the disappearing
|
||||
diagonals of "S" and "s" in many, many fonts.
|
||||
diagonals of `S' and `s' in many, many fonts.
|
||||
|
||||
* src/autohint/ahtypes.h (ah_flag_inflection): New macro.
|
||||
* src/autohint/ahangles.c (ah_angle_diff): New function.
|
||||
|
@ -3825,8 +3845,8 @@
|
|||
* src/tools/docmaker/docmaker.py, src/tools/docmaker/utils.py,
|
||||
src/tools/docmaker/tohtml.py: Updating the DocMaker tool.
|
||||
|
||||
* include/freetype/freetype.h: Changing the type of the "load_flags"
|
||||
parameter from "FT_Int" to "FT_Int32", this in order to support more
|
||||
* include/freetype/freetype.h: Changing the type of the `load_flags'
|
||||
parameter from `FT_Int' to `FT_Int32', this in order to support more
|
||||
options. This should only break binary and/or source compatibility
|
||||
on 16-bit platforms (Atari?).
|
||||
(FT_LOAD_NO_AUTOHINT): New macro.
|
||||
|
@ -3995,7 +4015,7 @@
|
|||
2002-07-30 David Turner <david@freetype.org>
|
||||
|
||||
* include/freetype/ftincrem.h: Adding new experimental header file
|
||||
to demonstrate a "cleaner" API to support incremental font loading.
|
||||
to demonstrate a `cleaner' API to support incremental font loading.
|
||||
|
||||
* include/freetype/config/ftheader.h (FT_INCREMENTAL_H): New macro.
|
||||
|
||||
|
@ -4031,10 +4051,10 @@
|
|||
2002-07-24 Graham Asher <graham.asher@btinternet.com>
|
||||
|
||||
* src/truetype/ttobjs.c: Fix for bug reported by Sven Neumann
|
||||
[sven@gimp.org] on the FreeType development forum: "If
|
||||
[sven@gimp.org] on the FreeType development forum: `If
|
||||
FT_CONFIG_OPTION_INCREMENTAL is undefined (this is the default), the
|
||||
TrueType loader crashes in line 852 of src/truetype/ttgload.c when
|
||||
it tries to access face->glyph_locations."
|
||||
it tries to access face->glyph_locations.'
|
||||
|
||||
2002-07-18 Graham Asher <graham.asher@btinternet.com>
|
||||
|
||||
|
@ -4137,8 +4157,8 @@
|
|||
2002-07-11 David Turner <david@freetype.org>
|
||||
|
||||
Changing the SFNT loader to check for SFNT-based font files
|
||||
differently. We now ignore the range "helper" fields and check the
|
||||
"head" table's magic number instead.
|
||||
differently. We now ignore the range `helper' fields and check the
|
||||
`head' table's magic number instead.
|
||||
|
||||
* include/freetype/internal/tttypes.h (SFNT_HeaderRec): Add `offset'
|
||||
field.
|
||||
|
@ -4655,7 +4675,7 @@
|
|||
2002-06-07 David Turner <david@freetype.org>
|
||||
|
||||
Fixed the bug that prevented the correct display of fonts with
|
||||
"ftview".
|
||||
`ftview'.
|
||||
|
||||
* src/type42/t42drivr.c: Split into...
|
||||
* src/type42/t42drivr.h, src/type42/t42parse.c,
|
||||
|
@ -4761,8 +4781,8 @@
|
|||
* include/freetype/t1tables.h: Updated.
|
||||
|
||||
* src/base/Jamfile, src/base/rules.mk, src/base/descrip.mms:
|
||||
Updating build control files for the new files "ftxf86.c" and
|
||||
"fttype1.c" in src/base.
|
||||
Updating build control files for the new files `ftxf86.c' and
|
||||
`fttype1.c' in src/base.
|
||||
|
||||
* src/pshinter/pshglob.c (psh_blues_scale_zones): Fixed a bug that
|
||||
prevented family blue zones substitution from hapenning correctly.
|
||||
|
@ -4784,7 +4804,7 @@
|
|||
Fixing the SFNT name table loader to support various buggy fonts.
|
||||
It now ignores empty name entries, entries with invalid pointer
|
||||
Offsets and certain fonts containing tables with broken
|
||||
"storageOffset" fields.
|
||||
`storageOffset' fields.
|
||||
|
||||
Name strings are now loaded on demand, which reduces the memory
|
||||
requirements for a given FT_Face tremendously (for example, the name
|
||||
|
@ -4838,7 +4858,7 @@
|
|||
2002-05-21 David Turner <david@freetype.org>
|
||||
|
||||
* src/bdf/bdflib.c: Removed compiler warning, and changed all tables
|
||||
to the "static const" storage specifier (instead of simply
|
||||
to the `static const' storage specifier (instead of simply
|
||||
`static').
|
||||
|
||||
* src/type42/t42drivr.c (hexval): Use more efficient code.
|
||||
|
@ -4849,7 +4869,7 @@
|
|||
src/base/descrip.mms, src/base/Jamfile, src/base/rules.mk
|
||||
(FT_Get_BDF_Charset_ID): New API to retrieve BDF-specific strings
|
||||
from a face. This is much cleaner than accessing the internal types
|
||||
"BDF_Public_Face" defined in FT_INTERNAL_BDF_TYPES_H.
|
||||
`BDF_Public_Face' defined in FT_INTERNAL_BDF_TYPES_H.
|
||||
|
||||
2002-05-21 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
|
@ -5003,11 +5023,11 @@
|
|||
2002-05-01 David Turner <david@freetype.org>
|
||||
|
||||
* src/sfnt/sfobjs.c (tt_face_get_name): Fixing a bug that caused
|
||||
FreeType to crash when certain broken fonts (e.g. "hya6gb.ttf")
|
||||
FreeType to crash when certain broken fonts (e.g. `hya6gb.ttf')
|
||||
were opened.
|
||||
|
||||
* src/sfnt/ttload.c (TT_Load_Names): Applied a small work-around to
|
||||
manage fonts containing a broken name table (e.g. "hya6gb.ttf").
|
||||
manage fonts containing a broken name table (e.g. `hya6gb.ttf').
|
||||
|
||||
* src/sfnt/ttcmap0.c (tt_cmap4_validate): Fixed over-restrictive
|
||||
validation test. The charmap validator now accepts overlapping
|
||||
|
@ -5174,8 +5194,8 @@
|
|||
* src/base/ftobjs.c, builds/win32/ftdebug.c,
|
||||
builds/amiga/src/base/ftdebug.c: Version 2.1.0 couldn't be linked
|
||||
against applications in Win32 and Amiga builds due to changes to
|
||||
"src/base/ftdebug.c" that were not properly propagated to
|
||||
"builds/win32" and "builds/amiga". This has been fixed.
|
||||
`src/base/ftdebug.c' that were not properly propagated to
|
||||
`builds/win32' and `builds/amiga'. This has been fixed.
|
||||
|
||||
* include/freetype/internal/ftobject.h,
|
||||
include/freetype/internal/ftexcept.h, include/freetype/ftsysmem.h,
|
||||
|
@ -5262,7 +5282,7 @@
|
|||
|
||||
builds/amiga/src/base/ftdebug.c:
|
||||
|
||||
Added the new configuration file "ftstdlib.h" used to define
|
||||
Added the new configuration file `ftstdlib.h' used to define
|
||||
aliases for all ISO C library functions used by the engine
|
||||
(e.g. strlen, qsort, setjmp, etc.).
|
||||
|
||||
|
@ -5503,7 +5523,7 @@
|
|||
|
||||
* src/psaux/t1cmap.h, src/psaux/t1cmap.c, src/type1/t1cmap.h,
|
||||
src/type1/t1cmap.c: Updating and moving the Type 1 FT_CMap support
|
||||
from "src/type1" to "src/psaux" since it is going to be shared by
|
||||
from `src/type1' to `src/psaux' since it is going to be shared by
|
||||
the Type 1 and CID font drivers.
|
||||
|
||||
* src/psaux/Jamfile, src/psaux/psaux.c, src/psaux/psauxmod.c,
|
||||
|
@ -5713,11 +5733,11 @@
|
|||
|
||||
* src/cid/cidriver.c (cid_get_postscript_name): Fixed a bug that
|
||||
caused the CID driver to return Postscript font names with a leading
|
||||
slash ("/") as in "/MOEKai-Regular".
|
||||
slash (`/') as in `/MOEKai-Regular'.
|
||||
|
||||
* src/sfnt/ttload.c (TT_Load_Names), src/sfnt/sfobjs.c (Get_Name),
|
||||
src/sfnt/sfdriver.c (get_sfnt_postscript_name): Fixed the loader so
|
||||
that it accepts broken fonts like "foxjump.ttf", which made FreeType
|
||||
that it accepts broken fonts like `foxjump.ttf', which made FreeType
|
||||
crash when trying to load them.
|
||||
|
||||
Also improved the name table parser to be able to load
|
||||
|
@ -5777,7 +5797,7 @@
|
|||
* src/sfnt/ttload.c (TT_Load_Names): Simplifying and securing the
|
||||
names table loader. Invalid individual name entries are now handled
|
||||
correctly. This allows the loading of very buggy fonts like
|
||||
"foxjump.ttf" without allocating tons of memory and causing crashes.
|
||||
`foxjump.ttf' without allocating tons of memory and causing crashes.
|
||||
|
||||
* src/otlayout/otlcommon.h, src/otlayout/otlcommon.c: Adding (still
|
||||
experimental) code for OpenType Layout tables validation and
|
||||
|
@ -5824,14 +5844,14 @@
|
|||
ft_io_stream => ft_ansi_stream_io (in base/ftsystem.c only)
|
||||
|
||||
* src/base/ftutil.c: New file. Contains all memory and list
|
||||
management code (previously in "ftobjs.c" and "ftlist.c",
|
||||
management code (previously in `ftobjs.c' and `ftlist.c',
|
||||
respectively).
|
||||
|
||||
* include/freetype/internal/ftobjs.h: Moving all code related to
|
||||
glyph loaders to ...
|
||||
* include/freetype/"internal/ftgloadr.h: This new file.
|
||||
"FT_GlyphLoader" is now a pointer to the structure
|
||||
"FT_GlyphLoaderRec".
|
||||
* include/freetype/internal/ftgloadr.h: This new file.
|
||||
`FT_GlyphLoader' is now a pointer to the structure
|
||||
`FT_GlyphLoaderRec'.
|
||||
(ft_glyph_own_bitmap): Renamed to ...
|
||||
(FT_GLYPH_OWN_BITMAP): This.
|
||||
* src/base/ftobjs.c: Moving all code related to glyph loaders
|
||||
|
@ -5846,8 +5866,8 @@
|
|||
2002-02-21 David Turner <david@freetype.org>
|
||||
|
||||
Modified the debug sub-system initialization. Trace levels can now
|
||||
be specified within the "FT2_DEBUG" environment variable. See the
|
||||
comments within "ftdebug.c" for more details.
|
||||
be specified within the `FT2_DEBUG' environment variable. See the
|
||||
comments within `ftdebug.c' for more details.
|
||||
|
||||
* src/base/ftdebug.c: (FT_SetTraceLevel): Removed.
|
||||
(ft_debug_init): New function.
|
||||
|
@ -5872,8 +5892,8 @@
|
|||
Removed. Both files are now completely obsolete.
|
||||
* src/base/Jamfile, src/base/rules.mk: Updated.
|
||||
|
||||
* include/freetype/fterrors.h: Adding "#undef FT_ERR_CAT" and
|
||||
`#undef FT_ERR_XCAT" to avoid warnings with certain compilers (like
|
||||
* include/freetype/fterrors.h: Adding `#undef FT_ERR_CAT' and
|
||||
`#undef FT_ERR_XCAT' to avoid warnings with certain compilers (like
|
||||
LCC).
|
||||
|
||||
* src/pshinter/pshalgo2.c (print_zone): Renamed to ...
|
||||
|
@ -5885,7 +5905,7 @@
|
|||
|
||||
2002-02-20 David Turner <david@freetype.org>
|
||||
|
||||
* README: Adding "devel@freetype.org" address for bug reports.
|
||||
* README: Adding `devel@freetype.org' address for bug reports.
|
||||
|
||||
2002-02-20 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
|
@ -6013,7 +6033,7 @@
|
|||
|
||||
* src/pcf/pcfdriver.c (FT_Done_Face): Fixed small memory leak.
|
||||
|
||||
* src/pcf/pcfread.c (pcf_load_font): Now handles the "AVERAGE_WIDTH"
|
||||
* src/pcf/pcfread.c (pcf_load_font): Now handles the `AVERAGE_WIDTH'
|
||||
property to return correct character pixel (width/height) pairs for
|
||||
embedded bitmaps.
|
||||
|
||||
|
@ -6079,7 +6099,7 @@
|
|||
2002-01-30 David Turner <david@freetype.org>
|
||||
|
||||
* INSTALL: Moved to ...
|
||||
* docs/INSTALL: Here to avoid conflicts with the "install" script on
|
||||
* docs/INSTALL: Here to avoid conflicts with the `install' script on
|
||||
Windows, where the filesystem doesn't preserve case.
|
||||
|
||||
2002-01-29 David Turner <david@freetype.org>
|
||||
|
@ -6089,7 +6109,7 @@
|
|||
|
||||
./configure --disable-shared --disable-nls
|
||||
|
||||
the "--disable-nls" was incorrectly sent to the "make" program.
|
||||
the `--disable-nls' was incorrectly sent to the `make' program.
|
||||
|
||||
2002-01-29 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
|
@ -6136,7 +6156,7 @@
|
|||
|
||||
2002-01-21 Antoine Leca <Antoine-Freetype@Leca-Marti.org>
|
||||
|
||||
* docs/PATENTS: Typo fixed (thanks to Detlef "Hawkeye" Würkner) in
|
||||
* docs/PATENTS: Typo fixed (thanks to Detlef `Hawkeye' Würkner) in
|
||||
the URL for the online resource.
|
||||
|
||||
2002-01-18 Ian Brown <ian.brown@printsoft.de>
|
||||
|
@ -6211,7 +6231,7 @@
|
|||
|
||||
* src/autohint/ahhint.c (ah_align_linked_edge): Modified computation
|
||||
of auto-hinted stem widths; this avoids color fringes in
|
||||
"ClearType-like" rendering.
|
||||
`ClearType-like' rendering.
|
||||
|
||||
* src/truetype/ttgload.c (TT_Load_Glyph_Header,
|
||||
TT_Load_Simple_Glyph, TT_Load_Composite_Glyph, load_truetype_glyph):
|
||||
|
@ -6238,22 +6258,22 @@
|
|||
2002-01-03 Keith Packard <keithp@keithp.com>
|
||||
|
||||
* builds/unix/ftsystem.c (FT_New_Stream): Added a fix to ensure that
|
||||
all FreeType input streams are closed in child processes of a "fork"
|
||||
all FreeType input streams are closed in child processes of a `fork'
|
||||
on Unix systems. This is important to avoid (potential) access
|
||||
control issues.
|
||||
|
||||
2002-01-03 David Turner <david@freetype.org>
|
||||
|
||||
* src/type1/t1objs.c (T1_Face_Init): Fixed a bug that crashed the
|
||||
library when dealing with certain weird fonts like "Stalingrad", in
|
||||
"sadn.pfb" (this font has no full font name entry).
|
||||
library when dealing with certain weird fonts like `Stalingrad', in
|
||||
`sadn.pfb' (this font has no full font name entry).
|
||||
|
||||
* src/base/ftoutln.c, include/freetype/ftoutln.h (FT_Outline_Check):
|
||||
New function to check the consistency of outline data.
|
||||
|
||||
* src/base/ftobjs.c (FT_Load_Glyph): Use `FT_Outline_Check' to
|
||||
ensure that loaded glyphs are valid. This allows certain fonts like
|
||||
"tt1095m_.ttf" to be loaded even though it appears they contain
|
||||
`tt1095m_.ttf' to be loaded even though it appears they contain
|
||||
really funky glyphs.
|
||||
|
||||
There still is a bug there, though.
|
||||
|
@ -6304,8 +6324,8 @@
|
|||
2001-12-21 David Turner <david@freetype.org>
|
||||
|
||||
* src/pshinter/pshrec.c (ps_hints_t2mask, ps_hints_t2counter):
|
||||
Ignore invalid "hintmask" and "cntrmask" operators (instead of
|
||||
returning an error). Glyph 2028 of the CFF font "MSung-Light-Acro"
|
||||
Ignore invalid `hintmask' and `cntrmask' operators (instead of
|
||||
returning an error). Glyph 2028 of the CFF font `MSung-Light-Acro'
|
||||
couldn't be rendered otherwise (it seems its charstring is buggy,
|
||||
though this requires more analysis).
|
||||
(FT_COMPONENT): Define.
|
||||
|
@ -6401,12 +6421,12 @@
|
|||
routines were never released when CID faces were destroyed.
|
||||
|
||||
* src/cff/cffload.h, src/cff/cffload.c, src/cff/cffgload.c: Updated
|
||||
to move the definition of encoding tables back within "cffload.c"
|
||||
to move the definition of encoding tables back within `cffload.c'
|
||||
instead of making them part of a shared header (causing problems in
|
||||
"multi" builds). This reverts change 2001-08-08.
|
||||
`multi' builds). This reverts change 2001-08-08.
|
||||
|
||||
* docs/CHANGES: Updated for 2.0.6 release.
|
||||
* docs/TODO: Added "stem3 and counter hints support" to the TODO
|
||||
* docs/TODO: Added `stem3 and counter hints support' to the TODO
|
||||
list for the Postscript hinter.
|
||||
* docs/BUGS: Closed the AUTOHINT-NO-SBITS bug.
|
||||
|
||||
|
@ -6420,12 +6440,12 @@
|
|||
that prevented composites from loading correctly, due to missing
|
||||
parentheses around macro parameters.
|
||||
|
||||
* src/sfnt/sfobjs.c (SFNT_Load_Face): Make the "post" and "name"
|
||||
* src/sfnt/sfobjs.c (SFNT_Load_Face): Make the `post' and `name'
|
||||
tables optional to load PCL fonts properly.
|
||||
|
||||
* src/truetype/ttgload.c (TT_Load_Glyph), src/base/ftobjs.c
|
||||
(FT_Load_Glyph), include/freetype/freetype.h (FT_LOAD_SBITS_ONLY):
|
||||
"Fixed" the bug that prevented embedded bitmaps to be loaded when
|
||||
`Fixed' the bug that prevented embedded bitmaps to be loaded when
|
||||
the auto-hinter is used. This actually is a hack but will be enough
|
||||
until the internal re-design scheduled for FreeType 2.1.
|
||||
|
||||
|
@ -6514,9 +6534,9 @@
|
|||
2001-12-11 David Turner <david@freetype.org>
|
||||
|
||||
* builds/unix/freetype-config.in: Modified the script to prevent
|
||||
passing "-L/usr/lib" to gcc.
|
||||
passing `-L/usr/lib' to gcc.
|
||||
|
||||
* docs/FTL.TXT: Simple fix (change "LICENSE.TXT" to "FTL.TXT").
|
||||
* docs/FTL.TXT: Simple fix (change `LICENSE.TXT' to `FTL.TXT').
|
||||
|
||||
* builds/unix/freetype2.m4: New file for checking configure paths.
|
||||
We need to install it in $(prefix)/share/aclocal/freetype2.m4 but I
|
||||
|
@ -6537,7 +6557,7 @@
|
|||
2001-12-10 Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>
|
||||
|
||||
* src/pcf/pcfdriver.c (PCF_Init_Face): Allow Xft to use PCF fonts
|
||||
by setting the "face->metrics.max_advance" correctly.
|
||||
by setting the `face->metrics.max_advance' correctly.
|
||||
|
||||
2001-12-07 David Turner <david@freetype.org>
|
||||
|
||||
|
@ -6636,8 +6656,8 @@
|
|||
* 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 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
|
||||
(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>
|
||||
|
@ -6684,7 +6704,7 @@
|
|||
Fix typos.
|
||||
|
||||
* tests/gview.c: Updated the debugging glyph viewer to show the
|
||||
hints generated by the "autohint" module.
|
||||
hints generated by the `autohint' module.
|
||||
|
||||
2001-10-27 David Turner <david@freetype.org>
|
||||
|
||||
|
@ -6695,7 +6715,7 @@
|
|||
|
||||
* 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
|
||||
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>
|
||||
|
@ -6763,7 +6783,7 @@
|
|||
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
|
||||
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.
|
||||
|
||||
|
@ -6817,7 +6837,7 @@
|
|||
compiler warnings.
|
||||
|
||||
* src/pshinter/module.mk, src/pshinter/rules.mk: Adding control
|
||||
files to build the PostScript hinter with the "old" build system.
|
||||
files to build the PostScript hinter with the `old' build system.
|
||||
|
||||
2001-10-19 Jacob Jansen <joukj@hrem.stm.tudelft.nl>
|
||||
|
||||
|
@ -6827,7 +6847,7 @@
|
|||
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.
|
||||
`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.
|
||||
|
||||
|
@ -6869,7 +6889,7 @@
|
|||
* 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>
|
||||
|
||||
|
@ -6991,7 +7011,7 @@
|
|||
in PDF documents that were automatically generated from TrueType
|
||||
ones).
|
||||
|
||||
* src/type1/t1load.c (is_alpha): Now supports "+" in font names;
|
||||
* src/type1/t1load.c (is_alpha): Now supports `+' in font names;
|
||||
this is used in embedded fonts.
|
||||
|
||||
* src/psaux/psobjs.c (PS_Table_Add): Fixed a reallocation bug that
|
||||
|
@ -7073,7 +7093,7 @@
|
|||
(cff_get_glyph_index): Minor documentation change.
|
||||
|
||||
* src/type1/t1driver.c (t1_get_name_index): New function used in
|
||||
Get_Interface as the function returned when the "name_index"
|
||||
Get_Interface as the function returned when the `name_index'
|
||||
function is requested.
|
||||
|
||||
(get_t1_glyph_name): Renamed to t1_get_glyph_name for consistency.
|
||||
|
@ -7090,10 +7110,10 @@
|
|||
|
||||
* src/cff/cffdrivr.c (cff_get_name_index): New function, returned
|
||||
when `cff_get_interface' is called with a request for the
|
||||
"name_index" function.
|
||||
`name_index' function.
|
||||
|
||||
(cff_get_interface): Modified so that it returns the function
|
||||
`cff_get_name_index' when the "name_index" function is requested.
|
||||
`cff_get_name_index' when the `name_index' function is requested.
|
||||
|
||||
* src/base/ftobjs.c (FT_Get_Name_Index): New function, used to
|
||||
return a glyph index for a given glyph name only if the driver
|
||||
|
@ -7239,7 +7259,7 @@
|
|||
Removing _lots_ of compiler warnings when the most pedantic warning
|
||||
levels of Visual C++ and Borland C++ are used. Too many files to be
|
||||
listed here, but FT2 now compiles without warnings with VC++ and the
|
||||
"/W4" warning level (lint-style).
|
||||
`/W4' warning level (lint-style).
|
||||
|
||||
* include/freetype/freetype.h (FT_New_Memory_Face): Updated
|
||||
documentation.
|
||||
|
@ -7313,9 +7333,9 @@
|
|||
2001-06-14 David Turner <david@freetype.org>
|
||||
|
||||
Modified the TrueType interpreter to let it use the new
|
||||
trigonometric functions provided in "fttrigon.h". This gets rid of
|
||||
trigonometric functions provided in `fttrigon.h'. This gets rid of
|
||||
some old 64-bit computation routines, as well as many warnings when
|
||||
compiling the library with the "long long" 64-bit integer type.
|
||||
compiling the library with the `long long' 64-bit integer type.
|
||||
|
||||
* include/freetype/config/ftoption.h: Undefine
|
||||
FT_CONFIG_OPTION_OLD_CALCS.
|
||||
|
@ -7437,7 +7457,7 @@
|
|||
|
||||
2001-05-25 David Turner <david@freetype.org>
|
||||
|
||||
Moved several documents from the top-level to the "docs" directory.
|
||||
Moved several documents from the top-level to the `docs' directory.
|
||||
|
||||
* src/base/ftcalc.c (FT_DivFix): Small fix to return value.
|
||||
|
||||
|
@ -7491,9 +7511,9 @@
|
|||
|
||||
* builds/newline: New file.
|
||||
* builds/top_level.mk, builds/detect.mk: Use it. This fixes
|
||||
problems with Make on Windows 2000, as well as problems when "make
|
||||
distclean" is invoked on a non-Unix platform when there is no
|
||||
"config.mk" in the current directory.
|
||||
problems with Make on Windows 2000, as well as problems when `make
|
||||
distclean' is invoked on a non-Unix platform when there is no
|
||||
`config.mk' in the current directory.
|
||||
|
||||
* builds/freetype.mk: Fixed a problem with object deletions under
|
||||
Dos/Windows/OS/2 systems.
|
||||
|
@ -7545,7 +7565,7 @@
|
|||
|
||||
* src/base/ftcalc.c (FT_MulDiv, FT_MulFix, FT_DivFix): Various tiny
|
||||
fixes related to rounding in 64-bits routines and
|
||||
pseudo-"optimizations".
|
||||
pseudo-`optimizations'.
|
||||
|
||||
2001-04-27 David Turner <david@freetype.org>
|
||||
|
||||
|
@ -7572,7 +7592,7 @@
|
|||
fixed-point square root computation. It is now used even with
|
||||
64-bits integers, as it is _much_ faster than calling FT_Sqrt64 :-)
|
||||
|
||||
* src/base/ftbbox.c: Removed invalid "#include FT_BEZIER_H" line.
|
||||
* src/base/ftbbox.c: Removed invalid `#include FT_BEZIER_H' line.
|
||||
|
||||
2001-04-25 David Turner <david@freetype.org>
|
||||
|
||||
|
@ -7590,7 +7610,7 @@
|
|||
|
||||
2001-04-20 David Turner <david@freetype.org>
|
||||
|
||||
* ftconfig.h, ftoption.h: Updated "ftconfig.h" to detect 64-bit int
|
||||
* ftconfig.h, ftoption.h: Updated `ftconfig.h' to detect 64-bit int
|
||||
types on platforms where Autoconf is not available). Also removed
|
||||
FTCALC_USE_LONG_LONG and replaced it with
|
||||
FT_CONFIG_OPTION_FORCE_INT64.
|
||||
|
@ -7707,7 +7727,7 @@
|
|||
2001-03-20 David Turner <david.turner@freetype.org>
|
||||
|
||||
* include/freetype/config/ftheader.h, include/freetype/ftsnames.h:
|
||||
Renamed "ftnames.h" to "ftsnames.h", and FT_NAMES_H to
|
||||
Renamed `ftnames.h' to `ftsnames.h', and FT_NAMES_H to
|
||||
FT_SFNT_NAMES_H.
|
||||
|
||||
* docs/docmaker.py: Added generation of INDEX link in table of
|
||||
|
@ -7717,8 +7737,8 @@
|
|||
compilation process has changed slightly (no more `src' required in
|
||||
the include path).
|
||||
|
||||
* builds/*/*-def.mk: Changed the objects directory from "obj" to
|
||||
"objs".
|
||||
* builds/*/*-def.mk: Changed the objects directory from `obj' to
|
||||
`objs'.
|
||||
|
||||
* include/freetype/config/ftheader.h: Removed obsolete macros like
|
||||
FT_SOURCE_FILE, etc. and added cache-specific macro definitions that
|
||||
|
@ -7727,7 +7747,7 @@
|
|||
|
||||
* src/*/*: Removed the use of FT_SOURCE_FILE, etc. Now, each
|
||||
component needs to add its own directory to the include path at
|
||||
compile time. Modified all "rules.mk" and "descrip.mms"
|
||||
compile time. Modified all `rules.mk' and `descrip.mms'
|
||||
accordingly.
|
||||
|
||||
2001-03-20 Werner Lemberg <wl@gnu.org>
|
||||
|
@ -7753,7 +7773,7 @@
|
|||
compiler warnings in pedantic modes.
|
||||
|
||||
* include/config/ft2build.h, include/config/ftheader.h: The file
|
||||
"ft2build.h" was renamed to "ftheader.h" to avoid conflicts with the
|
||||
`ft2build.h' was renamed to `ftheader.h' to avoid conflicts with the
|
||||
top-level <ft2build.h>.
|
||||
|
||||
* include/config/ftheader.h: Added new section describing the #include
|
||||
|
@ -7775,7 +7795,7 @@
|
|||
via FT_Get_Glyph_Name().
|
||||
|
||||
(cff_get_interface): Added support for getting a glyph name via the
|
||||
"glyph_name" module interface. Uses the new function
|
||||
`glyph_name' module interface. Uses the new function
|
||||
get_cff_glyph_name().
|
||||
Submitted by Sander van der Wal <svdwal@xs4all.nl>.
|
||||
|
||||
|
@ -7786,7 +7806,7 @@
|
|||
Submitted by Sander van der Wal <svdwal@xs4all.nl>.
|
||||
|
||||
* src/cff/cffgload.c (CFF_Parse_CharStrings): Added support for
|
||||
deprecated operator "dotsection".
|
||||
deprecated operator `dotsection'.
|
||||
Submitted by Sander van der Wal <svdwal@xs4all.nl>.
|
||||
|
||||
2001-03-12 Werner Lemberg <wl@gnu.org>
|
||||
|
@ -7972,7 +7992,7 @@
|
|||
2001-02-01 David Turner <david.turner@freetype.org>
|
||||
|
||||
* docs/docmaker.py: Improved the index sorting routine to place
|
||||
capital letters before small ones. Added the "<order>" marker to
|
||||
capital letters before small ones. Added the `<order>' marker to
|
||||
section blocks in order to give the order of blocks.
|
||||
|
||||
2001-01-30 Antoine Leca <Antoine.Leca@renault.fr>
|
||||
|
@ -8179,7 +8199,7 @@
|
|||
* src/smooth/ftgrays.c (grays_convert_glyph): Implement it.
|
||||
|
||||
* INSTALL: Updated installation instructions on Win32, listing the
|
||||
new "make setup list" target used to list supported
|
||||
new `make setup list' target used to list supported
|
||||
compilers/targets.
|
||||
|
||||
* src/raster/ftraster.c (ft_black_render): Test for unsupported
|
||||
|
@ -8197,7 +8217,7 @@
|
|||
|
||||
* builds/win32/detect.mk: Added support for the Intel C/C++
|
||||
compiler, as well as _preliminary_ (read: doesn't work!) support for
|
||||
Watcom. Also added a new setup target. Type "make setup list" for
|
||||
Watcom. Also added a new setup target. Type `make setup list' for
|
||||
a list of supported command-line compilers on Win32.
|
||||
|
||||
* src/base/ftdebug.c: Added dummy symbol to avoid empty file if
|
||||
|
@ -8298,16 +8318,16 @@
|
|||
pointer).
|
||||
|
||||
* src/base/ftsystem.c (FT_Done_Memory): Fixed an obvious bug:
|
||||
The ANSI "free()" function was called instead of "memory->free()".
|
||||
The ANSI `free()' function was called instead of `memory->free()'.
|
||||
|
||||
* docs/docmaker.py: Added section filtering, multi-page generation
|
||||
(index page generation is still missing though).
|
||||
|
||||
2000-12-04 David Turner <david.turner@freetype.org>
|
||||
|
||||
* builds/unix/install.mk, builds/unix/ft2unix.h: The file "ft2unix.h"
|
||||
* builds/unix/install.mk, builds/unix/ft2unix.h: The file `ft2unix.h'
|
||||
is now installed as <ft2build.h> for Unix systems. Note that we
|
||||
still use the "freetype2/freetype" installation path for now.
|
||||
still use the `freetype2/freetype' installation path for now.
|
||||
|
||||
* */*.[ch]: Now using <ft2build.h> as the default build and setup
|
||||
configuration file in all public headers. Internal source files
|
||||
|
@ -8319,7 +8339,7 @@
|
|||
|
||||
* builds/win32/detect.mk, builds/win32/w32-bccd.mk,
|
||||
builds/win32/w32-dev.mk: Changed the developer build targets to
|
||||
"devel-gcc" and "devel-bcc" in order to be able to develop with the
|
||||
`devel-gcc' and `devel-bcc' in order to be able to develop with the
|
||||
Borland C++ compiler.
|
||||
|
||||
2000-12-01 David Turner <david.turner@freetype.org>
|
||||
|
@ -8331,7 +8351,7 @@
|
|||
|
||||
* 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.
|
||||
`version_info' to 6:1:0 for the 2.0.1 release.
|
||||
|
||||
* CHANGES: Added a summary of changes between 2.0.1 and 2.0.
|
||||
|
||||
|
@ -8358,13 +8378,13 @@
|
|||
2000-11-30 David Turner <david.turner@freetype.ogr>
|
||||
|
||||
* INSTALL: Slightly updated the quick starter documentation to
|
||||
include IDE compilation, prevent against BSD Make, and specify "make
|
||||
setup" instead of a single "make" for build configuration.
|
||||
include IDE compilation, prevent against BSD Make, and specify `make
|
||||
setup' instead of a single `make' for build configuration.
|
||||
|
||||
* include/config/ftbuild.h, include/internal/internal.h: Added new
|
||||
configuration files used to determine the location of all public,
|
||||
configuration, and internal header files for FreeType 2. Modified
|
||||
all headers under "include/freetype" to reflect this change. Note
|
||||
all headers under `include/freetype' to reflect this change. Note
|
||||
that we still need to change the library source files themselves
|
||||
though.
|
||||
|
||||
|
@ -8372,7 +8392,7 @@
|
|||
builds/win32/w32-bcc.mk, builds/win32/w32-bccd.mk,
|
||||
builds/win32/detect.mk: Added new files to support compilation with
|
||||
the free Borland C++ command-line compiler. Modified the detection
|
||||
rules to recognize the new "bcc32" target in "make setup bcc32".
|
||||
rules to recognize the new `bcc32' target in `make setup bcc32'.
|
||||
|
||||
* src/sfnt/ttcmap.c, src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
|
||||
src/truetype/ttobjs.c, src/truetype/ttgload.c,
|
||||
|
|
64
docs/CHANGES
64
docs/CHANGES
|
@ -35,6 +35,70 @@ LATEST CHANGES BETWEEN 2.1.8 and 2.1.7
|
|||
`tttables.h') is available to get the language ID of a
|
||||
TrueType/SFNT cmap.
|
||||
|
||||
- The cache sub-system has been rewritten.
|
||||
|
||||
- There is now support for deinstallation of faces.
|
||||
|
||||
- A new API function `FTC_Manager_RemoveFaceID' has been added
|
||||
to delete all `idle' nodes that correspond to a given
|
||||
FTC_FaceID. All `locked' nodes (i.e., those with a reference
|
||||
count > 0), will be modified to prevent them from appearing in
|
||||
further lookups (they will be cleaned normally when their
|
||||
reference count reaches 0).
|
||||
|
||||
- There is now support for point scaling (i.e., providing
|
||||
character sizes in points + dpis, instead of pixels).
|
||||
|
||||
- Three abstract cache classes are now available:
|
||||
|
||||
FTC_GCache: Used to store one glyph item per cache node,
|
||||
with the ability to group common attributes into
|
||||
`families'. This replaces the old
|
||||
FTC_GlyphCache class.
|
||||
|
||||
FTC_ICache: Used to store one FT_Glyph per cache node. This
|
||||
extends FTC_GCache. Family definition, family
|
||||
comparison, and glyph loading are however left
|
||||
to sub-classes.
|
||||
|
||||
FTC_SCache: Used to store up to 16 small bitmaps per cache
|
||||
node. This extends FTC_GCache. Family
|
||||
definition, family comparison and glyph loading
|
||||
are however left to sub-classes.
|
||||
|
||||
- The file `src/cache/ftcbasic.c' implements:
|
||||
|
||||
FTC_ImageCache: Extends FTC_ICache; implements family
|
||||
definitions and glyph loading similar to the
|
||||
old API.
|
||||
|
||||
FTC_SBitCache: Extends FTC_SCache, implements family
|
||||
definitions and glyph loading similar to the
|
||||
old API
|
||||
|
||||
Client applications should be able to extend FTC_GCache,
|
||||
FTC_ICache, or FTC_SCache much more easily (i.e., less code to
|
||||
write, and less callbacks). For example, one could envision
|
||||
caches that are capable of storing transformed (obliqued),
|
||||
stroked, emboldened, or colored glyph images. Use
|
||||
`ftcbasic.c' as an example.
|
||||
|
||||
- All public APIs are now in `include/freetype/ftcache.h', (to
|
||||
be accessed as `FT_CACHE_H'). The contents of
|
||||
`include/freetype/cache/' is only needed by applications that
|
||||
wish to implement their own caches.
|
||||
|
||||
- There were some major performance improvements through the use
|
||||
of various programming tricks. Cache hits are up to 70%
|
||||
faster than in the old code.
|
||||
|
||||
- The FTC_CMapCache has been simplied. Charmaps can only be
|
||||
accessed by index right now. There is also a new API named
|
||||
`FT_Charmap_GetIndex' for this purpose.
|
||||
|
||||
- The demo programs have been updated to the new code. The
|
||||
previous versions will not work with the current one.
|
||||
|
||||
|
||||
III. MISCELLANEOUS
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType internal cache interface (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002 by */
|
||||
/* Copyright 2000-2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -30,6 +30,7 @@ FT_BEGIN_HEADER
|
|||
/* handle to cache class */
|
||||
typedef const struct FTC_CacheClassRec_* FTC_CacheClass;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -68,6 +69,7 @@ FT_BEGIN_HEADER
|
|||
#define FTC_NODE__NEXT(x) FTC_NODE( (x)->mru.next )
|
||||
#define FTC_NODE__PREV(x) FTC_NODE( (x)->mru.prev )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* These functions are exported so that they can be called from */
|
||||
|
@ -81,7 +83,6 @@ FT_BEGIN_HEADER
|
|||
FTC_Manager manager );
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -91,25 +92,31 @@ FT_BEGIN_HEADER
|
|||
/*************************************************************************/
|
||||
|
||||
/* initialize a new cache node */
|
||||
typedef FT_Error (*FTC_Node_NewFunc)( FTC_Node *pnode,
|
||||
typedef FT_Error
|
||||
(*FTC_Node_NewFunc)( FTC_Node *pnode,
|
||||
FT_Pointer query,
|
||||
FTC_Cache cache );
|
||||
|
||||
typedef FT_ULong (*FTC_Node_WeightFunc)( FTC_Node node,
|
||||
typedef FT_ULong
|
||||
(*FTC_Node_WeightFunc)( FTC_Node node,
|
||||
FTC_Cache cache );
|
||||
|
||||
/* compare a node to a given key pair */
|
||||
typedef FT_Bool (*FTC_Node_CompareFunc)( FTC_Node node,
|
||||
typedef FT_Bool
|
||||
(*FTC_Node_CompareFunc)( FTC_Node node,
|
||||
FT_Pointer key,
|
||||
FTC_Cache cache );
|
||||
|
||||
|
||||
typedef void (*FTC_Node_FreeFunc)( FTC_Node node,
|
||||
typedef void
|
||||
(*FTC_Node_FreeFunc)( FTC_Node node,
|
||||
FTC_Cache cache );
|
||||
|
||||
typedef FT_Error (*FTC_Cache_InitFunc)( FTC_Cache cache );
|
||||
typedef FT_Error
|
||||
(*FTC_Cache_InitFunc)( FTC_Cache cache );
|
||||
|
||||
typedef void (*FTC_Cache_DoneFunc)( FTC_Cache cache );
|
||||
typedef void
|
||||
(*FTC_Cache_DoneFunc)( FTC_Cache cache );
|
||||
|
||||
|
||||
typedef struct FTC_CacheClassRec_
|
||||
|
@ -126,6 +133,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
} FTC_CacheClassRec;
|
||||
|
||||
|
||||
/* each cache really implements a dynamic hash table to manage its nodes */
|
||||
typedef struct FTC_CacheRec_
|
||||
{
|
||||
|
@ -157,7 +165,7 @@ FT_BEGIN_HEADER
|
|||
FT_EXPORT( void )
|
||||
FTC_Cache_Done( FTC_Cache cache );
|
||||
|
||||
/* call this function to lookup the cache. if no corresponding
|
||||
/* Call this function to lookup the cache. If no corresponding
|
||||
* node is found, a new one is automatically created. This function
|
||||
* is capable of flushing the cache adequately to make room for the
|
||||
* new cache object.
|
||||
|
@ -174,15 +182,15 @@ FT_BEGIN_HEADER
|
|||
FT_Pointer query,
|
||||
FTC_Node *anode );
|
||||
|
||||
/* remove all nodes that relate to a given face_id. This is useful
|
||||
/* Remove all nodes that relate to a given face_id. This is useful
|
||||
* when un-installing fonts. Note that if a cache node relates to
|
||||
* the face_id, but is locked (i.e. has 'ref_count > 0'), the node
|
||||
* the face_id, but is locked (i.e., has 'ref_count > 0'), the node
|
||||
* will _not_ be destroyed, but its internal face_id reference will
|
||||
* be modified.
|
||||
*
|
||||
* the end result will be that the node will never come back
|
||||
* The final result will be that the node will never come back
|
||||
* in further lookup requests, and will be flushed on demand from
|
||||
* the cache normally when its reference count reaches 0
|
||||
* the cache normally when its reference count reaches 0.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FTC_Cache_RemoveFaceID( FTC_Cache cache,
|
||||
|
@ -198,6 +206,7 @@ FT_BEGIN_HEADER
|
|||
FTC_Node_CompareFunc _nodcomp = (FTC_Node_CompareFunc)(nodecmp); \
|
||||
FT_UInt _idx; \
|
||||
\
|
||||
\
|
||||
error = 0; \
|
||||
_idx = _hash & _cache->mask; \
|
||||
if ( _idx < _cache->p ) \
|
||||
|
@ -226,6 +235,7 @@ FT_BEGIN_HEADER
|
|||
{ \
|
||||
FTC_Manager _manager = _cache->manager; \
|
||||
\
|
||||
\
|
||||
if ( _node != _manager->nodes_list ) \
|
||||
FTC_MruNode_Up( (FTC_MruNode*)&_manager->nodes_list, \
|
||||
(FTC_MruNode)_node ); \
|
||||
|
|
|
@ -21,49 +21,48 @@
|
|||
* FTC_GCache is an _abstract_ cache object optimized to store glyph
|
||||
* data. It works as follows:
|
||||
*
|
||||
* - it manages FTC_GNode objects. Each one of them can hold one or more
|
||||
* glyph "items". Item types are not specified in the FTC_GCache but in
|
||||
* classes that extend it
|
||||
* - It manages FTC_GNode objects. Each one of them can hold one or more
|
||||
* glyph `items'. Item types are not specified in the FTC_GCache but
|
||||
* in classes that extend it.
|
||||
*
|
||||
* - glyph attributes, like face_id, character size, render mode, etc..
|
||||
* can be grouped in abstract "glyph families". This avoids storing
|
||||
* - Glyph attributes, like face ID, character size, render mode, etc.,
|
||||
* can be grouped into abstract `glyph families'. This avoids storing
|
||||
* the attributes within the FTC_GCache, since it is likely that many
|
||||
* FTC_GNodes will belong to the same family in typical uses
|
||||
* FTC_GNodes will belong to the same family in typical uses.
|
||||
*
|
||||
* - each FTC_GNode is thus a FTC_Node with two additionnal fields:
|
||||
* - Each FTC_GNode is thus an FTC_Node with two additional fields:
|
||||
*
|
||||
* * gindex :: a glyph index, or the first index in a glyph range
|
||||
* * family :: a pointer to a glyph "family"
|
||||
* * gindex: A glyph index, or the first index in a glyph range.
|
||||
* * family: A pointer to a glyph `family'.
|
||||
*
|
||||
* - Family types are not fully specific in the FTC_Family type, but
|
||||
* by classes that extend it.
|
||||
*
|
||||
* Note that both FTC_ImageCache and FTC_SBitCache extend FTC_GCache. They
|
||||
* share an FTC_Family sub-class called FTC_BasicFamily which is used to
|
||||
* store the following data: face_id, pixel/point sizes, load flags.
|
||||
* for more details, see the file "src/cache/ftcbasic.c"
|
||||
* Note that both FTC_ImageCache and FTC_SBitCache extend FTC_GCache.
|
||||
* They share an FTC_Family sub-class called FTC_BasicFamily which is
|
||||
* used to store the following data: face ID, pixel/point sizes, load
|
||||
* flags. For more details see the file `src/cache/ftcbasic.c'.
|
||||
*
|
||||
* Client applications can extend FTC_GNode with their own FTC_GNode
|
||||
* and FTC_Family sub-classes to implement more complex caches (e.g.
|
||||
* handling automatic synthetis, like obliquing & emboldening, colored
|
||||
* glyphs, etc...)
|
||||
* and FTC_Family sub-classes to implement more complex caches (e.g.,
|
||||
* handling automatic synthesis, like obliquing & emboldening, colored
|
||||
* glyphs, etc.).
|
||||
*
|
||||
* See also the FTC_ICache & FTC_SCache classes in "ftcimage.h" and
|
||||
* "ftcsbits.h", which both extend FTC_GCache with additionnal
|
||||
* See also the FTC_ICache & FTC_SCache classes in `ftcimage.h' and
|
||||
* `ftcsbits.h', which both extend FTC_GCache with additional
|
||||
* optimizations.
|
||||
*
|
||||
* A typical FTC_GCache implementation must provide at least the
|
||||
* following:
|
||||
*
|
||||
* a typical FTC_GCache implementation must provide at least the following:
|
||||
*
|
||||
* - FTC_GNode sub-class, e.g. MyNode, with relevant methods, i.e:
|
||||
* - FTC_GNode sub-class, e.g. MyNode, with relevant methods:
|
||||
* my_node_new (must call FTC_GNode_Init)
|
||||
* my_node_free (must call FTC_GNode_Done)
|
||||
* my_node_compare (must call FTC_GNode_Compare)
|
||||
* my_node_remove_faceid (must call ftc_gnode_unselect in case
|
||||
* of match)
|
||||
*
|
||||
*
|
||||
* - FTC_Family sub-class, e.g. MyFamily, with relevant methods, e.g.:
|
||||
* - FTC_Family sub-class, e.g. MyFamily, with relevant methods:
|
||||
* my_family_compare
|
||||
* my_family_init
|
||||
* my_family_reset (optional)
|
||||
|
@ -72,23 +71,24 @@
|
|||
* - FTC_GQuery sub-class, e.g. MyQuery, to hold cache-specific query
|
||||
* data.
|
||||
*
|
||||
* - provide constant structures for a FTC_GNodeClass
|
||||
* - Constant structures for a FTC_GNodeClass.
|
||||
*
|
||||
* - MyCacheNew() can be implemented easily as a call to the convenience
|
||||
* function FTC_GCache_New
|
||||
* function FTC_GCache_New.
|
||||
*
|
||||
* - implement MyCacheLookup with a call to FTC_GCache_Lookup. This
|
||||
* function will automatically:
|
||||
* - MyCacheLookup with a call to FTC_GCache_Lookup. This function will
|
||||
* automatically:
|
||||
*
|
||||
* - search for the corresponding family in the cache, or create
|
||||
* a new one if necessary. put it in FTC_GQUERY(myquery).family
|
||||
* - Search for the corresponding family in the cache, or create
|
||||
* a new one if necessary. Put it in FTC_GQUERY(myquery).family
|
||||
*
|
||||
* - call FTC_Cache_Lookup
|
||||
* - Call FTC_Cache_Lookup.
|
||||
*
|
||||
* if it returns NULL, you should create a new node, then call
|
||||
* If it returns NULL, you should create a new node, then call
|
||||
* ftc_cache_add as usual.
|
||||
*/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Important: The functions defined in this file are only used to */
|
||||
|
@ -125,10 +125,11 @@ FT_BEGIN_HEADER
|
|||
|
||||
|
||||
/*
|
||||
* we can group glyph in "families". Each family correspond to a
|
||||
* given face id, character size, transform, etc...
|
||||
* We can group glyphs into `families'. Each family correspond to a
|
||||
* given face ID, character size, transform, etc.
|
||||
*
|
||||
* families are implemented as MRU list nodes. They are reference-counted
|
||||
* Families are implemented as MRU list nodes. They are
|
||||
* reference-counted.
|
||||
*/
|
||||
|
||||
typedef struct FTC_FamilyRec_
|
||||
|
@ -166,8 +167,6 @@ FT_BEGIN_HEADER
|
|||
#define FTC_GQUERY( x ) ( (FTC_GQuery)(x) )
|
||||
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* These functions are exported so that they can be called from */
|
||||
|
@ -188,9 +187,8 @@ FT_BEGIN_HEADER
|
|||
FTC_GNode_Compare( FTC_GNode gnode,
|
||||
FTC_GQuery gquery );
|
||||
|
||||
/* call this function to clear a node's family. this is necessary
|
||||
* to implement the "node_remove_faceid" cache method correctly
|
||||
*/
|
||||
/* call this function to clear a node's family -- this is necessary */
|
||||
/* to implement the `node_remove_faceid' cache method correctly */
|
||||
FT_EXPORT( void )
|
||||
FTC_GNode_UnselectFamily( FTC_GNode gnode,
|
||||
FTC_Cache cache );
|
||||
|
@ -212,7 +210,6 @@ FT_BEGIN_HEADER
|
|||
|
||||
} FTC_GCacheRec, *FTC_GCache;
|
||||
|
||||
|
||||
#define FTC_GCACHE( x ) ((FTC_GCache)(x))
|
||||
|
||||
|
||||
|
@ -238,11 +235,13 @@ FT_BEGIN_HEADER
|
|||
|
||||
#define FTC_GCACHE_CLASS( x ) ((FTC_GCacheClass)(x))
|
||||
|
||||
#define FTC_CACHE__GCACHE_CLASS(x) FTC_GCACHE_CLASS( FTC_CACHE(x)->org_class )
|
||||
#define FTC_CACHE__FAMILY_CLASS(x) ((FTC_MruListClass) FTC_CACHE__GCACHE_CLASS(x)->family_class)
|
||||
#define FTC_CACHE__GCACHE_CLASS( x ) \
|
||||
FTC_GCACHE_CLASS( FTC_CACHE(x)->org_class )
|
||||
#define FTC_CACHE__FAMILY_CLASS( x ) \
|
||||
((FTC_MruListClass) FTC_CACHE__GCACHE_CLASS(x)->family_class)
|
||||
|
||||
|
||||
/* convenience function. use instead of FTC_Manager_Register_Cache */
|
||||
/* convenience function; use it instead of FTC_Manager_Register_Cache */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_GCache_New( FTC_Manager manager,
|
||||
FTC_GCacheClass clazz,
|
||||
|
@ -256,13 +255,15 @@ FT_BEGIN_HEADER
|
|||
FTC_Node *anode );
|
||||
|
||||
|
||||
#define FTC_GCACHE_LOOKUP_CMP( cache, famcmp, nodecmp, hash, gindex, query, node, error ) \
|
||||
#define FTC_GCACHE_LOOKUP_CMP( cache, famcmp, nodecmp, hash, \
|
||||
gindex, query, node, error ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FTC_GCache _gcache = FTC_GCACHE( cache ); \
|
||||
FTC_Family _family; \
|
||||
FTC_GQuery _gquery = (FTC_GQuery)( query ); \
|
||||
FTC_MruNode_CompareFunc _fcompare = (FTC_MruNode_CompareFunc)(famcmp); \
|
||||
\
|
||||
\
|
||||
_gquery->gindex = (gindex); \
|
||||
\
|
||||
FTC_MRULIST_LOOP( &_gcache->families, _family ) \
|
||||
|
|
|
@ -21,10 +21,10 @@
|
|||
* image per cache node.
|
||||
*
|
||||
* FTC_ICache extends FTC_GCache. For an implementation example,
|
||||
* see FTC_ImageCache in "src/cache/ftbasic.c"
|
||||
*
|
||||
* see FTC_ImageCache in `src/cache/ftbasic.c'.
|
||||
*/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Each image cache really manages FT_Glyph objects. */
|
||||
|
@ -55,7 +55,8 @@ FT_BEGIN_HEADER
|
|||
#define FTC_INODE_GINDEX( x ) FTC_GNODE(x)->gindex
|
||||
#define FTC_INODE_FAMILY( x ) FTC_GNODE(x)->family
|
||||
|
||||
typedef FT_Error (*FTC_IFamily_LoadGlyphFunc)( FTC_Family family,
|
||||
typedef FT_Error
|
||||
(*FTC_IFamily_LoadGlyphFunc)( FTC_Family family,
|
||||
FT_UInt gindex,
|
||||
FTC_Cache cache,
|
||||
FT_Glyph *aglyph );
|
||||
|
@ -74,14 +75,15 @@ FT_BEGIN_HEADER
|
|||
#define FTC_CACHE__IFAMILY_CLASS( x ) \
|
||||
FTC_IFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS(x)->family_class )
|
||||
|
||||
|
||||
/* can be used as a @FTC_Node_FreeFunc */
|
||||
FT_EXPORT( void )
|
||||
FTC_INode_Free( FTC_INode inode,
|
||||
FTC_Cache cache );
|
||||
|
||||
/* can be used as @FTC_Node_NewFunc. "gquery.index" & "gquery.family" must
|
||||
* be set correctly. this function will call the 'family_load_glyph' method
|
||||
* to load the FT_Glyph into the cache node
|
||||
/* Can be used as @FTC_Node_NewFunc. `gquery.index' and `gquery.family'
|
||||
* must be set correctly. This function will call the `family_load_glyph'
|
||||
* method to load the FT_Glyph into the cache node.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_INode_New( FTC_INode *pinode,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType Cache Manager (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001 by */
|
||||
/* Copyright 2000-2001, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -87,6 +87,7 @@ FT_BEGIN_HEADER
|
|||
/* maximum number of caches registered in a single manager */
|
||||
#define FTC_MAX_CACHES 16
|
||||
|
||||
|
||||
typedef struct FTC_ManagerRec_
|
||||
{
|
||||
FT_Library library;
|
||||
|
@ -134,7 +135,7 @@ FT_BEGIN_HEADER
|
|||
FTC_Manager_Compress( FTC_Manager manager );
|
||||
|
||||
|
||||
/* try to flush "count" old nodes from the cache. return the number
|
||||
/* try to flush `count' old nodes from the cache; return the number
|
||||
* of really flushed nodes
|
||||
*/
|
||||
FT_EXPORT( FT_UInt )
|
||||
|
|
|
@ -67,6 +67,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
} FTC_MruNodeRec;
|
||||
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruNode_Prepend( FTC_MruNode *plist,
|
||||
FTC_MruNode node );
|
||||
|
@ -79,24 +80,31 @@ FT_BEGIN_HEADER
|
|||
FTC_MruNode_Remove( FTC_MruNode *plist,
|
||||
FTC_MruNode node );
|
||||
|
||||
|
||||
typedef struct FTC_MruListRec_* FTC_MruList;
|
||||
|
||||
typedef struct FTC_MruListClassRec_ const * FTC_MruListClass;
|
||||
|
||||
typedef FT_Int (*FTC_MruNode_CompareFunc)( FTC_MruNode node,
|
||||
|
||||
typedef FT_Int
|
||||
(*FTC_MruNode_CompareFunc)( FTC_MruNode node,
|
||||
FT_Pointer key );
|
||||
|
||||
typedef FT_Error (*FTC_MruNode_InitFunc)( FTC_MruNode node,
|
||||
typedef FT_Error
|
||||
(*FTC_MruNode_InitFunc)( FTC_MruNode node,
|
||||
FT_Pointer key,
|
||||
FT_Pointer data );
|
||||
|
||||
typedef FT_Error (*FTC_MruNode_ResetFunc)( FTC_MruNode node,
|
||||
typedef FT_Error
|
||||
(*FTC_MruNode_ResetFunc)( FTC_MruNode node,
|
||||
FT_Pointer key,
|
||||
FT_Pointer data );
|
||||
|
||||
typedef void (*FTC_MruNode_DoneFunc)( FTC_MruNode node,
|
||||
typedef void
|
||||
(*FTC_MruNode_DoneFunc)( FTC_MruNode node,
|
||||
FT_Pointer data );
|
||||
|
||||
|
||||
typedef struct FTC_MruListClassRec_
|
||||
{
|
||||
FT_UInt node_size;
|
||||
|
@ -154,7 +162,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruList_RemoveSelection( FTC_MruList list,
|
||||
FTC_MruNode_CompareFunc select,
|
||||
FTC_MruNode_CompareFunc selection,
|
||||
FT_Pointer key );
|
||||
|
||||
|
||||
|
@ -165,6 +173,7 @@ FT_BEGIN_HEADER
|
|||
FTC_MruNode_CompareFunc _compare = (list)->clazz.node_compare; \
|
||||
FTC_MruNode _first, _node; \
|
||||
\
|
||||
\
|
||||
error = 0; \
|
||||
_first = (list)->nodes; \
|
||||
_node = NULL; \
|
||||
|
@ -180,8 +189,8 @@ FT_BEGIN_HEADER
|
|||
goto _Ok; \
|
||||
} \
|
||||
_node = _node->next; \
|
||||
} \
|
||||
while ( _node != _first) ; \
|
||||
\
|
||||
} while ( _node != _first) ; \
|
||||
} \
|
||||
\
|
||||
error = FTC_MruList_New( (list), (key), (FTC_MruNode*)&(node) ); \
|
||||
|
@ -201,9 +210,12 @@ FT_BEGIN_HEADER
|
|||
FT_BEGIN_STMNT \
|
||||
FTC_MruNode _first = (list)->nodes; \
|
||||
\
|
||||
\
|
||||
if ( _first ) \
|
||||
{ \
|
||||
FTC_MruNode _node = _first; \
|
||||
\
|
||||
\
|
||||
do \
|
||||
{ \
|
||||
*(FTC_MruNode*)&(node) = _node;
|
||||
|
@ -211,8 +223,8 @@ FT_BEGIN_HEADER
|
|||
|
||||
#define FTC_MRULIST_LOOP_END() \
|
||||
_node = _node->next; \
|
||||
} \
|
||||
while ( _node != _first ); \
|
||||
\
|
||||
} while ( _node != _first ); \
|
||||
} \
|
||||
FT_END_STMNT
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* A small-bitmap cache (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002 by */
|
||||
/* Copyright 2000-2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -42,10 +42,12 @@ FT_BEGIN_HEADER
|
|||
#define FTC_SNODE_GINDEX( x ) FTC_GNODE( x )->gindex
|
||||
#define FTC_SNODE_FAMILY( x ) FTC_GNODE( x )->family
|
||||
|
||||
typedef FT_UInt (*FTC_SFamily_GetCountFunc)( FTC_Family family,
|
||||
typedef FT_UInt
|
||||
(*FTC_SFamily_GetCountFunc)( FTC_Family family,
|
||||
FTC_Manager manager );
|
||||
|
||||
typedef FT_Error (*FTC_SFamily_LoadGlyphFunc)( FTC_Family family,
|
||||
typedef FT_Error
|
||||
(*FTC_SFamily_LoadGlyphFunc)( FTC_Family family,
|
||||
FT_UInt gindex,
|
||||
FTC_Manager manager,
|
||||
FT_Face *aface );
|
||||
|
@ -65,6 +67,7 @@ FT_BEGIN_HEADER
|
|||
#define FTC_CACHE__SFAMILY_CLASS( x ) \
|
||||
FTC_SFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS( x )->family_class )
|
||||
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_SNode_Free( FTC_SNode snode,
|
||||
FTC_Cache cache );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Build macros of the FreeType 2 library. */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -433,8 +433,8 @@
|
|||
/* see the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need */
|
||||
/* to store small glyph bitmaps, as it will use less memory. */
|
||||
/* */
|
||||
/* this macro is *DEPRECATED*, simply include @FT_CACHE_H and you'll */
|
||||
/* have all glyph image-related cache declarations */
|
||||
/* This macro is deprecated. Simply include @FT_CACHE_H to have all */
|
||||
/* glyph image-related cache declarations. */
|
||||
/* */
|
||||
#define FT_CACHE_IMAGE_H FT_CACHE_H
|
||||
|
||||
|
@ -453,8 +453,8 @@
|
|||
/* in @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images, */
|
||||
/* including scalable outlines. */
|
||||
/* */
|
||||
/* this macro is *DEPRECATED*, simply include @FT_CACHE_H and you'll */
|
||||
/* have all small bitmaps-related cache declarations */
|
||||
/* This macro is deprecated. Simply include @FT_CACHE_H to have all */
|
||||
/* small bitmaps-related cache declarations. */
|
||||
/* */
|
||||
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
|
||||
|
||||
|
@ -468,8 +468,8 @@
|
|||
/* A macro used in #include statements to name the file containing */
|
||||
/* the `charmap' API of the FreeType 2 cache sub-system. */
|
||||
/* */
|
||||
/* this macro is *DEPRECATED*, simply include @FT_CACHE_H and you'll */
|
||||
/* have all charmap-based cache declarations */
|
||||
/* This macro is deprecated. Simply include @FT_CACHE_H to have all */
|
||||
/* charmap-based cache declarations. */
|
||||
/* */
|
||||
#define FT_CACHE_CHARMAP_H FT_CACHE_H
|
||||
|
||||
|
|
|
@ -405,7 +405,7 @@ FT_BEGIN_HEADER
|
|||
/* FTC_CMapCache_New */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Creates a new charmap cache. */
|
||||
/* Create a new charmap cache. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* manager :: A handle to the cache manager. */
|
||||
|
@ -425,18 +425,18 @@ FT_BEGIN_HEADER
|
|||
FTC_CMapCache *acache );
|
||||
|
||||
|
||||
/* retrieve the index of a given charmap
|
||||
*/
|
||||
/* retrieve the index of a given charmap */
|
||||
FT_EXPORT( FT_Int )
|
||||
FT_Get_CharMap_Index( FT_CharMap charmap );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FTC_CMapCache_Lookup */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Translates a character code into a glyph index, using the charmap */
|
||||
/* Translate a character code into a glyph index, using the charmap */
|
||||
/* cache. */
|
||||
/* */
|
||||
/* @input: */
|
||||
|
@ -449,7 +449,7 @@ FT_BEGIN_HEADER
|
|||
/* char_code :: The character code (in the corresponding charmap). */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* Glyph index. 0 means "no glyph". */
|
||||
/* Glyph index. 0 means `no glyph'. */
|
||||
/* */
|
||||
FT_EXPORT( FT_UInt )
|
||||
FTC_CMapCache_Lookup( FTC_CMapCache cache,
|
||||
|
@ -463,7 +463,7 @@ FT_BEGIN_HEADER
|
|||
/* <Section> */
|
||||
/* cache_subsystem */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
@ -564,13 +564,13 @@ FT_BEGIN_HEADER
|
|||
/* Never try to transform or discard it manually! You can however */
|
||||
/* create a copy with @FT_Glyph_Copy and modify the new one. */
|
||||
/* */
|
||||
/* If "anode" is _not_ NULL, it receives the address of the cache */
|
||||
/* If `anode' is _not_ NULL, it receives the address of the cache */
|
||||
/* node containing the glyph image, after increasing its reference */
|
||||
/* count. This ensures that the node (as well as the FT_Glyph) will */
|
||||
/* always be kept in the cache until you call @FTC_Node_Unref to */
|
||||
/* "release" it. */
|
||||
/* `release' it. */
|
||||
/* */
|
||||
/* If "anode" is NULL, the cache node is left unchanged, which means */
|
||||
/* If `anode' is NULL, the cache node is left unchanged, which means */
|
||||
/* that the FT_Glyph could be flushed out of the cache on the next */
|
||||
/* call to one of the caching sub-system APIs. Don't assume that it */
|
||||
/* is persistent! */
|
||||
|
@ -582,13 +582,6 @@ FT_BEGIN_HEADER
|
|||
FT_Glyph *aglyph,
|
||||
FTC_Node *anode );
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* cache_subsystem */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
|
@ -698,7 +691,7 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
/* <Description> */
|
||||
/* Looks up a given small glyph bitmap in a given sbit cache and */
|
||||
/* "lock" it to prevent its flushing from the cache until needed */
|
||||
/* `lock' it to prevent its flushing from the cache until needed. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* cache :: A handle to the source sbit cache. */
|
||||
|
@ -726,12 +719,12 @@ FT_BEGIN_HEADER
|
|||
/* The descriptor's `buffer' field is set to 0 to indicate a missing */
|
||||
/* glyph bitmap. */
|
||||
/* */
|
||||
/* If "anode" is _not_ NULL, it receives the address of the cache */
|
||||
/* If `anode' is _not_ NULL, it receives the address of the cache */
|
||||
/* node containing the bitmap, after increasing its reference count. */
|
||||
/* This ensures that the node (as well as the image) will always be */
|
||||
/* kept in the cache until you call @FTC_Node_Unref to "release" it. */
|
||||
/* kept in the cache until you call @FTC_Node_Unref to `release' it. */
|
||||
/* */
|
||||
/* If "anode" is NULL, the cache node is left unchanged, which means */
|
||||
/* If `anode' is NULL, the cache node is left unchanged, which means */
|
||||
/* that the bitmap could be flushed out of the cache on the next */
|
||||
/* call to one of the caching sub-system APIs. Don't assume that it */
|
||||
/* is persistent! */
|
||||
|
|
|
@ -26,33 +26,35 @@ FT_BEGIN_HEADER
|
|||
|
||||
/*@*************************************************************
|
||||
*
|
||||
* @type: FT_Stroker
|
||||
* @type:
|
||||
* FT_Stroker
|
||||
*
|
||||
* @description:
|
||||
* opaque handler to a path stroker object
|
||||
* Opaque handler to a path stroker object.
|
||||
*/
|
||||
typedef struct FT_StrokerRec_* FT_Stroker;
|
||||
|
||||
|
||||
/*@*************************************************************
|
||||
*
|
||||
* @enum: FT_Stroker_LineJoin
|
||||
* @enum:
|
||||
* FT_Stroker_LineJoin
|
||||
*
|
||||
* @description:
|
||||
* these values determine how two joining lines are rendered
|
||||
* These values determine how two joining lines are rendered
|
||||
* in a stroker.
|
||||
*
|
||||
* @values:
|
||||
* FT_STROKER_LINEJOIN_ROUND ::
|
||||
* used to render rounded line joins. circular arcs are used
|
||||
* to join two lines smoothly
|
||||
* Used to render rounded line joins. Circular arcs are used
|
||||
* to join two lines smoothly.
|
||||
*
|
||||
* FT_STROKER_LINEJOIN_BEVEL ::
|
||||
* used to render beveled line joins; i.e. the two joining lines
|
||||
* are extended until they intersect
|
||||
* Used to render beveled line joins; i.e., the two joining lines
|
||||
* are extended until they intersect.
|
||||
*
|
||||
* FT_STROKER_LINEJOIN_MITER ::
|
||||
* same as beveled rendering, except that an additional line
|
||||
* Same as beveled rendering, except that an additional line
|
||||
* break is added if the angle between the two joining lines
|
||||
* is too closed (this is useful to avoid unpleasant spikes
|
||||
* in beveled rendering).
|
||||
|
@ -68,24 +70,25 @@ FT_BEGIN_HEADER
|
|||
|
||||
/*@*************************************************************
|
||||
*
|
||||
* @enum: FT_Stroker_LineCap
|
||||
* @enum:
|
||||
* FT_Stroker_LineCap
|
||||
*
|
||||
* @description:
|
||||
* these values determine how the end of opened sub-paths are
|
||||
* rendered in a stroke
|
||||
* These values determine how the end of opened sub-paths are
|
||||
* rendered in a stroke.
|
||||
*
|
||||
* @values:
|
||||
* FT_STROKER_LINECAP_BUTT ::
|
||||
* the end of lines is rendered as a full stop on the last
|
||||
* point itself
|
||||
* The end of lines is rendered as a full stop on the last
|
||||
* point itself.
|
||||
*
|
||||
* FT_STROKER_LINECAP_ROUND ::
|
||||
* the end of lines is rendered as a half-circle around the
|
||||
* last point
|
||||
* The end of lines is rendered as a half-circle around the
|
||||
* last point.
|
||||
*
|
||||
* FT_STROKER_LINECAP_SQUARE ::
|
||||
* the end of lines is rendered as a square around the
|
||||
* last point
|
||||
* The end of lines is rendered as a square around the
|
||||
* last point.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
|
@ -98,26 +101,27 @@ FT_BEGIN_HEADER
|
|||
|
||||
/**************************************************************
|
||||
*
|
||||
* @enum: FT_StrokerBorder
|
||||
* @enum:
|
||||
* FT_StrokerBorder
|
||||
*
|
||||
* @description:
|
||||
* theses values are used to select a given stroke border
|
||||
* in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder
|
||||
* These values are used to select a given stroke border
|
||||
* in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
|
||||
*
|
||||
* @values:
|
||||
* FT_STROKER_BORDER_LEFT ::
|
||||
* select the left border, relative to the drawing direction
|
||||
* Select the left border, relative to the drawing direction.
|
||||
*
|
||||
* FT_STROKER_BORDER_RIGHT ::
|
||||
* select the right border, relative to the drawing direction
|
||||
* Select the right border, relative to the drawing direction.
|
||||
*
|
||||
* @note:
|
||||
* applications are generally interested in the "inside" and "outside"
|
||||
* Applications are generally interested in the `inside' and `outside'
|
||||
* borders. However, there is no direct mapping between these and
|
||||
* the "left" / "right" ones, since this really depends on the glyph's
|
||||
* drawing orientation, which varies between font formats
|
||||
* the `left' / `right' ones, since this really depends on the glyph's
|
||||
* drawing orientation, which varies between font formats.
|
||||
*
|
||||
* you can however use @FT_Outline_GetInsideBorder and
|
||||
* You can however use @FT_Outline_GetInsideBorder and
|
||||
* @FT_Outline_GetOutsideBorder to get these.
|
||||
*/
|
||||
typedef enum
|
||||
|
@ -130,17 +134,20 @@ FT_BEGIN_HEADER
|
|||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: FT_Outline_GetInsideBorder
|
||||
* @function:
|
||||
* FT_Outline_GetInsideBorder
|
||||
*
|
||||
* @description:
|
||||
* retrieve the @FT_StrokerBorder value corresponding to the
|
||||
* "inside" borders of a given outline
|
||||
* Retrieve the @FT_StrokerBorder value corresponding to the
|
||||
* `inside' borders of a given outline.
|
||||
*
|
||||
* @input:
|
||||
* outline :: source outline handle
|
||||
* outline ::
|
||||
* The source outline handle.
|
||||
*
|
||||
* @return:
|
||||
* border index. @FT_STROKER_BORDER_LEFT for empty or invalid outlines
|
||||
* The border index. @FT_STROKER_BORDER_LEFT for empty or invalid
|
||||
* outlines.
|
||||
*/
|
||||
FT_EXPORT( FT_StrokerBorder )
|
||||
FT_Outline_GetInsideBorder( FT_Outline* outline );
|
||||
|
@ -148,17 +155,20 @@ FT_BEGIN_HEADER
|
|||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: FT_Outline_GetOutsideBorder
|
||||
* @function:
|
||||
* FT_Outline_GetOutsideBorder
|
||||
*
|
||||
* @description:
|
||||
* retrieve the @FT_StrokerBorder value corresponding to the
|
||||
* "outside" borders of a given outline
|
||||
* Retrieve the @FT_StrokerBorder value corresponding to the
|
||||
* `outside' borders of a given outline.
|
||||
*
|
||||
* @input:
|
||||
* outline :: source outline handle
|
||||
* outline ::
|
||||
* The source outline handle.
|
||||
*
|
||||
* @return:
|
||||
* border index. @FT_STROKER_BORDER_LEFT for empty or invalid outlines
|
||||
* The border index. @FT_STROKER_BORDER_LEFT for empty or invalid
|
||||
* outlines.
|
||||
*/
|
||||
FT_EXPORT( FT_StrokerBorder )
|
||||
FT_Outline_GetOutsideBorder( FT_Outline* outline );
|
||||
|
@ -166,19 +176,21 @@ FT_BEGIN_HEADER
|
|||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: FT_Stroker_New
|
||||
* @function:
|
||||
* FT_Stroker_New
|
||||
*
|
||||
* @description:
|
||||
* create a new stroker object
|
||||
* Create a new stroker object.
|
||||
*
|
||||
* @input:
|
||||
* memory :: memory manager handle
|
||||
* memory ::
|
||||
* The memory manager handle.
|
||||
*
|
||||
* @output:
|
||||
* new stroker object handle, NULL in case of error
|
||||
* A new stroker object handle. NULL in case of error.
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
* FreeType error code. 0 means success.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_New( FT_Memory memory,
|
||||
|
@ -187,20 +199,32 @@ FT_BEGIN_HEADER
|
|||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: FT_Stroker_Set
|
||||
* @function:
|
||||
* FT_Stroker_Set
|
||||
*
|
||||
* @description:
|
||||
* reset a stroker object's attributes
|
||||
* Reset a stroker object's attributes.
|
||||
*
|
||||
* @input:
|
||||
* stroker :: target stroker handle
|
||||
* radius :: border radius
|
||||
* line_cap :: line cap style
|
||||
* line_join :: line join style
|
||||
* miter_limit :: miter limit for the FT_STROKER_LINEJOIN_MITER style,
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* radius ::
|
||||
* The border radius.
|
||||
*
|
||||
* line_cap ::
|
||||
* The line cap style.
|
||||
*
|
||||
* line_join ::
|
||||
* The line join style.
|
||||
*
|
||||
* miter_limit ::
|
||||
* The miter limit for the FT_STROKER_LINEJOIN_MITER style,
|
||||
* expressed as 16.16 fixed point value.
|
||||
*
|
||||
* @note:
|
||||
* the radius is expressed in the same units that the outline coordinates.
|
||||
* The radius is expressed in the same units that the outline
|
||||
* coordinates.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Stroker_Set( FT_Stroker stroker,
|
||||
|
@ -212,75 +236,90 @@ FT_BEGIN_HEADER
|
|||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: FT_Stroker_ParseOutline
|
||||
* @function:
|
||||
* FT_Stroker_ParseOutline
|
||||
*
|
||||
* @description:
|
||||
* a convenient function used to parse a whole outline with
|
||||
* A convenience function used to parse a whole outline with
|
||||
* the stroker. The resulting outline(s) can be retrieved
|
||||
* later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export
|
||||
* later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.
|
||||
*
|
||||
* @input:
|
||||
* stroker :: target stroker handle
|
||||
* outline :: source outline
|
||||
* opened :: boolean. if TRUE, the outline is treated as an open path,
|
||||
* instead of a closed one
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* @return:*
|
||||
* error code. 0 means success
|
||||
* outline ::
|
||||
* The source outline.
|
||||
*
|
||||
* opened ::
|
||||
* A boolean. If TRUE, the outline is treated as an open path
|
||||
* instead of a closed one.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* if 'opened' is 0 (the default), the outline is treated as a closed path,
|
||||
* and the stroker will generate two distinct "border" outlines
|
||||
* If `opened' is 0 (the default), the outline is treated as a closed
|
||||
* path, and the stroker will generate two distinct `border' outlines.
|
||||
*
|
||||
* if 'opened' is 1, the outline is processed as an open path, and the
|
||||
* stroker will generate a single "stroke" outline
|
||||
* If `opened' is 1, the outline is processed as an open path, and the
|
||||
* stroker will generate a single `stroke' outline.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_ParseOutline( FT_Stroker stroker,
|
||||
FT_Outline* outline,
|
||||
FT_Bool opened );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: FT_Stroker_BeginSubPath
|
||||
* @function:
|
||||
* FT_Stroker_BeginSubPath
|
||||
*
|
||||
* @description:
|
||||
* start a new sub-path in the stroker
|
||||
* Start a new sub-path in the stroker.
|
||||
*
|
||||
* @input:
|
||||
* stroker :: target stroker handle
|
||||
* to :: pointer to start vector
|
||||
* open :: boolean. if TRUE, the sub-path is treated as an open
|
||||
* one
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* @return:*
|
||||
* error code. 0 means success
|
||||
* to ::
|
||||
* A pointer to the start vector.
|
||||
*
|
||||
* open ::
|
||||
* A boolean. If TRUE, the sub-path is treated as an open one.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* this function is useful when you need to stroke a path that is
|
||||
* not stored as a @FT_Outline object
|
||||
* This function is useful when you need to stroke a path that is
|
||||
* not stored as a @FT_Outline object.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_BeginSubPath( FT_Stroker stroker,
|
||||
FT_Vector* to,
|
||||
FT_Bool open );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: FT_Stroker_EndSubPath
|
||||
* @function:
|
||||
* FT_Stroker_EndSubPath
|
||||
*
|
||||
* @description:
|
||||
* close the current sub-path in the stroker
|
||||
* Close the current sub-path in the stroker.
|
||||
*
|
||||
* @input:
|
||||
* stroker :: target stroker handle
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* you should call this function after @FT_Stroker_BeginSubPath.
|
||||
* if the subpath was not "opened", this function will "draw" a
|
||||
* You should call this function after @FT_Stroker_BeginSubPath.
|
||||
* If the subpath was not `opened', this function will `draw' a
|
||||
* single line segment to the start position when needed.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
|
@ -289,72 +328,92 @@ FT_BEGIN_HEADER
|
|||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: FT_Stroker_LineTo
|
||||
* @function:
|
||||
* FT_Stroker_LineTo
|
||||
*
|
||||
* @description:
|
||||
* "draw" a single line segment in the stroker's current sub-path,
|
||||
* from the last position
|
||||
* `Draw' a single line segment in the stroker's current sub-path,
|
||||
* from the last position.
|
||||
*
|
||||
* @input:
|
||||
* stroker :: target stroker handle
|
||||
* to :: pointer to destination point
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* to ::
|
||||
* A pointer to the destination point.
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* you should call this function between @FT_Stroker_BeginSubPath and
|
||||
* @FT_Stroker_EndSubPath
|
||||
* You should call this function between @FT_Stroker_BeginSubPath and
|
||||
* @FT_Stroker_EndSubPath.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_LineTo( FT_Stroker stroker,
|
||||
FT_Vector* to );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: FT_Stroker_ConicTo
|
||||
* @function:
|
||||
* FT_Stroker_ConicTo
|
||||
*
|
||||
* @description:
|
||||
* "draw" a single quadratic bezier in the stroker's current sub-path,
|
||||
* from the last position
|
||||
* `Draw; a single quadratic bezier in the stroker's current sub-path,
|
||||
* from the last position.
|
||||
*
|
||||
* @input:
|
||||
* stroker :: target stroker handle
|
||||
* control :: pointer to bezier control point
|
||||
* to :: pointer to destination point
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* control ::
|
||||
* A pointer to a Bézier control point.
|
||||
*
|
||||
* to ::
|
||||
* A pointer to the destination point.
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* you should call this function between @FT_Stroker_BeginSubPath and
|
||||
* @FT_Stroker_EndSubPath
|
||||
* You should call this function between @FT_Stroker_BeginSubPath and
|
||||
* @FT_Stroker_EndSubPath.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_ConicTo( FT_Stroker stroker,
|
||||
FT_Vector* control,
|
||||
FT_Vector* to );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: FT_Stroker_CubicTo
|
||||
* @function:
|
||||
* FT_Stroker_CubicTo
|
||||
*
|
||||
* @description:
|
||||
* "draw" a single cubic bezier in the stroker's current sub-path,
|
||||
* from the last position
|
||||
* `Draw' a single cubic Bézier in the stroker's current sub-path,
|
||||
* from the last position.
|
||||
*
|
||||
* @input:
|
||||
* stroker :: target stroker handle
|
||||
* control1 :: pointer to first bezier control point
|
||||
* control2 :: pointer to second bezier control point
|
||||
* to :: pointer to destination point
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* control1 ::
|
||||
* A pointer to the first Bézier control point.
|
||||
*
|
||||
* control2 ::
|
||||
* A pointer to second Bézier control point.
|
||||
*
|
||||
* to ::
|
||||
* A pointer to the destination point.
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* you should call this function between @FT_Stroker_BeginSubPath and
|
||||
* @FT_Stroker_EndSubPath
|
||||
* You should call this function between @FT_Stroker_BeginSubPath and
|
||||
* @FT_Stroker_EndSubPath.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_CubicTo( FT_Stroker stroker,
|
||||
|
@ -365,34 +424,41 @@ FT_BEGIN_HEADER
|
|||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: FT_Stroker_GetBorderCounts
|
||||
* @function:
|
||||
* FT_Stroker_GetBorderCounts
|
||||
*
|
||||
* @description:
|
||||
* call this function once you finished parsing your paths
|
||||
* Vall this function once you have finished parsing your paths
|
||||
* with the stroker. It will return the number of points and
|
||||
* contours necessary to export one of the "border" or "stroke"
|
||||
* contours necessary to export one of the `border' or `stroke'
|
||||
* outlines generated by the stroker.
|
||||
*
|
||||
* @input:
|
||||
* stroker :: target stroker handle
|
||||
* border :: border index
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* border ::
|
||||
* The border index.
|
||||
*
|
||||
* @output:
|
||||
* anum_points :: number of points
|
||||
* anum_contours :: number of contours
|
||||
* anum_points ::
|
||||
* The number of points.
|
||||
*
|
||||
* anum_contours ::
|
||||
* The number of contours.
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* when an outline, or a sub-path, is "closed", the stroker generates
|
||||
* two independent 'border' outlines, named 'left' and 'right'
|
||||
* When an outline, or a sub-path, is `closed', the stroker generates
|
||||
* two independent `border' outlines, named `left' and `right'.
|
||||
*
|
||||
* when the outline, or a sub-path, is "opened", the stroker merges
|
||||
* the 'border' outlines with caps. The 'left' border receives all
|
||||
* points, while the 'right' border becomes empty.
|
||||
* When the outline, or a sub-path, is `opened', the stroker merges
|
||||
* the `border' outlines with caps. The `left' border receives all
|
||||
* points, while the `right' border becomes empty.
|
||||
*
|
||||
* use the function @FT_Stroker_GetCounts instead if you want to
|
||||
* Use the function @FT_Stroker_GetCounts instead if you want to
|
||||
* retrieve the counts associated to both borders.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
|
@ -401,123 +467,119 @@ FT_BEGIN_HEADER
|
|||
FT_UInt *anum_points,
|
||||
FT_UInt *anum_contours );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: FT_Stroker_ExportBorder
|
||||
* @function:
|
||||
* FT_Stroker_ExportBorder
|
||||
*
|
||||
* @description:
|
||||
* call this function after @FT_Stroker_GetBorderCounts to
|
||||
* Call this function after @FT_Stroker_GetBorderCounts to
|
||||
* export the corresponding border to your own @FT_Outline
|
||||
* structure.
|
||||
*
|
||||
* note that this function will append the border points and
|
||||
* Note that this function will append the border points and
|
||||
* contours to your outline, but will not try to resize its
|
||||
* arrays.
|
||||
*
|
||||
* @input:
|
||||
* stroker :: target stroker handle
|
||||
* border :: border index
|
||||
* outline :: target outline handle
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
* border ::
|
||||
* The border index.
|
||||
*
|
||||
* outline ::
|
||||
* The target outline handle.
|
||||
*
|
||||
* @note:
|
||||
* always call this function after @FT_Stroker_GetBorderCounts to
|
||||
* Always call this function after @FT_Stroker_GetBorderCounts to
|
||||
* get sure that there is enough room in your @FT_Outline object to
|
||||
* receive all new data.
|
||||
*
|
||||
* when an outline, or a sub-path, is "closed", the stroker generates
|
||||
* two independent 'border' outlines, named 'left' and 'right'
|
||||
* When an outline, or a sub-path, is `closed', the stroker generates
|
||||
* two independent `border' outlines, named `left' and `right'
|
||||
*
|
||||
* when the outline, or a sub-path, is "opened", the stroker merges
|
||||
* the 'border' outlines with caps. The 'left' border receives all
|
||||
* points, while the 'right' border becomes empty.
|
||||
* When the outline, or a sub-path, is `opened', the stroker merges
|
||||
* the `border' outlines with caps. The `left' border receives all
|
||||
* points, while the `right' border becomes empty.
|
||||
*
|
||||
* use the function @FT_Stroker_Export instead if you want to
|
||||
* retrieve all borders at once
|
||||
* Use the function @FT_Stroker_Export instead if you want to
|
||||
* retrieve all borders at once.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Stroker_ExportBorder( FT_Stroker stroker,
|
||||
FT_StrokerBorder border,
|
||||
FT_Outline* outline );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: FT_Stroker_GetCounts
|
||||
* @function:
|
||||
* FT_Stroker_GetCounts
|
||||
*
|
||||
* @description:
|
||||
* call this function once you finished parsing your paths
|
||||
* with the stroker. It will return the number of points and
|
||||
* Call this function once you have finished parsing your paths
|
||||
* with the stroker. It returns the number of points and
|
||||
* contours necessary to export all points/borders from the stroked
|
||||
* outline/path.
|
||||
*
|
||||
* @input:
|
||||
* stroker :: target stroker handle
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* @output:
|
||||
* anum_points :: number of points
|
||||
* anum_contours :: number of contours
|
||||
* anum_points ::
|
||||
* The number of points.
|
||||
*
|
||||
* anum_contours ::
|
||||
* The number of contours.
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
*
|
||||
* @note:
|
||||
* FreeType error code. 0 means success.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_GetCounts( FT_Stroker stroker,
|
||||
FT_UInt *anum_points,
|
||||
FT_UInt *anum_contours );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: FT_Stroker_ExportBorder
|
||||
* @function:
|
||||
* FT_Stroker_Export
|
||||
*
|
||||
* @description:
|
||||
* call this function after @FT_Stroker_GetBorderCounts to
|
||||
* export the corresponding border to your own @FT_Outline
|
||||
* structure.
|
||||
* Call this function after @FT_Stroker_GetBorderCounts to
|
||||
* export the all borders to your own @FT_Outline structure.
|
||||
*
|
||||
* note that this function will append the border points and
|
||||
* Note that this function will append the border points and
|
||||
* contours to your outline, but will not try to resize its
|
||||
* arrays.
|
||||
*
|
||||
* @input:
|
||||
* stroker :: target stroker handle
|
||||
* border :: border index
|
||||
* outline :: target outline handle
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
*
|
||||
* @note:
|
||||
* always call this function after @FT_Stroker_GetBorderCounts to
|
||||
* get sure that there is enough room in your @FT_Outline object to
|
||||
* receive all new data.
|
||||
*
|
||||
* when an outline, or a sub-path, is "closed", the stroker generates
|
||||
* two independent 'border' outlines, named 'left' and 'right'
|
||||
*
|
||||
* when the outline, or a sub-path, is "opened", the stroker merges
|
||||
* the 'border' outlines with caps. The 'left' border receives all
|
||||
* points, while the 'right' border becomes empty.
|
||||
*
|
||||
* use the function @FT_Stroker_Export instead if you want to
|
||||
* retrieve all borders at once
|
||||
* outline ::
|
||||
* The target outline handle.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Stroker_Export( FT_Stroker stroker,
|
||||
FT_Outline* outline );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: FT_Stroker_Done
|
||||
* @function:
|
||||
* FT_Stroker_Done
|
||||
*
|
||||
* @description:
|
||||
* destroy a stroker object
|
||||
* Destroy a stroker object.
|
||||
*
|
||||
* @input:
|
||||
* stroker :: stroker handle. can be NULL
|
||||
* stroker ::
|
||||
* A stroker handle. Can be NULL.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Stroker_Done( FT_Stroker stroker );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* The FreeType glyph loader (body). */
|
||||
/* */
|
||||
/* Copyright 2002 by */
|
||||
/* Copyright 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -19,6 +19,7 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_GLYPH_LOADER_H
|
||||
#include FT_INTERNAL_MEMORY_H
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
||||
#undef FT_COMPONENT
|
||||
#define FT_COMPONENT trace_gloader
|
||||
|
|
|
@ -27,9 +27,10 @@
|
|||
FT_EXPORT_DEF( FT_StrokerBorder )
|
||||
FT_Outline_GetInsideBorder( FT_Outline* outline )
|
||||
{
|
||||
FT_Orientation or = FT_Outline_Get_Orientation( outline );
|
||||
FT_Orientation o = FT_Outline_Get_Orientation( outline );
|
||||
|
||||
return ( or == FT_ORIENTATION_TRUETYPE ) ? FT_STROKER_BORDER_RIGHT
|
||||
|
||||
return o == FT_ORIENTATION_TRUETYPE ? FT_STROKER_BORDER_RIGHT
|
||||
: FT_STROKER_BORDER_LEFT ;
|
||||
}
|
||||
|
||||
|
@ -37,9 +38,10 @@
|
|||
FT_EXPORT_DEF( FT_StrokerBorder )
|
||||
FT_Outline_GetOutsideBorder( FT_Outline* outline )
|
||||
{
|
||||
FT_Orientation or = FT_Outline_Get_Orientation( outline );
|
||||
FT_Orientation o = FT_Outline_Get_Orientation( outline );
|
||||
|
||||
return ( or == FT_ORIENTATION_TRUETYPE ) ? FT_STROKER_BORDER_RIGHT
|
||||
|
||||
return o == FT_ORIENTATION_TRUETYPE ? FT_STROKER_BORDER_RIGHT
|
||||
: FT_STROKER_BORDER_LEFT ;
|
||||
}
|
||||
|
||||
|
@ -1457,6 +1459,7 @@
|
|||
FT_UInt num_points = 0, num_contours = 0;
|
||||
FT_Error error;
|
||||
|
||||
|
||||
if ( !stroker || border > 1 )
|
||||
{
|
||||
error = FT_Err_Invalid_Argument;
|
||||
|
@ -1516,6 +1519,7 @@
|
|||
{
|
||||
FT_StrokeBorder sborder = & stroker->borders[border];
|
||||
|
||||
|
||||
if ( sborder->valid )
|
||||
ft_stroke_border_export( sborder, outline );
|
||||
}
|
||||
|
@ -1531,8 +1535,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* The following is very similar to FT_Outline_Decompose, except
|
||||
* that we do support opened paths, and do not scale the outline.
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include FT_TRIGONOMETRY_H
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
FreeType font driver for bdf fonts
|
||||
|
||||
Copyright (C) 2001, 2002 by
|
||||
Copyright (C) 2001, 2002, 2003 by
|
||||
Francesco Zappa Nardelli
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# FreeType 2 src/cache Jamfile (c) 2001 David Turner
|
||||
# FreeType 2 src/cache Jamfile (c) 2001, 2003 David Turner
|
||||
#
|
||||
|
||||
SubDir FT2_TOP $(FT2_SRC_DIR) cache ;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 2001, 2002 by
|
||||
# Copyright 2001, 2002, 2003 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* The FreeType Caching sub-system (body only). */
|
||||
/* */
|
||||
/* Copyright 2000-2001 by */
|
||||
/* Copyright 2000-2001, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftcbasic.c */
|
||||
/* */
|
||||
/* The FreeType basic cache interface (body). */
|
||||
/* */
|
||||
/* Copyright 2003 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_CACHE_H
|
||||
#include FT_CACHE_INTERNAL_GLYPH_H
|
||||
|
@ -11,7 +29,6 @@
|
|||
/*
|
||||
* Basic Families
|
||||
*
|
||||
*
|
||||
*/
|
||||
typedef struct FTC_BasicAttrRec_
|
||||
{
|
||||
|
@ -36,7 +53,6 @@
|
|||
} FTC_BasicQueryRec, *FTC_BasicQuery;
|
||||
|
||||
|
||||
|
||||
typedef struct FTC_BasicFamilyRec_
|
||||
{
|
||||
FTC_FamilyRec family;
|
||||
|
@ -52,6 +68,7 @@
|
|||
return FT_BOOL( FTC_BASIC_ATTR_COMPARE( &family->attrs, &query->attrs ) );
|
||||
}
|
||||
|
||||
|
||||
static FT_Error
|
||||
ftc_basic_family_init( FTC_BasicFamily family,
|
||||
FTC_BasicQuery query,
|
||||
|
@ -71,6 +88,7 @@
|
|||
FT_Face face;
|
||||
FT_UInt result = 0;
|
||||
|
||||
|
||||
error = FTC_Manager_LookupFace( manager, family->attrs.scaler.face_id,
|
||||
&face );
|
||||
if ( !error )
|
||||
|
@ -89,16 +107,19 @@
|
|||
FT_Error error;
|
||||
FT_Size size;
|
||||
|
||||
|
||||
error = FTC_Manager_LookupSize( manager, &family->attrs.scaler, &size );
|
||||
if ( !error )
|
||||
{
|
||||
FT_Face face = size->face;
|
||||
|
||||
error = FT_Load_Glyph( face, gindex, family->attrs.load_flags |
|
||||
FT_LOAD_RENDER );
|
||||
|
||||
error = FT_Load_Glyph( face, gindex,
|
||||
family->attrs.load_flags | FT_LOAD_RENDER );
|
||||
if ( !error )
|
||||
*aface = face;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
@ -114,6 +135,7 @@
|
|||
FT_Face face;
|
||||
FT_Size size;
|
||||
|
||||
|
||||
/* we will now load the glyph image */
|
||||
error = FTC_Manager_LookupSize( cache->manager,
|
||||
scaler,
|
||||
|
@ -143,6 +165,7 @@
|
|||
error = FTC_Err_Invalid_Argument;
|
||||
}
|
||||
}
|
||||
|
||||
Exit:
|
||||
return error;
|
||||
}
|
||||
|
@ -156,11 +179,12 @@
|
|||
FTC_BasicFamily family = (FTC_BasicFamily)gnode->family;
|
||||
FT_Bool result;
|
||||
|
||||
|
||||
result = FT_BOOL( family->attrs.scaler.face_id == face_id );
|
||||
if ( result )
|
||||
{
|
||||
/* we must call this function to avoid this node from appearing
|
||||
* in later lookups with the same face_id !!
|
||||
* in later lookups with the same face_id!
|
||||
*/
|
||||
FTC_GNode_UnselectFamily( gnode, cache );
|
||||
}
|
||||
|
@ -168,7 +192,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* basic image cache
|
||||
|
@ -188,7 +211,6 @@
|
|||
};
|
||||
|
||||
|
||||
|
||||
static const FTC_GCacheClassRec ftc_basic_image_cache_class =
|
||||
{
|
||||
{
|
||||
|
@ -249,7 +271,7 @@
|
|||
|
||||
hash = FTC_BASIC_ATTR_HASH( &query.attrs ) + gindex;
|
||||
|
||||
#if 1 /* inlining is about 50% faster !! */
|
||||
#if 1 /* inlining is about 50% faster! */
|
||||
FTC_GCACHE_LOOKUP_CMP( cache,
|
||||
ftc_basic_family_compare,
|
||||
FTC_GNode_Compare,
|
||||
|
@ -279,7 +301,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* basic small bitmap cache
|
||||
|
@ -318,8 +339,6 @@
|
|||
};
|
||||
|
||||
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
FTC_SBitCache_New( FTC_Manager manager,
|
||||
FTC_SBitCache *acache )
|
||||
|
@ -341,6 +360,7 @@
|
|||
FTC_SNode node;
|
||||
FT_UInt32 hash;
|
||||
|
||||
|
||||
if ( anode )
|
||||
*anode = NULL;
|
||||
|
||||
|
@ -356,12 +376,11 @@
|
|||
query.attrs.scaler.pixel = 1;
|
||||
query.attrs.load_flags = type->flags;
|
||||
|
||||
/* beware, the hash must be the same for all glyph ranges !!
|
||||
*/
|
||||
/* beware, the hash must be the same for all glyph ranges! */
|
||||
hash = FTC_BASIC_ATTR_HASH( &query.attrs ) +
|
||||
(gindex/FTC_SBIT_ITEMS_PER_NODE);
|
||||
gindex / FTC_SBIT_ITEMS_PER_NODE;
|
||||
|
||||
#if 1 /* inlining is about 50% faster !! */
|
||||
#if 1 /* inlining is about 50% faster! */
|
||||
FTC_GCACHE_LOOKUP_CMP( cache,
|
||||
ftc_basic_family_compare,
|
||||
FTC_SNode_Compare,
|
||||
|
@ -391,3 +410,5 @@
|
|||
return error;
|
||||
}
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -45,7 +45,8 @@
|
|||
ftc_node_mru_link( FTC_Node node,
|
||||
FTC_Manager manager )
|
||||
{
|
||||
FTC_MruNode_Prepend( (FTC_MruNode*)&manager->nodes_list, (FTC_MruNode)node );
|
||||
FTC_MruNode_Prepend( (FTC_MruNode*)&manager->nodes_list,
|
||||
(FTC_MruNode)node );
|
||||
manager->num_nodes++;
|
||||
}
|
||||
|
||||
|
@ -55,7 +56,8 @@
|
|||
ftc_node_mru_unlink( FTC_Node node,
|
||||
FTC_Manager manager )
|
||||
{
|
||||
FTC_MruNode_Remove( (FTC_MruNode*)&manager->nodes_list, (FTC_MruNode)node );
|
||||
FTC_MruNode_Remove( (FTC_MruNode*)&manager->nodes_list,
|
||||
(FTC_MruNode)node );
|
||||
manager->num_nodes--;
|
||||
}
|
||||
|
||||
|
@ -65,13 +67,14 @@
|
|||
ftc_node_mru_up( FTC_Node node,
|
||||
FTC_Manager manager )
|
||||
{
|
||||
FTC_MruNode_Up( (FTC_MruNode*)&manager->nodes_list, (FTC_MruNode)node );
|
||||
FTC_MruNode_Up( (FTC_MruNode*)&manager->nodes_list,
|
||||
(FTC_MruNode)node );
|
||||
}
|
||||
|
||||
|
||||
/* note that this function cannot fail. If we cannot re-size the
|
||||
/* Note that this function cannot fail. If we cannot re-size the
|
||||
* buckets array appropriately, we simply degrade the hash table's
|
||||
* performance !!
|
||||
* performance!
|
||||
*/
|
||||
static void
|
||||
ftc_cache_resize( FTC_Cache cache )
|
||||
|
@ -83,12 +86,13 @@
|
|||
FT_UInt mask = cache->mask;
|
||||
FT_UInt count = mask + p + 1; /* number of buckets */
|
||||
|
||||
/* do we need to shrink the buckets array ?
|
||||
*/
|
||||
|
||||
/* do we need to shrink the buckets array? */
|
||||
if ( cache->slack < 0 )
|
||||
{
|
||||
FTC_Node new_list = NULL;
|
||||
|
||||
|
||||
/* try to expand the buckets array _before_ splitting
|
||||
* the bucket lists
|
||||
*/
|
||||
|
@ -96,6 +100,7 @@
|
|||
{
|
||||
FT_Memory memory = cache->memory;
|
||||
|
||||
|
||||
/* if we can't expand the array, leave immediately */
|
||||
if ( FT_MEM_RENEW_ARRAY( cache->buckets, (mask+1)*2, (mask+1)*4 ) )
|
||||
break;
|
||||
|
@ -132,13 +137,14 @@
|
|||
else
|
||||
cache->p = p + 1;
|
||||
}
|
||||
/* do we need to expand the buckets array ?
|
||||
*/
|
||||
|
||||
/* do we need to expand the buckets array? */
|
||||
else if ( cache->slack > (FT_Long)count * FTC_HASH_SUB_LOAD )
|
||||
{
|
||||
FT_UInt old_index = p + mask;
|
||||
FTC_Node* pold;
|
||||
|
||||
|
||||
if ( old_index + 1 <= FTC_HASH_INITIAL_SIZE )
|
||||
break;
|
||||
|
||||
|
@ -146,8 +152,10 @@
|
|||
{
|
||||
FT_Memory memory = cache->memory;
|
||||
|
||||
|
||||
/* if we can't shrink the array, leave immediately */
|
||||
if ( FT_MEM_RENEW_ARRAY( cache->buckets, ( mask + 1 ) * 2, (mask+1) ) )
|
||||
if ( FT_MEM_RENEW_ARRAY( cache->buckets,
|
||||
( mask + 1 ) * 2, mask + 1 ) )
|
||||
break;
|
||||
|
||||
cache->mask >>= 1;
|
||||
|
@ -173,7 +181,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* remove a node from its cache's hash table */
|
||||
static void
|
||||
ftc_node_hash_unlink( FTC_Node node0,
|
||||
|
@ -193,6 +200,7 @@
|
|||
{
|
||||
FTC_Node node = *pnode;
|
||||
|
||||
|
||||
if ( node == NULL )
|
||||
{
|
||||
FT_ERROR(( "ftc_node_hash_unlink: unknown node!\n" ));
|
||||
|
@ -213,8 +221,7 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* add a node to the "top" of its cache's hash table */
|
||||
/* add a node to the `top' of its cache's hash table */
|
||||
static void
|
||||
ftc_node_hash_link( FTC_Node node,
|
||||
FTC_Cache cache )
|
||||
|
@ -237,8 +244,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* remove a node from the cache manager */
|
||||
FT_EXPORT_DEF( void )
|
||||
ftc_node_destroy( FTC_Node node,
|
||||
|
@ -300,6 +305,7 @@
|
|||
{
|
||||
FT_Memory memory = cache->memory;
|
||||
|
||||
|
||||
cache->p = 0;
|
||||
cache->mask = FTC_HASH_INITIAL_SIZE - 1;
|
||||
cache->slack = FTC_HASH_INITIAL_SIZE * FTC_HASH_MAX_LOAD;
|
||||
|
@ -308,7 +314,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FTC_Cache_Clear( FTC_Cache cache )
|
||||
{
|
||||
|
@ -318,6 +323,7 @@
|
|||
FT_UFast i;
|
||||
FT_UInt count;
|
||||
|
||||
|
||||
count = cache->p + cache->mask + 1;
|
||||
|
||||
for ( i = 0; i < count; i++ )
|
||||
|
@ -353,6 +359,7 @@
|
|||
{
|
||||
FT_Memory memory = cache->memory;
|
||||
|
||||
|
||||
FTC_Cache_Clear( cache );
|
||||
|
||||
FT_FREE( cache->buckets );
|
||||
|
@ -365,7 +372,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
ftc_cache_add( FTC_Cache cache,
|
||||
FT_UInt32 hash,
|
||||
|
@ -381,6 +387,7 @@
|
|||
{
|
||||
FTC_Manager manager = cache->manager;
|
||||
|
||||
|
||||
manager->cur_weight += cache->clazz.node_weight( node, cache );
|
||||
|
||||
if ( manager->cur_weight >= manager->max_weight )
|
||||
|
@ -403,14 +410,14 @@
|
|||
FTC_Node node;
|
||||
|
||||
/*
|
||||
* try to allocate a new cache node. Note that in case of
|
||||
* Try to allocate a new cache node. Note that in case of
|
||||
* out-of-memory error (OOM), we'll flush the cache a bit,
|
||||
* then try again.
|
||||
*
|
||||
* on each try, the "tries" variable gives the number
|
||||
* On each try, the `tries' variable gives the number
|
||||
* of old nodes we want to flush from the manager's global list
|
||||
* before the next allocation attempt. it barely doubles on
|
||||
* each iteration
|
||||
* before the next allocation attempt. It barely doubles on
|
||||
* each iteration.
|
||||
*
|
||||
*/
|
||||
error = cache->clazz.node_new( &node, query, cache );
|
||||
|
@ -436,6 +443,7 @@
|
|||
FTC_Manager manager = cache->manager;
|
||||
FT_UInt count, tries = 1;
|
||||
|
||||
|
||||
for (;;)
|
||||
{
|
||||
error = cache->clazz.node_new( &node, query, cache );
|
||||
|
@ -510,6 +518,7 @@
|
|||
{
|
||||
FTC_Manager manager = cache->manager;
|
||||
|
||||
|
||||
if ( node != manager->nodes_list )
|
||||
ftc_node_mru_up( node, manager );
|
||||
}
|
||||
|
@ -521,8 +530,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FTC_Cache_RemoveFaceID( FTC_Cache cache,
|
||||
FTC_FaceID face_id )
|
||||
|
@ -531,16 +538,19 @@
|
|||
FTC_Manager manager = cache->manager;
|
||||
FTC_Node frees = NULL;
|
||||
|
||||
|
||||
count = cache->p + cache->mask;
|
||||
for ( i = 0; i < count; i++ )
|
||||
{
|
||||
FTC_Node* bucket = cache->buckets + i;
|
||||
FTC_Node* pnode = bucket;
|
||||
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
FTC_Node node = *pnode;
|
||||
|
||||
|
||||
if ( node == NULL )
|
||||
break;
|
||||
|
||||
|
@ -555,12 +565,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
/* remove all nodes in the free list
|
||||
*/
|
||||
/* remove all nodes in the free list */
|
||||
while ( frees )
|
||||
{
|
||||
FTC_Node node;
|
||||
|
||||
|
||||
node = frees;
|
||||
frees = node->link;
|
||||
|
||||
|
@ -575,4 +585,5 @@
|
|||
ftc_cache_resize( cache );
|
||||
}
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#undef FT_COMPONENT
|
||||
#define FT_COMPONENT trace_cache
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Each FTC_CMapNode contains a simple array to map a range of character */
|
||||
|
@ -48,7 +49,8 @@
|
|||
|
||||
/* compute a query/node hash */
|
||||
#define FTC_CMAP_HASH( faceid, index, charcode ) \
|
||||
( FTC_FACE_ID_HASH( faceid ) + 211*( index ) + ((char_code) / FTC_CMAP_INDICES_MAX) )
|
||||
( FTC_FACE_ID_HASH( faceid ) + 211 * ( index ) + \
|
||||
( (char_code) / FTC_CMAP_INDICES_MAX ) )
|
||||
|
||||
/* the charmap query */
|
||||
typedef struct FTC_CMapQueryRec_
|
||||
|
@ -60,7 +62,8 @@
|
|||
} FTC_CMapQueryRec, *FTC_CMapQuery;
|
||||
|
||||
#define FTC_CMAP_QUERY( x ) ((FTC_CMapQuery)(x))
|
||||
#define FTC_CMAP_QUERY_HASH(x) FTC_CMAP_HASH( (x)->face_id, (x)->cmap_index, (x)->char_code )
|
||||
#define FTC_CMAP_QUERY_HASH( x ) \
|
||||
FTC_CMAP_HASH( (x)->face_id, (x)->cmap_index, (x)->char_code )
|
||||
|
||||
/* the cmap cache node */
|
||||
typedef struct FTC_CMapNodeRec_
|
||||
|
@ -74,7 +77,8 @@
|
|||
} FTC_CMapNodeRec, *FTC_CMapNode;
|
||||
|
||||
#define FTC_CMAP_NODE( x ) ( (FTC_CMapNode)( x ) )
|
||||
#define FTC_CMAP_NODE_HASH(x) FTC_CMAP_HASH( (x)->face_id, (x)->cmap_index, (x)->first )
|
||||
#define FTC_CMAP_NODE_HASH( x ) \
|
||||
FTC_CMAP_HASH( (x)->face_id, (x)->cmap_index, (x)->first )
|
||||
|
||||
/* if (indices[n] == FTC_CMAP_UNKNOWN), we assume that the corresponding */
|
||||
/* glyph indices haven't been queried through FT_Get_Glyph_Index() yet */
|
||||
|
@ -90,7 +94,7 @@
|
|||
/*************************************************************************/
|
||||
|
||||
|
||||
/* no need for specific finalizer; we use "ftc_node_done" directly */
|
||||
/* no need for specific finalizer; we use `ftc_node_done' directly */
|
||||
|
||||
FT_CALLBACK_DEF( void )
|
||||
ftc_cmap_node_free( FTC_CMapNode node,
|
||||
|
@ -98,6 +102,7 @@
|
|||
{
|
||||
FT_Memory memory = cache->memory;
|
||||
|
||||
|
||||
FT_FREE( node );
|
||||
}
|
||||
|
||||
|
@ -113,6 +118,7 @@
|
|||
FTC_CMapNode node;
|
||||
FT_UInt nn;
|
||||
|
||||
|
||||
if ( !FT_NEW( node ) )
|
||||
{
|
||||
node->face_id = query->face_id;
|
||||
|
@ -149,8 +155,10 @@
|
|||
{
|
||||
FT_UInt32 offset = (FT_UInt32)( query->char_code - node->first );
|
||||
|
||||
|
||||
return FT_BOOL( offset < FTC_CMAP_INDICES_MAX );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -162,6 +170,7 @@
|
|||
return FT_BOOL( node->face_id == face_id );
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -185,6 +194,7 @@
|
|||
(FTC_Cache_DoneFunc) FTC_Cache_Done,
|
||||
};
|
||||
|
||||
|
||||
/* documentation is in ftccmap.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
|
@ -195,6 +205,8 @@
|
|||
&ftc_cmap_cache_class,
|
||||
FTC_CACHE_P( acache ) );
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in ftccmap.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_UInt )
|
||||
|
@ -239,6 +251,7 @@
|
|||
{
|
||||
FT_Face face;
|
||||
|
||||
|
||||
gindex = 0;
|
||||
|
||||
error = FTC_Manager_LookupFace( cache->manager, node->face_id, &face );
|
||||
|
@ -249,6 +262,7 @@
|
|||
{
|
||||
FT_CharMap old, cmap = NULL;
|
||||
|
||||
|
||||
old = face->charmap;
|
||||
cmap = face->charmaps[cmap_index];
|
||||
|
||||
|
@ -268,4 +282,5 @@
|
|||
return gindex;
|
||||
}
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType Glyph Image (FT_Glyph) cache (body). */
|
||||
/* */
|
||||
/* Copyright 2000-2001 by */
|
||||
/* Copyright 2000-2001, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -44,11 +44,11 @@
|
|||
{
|
||||
FTC_Family family = gnode->family;
|
||||
|
||||
|
||||
gnode->family = NULL;
|
||||
if ( family && --family->num_nodes <= 0 )
|
||||
{
|
||||
FTC_MruList_Remove( & FTC_GCACHE(cache)->families, (FTC_MruNode)family );
|
||||
}
|
||||
FTC_MruList_Remove( &FTC_GCACHE( cache )->families,
|
||||
(FTC_MruNode)family );
|
||||
}
|
||||
|
||||
|
||||
|
@ -86,6 +86,7 @@
|
|||
{
|
||||
FTC_GCacheClass clazz = FTC_CACHE__GCACHE_CLASS( cache );
|
||||
|
||||
|
||||
family->clazz = clazz->family_class;
|
||||
family->num_nodes = 0;
|
||||
family->cache = cache;
|
||||
|
@ -104,10 +105,11 @@
|
|||
|
||||
FTC_MruList_Init( &cache->families,
|
||||
clazz->family_class,
|
||||
0, /* no maximum here !! */
|
||||
0, /* no maximum here! */
|
||||
cache,
|
||||
FTC_CACHE( cache )->memory );
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
@ -139,6 +141,7 @@
|
|||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
query->gindex = gindex;
|
||||
|
||||
FTC_MRULIST_LOOKUP( &cache->families, query, query->family, error );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType Image cache (body). */
|
||||
/* */
|
||||
/* Copyright 2000-2001 by */
|
||||
/* Copyright 2000-2001, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -31,6 +31,7 @@
|
|||
{
|
||||
FT_Memory memory = cache->memory;
|
||||
|
||||
|
||||
if ( inode->glyph )
|
||||
{
|
||||
FT_Done_Glyph( inode->glyph );
|
||||
|
@ -52,6 +53,7 @@
|
|||
FT_Error error;
|
||||
FTC_INode inode;
|
||||
|
||||
|
||||
if ( !FT_NEW( inode ) )
|
||||
{
|
||||
FTC_GNode gnode = FTC_GNODE( inode );
|
||||
|
@ -59,12 +61,15 @@
|
|||
FT_UInt gindex = gquery->gindex;
|
||||
FTC_IFamilyClass clazz = FTC_CACHE__IFAMILY_CLASS( cache );
|
||||
|
||||
|
||||
/* initialize its inner fields */
|
||||
FTC_GNode_Init( gnode, gindex, family );
|
||||
|
||||
/* we will now load the glyph image */
|
||||
error = clazz->family_load_glyph( family, gindex, cache, &inode->glyph );
|
||||
error = clazz->family_load_glyph( family, gindex, cache,
|
||||
&inode->glyph );
|
||||
}
|
||||
|
||||
*pinode = inode;
|
||||
return error;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType Cache Manager (body). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002 by */
|
||||
/* Copyright 2000-2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -41,11 +41,14 @@
|
|||
FT_Size size = NULL;
|
||||
FT_Error error;
|
||||
|
||||
|
||||
error = FTC_Manager_LookupFace( manager, scaler->face_id, &face );
|
||||
if ( error ) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
error = FT_New_Size( face, &size );
|
||||
if ( error ) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
FT_Activate_Size( size );
|
||||
|
||||
|
@ -80,6 +83,7 @@
|
|||
{
|
||||
FT_Size size = node->size;
|
||||
|
||||
|
||||
if ( size )
|
||||
FT_Done_Size( size );
|
||||
}
|
||||
|
@ -91,11 +95,11 @@
|
|||
{
|
||||
FTC_Scaler scaler0 = &node->scaler;
|
||||
|
||||
|
||||
return FTC_SCALER_COMPARE( scaler0, scaler );
|
||||
}
|
||||
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
ftc_size_node_init( FTC_SizeNode node,
|
||||
FTC_Scaler scaler,
|
||||
|
@ -163,6 +167,7 @@
|
|||
{
|
||||
FTC_Scaler scaler0 = &node->scaler;
|
||||
|
||||
|
||||
if ( FTC_SCALER_COMPARE( scaler0, scaler ) )
|
||||
goto Found;
|
||||
}
|
||||
|
@ -195,7 +200,6 @@
|
|||
} FTC_FaceNodeRec, *FTC_FaceNode;
|
||||
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
ftc_face_node_init( FTC_FaceNode node,
|
||||
FTC_FaceID face_id,
|
||||
|
@ -203,6 +207,7 @@
|
|||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
node->face_id = face_id;
|
||||
|
||||
error = manager->request_face( face_id,
|
||||
|
@ -215,6 +220,7 @@
|
|||
if ( node->face->size )
|
||||
FT_Done_Size( node->face->size );
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
@ -256,7 +262,6 @@
|
|||
};
|
||||
|
||||
|
||||
|
||||
/* documentation is in ftcache.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
|
@ -296,8 +301,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -385,6 +388,7 @@
|
|||
{
|
||||
FTC_Cache cache = manager->caches[idx];
|
||||
|
||||
|
||||
if ( cache )
|
||||
{
|
||||
cache->clazz.cache_done( cache );
|
||||
|
@ -441,13 +445,12 @@
|
|||
{
|
||||
FTC_Cache cache = manager->caches[node->cache_index];
|
||||
|
||||
|
||||
if ( (FT_UInt)node->cache_index >= manager->num_caches )
|
||||
FT_ERROR(( "FTC_Manager_Check: invalid node (cache index = %ld\n",
|
||||
node->cache_index ));
|
||||
else
|
||||
{
|
||||
weight += cache->clazz.node_weight( node, cache );
|
||||
}
|
||||
|
||||
node = FTC_NODE__NEXT( node );
|
||||
|
||||
|
@ -510,7 +513,7 @@
|
|||
if ( manager->cur_weight < manager->max_weight || first == NULL )
|
||||
return;
|
||||
|
||||
/* go to last node - it's a circular list */
|
||||
/* go to last node -- it's a circular list */
|
||||
node = FTC_NODE__PREV( first );
|
||||
do
|
||||
{
|
||||
|
@ -543,6 +546,7 @@
|
|||
{
|
||||
FT_Memory memory = manager->memory;
|
||||
|
||||
|
||||
if ( manager->num_caches >= FTC_MAX_CACHES )
|
||||
{
|
||||
error = FTC_Err_Too_Many_Caches;
|
||||
|
@ -588,7 +592,8 @@
|
|||
FTC_Node node;
|
||||
FT_UInt result;
|
||||
|
||||
/* try to remove "count" nodes from the list */
|
||||
|
||||
/* try to remove `count' nodes from the list */
|
||||
if ( first == NULL ) /* empty list! */
|
||||
return 0;
|
||||
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftcmru.c */
|
||||
/* */
|
||||
/* FreeType MRU support (body). */
|
||||
/* */
|
||||
/* Copyright 2003 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_CACHE_H
|
||||
#include FT_CACHE_INTERNAL_MRU_H
|
||||
|
@ -6,29 +24,34 @@
|
|||
|
||||
#include "ftcerror.h"
|
||||
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FTC_MruNode_Prepend( FTC_MruNode *plist,
|
||||
FTC_MruNode node )
|
||||
{
|
||||
FTC_MruNode first = *plist;
|
||||
|
||||
|
||||
if ( first )
|
||||
{
|
||||
FTC_MruNode last = first->prev;
|
||||
|
||||
|
||||
#ifdef FT_DEBUG_ERROR
|
||||
{
|
||||
FTC_MruNode cnode = first;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
if ( cnode == node )
|
||||
{
|
||||
fprintf( stderr, "FTC_MruNode_Prepend: invalid action !!\n" );
|
||||
fprintf( stderr, "FTC_MruNode_Prepend: invalid action!\n" );
|
||||
exit( 2 );
|
||||
}
|
||||
cnode = cnode->next;
|
||||
}
|
||||
while ( cnode != first );
|
||||
|
||||
} while ( cnode != first );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -52,12 +75,14 @@
|
|||
{
|
||||
FTC_MruNode first = *plist;
|
||||
|
||||
|
||||
FT_ASSERT( first != NULL );
|
||||
|
||||
if ( first != node )
|
||||
{
|
||||
FTC_MruNode prev, next, last;
|
||||
|
||||
|
||||
#ifdef FT_DEBUG_ERROR
|
||||
{
|
||||
FTC_MruNode cnode = first;
|
||||
|
@ -66,10 +91,10 @@
|
|||
if ( cnode == node )
|
||||
goto Ok;
|
||||
cnode = cnode->next;
|
||||
}
|
||||
while ( cnode != first );
|
||||
|
||||
fprintf( stderr, "FTC_MruNode_Up: invalid action !!\n" );
|
||||
} while ( cnode != first );
|
||||
|
||||
fprintf( stderr, "FTC_MruNode_Up: invalid action!\n" );
|
||||
exit( 2 );
|
||||
Ok:
|
||||
}
|
||||
|
@ -100,20 +125,23 @@
|
|||
FTC_MruNode first = *plist;
|
||||
FTC_MruNode prev, next;
|
||||
|
||||
|
||||
FT_ASSERT( first != NULL );
|
||||
|
||||
#ifdef FT_DEBUG_ERROR
|
||||
{
|
||||
FTC_MruNode cnode = first;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
if ( cnode == node )
|
||||
goto Ok;
|
||||
cnode = cnode->next;
|
||||
}
|
||||
while ( cnode != first );
|
||||
|
||||
fprintf( stderr, "FTC_MruNode_Remove: invalid action !!\n" );
|
||||
} while ( cnode != first );
|
||||
|
||||
fprintf( stderr, "FTC_MruNode_Remove: invalid action!\n" );
|
||||
exit( 2 );
|
||||
Ok:
|
||||
}
|
||||
|
@ -137,7 +165,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FTC_MruList_Init( FTC_MruList list,
|
||||
FTC_MruListClass clazz,
|
||||
|
@ -171,7 +198,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FTC_MruNode )
|
||||
FTC_MruList_Find( FTC_MruList list,
|
||||
FT_Pointer key )
|
||||
|
@ -179,6 +205,7 @@
|
|||
FTC_MruNode_CompareFunc compare = list->clazz.node_compare;
|
||||
FTC_MruNode first, node;
|
||||
|
||||
|
||||
first = list->nodes;
|
||||
node = NULL;
|
||||
|
||||
|
@ -191,12 +218,12 @@
|
|||
return node;
|
||||
|
||||
node = node->next;
|
||||
}
|
||||
while ( node != first) ;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
} while ( node != first);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
|
@ -208,6 +235,7 @@
|
|||
FTC_MruNode node;
|
||||
FT_Memory memory = list->memory;
|
||||
|
||||
|
||||
if ( list->num_nodes >= list->max_nodes && list->max_nodes > 0 )
|
||||
{
|
||||
node = list->nodes->prev;
|
||||
|
@ -259,6 +287,7 @@
|
|||
{
|
||||
FTC_MruNode node;
|
||||
|
||||
|
||||
node = FTC_MruList_Find( list, key );
|
||||
if ( node == NULL )
|
||||
return FTC_MruList_New( list, key, anode );
|
||||
|
@ -278,6 +307,7 @@
|
|||
{
|
||||
FT_Memory memory = list->memory;
|
||||
|
||||
|
||||
if ( list->clazz.node_done )
|
||||
list->clazz.node_done( node, list->data );
|
||||
|
||||
|
@ -288,13 +318,14 @@
|
|||
|
||||
FT_EXPORT_DEF( void )
|
||||
FTC_MruList_RemoveSelection( FTC_MruList list,
|
||||
FTC_MruNode_CompareFunc select,
|
||||
FTC_MruNode_CompareFunc selection,
|
||||
FT_Pointer key )
|
||||
{
|
||||
FTC_MruNode first, node, next;
|
||||
|
||||
|
||||
first = list->nodes;
|
||||
while ( first && select( first, key ) )
|
||||
while ( first && selection( first, key ) )
|
||||
{
|
||||
FTC_MruList_Remove( list, first );
|
||||
first = list->nodes;
|
||||
|
@ -307,7 +338,7 @@
|
|||
{
|
||||
next = node->next;
|
||||
|
||||
if ( select( node, key ) )
|
||||
if ( selection( node, key ) )
|
||||
FTC_MruList_Remove( list, node );
|
||||
|
||||
node = next;
|
||||
|
@ -315,5 +346,5 @@
|
|||
}
|
||||
}
|
||||
|
||||
/* END */
|
||||
|
||||
/* END */
|
||||
|
|
Binary file not shown.
|
@ -1,4 +1,4 @@
|
|||
# FreeType 2 src/cff Jamfile (c) 2001 David Turner
|
||||
# FreeType 2 src/cff Jamfile (c) 2001, 2002 David Turner
|
||||
#
|
||||
|
||||
SubDir FT2_TOP $(FT2_SRC_DIR) cff ;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType OpenType driver component (body only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -62,7 +62,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
|
||||
FT_LOCAL( FT_Byte )
|
||||
cff_fd_select_get( CFF_FDSelect select,
|
||||
cff_fd_select_get( CFF_FDSelect fdselect,
|
||||
FT_UInt glyph_index );
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* CFF token stream parser (specification) */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# FreeType 2 src/pshinter Jamfile (c) 2001 David Turner
|
||||
# FreeType 2 src/pshinter Jamfile (c) 2001, 2003 David Turner
|
||||
#
|
||||
|
||||
SubDir FT2_TOP $(FT2_SRC_DIR) pshinter ;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Postscript (Type1/Type2) hints recorder (specification). */
|
||||
/* */
|
||||
/* Copyright 2001, 2002 by */
|
||||
/* Copyright 2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Single object library component. */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* TrueType new character mapping table (cmap) support (specification). */
|
||||
/* */
|
||||
/* Copyright 2002 by */
|
||||
/* Copyright 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Type 42 font data types (specification only). */
|
||||
/* */
|
||||
/* Copyright 2002 by Roberto Alameda. */
|
||||
/* Copyright 2002, 2003 by Roberto Alameda. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType font driver for Windows FNT/FON files */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
Loading…
Reference in New Issue