edf4014854
The font variation code. All parts dependent on the GX code in the `truetype' module are guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT. In other words, you can still compile the `cff' module without defining TT_CONFIG_OPTION_GX_VAR_SUPPORT (which brings you CFF2 support without font variation). * src/cff/cf2font.c (cf2_font_setup): Add support for font variation. * src/cff/cf2font.h (CF2_Font): Add fields for variation data. * src/cff/cf2ft.c (cf2_free_instance): Free blend data. (cf2_getVStore, cf2_getNormalizedVector): New functions. * src/cff/cf2ft.h: Updated. * src/cff/cf2intrp.c: Include `cffload.h'. (cf2_cmdRESERVED_15, cf2_cmdRESERVED_16): Replace with... (cf2_cmdVSINDEX, cf2_cmdBLEND): ... this new enum values. (cf2_doBlend): New function. (cf2_interpT2CharString): Handle `vsindex' and `blend' opcodes. * src/cff/cffload.c (FT_fdot14ToFixed): New macro. (cff_vstore_done, cff_vstore_load): New functions. (cff_blend_clear, cff_blend_doBlend, cff_blend_build_vector, cff_blend_check_vector): New functions. (cff_load_private_dict): Add arguments for blend vector. Handle blend data. (cff_subfont_load, cff_subfont_done): Updated. (cff_font_load): Handle CFF2 variation store data. (cff_font_done): Updated. * src/cff/cffload.h: Include `cffparse.h'. Updated. * src/cff/cffobjs.c (cff_face_done): Updated. * src/cff/cffparse.c: Include `cffload.h'. (cff_parse_num): Handle internal value 255. (cff_parse_vsindex, cff_parse_blend): New functions. (CFF_FIELD_BLEND): New macro. (cff_parser_run): Updated. * src/cff/cffparse.h (cff_kind_blend): New enum value. * src/cff/cfftoken.h: Handle `vstore', `vsindex', and `blend' dictionary values. * src/cff/cfftypes.h (CFF_VarData, CFF_AxisCoords, CFF_VarRegion, CFF_VStore, CFF_Blend): New structures. (CFF_FontRecDict): Add `vstore_offset' field. (CFF_Private): Add `vsindex' field. (CFF_SubFont): Add fields for blend data. (CFF_Font): Add `vstore' field. * src/truetype/ttgxvar.c (TT_Get_MM_Var): `CFF2' is equal to `gvar', since glyph variation data is directly embedded. (TT_Set_MM_Blend): Don't load `gvar' table for CFF2 fonts.
116 lines
3.5 KiB
C
116 lines
3.5 KiB
C
/***************************************************************************/
|
|
/* */
|
|
/* cffload.h */
|
|
/* */
|
|
/* OpenType & CFF data/program tables loader (specification). */
|
|
/* */
|
|
/* Copyright 1996-2016 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 CFFLOAD_H_
|
|
#define CFFLOAD_H_
|
|
|
|
|
|
#include <ft2build.h>
|
|
#include "cfftypes.h"
|
|
#include "cffparse.h"
|
|
|
|
|
|
FT_BEGIN_HEADER
|
|
|
|
FT_LOCAL( FT_UShort )
|
|
cff_get_standard_encoding( FT_UInt charcode );
|
|
|
|
|
|
FT_LOCAL( FT_String* )
|
|
cff_index_get_string( CFF_Font font,
|
|
FT_UInt element );
|
|
|
|
FT_LOCAL( FT_String* )
|
|
cff_index_get_sid_string( CFF_Font font,
|
|
FT_UInt sid );
|
|
|
|
|
|
FT_LOCAL( FT_Error )
|
|
cff_index_access_element( CFF_Index idx,
|
|
FT_UInt element,
|
|
FT_Byte** pbytes,
|
|
FT_ULong* pbyte_len );
|
|
|
|
FT_LOCAL( void )
|
|
cff_index_forget_element( CFF_Index idx,
|
|
FT_Byte** pbytes );
|
|
|
|
FT_LOCAL( FT_String* )
|
|
cff_index_get_name( CFF_Font font,
|
|
FT_UInt element );
|
|
|
|
|
|
FT_LOCAL( FT_UInt )
|
|
cff_charset_cid_to_gindex( CFF_Charset charset,
|
|
FT_UInt cid );
|
|
|
|
|
|
FT_LOCAL( FT_Error )
|
|
cff_font_load( FT_Library library,
|
|
FT_Stream stream,
|
|
FT_Int face_index,
|
|
CFF_Font font,
|
|
FT_Bool pure_cff,
|
|
FT_Bool cff2 );
|
|
|
|
FT_LOCAL( void )
|
|
cff_font_done( CFF_Font font );
|
|
|
|
|
|
FT_LOCAL( FT_Byte )
|
|
cff_fd_select_get( CFF_FDSelect fdselect,
|
|
FT_UInt glyph_index );
|
|
|
|
FT_LOCAL( FT_Bool )
|
|
cff_blend_check_vector( CFF_Blend blend,
|
|
FT_UInt vsindex,
|
|
FT_UInt lenNDV,
|
|
FT_Fixed* NDV );
|
|
|
|
FT_LOCAL( FT_Error )
|
|
cff_blend_build_vector( CFF_Blend blend,
|
|
FT_UInt vsindex,
|
|
FT_UInt lenNDV,
|
|
FT_Fixed* NDV );
|
|
|
|
FT_LOCAL( void )
|
|
cff_blend_clear( CFF_SubFont subFont );
|
|
|
|
FT_LOCAL( FT_Error )
|
|
cff_blend_doBlend( CFF_SubFont subfont,
|
|
CFF_Parser parser,
|
|
FT_UInt numBlends );
|
|
|
|
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
|
FT_LOCAL( FT_Error )
|
|
cff_get_var_blend( CFF_Face face,
|
|
FT_UInt *num_coords,
|
|
FT_Fixed* *coords );
|
|
|
|
FT_LOCAL( void )
|
|
cff_done_blend( CFF_Face face );
|
|
#endif
|
|
|
|
|
|
FT_END_HEADER
|
|
|
|
#endif /* CFFLOAD_H_ */
|
|
|
|
|
|
/* END */
|