* include/freetype/config/ftoption.h: clarify documentation regarding
unpatented hinting * include/freetype/freetype.h, src/base/ftpatent.c, src/truetype/ttdriver.c, include/freetype/internal/services/svttglyf.h, modules.cfg,: include/freetype/internal/ftserv.h,: Fonts without a cmap must be handled correctly by FreeType (anything Adding the FT_Face_CheckTrueTypePatents API to FT_FREETYPE_H, it is implemented by the optional src/base/ftpatent.c
This commit is contained in:
parent
33db39e292
commit
84c6f88117
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2007-06-10 David Turner <david@freetype.org>
|
||||
|
||||
* include/freetype/config/ftoption.h: clarify documentation regarding
|
||||
unpatented hinting
|
||||
|
||||
* include/freetype/freetype.h, src/base/ftpatent.c, src/truetype/ttdriver.c,
|
||||
include/freetype/internal/services/svttglyf.h, modules.cfg,:
|
||||
include/freetype/internal/ftserv.h,:
|
||||
Fonts without a cmap must be handled correctly by FreeType (anything
|
||||
Adding the FT_Face_CheckTrueTypePatents API to FT_FREETYPE_H, it is
|
||||
implemented by the optional src/base/ftpatent.c
|
||||
|
||||
2007-06-08 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
* src/sfnt/sfobjs.c (sfnt_load_face): Undo change from 2007-04-28.
|
||||
|
|
|
@ -463,12 +463,26 @@ FT_BEGIN_HEADER
|
|||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_UNPATENTED_HINTING (in addition to */
|
||||
/* TT_CONFIG_OPTION_BYTECODE_INTERPRETER) to compile the unpatented */
|
||||
/* work-around hinting system. Note that for the moment, the algorithm */
|
||||
/* is only used when selected at runtime through the parameter tag */
|
||||
/* FT_PARAM_TAG_UNPATENTED_HINTING; or when the debug hook */
|
||||
/* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally activated. */
|
||||
/* The TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you */
|
||||
/* have defined TT_CONFIG_OPTION_BYTECODE_INTERPRETER. If not, it will */
|
||||
/* compile a special work-around TrueType bytecode interpreter that */
|
||||
/* doesn't implement any of the patented opcodes/algorithms. */
|
||||
/* */
|
||||
/* this is only useful for a small number of font files (mostly Asian) */
|
||||
/* that require bytecode interpretation to properly load glyphs. For all */
|
||||
/* other fonts, this will produce unpleasant results. */
|
||||
/* */
|
||||
/* for this reason, the unpatented interpreter is never used by to load */
|
||||
/* glyphs from TrueType fonts, unless one of the following happens: */
|
||||
/* */
|
||||
/* - the unpatented interpreter is explicitely activated by the */
|
||||
/* user through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
|
||||
/* when opening the FT_Face */
|
||||
/* */
|
||||
/* - FreeType detects that the FT_Face corresponds to one of the */
|
||||
/* 'trick' fonts (e.g. Mingliu) it knows about. The font engine */
|
||||
/* contains a hard-coded list of font names and other matching */
|
||||
/* parameters. */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_UNPATENTED_HINTING
|
||||
|
||||
|
|
|
@ -3368,6 +3368,31 @@ FT_BEGIN_HEADER
|
|||
FT_Int *aminor,
|
||||
FT_Int *apatch );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Face_CheckTrueTypePatents */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Parses the whole content of a TrueType font file and returns */
|
||||
/* true if it uses any of the patented opcodes. this is only useful */
|
||||
/* if you want to be able to use the unpatented hinter with */
|
||||
/* fonts that do *not* use these opcodes. */
|
||||
/* */
|
||||
/* note that this function parses *all* glyph instructions in the */
|
||||
/* font file, and may be *slow* */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: a face handle */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* TRUE if this is a TrueType font that uses one of the patented */
|
||||
/* opcodes. FALSE otherwise */
|
||||
/* */
|
||||
FT_EXPORT( FT_Bool )
|
||||
FT_Face_CheckTrueTypePatents( FT_Face face );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
|
|
|
@ -315,6 +315,7 @@ FT_BEGIN_HEADER
|
|||
#define FT_SERVICE_TT_CMAP_H <freetype/internal/services/svttcmap.h>
|
||||
#define FT_SERVICE_WINFNT_H <freetype/internal/services/svwinfnt.h>
|
||||
#define FT_SERVICE_XFREE86_NAME_H <freetype/internal/services/svxf86nm.h>
|
||||
#define FT_SERVICE_TRUETYPE_GLYF_H <freetype/internal/services/svttglyf.h>
|
||||
|
||||
/* */
|
||||
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* svsttglyf.h */
|
||||
/* */
|
||||
/* The FreeType TrueType glyph service. */
|
||||
/* */
|
||||
/* Copyright 2007 by David Turner. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
#ifndef __SVTTGLYF_H__
|
||||
#define __SVTTGLYF_H__
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define FT_SERVICE_ID_TT_GLYF "tt-glyf"
|
||||
|
||||
|
||||
typedef FT_ULong
|
||||
(*TT_Glyf_GetLocationFunc)( FT_Face face,
|
||||
FT_UInt gindex,
|
||||
FT_ULong *psize );
|
||||
|
||||
FT_DEFINE_SERVICE( TTGlyf )
|
||||
{
|
||||
TT_Glyf_GetLocationFunc get_location;
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __SVTTCMAP_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -220,6 +220,11 @@ BASE_EXTENSIONS += ftlcdfil.c
|
|||
# See include/freetype/ftgasp.h for the API.
|
||||
BASE_EXTENSIONS += ftgasp.c
|
||||
|
||||
# Support for FT_Face_CheckTrueTypePatents
|
||||
#
|
||||
# See include/freetype.h for the API.
|
||||
BASE_EXTENSIONS += ftpatent.c
|
||||
|
||||
####
|
||||
#### The components `ftsystem.c' (for memory allocation and stream I/O
|
||||
#### management) and `ftdebug.c' (for emitting debug messages to the user)
|
||||
|
|
|
@ -34,7 +34,7 @@ SubDir FT2_TOP $(FT2_SRC_DIR) base ;
|
|||
local _sources = system init glyph mm bdf
|
||||
bbox debug xf86 type1 pfr
|
||||
stroke winfnt otval bitmap synth
|
||||
gxval lcdfil gasp
|
||||
gxval lcdfil gasp patent
|
||||
;
|
||||
|
||||
Library $(FT2_LIB) : ft$(_sources).c ;
|
||||
|
|
|
@ -29,9 +29,11 @@
|
|||
#endif
|
||||
|
||||
#include FT_SERVICE_TRUETYPE_ENGINE_H
|
||||
#include FT_SERVICE_TRUETYPE_GLYF_H
|
||||
|
||||
#include "ttdriver.h"
|
||||
#include "ttgload.h"
|
||||
#include "ttpload.h"
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
#include "ttgxvar.h"
|
||||
|
@ -313,6 +315,11 @@
|
|||
#endif /* TT_USE_BYTECODE_INTERPRETER */
|
||||
};
|
||||
|
||||
static const FT_Service_TTGlyfRec tt_service_truetype_glyf =
|
||||
{
|
||||
(TT_Glyf_GetLocationFunc) tt_face_get_location
|
||||
};
|
||||
|
||||
static const FT_ServiceDescRec tt_services[] =
|
||||
{
|
||||
{ FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE },
|
||||
|
@ -320,6 +327,7 @@
|
|||
{ FT_SERVICE_ID_MULTI_MASTERS, &tt_service_gx_multi_masters },
|
||||
#endif
|
||||
{ FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine },
|
||||
{ FT_SERVICE_ID_TT_GLYF, &tt_service_truetype_glyf },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue