mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
[FREETYPE]
* Update to 2.5.3. Based on the sync done by Ivan Di Francesco. CORE-8033 svn path=/trunk/; revision=63335
This commit is contained in:
+1049
-6347
File diff suppressed because it is too large
Load Diff
Vendored
+6
-6
@@ -1,4 +1,4 @@
|
||||
FreeType 2.5.2
|
||||
FreeType 2.5.3
|
||||
==============
|
||||
|
||||
Homepage: http://www.freetype.org
|
||||
@@ -16,7 +16,7 @@
|
||||
the file `docs/LICENSE.TXT' for the available licenses.
|
||||
|
||||
The FreeType 2 API reference is located in `docs/reference'; use the
|
||||
file `ft2-doc.html' as the top entry point. Additional
|
||||
file `ft2-toc.html' as the top entry point. Additional
|
||||
documentation is available as a separate package from our sites. Go
|
||||
to
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
|
||||
and download one of the following files.
|
||||
|
||||
freetype-doc-2.5.2.tar.bz2
|
||||
freetype-doc-2.5.2.tar.gz
|
||||
ftdoc252.zip
|
||||
freetype-doc-2.5.3.tar.bz2
|
||||
freetype-doc-2.5.3.tar.gz
|
||||
ftdoc253.zip
|
||||
|
||||
To view the documentation online, go to
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright 2006-2013 by
|
||||
Copyright 2006-2014 by
|
||||
David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
|
||||
This file is part of the FreeType project, and may only be used,
|
||||
|
||||
+13
@@ -217,6 +217,19 @@ FT_BEGIN_HEADER
|
||||
#define FT_CONFIG_OPTION_USE_PNG
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* HarfBuzz support. */
|
||||
/* */
|
||||
/* FreeType uses the HarfBuzz library to improve auto-hinting of */
|
||||
/* OpenType fonts. If available, many glyphs not directly addressable */
|
||||
/* by a font's character map will be hinted also. */
|
||||
/* */
|
||||
/* Define this macro if you want to enable this `feature'. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_USE_HARFBUZZ
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define to disable the use of file stream functions and types, FILE, */
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* ANSI-specific configuration file (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2004, 2006-2008, 2010-2011, 2013 by */
|
||||
/* Copyright 1996-2004, 2006-2008, 2010-2011, 2013, 2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -386,7 +386,7 @@ FT_BEGIN_HEADER
|
||||
__asm__ __volatile__ (
|
||||
"smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
|
||||
"mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */
|
||||
#ifdef __clang__
|
||||
#if defined( __clang__ ) && defined( __thumb2__ )
|
||||
"add.w %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
|
||||
#else
|
||||
"add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
|
||||
|
||||
@@ -228,6 +228,19 @@ FT_BEGIN_HEADER
|
||||
/* #define FT_CONFIG_OPTION_USE_PNG */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* HarfBuzz support. */
|
||||
/* */
|
||||
/* FreeType uses the HarfBuzz library to improve auto-hinting of */
|
||||
/* OpenType fonts. If available, many glyphs not directly addressable */
|
||||
/* by a font's character map will be hinted also. */
|
||||
/* */
|
||||
/* Define this macro if you want to enable this `feature'. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_USE_HARFBUZZ */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* DLL export compilation */
|
||||
|
||||
+42
-2
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType high-level API and common types (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2013 by */
|
||||
/* Copyright 1996-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -39,6 +39,38 @@ FT_BEGIN_HEADER
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* header_inclusion */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* FreeType's header inclusion scheme */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* How client applications should include FreeType header files. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* To be as flexible as possible (and for historical reasons), */
|
||||
/* FreeType uses a very special inclusion scheme to load header */
|
||||
/* files, for example */
|
||||
/* */
|
||||
/* { */
|
||||
/* #include <ft2build.h> */
|
||||
/* */
|
||||
/* #include FT_FREETYPE_H */
|
||||
/* #include FT_OUTLINE_H */
|
||||
/* } */
|
||||
/* */
|
||||
/* A compiler and its preprocessor only needs an include path to find */
|
||||
/* the file `ft2build.h'; the exact locations and names of the other */
|
||||
/* FreeType header files are hidden by preprocessor macro names, */
|
||||
/* loaded by `ft2build.h'. The API documentation always gives the */
|
||||
/* header macro name needed for a particular function. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
@@ -2273,6 +2305,8 @@ FT_BEGIN_HEADER
|
||||
/* glyph relative to this size. For more information refer to */
|
||||
/* `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html' */
|
||||
/* */
|
||||
/* Don't use this function if you are using the FreeType cache API. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Request_Size( FT_Face face,
|
||||
FT_Size_Request req );
|
||||
@@ -2347,6 +2381,8 @@ FT_BEGIN_HEADER
|
||||
/* constrained, to this pixel size. Refer to @FT_Request_Size to */
|
||||
/* understand how requested sizes relate to actual sizes. */
|
||||
/* */
|
||||
/* Don't use this function if you are using the FreeType cache API. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Set_Pixel_Sizes( FT_Face face,
|
||||
FT_UInt pixel_width,
|
||||
@@ -2839,6 +2875,10 @@ FT_BEGIN_HEADER
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0~means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* To get meaningful results, font scaling values must be set with */
|
||||
/* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Render_Glyph( FT_GlyphSlot slot,
|
||||
FT_Render_Mode render_mode );
|
||||
@@ -3925,7 +3965,7 @@ FT_BEGIN_HEADER
|
||||
*/
|
||||
#define FREETYPE_MAJOR 2
|
||||
#define FREETYPE_MINOR 5
|
||||
#define FREETYPE_PATCH 2
|
||||
#define FREETYPE_PATCH 3
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
+46
-1
@@ -287,7 +287,52 @@ FT_BEGIN_HEADER
|
||||
* face-specific property like @glyph-to-script-map, or by auto-hinting
|
||||
* any glyph from that face. In particular, if you have already created
|
||||
* an @FT_Face structure but not loaded any glyph (using the
|
||||
* auto-hinter), a change of the fallback glyph will affect this face.
|
||||
* auto-hinter), a change of the fallback script will affect this face.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @property:
|
||||
* default-script
|
||||
*
|
||||
* @description:
|
||||
* *Experimental* *only*
|
||||
*
|
||||
* If Freetype gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make
|
||||
* the HarfBuzz library access OpenType features for getting better
|
||||
* glyph coverages, this property sets the (auto-fitter) script to be
|
||||
* used for the default (OpenType) script data of a font's GSUB table.
|
||||
* Features for the default script are intended for all scripts not
|
||||
* explicitly handled in GSUB; an example is a `dlig' feature,
|
||||
* containing the combination of the characters `T', `E', and `L' to
|
||||
* form a `TEL' ligature.
|
||||
*
|
||||
* By default, this is @FT_AUTOHINTER_SCRIPT_LATIN. Using the
|
||||
* `default-script' property, this default value can be changed.
|
||||
*
|
||||
* {
|
||||
* FT_Library library;
|
||||
* FT_UInt default_script = FT_AUTOHINTER_SCRIPT_NONE;
|
||||
*
|
||||
*
|
||||
* FT_Init_FreeType( &library );
|
||||
*
|
||||
* FT_Property_Set( library, "autofitter",
|
||||
* "default-script", &default_script );
|
||||
* }
|
||||
*
|
||||
* @note:
|
||||
* This property can be used with @FT_Property_Get also.
|
||||
*
|
||||
* It's important to use the right timing for changing this value: The
|
||||
* creation of the glyph-to-script map that eventually uses the
|
||||
* default script value gets triggered either by setting or reading a
|
||||
* face-specific property like @glyph-to-script-map, or by auto-hinting
|
||||
* any glyph from that face. In particular, if you have already created
|
||||
* an @FT_Face structure but not loaded any glyph (using the
|
||||
* auto-hinter), a change of the default script will affect this face.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
+3
-2
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType API for accessing BDF-specific strings (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004, 2006, 2009 by */
|
||||
/* Copyright 2002-2004, 2006, 2009, 2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -106,7 +106,8 @@ FT_BEGIN_HEADER
|
||||
* The property type.
|
||||
*
|
||||
* u.atom ::
|
||||
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
|
||||
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be
|
||||
* NULL, indicating an empty string.
|
||||
*
|
||||
* u.integer ::
|
||||
* A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
/* General Remarks */
|
||||
/* */
|
||||
/* <Sections> */
|
||||
/* header_inclusion */
|
||||
/* user_allocation */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
+4
-1
@@ -5,7 +5,7 @@
|
||||
/* Support for the FT_Outline type used to store glyph shapes of */
|
||||
/* most scalable font formats (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2003, 2005-2013 by */
|
||||
/* Copyright 1996-2003, 2005-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -355,6 +355,9 @@ FT_BEGIN_HEADER
|
||||
/* FT_Outline_Embolden( &face->slot->outline, strength ); */
|
||||
/* } */
|
||||
/* */
|
||||
/* To get meaningful results, font scaling values must be set with */
|
||||
/* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Outline_Embolden( FT_Outline* outline,
|
||||
FT_Pos strength );
|
||||
|
||||
+10
-2
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Embedded resource forks accessor (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2006, 2007, 2012 by */
|
||||
/* Copyright 2004, 2006, 2007, 2012, 2013 by */
|
||||
/* Masatake YAMATO and Redhat K.K. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -94,7 +94,7 @@ FT_BEGIN_HEADER
|
||||
/* this array is a function in PIC mode, so no ; is needed in END */
|
||||
#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
|
||||
void \
|
||||
FT_Init_ ## name( type* storage ) \
|
||||
FT_Init_Table_ ## name( type* storage ) \
|
||||
{ \
|
||||
type* local = storage; \
|
||||
\
|
||||
@@ -224,6 +224,13 @@ FT_BEGIN_HEADER
|
||||
/* tag :: */
|
||||
/* The resource tag. */
|
||||
/* */
|
||||
/* sort_by_res_id :: */
|
||||
/* A Boolean to sort the fragmented resource by their ids. */
|
||||
/* The fragmented resources for `POST' resource should be sorted */
|
||||
/* to restore Type1 font properly. For `snft' resources, sorting */
|
||||
/* may induce a different order of the faces in comparison to that */
|
||||
/* by QuickDraw API. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* offsets :: */
|
||||
/* The stream offsets for the resource data specified by `tag'. */
|
||||
@@ -246,6 +253,7 @@ FT_BEGIN_HEADER
|
||||
FT_Long map_offset,
|
||||
FT_Long rdata_pos,
|
||||
FT_Long tag,
|
||||
FT_Bool sort_by_res_id,
|
||||
FT_Long **offsets,
|
||||
FT_Long *count );
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Tracing handling (specification only). */
|
||||
/* */
|
||||
/* Copyright 2002, 2004-2007, 2009, 2011-2013 by */
|
||||
/* Copyright 2002, 2004-2007, 2009, 2011-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -148,5 +148,7 @@ FT_TRACE_DEF( afcjk )
|
||||
FT_TRACE_DEF( aflatin )
|
||||
FT_TRACE_DEF( aflatin2 )
|
||||
FT_TRACE_DEF( afwarp )
|
||||
FT_TRACE_DEF( afharfbuzz )
|
||||
FT_TRACE_DEF( afglobal )
|
||||
|
||||
/* END */
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@
|
||||
};
|
||||
|
||||
|
||||
/* stringsets are specific to scripts */
|
||||
/* stringsets are specific to styles */
|
||||
FT_LOCAL_ARRAY_DEF( AF_Blue_StringRec )
|
||||
af_blue_stringsets[] =
|
||||
{
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
};
|
||||
|
||||
|
||||
/* stringsets are specific to scripts */
|
||||
/* stringsets are specific to styles */
|
||||
FT_LOCAL_ARRAY_DEF( AF_Blue_StringRec )
|
||||
af_blue_stringsets[] =
|
||||
{
|
||||
|
||||
+9
-9
@@ -103,13 +103,13 @@ FT_BEGIN_HEADER
|
||||
AF_BLUE_STRING_CJK_LEFT_UNFILL = af_blue_1_1_1 + 77,
|
||||
AF_BLUE_STRING_CJK_RIGHT_FILL = af_blue_1_1_1 + 153,
|
||||
AF_BLUE_STRING_CJK_RIGHT_UNFILL = af_blue_1_1_1 + 229,
|
||||
af_blue_1_2_1 = af_blue_1_1_1 + 304,
|
||||
af_blue_1_1_2 = af_blue_1_1_1 + 304,
|
||||
#else
|
||||
af_blue_1_2_1 = af_blue_1_1_1 + 0,
|
||||
af_blue_1_1_2 = af_blue_1_1_1 + 0,
|
||||
#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
|
||||
af_blue_1_2 = af_blue_1_2_1 + 0,
|
||||
af_blue_1_2 = af_blue_1_1_2 + 0,
|
||||
#else
|
||||
af_blue_1_2 = af_blue_1_2_1 + 0,
|
||||
af_blue_1_2 = af_blue_1_1 + 0,
|
||||
#endif /* AF_CONFIG_OPTION_CJK */
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* The next level is to group blue strings into script-specific sets. */
|
||||
/* The next level is to group blue strings into style-specific sets. */
|
||||
|
||||
|
||||
/* Properties are specific to a writing system. We assume that a given */
|
||||
@@ -162,13 +162,13 @@ FT_BEGIN_HEADER
|
||||
AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0,
|
||||
af_blue_2_1_1 = af_blue_2_1 + 4,
|
||||
#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
|
||||
af_blue_2_2_1 = af_blue_2_1_1 + 4,
|
||||
af_blue_2_1_2 = af_blue_2_1_1 + 4,
|
||||
#else
|
||||
af_blue_2_2_1 = af_blue_2_1_1 + 0,
|
||||
af_blue_2_1_2 = af_blue_2_1_1 + 0,
|
||||
#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
|
||||
af_blue_2_2 = af_blue_2_2_1 + 1,
|
||||
af_blue_2_2 = af_blue_2_1_2 + 1,
|
||||
#else
|
||||
af_blue_2_2 = af_blue_2_2_1 + 0,
|
||||
af_blue_2_2 = af_blue_2_1 + 0,
|
||||
#endif /* AF_CONFIG_OPTION_CJK */
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* The next level is to group blue strings into script-specific sets. */
|
||||
/* The next level is to group blue strings into style-specific sets. */
|
||||
|
||||
|
||||
/* Properties are specific to a writing system. We assume that a given */
|
||||
|
||||
+78
-93
@@ -2,7 +2,7 @@
|
||||
/* */
|
||||
/* afcjk.c */
|
||||
/* */
|
||||
/* Auto-fitter hinting routines for CJK script (body). */
|
||||
/* Auto-fitter hinting routines for CJK writing system (body). */
|
||||
/* */
|
||||
/* Copyright 2006-2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
@@ -27,6 +27,7 @@
|
||||
#include FT_INTERNAL_DEBUG_H
|
||||
|
||||
#include "afglobal.h"
|
||||
#include "afpic.h"
|
||||
#include "aflatin.h"
|
||||
|
||||
|
||||
@@ -74,10 +75,10 @@
|
||||
|
||||
|
||||
FT_TRACE5(( "\n"
|
||||
"cjk standard widths computation (script `%s')\n"
|
||||
"===============================================\n"
|
||||
"cjk standard widths computation (style `%s')\n"
|
||||
"===================================================\n"
|
||||
"\n",
|
||||
af_script_names[metrics->root.script_class->script] ));
|
||||
af_style_names[metrics->root.style_class->style] ));
|
||||
|
||||
af_glyph_hints_init( hints, face->memory );
|
||||
|
||||
@@ -86,20 +87,59 @@
|
||||
|
||||
{
|
||||
FT_Error error;
|
||||
FT_UInt glyph_index;
|
||||
FT_ULong glyph_index;
|
||||
FT_Long y_offset;
|
||||
int dim;
|
||||
AF_CJKMetricsRec dummy[1];
|
||||
AF_Scaler scaler = &dummy->root.scaler;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_PIC
|
||||
AF_FaceGlobals globals = metrics->root.globals;
|
||||
#endif
|
||||
|
||||
glyph_index = FT_Get_Char_Index(
|
||||
face,
|
||||
metrics->root.script_class->standard_char );
|
||||
if ( glyph_index == 0 )
|
||||
goto Exit;
|
||||
AF_StyleClass style_class = metrics->root.style_class;
|
||||
AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET
|
||||
[style_class->script];
|
||||
|
||||
FT_UInt32 standard_char;
|
||||
|
||||
|
||||
standard_char = script_class->standard_char1;
|
||||
af_get_char_index( &metrics->root,
|
||||
standard_char,
|
||||
&glyph_index,
|
||||
&y_offset );
|
||||
if ( !glyph_index )
|
||||
{
|
||||
if ( script_class->standard_char2 )
|
||||
{
|
||||
standard_char = script_class->standard_char2;
|
||||
af_get_char_index( &metrics->root,
|
||||
standard_char,
|
||||
&glyph_index,
|
||||
&y_offset );
|
||||
if ( !glyph_index )
|
||||
{
|
||||
if ( script_class->standard_char3 )
|
||||
{
|
||||
standard_char = script_class->standard_char3;
|
||||
af_get_char_index( &metrics->root,
|
||||
standard_char,
|
||||
&glyph_index,
|
||||
&y_offset );
|
||||
if ( !glyph_index )
|
||||
goto Exit;
|
||||
}
|
||||
else
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n",
|
||||
metrics->root.script_class->standard_char, glyph_index ));
|
||||
standard_char, glyph_index ));
|
||||
|
||||
error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
|
||||
if ( error || face->glyph->outline.n_points <= 0 )
|
||||
@@ -118,7 +158,7 @@
|
||||
scaler->render_mode = FT_RENDER_MODE_NORMAL;
|
||||
scaler->flags = 0;
|
||||
|
||||
af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy );
|
||||
af_glyph_hints_rescale( hints, (AF_StyleMetrics)dummy );
|
||||
|
||||
error = af_glyph_hints_reload( hints, &face->glyph->outline );
|
||||
if ( error )
|
||||
@@ -226,7 +266,9 @@
|
||||
AF_CJKAxis axis;
|
||||
FT_Outline outline;
|
||||
|
||||
AF_Blue_Stringset bss = metrics->root.script_class->blue_stringset;
|
||||
AF_StyleClass sc = metrics->root.style_class;
|
||||
|
||||
AF_Blue_Stringset bss = sc->blue_stringset;
|
||||
const AF_Blue_StringRec* bs = &af_blue_stringsets[bss];
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
@@ -246,9 +288,9 @@
|
||||
#endif
|
||||
|
||||
|
||||
/* we walk over the blue character strings as specified in the */
|
||||
/* script's entry in the `af_blue_stringset' array, computing its */
|
||||
/* extremum points (depending on the string properties) */
|
||||
/* we walk over the blue character strings as specified in the */
|
||||
/* style's entry in the `af_blue_stringset' array, computing its */
|
||||
/* extremum points (depending on the string properties) */
|
||||
|
||||
FT_TRACE5(( "cjk blue zones computation\n"
|
||||
"==========================\n"
|
||||
@@ -279,7 +321,8 @@
|
||||
while ( *p )
|
||||
{
|
||||
FT_ULong ch;
|
||||
FT_UInt glyph_index;
|
||||
FT_ULong glyph_index;
|
||||
FT_Long y_offset;
|
||||
FT_Pos best_pos; /* same as points.y or points.x, resp. */
|
||||
FT_Int best_point;
|
||||
FT_Vector* points;
|
||||
@@ -288,7 +331,7 @@
|
||||
GET_UTF8_CHAR( ch, p );
|
||||
|
||||
/* load the character in the face -- skip unknown or empty ones */
|
||||
glyph_index = FT_Get_Char_Index( face, ch );
|
||||
af_get_char_index( &metrics->root, ch, &glyph_index, &y_offset );
|
||||
if ( glyph_index == 0 )
|
||||
{
|
||||
FT_TRACE5(( " U+%04lX unavailable\n", ch ));
|
||||
@@ -467,10 +510,11 @@
|
||||
/* digit `0' is 0x30 in all supported charmaps */
|
||||
for ( i = 0x30; i <= 0x39; i++ )
|
||||
{
|
||||
FT_UInt glyph_index;
|
||||
FT_ULong glyph_index;
|
||||
FT_Long y_offset;
|
||||
|
||||
|
||||
glyph_index = FT_Get_Char_Index( face, i );
|
||||
af_get_char_index( &metrics->root, i, &glyph_index, &y_offset );
|
||||
if ( glyph_index == 0 )
|
||||
continue;
|
||||
|
||||
@@ -1234,7 +1278,7 @@
|
||||
FT_UInt32 scaler_flags, other_flags;
|
||||
|
||||
|
||||
af_glyph_hints_rescale( hints, (AF_ScriptMetrics)metrics );
|
||||
af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );
|
||||
|
||||
/*
|
||||
* correct x_scale and y_scale when needed, since they may have
|
||||
@@ -1665,9 +1709,9 @@
|
||||
#endif
|
||||
|
||||
|
||||
FT_TRACE5(( "cjk %s edge hinting (script `%s')\n",
|
||||
FT_TRACE5(( "cjk %s edge hinting (style `%s')\n",
|
||||
dim == AF_DIMENSION_VERT ? "horizontal" : "vertical",
|
||||
af_script_names[hints->metrics->script_class->script] ));
|
||||
af_style_names[hints->metrics->style_class->style] ));
|
||||
|
||||
/* we begin by aligning all stems relative to the blue zone */
|
||||
|
||||
@@ -2210,60 +2254,18 @@
|
||||
|
||||
sizeof ( AF_CJKMetricsRec ),
|
||||
|
||||
(AF_Script_InitMetricsFunc) af_cjk_metrics_init,
|
||||
(AF_Script_ScaleMetricsFunc)af_cjk_metrics_scale,
|
||||
(AF_Script_DoneMetricsFunc) NULL,
|
||||
(AF_WritingSystem_InitMetricsFunc) af_cjk_metrics_init,
|
||||
(AF_WritingSystem_ScaleMetricsFunc)af_cjk_metrics_scale,
|
||||
(AF_WritingSystem_DoneMetricsFunc) NULL,
|
||||
|
||||
(AF_Script_InitHintsFunc) af_cjk_hints_init,
|
||||
(AF_Script_ApplyHintsFunc) af_cjk_hints_apply
|
||||
(AF_WritingSystem_InitHintsFunc) af_cjk_hints_init,
|
||||
(AF_WritingSystem_ApplyHintsFunc) af_cjk_hints_apply
|
||||
)
|
||||
|
||||
|
||||
/* this corresponds to Unicode 6.0 */
|
||||
|
||||
/* XXX: this should probably fine tuned to differentiate better between */
|
||||
/* scripts... */
|
||||
|
||||
static const AF_Script_UniRangeRec af_hani_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x1100UL, 0x11FFUL ), /* Hangul Jamo */
|
||||
AF_UNIRANGE_REC( 0x2E80UL, 0x2EFFUL ), /* CJK Radicals Supplement */
|
||||
AF_UNIRANGE_REC( 0x2F00UL, 0x2FDFUL ), /* Kangxi Radicals */
|
||||
AF_UNIRANGE_REC( 0x2FF0UL, 0x2FFFUL ), /* Ideographic Description Characters */
|
||||
AF_UNIRANGE_REC( 0x3000UL, 0x303FUL ), /* CJK Symbols and Punctuation */
|
||||
AF_UNIRANGE_REC( 0x3040UL, 0x309FUL ), /* Hiragana */
|
||||
AF_UNIRANGE_REC( 0x30A0UL, 0x30FFUL ), /* Katakana */
|
||||
AF_UNIRANGE_REC( 0x3100UL, 0x312FUL ), /* Bopomofo */
|
||||
AF_UNIRANGE_REC( 0x3130UL, 0x318FUL ), /* Hangul Compatibility Jamo */
|
||||
AF_UNIRANGE_REC( 0x3190UL, 0x319FUL ), /* Kanbun */
|
||||
AF_UNIRANGE_REC( 0x31A0UL, 0x31BFUL ), /* Bopomofo Extended */
|
||||
AF_UNIRANGE_REC( 0x31C0UL, 0x31EFUL ), /* CJK Strokes */
|
||||
AF_UNIRANGE_REC( 0x31F0UL, 0x31FFUL ), /* Katakana Phonetic Extensions */
|
||||
AF_UNIRANGE_REC( 0x3200UL, 0x32FFUL ), /* Enclosed CJK Letters and Months */
|
||||
AF_UNIRANGE_REC( 0x3300UL, 0x33FFUL ), /* CJK Compatibility */
|
||||
AF_UNIRANGE_REC( 0x3400UL, 0x4DBFUL ), /* CJK Unified Ideographs Extension A */
|
||||
AF_UNIRANGE_REC( 0x4DC0UL, 0x4DFFUL ), /* Yijing Hexagram Symbols */
|
||||
AF_UNIRANGE_REC( 0x4E00UL, 0x9FFFUL ), /* CJK Unified Ideographs */
|
||||
AF_UNIRANGE_REC( 0xA960UL, 0xA97FUL ), /* Hangul Jamo Extended-A */
|
||||
AF_UNIRANGE_REC( 0xAC00UL, 0xD7AFUL ), /* Hangul Syllables */
|
||||
AF_UNIRANGE_REC( 0xD7B0UL, 0xD7FFUL ), /* Hangul Jamo Extended-B */
|
||||
AF_UNIRANGE_REC( 0xF900UL, 0xFAFFUL ), /* CJK Compatibility Ideographs */
|
||||
AF_UNIRANGE_REC( 0xFE10UL, 0xFE1FUL ), /* Vertical forms */
|
||||
AF_UNIRANGE_REC( 0xFE30UL, 0xFE4FUL ), /* CJK Compatibility Forms */
|
||||
AF_UNIRANGE_REC( 0xFF00UL, 0xFFEFUL ), /* Halfwidth and Fullwidth Forms */
|
||||
AF_UNIRANGE_REC( 0x1B000UL, 0x1B0FFUL ), /* Kana Supplement */
|
||||
AF_UNIRANGE_REC( 0x1D300UL, 0x1D35FUL ), /* Tai Xuan Hing Symbols */
|
||||
AF_UNIRANGE_REC( 0x1F200UL, 0x1F2FFUL ), /* Enclosed Ideographic Supplement */
|
||||
AF_UNIRANGE_REC( 0x20000UL, 0x2A6DFUL ), /* CJK Unified Ideographs Extension B */
|
||||
AF_UNIRANGE_REC( 0x2A700UL, 0x2B73FUL ), /* CJK Unified Ideographs Extension C */
|
||||
AF_UNIRANGE_REC( 0x2B740UL, 0x2B81FUL ), /* CJK Unified Ideographs Extension D */
|
||||
AF_UNIRANGE_REC( 0x2F800UL, 0x2FA1FUL ), /* CJK Compatibility Ideographs Supplement */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
|
||||
#else /* !AF_CONFIG_OPTION_CJK */
|
||||
|
||||
|
||||
AF_DEFINE_WRITING_SYSTEM_CLASS(
|
||||
af_cjk_writing_system_class,
|
||||
|
||||
@@ -2271,33 +2273,16 @@
|
||||
|
||||
sizeof ( AF_CJKMetricsRec ),
|
||||
|
||||
(AF_Script_InitMetricsFunc) NULL,
|
||||
(AF_Script_ScaleMetricsFunc)NULL,
|
||||
(AF_Script_DoneMetricsFunc) NULL,
|
||||
(AF_WritingSystem_InitMetricsFunc) NULL,
|
||||
(AF_WritingSystem_ScaleMetricsFunc)NULL,
|
||||
(AF_WritingSystem_DoneMetricsFunc) NULL,
|
||||
|
||||
(AF_Script_InitHintsFunc) NULL,
|
||||
(AF_Script_ApplyHintsFunc) NULL
|
||||
(AF_WritingSystem_InitHintsFunc) NULL,
|
||||
(AF_WritingSystem_ApplyHintsFunc) NULL
|
||||
)
|
||||
|
||||
|
||||
static const AF_Script_UniRangeRec af_hani_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
#endif /* !AF_CONFIG_OPTION_CJK */
|
||||
|
||||
|
||||
AF_DEFINE_SCRIPT_CLASS(
|
||||
af_hani_script_class,
|
||||
|
||||
AF_SCRIPT_HANI,
|
||||
AF_BLUE_STRINGSET_HANI,
|
||||
AF_WRITING_SYSTEM_CJK,
|
||||
|
||||
af_hani_uniranges,
|
||||
0x7530 /* 田 */
|
||||
)
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
+4
-9
@@ -2,7 +2,7 @@
|
||||
/* */
|
||||
/* afcjk.h */
|
||||
/* */
|
||||
/* Auto-fitter hinting routines for CJK script (specification). */
|
||||
/* Auto-fitter hinting routines for CJK writing system (specification). */
|
||||
/* */
|
||||
/* Copyright 2006, 2007, 2011-2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
@@ -31,11 +31,6 @@ FT_BEGIN_HEADER
|
||||
AF_DECLARE_WRITING_SYSTEM_CLASS( af_cjk_writing_system_class )
|
||||
|
||||
|
||||
/* the CJK-specific script classes */
|
||||
|
||||
AF_DECLARE_SCRIPT_CLASS( af_hani_script_class )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
@@ -105,9 +100,9 @@ FT_BEGIN_HEADER
|
||||
|
||||
typedef struct AF_CJKMetricsRec_
|
||||
{
|
||||
AF_ScriptMetricsRec root;
|
||||
FT_UInt units_per_em;
|
||||
AF_CJKAxisRec axis[AF_DIMENSION_MAX];
|
||||
AF_StyleMetricsRec root;
|
||||
FT_UInt units_per_em;
|
||||
AF_CJKAxisRec axis[AF_DIMENSION_MAX];
|
||||
|
||||
} AF_CJKMetricsRec, *AF_CJKMetrics;
|
||||
|
||||
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* afcover.h */
|
||||
/* */
|
||||
/* Auto-fitter coverages (specification only). */
|
||||
/* */
|
||||
/* Copyright 2013, 2014 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/* This header file can be included multiple times. */
|
||||
/* Define `COVERAGE' as needed. */
|
||||
|
||||
|
||||
/* Add new coverages here. The first and second arguments are the */
|
||||
/* coverage name in lowercase and uppercase, respectively, followed */
|
||||
/* by a description string. The last four arguments are the four */
|
||||
/* characters defining the corresponding OpenType feature. */
|
||||
|
||||
#if 0
|
||||
/* XXX: It's not possible to define blue zone characters in advance. */
|
||||
COVERAGE( alternative_fractions, ALTERNATIVE_FRACTIONS,
|
||||
"alternative fractions",
|
||||
'a', 'f', 'r', 'c' )
|
||||
#endif
|
||||
|
||||
COVERAGE( petite_capitals_from_capitals, PETITE_CAPITALS_FROM_CAPITALS,
|
||||
"petite capitals from capitals",
|
||||
'c', '2', 'c', 'p' )
|
||||
|
||||
COVERAGE( small_capitals_from_capitals, SMALL_CAPITALS_FROM_CAPITALS,
|
||||
"small capitals from capitals",
|
||||
'c', '2', 's', 'c' )
|
||||
|
||||
#if 0
|
||||
/* XXX: Only digits are in this coverage, however, both normal style */
|
||||
/* and oldstyle representation forms are possible. */
|
||||
COVERAGE( denominators, DENOMINATORS,
|
||||
"denominators",
|
||||
'd', 'n', 'o', 'm' )
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* XXX: It's not possible to define blue zone characters in advance. */
|
||||
COVERAGE( fractions, FRACTIONS,
|
||||
"fractions",
|
||||
'f', 'r', 'a', 'c' )
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* XXX: Only digits are in this coverage, however, both normal style */
|
||||
/* and oldstyle representation forms are possible. */
|
||||
COVERAGE( numerators, NUMERATORS,
|
||||
"numerators",
|
||||
'n', 'u', 'm', 'r' )
|
||||
#endif
|
||||
|
||||
COVERAGE( ordinals, ORDINALS,
|
||||
"ordinals",
|
||||
'o', 'r', 'd', 'n' )
|
||||
|
||||
COVERAGE( petite_capitals, PETITE_CAPITALS,
|
||||
"petite capitals",
|
||||
'p', 'c', 'a', 'p' )
|
||||
|
||||
COVERAGE( ruby, RUBY,
|
||||
"ruby",
|
||||
'r', 'u', 'b', 'y' )
|
||||
|
||||
COVERAGE( scientific_inferiors, SCIENTIFIC_INFERIORS,
|
||||
"scientific inferiors",
|
||||
's', 'i', 'n', 'f' )
|
||||
|
||||
COVERAGE( small_capitals, SMALL_CAPITALS,
|
||||
"small capitals",
|
||||
's', 'm', 'c', 'p' )
|
||||
|
||||
COVERAGE( subscript, SUBSCRIPT,
|
||||
"subscript",
|
||||
's', 'u', 'b', 's' )
|
||||
|
||||
COVERAGE( superscript, SUPERSCRIPT,
|
||||
"superscript",
|
||||
's', 'u', 'p', 's' )
|
||||
|
||||
COVERAGE( titling, TITLING,
|
||||
"titling",
|
||||
't', 'i', 't', 'l' )
|
||||
|
||||
#if 0
|
||||
/* to be always excluded */
|
||||
COVERAGE(nalt, 'n', 'a', 'l', 't'); /* Alternate Annotation Forms (?) */
|
||||
COVERAGE(ornm, 'o', 'r', 'n', 'm'); /* Ornaments (?) */
|
||||
#endif
|
||||
|
||||
|
||||
/* END */
|
||||
+8
-20
@@ -23,8 +23,8 @@
|
||||
|
||||
|
||||
static FT_Error
|
||||
af_dummy_hints_init( AF_GlyphHints hints,
|
||||
AF_ScriptMetrics metrics )
|
||||
af_dummy_hints_init( AF_GlyphHints hints,
|
||||
AF_StyleMetrics metrics )
|
||||
{
|
||||
af_glyph_hints_rescale( hints, metrics );
|
||||
|
||||
@@ -57,26 +57,14 @@
|
||||
|
||||
AF_WRITING_SYSTEM_DUMMY,
|
||||
|
||||
sizeof ( AF_ScriptMetricsRec ),
|
||||
sizeof ( AF_StyleMetricsRec ),
|
||||
|
||||
(AF_Script_InitMetricsFunc) NULL,
|
||||
(AF_Script_ScaleMetricsFunc)NULL,
|
||||
(AF_Script_DoneMetricsFunc) NULL,
|
||||
(AF_WritingSystem_InitMetricsFunc) NULL,
|
||||
(AF_WritingSystem_ScaleMetricsFunc)NULL,
|
||||
(AF_WritingSystem_DoneMetricsFunc) NULL,
|
||||
|
||||
(AF_Script_InitHintsFunc) af_dummy_hints_init,
|
||||
(AF_Script_ApplyHintsFunc) af_dummy_hints_apply
|
||||
)
|
||||
|
||||
|
||||
AF_DEFINE_SCRIPT_CLASS(
|
||||
af_dflt_script_class,
|
||||
|
||||
AF_SCRIPT_DFLT,
|
||||
(AF_Blue_Stringset)0,
|
||||
AF_WRITING_SYSTEM_DUMMY,
|
||||
|
||||
NULL,
|
||||
'\0'
|
||||
(AF_WritingSystem_InitHintsFunc) af_dummy_hints_init,
|
||||
(AF_WritingSystem_ApplyHintsFunc) af_dummy_hints_apply
|
||||
)
|
||||
|
||||
|
||||
|
||||
+1
-5
@@ -25,14 +25,10 @@
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/* A dummy writing system and script class used when no hinting should be
|
||||
* performed.
|
||||
*/
|
||||
/* A dummy writing system used when no hinting should be performed. */
|
||||
|
||||
AF_DECLARE_WRITING_SYSTEM_CLASS( af_dummy_writing_system_class )
|
||||
|
||||
AF_DECLARE_SCRIPT_CLASS( af_dflt_script_class )
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
+213
-84
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter routines to compute global hinting values (body). */
|
||||
/* */
|
||||
/* Copyright 2003-2013 by */
|
||||
/* Copyright 2003-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -17,6 +17,20 @@
|
||||
|
||||
|
||||
#include "afglobal.h"
|
||||
#include "afranges.h"
|
||||
#include "hbshim.h"
|
||||
#include FT_INTERNAL_DEBUG_H
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
||||
/* messages during execution. */
|
||||
/* */
|
||||
#undef FT_COMPONENT
|
||||
#define FT_COMPONENT trace_afglobal
|
||||
|
||||
|
||||
/* get writing system specific header files */
|
||||
#undef WRITING_SYSTEM
|
||||
@@ -27,6 +41,30 @@
|
||||
#include "afpic.h"
|
||||
|
||||
|
||||
#undef SCRIPT
|
||||
#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \
|
||||
AF_DEFINE_SCRIPT_CLASS( \
|
||||
af_ ## s ## _script_class, \
|
||||
AF_SCRIPT_ ## S, \
|
||||
af_ ## s ## _uniranges, \
|
||||
sc1, sc2, sc3 )
|
||||
|
||||
#include "afscript.h"
|
||||
|
||||
|
||||
#undef STYLE
|
||||
#define STYLE( s, S, d, ws, sc, ss, c ) \
|
||||
AF_DEFINE_STYLE_CLASS( \
|
||||
af_ ## s ## _style_class, \
|
||||
AF_STYLE_ ## S, \
|
||||
ws, \
|
||||
sc, \
|
||||
ss, \
|
||||
c )
|
||||
|
||||
#include "afstyles.h"
|
||||
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_PIC
|
||||
|
||||
#undef WRITING_SYSTEM
|
||||
@@ -44,7 +82,7 @@
|
||||
|
||||
|
||||
#undef SCRIPT
|
||||
#define SCRIPT( s, S, d ) \
|
||||
#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \
|
||||
&af_ ## s ## _script_class,
|
||||
|
||||
FT_LOCAL_ARRAY_DEF( AF_ScriptClass )
|
||||
@@ -56,58 +94,76 @@
|
||||
NULL /* do not remove */
|
||||
};
|
||||
|
||||
|
||||
#undef STYLE
|
||||
#define STYLE( s, S, d, ws, sc, ss, c ) \
|
||||
&af_ ## s ## _style_class,
|
||||
|
||||
FT_LOCAL_ARRAY_DEF( AF_StyleClass )
|
||||
af_style_classes[] =
|
||||
{
|
||||
|
||||
#include "afstyles.h"
|
||||
|
||||
NULL /* do not remove */
|
||||
};
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_PIC */
|
||||
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
|
||||
#undef SCRIPT
|
||||
#define SCRIPT( s, S, d ) #s,
|
||||
#undef STYLE
|
||||
#define STYLE( s, S, d, ws, sc, ss, c ) #s,
|
||||
|
||||
FT_LOCAL_ARRAY_DEF( char* )
|
||||
af_script_names[] =
|
||||
af_style_names[] =
|
||||
{
|
||||
|
||||
#include "afscript.h"
|
||||
#include "afstyles.h"
|
||||
|
||||
};
|
||||
|
||||
#endif /* FT_DEBUG_LEVEL_TRACE */
|
||||
|
||||
|
||||
/* Compute the script index of each glyph within a given face. */
|
||||
/* Compute the style index of each glyph within a given face. */
|
||||
|
||||
static FT_Error
|
||||
af_face_globals_compute_script_coverage( AF_FaceGlobals globals )
|
||||
af_face_globals_compute_style_coverage( AF_FaceGlobals globals )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_Face face = globals->face;
|
||||
FT_CharMap old_charmap = face->charmap;
|
||||
FT_Byte* gscripts = globals->glyph_scripts;
|
||||
FT_Byte* gstyles = globals->glyph_styles;
|
||||
FT_UInt ss;
|
||||
FT_UInt i;
|
||||
FT_UInt dflt = -1;
|
||||
|
||||
|
||||
/* the value AF_SCRIPT_NONE means `uncovered glyph' */
|
||||
FT_MEM_SET( globals->glyph_scripts,
|
||||
AF_SCRIPT_NONE,
|
||||
/* the value AF_STYLE_UNASSIGNED means `uncovered glyph' */
|
||||
FT_MEM_SET( globals->glyph_styles,
|
||||
AF_STYLE_UNASSIGNED,
|
||||
globals->glyph_count );
|
||||
|
||||
error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );
|
||||
if ( error )
|
||||
{
|
||||
/*
|
||||
* Ignore this error; we simply use the fallback script.
|
||||
* XXX: Shouldn't we rather disable hinting?
|
||||
*/
|
||||
/*
|
||||
* Ignore this error; we simply use the fallback style.
|
||||
* XXX: Shouldn't we rather disable hinting?
|
||||
*/
|
||||
error = FT_Err_Ok;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
/* scan each script in a Unicode charmap */
|
||||
for ( ss = 0; AF_SCRIPT_CLASSES_GET[ss]; ss++ )
|
||||
/* scan each style in a Unicode charmap */
|
||||
for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
|
||||
{
|
||||
AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET[ss];
|
||||
AF_StyleClass style_class =
|
||||
AF_STYLE_CLASSES_GET[ss];
|
||||
AF_ScriptClass script_class =
|
||||
AF_SCRIPT_CLASSES_GET[style_class->script];
|
||||
AF_Script_UniRange range;
|
||||
|
||||
|
||||
@@ -116,35 +172,59 @@
|
||||
|
||||
/*
|
||||
* Scan all Unicode points in the range and set the corresponding
|
||||
* glyph script index.
|
||||
* glyph style index.
|
||||
*/
|
||||
for ( range = script_class->script_uni_ranges;
|
||||
range->first != 0;
|
||||
range++ )
|
||||
if ( style_class->coverage == AF_COVERAGE_DEFAULT )
|
||||
{
|
||||
FT_ULong charcode = range->first;
|
||||
FT_UInt gindex;
|
||||
if ( style_class->script == globals->module->default_script )
|
||||
dflt = ss;
|
||||
|
||||
|
||||
gindex = FT_Get_Char_Index( face, charcode );
|
||||
|
||||
if ( gindex != 0 &&
|
||||
gindex < (FT_ULong)globals->glyph_count &&
|
||||
gscripts[gindex] == AF_SCRIPT_NONE )
|
||||
gscripts[gindex] = (FT_Byte)ss;
|
||||
|
||||
for (;;)
|
||||
for ( range = script_class->script_uni_ranges;
|
||||
range->first != 0;
|
||||
range++ )
|
||||
{
|
||||
charcode = FT_Get_Next_Char( face, charcode, &gindex );
|
||||
FT_ULong charcode = range->first;
|
||||
FT_UInt gindex;
|
||||
|
||||
if ( gindex == 0 || charcode > range->last )
|
||||
break;
|
||||
|
||||
if ( gindex < (FT_ULong)globals->glyph_count &&
|
||||
gscripts[gindex] == AF_SCRIPT_NONE )
|
||||
gscripts[gindex] = (FT_Byte)ss;
|
||||
gindex = FT_Get_Char_Index( face, charcode );
|
||||
|
||||
if ( gindex != 0 &&
|
||||
gindex < (FT_ULong)globals->glyph_count &&
|
||||
gstyles[gindex] == AF_STYLE_UNASSIGNED )
|
||||
gstyles[gindex] = (FT_Byte)ss;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
charcode = FT_Get_Next_Char( face, charcode, &gindex );
|
||||
|
||||
if ( gindex == 0 || charcode > range->last )
|
||||
break;
|
||||
|
||||
if ( gindex < (FT_ULong)globals->glyph_count &&
|
||||
gstyles[gindex] == AF_STYLE_UNASSIGNED )
|
||||
gstyles[gindex] = (FT_Byte)ss;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* get glyphs not directly addressable by cmap */
|
||||
af_get_coverage( globals, style_class, gstyles );
|
||||
}
|
||||
}
|
||||
|
||||
/* handle the default OpenType features of the default script ... */
|
||||
af_get_coverage( globals, AF_STYLE_CLASSES_GET[dflt], gstyles );
|
||||
|
||||
/* ... and the remaining default OpenType features */
|
||||
for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
|
||||
{
|
||||
AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss];
|
||||
|
||||
|
||||
if ( ss != dflt && style_class->coverage == AF_COVERAGE_DEFAULT )
|
||||
af_get_coverage( globals, style_class, gstyles );
|
||||
}
|
||||
|
||||
/* mark ASCII digits */
|
||||
@@ -154,29 +234,68 @@
|
||||
|
||||
|
||||
if ( gindex != 0 && gindex < (FT_ULong)globals->glyph_count )
|
||||
gscripts[gindex] |= AF_DIGIT;
|
||||
gstyles[gindex] |= AF_DIGIT;
|
||||
}
|
||||
|
||||
Exit:
|
||||
/*
|
||||
* By default, all uncovered glyphs are set to the fallback script.
|
||||
* By default, all uncovered glyphs are set to the fallback style.
|
||||
* XXX: Shouldn't we disable hinting or do something similar?
|
||||
*/
|
||||
if ( globals->module->fallback_script != AF_SCRIPT_NONE )
|
||||
if ( globals->module->fallback_style != AF_STYLE_UNASSIGNED )
|
||||
{
|
||||
FT_Long nn;
|
||||
|
||||
|
||||
for ( nn = 0; nn < globals->glyph_count; nn++ )
|
||||
{
|
||||
if ( ( gscripts[nn] & ~AF_DIGIT ) == AF_SCRIPT_NONE )
|
||||
if ( ( gstyles[nn] & ~AF_DIGIT ) == AF_STYLE_UNASSIGNED )
|
||||
{
|
||||
gscripts[nn] &= ~AF_SCRIPT_NONE;
|
||||
gscripts[nn] |= globals->module->fallback_script;
|
||||
gstyles[nn] &= ~AF_STYLE_UNASSIGNED;
|
||||
gstyles[nn] |= globals->module->fallback_style;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
|
||||
FT_TRACE4(( "\n"
|
||||
"style coverage\n"
|
||||
"==============\n"
|
||||
"\n" ));
|
||||
|
||||
for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
|
||||
{
|
||||
AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss];
|
||||
FT_UInt count = 0;
|
||||
FT_Long idx;
|
||||
|
||||
|
||||
FT_TRACE4(( "%s:\n", af_style_names[style_class->style] ));
|
||||
|
||||
for ( idx = 0; idx < globals->glyph_count; idx++ )
|
||||
{
|
||||
if ( ( gstyles[idx] & ~AF_DIGIT ) == style_class->style )
|
||||
{
|
||||
if ( !( count % 10 ) )
|
||||
FT_TRACE4(( " " ));
|
||||
|
||||
FT_TRACE4(( " %d", idx ));
|
||||
count++;
|
||||
|
||||
if ( !( count % 10 ) )
|
||||
FT_TRACE4(( "\n" ));
|
||||
}
|
||||
}
|
||||
|
||||
if ( !count )
|
||||
FT_TRACE4(( " (none)\n" ));
|
||||
if ( count % 10 )
|
||||
FT_TRACE4(( "\n" ));
|
||||
}
|
||||
|
||||
#endif /* FT_DEBUG_LEVEL_TRACE */
|
||||
|
||||
FT_Set_Charmap( face, old_charmap );
|
||||
return error;
|
||||
}
|
||||
@@ -198,12 +317,16 @@
|
||||
face->num_glyphs * sizeof ( FT_Byte ) ) )
|
||||
goto Exit;
|
||||
|
||||
globals->face = face;
|
||||
globals->glyph_count = face->num_glyphs;
|
||||
globals->glyph_scripts = (FT_Byte*)( globals + 1 );
|
||||
globals->module = module;
|
||||
globals->face = face;
|
||||
globals->glyph_count = face->num_glyphs;
|
||||
globals->glyph_styles = (FT_Byte*)( globals + 1 );
|
||||
globals->module = module;
|
||||
|
||||
error = af_face_globals_compute_script_coverage( globals );
|
||||
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
|
||||
globals->hb_font = hb_ft_font_create( face, NULL );
|
||||
#endif
|
||||
|
||||
error = af_face_globals_compute_style_coverage( globals );
|
||||
if ( error )
|
||||
{
|
||||
af_face_globals_free( globals );
|
||||
@@ -227,26 +350,31 @@
|
||||
FT_UInt nn;
|
||||
|
||||
|
||||
for ( nn = 0; nn < AF_SCRIPT_MAX; nn++ )
|
||||
for ( nn = 0; nn < AF_STYLE_MAX; nn++ )
|
||||
{
|
||||
if ( globals->metrics[nn] )
|
||||
{
|
||||
AF_ScriptClass script_class =
|
||||
AF_SCRIPT_CLASSES_GET[nn];
|
||||
AF_StyleClass style_class =
|
||||
AF_STYLE_CLASSES_GET[nn];
|
||||
AF_WritingSystemClass writing_system_class =
|
||||
AF_WRITING_SYSTEM_CLASSES_GET[script_class->writing_system];
|
||||
AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];
|
||||
|
||||
|
||||
if ( writing_system_class->script_metrics_done )
|
||||
writing_system_class->script_metrics_done( globals->metrics[nn] );
|
||||
if ( writing_system_class->style_metrics_done )
|
||||
writing_system_class->style_metrics_done( globals->metrics[nn] );
|
||||
|
||||
FT_FREE( globals->metrics[nn] );
|
||||
}
|
||||
}
|
||||
|
||||
globals->glyph_count = 0;
|
||||
globals->glyph_scripts = NULL; /* no need to free this one! */
|
||||
globals->face = NULL;
|
||||
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
|
||||
hb_font_destroy( globals->hb_font );
|
||||
globals->hb_font = NULL;
|
||||
#endif
|
||||
|
||||
globals->glyph_count = 0;
|
||||
globals->glyph_styles = NULL; /* no need to free this one! */
|
||||
globals->face = NULL;
|
||||
|
||||
FT_FREE( globals );
|
||||
}
|
||||
@@ -254,16 +382,16 @@
|
||||
|
||||
|
||||
FT_LOCAL_DEF( FT_Error )
|
||||
af_face_globals_get_metrics( AF_FaceGlobals globals,
|
||||
FT_UInt gindex,
|
||||
FT_UInt options,
|
||||
AF_ScriptMetrics *ametrics )
|
||||
af_face_globals_get_metrics( AF_FaceGlobals globals,
|
||||
FT_UInt gindex,
|
||||
FT_UInt options,
|
||||
AF_StyleMetrics *ametrics )
|
||||
{
|
||||
AF_ScriptMetrics metrics = NULL;
|
||||
AF_StyleMetrics metrics = NULL;
|
||||
|
||||
AF_Script script = (AF_Script)( options & 15 );
|
||||
AF_Style style = (AF_Style)options;
|
||||
AF_WritingSystemClass writing_system_class;
|
||||
AF_ScriptClass script_class;
|
||||
AF_StyleClass style_class;
|
||||
|
||||
FT_Error error = FT_Err_Ok;
|
||||
|
||||
@@ -274,43 +402,44 @@
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
/* if we have a forced script (via `options'), use it, */
|
||||
/* otherwise look into `glyph_scripts' array */
|
||||
if ( script == AF_SCRIPT_DFLT || script + 1 >= AF_SCRIPT_MAX )
|
||||
script = (AF_Script)( globals->glyph_scripts[gindex] & AF_SCRIPT_NONE );
|
||||
/* if we have a forced style (via `options'), use it, */
|
||||
/* otherwise look into `glyph_styles' array */
|
||||
if ( style == AF_STYLE_NONE_DFLT || style + 1 >= AF_STYLE_MAX )
|
||||
style = (AF_Style)( globals->glyph_styles[gindex] &
|
||||
AF_STYLE_UNASSIGNED );
|
||||
|
||||
script_class = AF_SCRIPT_CLASSES_GET[script];
|
||||
style_class = AF_STYLE_CLASSES_GET[style];
|
||||
writing_system_class = AF_WRITING_SYSTEM_CLASSES_GET
|
||||
[script_class->writing_system];
|
||||
[style_class->writing_system];
|
||||
|
||||
metrics = globals->metrics[script];
|
||||
metrics = globals->metrics[style];
|
||||
if ( metrics == NULL )
|
||||
{
|
||||
/* create the global metrics object if necessary */
|
||||
FT_Memory memory = globals->face->memory;
|
||||
|
||||
|
||||
if ( FT_ALLOC( metrics, writing_system_class->script_metrics_size ) )
|
||||
if ( FT_ALLOC( metrics, writing_system_class->style_metrics_size ) )
|
||||
goto Exit;
|
||||
|
||||
metrics->script_class = script_class;
|
||||
metrics->globals = globals;
|
||||
metrics->style_class = style_class;
|
||||
metrics->globals = globals;
|
||||
|
||||
if ( writing_system_class->script_metrics_init )
|
||||
if ( writing_system_class->style_metrics_init )
|
||||
{
|
||||
error = writing_system_class->script_metrics_init( metrics,
|
||||
globals->face );
|
||||
error = writing_system_class->style_metrics_init( metrics,
|
||||
globals->face );
|
||||
if ( error )
|
||||
{
|
||||
if ( writing_system_class->script_metrics_done )
|
||||
writing_system_class->script_metrics_done( metrics );
|
||||
if ( writing_system_class->style_metrics_done )
|
||||
writing_system_class->style_metrics_done( metrics );
|
||||
|
||||
FT_FREE( metrics );
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
|
||||
globals->metrics[script] = metrics;
|
||||
globals->metrics[style] = metrics;
|
||||
}
|
||||
|
||||
Exit:
|
||||
@@ -325,7 +454,7 @@
|
||||
FT_UInt gindex )
|
||||
{
|
||||
if ( gindex < (FT_ULong)globals->glyph_count )
|
||||
return (FT_Bool)( globals->glyph_scripts[gindex] & AF_DIGIT );
|
||||
return (FT_Bool)( globals->glyph_styles[gindex] & AF_DIGIT );
|
||||
|
||||
return (FT_Bool)0;
|
||||
}
|
||||
|
||||
+46
-20
@@ -5,7 +5,7 @@
|
||||
/* Auto-fitter routines to compute global hinting values */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 2003-2005, 2007, 2009, 2011-2013 by */
|
||||
/* Copyright 2003-2005, 2007, 2009, 2011-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "aftypes.h"
|
||||
#include "afmodule.h"
|
||||
#include "hbshim.h"
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
@@ -31,29 +32,50 @@ FT_BEGIN_HEADER
|
||||
FT_LOCAL_ARRAY( AF_WritingSystemClass )
|
||||
af_writing_system_classes[];
|
||||
|
||||
|
||||
#undef SCRIPT
|
||||
#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \
|
||||
AF_DECLARE_SCRIPT_CLASS( af_ ## s ## _script_class )
|
||||
|
||||
#include "afscript.h"
|
||||
|
||||
FT_LOCAL_ARRAY( AF_ScriptClass )
|
||||
af_script_classes[];
|
||||
|
||||
|
||||
#undef STYLE
|
||||
#define STYLE( s, S, d, ws, sc, ss, c ) \
|
||||
AF_DECLARE_STYLE_CLASS( af_ ## s ## _style_class )
|
||||
|
||||
#include "afstyles.h"
|
||||
|
||||
FT_LOCAL_ARRAY( AF_StyleClass )
|
||||
af_style_classes[];
|
||||
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
FT_LOCAL_ARRAY( char* )
|
||||
af_script_names[];
|
||||
af_style_names[];
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Default values and flags for both autofitter globals (found in
|
||||
* AF_ModuleRec) and face globals (in AF_FaceGlobalsRec).
|
||||
*/
|
||||
|
||||
/* index of fallback script in `af_script_classes' */
|
||||
/* index of fallback style in `af_style_classes' */
|
||||
#ifdef AF_CONFIG_OPTION_CJK
|
||||
#define AF_SCRIPT_FALLBACK AF_SCRIPT_HANI
|
||||
#define AF_STYLE_FALLBACK AF_STYLE_HANI_DFLT
|
||||
#else
|
||||
#define AF_SCRIPT_FALLBACK AF_SCRIPT_DFLT
|
||||
#define AF_STYLE_FALLBACK AF_STYLE_NONE_DFLT
|
||||
#endif
|
||||
/* default script for OpenType; ignored if HarfBuzz isn't used */
|
||||
#define AF_SCRIPT_DEFAULT AF_SCRIPT_LATN
|
||||
/* a bit mask indicating an uncovered glyph */
|
||||
#define AF_SCRIPT_NONE 0x7F
|
||||
#define AF_STYLE_UNASSIGNED 0x7F
|
||||
/* if this flag is set, we have an ASCII digit */
|
||||
#define AF_DIGIT 0x80
|
||||
#define AF_DIGIT 0x80
|
||||
|
||||
/* `increase-x-height' property */
|
||||
#define AF_PROP_INCREASE_X_HEIGHT_MIN 6
|
||||
@@ -70,29 +92,33 @@ FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*
|
||||
* Note that glyph_scripts[] maps each glyph to an index into the
|
||||
* `af_script_classes' array.
|
||||
* Note that glyph_styles[] maps each glyph to an index into the
|
||||
* `af_style_classes' array.
|
||||
*
|
||||
*/
|
||||
typedef struct AF_FaceGlobalsRec_
|
||||
{
|
||||
FT_Face face;
|
||||
FT_Long glyph_count; /* same as face->num_glyphs */
|
||||
FT_Byte* glyph_scripts;
|
||||
FT_Face face;
|
||||
FT_Long glyph_count; /* same as face->num_glyphs */
|
||||
FT_Byte* glyph_styles;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
|
||||
hb_font_t* hb_font;
|
||||
#endif
|
||||
|
||||
/* per-face auto-hinter properties */
|
||||
FT_UInt increase_x_height;
|
||||
FT_UInt increase_x_height;
|
||||
|
||||
AF_ScriptMetrics metrics[AF_SCRIPT_MAX];
|
||||
AF_StyleMetrics metrics[AF_STYLE_MAX];
|
||||
|
||||
AF_Module module; /* to access global properties */
|
||||
AF_Module module; /* to access global properties */
|
||||
|
||||
} AF_FaceGlobalsRec;
|
||||
|
||||
|
||||
/*
|
||||
* model the global hints data for a given face, decomposed into
|
||||
* script-specific items
|
||||
* style-specific items
|
||||
*/
|
||||
|
||||
FT_LOCAL( FT_Error )
|
||||
@@ -101,10 +127,10 @@ FT_BEGIN_HEADER
|
||||
AF_Module module );
|
||||
|
||||
FT_LOCAL( FT_Error )
|
||||
af_face_globals_get_metrics( AF_FaceGlobals globals,
|
||||
FT_UInt gindex,
|
||||
FT_UInt options,
|
||||
AF_ScriptMetrics *ametrics );
|
||||
af_face_globals_get_metrics( AF_FaceGlobals globals,
|
||||
FT_UInt gindex,
|
||||
FT_UInt options,
|
||||
AF_StyleMetrics *ametrics );
|
||||
|
||||
FT_LOCAL( void )
|
||||
af_face_globals_free( AF_FaceGlobals globals );
|
||||
|
||||
+18
-11
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter hinting routines (body). */
|
||||
/* */
|
||||
/* Copyright 2003-2007, 2009-2013 by */
|
||||
/* Copyright 2003-2007, 2009-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -345,7 +345,9 @@
|
||||
af_glyph_hints_get_segment_offset( AF_GlyphHints hints,
|
||||
FT_Int dimension,
|
||||
FT_Int idx,
|
||||
FT_Pos* offset )
|
||||
FT_Pos *offset,
|
||||
FT_Bool *is_blue,
|
||||
FT_Pos *blue_offset )
|
||||
{
|
||||
AF_Dimension dim;
|
||||
AF_AxisHints axis;
|
||||
@@ -362,9 +364,18 @@
|
||||
if ( idx < 0 || idx >= axis->num_segments )
|
||||
return FT_THROW( Invalid_Argument );
|
||||
|
||||
seg = &axis->segments[idx];
|
||||
*offset = ( dim == AF_DIMENSION_HORZ ) ? seg->first->ox
|
||||
: seg->first->oy;
|
||||
seg = &axis->segments[idx];
|
||||
*offset = ( dim == AF_DIMENSION_HORZ ) ? seg->first->ox
|
||||
: seg->first->oy;
|
||||
if ( seg->edge )
|
||||
*is_blue = (FT_Bool)( seg->edge->blue_edge != 0 );
|
||||
else
|
||||
*is_blue = FALSE;
|
||||
|
||||
if ( *is_blue )
|
||||
*blue_offset = seg->edge->blue_edge->cur;
|
||||
else
|
||||
*blue_offset = 0;
|
||||
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
@@ -533,8 +544,8 @@
|
||||
/* Reset metrics. */
|
||||
|
||||
FT_LOCAL_DEF( void )
|
||||
af_glyph_hints_rescale( AF_GlyphHints hints,
|
||||
AF_ScriptMetrics metrics )
|
||||
af_glyph_hints_rescale( AF_GlyphHints hints,
|
||||
AF_StyleMetrics metrics )
|
||||
{
|
||||
hints->metrics = metrics;
|
||||
hints->scaler_flags = metrics->scaler.flags;
|
||||
@@ -810,7 +821,6 @@
|
||||
|
||||
in_x = out_x;
|
||||
in_y = out_y;
|
||||
prev = point;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1224,8 +1234,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
point = points;
|
||||
|
||||
for ( ; contour < contour_limit; contour++ )
|
||||
{
|
||||
AF_Point first_touched, last_touched;
|
||||
@@ -1248,7 +1256,6 @@
|
||||
}
|
||||
|
||||
first_touched = point;
|
||||
last_touched = point;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
|
||||
+21
-21
@@ -27,7 +27,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
/*
|
||||
* The definition of outline glyph hints. These are shared by all
|
||||
* script analysis routines (until now).
|
||||
* writing system analysis routines (until now).
|
||||
*/
|
||||
|
||||
typedef enum AF_Dimension_
|
||||
@@ -343,31 +343,31 @@ FT_BEGIN_HEADER
|
||||
|
||||
typedef struct AF_GlyphHintsRec_
|
||||
{
|
||||
FT_Memory memory;
|
||||
FT_Memory memory;
|
||||
|
||||
FT_Fixed x_scale;
|
||||
FT_Pos x_delta;
|
||||
FT_Fixed x_scale;
|
||||
FT_Pos x_delta;
|
||||
|
||||
FT_Fixed y_scale;
|
||||
FT_Pos y_delta;
|
||||
FT_Fixed y_scale;
|
||||
FT_Pos y_delta;
|
||||
|
||||
FT_Int max_points; /* number of allocated points */
|
||||
FT_Int num_points; /* number of used points */
|
||||
AF_Point points; /* points array */
|
||||
FT_Int max_points; /* number of allocated points */
|
||||
FT_Int num_points; /* number of used points */
|
||||
AF_Point points; /* points array */
|
||||
|
||||
FT_Int max_contours; /* number of allocated contours */
|
||||
FT_Int num_contours; /* number of used contours */
|
||||
AF_Point* contours; /* contours array */
|
||||
FT_Int max_contours; /* number of allocated contours */
|
||||
FT_Int num_contours; /* number of used contours */
|
||||
AF_Point* contours; /* contours array */
|
||||
|
||||
AF_AxisHintsRec axis[AF_DIMENSION_MAX];
|
||||
AF_AxisHintsRec axis[AF_DIMENSION_MAX];
|
||||
|
||||
FT_UInt32 scaler_flags; /* copy of scaler flags */
|
||||
FT_UInt32 other_flags; /* free for script-specific */
|
||||
/* implementations */
|
||||
AF_ScriptMetrics metrics;
|
||||
FT_UInt32 scaler_flags; /* copy of scaler flags */
|
||||
FT_UInt32 other_flags; /* free for style-specific */
|
||||
/* implementations */
|
||||
AF_StyleMetrics metrics;
|
||||
|
||||
FT_Pos xmin_delta; /* used for warping */
|
||||
FT_Pos xmax_delta;
|
||||
FT_Pos xmin_delta; /* used for warping */
|
||||
FT_Pos xmax_delta;
|
||||
|
||||
} AF_GlyphHintsRec;
|
||||
|
||||
@@ -429,8 +429,8 @@ FT_BEGIN_HEADER
|
||||
FT_Memory memory );
|
||||
|
||||
FT_LOCAL( void )
|
||||
af_glyph_hints_rescale( AF_GlyphHints hints,
|
||||
AF_ScriptMetrics metrics );
|
||||
af_glyph_hints_rescale( AF_GlyphHints hints,
|
||||
AF_StyleMetrics metrics );
|
||||
|
||||
FT_LOCAL( FT_Error )
|
||||
af_glyph_hints_reload( AF_GlyphHints hints,
|
||||
|
||||
+12
-43
@@ -2,7 +2,7 @@
|
||||
/* */
|
||||
/* afindic.c */
|
||||
/* */
|
||||
/* Auto-fitter hinting routines for Indic scripts (body). */
|
||||
/* Auto-fitter hinting routines for Indic writing system (body). */
|
||||
/* */
|
||||
/* Copyright 2007, 2011-2013 by */
|
||||
/* Rahul Bhalerao <[email protected]>, <[email protected]>. */
|
||||
@@ -104,32 +104,18 @@
|
||||
|
||||
sizeof ( AF_CJKMetricsRec ),
|
||||
|
||||
(AF_Script_InitMetricsFunc) af_indic_metrics_init,
|
||||
(AF_Script_ScaleMetricsFunc)af_indic_metrics_scale,
|
||||
(AF_Script_DoneMetricsFunc) NULL,
|
||||
(AF_WritingSystem_InitMetricsFunc) af_indic_metrics_init,
|
||||
(AF_WritingSystem_ScaleMetricsFunc)af_indic_metrics_scale,
|
||||
(AF_WritingSystem_DoneMetricsFunc) NULL,
|
||||
|
||||
(AF_Script_InitHintsFunc) af_indic_hints_init,
|
||||
(AF_Script_ApplyHintsFunc) af_indic_hints_apply
|
||||
(AF_WritingSystem_InitHintsFunc) af_indic_hints_init,
|
||||
(AF_WritingSystem_ApplyHintsFunc) af_indic_hints_apply
|
||||
)
|
||||
|
||||
/* XXX: this should probably fine tuned to differentiate better between */
|
||||
/* scripts... */
|
||||
|
||||
static const AF_Script_UniRangeRec af_deva_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0900UL, 0x0DFFUL ), /* Indic Range */
|
||||
AF_UNIRANGE_REC( 0x0F00UL, 0x0FFFUL ), /* Tibetan */
|
||||
AF_UNIRANGE_REC( 0x1900UL, 0x194FUL ), /* Limbu */
|
||||
AF_UNIRANGE_REC( 0x1B80UL, 0x1BBFUL ), /* Sundanese */
|
||||
AF_UNIRANGE_REC( 0x1C80UL, 0x1CDFUL ), /* Meetei Mayak */
|
||||
AF_UNIRANGE_REC( 0xA800UL, 0xA82FUL ), /* Syloti Nagri */
|
||||
AF_UNIRANGE_REC( 0x11800UL, 0x118DFUL ), /* Sharada */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
|
||||
#else /* !AF_CONFIG_OPTION_INDIC */
|
||||
|
||||
|
||||
AF_DEFINE_WRITING_SYSTEM_CLASS(
|
||||
af_indic_writing_system_class,
|
||||
|
||||
@@ -137,33 +123,16 @@
|
||||
|
||||
sizeof ( AF_CJKMetricsRec ),
|
||||
|
||||
(AF_Script_InitMetricsFunc) NULL,
|
||||
(AF_Script_ScaleMetricsFunc)NULL,
|
||||
(AF_Script_DoneMetricsFunc) NULL,
|
||||
(AF_WritingSystem_InitMetricsFunc) NULL,
|
||||
(AF_WritingSystem_ScaleMetricsFunc)NULL,
|
||||
(AF_WritingSystem_DoneMetricsFunc) NULL,
|
||||
|
||||
(AF_Script_InitHintsFunc) NULL,
|
||||
(AF_Script_ApplyHintsFunc) NULL
|
||||
(AF_WritingSystem_InitHintsFunc) NULL,
|
||||
(AF_WritingSystem_ApplyHintsFunc) NULL
|
||||
)
|
||||
|
||||
|
||||
static const AF_Script_UniRangeRec af_deva_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
#endif /* !AF_CONFIG_OPTION_INDIC */
|
||||
|
||||
|
||||
AF_DEFINE_SCRIPT_CLASS(
|
||||
af_deva_script_class,
|
||||
|
||||
AF_SCRIPT_DEVA,
|
||||
(AF_Blue_Stringset)0, /* XXX */
|
||||
AF_WRITING_SYSTEM_INDIC,
|
||||
|
||||
af_deva_uniranges,
|
||||
'o' /* XXX */
|
||||
)
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
+2
-6
@@ -2,7 +2,8 @@
|
||||
/* */
|
||||
/* afindic.h */
|
||||
/* */
|
||||
/* Auto-fitter hinting routines for Indic scripts (specification). */
|
||||
/* Auto-fitter hinting routines for Indic writing system */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 2007, 2012, 2013 by */
|
||||
/* Rahul Bhalerao <[email protected]>, <[email protected]>. */
|
||||
@@ -30,11 +31,6 @@ FT_BEGIN_HEADER
|
||||
AF_DECLARE_WRITING_SYSTEM_CLASS( af_indic_writing_system_class )
|
||||
|
||||
|
||||
/* the indic-specific script classes */
|
||||
|
||||
AF_DECLARE_SCRIPT_CLASS( af_deva_script_class )
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
+97
-136
@@ -2,9 +2,9 @@
|
||||
/* */
|
||||
/* aflatin.c */
|
||||
/* */
|
||||
/* Auto-fitter hinting routines for latin script (body). */
|
||||
/* Auto-fitter hinting routines for latin writing system (body). */
|
||||
/* */
|
||||
/* Copyright 2003-2013 by */
|
||||
/* Copyright 2003-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -21,6 +21,7 @@
|
||||
#include FT_INTERNAL_DEBUG_H
|
||||
|
||||
#include "afglobal.h"
|
||||
#include "afpic.h"
|
||||
#include "aflatin.h"
|
||||
#include "aferrors.h"
|
||||
|
||||
@@ -61,10 +62,10 @@
|
||||
|
||||
|
||||
FT_TRACE5(( "\n"
|
||||
"latin standard widths computation (script `%s')\n"
|
||||
"=================================================\n"
|
||||
"latin standard widths computation (style `%s')\n"
|
||||
"=====================================================\n"
|
||||
"\n",
|
||||
af_script_names[metrics->root.script_class->script] ));
|
||||
af_style_names[metrics->root.style_class->style] ));
|
||||
|
||||
af_glyph_hints_init( hints, face->memory );
|
||||
|
||||
@@ -73,20 +74,66 @@
|
||||
|
||||
{
|
||||
FT_Error error;
|
||||
FT_UInt glyph_index;
|
||||
FT_ULong glyph_index;
|
||||
FT_Long y_offset;
|
||||
int dim;
|
||||
AF_LatinMetricsRec dummy[1];
|
||||
AF_Scaler scaler = &dummy->root.scaler;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_PIC
|
||||
AF_FaceGlobals globals = metrics->root.globals;
|
||||
#endif
|
||||
|
||||
glyph_index = FT_Get_Char_Index(
|
||||
face,
|
||||
metrics->root.script_class->standard_char );
|
||||
if ( glyph_index == 0 )
|
||||
goto Exit;
|
||||
AF_StyleClass style_class = metrics->root.style_class;
|
||||
AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET
|
||||
[style_class->script];
|
||||
|
||||
FT_UInt32 standard_char;
|
||||
|
||||
|
||||
/*
|
||||
* We check more than a single standard character to catch features
|
||||
* like `c2sc' (small caps from caps) that don't contain lowercase
|
||||
* letters by definition, or other features that mainly operate on
|
||||
* numerals.
|
||||
*/
|
||||
|
||||
standard_char = script_class->standard_char1;
|
||||
af_get_char_index( &metrics->root,
|
||||
standard_char,
|
||||
&glyph_index,
|
||||
&y_offset );
|
||||
if ( !glyph_index )
|
||||
{
|
||||
if ( script_class->standard_char2 )
|
||||
{
|
||||
standard_char = script_class->standard_char2;
|
||||
af_get_char_index( &metrics->root,
|
||||
standard_char,
|
||||
&glyph_index,
|
||||
&y_offset );
|
||||
if ( !glyph_index )
|
||||
{
|
||||
if ( script_class->standard_char3 )
|
||||
{
|
||||
standard_char = script_class->standard_char3;
|
||||
af_get_char_index( &metrics->root,
|
||||
standard_char,
|
||||
&glyph_index,
|
||||
&y_offset );
|
||||
if ( !glyph_index )
|
||||
goto Exit;
|
||||
}
|
||||
else
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n",
|
||||
metrics->root.script_class->standard_char, glyph_index ));
|
||||
standard_char, glyph_index ));
|
||||
|
||||
error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
|
||||
if ( error || face->glyph->outline.n_points <= 0 )
|
||||
@@ -105,7 +152,7 @@
|
||||
scaler->render_mode = FT_RENDER_MODE_NORMAL;
|
||||
scaler->flags = 0;
|
||||
|
||||
af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy );
|
||||
af_glyph_hints_rescale( hints, (AF_StyleMetrics)dummy );
|
||||
|
||||
error = af_glyph_hints_reload( hints, &face->glyph->outline );
|
||||
if ( error )
|
||||
@@ -214,12 +261,14 @@
|
||||
AF_LatinAxis axis = &metrics->axis[AF_DIMENSION_VERT];
|
||||
FT_Outline outline;
|
||||
|
||||
AF_Blue_Stringset bss = metrics->root.script_class->blue_stringset;
|
||||
AF_StyleClass sc = metrics->root.style_class;
|
||||
|
||||
AF_Blue_Stringset bss = sc->blue_stringset;
|
||||
const AF_Blue_StringRec* bs = &af_blue_stringsets[bss];
|
||||
|
||||
|
||||
/* we walk over the blue character strings as specified in the */
|
||||
/* script's entry in the `af_blue_stringset' array */
|
||||
/* we walk over the blue character strings as specified in the */
|
||||
/* style's entry in the `af_blue_stringset' array */
|
||||
|
||||
FT_TRACE5(( "latin blue zones computation\n"
|
||||
"============================\n"
|
||||
@@ -277,7 +326,8 @@
|
||||
while ( *p )
|
||||
{
|
||||
FT_ULong ch;
|
||||
FT_UInt glyph_index;
|
||||
FT_ULong glyph_index;
|
||||
FT_Long y_offset;
|
||||
FT_Pos best_y; /* same as points.y */
|
||||
FT_Int best_point, best_contour_first, best_contour_last;
|
||||
FT_Vector* points;
|
||||
@@ -287,7 +337,7 @@
|
||||
GET_UTF8_CHAR( ch, p );
|
||||
|
||||
/* load the character in the face -- skip unknown or empty ones */
|
||||
glyph_index = FT_Get_Char_Index( face, ch );
|
||||
af_get_char_index( &metrics->root, ch, &glyph_index, &y_offset );
|
||||
if ( glyph_index == 0 )
|
||||
{
|
||||
FT_TRACE5(( " U+%04lX unavailable\n", ch ));
|
||||
@@ -575,7 +625,10 @@
|
||||
if ( FT_ABS( points[next].x - points[first].x ) <=
|
||||
20 * dist )
|
||||
{
|
||||
last--;
|
||||
if ( last > best_contour_first )
|
||||
last--;
|
||||
else
|
||||
last = best_contour_last;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -606,6 +659,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* for computing blue zones, we add the y offset as returned */
|
||||
/* by the currently used OpenType feature -- for example, */
|
||||
/* superscript glyphs might be identical to subscript glyphs */
|
||||
/* with a vertical shift */
|
||||
best_y += y_offset;
|
||||
|
||||
FT_TRACE5(( " U+%04lX: best_y = %5ld", ch, best_y ));
|
||||
|
||||
/* now set the `round' flag depending on the segment's kind: */
|
||||
@@ -733,10 +792,11 @@
|
||||
/* digit `0' is 0x30 in all supported charmaps */
|
||||
for ( i = 0x30; i <= 0x39; i++ )
|
||||
{
|
||||
FT_UInt glyph_index;
|
||||
FT_ULong glyph_index;
|
||||
FT_Long y_offset;
|
||||
|
||||
|
||||
glyph_index = FT_Get_Char_Index( face, i );
|
||||
af_get_char_index( &metrics->root, i, &glyph_index, &y_offset );
|
||||
if ( glyph_index == 0 )
|
||||
continue;
|
||||
|
||||
@@ -879,11 +939,11 @@
|
||||
|
||||
FT_TRACE5((
|
||||
"af_latin_metrics_scale_dim:"
|
||||
" x height alignment (script `%s'):\n"
|
||||
" x height alignment (style `%s'):\n"
|
||||
" "
|
||||
" vertical scaling changed from %.4f to %.4f (by %d%%)\n"
|
||||
"\n",
|
||||
af_script_names[metrics->root.script_class->script],
|
||||
af_style_names[metrics->root.style_class->style],
|
||||
axis->org_scale / 65536.0,
|
||||
scale / 65536.0,
|
||||
( fitted - scaled ) * 100 / scaled ));
|
||||
@@ -906,9 +966,9 @@
|
||||
metrics->root.scaler.y_delta = delta;
|
||||
}
|
||||
|
||||
FT_TRACE5(( "%s widths (script `%s')\n",
|
||||
FT_TRACE5(( "%s widths (style `%s')\n",
|
||||
dim == AF_DIMENSION_HORZ ? "horizontal" : "vertical",
|
||||
af_script_names[metrics->root.script_class->script] ));
|
||||
af_style_names[metrics->root.style_class->style] ));
|
||||
|
||||
/* scale the widths */
|
||||
for ( nn = 0; nn < axis->width_count; nn++ )
|
||||
@@ -933,15 +993,15 @@
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
if ( axis->extra_light )
|
||||
FT_TRACE5(( "`%s' script is extra light (at current resolution)\n"
|
||||
FT_TRACE5(( "`%s' style is extra light (at current resolution)\n"
|
||||
"\n",
|
||||
af_script_names[metrics->root.script_class->script] ));
|
||||
af_style_names[metrics->root.style_class->style] ));
|
||||
#endif
|
||||
|
||||
if ( dim == AF_DIMENSION_VERT )
|
||||
{
|
||||
FT_TRACE5(( "blue zones (script `%s')\n",
|
||||
af_script_names[metrics->root.script_class->script] ));
|
||||
FT_TRACE5(( "blue zones (style `%s')\n",
|
||||
af_style_names[metrics->root.style_class->style] ));
|
||||
|
||||
/* scale the blue zones */
|
||||
for ( nn = 0; nn < axis->blue_count; nn++ )
|
||||
@@ -1797,7 +1857,7 @@
|
||||
FT_Face face = metrics->root.scaler.face;
|
||||
|
||||
|
||||
af_glyph_hints_rescale( hints, (AF_ScriptMetrics)metrics );
|
||||
af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );
|
||||
|
||||
/*
|
||||
* correct x_scale and y_scale if needed, since they may have
|
||||
@@ -2148,9 +2208,9 @@
|
||||
#endif
|
||||
|
||||
|
||||
FT_TRACE5(( "latin %s edge hinting (script `%s')\n",
|
||||
FT_TRACE5(( "latin %s edge hinting (style `%s')\n",
|
||||
dim == AF_DIMENSION_VERT ? "horizontal" : "vertical",
|
||||
af_script_names[hints->metrics->script_class->script] ));
|
||||
af_style_names[hints->metrics->style_class->style] ));
|
||||
|
||||
/* we begin by aligning all stems relative to the blue zone */
|
||||
/* if needed -- that's only for horizontal edges */
|
||||
@@ -2709,111 +2769,12 @@
|
||||
|
||||
sizeof ( AF_LatinMetricsRec ),
|
||||
|
||||
(AF_Script_InitMetricsFunc) af_latin_metrics_init,
|
||||
(AF_Script_ScaleMetricsFunc)af_latin_metrics_scale,
|
||||
(AF_Script_DoneMetricsFunc) NULL,
|
||||
(AF_WritingSystem_InitMetricsFunc) af_latin_metrics_init,
|
||||
(AF_WritingSystem_ScaleMetricsFunc)af_latin_metrics_scale,
|
||||
(AF_WritingSystem_DoneMetricsFunc) NULL,
|
||||
|
||||
(AF_Script_InitHintsFunc) af_latin_hints_init,
|
||||
(AF_Script_ApplyHintsFunc) af_latin_hints_apply
|
||||
)
|
||||
|
||||
|
||||
/* XXX: this should probably fine tuned to differentiate better between */
|
||||
/* scripts... */
|
||||
|
||||
static const AF_Script_UniRangeRec af_latn_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0020UL, 0x007FUL ), /* Basic Latin (no control chars) */
|
||||
AF_UNIRANGE_REC( 0x00A0UL, 0x00FFUL ), /* Latin-1 Supplement (no control chars) */
|
||||
AF_UNIRANGE_REC( 0x0100UL, 0x017FUL ), /* Latin Extended-A */
|
||||
AF_UNIRANGE_REC( 0x0180UL, 0x024FUL ), /* Latin Extended-B */
|
||||
AF_UNIRANGE_REC( 0x0250UL, 0x02AFUL ), /* IPA Extensions */
|
||||
AF_UNIRANGE_REC( 0x02B0UL, 0x02FFUL ), /* Spacing Modifier Letters */
|
||||
AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ), /* Combining Diacritical Marks */
|
||||
AF_UNIRANGE_REC( 0x1D00UL, 0x1D7FUL ), /* Phonetic Extensions */
|
||||
AF_UNIRANGE_REC( 0x1D80UL, 0x1DBFUL ), /* Phonetic Extensions Supplement */
|
||||
AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ), /* Combining Diacritical Marks Supplement */
|
||||
AF_UNIRANGE_REC( 0x1E00UL, 0x1EFFUL ), /* Latin Extended Additional */
|
||||
AF_UNIRANGE_REC( 0x2000UL, 0x206FUL ), /* General Punctuation */
|
||||
AF_UNIRANGE_REC( 0x2070UL, 0x209FUL ), /* Superscripts and Subscripts */
|
||||
AF_UNIRANGE_REC( 0x20A0UL, 0x20CFUL ), /* Currency Symbols */
|
||||
AF_UNIRANGE_REC( 0x2150UL, 0x218FUL ), /* Number Forms */
|
||||
AF_UNIRANGE_REC( 0x2460UL, 0x24FFUL ), /* Enclosed Alphanumerics */
|
||||
AF_UNIRANGE_REC( 0x2C60UL, 0x2C7FUL ), /* Latin Extended-C */
|
||||
AF_UNIRANGE_REC( 0x2E00UL, 0x2E7FUL ), /* Supplemental Punctuation */
|
||||
AF_UNIRANGE_REC( 0xA720UL, 0xA7FFUL ), /* Latin Extended-D */
|
||||
AF_UNIRANGE_REC( 0xFB00UL, 0xFB06UL ), /* Alphab. Present. Forms (Latin Ligs) */
|
||||
AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ), /* Mathematical Alphanumeric Symbols */
|
||||
AF_UNIRANGE_REC( 0x1F100UL, 0x1F1FFUL ), /* Enclosed Alphanumeric Supplement */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
static const AF_Script_UniRangeRec af_grek_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0370UL, 0x03FFUL ), /* Greek and Coptic */
|
||||
AF_UNIRANGE_REC( 0x1F00UL, 0x1FFFUL ), /* Greek Extended */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
static const AF_Script_UniRangeRec af_cyrl_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0400UL, 0x04FFUL ), /* Cyrillic */
|
||||
AF_UNIRANGE_REC( 0x0500UL, 0x052FUL ), /* Cyrillic Supplement */
|
||||
AF_UNIRANGE_REC( 0x2DE0UL, 0x2DFFUL ), /* Cyrillic Extended-A */
|
||||
AF_UNIRANGE_REC( 0xA640UL, 0xA69FUL ), /* Cyrillic Extended-B */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
static const AF_Script_UniRangeRec af_hebr_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0590UL, 0x05FFUL ), /* Hebrew */
|
||||
AF_UNIRANGE_REC( 0xFB1DUL, 0xFB4FUL ), /* Alphab. Present. Forms (Hebrew) */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
|
||||
AF_DEFINE_SCRIPT_CLASS(
|
||||
af_latn_script_class,
|
||||
|
||||
AF_SCRIPT_LATN,
|
||||
AF_BLUE_STRINGSET_LATN,
|
||||
AF_WRITING_SYSTEM_LATIN,
|
||||
|
||||
af_latn_uniranges,
|
||||
'o'
|
||||
)
|
||||
|
||||
AF_DEFINE_SCRIPT_CLASS(
|
||||
af_grek_script_class,
|
||||
|
||||
AF_SCRIPT_GREK,
|
||||
AF_BLUE_STRINGSET_GREK,
|
||||
AF_WRITING_SYSTEM_LATIN,
|
||||
|
||||
af_grek_uniranges,
|
||||
0x3BF /* ο */
|
||||
)
|
||||
|
||||
AF_DEFINE_SCRIPT_CLASS(
|
||||
af_cyrl_script_class,
|
||||
|
||||
AF_SCRIPT_CYRL,
|
||||
AF_BLUE_STRINGSET_CYRL,
|
||||
AF_WRITING_SYSTEM_LATIN,
|
||||
|
||||
af_cyrl_uniranges,
|
||||
0x43E /* о */
|
||||
)
|
||||
|
||||
AF_DEFINE_SCRIPT_CLASS(
|
||||
af_hebr_script_class,
|
||||
|
||||
AF_SCRIPT_HEBR,
|
||||
AF_BLUE_STRINGSET_HEBR,
|
||||
AF_WRITING_SYSTEM_LATIN,
|
||||
|
||||
af_hebr_uniranges,
|
||||
0x5DD /* ם */
|
||||
(AF_WritingSystem_InitHintsFunc) af_latin_hints_init,
|
||||
(AF_WritingSystem_ApplyHintsFunc) af_latin_hints_apply
|
||||
)
|
||||
|
||||
|
||||
|
||||
+8
-18
@@ -2,7 +2,8 @@
|
||||
/* */
|
||||
/* aflatin.h */
|
||||
/* */
|
||||
/* Auto-fitter hinting routines for latin script (specification). */
|
||||
/* Auto-fitter hinting routines for latin writing system */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 2003-2007, 2009, 2011-2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
@@ -29,17 +30,6 @@ FT_BEGIN_HEADER
|
||||
AF_DECLARE_WRITING_SYSTEM_CLASS( af_latin_writing_system_class )
|
||||
|
||||
|
||||
/* the latin-specific script classes */
|
||||
|
||||
AF_DECLARE_SCRIPT_CLASS( af_cyrl_script_class )
|
||||
AF_DECLARE_SCRIPT_CLASS( af_grek_script_class )
|
||||
AF_DECLARE_SCRIPT_CLASS( af_latn_script_class )
|
||||
AF_DECLARE_SCRIPT_CLASS( af_hebr_script_class )
|
||||
#if 0
|
||||
AF_DECLARE_SCRIPT_CLASS( af_armn_script_class )
|
||||
#endif
|
||||
|
||||
|
||||
/* constants are given with units_per_em == 2048 in mind */
|
||||
#define AF_LATIN_CONSTANT( metrics, c ) \
|
||||
( ( (c) * (FT_Long)( (AF_LatinMetrics)(metrics) )->units_per_em ) / 2048 )
|
||||
@@ -56,8 +46,8 @@ FT_BEGIN_HEADER
|
||||
|
||||
/*
|
||||
* The following declarations could be embedded in the file `aflatin.c';
|
||||
* they have been made semi-public to allow alternate script hinters to
|
||||
* re-use some of them.
|
||||
* they have been made semi-public to allow alternate writing system
|
||||
* hinters to re-use some of them.
|
||||
*/
|
||||
|
||||
|
||||
@@ -113,9 +103,9 @@ FT_BEGIN_HEADER
|
||||
|
||||
typedef struct AF_LatinMetricsRec_
|
||||
{
|
||||
AF_ScriptMetricsRec root;
|
||||
FT_UInt units_per_em;
|
||||
AF_LatinAxisRec axis[AF_DIMENSION_MAX];
|
||||
AF_StyleMetricsRec root;
|
||||
FT_UInt units_per_em;
|
||||
AF_LatinAxisRec axis[AF_DIMENSION_MAX];
|
||||
|
||||
} AF_LatinMetricsRec, *AF_LatinMetrics;
|
||||
|
||||
@@ -171,7 +161,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
/*
|
||||
* The next functions shouldn't normally be exported. However, other
|
||||
* scripts might like to use these functions as-is.
|
||||
* writing systems might like to use these functions as-is.
|
||||
*/
|
||||
FT_LOCAL( FT_Error )
|
||||
af_latin_hints_compute_segments( AF_GlyphHints hints,
|
||||
|
||||
+9
-58
@@ -2,7 +2,7 @@
|
||||
/* */
|
||||
/* aflatin2.c */
|
||||
/* */
|
||||
/* Auto-fitter hinting routines for latin script (body). */
|
||||
/* Auto-fitter hinting routines for latin writing system (body). */
|
||||
/* */
|
||||
/* Copyright 2003-2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
glyph_index = FT_Get_Char_Index(
|
||||
face,
|
||||
metrics->root.script_class->standard_char );
|
||||
metrics->root.style_class->standard_char );
|
||||
if ( glyph_index == 0 )
|
||||
goto Exit;
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
scaler->render_mode = FT_RENDER_MODE_NORMAL;
|
||||
scaler->flags = 0;
|
||||
|
||||
af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy );
|
||||
af_glyph_hints_rescale( hints, (AF_StyleMetrics)dummy );
|
||||
|
||||
error = af_glyph_hints_reload( hints, &face->glyph->outline );
|
||||
if ( error )
|
||||
@@ -1501,7 +1501,7 @@
|
||||
FT_Face face = metrics->root.scaler.face;
|
||||
|
||||
|
||||
af_glyph_hints_rescale( hints, (AF_ScriptMetrics)metrics );
|
||||
af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );
|
||||
|
||||
/*
|
||||
* correct x_scale and y_scale if needed, since they may have
|
||||
@@ -2387,61 +2387,12 @@
|
||||
|
||||
sizeof ( AF_LatinMetricsRec ),
|
||||
|
||||
(AF_Script_InitMetricsFunc) af_latin2_metrics_init,
|
||||
(AF_Script_ScaleMetricsFunc)af_latin2_metrics_scale,
|
||||
(AF_Script_DoneMetricsFunc) NULL,
|
||||
(AF_WritingSystem_InitMetricsFunc) af_latin2_metrics_init,
|
||||
(AF_WritingSystem_ScaleMetricsFunc)af_latin2_metrics_scale,
|
||||
(AF_WritingSystem_DoneMetricsFunc) NULL,
|
||||
|
||||
(AF_Script_InitHintsFunc) af_latin2_hints_init,
|
||||
(AF_Script_ApplyHintsFunc) af_latin2_hints_apply
|
||||
)
|
||||
|
||||
|
||||
/* XXX: this should probably fine tuned to differentiate better between */
|
||||
/* scripts... */
|
||||
|
||||
static const AF_Script_UniRangeRec af_ltn2_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0020UL, 0x007FUL ), /* Basic Latin (no control chars) */
|
||||
AF_UNIRANGE_REC( 0x00A0UL, 0x00FFUL ), /* Latin-1 Supplement (no control chars) */
|
||||
AF_UNIRANGE_REC( 0x0100UL, 0x017FUL ), /* Latin Extended-A */
|
||||
AF_UNIRANGE_REC( 0x0180UL, 0x024FUL ), /* Latin Extended-B */
|
||||
AF_UNIRANGE_REC( 0x0250UL, 0x02AFUL ), /* IPA Extensions */
|
||||
AF_UNIRANGE_REC( 0x02B0UL, 0x02FFUL ), /* Spacing Modifier Letters */
|
||||
AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ), /* Combining Diacritical Marks */
|
||||
AF_UNIRANGE_REC( 0x0370UL, 0x03FFUL ), /* Greek and Coptic */
|
||||
AF_UNIRANGE_REC( 0x0400UL, 0x04FFUL ), /* Cyrillic */
|
||||
AF_UNIRANGE_REC( 0x0500UL, 0x052FUL ), /* Cyrillic Supplement */
|
||||
AF_UNIRANGE_REC( 0x1D00UL, 0x1D7FUL ), /* Phonetic Extensions */
|
||||
AF_UNIRANGE_REC( 0x1D80UL, 0x1DBFUL ), /* Phonetic Extensions Supplement */
|
||||
AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ), /* Combining Diacritical Marks Supplement */
|
||||
AF_UNIRANGE_REC( 0x1E00UL, 0x1EFFUL ), /* Latin Extended Additional */
|
||||
AF_UNIRANGE_REC( 0x1F00UL, 0x1FFFUL ), /* Greek Extended */
|
||||
AF_UNIRANGE_REC( 0x2000UL, 0x206FUL ), /* General Punctuation */
|
||||
AF_UNIRANGE_REC( 0x2070UL, 0x209FUL ), /* Superscripts and Subscripts */
|
||||
AF_UNIRANGE_REC( 0x20A0UL, 0x20CFUL ), /* Currency Symbols */
|
||||
AF_UNIRANGE_REC( 0x2150UL, 0x218FUL ), /* Number Forms */
|
||||
AF_UNIRANGE_REC( 0x2460UL, 0x24FFUL ), /* Enclosed Alphanumerics */
|
||||
AF_UNIRANGE_REC( 0x2C60UL, 0x2C7FUL ), /* Latin Extended-C */
|
||||
AF_UNIRANGE_REC( 0x2DE0UL, 0x2DFFUL ), /* Cyrillic Extended-A */
|
||||
AF_UNIRANGE_REC( 0x2E00UL, 0x2E7FUL ), /* Supplemental Punctuation */
|
||||
AF_UNIRANGE_REC( 0xA640UL, 0xA69FUL ), /* Cyrillic Extended-B */
|
||||
AF_UNIRANGE_REC( 0xA720UL, 0xA7FFUL ), /* Latin Extended-D */
|
||||
AF_UNIRANGE_REC( 0xFB00UL, 0xFB06UL ), /* Alphab. Present. Forms (Latin Ligs) */
|
||||
AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ), /* Mathematical Alphanumeric Symbols */
|
||||
AF_UNIRANGE_REC( 0x1F100UL, 0x1F1FFUL ), /* Enclosed Alphanumeric Supplement */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
|
||||
AF_DEFINE_SCRIPT_CLASS(
|
||||
af_ltn2_script_class,
|
||||
|
||||
AF_SCRIPT_LTN2,
|
||||
AF_BLUE_STRINGSET_LATN,
|
||||
AF_WRITING_SYSTEM_LATIN2,
|
||||
|
||||
af_ltn2_uniranges,
|
||||
'o'
|
||||
(AF_WritingSystem_InitHintsFunc) af_latin2_hints_init,
|
||||
(AF_WritingSystem_ApplyHintsFunc) af_latin2_hints_apply
|
||||
)
|
||||
|
||||
|
||||
|
||||
+2
-12
@@ -2,7 +2,8 @@
|
||||
/* */
|
||||
/* aflatin2.h */
|
||||
/* */
|
||||
/* Auto-fitter hinting routines for latin script (specification). */
|
||||
/* Auto-fitter hinting routines for latin writing system */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 2003-2007, 2012, 2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
@@ -30,17 +31,6 @@ FT_BEGIN_HEADER
|
||||
AF_DECLARE_WRITING_SYSTEM_CLASS( af_latin2_writing_system_class )
|
||||
|
||||
|
||||
/* the latin-specific script classes */
|
||||
|
||||
AF_DECLARE_SCRIPT_CLASS( af_ltn2_script_class ) /* XXX */
|
||||
#if 0
|
||||
AF_DECLARE_SCRIPT_CLASS( af_arm2_script_class )
|
||||
AF_DECLARE_SCRIPT_CLASS( af_cyr2_script_class )
|
||||
AF_DECLARE_SCRIPT_CLASS( af_grk2_script_class )
|
||||
AF_DECLARE_SCRIPT_CLASS( af_hbr2_script_class )
|
||||
#endif
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
+21
-26
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter glyph loading routines (body). */
|
||||
/* */
|
||||
/* Copyright 2003-2009, 2011-2013 by */
|
||||
/* Copyright 2003-2009, 2011-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -109,7 +109,7 @@
|
||||
FT_Error error;
|
||||
FT_Face face = loader->face;
|
||||
FT_GlyphLoader gloader = loader->gloader;
|
||||
AF_ScriptMetrics metrics = loader->metrics;
|
||||
AF_StyleMetrics metrics = loader->metrics;
|
||||
AF_GlyphHints hints = &loader->hints;
|
||||
FT_GlyphSlot slot = face->glyph;
|
||||
FT_Slot_Internal internal = slot->internal;
|
||||
@@ -183,17 +183,17 @@
|
||||
/* automatic hinting process */
|
||||
{
|
||||
#ifdef FT_CONFIG_OPTION_PIC
|
||||
AF_FaceGlobals globals = loader->globals;
|
||||
AF_FaceGlobals globals = loader->globals;
|
||||
#endif
|
||||
AF_StyleClass style_class = metrics->style_class;
|
||||
AF_WritingSystemClass writing_system_class =
|
||||
AF_WRITING_SYSTEM_CLASSES_GET
|
||||
[metrics->script_class->writing_system];
|
||||
AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];
|
||||
|
||||
|
||||
if ( writing_system_class->script_hints_apply )
|
||||
writing_system_class->script_hints_apply( hints,
|
||||
&gloader->current.outline,
|
||||
metrics );
|
||||
if ( writing_system_class->style_hints_apply )
|
||||
writing_system_class->style_hints_apply( hints,
|
||||
&gloader->current.outline,
|
||||
metrics );
|
||||
}
|
||||
|
||||
/* we now need to adjust the metrics according to the change in */
|
||||
@@ -318,12 +318,7 @@
|
||||
/* recompute subglyph pointer */
|
||||
subglyph = gloader->base.subglyphs + num_base_subgs + nn;
|
||||
|
||||
if ( subglyph->flags & FT_SUBGLYPH_FLAG_USE_MY_METRICS )
|
||||
{
|
||||
pp1 = loader->pp1;
|
||||
pp2 = loader->pp2;
|
||||
}
|
||||
else
|
||||
if ( !( subglyph->flags & FT_SUBGLYPH_FLAG_USE_MY_METRICS ) )
|
||||
{
|
||||
loader->pp1 = pp1;
|
||||
loader->pp2 = pp2;
|
||||
@@ -529,14 +524,14 @@
|
||||
error = af_loader_reset( module, face );
|
||||
if ( !error )
|
||||
{
|
||||
AF_ScriptMetrics metrics;
|
||||
FT_UInt options = AF_SCRIPT_DFLT;
|
||||
AF_StyleMetrics metrics;
|
||||
FT_UInt options = AF_STYLE_NONE_DFLT;
|
||||
|
||||
|
||||
#ifdef FT_OPTION_AUTOFIT2
|
||||
/* XXX: undocumented hook to activate the latin2 writing system */
|
||||
if ( load_flags & ( 1UL << 20 ) )
|
||||
options = AF_SCRIPT_LTN2;
|
||||
options = AF_STYLE_LTN2_DFLT;
|
||||
#endif
|
||||
|
||||
error = af_face_globals_get_metrics( loader->globals, gindex,
|
||||
@@ -544,27 +539,27 @@
|
||||
if ( !error )
|
||||
{
|
||||
#ifdef FT_CONFIG_OPTION_PIC
|
||||
AF_FaceGlobals globals = loader->globals;
|
||||
AF_FaceGlobals globals = loader->globals;
|
||||
#endif
|
||||
AF_StyleClass style_class = metrics->style_class;
|
||||
AF_WritingSystemClass writing_system_class =
|
||||
AF_WRITING_SYSTEM_CLASSES_GET
|
||||
[metrics->script_class->writing_system];
|
||||
AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];
|
||||
|
||||
|
||||
loader->metrics = metrics;
|
||||
|
||||
if ( writing_system_class->script_metrics_scale )
|
||||
writing_system_class->script_metrics_scale( metrics, &scaler );
|
||||
if ( writing_system_class->style_metrics_scale )
|
||||
writing_system_class->style_metrics_scale( metrics, &scaler );
|
||||
else
|
||||
metrics->scaler = scaler;
|
||||
|
||||
load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;
|
||||
load_flags &= ~FT_LOAD_RENDER;
|
||||
|
||||
if ( writing_system_class->script_hints_init )
|
||||
if ( writing_system_class->style_hints_init )
|
||||
{
|
||||
error = writing_system_class->script_hints_init( &loader->hints,
|
||||
metrics );
|
||||
error = writing_system_class->style_hints_init( &loader->hints,
|
||||
metrics );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter glyph loading routines (specification). */
|
||||
/* */
|
||||
/* Copyright 2003-2005, 2011-2012 by */
|
||||
/* Copyright 2003-2005, 2011-2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -44,7 +44,7 @@ FT_BEGIN_HEADER
|
||||
/* current glyph data */
|
||||
FT_GlyphLoader gloader;
|
||||
AF_GlyphHintsRec hints;
|
||||
AF_ScriptMetrics metrics;
|
||||
AF_StyleMetrics metrics;
|
||||
FT_Bool transformed;
|
||||
FT_Matrix trans_matrix;
|
||||
FT_Vector trans_delta;
|
||||
|
||||
+58
-13
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter module implementation (body). */
|
||||
/* */
|
||||
/* Copyright 2003-2006, 2009, 2011-2013 by */
|
||||
/* Copyright 2003-2006, 2009, 2011-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -45,7 +45,7 @@
|
||||
#define FT_COMPONENT trace_afmodule
|
||||
|
||||
|
||||
FT_Error
|
||||
static FT_Error
|
||||
af_property_get_face_globals( FT_Face face,
|
||||
AF_FaceGlobals* aglobals,
|
||||
AF_Module module )
|
||||
@@ -60,8 +60,8 @@
|
||||
globals = (AF_FaceGlobals)face->autohint.data;
|
||||
if ( !globals )
|
||||
{
|
||||
/* trigger computation of the global script data */
|
||||
/* in case it hasn't been done yet */
|
||||
/* trigger computation of the global style data */
|
||||
/* in case it hasn't been done yet */
|
||||
error = af_face_globals_new( face, &globals, module );
|
||||
if ( !error )
|
||||
{
|
||||
@@ -79,7 +79,7 @@
|
||||
}
|
||||
|
||||
|
||||
FT_Error
|
||||
static FT_Error
|
||||
af_property_set( FT_Module ft_module,
|
||||
const char* property_name,
|
||||
const void* value )
|
||||
@@ -92,8 +92,40 @@
|
||||
{
|
||||
FT_UInt* fallback_script = (FT_UInt*)value;
|
||||
|
||||
FT_UInt ss;
|
||||
|
||||
module->fallback_script = *fallback_script;
|
||||
|
||||
/* We translate the fallback script to a fallback style that uses */
|
||||
/* `fallback-script' as its script and `AF_COVERAGE_NONE' as its */
|
||||
/* coverage value. */
|
||||
for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
|
||||
{
|
||||
AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss];
|
||||
|
||||
|
||||
if ( style_class->script == *fallback_script &&
|
||||
style_class->coverage == AF_COVERAGE_DEFAULT )
|
||||
{
|
||||
module->fallback_style = ss;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !AF_STYLE_CLASSES_GET[ss] )
|
||||
{
|
||||
FT_TRACE0(( "af_property_set: Invalid value %d for property `%s'\n",
|
||||
fallback_script, property_name ));
|
||||
return FT_THROW( Invalid_Argument );
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
else if ( !ft_strcmp( property_name, "default-script" ) )
|
||||
{
|
||||
FT_UInt* default_script = (FT_UInt*)value;
|
||||
|
||||
|
||||
module->default_script = *default_script;
|
||||
|
||||
return error;
|
||||
}
|
||||
@@ -116,14 +148,15 @@
|
||||
}
|
||||
|
||||
|
||||
FT_Error
|
||||
static FT_Error
|
||||
af_property_get( FT_Module ft_module,
|
||||
const char* property_name,
|
||||
void* value )
|
||||
{
|
||||
FT_Error error = FT_Err_Ok;
|
||||
AF_Module module = (AF_Module)ft_module;
|
||||
FT_UInt fallback_script = module->fallback_script;
|
||||
FT_Error error = FT_Err_Ok;
|
||||
AF_Module module = (AF_Module)ft_module;
|
||||
FT_UInt fallback_style = module->fallback_style;
|
||||
FT_UInt default_script = module->default_script;
|
||||
|
||||
|
||||
if ( !ft_strcmp( property_name, "glyph-to-script-map" ) )
|
||||
@@ -134,7 +167,7 @@
|
||||
|
||||
error = af_property_get_face_globals( prop->face, &globals, module );
|
||||
if ( !error )
|
||||
prop->map = globals->glyph_scripts;
|
||||
prop->map = globals->glyph_styles;
|
||||
|
||||
return error;
|
||||
}
|
||||
@@ -142,8 +175,19 @@
|
||||
{
|
||||
FT_UInt* val = (FT_UInt*)value;
|
||||
|
||||
AF_StyleClass style_class = AF_STYLE_CLASSES_GET[fallback_style];
|
||||
|
||||
*val = fallback_script;
|
||||
|
||||
*val = style_class->script;
|
||||
|
||||
return error;
|
||||
}
|
||||
else if ( !ft_strcmp( property_name, "default-script" ) )
|
||||
{
|
||||
FT_UInt* val = (FT_UInt*)value;
|
||||
|
||||
|
||||
*val = default_script;
|
||||
|
||||
return error;
|
||||
}
|
||||
@@ -206,7 +250,8 @@
|
||||
AF_Module module = (AF_Module)ft_module;
|
||||
|
||||
|
||||
module->fallback_script = AF_SCRIPT_FALLBACK;
|
||||
module->fallback_style = AF_STYLE_FALLBACK;
|
||||
module->default_script = AF_SCRIPT_DEFAULT;
|
||||
|
||||
return af_loader_init( module );
|
||||
}
|
||||
|
||||
+3
-2
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter module implementation (specification). */
|
||||
/* */
|
||||
/* Copyright 2003, 2004, 2005 by */
|
||||
/* Copyright 2003-2005, 2009, 2012, 2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -40,7 +40,8 @@ FT_BEGIN_HEADER
|
||||
{
|
||||
FT_ModuleRec root;
|
||||
|
||||
FT_UInt fallback_script;
|
||||
FT_UInt fallback_style;
|
||||
FT_UInt default_script;
|
||||
|
||||
AF_LoaderRec loader[1];
|
||||
|
||||
|
||||
+21
-7
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType position independent code services for autofit module. */
|
||||
/* */
|
||||
/* Copyright 2009-2013 by */
|
||||
/* Copyright 2009-2014 by */
|
||||
/* Oran Agra and Mickey Gabel. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -20,6 +20,7 @@
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include "afpic.h"
|
||||
#include "afglobal.h"
|
||||
#include "aferrors.h"
|
||||
|
||||
|
||||
@@ -42,7 +43,7 @@
|
||||
FT_AutoHinter_InterfaceRec* clazz );
|
||||
|
||||
|
||||
/* forward declaration of PIC init functions from script classes */
|
||||
/* forward declaration of PIC init functions from writing system classes */
|
||||
#undef WRITING_SYSTEM
|
||||
#define WRITING_SYSTEM( ws, WS ) /* empty */
|
||||
|
||||
@@ -97,15 +98,20 @@
|
||||
|
||||
FT_Init_Class_af_service_properties( &container->af_service_properties );
|
||||
|
||||
for ( ss = 0; ss < AF_WRITING_SYSTEM_MAX - 1; ss++ )
|
||||
for ( ss = 0; ss < AF_WRITING_SYSTEM_MAX; ss++ )
|
||||
container->af_writing_system_classes[ss] =
|
||||
&container->af_writing_system_classes_rec[ss];
|
||||
container->af_writing_system_classes[AF_WRITING_SYSTEM_MAX - 1] = NULL;
|
||||
container->af_writing_system_classes[AF_WRITING_SYSTEM_MAX] = NULL;
|
||||
|
||||
for ( ss = 0; ss < AF_SCRIPT_MAX - 1; ss++ )
|
||||
for ( ss = 0; ss < AF_SCRIPT_MAX; ss++ )
|
||||
container->af_script_classes[ss] =
|
||||
&container->af_script_classes_rec[ss];
|
||||
container->af_script_classes[AF_SCRIPT_MAX - 1] = NULL;
|
||||
container->af_script_classes[AF_SCRIPT_MAX] = NULL;
|
||||
|
||||
for ( ss = 0; ss < AF_STYLE_MAX; ss++ )
|
||||
container->af_style_classes[ss] =
|
||||
&container->af_style_classes_rec[ss];
|
||||
container->af_style_classes[AF_STYLE_MAX] = NULL;
|
||||
|
||||
#undef WRITING_SYSTEM
|
||||
#define WRITING_SYSTEM( ws, WS ) \
|
||||
@@ -116,13 +122,21 @@
|
||||
#include "afwrtsys.h"
|
||||
|
||||
#undef SCRIPT
|
||||
#define SCRIPT( s, S, d ) \
|
||||
#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \
|
||||
FT_Init_Class_af_ ## s ## _script_class( \
|
||||
&container->af_script_classes_rec[ss++] );
|
||||
|
||||
ss = 0;
|
||||
#include "afscript.h"
|
||||
|
||||
#undef STYLE
|
||||
#define STYLE( s, S, d, ws, sc, bss, c ) \
|
||||
FT_Init_Class_af_ ## s ## _style_class( \
|
||||
&container->af_style_classes_rec[ss++] );
|
||||
|
||||
ss = 0;
|
||||
#include "afstyles.h"
|
||||
|
||||
FT_Init_Class_af_autofitter_interface(
|
||||
library, &container->af_autofitter_interface );
|
||||
|
||||
|
||||
+12
-4
@@ -32,6 +32,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
#define AF_WRITING_SYSTEM_CLASSES_GET af_writing_system_classes
|
||||
#define AF_SCRIPT_CLASSES_GET af_script_classes
|
||||
#define AF_STYLE_CLASSES_GET af_style_classes
|
||||
#define AF_INTERFACE_GET af_autofitter_interface
|
||||
|
||||
#else /* FT_CONFIG_OPTION_PIC */
|
||||
@@ -48,14 +49,19 @@ FT_BEGIN_HEADER
|
||||
FT_Service_PropertiesRec af_service_properties;
|
||||
|
||||
AF_WritingSystemClass af_writing_system_classes
|
||||
[AF_WRITING_SYSTEM_MAX];
|
||||
[AF_WRITING_SYSTEM_MAX + 1];
|
||||
AF_WritingSystemClassRec af_writing_system_classes_rec
|
||||
[AF_WRITING_SYSTEM_MAX - 1];
|
||||
[AF_WRITING_SYSTEM_MAX];
|
||||
|
||||
AF_ScriptClass af_script_classes
|
||||
[AF_SCRIPT_MAX];
|
||||
[AF_SCRIPT_MAX + 1];
|
||||
AF_ScriptClassRec af_script_classes_rec
|
||||
[AF_SCRIPT_MAX - 1];
|
||||
[AF_SCRIPT_MAX];
|
||||
|
||||
AF_StyleClass af_style_classes
|
||||
[AF_STYLE_MAX + 1];
|
||||
AF_StyleClassRec af_style_classes_rec
|
||||
[AF_STYLE_MAX];
|
||||
|
||||
FT_AutoHinter_InterfaceRec af_autofitter_interface;
|
||||
|
||||
@@ -74,6 +80,8 @@ FT_BEGIN_HEADER
|
||||
( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_writing_system_classes )
|
||||
#define AF_SCRIPT_CLASSES_GET \
|
||||
( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_script_classes )
|
||||
#define AF_STYLE_CLASSES_GET \
|
||||
( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_style_classes )
|
||||
#define AF_INTERFACE_GET \
|
||||
( GET_PIC( library )->af_autofitter_interface )
|
||||
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* afranges.c */
|
||||
/* */
|
||||
/* Auto-fitter Unicode script ranges (body). */
|
||||
/* */
|
||||
/* Copyright 2013, 2014 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 "afranges.h"
|
||||
|
||||
|
||||
const AF_Script_UniRangeRec af_cyrl_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0400UL, 0x04FFUL ), /* Cyrillic */
|
||||
AF_UNIRANGE_REC( 0x0500UL, 0x052FUL ), /* Cyrillic Supplement */
|
||||
AF_UNIRANGE_REC( 0x2DE0UL, 0x2DFFUL ), /* Cyrillic Extended-A */
|
||||
AF_UNIRANGE_REC( 0xA640UL, 0xA69FUL ), /* Cyrillic Extended-B */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_grek_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0370UL, 0x03FFUL ), /* Greek and Coptic */
|
||||
AF_UNIRANGE_REC( 0x1F00UL, 0x1FFFUL ), /* Greek Extended */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_hebr_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0590UL, 0x05FFUL ), /* Hebrew */
|
||||
AF_UNIRANGE_REC( 0xFB1DUL, 0xFB4FUL ), /* Alphab. Present. Forms (Hebrew) */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_latn_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0020UL, 0x007FUL ), /* Basic Latin (no control chars) */
|
||||
AF_UNIRANGE_REC( 0x00A0UL, 0x00FFUL ), /* Latin-1 Supplement (no control chars) */
|
||||
AF_UNIRANGE_REC( 0x0100UL, 0x017FUL ), /* Latin Extended-A */
|
||||
AF_UNIRANGE_REC( 0x0180UL, 0x024FUL ), /* Latin Extended-B */
|
||||
AF_UNIRANGE_REC( 0x0250UL, 0x02AFUL ), /* IPA Extensions */
|
||||
AF_UNIRANGE_REC( 0x02B0UL, 0x02FFUL ), /* Spacing Modifier Letters */
|
||||
AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ), /* Combining Diacritical Marks */
|
||||
AF_UNIRANGE_REC( 0x1D00UL, 0x1D7FUL ), /* Phonetic Extensions */
|
||||
AF_UNIRANGE_REC( 0x1D80UL, 0x1DBFUL ), /* Phonetic Extensions Supplement */
|
||||
AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ), /* Combining Diacritical Marks Supplement */
|
||||
AF_UNIRANGE_REC( 0x1E00UL, 0x1EFFUL ), /* Latin Extended Additional */
|
||||
AF_UNIRANGE_REC( 0x2000UL, 0x206FUL ), /* General Punctuation */
|
||||
AF_UNIRANGE_REC( 0x2070UL, 0x209FUL ), /* Superscripts and Subscripts */
|
||||
AF_UNIRANGE_REC( 0x20A0UL, 0x20CFUL ), /* Currency Symbols */
|
||||
AF_UNIRANGE_REC( 0x2150UL, 0x218FUL ), /* Number Forms */
|
||||
AF_UNIRANGE_REC( 0x2460UL, 0x24FFUL ), /* Enclosed Alphanumerics */
|
||||
AF_UNIRANGE_REC( 0x2C60UL, 0x2C7FUL ), /* Latin Extended-C */
|
||||
AF_UNIRANGE_REC( 0x2E00UL, 0x2E7FUL ), /* Supplemental Punctuation */
|
||||
AF_UNIRANGE_REC( 0xA720UL, 0xA7FFUL ), /* Latin Extended-D */
|
||||
AF_UNIRANGE_REC( 0xFB00UL, 0xFB06UL ), /* Alphab. Present. Forms (Latin Ligs) */
|
||||
AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ), /* Mathematical Alphanumeric Symbols */
|
||||
AF_UNIRANGE_REC( 0x1F100UL, 0x1F1FFUL ), /* Enclosed Alphanumeric Supplement */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_none_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
#ifdef AF_CONFIG_OPTION_INDIC
|
||||
|
||||
const AF_Script_UniRangeRec af_beng_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0980UL, 0x09FFUL ), /* Bengali */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_deva_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0900UL, 0x097FUL ), /* Devanagari */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_gujr_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0A80UL, 0x0AFFUL ), /* Gujarati */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_guru_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0A00UL, 0x0A7FUL ), /* Gurmukhi */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_knda_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0C80UL, 0x0CFFUL ), /* Kannada */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_limb_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x1900UL, 0x194FUL ), /* Limbu */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_mlym_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0D00UL, 0x0D7FUL ), /* Malayalam */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_orya_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0B00UL, 0x0B7FUL ), /* Oriya */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_sinh_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0D80UL, 0x0DFFUL ), /* Sinhala */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_sund_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x1B80UL, 0x1BBFUL ), /* Sundanese */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_sylo_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0xA800UL, 0xA82FUL ), /* Syloti Nagri */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_taml_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0B80UL, 0x0BFFUL ), /* Tamil */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_telu_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0C00UL, 0x0C7FUL ), /* Telugu */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
const AF_Script_UniRangeRec af_tibt_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x0F00UL, 0x0FFFUL ), /* Tibetan */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
#endif /* !AF_CONFIG_OPTION_INDIC */
|
||||
|
||||
#ifdef AF_CONFIG_OPTION_CJK
|
||||
|
||||
/* this corresponds to Unicode 6.0 */
|
||||
|
||||
const AF_Script_UniRangeRec af_hani_uniranges[] =
|
||||
{
|
||||
AF_UNIRANGE_REC( 0x1100UL, 0x11FFUL ), /* Hangul Jamo */
|
||||
AF_UNIRANGE_REC( 0x2E80UL, 0x2EFFUL ), /* CJK Radicals Supplement */
|
||||
AF_UNIRANGE_REC( 0x2F00UL, 0x2FDFUL ), /* Kangxi Radicals */
|
||||
AF_UNIRANGE_REC( 0x2FF0UL, 0x2FFFUL ), /* Ideographic Description Characters */
|
||||
AF_UNIRANGE_REC( 0x3000UL, 0x303FUL ), /* CJK Symbols and Punctuation */
|
||||
AF_UNIRANGE_REC( 0x3040UL, 0x309FUL ), /* Hiragana */
|
||||
AF_UNIRANGE_REC( 0x30A0UL, 0x30FFUL ), /* Katakana */
|
||||
AF_UNIRANGE_REC( 0x3100UL, 0x312FUL ), /* Bopomofo */
|
||||
AF_UNIRANGE_REC( 0x3130UL, 0x318FUL ), /* Hangul Compatibility Jamo */
|
||||
AF_UNIRANGE_REC( 0x3190UL, 0x319FUL ), /* Kanbun */
|
||||
AF_UNIRANGE_REC( 0x31A0UL, 0x31BFUL ), /* Bopomofo Extended */
|
||||
AF_UNIRANGE_REC( 0x31C0UL, 0x31EFUL ), /* CJK Strokes */
|
||||
AF_UNIRANGE_REC( 0x31F0UL, 0x31FFUL ), /* Katakana Phonetic Extensions */
|
||||
AF_UNIRANGE_REC( 0x3200UL, 0x32FFUL ), /* Enclosed CJK Letters and Months */
|
||||
AF_UNIRANGE_REC( 0x3300UL, 0x33FFUL ), /* CJK Compatibility */
|
||||
AF_UNIRANGE_REC( 0x3400UL, 0x4DBFUL ), /* CJK Unified Ideographs Extension A */
|
||||
AF_UNIRANGE_REC( 0x4DC0UL, 0x4DFFUL ), /* Yijing Hexagram Symbols */
|
||||
AF_UNIRANGE_REC( 0x4E00UL, 0x9FFFUL ), /* CJK Unified Ideographs */
|
||||
AF_UNIRANGE_REC( 0xA960UL, 0xA97FUL ), /* Hangul Jamo Extended-A */
|
||||
AF_UNIRANGE_REC( 0xAC00UL, 0xD7AFUL ), /* Hangul Syllables */
|
||||
AF_UNIRANGE_REC( 0xD7B0UL, 0xD7FFUL ), /* Hangul Jamo Extended-B */
|
||||
AF_UNIRANGE_REC( 0xF900UL, 0xFAFFUL ), /* CJK Compatibility Ideographs */
|
||||
AF_UNIRANGE_REC( 0xFE10UL, 0xFE1FUL ), /* Vertical forms */
|
||||
AF_UNIRANGE_REC( 0xFE30UL, 0xFE4FUL ), /* CJK Compatibility Forms */
|
||||
AF_UNIRANGE_REC( 0xFF00UL, 0xFFEFUL ), /* Halfwidth and Fullwidth Forms */
|
||||
AF_UNIRANGE_REC( 0x1B000UL, 0x1B0FFUL ), /* Kana Supplement */
|
||||
AF_UNIRANGE_REC( 0x1D300UL, 0x1D35FUL ), /* Tai Xuan Hing Symbols */
|
||||
AF_UNIRANGE_REC( 0x1F200UL, 0x1F2FFUL ), /* Enclosed Ideographic Supplement */
|
||||
AF_UNIRANGE_REC( 0x20000UL, 0x2A6DFUL ), /* CJK Unified Ideographs Extension B */
|
||||
AF_UNIRANGE_REC( 0x2A700UL, 0x2B73FUL ), /* CJK Unified Ideographs Extension C */
|
||||
AF_UNIRANGE_REC( 0x2B740UL, 0x2B81FUL ), /* CJK Unified Ideographs Extension D */
|
||||
AF_UNIRANGE_REC( 0x2F800UL, 0x2FA1FUL ), /* CJK Compatibility Ideographs Supplement */
|
||||
AF_UNIRANGE_REC( 0UL, 0UL )
|
||||
};
|
||||
|
||||
#endif /* !AF_CONFIG_OPTION_CJK */
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,41 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* afranges.h */
|
||||
/* */
|
||||
/* Auto-fitter Unicode script ranges (specification). */
|
||||
/* */
|
||||
/* Copyright 2013, 2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __AFRANGES_H__
|
||||
#define __AFRANGES_H__
|
||||
|
||||
|
||||
#include "aftypes.h"
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
#undef SCRIPT
|
||||
#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \
|
||||
extern const AF_Script_UniRangeRec af_ ## s ## _uniranges[];
|
||||
|
||||
#include "afscript.h"
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __AFRANGES_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
+113
-12
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter scripts (specification only). */
|
||||
/* */
|
||||
/* Copyright 2013 by */
|
||||
/* Copyright 2013, 2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -20,18 +20,119 @@
|
||||
/* Define `SCRIPT' as needed. */
|
||||
|
||||
|
||||
/* Add new scripts here. */
|
||||
/* Add new scripts here. The first and second arguments are the */
|
||||
/* script name in lowercase and uppercase, respectively, followed */
|
||||
/* by a description string. Then comes the corresponding HarfBuzz */
|
||||
/* script name tag, followed by a string of standard characters (to */
|
||||
/* derive the standard width and height of stems). */
|
||||
|
||||
SCRIPT( cyrl, CYRL, "Cyrillic" )
|
||||
SCRIPT( deva, DEVA, "Indic scripts" )
|
||||
SCRIPT( dflt, DFLT, "no script" )
|
||||
SCRIPT( grek, GREK, "Greek" )
|
||||
SCRIPT( hani, HANI, "CJKV ideographs" )
|
||||
SCRIPT( hebr, HEBR, "Hebrew" )
|
||||
SCRIPT( latn, LATN, "Latin" )
|
||||
#ifdef FT_OPTION_AUTOFIT2
|
||||
SCRIPT( ltn2, LTN2, "Latin 2" )
|
||||
#endif
|
||||
SCRIPT( cyrl, CYRL,
|
||||
"Cyrillic",
|
||||
HB_SCRIPT_CYRILLIC,
|
||||
0x43E, 0x41E, 0x0 ) /* оО */
|
||||
|
||||
SCRIPT( grek, GREK,
|
||||
"Greek",
|
||||
HB_SCRIPT_GREEK,
|
||||
0x3BF, 0x39F, 0x0 ) /* οΟ */
|
||||
|
||||
SCRIPT( hebr, HEBR,
|
||||
"Hebrew",
|
||||
HB_SCRIPT_HEBREW,
|
||||
0x5DD, 0x0, 0x0 ) /* ם */
|
||||
|
||||
SCRIPT( latn, LATN,
|
||||
"Latin",
|
||||
HB_SCRIPT_LATIN,
|
||||
'o', 'O', '0' )
|
||||
|
||||
SCRIPT( none, NONE,
|
||||
"no script",
|
||||
HB_SCRIPT_INVALID,
|
||||
0x0, 0x0, 0x0 )
|
||||
|
||||
#ifdef AF_CONFIG_OPTION_INDIC
|
||||
|
||||
SCRIPT( beng, BENG,
|
||||
"Bengali",
|
||||
HB_SCRIPT_BENGALI,
|
||||
'o', 0x0, 0x0 ) /* XXX */
|
||||
|
||||
SCRIPT( deva, DEVA,
|
||||
"Devanagari",
|
||||
HB_SCRIPT_DEVANAGARI,
|
||||
'o', 0x0, 0x0 ) /* XXX */
|
||||
|
||||
SCRIPT( gujr, GUJR,
|
||||
"Gujarati",
|
||||
HB_SCRIPT_GUJARATI,
|
||||
'o', 0x0, 0x0 ) /* XXX */
|
||||
|
||||
SCRIPT( guru, GURU,
|
||||
"Gurmukhi",
|
||||
HB_SCRIPT_GURMUKHI,
|
||||
'o', 0x0, 0x0 ) /* XXX */
|
||||
|
||||
SCRIPT( knda, KNDA,
|
||||
"Kannada",
|
||||
HB_SCRIPT_KANNADA,
|
||||
'o', 0x0, 0x0 ) /* XXX */
|
||||
|
||||
SCRIPT( limb, LIMB,
|
||||
"Limbu",
|
||||
HB_SCRIPT_LIMBU,
|
||||
'o', 0x0, 0x0 ) /* XXX */
|
||||
|
||||
SCRIPT( mlym, MLYM,
|
||||
"Malayalam",
|
||||
HB_SCRIPT_MALAYALAM,
|
||||
'o', 0x0, 0x0 ) /* XXX */
|
||||
|
||||
SCRIPT( orya, ORYA,
|
||||
"Oriya",
|
||||
HB_SCRIPT_ORIYA,
|
||||
'o', 0x0, 0x0 ) /* XXX */
|
||||
|
||||
SCRIPT( sinh, SINH,
|
||||
"Sinhala",
|
||||
HB_SCRIPT_SINHALA,
|
||||
'o', 0x0, 0x0 ) /* XXX */
|
||||
|
||||
SCRIPT( sund, SUND,
|
||||
"Sundanese",
|
||||
HB_SCRIPT_SUNDANESE,
|
||||
'o', 0x0, 0x0 ) /* XXX */
|
||||
|
||||
SCRIPT( sylo, SYLO,
|
||||
"Syloti Nagri",
|
||||
HB_SCRIPT_SYLOTI_NAGRI,
|
||||
'o', 0x0, 0x0 ) /* XXX */
|
||||
|
||||
SCRIPT( taml, TAML,
|
||||
"Tamil",
|
||||
HB_SCRIPT_TAMIL,
|
||||
'o', 0x0, 0x0 ) /* XXX */
|
||||
|
||||
SCRIPT( telu, TELU,
|
||||
"Telugu",
|
||||
HB_SCRIPT_TELUGU,
|
||||
'o', 0x0, 0x0 ) /* XXX */
|
||||
|
||||
SCRIPT( tibt, TIBT,
|
||||
"Tibetan",
|
||||
HB_SCRIPT_TIBETAN,
|
||||
'o', 0x0, 0x0 ) /* XXX */
|
||||
|
||||
#endif /* AF_CONFIG_OPTION_INDIC */
|
||||
|
||||
#ifdef AF_CONFIG_OPTION_CJK
|
||||
|
||||
SCRIPT( hani, HANI,
|
||||
"CJKV ideographs",
|
||||
HB_SCRIPT_HAN,
|
||||
0x7530, 0x56D7, 0x0 ) /* 田囗 */
|
||||
|
||||
#endif /* AF_CONFIG_OPTION_CJK */
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* afstyles.h */
|
||||
/* */
|
||||
/* Auto-fitter styles (specification only). */
|
||||
/* */
|
||||
/* Copyright 2013, 2014 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/* The following part can be included multiple times. */
|
||||
/* Define `STYLE' as needed. */
|
||||
|
||||
|
||||
/* Add new styles here. The first and second arguments are the */
|
||||
/* style name in lowercase and uppercase, respectively, followed */
|
||||
/* by a description string. The next arguments are the */
|
||||
/* corresponding writing system, script, blue stringset, and */
|
||||
/* coverage. */
|
||||
/* */
|
||||
/* Note that styles using `AF_COVERAGE_DEFAULT' should always */
|
||||
/* come after styles with other coverages. */
|
||||
/* */
|
||||
/* Example: */
|
||||
/* */
|
||||
/* STYLE( cyrl_dflt, CYRL_DFLT, */
|
||||
/* "Cyrillic default style", */
|
||||
/* AF_WRITING_SYSTEM_LATIN, */
|
||||
/* AF_SCRIPT_CYRL, */
|
||||
/* AF_BLUE_STRINGSET_CYRL, */
|
||||
/* AF_COVERAGE_DEFAULT ) */
|
||||
|
||||
#undef STYLE_LATIN
|
||||
#define STYLE_LATIN( s, S, f, F, ds, df, C ) \
|
||||
STYLE( s ## _ ## f, S ## _ ## F, \
|
||||
ds " " df " style", \
|
||||
AF_WRITING_SYSTEM_LATIN, \
|
||||
AF_SCRIPT_ ## S, \
|
||||
AF_BLUE_STRINGSET_ ## S, \
|
||||
AF_COVERAGE_ ## C )
|
||||
|
||||
#undef META_STYLE_LATIN
|
||||
#define META_STYLE_LATIN( s, S, ds ) \
|
||||
STYLE_LATIN( s, S, c2cp, C2CP, ds, \
|
||||
"petite capticals from capitals", \
|
||||
PETITE_CAPITALS_FROM_CAPITALS ) \
|
||||
STYLE_LATIN( s, S, c2sc, C2SC, ds, \
|
||||
"small capticals from capitals", \
|
||||
SMALL_CAPITALS_FROM_CAPITALS ) \
|
||||
STYLE_LATIN( s, S, ordn, ORDN, ds, \
|
||||
"ordinals", \
|
||||
ORDINALS ) \
|
||||
STYLE_LATIN( s, S, pcap, PCAP, ds, \
|
||||
"petite capitals", \
|
||||
PETITE_CAPITALS ) \
|
||||
STYLE_LATIN( s, S, sinf, SINF, ds, \
|
||||
"scientific inferiors", \
|
||||
SCIENTIFIC_INFERIORS ) \
|
||||
STYLE_LATIN( s, S, smcp, SMCP, ds, \
|
||||
"small capitals", \
|
||||
SMALL_CAPITALS ) \
|
||||
STYLE_LATIN( s, S, subs, SUBS, ds, \
|
||||
"subscript", \
|
||||
SUBSCRIPT ) \
|
||||
STYLE_LATIN( s, S, sups, SUPS, ds, \
|
||||
"superscript", \
|
||||
SUPERSCRIPT ) \
|
||||
STYLE_LATIN( s, S, titl, TITL, ds, \
|
||||
"titling", \
|
||||
TITLING ) \
|
||||
STYLE_LATIN( s, S, dflt, DFLT, ds, \
|
||||
"default", \
|
||||
DEFAULT )
|
||||
|
||||
META_STYLE_LATIN( cyrl, CYRL, "Cyrillic" )
|
||||
META_STYLE_LATIN( grek, GREK, "Greek" )
|
||||
STYLE( hebr_dflt, HEBR_DFLT,
|
||||
"Hebrew default style",
|
||||
AF_WRITING_SYSTEM_LATIN,
|
||||
AF_SCRIPT_HEBR,
|
||||
AF_BLUE_STRINGSET_HEBR,
|
||||
AF_COVERAGE_DEFAULT )
|
||||
META_STYLE_LATIN( latn, LATN, "Latin" )
|
||||
|
||||
#ifdef FT_OPTION_AUTOFIT2
|
||||
STYLE( ltn2_dflt, LTN2_DFLT,
|
||||
"Latin 2 default style",
|
||||
AF_WRITING_SYSTEM_LATIN2,
|
||||
AF_SCRIPT_LATN,
|
||||
AF_BLUE_STRINGSET_LATN,
|
||||
AF_COVERAGE_DEFAULT )
|
||||
#endif
|
||||
|
||||
STYLE( none_dflt, NONE_DFLT,
|
||||
"no style",
|
||||
AF_WRITING_SYSTEM_DUMMY,
|
||||
AF_SCRIPT_NONE,
|
||||
(AF_Blue_Stringset)0,
|
||||
AF_COVERAGE_DEFAULT )
|
||||
|
||||
#ifdef AF_CONFIG_OPTION_INDIC
|
||||
|
||||
/* no blue stringset support for the Indic writing system yet */
|
||||
#undef STYLE_DEFAULT_INDIC
|
||||
#define STYLE_DEFAULT_INDIC( s, S, d ) \
|
||||
STYLE( s ## _dflt, S ## _DFLT, \
|
||||
d " default style", \
|
||||
AF_WRITING_SYSTEM_INDIC, \
|
||||
AF_SCRIPT_ ## S, \
|
||||
(AF_Blue_Stringset)0, \
|
||||
AF_COVERAGE_DEFAULT )
|
||||
|
||||
STYLE_DEFAULT_INDIC( beng, BENG, "Bengali" )
|
||||
STYLE_DEFAULT_INDIC( deva, DEVA, "Devanagari" )
|
||||
STYLE_DEFAULT_INDIC( gujr, GUJR, "Gujarati" )
|
||||
STYLE_DEFAULT_INDIC( guru, GURU, "Gurmukhi" )
|
||||
STYLE_DEFAULT_INDIC( knda, KNDA, "Kannada" )
|
||||
STYLE_DEFAULT_INDIC( limb, LIMB, "Limbu" )
|
||||
STYLE_DEFAULT_INDIC( mlym, MLYM, "Malayalam" )
|
||||
STYLE_DEFAULT_INDIC( orya, ORYA, "Oriya" )
|
||||
STYLE_DEFAULT_INDIC( sinh, SINH, "Sinhala" )
|
||||
STYLE_DEFAULT_INDIC( sund, SUND, "Sundanese" )
|
||||
STYLE_DEFAULT_INDIC( sylo, SYLO, "Syloti Nagri" )
|
||||
STYLE_DEFAULT_INDIC( taml, TAML, "Tamil" )
|
||||
STYLE_DEFAULT_INDIC( telu, TELU, "Telugu" )
|
||||
STYLE_DEFAULT_INDIC( tibt, TIBT, "Tibetan" )
|
||||
|
||||
#endif /* AF_CONFIG_OPTION_INDIC */
|
||||
|
||||
#ifdef AF_CONFIG_OPTION_CJK
|
||||
|
||||
STYLE( hani_dflt, HANI_DFLT,
|
||||
"CJKV ideographs default style",
|
||||
AF_WRITING_SYSTEM_CJK,
|
||||
AF_SCRIPT_HANI,
|
||||
AF_BLUE_STRINGSET_HANI,
|
||||
AF_COVERAGE_DEFAULT )
|
||||
|
||||
#endif /* AF_CONFIG_OPTION_CJK */
|
||||
|
||||
|
||||
/* END */
|
||||
+232
-78
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter types (specification only). */
|
||||
/* */
|
||||
/* Copyright 2003-2009, 2011-2013 by */
|
||||
/* Copyright 2003-2009, 2011-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
* The auto-fitter is a complete rewrite of the old auto-hinter.
|
||||
* Its main feature is the ability to differentiate between different
|
||||
* writing systems in order to apply script-specific rules.
|
||||
* writing systems and scripts in order to apply specific rules.
|
||||
*
|
||||
* The code has also been compartmentized into several entities that
|
||||
* should make algorithmic experimentation easier than with the old
|
||||
@@ -197,55 +197,31 @@ extern void* _af_debug_hints;
|
||||
(a)->y_delta == (b)->y_delta )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** S C R I P T M E T R I C S *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* This is the main structure which combines writing systems and script */
|
||||
/* data (for a given face object, see below). */
|
||||
|
||||
typedef struct AF_WritingSystemClassRec_ const* AF_WritingSystemClass;
|
||||
typedef struct AF_ScriptClassRec_ const* AF_ScriptClass;
|
||||
typedef struct AF_FaceGlobalsRec_* AF_FaceGlobals;
|
||||
|
||||
typedef struct AF_ScriptMetricsRec_
|
||||
{
|
||||
AF_ScriptClass script_class;
|
||||
AF_ScalerRec scaler;
|
||||
FT_Bool digits_have_same_width;
|
||||
|
||||
AF_FaceGlobals globals; /* to access properties */
|
||||
|
||||
} AF_ScriptMetricsRec, *AF_ScriptMetrics;
|
||||
|
||||
typedef struct AF_StyleMetricsRec_* AF_StyleMetrics;
|
||||
|
||||
/* This function parses an FT_Face to compute global metrics for
|
||||
* a specific script.
|
||||
* a specific style.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*AF_Script_InitMetricsFunc)( AF_ScriptMetrics metrics,
|
||||
FT_Face face );
|
||||
(*AF_WritingSystem_InitMetricsFunc)( AF_StyleMetrics metrics,
|
||||
FT_Face face );
|
||||
|
||||
typedef void
|
||||
(*AF_Script_ScaleMetricsFunc)( AF_ScriptMetrics metrics,
|
||||
AF_Scaler scaler );
|
||||
(*AF_WritingSystem_ScaleMetricsFunc)( AF_StyleMetrics metrics,
|
||||
AF_Scaler scaler );
|
||||
|
||||
typedef void
|
||||
(*AF_Script_DoneMetricsFunc)( AF_ScriptMetrics metrics );
|
||||
(*AF_WritingSystem_DoneMetricsFunc)( AF_StyleMetrics metrics );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*AF_Script_InitHintsFunc)( AF_GlyphHints hints,
|
||||
AF_ScriptMetrics metrics );
|
||||
(*AF_WritingSystem_InitHintsFunc)( AF_GlyphHints hints,
|
||||
AF_StyleMetrics metrics );
|
||||
|
||||
typedef void
|
||||
(*AF_Script_ApplyHintsFunc)( AF_GlyphHints hints,
|
||||
FT_Outline* outline,
|
||||
AF_ScriptMetrics metrics );
|
||||
(*AF_WritingSystem_ApplyHintsFunc)( AF_GlyphHints hints,
|
||||
FT_Outline* outline,
|
||||
AF_StyleMetrics metrics );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -257,14 +233,14 @@ extern void* _af_debug_hints;
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* In FreeType, a writing system consists of multiple scripts which can
|
||||
* be handled similarly *in a typographical way*; the relationship is not
|
||||
* based on history. For example, both the Greek and the unrelated
|
||||
* For the auto-hinter, a writing system consists of multiple scripts that
|
||||
* can be handled similarly *in a typographical way*; the relationship is
|
||||
* not based on history. For example, both the Greek and the unrelated
|
||||
* Armenian scripts share the same features like ascender, descender,
|
||||
* x-height, etc. Essentially, a writing system is covered by a
|
||||
* submodule of the auto-fitter; it contains
|
||||
*
|
||||
* - a specific global analyzer which computes global metrics specific to
|
||||
* - a specific global analyzer that computes global metrics specific to
|
||||
* the script (based on script-specific characters to identify ascender
|
||||
* height, x-height, etc.),
|
||||
*
|
||||
@@ -297,16 +273,18 @@ extern void* _af_debug_hints;
|
||||
{
|
||||
AF_WritingSystem writing_system;
|
||||
|
||||
FT_Offset script_metrics_size;
|
||||
AF_Script_InitMetricsFunc script_metrics_init;
|
||||
AF_Script_ScaleMetricsFunc script_metrics_scale;
|
||||
AF_Script_DoneMetricsFunc script_metrics_done;
|
||||
FT_Offset style_metrics_size;
|
||||
AF_WritingSystem_InitMetricsFunc style_metrics_init;
|
||||
AF_WritingSystem_ScaleMetricsFunc style_metrics_scale;
|
||||
AF_WritingSystem_DoneMetricsFunc style_metrics_done;
|
||||
|
||||
AF_Script_InitHintsFunc script_hints_init;
|
||||
AF_Script_ApplyHintsFunc script_hints_apply;
|
||||
AF_WritingSystem_InitHintsFunc style_hints_init;
|
||||
AF_WritingSystem_ApplyHintsFunc style_hints_apply;
|
||||
|
||||
} AF_WritingSystemClassRec;
|
||||
|
||||
typedef const AF_WritingSystemClassRec* AF_WritingSystemClass;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
@@ -317,15 +295,15 @@ extern void* _af_debug_hints;
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* Each script is associated with a set of Unicode ranges which gets used
|
||||
* to test whether the font face supports the script. It also references
|
||||
* the writing system it belongs to.
|
||||
* Each script is associated with a set of Unicode ranges that gets used
|
||||
* to test whether the font face supports the script.
|
||||
*
|
||||
* We use four-letter script tags from the OpenType specification.
|
||||
* We use four-letter script tags from the OpenType specification,
|
||||
* extended by `NONE', which indicates `no script'.
|
||||
*/
|
||||
|
||||
#undef SCRIPT
|
||||
#define SCRIPT( s, S, d ) \
|
||||
#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \
|
||||
AF_SCRIPT_ ## S,
|
||||
|
||||
/* The list of known scripts. */
|
||||
@@ -353,15 +331,147 @@ extern void* _af_debug_hints;
|
||||
|
||||
typedef struct AF_ScriptClassRec_
|
||||
{
|
||||
AF_Script script;
|
||||
AF_Blue_Stringset blue_stringset;
|
||||
AF_WritingSystem writing_system;
|
||||
AF_Script script;
|
||||
|
||||
AF_Script_UniRange script_uni_ranges; /* last must be { 0, 0 } */
|
||||
FT_UInt32 standard_char; /* for default width and height */
|
||||
|
||||
FT_UInt32 standard_char1; /* for default width and height */
|
||||
FT_UInt32 standard_char2; /* ditto */
|
||||
FT_UInt32 standard_char3; /* ditto */
|
||||
|
||||
} AF_ScriptClassRec;
|
||||
|
||||
typedef const AF_ScriptClassRec* AF_ScriptClass;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** C O V E R A G E S *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* Usually, a font contains more glyphs than can be addressed by its
|
||||
* character map.
|
||||
*
|
||||
* In the PostScript font world, encoding vectors specific to a given
|
||||
* task are used to select such glyphs, and these glyphs can be often
|
||||
* recognized by having a suffix in its glyph names. For example, a
|
||||
* superscript glyph `A' might be called `A.sup'. Unfortunately, this
|
||||
* naming scheme is not standardized and thus unusable for us.
|
||||
*
|
||||
* In the OpenType world, a better solution was invented, namely
|
||||
* `features', which cleanly separate a character's input encoding from
|
||||
* the corresponding glyph's appearance, and which don't use glyph names
|
||||
* at all. For our purposes, and slightly generalized, an OpenType
|
||||
* feature is a name of a mapping that maps character codes to
|
||||
* non-standard glyph indices (features get used for other things also).
|
||||
* For example, the `sups' feature provides superscript glyphs, thus
|
||||
* mapping character codes like `A' or `B' to superscript glyph
|
||||
* representation forms. How this mapping happens is completely
|
||||
* uninteresting to us.
|
||||
*
|
||||
* For the auto-hinter, a `coverage' represents all glyphs of an OpenType
|
||||
* feature collected in a set (as listed below) that can be hinted
|
||||
* together. To continue the above example, superscript glyphs must not
|
||||
* be hinted together with normal glyphs because the blue zones
|
||||
* completely differ.
|
||||
*
|
||||
* Note that FreeType itself doesn't compute coverages; it only provides
|
||||
* the glyphs addressable by the default Unicode character map. Instead,
|
||||
* we use the HarfBuzz library (if available), which has many functions
|
||||
* exactly for this purpose.
|
||||
*
|
||||
* AF_COVERAGE_DEFAULT is special: It should cover everything that isn't
|
||||
* listed separately (including the glyphs addressable by the character
|
||||
* map). In case HarfBuzz isn't available, it exactly covers the glyphs
|
||||
* addressable by the character map.
|
||||
*
|
||||
*/
|
||||
|
||||
#undef COVERAGE
|
||||
#define COVERAGE( name, NAME, description, \
|
||||
tag1, tag2, tag3, tag4 ) \
|
||||
AF_COVERAGE_ ## NAME,
|
||||
|
||||
|
||||
typedef enum AF_Coverage_
|
||||
{
|
||||
#include "afcover.h"
|
||||
|
||||
AF_COVERAGE_DEFAULT
|
||||
|
||||
} AF_Coverage;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** S T Y L E S *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* The topmost structure for modelling the auto-hinter glyph input data
|
||||
* is a `style class', grouping everything together.
|
||||
*/
|
||||
|
||||
#undef STYLE
|
||||
#define STYLE( s, S, d, ws, sc, ss, c ) \
|
||||
AF_STYLE_ ## S,
|
||||
|
||||
/* The list of known styles. */
|
||||
typedef enum AF_Style_
|
||||
{
|
||||
|
||||
#include "afstyles.h"
|
||||
|
||||
AF_STYLE_MAX /* do not remove */
|
||||
|
||||
} AF_Style;
|
||||
|
||||
|
||||
typedef struct AF_StyleClassRec_
|
||||
{
|
||||
AF_Style style;
|
||||
|
||||
AF_WritingSystem writing_system;
|
||||
AF_Script script;
|
||||
AF_Blue_Stringset blue_stringset;
|
||||
AF_Coverage coverage;
|
||||
|
||||
} AF_StyleClassRec;
|
||||
|
||||
typedef const AF_StyleClassRec* AF_StyleClass;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** S T Y L E M E T R I C S *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct AF_FaceGlobalsRec_* AF_FaceGlobals;
|
||||
|
||||
/* This is the main structure that combines everything. Autofit modules */
|
||||
/* specific to writing systems derive their structures from it, for */
|
||||
/* example `AF_LatinMetrics'. */
|
||||
|
||||
typedef struct AF_StyleMetricsRec_
|
||||
{
|
||||
AF_StyleClass style_class;
|
||||
AF_ScalerRec scaler;
|
||||
FT_Bool digits_have_same_width;
|
||||
|
||||
AF_FaceGlobals globals; /* to access properties */
|
||||
|
||||
} AF_StyleMetricsRec;
|
||||
|
||||
|
||||
/* Declare and define vtables for classes */
|
||||
#ifndef FT_CONFIG_OPTION_PIC
|
||||
@@ -401,19 +511,41 @@ extern void* _af_debug_hints;
|
||||
|
||||
#define AF_DEFINE_SCRIPT_CLASS( \
|
||||
script_class, \
|
||||
script_, \
|
||||
blue_stringset_, \
|
||||
writing_system_, \
|
||||
script, \
|
||||
ranges, \
|
||||
std_char ) \
|
||||
std_char1, \
|
||||
std_char2, \
|
||||
std_char3 ) \
|
||||
FT_CALLBACK_TABLE_DEF \
|
||||
const AF_ScriptClassRec script_class = \
|
||||
{ \
|
||||
script_, \
|
||||
blue_stringset_, \
|
||||
writing_system_, \
|
||||
script, \
|
||||
ranges, \
|
||||
std_char \
|
||||
std_char1, \
|
||||
std_char2, \
|
||||
std_char3 \
|
||||
};
|
||||
|
||||
|
||||
#define AF_DECLARE_STYLE_CLASS( style_class ) \
|
||||
FT_CALLBACK_TABLE const AF_StyleClassRec \
|
||||
style_class;
|
||||
|
||||
#define AF_DEFINE_STYLE_CLASS( \
|
||||
style_class, \
|
||||
style, \
|
||||
writing_system, \
|
||||
script, \
|
||||
blue_stringset, \
|
||||
coverage ) \
|
||||
FT_CALLBACK_TABLE_DEF \
|
||||
const AF_StyleClassRec style_class = \
|
||||
{ \
|
||||
style, \
|
||||
writing_system, \
|
||||
script, \
|
||||
blue_stringset, \
|
||||
coverage \
|
||||
};
|
||||
|
||||
#else /* FT_CONFIG_OPTION_PIC */
|
||||
@@ -434,16 +566,16 @@ extern void* _af_debug_hints;
|
||||
FT_LOCAL_DEF( void ) \
|
||||
FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec* ac ) \
|
||||
{ \
|
||||
ac->writing_system = system; \
|
||||
ac->writing_system = system; \
|
||||
\
|
||||
ac->script_metrics_size = m_size; \
|
||||
ac->style_metrics_size = m_size; \
|
||||
\
|
||||
ac->script_metrics_init = m_init; \
|
||||
ac->script_metrics_scale = m_scale; \
|
||||
ac->script_metrics_done = m_done; \
|
||||
ac->style_metrics_init = m_init; \
|
||||
ac->style_metrics_scale = m_scale; \
|
||||
ac->style_metrics_done = m_done; \
|
||||
\
|
||||
ac->script_hints_init = h_init; \
|
||||
ac->script_hints_apply = h_apply; \
|
||||
ac->style_hints_init = h_init; \
|
||||
ac->style_hints_apply = h_apply; \
|
||||
}
|
||||
|
||||
|
||||
@@ -454,18 +586,40 @@ extern void* _af_debug_hints;
|
||||
#define AF_DEFINE_SCRIPT_CLASS( \
|
||||
script_class, \
|
||||
script_, \
|
||||
blue_string_set_, \
|
||||
writing_system_, \
|
||||
ranges, \
|
||||
std_char ) \
|
||||
std_char1, \
|
||||
std_char2, \
|
||||
std_char3 ) \
|
||||
FT_LOCAL_DEF( void ) \
|
||||
FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac ) \
|
||||
{ \
|
||||
ac->script = script_; \
|
||||
ac->blue_stringset = blue_stringset_; \
|
||||
ac->writing_system = writing_system_; \
|
||||
ac->script_uni_ranges = ranges; \
|
||||
ac->standard_char = std_char; \
|
||||
ac->standard_char1 = std_char1; \
|
||||
ac->standard_char2 = std_char2; \
|
||||
ac->standard_char3 = std_char3; \
|
||||
}
|
||||
|
||||
|
||||
#define AF_DECLARE_STYLE_CLASS( style_class ) \
|
||||
FT_LOCAL( void ) \
|
||||
FT_Init_Class_ ## style_class( AF_StyleClassRec* ac );
|
||||
|
||||
#define AF_DEFINE_STYLE_CLASS( \
|
||||
style_class, \
|
||||
style_, \
|
||||
writing_system_, \
|
||||
script_, \
|
||||
blue_stringset_, \
|
||||
coverage_ ) \
|
||||
FT_LOCAL_DEF( void ) \
|
||||
FT_Init_Class_ ## style_class( AF_StyleClassRec* ac ) \
|
||||
{ \
|
||||
ac->style = style_; \
|
||||
ac->writing_system = writing_system_; \
|
||||
ac->script = script_; \
|
||||
ac->blue_stringset = blue_stringset_; \
|
||||
ac->coverage = coverage_; \
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_PIC */
|
||||
|
||||
+2
-1
@@ -37,7 +37,8 @@
|
||||
/* Define `WRITING_SYSTEM' as needed. */
|
||||
|
||||
|
||||
/* Add new writing systems here. */
|
||||
/* Add new writing systems here. The arguments are the writing system */
|
||||
/* name in lowercase and uppercase, respectively. */
|
||||
|
||||
WRITING_SYSTEM( dummy, DUMMY )
|
||||
WRITING_SYSTEM( latin, LATIN )
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include "afglobal.c"
|
||||
#include "afhints.c"
|
||||
|
||||
#include "afranges.c"
|
||||
|
||||
#include "afdummy.c"
|
||||
#include "aflatin.c"
|
||||
#ifdef FT_OPTION_AUTOFIT2
|
||||
@@ -32,6 +34,8 @@
|
||||
#include "afcjk.c"
|
||||
#include "afindic.c"
|
||||
|
||||
#include "hbshim.c"
|
||||
|
||||
#include "afloader.c"
|
||||
#include "afmodule.c"
|
||||
|
||||
|
||||
+531
@@ -0,0 +1,531 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* hbshim.c */
|
||||
/* */
|
||||
/* HarfBuzz interface for accessing OpenType features (body). */
|
||||
/* */
|
||||
/* Copyright 2013, 2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include "afglobal.h"
|
||||
#include "aftypes.h"
|
||||
#include "hbshim.h"
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
||||
/* messages during execution. */
|
||||
/* */
|
||||
#undef FT_COMPONENT
|
||||
#define FT_COMPONENT trace_afharfbuzz
|
||||
|
||||
|
||||
/*
|
||||
* We use `sets' (in the HarfBuzz sense, which comes quite near to the
|
||||
* usual mathematical meaning) to manage both lookups and glyph indices.
|
||||
*
|
||||
* 1. For each coverage, collect lookup IDs in a set. Note that an
|
||||
* auto-hinter `coverage' is represented by one `feature', and a
|
||||
* feature consists of an arbitrary number of (font specific) `lookup's
|
||||
* that actually do the mapping job. Please check the OpenType
|
||||
* specification for more details on features and lookups.
|
||||
*
|
||||
* 2. Create glyph ID sets from the corresponding lookup sets.
|
||||
*
|
||||
* 3. The glyph set corresponding to AF_COVERAGE_DEFAULT is computed
|
||||
* with all lookups specific to the OpenType script activated. It
|
||||
* relies on the order of AF_DEFINE_STYLE_CLASS entries so that
|
||||
* special coverages (like `oldstyle figures') don't get overwritten.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* load coverage tags */
|
||||
#undef COVERAGE
|
||||
#define COVERAGE( name, NAME, description, \
|
||||
tag1, tag2, tag3, tag4 ) \
|
||||
static const hb_tag_t name ## _coverage[] = \
|
||||
{ \
|
||||
HB_TAG( tag1, tag2, tag3, tag4 ), \
|
||||
HB_TAG_NONE \
|
||||
};
|
||||
|
||||
|
||||
#include "afcover.h"
|
||||
|
||||
|
||||
/* define mapping between coverage tags and AF_Coverage */
|
||||
#undef COVERAGE
|
||||
#define COVERAGE( name, NAME, description, \
|
||||
tag1, tag2, tag3, tag4 ) \
|
||||
name ## _coverage,
|
||||
|
||||
|
||||
static const hb_tag_t* coverages[] =
|
||||
{
|
||||
#include "afcover.h"
|
||||
|
||||
NULL /* AF_COVERAGE_DEFAULT */
|
||||
};
|
||||
|
||||
|
||||
/* load HarfBuzz script tags */
|
||||
#undef SCRIPT
|
||||
#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) h,
|
||||
|
||||
|
||||
static const hb_script_t scripts[] =
|
||||
{
|
||||
#include "afscript.h"
|
||||
};
|
||||
|
||||
|
||||
FT_Error
|
||||
af_get_coverage( AF_FaceGlobals globals,
|
||||
AF_StyleClass style_class,
|
||||
FT_Byte* gstyles )
|
||||
{
|
||||
hb_face_t* face;
|
||||
|
||||
hb_set_t* gsub_lookups; /* GSUB lookups for a given script */
|
||||
hb_set_t* gsub_glyphs; /* glyphs covered by GSUB lookups */
|
||||
hb_set_t* gpos_lookups; /* GPOS lookups for a given script */
|
||||
hb_set_t* gpos_glyphs; /* glyphs covered by GPOS lookups */
|
||||
|
||||
hb_script_t script;
|
||||
const hb_tag_t* coverage_tags;
|
||||
hb_tag_t script_tags[] = { HB_TAG_NONE,
|
||||
HB_TAG_NONE,
|
||||
HB_TAG_NONE,
|
||||
HB_TAG_NONE };
|
||||
|
||||
hb_codepoint_t idx;
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
int count;
|
||||
#endif
|
||||
|
||||
|
||||
if ( !globals || !style_class || !gstyles )
|
||||
return FT_THROW( Invalid_Argument );
|
||||
|
||||
face = hb_font_get_face( globals->hb_font );
|
||||
|
||||
gsub_lookups = hb_set_create();
|
||||
gsub_glyphs = hb_set_create();
|
||||
gpos_lookups = hb_set_create();
|
||||
gpos_glyphs = hb_set_create();
|
||||
|
||||
coverage_tags = coverages[style_class->coverage];
|
||||
script = scripts[style_class->script];
|
||||
|
||||
/* Convert a HarfBuzz script tag into the corresponding OpenType */
|
||||
/* tag or tags -- some Indic scripts like Devanagari have an old */
|
||||
/* and a new set of features. */
|
||||
hb_ot_tags_from_script( script,
|
||||
&script_tags[0],
|
||||
&script_tags[1] );
|
||||
|
||||
/* `hb_ot_tags_from_script' usually returns HB_OT_TAG_DEFAULT_SCRIPT */
|
||||
/* as the second tag. We change that to HB_TAG_NONE except for the */
|
||||
/* default script. */
|
||||
if ( style_class->script == globals->module->default_script &&
|
||||
style_class->coverage == AF_COVERAGE_DEFAULT )
|
||||
{
|
||||
if ( script_tags[0] == HB_TAG_NONE )
|
||||
script_tags[0] = HB_OT_TAG_DEFAULT_SCRIPT;
|
||||
else
|
||||
{
|
||||
if ( script_tags[1] == HB_TAG_NONE )
|
||||
script_tags[1] = HB_OT_TAG_DEFAULT_SCRIPT;
|
||||
else if ( script_tags[1] != HB_OT_TAG_DEFAULT_SCRIPT )
|
||||
script_tags[2] = HB_OT_TAG_DEFAULT_SCRIPT;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( script_tags[1] == HB_OT_TAG_DEFAULT_SCRIPT )
|
||||
script_tags[1] = HB_TAG_NONE;
|
||||
}
|
||||
|
||||
hb_ot_layout_collect_lookups( face,
|
||||
HB_OT_TAG_GSUB,
|
||||
script_tags,
|
||||
NULL,
|
||||
coverage_tags,
|
||||
gsub_lookups );
|
||||
|
||||
if ( hb_set_is_empty( gsub_lookups ) )
|
||||
goto Exit; /* nothing to do */
|
||||
|
||||
hb_ot_layout_collect_lookups( face,
|
||||
HB_OT_TAG_GPOS,
|
||||
script_tags,
|
||||
NULL,
|
||||
coverage_tags,
|
||||
gpos_lookups );
|
||||
|
||||
FT_TRACE4(( "GSUB lookups (style `%s'):\n"
|
||||
" ",
|
||||
af_style_names[style_class->style] ));
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
count = 0;
|
||||
#endif
|
||||
|
||||
for ( idx = -1; hb_set_next( gsub_lookups, &idx ); )
|
||||
{
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
FT_TRACE4(( " %d", idx ));
|
||||
count++;
|
||||
#endif
|
||||
|
||||
/* get output coverage of GSUB feature */
|
||||
hb_ot_layout_lookup_collect_glyphs( face,
|
||||
HB_OT_TAG_GSUB,
|
||||
idx,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
gsub_glyphs );
|
||||
}
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
if ( !count )
|
||||
FT_TRACE4(( " (none)" ));
|
||||
FT_TRACE4(( "\n\n" ));
|
||||
#endif
|
||||
|
||||
FT_TRACE4(( "GPOS lookups (style `%s'):\n"
|
||||
" ",
|
||||
af_style_names[style_class->style] ));
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
count = 0;
|
||||
#endif
|
||||
|
||||
for ( idx = -1; hb_set_next( gpos_lookups, &idx ); )
|
||||
{
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
FT_TRACE4(( " %d", idx ));
|
||||
count++;
|
||||
#endif
|
||||
|
||||
/* get input coverage of GPOS feature */
|
||||
hb_ot_layout_lookup_collect_glyphs( face,
|
||||
HB_OT_TAG_GPOS,
|
||||
idx,
|
||||
NULL,
|
||||
gpos_glyphs,
|
||||
NULL,
|
||||
NULL );
|
||||
}
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
if ( !count )
|
||||
FT_TRACE4(( " (none)" ));
|
||||
FT_TRACE4(( "\n\n" ));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We now check whether we can construct blue zones, using glyphs
|
||||
* covered by the feature only. In case there is not a single zone
|
||||
* (this is, not a single character is covered), we skip this coverage.
|
||||
*
|
||||
*/
|
||||
{
|
||||
AF_Blue_Stringset bss = style_class->blue_stringset;
|
||||
const AF_Blue_StringRec* bs = &af_blue_stringsets[bss];
|
||||
|
||||
FT_Bool found = 0;
|
||||
|
||||
|
||||
for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ )
|
||||
{
|
||||
const char* p = &af_blue_strings[bs->string];
|
||||
|
||||
|
||||
while ( *p )
|
||||
{
|
||||
hb_codepoint_t ch;
|
||||
|
||||
|
||||
GET_UTF8_CHAR( ch, p );
|
||||
|
||||
for ( idx = -1; hb_set_next( gsub_lookups, &idx ); )
|
||||
{
|
||||
hb_codepoint_t gidx = FT_Get_Char_Index( globals->face, ch );
|
||||
|
||||
|
||||
if ( hb_ot_layout_lookup_would_substitute( face, idx,
|
||||
&gidx, 1, 1 ) )
|
||||
{
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !found )
|
||||
{
|
||||
FT_TRACE4(( " no blue characters found; style skipped\n" ));
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Various OpenType features might use the same glyphs at different
|
||||
* vertical positions; for example, superscript and subscript glyphs
|
||||
* could be the same. However, the auto-hinter is completely
|
||||
* agnostic of OpenType features after the feature analysis has been
|
||||
* completed: The engine then simply receives a glyph index and returns a
|
||||
* hinted and usually rendered glyph.
|
||||
*
|
||||
* Consider the superscript feature of font `pala.ttf': Some of the
|
||||
* glyphs are `real', this is, they have a zero vertical offset, but
|
||||
* most of them are small caps glyphs shifted up to the superscript
|
||||
* position (this is, the `sups' feature is present in both the GSUB and
|
||||
* GPOS tables). The code for blue zones computation actually uses a
|
||||
* feature's y offset so that the `real' glyphs get correct hints. But
|
||||
* later on it is impossible to decide whether a glyph index belongs to,
|
||||
* say, the small caps or superscript feature.
|
||||
*
|
||||
* For this reason, we don't assign a style to a glyph if the current
|
||||
* feature covers the glyph in both the GSUB and the GPOS tables. This
|
||||
* is quite a broad condition, assuming that
|
||||
*
|
||||
* (a) glyphs that get used in multiple features are present in a
|
||||
* feature without vertical shift,
|
||||
*
|
||||
* and
|
||||
*
|
||||
* (b) a feature's GPOS data really moves the glyph vertically.
|
||||
*
|
||||
* Not fulfilling condition (a) makes a font larger; it would also
|
||||
* reduce the number of glyphs that could be addressed directly without
|
||||
* using OpenType features, so this assumption is rather strong.
|
||||
*
|
||||
* Condition (b) is much weaker, and there might be glyphs which get
|
||||
* missed. However, the OpenType features we are going to handle are
|
||||
* primarily located in GSUB, and HarfBuzz doesn't provide an API to
|
||||
* directly get the necessary information from the GPOS table. A
|
||||
* possible solution might be to directly parse the GPOS table to find
|
||||
* out whether a glyph gets shifted vertically, but this is something I
|
||||
* would like to avoid if not really necessary.
|
||||
*
|
||||
*/
|
||||
hb_set_subtract( gsub_glyphs, gpos_glyphs );
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
FT_TRACE4(( " glyphs without GPOS data (`*' means already assigned)" ));
|
||||
count = 0;
|
||||
#endif
|
||||
|
||||
for ( idx = -1; hb_set_next( gsub_glyphs, &idx ); )
|
||||
{
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
if ( !( count % 10 ) )
|
||||
FT_TRACE4(( "\n"
|
||||
" " ));
|
||||
|
||||
FT_TRACE4(( " %d", idx ));
|
||||
count++;
|
||||
#endif
|
||||
|
||||
if ( gstyles[idx] == AF_STYLE_UNASSIGNED )
|
||||
gstyles[idx] = (FT_Byte)style_class->style;
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
else
|
||||
FT_TRACE4(( "*" ));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
if ( !count )
|
||||
FT_TRACE4(( "\n"
|
||||
" (none)" ));
|
||||
FT_TRACE4(( "\n\n" ));
|
||||
#endif
|
||||
|
||||
Exit:
|
||||
hb_set_destroy( gsub_lookups );
|
||||
hb_set_destroy( gsub_glyphs );
|
||||
hb_set_destroy( gpos_lookups );
|
||||
hb_set_destroy( gpos_glyphs );
|
||||
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
||||
|
||||
/* construct HarfBuzz features */
|
||||
#undef COVERAGE
|
||||
#define COVERAGE( name, NAME, description, \
|
||||
tag1, tag2, tag3, tag4 ) \
|
||||
static const hb_feature_t name ## _feature[] = \
|
||||
{ \
|
||||
{ \
|
||||
HB_TAG( tag1, tag2, tag3, tag4 ), \
|
||||
1, 0, (unsigned int)-1 \
|
||||
} \
|
||||
};
|
||||
|
||||
|
||||
#include "afcover.h"
|
||||
|
||||
|
||||
/* define mapping between HarfBuzz features and AF_Coverage */
|
||||
#undef COVERAGE
|
||||
#define COVERAGE( name, NAME, description, \
|
||||
tag1, tag2, tag3, tag4 ) \
|
||||
name ## _feature,
|
||||
|
||||
|
||||
static const hb_feature_t* features[] =
|
||||
{
|
||||
#include "afcover.h"
|
||||
|
||||
NULL /* AF_COVERAGE_DEFAULT */
|
||||
};
|
||||
|
||||
|
||||
FT_Error
|
||||
af_get_char_index( AF_StyleMetrics metrics,
|
||||
FT_ULong charcode,
|
||||
FT_ULong *codepoint,
|
||||
FT_Long *y_offset )
|
||||
{
|
||||
AF_StyleClass style_class;
|
||||
|
||||
const hb_feature_t* feature;
|
||||
|
||||
FT_ULong in_idx, out_idx;
|
||||
|
||||
|
||||
if ( !metrics )
|
||||
return FT_THROW( Invalid_Argument );
|
||||
|
||||
in_idx = FT_Get_Char_Index( metrics->globals->face, charcode );
|
||||
|
||||
style_class = metrics->style_class;
|
||||
|
||||
feature = features[style_class->coverage];
|
||||
|
||||
if ( feature )
|
||||
{
|
||||
FT_UInt upem = metrics->globals->face->units_per_EM;
|
||||
|
||||
hb_font_t* font = metrics->globals->hb_font;
|
||||
hb_buffer_t* buf = hb_buffer_create();
|
||||
|
||||
uint32_t c = (uint32_t)charcode;
|
||||
|
||||
hb_glyph_info_t* ginfo;
|
||||
hb_glyph_position_t* gpos;
|
||||
unsigned int gcount;
|
||||
|
||||
|
||||
/* we shape at a size of units per EM; this means font units */
|
||||
hb_font_set_scale( font, upem, upem );
|
||||
|
||||
/* XXX: is this sufficient for a single character of any script? */
|
||||
hb_buffer_set_direction( buf, HB_DIRECTION_LTR );
|
||||
hb_buffer_set_script( buf, scripts[style_class->script] );
|
||||
|
||||
/* we add one character to `buf' ... */
|
||||
hb_buffer_add_utf32( buf, &c, 1, 0, 1 );
|
||||
|
||||
/* ... and apply one feature */
|
||||
hb_shape( font, buf, feature, 1 );
|
||||
|
||||
ginfo = hb_buffer_get_glyph_infos( buf, &gcount );
|
||||
gpos = hb_buffer_get_glyph_positions( buf, &gcount );
|
||||
|
||||
out_idx = ginfo[0].codepoint;
|
||||
|
||||
/* getting the same index indicates no substitution, */
|
||||
/* which means that the glyph isn't available in the feature */
|
||||
if ( in_idx == out_idx )
|
||||
{
|
||||
*codepoint = 0;
|
||||
*y_offset = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*codepoint = out_idx;
|
||||
*y_offset = gpos[0].y_offset;
|
||||
}
|
||||
|
||||
hb_buffer_destroy( buf );
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
if ( gcount > 1 )
|
||||
FT_TRACE1(( "af_get_char_index:"
|
||||
" input character mapped to multiple glyphs\n" ));
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
*codepoint = in_idx;
|
||||
*y_offset = 0;
|
||||
}
|
||||
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
||||
|
||||
#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ */
|
||||
|
||||
|
||||
FT_Error
|
||||
af_get_coverage( AF_FaceGlobals globals,
|
||||
AF_StyleClass style_class,
|
||||
FT_Byte* gstyles )
|
||||
{
|
||||
FT_UNUSED( globals );
|
||||
FT_UNUSED( style_class );
|
||||
FT_UNUSED( gstyles );
|
||||
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
||||
|
||||
FT_Error
|
||||
af_get_char_index( AF_StyleMetrics metrics,
|
||||
FT_ULong charcode,
|
||||
FT_ULong *codepoint,
|
||||
FT_Long *y_offset )
|
||||
{
|
||||
FT_Face face;
|
||||
|
||||
|
||||
if ( !metrics )
|
||||
return FT_THROW( Invalid_Argument );
|
||||
|
||||
face = metrics->globals->face;
|
||||
|
||||
*codepoint = FT_Get_Char_Index( face, charcode );
|
||||
*y_offset = 0;
|
||||
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,56 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* hbshim.h */
|
||||
/* */
|
||||
/* HarfBuzz interface for accessing OpenType features (specification). */
|
||||
/* */
|
||||
/* Copyright 2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __HBSHIM_H__
|
||||
#define __HBSHIM_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
|
||||
|
||||
#include <hb.h>
|
||||
#include <hb-ot.h>
|
||||
#include <hb-ft.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
FT_Error
|
||||
af_get_coverage( AF_FaceGlobals globals,
|
||||
AF_StyleClass style_class,
|
||||
FT_Byte* gstyles );
|
||||
|
||||
FT_Error
|
||||
af_get_char_index( AF_StyleMetrics metrics,
|
||||
FT_ULong charcode,
|
||||
FT_ULong *codepoint,
|
||||
FT_Long *y_offset );
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __HBSHIM_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -1,23 +0,0 @@
|
||||
#
|
||||
# FreeType 2 auto-fitter module definition
|
||||
#
|
||||
|
||||
|
||||
# Copyright 2003, 2004, 2005, 2006 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.
|
||||
|
||||
|
||||
FTMODULE_H_COMMANDS += AUTOFIT_MODULE
|
||||
|
||||
define AUTOFIT_MODULE
|
||||
$(OPEN_DRIVER) FT_Module_Class, autofit_module_class $(CLOSE_DRIVER)
|
||||
$(ECHO_DRIVER)autofit $(ECHO_DRIVER_DESC)automatic hinting module$(ECHO_DRIVER_DONE)
|
||||
endef
|
||||
|
||||
# EOF
|
||||
@@ -1,82 +0,0 @@
|
||||
#
|
||||
# FreeType 2 auto-fitter module configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright 2003-2007, 2011, 2013 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.
|
||||
|
||||
|
||||
# AUTOF driver directory
|
||||
#
|
||||
AUTOF_DIR := $(SRC_DIR)/autofit
|
||||
|
||||
|
||||
# compilation flags for the driver
|
||||
#
|
||||
AUTOF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(AUTOF_DIR))
|
||||
|
||||
|
||||
# AUTOF driver sources (i.e., C files)
|
||||
#
|
||||
AUTOF_DRV_SRC := $(AUTOF_DIR)/afangles.c \
|
||||
$(AUTOF_DIR)/afblue.c \
|
||||
$(AUTOF_DIR)/afcjk.c \
|
||||
$(AUTOF_DIR)/afdummy.c \
|
||||
$(AUTOF_DIR)/afglobal.c \
|
||||
$(AUTOF_DIR)/afhints.c \
|
||||
$(AUTOF_DIR)/afindic.c \
|
||||
$(AUTOF_DIR)/aflatin.c \
|
||||
$(AUTOF_DIR)/afloader.c \
|
||||
$(AUTOF_DIR)/afmodule.c \
|
||||
$(AUTOF_DIR)/afpic.c \
|
||||
$(AUTOF_DIR)/afwarp.c
|
||||
|
||||
# AUTOF driver headers
|
||||
#
|
||||
AUTOF_DRV_H := $(AUTOF_DRV_SRC:%c=%h) \
|
||||
$(AUTOF_DIR)/aferrors.h \
|
||||
$(AUTOF_DIR)/afscript.h \
|
||||
$(AUTOF_DIR)/aftypes.h \
|
||||
$(AUTOF_DIR)/afwrtsys.h
|
||||
|
||||
|
||||
# AUTOF driver object(s)
|
||||
#
|
||||
# AUTOF_DRV_OBJ_M is used during `multi' builds.
|
||||
# AUTOF_DRV_OBJ_S is used during `single' builds.
|
||||
#
|
||||
AUTOF_DRV_OBJ_M := $(AUTOF_DRV_SRC:$(AUTOF_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
AUTOF_DRV_OBJ_S := $(OBJ_DIR)/autofit.$O
|
||||
|
||||
# AUTOF driver source file for single build
|
||||
#
|
||||
AUTOF_DRV_SRC_S := $(AUTOF_DIR)/autofit.c
|
||||
|
||||
|
||||
# AUTOF driver - single object
|
||||
#
|
||||
$(AUTOF_DRV_OBJ_S): $(AUTOF_DRV_SRC_S) $(AUTOF_DRV_SRC) \
|
||||
$(FREETYPE_H) $(AUTOF_DRV_H)
|
||||
$(AUTOF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(AUTOF_DRV_SRC_S))
|
||||
|
||||
|
||||
# AUTOF driver - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(AUTOF_DIR)/%.c $(FREETYPE_H) $(AUTOF_DRV_H)
|
||||
$(AUTOF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(AUTOF_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(AUTOF_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
||||
+3
-3
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType position independent code services for base. */
|
||||
/* */
|
||||
/* Copyright 2009, 2012 by */
|
||||
/* Copyright 2009, 2012, 2013 by */
|
||||
/* Oran Agra and Mickey Gabel. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -35,7 +35,7 @@
|
||||
/* forward declaration of PIC init function from ftrfork.c */
|
||||
/* (not modularized) */
|
||||
void
|
||||
FT_Init_Table_raccess_guess_table( ft_raccess_guess_rec* record );
|
||||
FT_Init_Table_ft_raccess_guess_table( ft_raccess_guess_rec* record );
|
||||
#endif
|
||||
|
||||
/* forward declaration of PIC init functions from ftinit.c */
|
||||
@@ -92,7 +92,7 @@
|
||||
FT_Init_Class_ft_bitmap_glyph_class(
|
||||
&container->ft_bitmap_glyph_class );
|
||||
#ifdef FT_CONFIG_OPTION_MAC_FONTS
|
||||
FT_Init_Table_raccess_guess_table(
|
||||
FT_Init_Table_ft_raccess_guess_table(
|
||||
(ft_raccess_guess_rec*)&container->ft_raccess_guess_table );
|
||||
#endif
|
||||
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType utility functions for bitmaps (body). */
|
||||
/* */
|
||||
/* Copyright 2004-2009, 2011, 2013 by */
|
||||
/* Copyright 2004-2009, 2011, 2013, 2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -375,7 +375,7 @@
|
||||
}
|
||||
|
||||
|
||||
FT_Byte
|
||||
static FT_Byte
|
||||
ft_gray_for_premultiplied_srgb_bgra( const FT_Byte* bgra )
|
||||
{
|
||||
FT_Long a = bgra[3];
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Arithmetic computations (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2006, 2008, 2012-2013 by */
|
||||
/* Copyright 1996-2006, 2008, 2012-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -128,7 +128,7 @@
|
||||
}
|
||||
if ( z >= ( 1L << 1 ) )
|
||||
{
|
||||
z >>= 1;
|
||||
/* z >>= 1; */
|
||||
shift += 1;
|
||||
}
|
||||
|
||||
|
||||
+16
-6
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType private base classes (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2013 by */
|
||||
/* Copyright 1996-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -1801,9 +1801,10 @@
|
||||
if ( error )
|
||||
return error;
|
||||
|
||||
/* POST resources must be sorted to concatenate properly */
|
||||
error = FT_Raccess_Get_DataOffsets( library, stream,
|
||||
map_offset, rdara_pos,
|
||||
TTAG_POST,
|
||||
TTAG_POST, TRUE,
|
||||
&data_offsets, &count );
|
||||
if ( !error )
|
||||
{
|
||||
@@ -1816,9 +1817,11 @@
|
||||
return error;
|
||||
}
|
||||
|
||||
/* sfnt resources should not be sorted to preserve the face order by
|
||||
QuickDraw API */
|
||||
error = FT_Raccess_Get_DataOffsets( library, stream,
|
||||
map_offset, rdara_pos,
|
||||
TTAG_sfnt,
|
||||
TTAG_sfnt, FALSE,
|
||||
&data_offsets, &count );
|
||||
if ( !error )
|
||||
{
|
||||
@@ -3357,6 +3360,7 @@
|
||||
FT_UInt gindex = 0;
|
||||
|
||||
|
||||
/* only do something if we have a charmap, and we have glyphs at all */
|
||||
if ( face && face->charmap && face->num_glyphs )
|
||||
{
|
||||
gindex = FT_Get_Char_Index( face, 0 );
|
||||
@@ -3943,11 +3947,17 @@
|
||||
static void
|
||||
ft_remove_renderer( FT_Module module )
|
||||
{
|
||||
FT_Library library = module->library;
|
||||
FT_Memory memory = library->memory;
|
||||
FT_Library library;
|
||||
FT_Memory memory;
|
||||
FT_ListNode node;
|
||||
|
||||
|
||||
library = module->library;
|
||||
if ( !library )
|
||||
return;
|
||||
|
||||
memory = library->memory;
|
||||
|
||||
node = FT_List_Find( &library->renderers, module );
|
||||
if ( node )
|
||||
{
|
||||
@@ -4463,7 +4473,7 @@
|
||||
}
|
||||
|
||||
|
||||
FT_Error
|
||||
static FT_Error
|
||||
ft_property_do( FT_Library library,
|
||||
const FT_String* module_name,
|
||||
const FT_String* property_name,
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType outline management (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2008, 2010, 2012-2013 by */
|
||||
/* Copyright 1996-2008, 2010, 2012-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -128,7 +128,7 @@
|
||||
v_start.x = ( v_start.x + v_last.x ) / 2;
|
||||
v_start.y = ( v_start.y + v_last.y ) / 2;
|
||||
|
||||
v_last = v_start;
|
||||
/* v_last = v_start; */
|
||||
}
|
||||
point--;
|
||||
tags--;
|
||||
|
||||
+22
-4
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Embedded resource forks accessor (body). */
|
||||
/* */
|
||||
/* Copyright 2004-2010, 2013 by */
|
||||
/* Copyright 2004-2010, 2013, 2014 by */
|
||||
/* Masatake YAMATO and Redhat K.K. */
|
||||
/* */
|
||||
/* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are */
|
||||
@@ -29,6 +29,7 @@
|
||||
#include FT_INTERNAL_STREAM_H
|
||||
#include FT_INTERNAL_RFORK_H
|
||||
#include "basepic.h"
|
||||
#include "ftbase.h"
|
||||
|
||||
#undef FT_COMPONENT
|
||||
#define FT_COMPONENT trace_raccess
|
||||
@@ -151,6 +152,7 @@
|
||||
FT_Long map_offset,
|
||||
FT_Long rdata_pos,
|
||||
FT_Long tag,
|
||||
FT_Bool sort_by_res_id,
|
||||
FT_Long **offsets,
|
||||
FT_Long *count )
|
||||
{
|
||||
@@ -163,6 +165,7 @@
|
||||
FT_RFork_Ref *ref = NULL;
|
||||
|
||||
|
||||
FT_TRACE3(( "\n" ));
|
||||
error = FT_Stream_Seek( stream, map_offset );
|
||||
if ( error )
|
||||
return error;
|
||||
@@ -183,6 +186,8 @@
|
||||
(char)( 0xff & ( tag_internal >> 16 ) ),
|
||||
(char)( 0xff & ( tag_internal >> 8 ) ),
|
||||
(char)( 0xff & ( tag_internal >> 0 ) ) ));
|
||||
FT_TRACE3(( " : subcount=%d, suboffset=0x%04x\n",
|
||||
subcnt, rpos ));
|
||||
|
||||
if ( tag_internal == tag )
|
||||
{
|
||||
@@ -208,11 +213,24 @@
|
||||
goto Exit;
|
||||
|
||||
ref[j].offset = temp & 0xFFFFFFL;
|
||||
FT_TRACE3(( " [%d]:"
|
||||
" resource_id=0x%04x, offset=0x%08x\n",
|
||||
j, ref[j].res_id, ref[j].offset ));
|
||||
}
|
||||
|
||||
ft_qsort( ref, *count, sizeof ( FT_RFork_Ref ),
|
||||
( int(*)(const void*, const void*) )
|
||||
ft_raccess_sort_ref_by_id );
|
||||
if (sort_by_res_id)
|
||||
{
|
||||
ft_qsort( ref, *count, sizeof ( FT_RFork_Ref ),
|
||||
( int(*)(const void*, const void*) )
|
||||
ft_raccess_sort_ref_by_id );
|
||||
|
||||
FT_TRACE3(( " -- sort resources by their ids --\n" ));
|
||||
for ( j = 0; j < *count; ++ j ) {
|
||||
FT_TRACE3(( " [%d]:"
|
||||
" resource_id=0x%04x, offset=0x%08x\n",
|
||||
j, ref[j].res_id, ref[j].offset ));
|
||||
}
|
||||
}
|
||||
|
||||
if ( FT_NEW_ARRAY( offsets_internal, *count ) )
|
||||
goto Exit;
|
||||
|
||||
-99
@@ -1,99 +0,0 @@
|
||||
#
|
||||
# FreeType 2 base layer configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2002-2009, 2013 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.
|
||||
|
||||
|
||||
# It sets the following variables which are used by the master Makefile
|
||||
# after the call:
|
||||
#
|
||||
# BASE_OBJ_S: The single-object base layer.
|
||||
# BASE_OBJ_M: A list of all objects for a multiple-objects build.
|
||||
# BASE_EXT_OBJ: A list of base layer extensions, i.e., components found
|
||||
# in `src/base' which are not compiled within the base
|
||||
# layer proper.
|
||||
|
||||
|
||||
BASE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SRC_DIR)/base)
|
||||
|
||||
|
||||
# Base layer sources
|
||||
#
|
||||
# ftsystem, ftinit, and ftdebug are handled by freetype.mk
|
||||
#
|
||||
# All files listed here should be included in `ftbase.c' (for a `single'
|
||||
# build).
|
||||
#
|
||||
BASE_SRC := $(BASE_DIR)/ftadvanc.c \
|
||||
$(BASE_DIR)/ftcalc.c \
|
||||
$(BASE_DIR)/ftdbgmem.c \
|
||||
$(BASE_DIR)/ftgloadr.c \
|
||||
$(BASE_DIR)/ftobjs.c \
|
||||
$(BASE_DIR)/ftoutln.c \
|
||||
$(BASE_DIR)/ftrfork.c \
|
||||
$(BASE_DIR)/ftsnames.c \
|
||||
$(BASE_DIR)/ftstream.c \
|
||||
$(BASE_DIR)/fttrigon.c \
|
||||
$(BASE_DIR)/ftutil.c
|
||||
|
||||
|
||||
ifneq ($(ftmac_c),)
|
||||
BASE_SRC += $(BASE_DIR)/$(ftmac_c)
|
||||
endif
|
||||
|
||||
# for simplicity, we also handle `md5.c' (which gets included by `ftobjs.h')
|
||||
BASE_H := $(BASE_DIR)/ftbase.h \
|
||||
$(BASE_DIR)/md5.c \
|
||||
$(BASE_DIR)/md5.h
|
||||
|
||||
# Base layer `extensions' sources
|
||||
#
|
||||
# An extension is added to the library file as a separate object. It is
|
||||
# then linked to the final executable only if one of its symbols is used by
|
||||
# the application.
|
||||
#
|
||||
BASE_EXT_SRC := $(patsubst %,$(BASE_DIR)/%,$(BASE_EXTENSIONS))
|
||||
|
||||
# Default extensions objects
|
||||
#
|
||||
BASE_EXT_OBJ := $(BASE_EXT_SRC:$(BASE_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
|
||||
|
||||
# Base layer object(s)
|
||||
#
|
||||
# BASE_OBJ_M is used during `multi' builds (each base source file compiles
|
||||
# to a single object file).
|
||||
#
|
||||
# BASE_OBJ_S is used during `single' builds (the whole base layer is
|
||||
# compiled as a single object file using ftbase.c).
|
||||
#
|
||||
BASE_OBJ_M := $(BASE_SRC:$(BASE_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
BASE_OBJ_S := $(OBJ_DIR)/ftbase.$O
|
||||
|
||||
# Base layer root source file for single build
|
||||
#
|
||||
BASE_SRC_S := $(BASE_DIR)/ftbase.c
|
||||
|
||||
|
||||
# Base layer - single object build
|
||||
#
|
||||
$(BASE_OBJ_S): $(BASE_SRC_S) $(BASE_SRC) $(FREETYPE_H) $(BASE_H)
|
||||
$(BASE_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(BASE_SRC_S))
|
||||
|
||||
|
||||
# Multiple objects build + extensions
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(BASE_DIR)/%.c $(FREETYPE_H) $(BASE_H)
|
||||
$(BASE_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# EOF
|
||||
+5
-6
@@ -2,7 +2,7 @@
|
||||
|
||||
FreeType font driver for bdf files
|
||||
|
||||
Copyright (C) 2001-2008, 2011, 2013 by
|
||||
Copyright (C) 2001-2008, 2011, 2013, 2014 by
|
||||
Francesco Zappa Nardelli
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@@ -243,8 +243,6 @@ THE SOFTWARE.
|
||||
!( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) )
|
||||
strings[0] = (char *)(prop->value.atom);
|
||||
|
||||
len = 0;
|
||||
|
||||
for ( len = 0, nn = 0; nn < 4; nn++ )
|
||||
{
|
||||
lengths[nn] = 0;
|
||||
@@ -400,9 +398,10 @@ THE SOFTWARE.
|
||||
|
||||
bdfface->num_faces = 1;
|
||||
bdfface->face_index = 0;
|
||||
bdfface->face_flags = FT_FACE_FLAG_FIXED_SIZES |
|
||||
FT_FACE_FLAG_HORIZONTAL |
|
||||
FT_FACE_FLAG_FAST_GLYPHS;
|
||||
|
||||
bdfface->face_flags |= FT_FACE_FLAG_FIXED_SIZES |
|
||||
FT_FACE_FLAG_HORIZONTAL |
|
||||
FT_FACE_FLAG_FAST_GLYPHS;
|
||||
|
||||
prop = bdf_get_font_property( font, "SPACING" );
|
||||
if ( prop && prop->format == BDF_ATOM &&
|
||||
|
||||
+28
-30
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000 Computing Research Labs, New Mexico State University
|
||||
* Copyright 2001-2013
|
||||
* Copyright 2001-2014
|
||||
* Francesco Zappa Nardelli
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
@@ -691,7 +691,6 @@
|
||||
lineno = 1;
|
||||
buf[0] = 0;
|
||||
start = 0;
|
||||
end = 0;
|
||||
avail = 0;
|
||||
cursor = 0;
|
||||
refill = 1;
|
||||
@@ -1409,7 +1408,7 @@
|
||||
|
||||
/* If the property happens to be a comment, then it doesn't need */
|
||||
/* to be added to the internal hash table. */
|
||||
if ( ft_memcmp( name, "COMMENT", 7 ) != 0 )
|
||||
if ( ft_strncmp( name, "COMMENT", 7 ) != 0 )
|
||||
{
|
||||
/* Add the property to the font property table. */
|
||||
error = hash_insert( fp->name,
|
||||
@@ -1427,13 +1426,13 @@
|
||||
/* FONT_ASCENT and FONT_DESCENT need to be assigned if they are */
|
||||
/* present, and the SPACING property should override the default */
|
||||
/* spacing. */
|
||||
if ( ft_memcmp( name, "DEFAULT_CHAR", 12 ) == 0 )
|
||||
if ( ft_strncmp( name, "DEFAULT_CHAR", 12 ) == 0 )
|
||||
font->default_char = fp->value.l;
|
||||
else if ( ft_memcmp( name, "FONT_ASCENT", 11 ) == 0 )
|
||||
else if ( ft_strncmp( name, "FONT_ASCENT", 11 ) == 0 )
|
||||
font->font_ascent = fp->value.l;
|
||||
else if ( ft_memcmp( name, "FONT_DESCENT", 12 ) == 0 )
|
||||
else if ( ft_strncmp( name, "FONT_DESCENT", 12 ) == 0 )
|
||||
font->font_descent = fp->value.l;
|
||||
else if ( ft_memcmp( name, "SPACING", 7 ) == 0 )
|
||||
else if ( ft_strncmp( name, "SPACING", 7 ) == 0 )
|
||||
{
|
||||
if ( !fp->value.atom )
|
||||
{
|
||||
@@ -1491,7 +1490,7 @@
|
||||
memory = font->memory;
|
||||
|
||||
/* Check for a comment. */
|
||||
if ( ft_memcmp( line, "COMMENT", 7 ) == 0 )
|
||||
if ( ft_strncmp( line, "COMMENT", 7 ) == 0 )
|
||||
{
|
||||
linelen -= 7;
|
||||
|
||||
@@ -1508,7 +1507,7 @@
|
||||
/* The very first thing expected is the number of glyphs. */
|
||||
if ( !( p->flags & _BDF_GLYPHS ) )
|
||||
{
|
||||
if ( ft_memcmp( line, "CHARS", 5 ) != 0 )
|
||||
if ( ft_strncmp( line, "CHARS", 5 ) != 0 )
|
||||
{
|
||||
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "CHARS" ));
|
||||
error = FT_THROW( Missing_Chars_Field );
|
||||
@@ -1542,7 +1541,7 @@
|
||||
}
|
||||
|
||||
/* Check for the ENDFONT field. */
|
||||
if ( ft_memcmp( line, "ENDFONT", 7 ) == 0 )
|
||||
if ( ft_strncmp( line, "ENDFONT", 7 ) == 0 )
|
||||
{
|
||||
/* Sort the glyphs by encoding. */
|
||||
ft_qsort( (char *)font->glyphs,
|
||||
@@ -1556,7 +1555,7 @@
|
||||
}
|
||||
|
||||
/* Check for the ENDCHAR field. */
|
||||
if ( ft_memcmp( line, "ENDCHAR", 7 ) == 0 )
|
||||
if ( ft_strncmp( line, "ENDCHAR", 7 ) == 0 )
|
||||
{
|
||||
p->glyph_enc = 0;
|
||||
p->flags &= ~_BDF_GLYPH_BITS;
|
||||
@@ -1572,7 +1571,7 @@
|
||||
goto Exit;
|
||||
|
||||
/* Check for the STARTCHAR field. */
|
||||
if ( ft_memcmp( line, "STARTCHAR", 9 ) == 0 )
|
||||
if ( ft_strncmp( line, "STARTCHAR", 9 ) == 0 )
|
||||
{
|
||||
/* Set the character name in the parse info first until the */
|
||||
/* encoding can be checked for an unencoded character. */
|
||||
@@ -1606,7 +1605,7 @@
|
||||
}
|
||||
|
||||
/* Check for the ENCODING field. */
|
||||
if ( ft_memcmp( line, "ENCODING", 8 ) == 0 )
|
||||
if ( ft_strncmp( line, "ENCODING", 8 ) == 0 )
|
||||
{
|
||||
if ( !( p->flags & _BDF_GLYPH ) )
|
||||
{
|
||||
@@ -1792,7 +1791,7 @@
|
||||
}
|
||||
|
||||
/* Expect the SWIDTH (scalable width) field next. */
|
||||
if ( ft_memcmp( line, "SWIDTH", 6 ) == 0 )
|
||||
if ( ft_strncmp( line, "SWIDTH", 6 ) == 0 )
|
||||
{
|
||||
if ( !( p->flags & _BDF_ENCODING ) )
|
||||
goto Missing_Encoding;
|
||||
@@ -1808,7 +1807,7 @@
|
||||
}
|
||||
|
||||
/* Expect the DWIDTH (scalable width) field next. */
|
||||
if ( ft_memcmp( line, "DWIDTH", 6 ) == 0 )
|
||||
if ( ft_strncmp( line, "DWIDTH", 6 ) == 0 )
|
||||
{
|
||||
if ( !( p->flags & _BDF_ENCODING ) )
|
||||
goto Missing_Encoding;
|
||||
@@ -1836,7 +1835,7 @@
|
||||
}
|
||||
|
||||
/* Expect the BBX field next. */
|
||||
if ( ft_memcmp( line, "BBX", 3 ) == 0 )
|
||||
if ( ft_strncmp( line, "BBX", 3 ) == 0 )
|
||||
{
|
||||
if ( !( p->flags & _BDF_ENCODING ) )
|
||||
goto Missing_Encoding;
|
||||
@@ -1904,7 +1903,7 @@
|
||||
}
|
||||
|
||||
/* And finally, gather up the bitmap. */
|
||||
if ( ft_memcmp( line, "BITMAP", 6 ) == 0 )
|
||||
if ( ft_strncmp( line, "BITMAP", 6 ) == 0 )
|
||||
{
|
||||
unsigned long bitmap_size;
|
||||
|
||||
@@ -1979,7 +1978,7 @@
|
||||
p = (_bdf_parse_t *) client_data;
|
||||
|
||||
/* Check for the end of the properties. */
|
||||
if ( ft_memcmp( line, "ENDPROPERTIES", 13 ) == 0 )
|
||||
if ( ft_strncmp( line, "ENDPROPERTIES", 13 ) == 0 )
|
||||
{
|
||||
/* If the FONT_ASCENT or FONT_DESCENT properties have not been */
|
||||
/* encountered yet, then make sure they are added as properties and */
|
||||
@@ -2020,12 +2019,12 @@
|
||||
}
|
||||
|
||||
/* Ignore the _XFREE86_GLYPH_RANGES properties. */
|
||||
if ( ft_memcmp( line, "_XFREE86_GLYPH_RANGES", 21 ) == 0 )
|
||||
if ( ft_strncmp( line, "_XFREE86_GLYPH_RANGES", 21 ) == 0 )
|
||||
goto Exit;
|
||||
|
||||
/* Handle COMMENT fields and properties in a special way to preserve */
|
||||
/* the spacing. */
|
||||
if ( ft_memcmp( line, "COMMENT", 7 ) == 0 )
|
||||
if ( ft_strncmp( line, "COMMENT", 7 ) == 0 )
|
||||
{
|
||||
name = value = line;
|
||||
value += 7;
|
||||
@@ -2089,7 +2088,7 @@
|
||||
|
||||
/* Check for a comment. This is done to handle those fonts that have */
|
||||
/* comments before the STARTFONT line for some reason. */
|
||||
if ( ft_memcmp( line, "COMMENT", 7 ) == 0 )
|
||||
if ( ft_strncmp( line, "COMMENT", 7 ) == 0 )
|
||||
{
|
||||
if ( p->opts->keep_comments != 0 && p->font != 0 )
|
||||
{
|
||||
@@ -2115,7 +2114,7 @@
|
||||
{
|
||||
memory = p->memory;
|
||||
|
||||
if ( ft_memcmp( line, "STARTFONT", 9 ) != 0 )
|
||||
if ( ft_strncmp( line, "STARTFONT", 9 ) != 0 )
|
||||
{
|
||||
/* we don't emit an error message since this code gets */
|
||||
/* explicitly caught one level higher */
|
||||
@@ -2163,7 +2162,7 @@
|
||||
}
|
||||
|
||||
/* Check for the start of the properties. */
|
||||
if ( ft_memcmp( line, "STARTPROPERTIES", 15 ) == 0 )
|
||||
if ( ft_strncmp( line, "STARTPROPERTIES", 15 ) == 0 )
|
||||
{
|
||||
if ( !( p->flags & _BDF_FONT_BBX ) )
|
||||
{
|
||||
@@ -2192,7 +2191,7 @@
|
||||
}
|
||||
|
||||
/* Check for the FONTBOUNDINGBOX field. */
|
||||
if ( ft_memcmp( line, "FONTBOUNDINGBOX", 15 ) == 0 )
|
||||
if ( ft_strncmp( line, "FONTBOUNDINGBOX", 15 ) == 0 )
|
||||
{
|
||||
if ( !( p->flags & _BDF_SIZE ) )
|
||||
{
|
||||
@@ -2223,7 +2222,7 @@
|
||||
}
|
||||
|
||||
/* The next thing to check for is the FONT field. */
|
||||
if ( ft_memcmp( line, "FONT", 4 ) == 0 )
|
||||
if ( ft_strncmp( line, "FONT", 4 ) == 0 )
|
||||
{
|
||||
error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
|
||||
if ( error )
|
||||
@@ -2258,7 +2257,7 @@
|
||||
}
|
||||
|
||||
/* Check for the SIZE field. */
|
||||
if ( ft_memcmp( line, "SIZE", 4 ) == 0 )
|
||||
if ( ft_strncmp( line, "SIZE", 4 ) == 0 )
|
||||
{
|
||||
if ( !( p->flags & _BDF_FONT_NAME ) )
|
||||
{
|
||||
@@ -2312,7 +2311,7 @@
|
||||
}
|
||||
|
||||
/* Check for the CHARS field -- font properties are optional */
|
||||
if ( ft_memcmp( line, "CHARS", 5 ) == 0 )
|
||||
if ( ft_strncmp( line, "CHARS", 5 ) == 0 )
|
||||
{
|
||||
char nbuf[128];
|
||||
|
||||
@@ -2376,8 +2375,8 @@
|
||||
unsigned long lineno = 0; /* make compiler happy */
|
||||
_bdf_parse_t *p = NULL;
|
||||
|
||||
FT_Memory memory = extmemory;
|
||||
FT_Error error = FT_Err_Ok;
|
||||
FT_Memory memory = extmemory; /* needed for FT_NEW */
|
||||
FT_Error error = FT_Err_Ok;
|
||||
|
||||
|
||||
if ( FT_NEW( p ) )
|
||||
@@ -2399,7 +2398,6 @@
|
||||
{
|
||||
/* If the font is not proportional, set the font's monowidth */
|
||||
/* field to the width of the font bounding box. */
|
||||
memory = p->font->memory;
|
||||
|
||||
if ( p->font->spacing != BDF_PROPORTIONAL )
|
||||
p->font->monowidth = p->font->bbx.width;
|
||||
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
#
|
||||
# FreeType 2 BDF module definition
|
||||
#
|
||||
|
||||
# Copyright 2001, 2002, 2006 by
|
||||
# Francesco Zappa Nardelli
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
|
||||
FTMODULE_H_COMMANDS += BDF_DRIVER
|
||||
|
||||
define BDF_DRIVER
|
||||
$(OPEN_DRIVER) FT_Driver_ClassRec, bdf_driver_class $(CLOSE_DRIVER)
|
||||
$(ECHO_DRIVER)bdf $(ECHO_DRIVER_DESC)bdf bitmap fonts$(ECHO_DRIVER_DONE)
|
||||
endef
|
||||
|
||||
# EOF
|
||||
-81
@@ -1,81 +0,0 @@
|
||||
#
|
||||
# FreeType 2 bdf driver configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2008 by
|
||||
# Francesco Zappa Nardelli
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
|
||||
|
||||
|
||||
# bdf driver directory
|
||||
#
|
||||
BDF_DIR := $(SRC_DIR)/bdf
|
||||
|
||||
|
||||
BDF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(BDF_DIR))
|
||||
|
||||
|
||||
# bdf driver sources (i.e., C files)
|
||||
#
|
||||
BDF_DRV_SRC := $(BDF_DIR)/bdflib.c \
|
||||
$(BDF_DIR)/bdfdrivr.c
|
||||
|
||||
|
||||
# bdf driver headers
|
||||
#
|
||||
BDF_DRV_H := $(BDF_DIR)/bdf.h \
|
||||
$(BDF_DIR)/bdfdrivr.h \
|
||||
$(BDF_DIR)/bdferror.h
|
||||
|
||||
# bdf driver object(s)
|
||||
#
|
||||
# BDF_DRV_OBJ_M is used during `multi' builds
|
||||
# BDF_DRV_OBJ_S is used during `single' builds
|
||||
#
|
||||
BDF_DRV_OBJ_M := $(BDF_DRV_SRC:$(BDF_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
BDF_DRV_OBJ_S := $(OBJ_DIR)/bdf.$O
|
||||
|
||||
# bdf driver source file for single build
|
||||
#
|
||||
BDF_DRV_SRC_S := $(BDF_DIR)/bdf.c
|
||||
|
||||
|
||||
# bdf driver - single object
|
||||
#
|
||||
$(BDF_DRV_OBJ_S): $(BDF_DRV_SRC_S) $(BDF_DRV_SRC) $(FREETYPE_H) $(BDF_DRV_H)
|
||||
$(BDF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(BDF_DRV_SRC_S))
|
||||
|
||||
|
||||
# bdf driver - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(BDF_DIR)/%.c $(FREETYPE_H) $(BDF_DRV_H)
|
||||
$(BDF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(BDF_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(BDF_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
||||
@@ -1,63 +0,0 @@
|
||||
#
|
||||
# FreeType 2 BZIP2 support configuration rules
|
||||
#
|
||||
|
||||
# Copyright 2010 by
|
||||
# Joel Klinghed.
|
||||
#
|
||||
# Based on src/lzw/rules.mk, Copyright 2004-2006 by
|
||||
# Albert Chin-A-Young.
|
||||
#
|
||||
# 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.
|
||||
|
||||
|
||||
# BZIP2 driver directory
|
||||
#
|
||||
BZIP2_DIR := $(SRC_DIR)/bzip2
|
||||
|
||||
|
||||
# compilation flags for the driver
|
||||
#
|
||||
BZIP2_COMPILE := $(FT_COMPILE)
|
||||
|
||||
|
||||
# BZIP2 support sources (i.e., C files)
|
||||
#
|
||||
BZIP2_DRV_SRC := $(BZIP2_DIR)/ftbzip2.c
|
||||
|
||||
# BZIP2 driver object(s)
|
||||
#
|
||||
# BZIP2_DRV_OBJ_M is used during `multi' builds
|
||||
# BZIP2_DRV_OBJ_S is used during `single' builds
|
||||
#
|
||||
BZIP2_DRV_OBJ_M := $(OBJ_DIR)/ftbzip2.$O
|
||||
BZIP2_DRV_OBJ_S := $(OBJ_DIR)/ftbzip2.$O
|
||||
|
||||
# BZIP2 support source file for single build
|
||||
#
|
||||
BZIP2_DRV_SRC_S := $(BZIP2_DIR)/ftbzip2.c
|
||||
|
||||
|
||||
# BZIP2 support - single object
|
||||
#
|
||||
$(BZIP2_DRV_OBJ_S): $(BZIP2_DRV_SRC_S) $(BZIP2_DRV_SRC) $(FREETYPE_H) $(BZIP2_DRV_H)
|
||||
$(BZIP2_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(BZIP2_DRV_SRC_S))
|
||||
|
||||
|
||||
# BZIP2 support - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(BZIP2_DIR)/%.c $(FREETYPE_H) $(BZIP2_DRV_H)
|
||||
$(BZIP2_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(BZIP2_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(BZIP2_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
||||
@@ -1,80 +0,0 @@
|
||||
#
|
||||
# FreeType 2 Cache configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright 2000, 2001, 2003, 2004, 2006, 2008 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
# and distributed under the terms of the FreeType project license,
|
||||
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
|
||||
# indicate that you have read the license and understand and accept it
|
||||
# fully.
|
||||
|
||||
|
||||
# Cache driver directory
|
||||
#
|
||||
CACHE_DIR := $(SRC_DIR)/cache
|
||||
|
||||
# compilation flags for the driver
|
||||
#
|
||||
CACHE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CACHE_DIR))
|
||||
|
||||
|
||||
# Cache driver sources (i.e., C files)
|
||||
#
|
||||
CACHE_DRV_SRC := $(CACHE_DIR)/ftcbasic.c \
|
||||
$(CACHE_DIR)/ftccache.c \
|
||||
$(CACHE_DIR)/ftccmap.c \
|
||||
$(CACHE_DIR)/ftcglyph.c \
|
||||
$(CACHE_DIR)/ftcimage.c \
|
||||
$(CACHE_DIR)/ftcmanag.c \
|
||||
$(CACHE_DIR)/ftcmru.c \
|
||||
$(CACHE_DIR)/ftcsbits.c
|
||||
|
||||
# Cache driver headers
|
||||
#
|
||||
CACHE_DRV_H := $(CACHE_DIR)/ftccache.h \
|
||||
$(CACHE_DIR)/ftccback.h \
|
||||
$(CACHE_DIR)/ftcerror.h \
|
||||
$(CACHE_DIR)/ftcglyph.h \
|
||||
$(CACHE_DIR)/ftcimage.h \
|
||||
$(CACHE_DIR)/ftcmanag.h \
|
||||
$(CACHE_DIR)/ftcmru.h \
|
||||
$(CACHE_DIR)/ftcsbits.h
|
||||
|
||||
|
||||
# Cache driver object(s)
|
||||
#
|
||||
# CACHE_DRV_OBJ_M is used during `multi' builds.
|
||||
# CACHE_DRV_OBJ_S is used during `single' builds.
|
||||
#
|
||||
CACHE_DRV_OBJ_M := $(CACHE_DRV_SRC:$(CACHE_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
CACHE_DRV_OBJ_S := $(OBJ_DIR)/ftcache.$O
|
||||
|
||||
# Cache driver source file for single build
|
||||
#
|
||||
CACHE_DRV_SRC_S := $(CACHE_DIR)/ftcache.c
|
||||
|
||||
|
||||
# Cache driver - single object
|
||||
#
|
||||
$(CACHE_DRV_OBJ_S): $(CACHE_DRV_SRC_S) $(CACHE_DRV_SRC) \
|
||||
$(FREETYPE_H) $(CACHE_DRV_H)
|
||||
$(CACHE_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(CACHE_DRV_SRC_S))
|
||||
|
||||
|
||||
# Cache driver - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(CACHE_DIR)/%.c $(FREETYPE_H) $(CACHE_DRV_H)
|
||||
$(CACHE_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(CACHE_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(CACHE_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
||||
+5
-6
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Adobe's code for handling Blue Zones (body). */
|
||||
/* */
|
||||
/* Copyright 2009-2013 Adobe Systems Incorporated. */
|
||||
/* Copyright 2009-2014 Adobe Systems Incorporated. */
|
||||
/* */
|
||||
/* This software, and all works of authorship, whether in source or */
|
||||
/* object code form as indicated by the copyright notice(s) included */
|
||||
@@ -408,11 +408,10 @@
|
||||
/* Note: constant changed from 0.5 to 0.6 to avoid a problem with */
|
||||
/* 10ppem Arial */
|
||||
|
||||
blues->boost = FT_MulFix(
|
||||
cf2_floatToFixed( .6 ),
|
||||
( cf2_intToFixed( 1 ) -
|
||||
FT_DivFix( blues->scale,
|
||||
blues->blueScale ) ) );
|
||||
blues->boost = cf2_floatToFixed( .6 ) -
|
||||
FT_MulDiv( cf2_floatToFixed ( .6 ),
|
||||
blues->scale,
|
||||
blues->blueScale );
|
||||
if ( blues->boost > 0x7FFF )
|
||||
{
|
||||
/* boost must remain less than 0.5, or baseline could go negative */
|
||||
|
||||
+13
-8
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Adobe's code for font instances (body). */
|
||||
/* */
|
||||
/* Copyright 2007-2013 Adobe Systems Incorporated. */
|
||||
/* Copyright 2007-2014 Adobe Systems Incorporated. */
|
||||
/* */
|
||||
/* This software, and all works of authorship, whether in source or */
|
||||
/* object code form as indicated by the copyright notice(s) included */
|
||||
@@ -167,7 +167,7 @@
|
||||
if ( !xdelta )
|
||||
goto Try_x3;
|
||||
|
||||
*darkenAmount = FT_MulFix( x, FT_DivFix( ydelta, xdelta ) ) +
|
||||
*darkenAmount = FT_MulDiv( x, ydelta, xdelta ) +
|
||||
FT_DivFix( cf2_intToFixed( y1 ), ppem );
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@
|
||||
if ( !xdelta )
|
||||
goto Try_x4;
|
||||
|
||||
*darkenAmount = FT_MulFix( x, FT_DivFix( ydelta, xdelta ) ) +
|
||||
*darkenAmount = FT_MulDiv( x, ydelta, xdelta ) +
|
||||
FT_DivFix( cf2_intToFixed( y2 ), ppem );
|
||||
}
|
||||
}
|
||||
@@ -202,7 +202,7 @@
|
||||
if ( !xdelta )
|
||||
goto Use_y4;
|
||||
|
||||
*darkenAmount = FT_MulFix( x, FT_DivFix( ydelta, xdelta ) ) +
|
||||
*darkenAmount = FT_MulDiv( x, ydelta, xdelta ) +
|
||||
FT_DivFix( cf2_intToFixed( y3 ), ppem );
|
||||
}
|
||||
}
|
||||
@@ -233,13 +233,14 @@
|
||||
/* pointer to parsed font object */
|
||||
CFF_Decoder* decoder = font->decoder;
|
||||
|
||||
FT_Bool needExtraSetup;
|
||||
FT_Bool needExtraSetup = FALSE;
|
||||
|
||||
/* character space units */
|
||||
CF2_Fixed boldenX = font->syntheticEmboldeningAmountX;
|
||||
CF2_Fixed boldenY = font->syntheticEmboldeningAmountY;
|
||||
|
||||
CF2_Fixed ppem;
|
||||
CFF_SubFont subFont;
|
||||
CF2_Fixed ppem;
|
||||
|
||||
|
||||
/* clear previous error */
|
||||
@@ -247,8 +248,12 @@
|
||||
|
||||
/* if a CID fontDict has changed, we need to recompute some cached */
|
||||
/* data */
|
||||
needExtraSetup =
|
||||
(FT_Bool)( font->lastSubfont != cf2_getSubfont( decoder ) );
|
||||
subFont = cf2_getSubfont( decoder );
|
||||
if ( font->lastSubfont != subFont )
|
||||
{
|
||||
font->lastSubfont = subFont;
|
||||
needExtraSetup = TRUE;
|
||||
}
|
||||
|
||||
/* if ppem has changed, we need to recompute some cached data */
|
||||
/* note: because of CID font matrix concatenation, ppem and transform */
|
||||
|
||||
+27
-12
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType Glue Component to Adobe's Interpreter (body). */
|
||||
/* */
|
||||
/* Copyright 2013 Adobe Systems Incorporated. */
|
||||
/* Copyright 2013-2014 Adobe Systems Incorporated. */
|
||||
/* */
|
||||
/* This software, and all works of authorship, whether in source or */
|
||||
/* object code form as indicated by the copyright notice(s) included */
|
||||
@@ -61,7 +61,9 @@
|
||||
|
||||
FT_ASSERT( unitsPerEm > 0 );
|
||||
|
||||
FT_ASSERT( transform->a > 0 && transform->d > 0 );
|
||||
if ( transform->a <= 0 || transform->d <= 0 )
|
||||
return FT_THROW( Invalid_Size_Handle );
|
||||
|
||||
FT_ASSERT( transform->b == 0 && transform->c == 0 );
|
||||
FT_ASSERT( transform->tx == 0 && transform->ty == 0 );
|
||||
|
||||
@@ -236,10 +238,8 @@
|
||||
|
||||
if ( *hinted )
|
||||
{
|
||||
*x_scale = FT_DivFix( decoder->builder.glyph->x_scale,
|
||||
cf2_intToFixed( 64 ) );
|
||||
*y_scale = FT_DivFix( decoder->builder.glyph->y_scale,
|
||||
cf2_intToFixed( 64 ) );
|
||||
*x_scale = ( decoder->builder.glyph->x_scale + 32 ) / 64;
|
||||
*y_scale = ( decoder->builder.glyph->y_scale + 32 ) / 64;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -357,9 +357,12 @@
|
||||
/* also get units per em to validate scale */
|
||||
font->unitsPerEm = (CF2_Int)cf2_getUnitsPerEm( decoder );
|
||||
|
||||
error2 = cf2_checkTransform( &transform, font->unitsPerEm );
|
||||
if ( error2 )
|
||||
return error2;
|
||||
if ( scaled )
|
||||
{
|
||||
error2 = cf2_checkTransform( &transform, font->unitsPerEm );
|
||||
if ( error2 )
|
||||
return error2;
|
||||
}
|
||||
|
||||
error2 = cf2_getGlyphOutline( font, &buf, &transform, &glyphWidth );
|
||||
if ( error2 )
|
||||
@@ -389,8 +392,16 @@
|
||||
FT_ASSERT( decoder &&
|
||||
decoder->builder.face &&
|
||||
decoder->builder.face->root.size );
|
||||
FT_ASSERT( decoder->builder.face->root.size->metrics.y_ppem );
|
||||
|
||||
/*
|
||||
* Note that `y_ppem' can be zero if there wasn't a call to
|
||||
* `FT_Set_Char_Size' or something similar. However, this isn't a
|
||||
* problem since we come to this place in the code only if
|
||||
* FT_LOAD_NO_SCALE is set (the other case gets caught by
|
||||
* `cf2_checkTransform'). The ppem value is needed to compute the stem
|
||||
* darkening, which is disabled for getting the unscaled outline.
|
||||
*
|
||||
*/
|
||||
return cf2_intToFixed(
|
||||
decoder->builder.face->root.size->metrics.y_ppem );
|
||||
}
|
||||
@@ -508,7 +519,7 @@
|
||||
CF2_UInt idx,
|
||||
CF2_Buffer buf )
|
||||
{
|
||||
FT_ASSERT( decoder && decoder->globals );
|
||||
FT_ASSERT( decoder );
|
||||
|
||||
FT_ZERO( buf );
|
||||
|
||||
@@ -516,6 +527,8 @@
|
||||
if ( idx >= decoder->num_globals )
|
||||
return TRUE; /* error */
|
||||
|
||||
FT_ASSERT( decoder->globals );
|
||||
|
||||
buf->start =
|
||||
buf->ptr = decoder->globals[idx];
|
||||
buf->end = decoder->globals[idx + 1];
|
||||
@@ -581,7 +594,7 @@
|
||||
CF2_UInt idx,
|
||||
CF2_Buffer buf )
|
||||
{
|
||||
FT_ASSERT( decoder && decoder->locals );
|
||||
FT_ASSERT( decoder );
|
||||
|
||||
FT_ZERO( buf );
|
||||
|
||||
@@ -589,6 +602,8 @@
|
||||
if ( idx >= decoder->num_locals )
|
||||
return TRUE; /* error */
|
||||
|
||||
FT_ASSERT( decoder->locals );
|
||||
|
||||
buf->start =
|
||||
buf->ptr = decoder->locals[idx];
|
||||
buf->end = decoder->locals[idx + 1];
|
||||
|
||||
+3
-1
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Adobe's code for handling CFF hints (body). */
|
||||
/* */
|
||||
/* Copyright 2007-2013 Adobe Systems Incorporated. */
|
||||
/* Copyright 2007-2014 Adobe Systems Incorporated. */
|
||||
/* */
|
||||
/* This software, and all works of authorship, whether in source or */
|
||||
/* object code form as indicated by the copyright notice(s) included */
|
||||
@@ -781,6 +781,8 @@
|
||||
cf2_hintmask_setAll( hintMask,
|
||||
cf2_arrstack_size( hStemHintArray ) +
|
||||
cf2_arrstack_size( vStemHintArray ) );
|
||||
if ( !cf2_hintmask_isValid( hintMask ) )
|
||||
return; /* too many stem hints */
|
||||
}
|
||||
|
||||
/* begin by clearing the map */
|
||||
|
||||
+11
-4
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* OpenType and CFF data/program tables loader (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2013 by */
|
||||
/* Copyright 1996-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -689,6 +689,13 @@
|
||||
if ( FT_READ_USHORT( num_ranges ) )
|
||||
goto Exit;
|
||||
|
||||
if ( !num_ranges )
|
||||
{
|
||||
FT_TRACE0(( "CFF_Load_FD_Select: empty FDSelect array\n" ));
|
||||
error = FT_THROW( Invalid_File_Format );
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
fdselect->data_size = num_ranges * 3 + 2;
|
||||
|
||||
Load_Data:
|
||||
@@ -719,7 +726,7 @@
|
||||
break;
|
||||
|
||||
case 3:
|
||||
/* first, compare to cache */
|
||||
/* first, compare to the cache */
|
||||
if ( (FT_UInt)( glyph_index - fdselect->cache_first ) <
|
||||
fdselect->cache_count )
|
||||
{
|
||||
@@ -727,7 +734,7 @@
|
||||
break;
|
||||
}
|
||||
|
||||
/* then, lookup the ranges array */
|
||||
/* then, look up the ranges array */
|
||||
{
|
||||
FT_Byte* p = fdselect->data;
|
||||
FT_Byte* p_limit = p + fdselect->data_size;
|
||||
@@ -750,7 +757,7 @@
|
||||
|
||||
/* update cache */
|
||||
fdselect->cache_first = first;
|
||||
fdselect->cache_count = limit-first;
|
||||
fdselect->cache_count = limit - first;
|
||||
fdselect->cache_fd = fd2;
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-1
@@ -866,7 +866,7 @@
|
||||
flags |= FT_FACE_FLAG_KERNING;
|
||||
#endif
|
||||
|
||||
cffface->face_flags = flags;
|
||||
cffface->face_flags |= flags;
|
||||
|
||||
/*******************************************************************/
|
||||
/* */
|
||||
|
||||
+1
-5
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* CFF token stream parser (body) */
|
||||
/* */
|
||||
/* Copyright 1996-2004, 2007-2013 by */
|
||||
/* Copyright 1996-2004, 2007-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -66,7 +66,6 @@
|
||||
goto Bad;
|
||||
|
||||
val = (FT_Short)( ( (FT_UShort)p[0] << 8 ) | p[1] );
|
||||
p += 2;
|
||||
}
|
||||
else if ( v == 29 )
|
||||
{
|
||||
@@ -77,7 +76,6 @@
|
||||
( (FT_ULong)p[1] << 16 ) |
|
||||
( (FT_ULong)p[2] << 8 ) |
|
||||
(FT_ULong)p[3] );
|
||||
p += 4;
|
||||
}
|
||||
else if ( v < 247 )
|
||||
{
|
||||
@@ -89,7 +87,6 @@
|
||||
goto Bad;
|
||||
|
||||
val = ( v - 247 ) * 256 + p[0] + 108;
|
||||
p++;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -97,7 +94,6 @@
|
||||
goto Bad;
|
||||
|
||||
val = -( v - 251 ) * 256 - p[0] - 108;
|
||||
p++;
|
||||
}
|
||||
|
||||
Exit:
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
#
|
||||
# FreeType 2 CFF module definition
|
||||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2006 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.
|
||||
|
||||
|
||||
FTMODULE_H_COMMANDS += CFF_DRIVER
|
||||
|
||||
define CFF_DRIVER
|
||||
$(OPEN_DRIVER) FT_Driver_ClassRec, cff_driver_class $(CLOSE_DRIVER)
|
||||
$(ECHO_DRIVER)cff $(ECHO_DRIVER_DESC)OpenType fonts with extension *.otf$(ECHO_DRIVER_DONE)
|
||||
endef
|
||||
|
||||
# EOF
|
||||
-86
@@ -1,86 +0,0 @@
|
||||
#
|
||||
# FreeType 2 OpenType/CFF driver configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright 1996-2001, 2003, 2011, 2013 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.
|
||||
|
||||
|
||||
# OpenType driver directory
|
||||
#
|
||||
CFF_DIR := $(SRC_DIR)/cff
|
||||
|
||||
|
||||
CFF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CFF_DIR))
|
||||
|
||||
|
||||
# CFF driver sources (i.e., C files)
|
||||
#
|
||||
CFF_DRV_SRC := $(CFF_DIR)/cffcmap.c \
|
||||
$(CFF_DIR)/cffdrivr.c \
|
||||
$(CFF_DIR)/cffgload.c \
|
||||
$(CFF_DIR)/cffload.c \
|
||||
$(CFF_DIR)/cffobjs.c \
|
||||
$(CFF_DIR)/cffparse.c \
|
||||
$(CFF_DIR)/cffpic.c \
|
||||
$(CFF_DIR)/cf2arrst.c \
|
||||
$(CFF_DIR)/cf2blues.c \
|
||||
$(CFF_DIR)/cf2error.c \
|
||||
$(CFF_DIR)/cf2font.c \
|
||||
$(CFF_DIR)/cf2ft.c \
|
||||
$(CFF_DIR)/cf2hints.c \
|
||||
$(CFF_DIR)/cf2intrp.c \
|
||||
$(CFF_DIR)/cf2read.c \
|
||||
$(CFF_DIR)/cf2stack.c
|
||||
|
||||
|
||||
# CFF driver headers
|
||||
#
|
||||
CFF_DRV_H := $(CFF_DRV_SRC:%.c=%.h) \
|
||||
$(CFF_DIR)/cfferrs.h \
|
||||
$(CFF_DIR)/cfftoken.h \
|
||||
$(CFF_DIR)/cfftypes.h \
|
||||
$(CFF_DIR)/cf2fixed.h \
|
||||
$(CFF_DIR)/cf2glue.h \
|
||||
$(CFF_DIR)/cf2types.h
|
||||
|
||||
|
||||
# CFF driver object(s)
|
||||
#
|
||||
# CFF_DRV_OBJ_M is used during `multi' builds
|
||||
# CFF_DRV_OBJ_S is used during `single' builds
|
||||
#
|
||||
CFF_DRV_OBJ_M := $(CFF_DRV_SRC:$(CFF_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
CFF_DRV_OBJ_S := $(OBJ_DIR)/cff.$O
|
||||
|
||||
# CFF driver source file for single build
|
||||
#
|
||||
CFF_DRV_SRC_S := $(CFF_DIR)/cff.c
|
||||
|
||||
|
||||
# CFF driver - single object
|
||||
#
|
||||
$(CFF_DRV_OBJ_S): $(CFF_DRV_SRC_S) $(CFF_DRV_SRC) $(FREETYPE_H) $(CFF_DRV_H)
|
||||
$(CFF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(CFF_DRV_SRC_S))
|
||||
|
||||
|
||||
# CFF driver - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(CFF_DIR)/%.c $(FREETYPE_H) $(CFF_DRV_H)
|
||||
$(CFF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(CFF_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(CFF_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
||||
+14
-5
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* CID-keyed Type1 font loader (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2006, 2009, 2011-2013 by */
|
||||
/* Copyright 1996-2006, 2009, 2011-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -160,16 +160,26 @@
|
||||
{
|
||||
FT_Matrix* matrix;
|
||||
FT_Vector* offset;
|
||||
FT_Int result;
|
||||
|
||||
|
||||
dict = face->cid.font_dicts + parser->num_dict;
|
||||
matrix = &dict->font_matrix;
|
||||
offset = &dict->font_offset;
|
||||
|
||||
(void)cid_parser_to_fixed_array( parser, 6, temp, 3 );
|
||||
result = cid_parser_to_fixed_array( parser, 6, temp, 3 );
|
||||
|
||||
if ( result < 6 )
|
||||
return FT_THROW( Invalid_File_Format );
|
||||
|
||||
temp_scale = FT_ABS( temp[3] );
|
||||
|
||||
if ( temp_scale == 0 )
|
||||
{
|
||||
FT_ERROR(( "cid_parse_font_matrix: invalid font matrix\n" ));
|
||||
return FT_THROW( Invalid_File_Format );
|
||||
}
|
||||
|
||||
/* Set Units per EM based on FontMatrix values. We set the value to */
|
||||
/* 1000 / temp_scale, because temp_scale was already multiplied by */
|
||||
/* 1000 (in t1_tofixed, from psobjs.c). */
|
||||
@@ -184,7 +194,7 @@
|
||||
temp[2] = FT_DivFix( temp[2], temp_scale );
|
||||
temp[4] = FT_DivFix( temp[4], temp_scale );
|
||||
temp[5] = FT_DivFix( temp[5], temp_scale );
|
||||
temp[3] = 0x10000L;
|
||||
temp[3] = temp[3] < 0 ? -0x10000L : 0x10000L;
|
||||
}
|
||||
|
||||
matrix->xx = temp[0];
|
||||
@@ -197,8 +207,7 @@
|
||||
offset->y = temp[5] >> 16;
|
||||
}
|
||||
|
||||
return FT_Err_Ok; /* this is a callback function; */
|
||||
/* we must return an error code */
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
-3
@@ -355,9 +355,10 @@
|
||||
cidface->num_charmaps = 0;
|
||||
|
||||
cidface->face_index = face_index;
|
||||
cidface->face_flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */
|
||||
FT_FACE_FLAG_HORIZONTAL | /* horizontal data */
|
||||
FT_FACE_FLAG_HINTER; /* has native hinter */
|
||||
|
||||
cidface->face_flags |= FT_FACE_FLAG_SCALABLE | /* scalable outlines */
|
||||
FT_FACE_FLAG_HORIZONTAL | /* horizontal data */
|
||||
FT_FACE_FLAG_HINTER; /* has native hinter */
|
||||
|
||||
if ( info->is_fixed_pitch )
|
||||
cidface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
|
||||
|
||||
+1
-3
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* CID-keyed Type1 parser (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2007, 2009, 2013 by */
|
||||
/* Copyright 1996-2007, 2009, 2013, 2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -178,8 +178,6 @@
|
||||
if ( ft_strncmp( (char*)arg1, "(Hex)", 5 ) == 0 )
|
||||
parser->binary_length = ft_atol( (const char *)arg2 );
|
||||
|
||||
limit = parser->root.limit;
|
||||
cur = parser->root.cursor;
|
||||
goto Exit;
|
||||
}
|
||||
else if ( cur[1] == 's' && ft_strncmp( (char*)cur, "/sfnts", 6 ) == 0 )
|
||||
|
||||
+11
-11
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* CID-keyed Type1 parser (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2004, 2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -92,26 +92,26 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
#define cid_parser_skip_spaces( p ) \
|
||||
#define cid_parser_skip_spaces( p ) \
|
||||
(p)->root.funcs.skip_spaces( &(p)->root )
|
||||
#define cid_parser_skip_PS_token( p ) \
|
||||
#define cid_parser_skip_PS_token( p ) \
|
||||
(p)->root.funcs.skip_PS_token( &(p)->root )
|
||||
|
||||
#define cid_parser_to_int( p ) (p)->root.funcs.to_int( &(p)->root )
|
||||
#define cid_parser_to_fixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t )
|
||||
#define cid_parser_to_int( p ) (p)->root.funcs.to_int( &(p)->root )
|
||||
#define cid_parser_to_fixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t )
|
||||
|
||||
#define cid_parser_to_coord_array( p, m, c ) \
|
||||
#define cid_parser_to_coord_array( p, m, c ) \
|
||||
(p)->root.funcs.to_coord_array( &(p)->root, m, c )
|
||||
#define cid_parser_to_fixed_array( p, m, f, t ) \
|
||||
#define cid_parser_to_fixed_array( p, m, f, t ) \
|
||||
(p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )
|
||||
#define cid_parser_to_token( p, t ) \
|
||||
#define cid_parser_to_token( p, t ) \
|
||||
(p)->root.funcs.to_token( &(p)->root, t )
|
||||
#define cid_parser_to_token_array( p, t, m, c ) \
|
||||
#define cid_parser_to_token_array( p, t, m, c ) \
|
||||
(p)->root.funcs.to_token_array( &(p)->root, t, m, c )
|
||||
|
||||
#define cid_parser_load_field( p, f, o ) \
|
||||
#define cid_parser_load_field( p, f, o ) \
|
||||
(p)->root.funcs.load_field( &(p)->root, f, o, 0, 0 )
|
||||
#define cid_parser_load_field_table( p, f, o ) \
|
||||
#define cid_parser_load_field_table( p, f, o ) \
|
||||
(p)->root.funcs.load_field_table( &(p)->root, f, o, 0, 0 )
|
||||
|
||||
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
#
|
||||
# FreeType 2 CID module definition
|
||||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2006 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.
|
||||
|
||||
|
||||
FTMODULE_H_COMMANDS += TYPE1CID_DRIVER
|
||||
|
||||
define TYPE1CID_DRIVER
|
||||
$(OPEN_DRIVER) FT_Driver_ClassRec, t1cid_driver_class $(CLOSE_DRIVER)
|
||||
$(ECHO_DRIVER)cid $(ECHO_DRIVER_DESC)Postscript CID-keyed fonts, no known extension$(ECHO_DRIVER_DONE)
|
||||
endef
|
||||
|
||||
# EOF
|
||||
-70
@@ -1,70 +0,0 @@
|
||||
#
|
||||
# FreeType 2 CID driver configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2001, 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.
|
||||
|
||||
|
||||
# CID driver directory
|
||||
#
|
||||
CID_DIR := $(SRC_DIR)/cid
|
||||
|
||||
|
||||
CID_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CID_DIR))
|
||||
|
||||
|
||||
# CID driver sources (i.e., C files)
|
||||
#
|
||||
CID_DRV_SRC := $(CID_DIR)/cidparse.c \
|
||||
$(CID_DIR)/cidload.c \
|
||||
$(CID_DIR)/cidriver.c \
|
||||
$(CID_DIR)/cidgload.c \
|
||||
$(CID_DIR)/cidobjs.c
|
||||
|
||||
# CID driver headers
|
||||
#
|
||||
CID_DRV_H := $(CID_DRV_SRC:%.c=%.h) \
|
||||
$(CID_DIR)/cidtoken.h \
|
||||
$(CID_DIR)/ciderrs.h
|
||||
|
||||
|
||||
# CID driver object(s)
|
||||
#
|
||||
# CID_DRV_OBJ_M is used during `multi' builds
|
||||
# CID_DRV_OBJ_S is used during `single' builds
|
||||
#
|
||||
CID_DRV_OBJ_M := $(CID_DRV_SRC:$(CID_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
CID_DRV_OBJ_S := $(OBJ_DIR)/type1cid.$O
|
||||
|
||||
# CID driver source file for single build
|
||||
#
|
||||
CID_DRV_SRC_S := $(CID_DIR)/type1cid.c
|
||||
|
||||
|
||||
# CID driver - single object
|
||||
#
|
||||
$(CID_DRV_OBJ_S): $(CID_DRV_SRC_S) $(CID_DRV_SRC) $(FREETYPE_H) $(CID_DRV_H)
|
||||
$(CID_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(CID_DRV_SRC_S))
|
||||
|
||||
|
||||
# CID driver - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(CID_DIR)/%.c $(FREETYPE_H) $(CID_DRV_H)
|
||||
$(CID_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(CID_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(CID_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
||||
@@ -1,23 +0,0 @@
|
||||
#
|
||||
# FreeType 2 gxvalid module definition
|
||||
#
|
||||
|
||||
# Copyright 2004, 2005, 2006
|
||||
# by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
|
||||
# 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.
|
||||
|
||||
|
||||
FTMODULE_H_COMMANDS += GXVALID_MODULE
|
||||
|
||||
define GXVALID_MODULE
|
||||
$(OPEN_DRIVER) FT_Module_Class, gxv_module_class $(CLOSE_DRIVER)
|
||||
$(ECHO_DRIVER)gxvalid $(ECHO_DRIVER_DESC)TrueTypeGX/AAT validation module$(ECHO_DRIVER_DONE)
|
||||
endef
|
||||
|
||||
# EOF
|
||||
@@ -1,94 +0,0 @@
|
||||
#
|
||||
# FreeType 2 TrueTypeGX/AAT validation driver configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
|
||||
# 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.
|
||||
|
||||
|
||||
# GXV driver directory
|
||||
#
|
||||
GXV_DIR := $(SRC_DIR)/gxvalid
|
||||
|
||||
|
||||
# compilation flags for the driver
|
||||
#
|
||||
GXV_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(GXV_DIR))
|
||||
|
||||
|
||||
# GXV driver sources (i.e., C files)
|
||||
#
|
||||
GXV_DRV_SRC := $(GXV_DIR)/gxvcommn.c \
|
||||
$(GXV_DIR)/gxvfeat.c \
|
||||
$(GXV_DIR)/gxvbsln.c \
|
||||
$(GXV_DIR)/gxvtrak.c \
|
||||
$(GXV_DIR)/gxvopbd.c \
|
||||
$(GXV_DIR)/gxvprop.c \
|
||||
$(GXV_DIR)/gxvjust.c \
|
||||
$(GXV_DIR)/gxvmort.c \
|
||||
$(GXV_DIR)/gxvmort0.c \
|
||||
$(GXV_DIR)/gxvmort1.c \
|
||||
$(GXV_DIR)/gxvmort2.c \
|
||||
$(GXV_DIR)/gxvmort4.c \
|
||||
$(GXV_DIR)/gxvmort5.c \
|
||||
$(GXV_DIR)/gxvmorx.c \
|
||||
$(GXV_DIR)/gxvmorx0.c \
|
||||
$(GXV_DIR)/gxvmorx1.c \
|
||||
$(GXV_DIR)/gxvmorx2.c \
|
||||
$(GXV_DIR)/gxvmorx4.c \
|
||||
$(GXV_DIR)/gxvmorx5.c \
|
||||
$(GXV_DIR)/gxvlcar.c \
|
||||
$(GXV_DIR)/gxvkern.c \
|
||||
$(GXV_DIR)/gxvmod.c
|
||||
|
||||
# GXV driver headers
|
||||
#
|
||||
GXV_DRV_H := $(GXV_DIR)/gxvalid.h \
|
||||
$(GXV_DIR)/gxverror.h \
|
||||
$(GXV_DIR)/gxvcommn.h \
|
||||
$(GXV_DIR)/gxvfeat.h \
|
||||
$(GXV_DIR)/gxvmod.h \
|
||||
$(GXV_DIR)/gxvmort.h \
|
||||
$(GXV_DIR)/gxvmorx.h
|
||||
|
||||
|
||||
# GXV driver object(s)
|
||||
#
|
||||
# GXV_DRV_OBJ_M is used during `multi' builds.
|
||||
# GXV_DRV_OBJ_S is used during `single' builds.
|
||||
#
|
||||
GXV_DRV_OBJ_M := $(GXV_DRV_SRC:$(GXV_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
GXV_DRV_OBJ_S := $(OBJ_DIR)/gxvalid.$O
|
||||
|
||||
# GXV driver source file for single build
|
||||
#
|
||||
GXV_DRV_SRC_S := $(GXV_DIR)/gxvalid.c
|
||||
|
||||
|
||||
# GXV driver - single object
|
||||
#
|
||||
$(GXV_DRV_OBJ_S): $(GXV_DRV_SRC_S) $(GXV_DRV_SRC) \
|
||||
$(FREETYPE_H) $(GXV_DRV_H)
|
||||
$(GXV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(GXV_DRV_SRC_S))
|
||||
|
||||
|
||||
# GXV driver - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(GXV_DIR)/%.c $(FREETYPE_H) $(GXV_DRV_H)
|
||||
$(GXV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(GXV_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(GXV_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
||||
-78
@@ -1,78 +0,0 @@
|
||||
#
|
||||
# FreeType 2 GZip support configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright 2002, 2003, 2013 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.
|
||||
|
||||
|
||||
# gzip driver directory
|
||||
#
|
||||
GZIP_DIR := $(SRC_DIR)/gzip
|
||||
|
||||
|
||||
# compilation flags for the driver
|
||||
#
|
||||
ifeq ($(SYSTEM_ZLIB),)
|
||||
GZIP_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(GZIP_DIR))
|
||||
else
|
||||
GZIP_COMPILE := $(FT_COMPILE)
|
||||
endif
|
||||
|
||||
|
||||
# gzip support sources
|
||||
#
|
||||
# All source and header files get loaded by `ftgzip.c' only if SYTEM_ZLIB is
|
||||
# not defined (regardless whether we have a `single' or a `multi' build).
|
||||
# However, it doesn't harm if we add everything as a dependency
|
||||
# unconditionally.
|
||||
#
|
||||
GZIP_DRV_SRCS := $(GZIP_DIR)/adler32.c \
|
||||
$(GZIP_DIR)/infblock.c \
|
||||
$(GZIP_DIR)/infblock.h \
|
||||
$(GZIP_DIR)/infcodes.c \
|
||||
$(GZIP_DIR)/infcodes.h \
|
||||
$(GZIP_DIR)/inffixed.h \
|
||||
$(GZIP_DIR)/inflate.c \
|
||||
$(GZIP_DIR)/inftrees.c \
|
||||
$(GZIP_DIR)/inftrees.h \
|
||||
$(GZIP_DIR)/infutil.c \
|
||||
$(GZIP_DIR)/infutil.h \
|
||||
$(GZIP_DIR)/zconf.h \
|
||||
$(GZIP_DIR)/zlib.h \
|
||||
$(GZIP_DIR)/zutil.c \
|
||||
$(GZIP_DIR)/zutil.h
|
||||
|
||||
|
||||
# gzip driver object(s)
|
||||
#
|
||||
# GZIP_DRV_OBJ is used during both `single' and `multi' builds
|
||||
#
|
||||
GZIP_DRV_OBJ := $(OBJ_DIR)/ftgzip.$O
|
||||
|
||||
|
||||
# gzip main source file
|
||||
#
|
||||
GZIP_DRV_SRC := $(GZIP_DIR)/ftgzip.c
|
||||
|
||||
|
||||
# gzip support - object
|
||||
#
|
||||
$(GZIP_DRV_OBJ): $(GZIP_DRV_SRC) $(GZIP_DRV_SRCS) $(FREETYPE_H)
|
||||
$(GZIP_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(GZIP_DRV_SRC))
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(GZIP_DRV_OBJ)
|
||||
DRV_OBJS_M += $(GZIP_DRV_OBJ)
|
||||
|
||||
|
||||
# EOF
|
||||
-70
@@ -1,70 +0,0 @@
|
||||
#
|
||||
# FreeType 2 LZW support configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright 2004, 2005, 2006 by
|
||||
# Albert Chin-A-Young.
|
||||
#
|
||||
# Based on src/lzw/rules.mk, Copyright 2002 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.
|
||||
|
||||
|
||||
# LZW driver directory
|
||||
#
|
||||
LZW_DIR := $(SRC_DIR)/lzw
|
||||
|
||||
|
||||
# compilation flags for the driver
|
||||
#
|
||||
LZW_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(LZW_DIR))
|
||||
|
||||
|
||||
# LZW support sources (i.e., C files)
|
||||
#
|
||||
LZW_DRV_SRC := $(LZW_DIR)/ftlzw.c
|
||||
|
||||
# LZW support headers
|
||||
#
|
||||
LZW_DRV_H := $(LZW_DIR)/ftzopen.h \
|
||||
$(LZW_DIR)/ftzopen.c
|
||||
|
||||
|
||||
# LZW driver object(s)
|
||||
#
|
||||
# LZW_DRV_OBJ_M is used during `multi' builds
|
||||
# LZW_DRV_OBJ_S is used during `single' builds
|
||||
#
|
||||
LZW_DRV_OBJ_M := $(OBJ_DIR)/ftlzw.$O
|
||||
LZW_DRV_OBJ_S := $(OBJ_DIR)/ftlzw.$O
|
||||
|
||||
# LZW support source file for single build
|
||||
#
|
||||
LZW_DRV_SRC_S := $(LZW_DIR)/ftlzw.c
|
||||
|
||||
|
||||
# LZW support - single object
|
||||
#
|
||||
$(LZW_DRV_OBJ_S): $(LZW_DRV_SRC_S) $(LZW_DRV_SRC) $(FREETYPE_H) $(LZW_DRV_H)
|
||||
$(LZW_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(LZW_DRV_SRC_S))
|
||||
|
||||
|
||||
# LZW support - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(LZW_DIR)/%.c $(FREETYPE_H) $(LZW_DRV_H)
|
||||
$(LZW_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(LZW_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(LZW_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
||||
@@ -1,23 +0,0 @@
|
||||
#
|
||||
# FreeType 2 otvalid module definition
|
||||
#
|
||||
|
||||
|
||||
# Copyright 2004, 2006 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.
|
||||
|
||||
|
||||
FTMODULE_H_COMMANDS += OTVALID_MODULE
|
||||
|
||||
define OTVALID_MODULE
|
||||
$(OPEN_DRIVER) FT_Module_Class, otv_module_class $(CLOSE_DRIVER)
|
||||
$(ECHO_DRIVER)otvalid $(ECHO_DRIVER_DESC)OpenType validation module$(ECHO_DRIVER_DONE)
|
||||
endef
|
||||
|
||||
# EOF
|
||||
@@ -1,78 +0,0 @@
|
||||
#
|
||||
# FreeType 2 OpenType validation driver configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright 2004, 2007 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
# and distributed under the terms of the FreeType project license,
|
||||
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
|
||||
# indicate that you have read the license and understand and accept it
|
||||
# fully.
|
||||
|
||||
|
||||
# OTV driver directory
|
||||
#
|
||||
OTV_DIR := $(SRC_DIR)/otvalid
|
||||
|
||||
|
||||
# compilation flags for the driver
|
||||
#
|
||||
OTV_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(OTV_DIR))
|
||||
|
||||
|
||||
# OTV driver sources (i.e., C files)
|
||||
#
|
||||
OTV_DRV_SRC := $(OTV_DIR)/otvbase.c \
|
||||
$(OTV_DIR)/otvcommn.c \
|
||||
$(OTV_DIR)/otvgdef.c \
|
||||
$(OTV_DIR)/otvgpos.c \
|
||||
$(OTV_DIR)/otvgsub.c \
|
||||
$(OTV_DIR)/otvjstf.c \
|
||||
$(OTV_DIR)/otvmath.c \
|
||||
$(OTV_DIR)/otvmod.c
|
||||
|
||||
# OTV driver headers
|
||||
#
|
||||
OTV_DRV_H := $(OTV_DIR)/otvalid.h \
|
||||
$(OTV_DIR)/otvcommn.h \
|
||||
$(OTV_DIR)/otverror.h \
|
||||
$(OTV_DIR)/otvgpos.h \
|
||||
$(OTV_DIR)/otvmod.h
|
||||
|
||||
|
||||
# OTV driver object(s)
|
||||
#
|
||||
# OTV_DRV_OBJ_M is used during `multi' builds.
|
||||
# OTV_DRV_OBJ_S is used during `single' builds.
|
||||
#
|
||||
OTV_DRV_OBJ_M := $(OTV_DRV_SRC:$(OTV_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
OTV_DRV_OBJ_S := $(OBJ_DIR)/otvalid.$O
|
||||
|
||||
# OTV driver source file for single build
|
||||
#
|
||||
OTV_DRV_SRC_S := $(OTV_DIR)/otvalid.c
|
||||
|
||||
|
||||
# OTV driver - single object
|
||||
#
|
||||
$(OTV_DRV_OBJ_S): $(OTV_DRV_SRC_S) $(OTV_DRV_SRC) \
|
||||
$(FREETYPE_H) $(OTV_DRV_H)
|
||||
$(OTV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(OTV_DRV_SRC_S))
|
||||
|
||||
|
||||
# OTV driver - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(OTV_DIR)/%.c $(FREETYPE_H) $(OTV_DRV_H)
|
||||
$(OTV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(OTV_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(OTV_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
#
|
||||
# FreeType 2 PCF module definition
|
||||
#
|
||||
|
||||
# Copyright 2000, 2006 by
|
||||
# Francesco Zappa Nardelli
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
|
||||
FTMODULE_H_COMMANDS += PCF_DRIVER
|
||||
|
||||
define PCF_DRIVER
|
||||
$(OPEN_DRIVER) FT_Driver_ClassRec, pcf_driver_class $(CLOSE_DRIVER)
|
||||
$(ECHO_DRIVER)pcf $(ECHO_DRIVER_DESC)pcf bitmap fonts$(ECHO_DRIVER_DONE)
|
||||
endef
|
||||
|
||||
# EOF
|
||||
+4
-3
@@ -1153,9 +1153,10 @@ THE SOFTWARE.
|
||||
|
||||
root->num_faces = 1;
|
||||
root->face_index = 0;
|
||||
root->face_flags = FT_FACE_FLAG_FIXED_SIZES |
|
||||
FT_FACE_FLAG_HORIZONTAL |
|
||||
FT_FACE_FLAG_FAST_GLYPHS;
|
||||
|
||||
root->face_flags |= FT_FACE_FLAG_FIXED_SIZES |
|
||||
FT_FACE_FLAG_HORIZONTAL |
|
||||
FT_FACE_FLAG_FAST_GLYPHS;
|
||||
|
||||
if ( face->accel.constantWidth )
|
||||
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
|
||||
|
||||
-79
@@ -1,79 +0,0 @@
|
||||
#
|
||||
# FreeType 2 pcf driver configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright (C) 2000, 2001, 2003, 2008 by
|
||||
# Francesco Zappa Nardelli
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
|
||||
# pcf driver directory
|
||||
#
|
||||
PCF_DIR := $(SRC_DIR)/pcf
|
||||
|
||||
|
||||
PCF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PCF_DIR))
|
||||
|
||||
|
||||
# pcf driver sources (i.e., C files)
|
||||
#
|
||||
PCF_DRV_SRC := $(PCF_DIR)/pcfdrivr.c \
|
||||
$(PCF_DIR)/pcfread.c \
|
||||
$(PCF_DIR)/pcfutil.c
|
||||
|
||||
# pcf driver headers
|
||||
#
|
||||
PCF_DRV_H := $(PCF_DRV_SRC:%.c=%.h) \
|
||||
$(PCF_DIR)/pcf.h \
|
||||
$(PCF_DIR)/pcferror.h
|
||||
|
||||
# pcf driver object(s)
|
||||
#
|
||||
# PCF_DRV_OBJ_M is used during `multi' builds
|
||||
# PCF_DRV_OBJ_S is used during `single' builds
|
||||
#
|
||||
PCF_DRV_OBJ_M := $(PCF_DRV_SRC:$(PCF_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
PCF_DRV_OBJ_S := $(OBJ_DIR)/pcf.$O
|
||||
|
||||
# pcf driver source file for single build
|
||||
#
|
||||
PCF_DRV_SRC_S := $(PCF_DIR)/pcf.c
|
||||
|
||||
|
||||
# pcf driver - single object
|
||||
#
|
||||
$(PCF_DRV_OBJ_S): $(PCF_DRV_SRC_S) $(PCF_DRV_SRC) $(FREETYPE_H) $(PCF_DRV_H)
|
||||
$(PCF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PCF_DRV_SRC_S))
|
||||
|
||||
|
||||
# pcf driver - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(PCF_DIR)/%.c $(FREETYPE_H) $(PCF_DRV_H)
|
||||
$(PCF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(PCF_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(PCF_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
#
|
||||
# FreeType 2 PFR module definition
|
||||
#
|
||||
|
||||
|
||||
# Copyright 2002, 2006 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.
|
||||
|
||||
|
||||
FTMODULE_H_COMMANDS += PFR_DRIVER
|
||||
|
||||
define PFR_DRIVER
|
||||
$(OPEN_DRIVER) FT_Driver_ClassRec, pfr_driver_class $(CLOSE_DRIVER)
|
||||
$(ECHO_DRIVER)pfr $(ECHO_DRIVER_DESC)PFR/TrueDoc font files with extension *.pfr$(ECHO_DRIVER_DONE)
|
||||
endef
|
||||
|
||||
# EOF
|
||||
+1
-2
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType PFR loader (body). */
|
||||
/* */
|
||||
/* Copyright 2002-2005, 2007, 2009, 2010, 2013 by */
|
||||
/* Copyright 2002-2005, 2007, 2009, 2010, 2013, 2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -813,7 +813,6 @@
|
||||
phy_font->ascent = PFR_NEXT_SHORT( q );
|
||||
phy_font->descent = PFR_NEXT_SHORT( q );
|
||||
phy_font->leading = PFR_NEXT_SHORT( q );
|
||||
q += 16;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
|
||||
+2
-1
@@ -137,7 +137,8 @@
|
||||
|
||||
pfrface->face_index = face_index;
|
||||
pfrface->num_glyphs = phy_font->num_chars + 1;
|
||||
pfrface->face_flags = FT_FACE_FLAG_SCALABLE;
|
||||
|
||||
pfrface->face_flags |= FT_FACE_FLAG_SCALABLE;
|
||||
|
||||
/* if all characters point to the same gps_offset 0, we */
|
||||
/* assume that the font only contains bitmaps */
|
||||
|
||||
-73
@@ -1,73 +0,0 @@
|
||||
#
|
||||
# FreeType 2 PFR driver configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright 2002, 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.
|
||||
|
||||
|
||||
# pfr driver directory
|
||||
#
|
||||
PFR_DIR := $(SRC_DIR)/pfr
|
||||
|
||||
|
||||
# compilation flags for the driver
|
||||
#
|
||||
PFR_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PFR_DIR))
|
||||
|
||||
|
||||
# pfr driver sources (i.e., C files)
|
||||
#
|
||||
PFR_DRV_SRC := $(PFR_DIR)/pfrload.c \
|
||||
$(PFR_DIR)/pfrgload.c \
|
||||
$(PFR_DIR)/pfrcmap.c \
|
||||
$(PFR_DIR)/pfrdrivr.c \
|
||||
$(PFR_DIR)/pfrsbit.c \
|
||||
$(PFR_DIR)/pfrobjs.c
|
||||
|
||||
# pfr driver headers
|
||||
#
|
||||
PFR_DRV_H := $(PFR_DRV_SRC:%.c=%.h) \
|
||||
$(PFR_DIR)/pfrerror.h \
|
||||
$(PFR_DIR)/pfrtypes.h
|
||||
|
||||
|
||||
# Pfr driver object(s)
|
||||
#
|
||||
# PFR_DRV_OBJ_M is used during `multi' builds
|
||||
# PFR_DRV_OBJ_S is used during `single' builds
|
||||
#
|
||||
PFR_DRV_OBJ_M := $(PFR_DRV_SRC:$(PFR_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
PFR_DRV_OBJ_S := $(OBJ_DIR)/pfr.$O
|
||||
|
||||
# pfr driver source file for single build
|
||||
#
|
||||
PFR_DRV_SRC_S := $(PFR_DIR)/pfr.c
|
||||
|
||||
|
||||
# pfr driver - single object
|
||||
#
|
||||
$(PFR_DRV_OBJ_S): $(PFR_DRV_SRC_S) $(PFR_DRV_SRC) $(FREETYPE_H) $(PFR_DRV_H)
|
||||
$(PFR_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PFR_DRV_SRC_S))
|
||||
|
||||
|
||||
# pfr driver - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(PFR_DIR)/%.c $(FREETYPE_H) $(PFR_DRV_H)
|
||||
$(PFR_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(PFR_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(PFR_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
||||
@@ -1,23 +0,0 @@
|
||||
#
|
||||
# FreeType 2 PSaux module definition
|
||||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2006 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.
|
||||
|
||||
|
||||
FTMODULE_H_COMMANDS += PSAUX_MODULE
|
||||
|
||||
define PSAUX_MODULE
|
||||
$(OPEN_DRIVER) FT_Module_Class, psaux_module_class $(CLOSE_DRIVER)
|
||||
$(ECHO_DRIVER)psaux $(ECHO_DRIVER_DESC)Postscript Type 1 & Type 2 helper module$(ECHO_DRIVER_DONE)
|
||||
endef
|
||||
|
||||
# EOF
|
||||
+5
-3
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auxiliary functions for PostScript fonts (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2013 by */
|
||||
/* Copyright 1996-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -847,6 +847,8 @@
|
||||
/* first character must be a delimiter or a part of a number */
|
||||
/* NB: `values' can be NULL if we just want to skip the */
|
||||
/* array; in this case we ignore `max_values' */
|
||||
/* */
|
||||
/* return number of successfully parsed values */
|
||||
|
||||
static FT_Int
|
||||
ps_tofixedarray( FT_Byte* *acur,
|
||||
@@ -1200,7 +1202,7 @@
|
||||
|
||||
result = ps_tofixedarray( &cur, limit, 4, temp, 0 );
|
||||
|
||||
if ( result < 0 )
|
||||
if ( result < 4 )
|
||||
{
|
||||
FT_ERROR(( "ps_parser_load_field:"
|
||||
" expected four integers in bounding box\n" ));
|
||||
@@ -1230,7 +1232,7 @@
|
||||
{
|
||||
result = ps_tofixedarray( &cur, limit, max_objects,
|
||||
temp + i * max_objects, 0 );
|
||||
if ( result < 0 )
|
||||
if ( result < 0 || (FT_UInt)result < max_objects )
|
||||
{
|
||||
FT_ERROR(( "ps_parser_load_field:"
|
||||
" expected %d integers in the %s subarray\n"
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
#
|
||||
# FreeType 2 PSaux driver configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2002, 2003, 2006 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.
|
||||
|
||||
|
||||
# PSAUX driver directory
|
||||
#
|
||||
PSAUX_DIR := $(SRC_DIR)/psaux
|
||||
|
||||
|
||||
# compilation flags for the driver
|
||||
#
|
||||
PSAUX_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSAUX_DIR))
|
||||
|
||||
|
||||
# PSAUX driver sources (i.e., C files)
|
||||
#
|
||||
PSAUX_DRV_SRC := $(PSAUX_DIR)/psobjs.c \
|
||||
$(PSAUX_DIR)/t1decode.c \
|
||||
$(PSAUX_DIR)/t1cmap.c \
|
||||
$(PSAUX_DIR)/afmparse.c \
|
||||
$(PSAUX_DIR)/psconv.c \
|
||||
$(PSAUX_DIR)/psauxmod.c
|
||||
|
||||
# PSAUX driver headers
|
||||
#
|
||||
PSAUX_DRV_H := $(PSAUX_DRV_SRC:%c=%h) \
|
||||
$(PSAUX_DIR)/psauxerr.h
|
||||
|
||||
|
||||
# PSAUX driver object(s)
|
||||
#
|
||||
# PSAUX_DRV_OBJ_M is used during `multi' builds.
|
||||
# PSAUX_DRV_OBJ_S is used during `single' builds.
|
||||
#
|
||||
PSAUX_DRV_OBJ_M := $(PSAUX_DRV_SRC:$(PSAUX_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
PSAUX_DRV_OBJ_S := $(OBJ_DIR)/psaux.$O
|
||||
|
||||
# PSAUX driver source file for single build
|
||||
#
|
||||
PSAUX_DRV_SRC_S := $(PSAUX_DIR)/psaux.c
|
||||
|
||||
|
||||
# PSAUX driver - single object
|
||||
#
|
||||
$(PSAUX_DRV_OBJ_S): $(PSAUX_DRV_SRC_S) $(PSAUX_DRV_SRC) \
|
||||
$(FREETYPE_H) $(PSAUX_DRV_H)
|
||||
$(PSAUX_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSAUX_DRV_SRC_S))
|
||||
|
||||
|
||||
# PSAUX driver - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(PSAUX_DIR)/%.c $(FREETYPE_H) $(PSAUX_DRV_H)
|
||||
$(PSAUX_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(PSAUX_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(PSAUX_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
||||
@@ -1,23 +0,0 @@
|
||||
#
|
||||
# FreeType 2 PSHinter module definition
|
||||
#
|
||||
|
||||
|
||||
# Copyright 1996-2001, 2006 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.
|
||||
|
||||
|
||||
FTMODULE_H_COMMANDS += PSHINTER_MODULE
|
||||
|
||||
define PSHINTER_MODULE
|
||||
$(OPEN_DRIVER) FT_Module_Class, pshinter_module_class $(CLOSE_DRIVER)
|
||||
$(ECHO_DRIVER)pshinter $(ECHO_DRIVER_DESC)Postscript hinter module$(ECHO_DRIVER_DONE)
|
||||
endef
|
||||
|
||||
# EOF
|
||||
+1
-4
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* PostScript hinting algorithm (body). */
|
||||
/* */
|
||||
/* Copyright 2001-2010, 2012, 2013 by */
|
||||
/* Copyright 2001-2010, 2012-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used */
|
||||
@@ -1406,7 +1406,6 @@
|
||||
|
||||
point = first;
|
||||
before = point;
|
||||
after = point;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -2079,8 +2078,6 @@
|
||||
start = first;
|
||||
do
|
||||
{
|
||||
point = first;
|
||||
|
||||
/* skip consecutive fitted points */
|
||||
for (;;)
|
||||
{
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
#
|
||||
# FreeType 2 PSHinter driver configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright 2001, 2003, 2011 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.
|
||||
|
||||
|
||||
# PSHINTER driver directory
|
||||
#
|
||||
PSHINTER_DIR := $(SRC_DIR)/pshinter
|
||||
|
||||
|
||||
# compilation flags for the driver
|
||||
#
|
||||
PSHINTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSHINTER_DIR))
|
||||
|
||||
|
||||
# PSHINTER driver sources (i.e., C files)
|
||||
#
|
||||
PSHINTER_DRV_SRC := $(PSHINTER_DIR)/pshalgo.c \
|
||||
$(PSHINTER_DIR)/pshglob.c \
|
||||
$(PSHINTER_DIR)/pshmod.c \
|
||||
$(PSHINTER_DIR)/pshpic.c \
|
||||
$(PSHINTER_DIR)/pshrec.c
|
||||
|
||||
|
||||
# PSHINTER driver headers
|
||||
#
|
||||
PSHINTER_DRV_H := $(PSHINTER_DRV_SRC:%c=%h) \
|
||||
$(PSHINTER_DIR)/pshnterr.h
|
||||
|
||||
|
||||
# PSHINTER driver object(s)
|
||||
#
|
||||
# PSHINTER_DRV_OBJ_M is used during `multi' builds.
|
||||
# PSHINTER_DRV_OBJ_S is used during `single' builds.
|
||||
#
|
||||
PSHINTER_DRV_OBJ_M := $(PSHINTER_DRV_SRC:$(PSHINTER_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
PSHINTER_DRV_OBJ_S := $(OBJ_DIR)/pshinter.$O
|
||||
|
||||
# PSHINTER driver source file for single build
|
||||
#
|
||||
PSHINTER_DRV_SRC_S := $(PSHINTER_DIR)/pshinter.c
|
||||
|
||||
|
||||
# PSHINTER driver - single object
|
||||
#
|
||||
$(PSHINTER_DRV_OBJ_S): $(PSHINTER_DRV_SRC_S) $(PSHINTER_DRV_SRC) \
|
||||
$(FREETYPE_H) $(PSHINTER_DRV_H)
|
||||
$(PSHINTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSHINTER_DRV_SRC_S))
|
||||
|
||||
|
||||
# PSHINTER driver - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(PSHINTER_DIR)/%.c $(FREETYPE_H) $(PSHINTER_DRV_H)
|
||||
$(PSHINTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(PSHINTER_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(PSHINTER_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
||||
@@ -1,23 +0,0 @@
|
||||
#
|
||||
# FreeType 2 PSnames module definition
|
||||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2006 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.
|
||||
|
||||
|
||||
FTMODULE_H_COMMANDS += PSNAMES_MODULE
|
||||
|
||||
define PSNAMES_MODULE
|
||||
$(OPEN_DRIVER) FT_Module_Class, psnames_module_class $(CLOSE_DRIVER)
|
||||
$(ECHO_DRIVER)psnames $(ECHO_DRIVER_DESC)Postscript & Unicode Glyph name handling$(ECHO_DRIVER_DONE)
|
||||
endef
|
||||
|
||||
# EOF
|
||||
@@ -1,71 +0,0 @@
|
||||
#
|
||||
# FreeType 2 PSNames driver configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2001, 2003, 2011 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.
|
||||
|
||||
|
||||
# PSNames driver directory
|
||||
#
|
||||
PSNAMES_DIR := $(SRC_DIR)/psnames
|
||||
|
||||
|
||||
# compilation flags for the driver
|
||||
#
|
||||
PSNAMES_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSNAMES_DIR))
|
||||
|
||||
|
||||
# PSNames driver sources (i.e., C files)
|
||||
#
|
||||
PSNAMES_DRV_SRC := $(PSNAMES_DIR)/psmodule.c \
|
||||
$(PSNAMES_DIR)/pspic.c
|
||||
|
||||
|
||||
# PSNames driver headers
|
||||
#
|
||||
PSNAMES_DRV_H := $(PSNAMES_DRV_SRC:%.c=%.h) \
|
||||
$(PSNAMES_DIR)/psnamerr.h \
|
||||
$(PSNAMES_DIR)/pstables.h
|
||||
|
||||
|
||||
# PSNames driver object(s)
|
||||
#
|
||||
# PSNAMES_DRV_OBJ_M is used during `multi' builds
|
||||
# PSNAMES_DRV_OBJ_S is used during `single' builds
|
||||
#
|
||||
PSNAMES_DRV_OBJ_M := $(PSNAMES_DRV_SRC:$(PSNAMES_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
PSNAMES_DRV_OBJ_S := $(OBJ_DIR)/psnames.$O
|
||||
|
||||
# PSNames driver source file for single build
|
||||
#
|
||||
PSNAMES_DRV_SRC_S := $(PSNAMES_DIR)/psmodule.c
|
||||
|
||||
|
||||
# PSNames driver - single object
|
||||
#
|
||||
$(PSNAMES_DRV_OBJ_S): $(PSNAMES_DRV_SRC_S) $(PSNAMES_DRV_SRC) \
|
||||
$(FREETYPE_H) $(PSNAMES_DRV_H)
|
||||
$(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSNAMES_DRV_SRC_S))
|
||||
|
||||
|
||||
# PSNames driver - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(PSNAMES_DIR)/%.c $(FREETYPE_H) $(PSNAMES_DRV_H)
|
||||
$(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(PSNAMES_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(PSNAMES_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType glyph rasterizer (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2003, 2005, 2007-2013 by */
|
||||
/* Copyright 1996-2003, 2005, 2007-2014 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -1874,7 +1874,7 @@
|
||||
v_start.x = ( v_start.x + v_last.x ) / 2;
|
||||
v_start.y = ( v_start.y + v_last.y ) / 2;
|
||||
|
||||
v_last = v_start;
|
||||
/* v_last = v_start; */
|
||||
}
|
||||
point--;
|
||||
tags--;
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#
|
||||
# FreeType 2 renderer module definition
|
||||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2006 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.
|
||||
|
||||
|
||||
FTMODULE_H_COMMANDS += RASTER_MODULE
|
||||
|
||||
define RASTER_MODULE
|
||||
$(OPEN_DRIVER) FT_Renderer_Class, ft_raster1_renderer_class $(CLOSE_DRIVER)
|
||||
$(ECHO_DRIVER)raster $(ECHO_DRIVER_DESC)monochrome bitmap renderer$(ECHO_DRIVER_DONE)
|
||||
endef
|
||||
|
||||
# EOF
|
||||
@@ -1,70 +0,0 @@
|
||||
#
|
||||
# FreeType 2 renderer module build rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2001, 2003, 2008, 2009, 2011 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.
|
||||
|
||||
|
||||
# raster driver directory
|
||||
#
|
||||
RASTER_DIR := $(SRC_DIR)/raster
|
||||
|
||||
# compilation flags for the driver
|
||||
#
|
||||
RASTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(RASTER_DIR))
|
||||
|
||||
|
||||
# raster driver sources (i.e., C files)
|
||||
#
|
||||
RASTER_DRV_SRC := $(RASTER_DIR)/ftraster.c \
|
||||
$(RASTER_DIR)/ftrend1.c \
|
||||
$(RASTER_DIR)/rastpic.c
|
||||
|
||||
|
||||
# raster driver headers
|
||||
#
|
||||
RASTER_DRV_H := $(RASTER_DRV_SRC:%.c=%.h) \
|
||||
$(RASTER_DIR)/rasterrs.h
|
||||
|
||||
|
||||
# raster driver object(s)
|
||||
#
|
||||
# RASTER_DRV_OBJ_M is used during `multi' builds.
|
||||
# RASTER_DRV_OBJ_S is used during `single' builds.
|
||||
#
|
||||
RASTER_DRV_OBJ_M := $(RASTER_DRV_SRC:$(RASTER_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
RASTER_DRV_OBJ_S := $(OBJ_DIR)/raster.$O
|
||||
|
||||
# raster driver source file for single build
|
||||
#
|
||||
RASTER_DRV_SRC_S := $(RASTER_DIR)/raster.c
|
||||
|
||||
|
||||
# raster driver - single object
|
||||
#
|
||||
$(RASTER_DRV_OBJ_S): $(RASTER_DRV_SRC_S) $(RASTER_DRV_SRC) \
|
||||
$(FREETYPE_H) $(RASTER_DRV_H)
|
||||
$(RASTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(RASTER_DRV_SRC_S))
|
||||
|
||||
|
||||
# raster driver - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(RASTER_DIR)/%.c $(FREETYPE_H) $(RASTER_DRV_H)
|
||||
$(RASTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main driver object lists
|
||||
#
|
||||
DRV_OBJS_S += $(RASTER_DRV_OBJ_S)
|
||||
DRV_OBJS_M += $(RASTER_DRV_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user