ReactOS  0.4.15-dev-489-g75a0787
psft.h File Reference
#include "pstypes.h"
#include "psglue.h"
Include dependency graph for psft.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CF2_OutlineRec_
 

Macros

#define CF2_NDEBUG
 

Typedefs

typedef struct CF2_OutlineRec_ CF2_OutlineRec
 
typedef struct CF2_OutlineRec_CF2_Outline
 

Functions

FT_BEGIN_HEADER cf2_decoder_parse_charstrings (PS_Decoder *decoder, FT_Byte *charstring_base, FT_ULong charstring_len)
 
 cf2_getSubfont (PS_Decoder *decoder)
 
 cf2_getVStore (PS_Decoder *decoder)
 
 cf2_getMaxstack (PS_Decoder *decoder)
 
 cf2_getPpemY (PS_Decoder *decoder)
 
 cf2_getStdVW (PS_Decoder *decoder)
 
 cf2_getStdHW (PS_Decoder *decoder)
 
 cf2_getBlueMetrics (PS_Decoder *decoder, CF2_Fixed *blueScale, CF2_Fixed *blueShift, CF2_Fixed *blueFuzz)
 
 cf2_getBlueValues (PS_Decoder *decoder, size_t *count, FT_Pos **data)
 
 cf2_getOtherBlues (PS_Decoder *decoder, size_t *count, FT_Pos **data)
 
 cf2_getFamilyBlues (PS_Decoder *decoder, size_t *count, FT_Pos **data)
 
 cf2_getFamilyOtherBlues (PS_Decoder *decoder, size_t *count, FT_Pos **data)
 
 cf2_getLanguageGroup (PS_Decoder *decoder)
 
 cf2_initGlobalRegionBuffer (PS_Decoder *decoder, CF2_Int subrNum, CF2_Buffer buf)
 
 cf2_getSeacComponent (PS_Decoder *decoder, CF2_Int code, CF2_Buffer buf)
 
 cf2_freeSeacComponent (PS_Decoder *decoder, CF2_Buffer buf)
 
 cf2_initLocalRegionBuffer (PS_Decoder *decoder, CF2_Int subrNum, CF2_Buffer buf)
 
 cf2_getDefaultWidthX (PS_Decoder *decoder)
 
 cf2_getNominalWidthX (PS_Decoder *decoder)
 
 cf2_getT1SeacComponent (PS_Decoder *decoder, FT_UInt glyph_index, CF2_Buffer buf)
 
 cf2_freeT1SeacComponent (PS_Decoder *decoder, CF2_Buffer buf)
 
 cf2_outline_reset (CF2_Outline outline)
 
 cf2_outline_close (CF2_Outline outline)
 

Macro Definition Documentation

◆ CF2_NDEBUG

#define CF2_NDEBUG

Definition at line 47 of file psft.h.

Typedef Documentation

◆ CF2_Outline

◆ CF2_OutlineRec

Function Documentation

◆ cf2_decoder_parse_charstrings()

FT_BEGIN_HEADER cf2_decoder_parse_charstrings ( PS_Decoder decoder,
FT_Byte charstring_base,
FT_ULong  charstring_len 
)

Definition at line 308 of file psft.c.

311  {
314  CF2_Font font;
315 
316  FT_Bool is_t1 = decoder->builder.is_t1;
317 
318 
319  FT_ASSERT( decoder &&
320  ( is_t1 || decoder->cff ) );
321 
322  if ( is_t1 && !decoder->current_subfont )
323  {
324  FT_ERROR(( "cf2_decoder_parse_charstrings (Type 1): "
325  "SubFont missing. Use `t1_make_subfont' first\n" ));
326  return FT_THROW( Invalid_Table );
327  }
328 
329  memory = decoder->builder.memory;
330 
331  /* CF2 data is saved here across glyphs */
332  font = (CF2_Font)decoder->cf2_instance->data;
333 
334  /* on first glyph, allocate instance structure */
335  if ( !decoder->cf2_instance->data )
336  {
337  decoder->cf2_instance->finalizer =
339 
340  if ( FT_ALLOC( decoder->cf2_instance->data,
341  sizeof ( CF2_FontRec ) ) )
342  return FT_THROW( Out_Of_Memory );
343 
344  font = (CF2_Font)decoder->cf2_instance->data;
345 
346  font->memory = memory;
347 
348  if ( !is_t1 )
349  font->cffload = (FT_Service_CFFLoad)decoder->cff->cffload;
350 
351  /* initialize a client outline, to be shared by each glyph rendered */
352  cf2_outline_init( &font->outline, font->memory, &font->error );
353  }
354 
355  /* save decoder; it is a stack variable and will be different on each */
356  /* call */
357  font->decoder = decoder;
358  font->outline.decoder = decoder;
359 
360  {
361  /* build parameters for Adobe engine */
362 
363  PS_Builder* builder = &decoder->builder;
365 
366  FT_Bool no_stem_darkening_driver =
367  driver->no_stem_darkening;
368  FT_Char no_stem_darkening_font =
369  builder->face->internal->no_stem_darkening;
370 
371  /* local error */
375  CF2_F16Dot16 glyphWidth;
376 
377  FT_Bool hinted;
378  FT_Bool scaled;
379 
380 
381  /* FreeType has already looked up the GID; convert to */
382  /* `RegionBuffer', assuming that the input has been validated */
383  FT_ASSERT( charstring_base + charstring_len >= charstring_base );
384 
385  FT_ZERO( &buf );
386  buf.start =
387  buf.ptr = charstring_base;
388  buf.end = charstring_base + charstring_len;
389 
390  FT_ZERO( &transform );
391 
392  cf2_getScaleAndHintFlag( decoder,
393  &transform.a,
394  &transform.d,
395  &hinted,
396  &scaled );
397 
398  if ( is_t1 )
399  font->isCFF2 = FALSE;
400  else
401  {
402  /* copy isCFF2 boolean from TT_Face to CF2_Font */
403  font->isCFF2 = ((TT_Face)builder->face)->is_cff2;
404  }
405  font->isT1 = is_t1;
406 
407  font->renderingFlags = 0;
408  if ( hinted )
409  font->renderingFlags |= CF2_FlagsHinted;
410  if ( scaled && ( !no_stem_darkening_font ||
411  ( no_stem_darkening_font < 0 &&
412  !no_stem_darkening_driver ) ) )
413  font->renderingFlags |= CF2_FlagsDarkened;
414 
415  font->darkenParams[0] = driver->darken_params[0];
416  font->darkenParams[1] = driver->darken_params[1];
417  font->darkenParams[2] = driver->darken_params[2];
418  font->darkenParams[3] = driver->darken_params[3];
419  font->darkenParams[4] = driver->darken_params[4];
420  font->darkenParams[5] = driver->darken_params[5];
421  font->darkenParams[6] = driver->darken_params[6];
422  font->darkenParams[7] = driver->darken_params[7];
423 
424  /* now get an outline for this glyph; */
425  /* also get units per em to validate scale */
426  font->unitsPerEm = (CF2_Int)cf2_getUnitsPerEm( decoder );
427 
428  if ( scaled )
429  {
430  error2 = cf2_checkTransform( &transform, font->unitsPerEm );
431  if ( error2 )
432  return error2;
433  }
434 
435  error2 = cf2_getGlyphOutline( font, &buf, &transform, &glyphWidth );
436  if ( error2 )
437  return FT_ERR( Invalid_File_Format );
438 
439  cf2_setGlyphWidth( &font->outline, glyphWidth );
440 
441  return FT_Err_Ok;
442  }
443  }
#define FT_ALLOC(ptr, size)
Definition: ftmemory.h:303
int FT_Error
Definition: fttypes.h:300
FT_Face_Internal internal
Definition: freetype.h:1120
FT_Int32 CF2_F16Dot16
Definition: pstypes.h:69
FT_Memory memory
Definition: psaux.h:534
#define error(str)
Definition: mkdosfs.c:1605
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
cf2_getGlyphOutline(CF2_Font font, CF2_Buffer charstring, const CF2_Matrix *transform, CF2_F16Dot16 *glyphWidth)
Definition: psfont.c:487
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
Definition: mk_font.cpp:20
#define CF2_FlagsHinted
Definition: psglue.h:56
void(* FT_Generic_Finalizer)(void *object)
Definition: fttypes.h:428
CFF_SubFont current_subfont
Definition: psaux.h:614
signed char FT_Char
Definition: fttypes.h:143
return FT_Err_Ok
Definition: ftbbox.c:511
static char memory[1024 *256]
Definition: process.c:116
FT_BEGIN_HEADER struct CF2_BufferRec_ CF2_BufferRec
static void cf2_outline_init(CF2_Outline outline, FT_Memory memory, FT_Error *error)
Definition: psft.c:249
FT_BEGIN_HEADER struct PS_DriverRec_ * PS_Driver
#define FT_FACE_DRIVER(x)
Definition: ftobjs.h:634
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
static void cf2_getScaleAndHintFlag(PS_Decoder *decoder, CF2_Fixed *x_scale, CF2_Fixed *y_scale, FT_Bool *hinted, FT_Bool *scaled)
Definition: psft.c:266
#define FT_ERROR(varformat)
Definition: ftdebug.h:181
#define FT_THROW(e)
Definition: ftdebug.h:213
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
const void * cffload
Definition: cfftypes.h:386
PS_Builder builder
Definition: psaux.h:601
struct TT_FaceRec_ * TT_Face
Definition: tttypes.h:973
static void cf2_free_instance(void *ptr)
Definition: psft.c:107
#define error2(s, a, b)
Definition: debug.h:126
FT_Bool is_t1
Definition: psaux.h:553
static FT_UShort cf2_getUnitsPerEm(PS_Decoder *decoder)
Definition: psft.c:297
#define FT_ERR(e)
Definition: fttypes.h:586
#define FT_ZERO(p)
Definition: ftmemory.h:237
if(!(yy_init))
Definition: macro.lex.yy.c:714
FT_Generic_Finalizer finalizer
Definition: fttypes.h:462
static FT_Error cf2_checkTransform(const CF2_Matrix *transform, CF2_Int unitsPerEm)
Definition: psft.c:65
void * data
Definition: fttypes.h:461
struct @1641::@1642 driver
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
static void cf2_setGlyphWidth(CF2_Outline outline, CF2_Fixed width)
Definition: psft.c:92
#define CF2_FlagsDarkened
Definition: psglue.h:58
FT_Char no_stem_darkening
Definition: ftobjs.h:416
FT_Generic * cf2_instance
Definition: psaux.h:615
#define CF2_Int
Definition: pstypes.h:65
CFF_Font cff
Definition: psaux.h:613
GLuint GLenum GLenum transform
Definition: glext.h:9407
FT_Face face
Definition: psaux.h:535
struct CF2_FontRec_ * CF2_Font
Definition: psglue.h:90

◆ cf2_freeSeacComponent()

cf2_freeSeacComponent ( PS_Decoder decoder,
CF2_Buffer  buf 
)

Definition at line 708 of file psft.c.

710  {
711  FT_ASSERT( decoder );
712  FT_ASSERT( !decoder->builder.is_t1 );
713 
714  decoder->free_glyph_callback( (TT_Face)decoder->builder.face,
715  (FT_Byte**)&buf->start,
716  (FT_ULong)( buf->end - buf->start ) );
717  }
unsigned long FT_ULong
Definition: fttypes.h:253
CFF_Decoder_Free_Glyph_Callback free_glyph_callback
Definition: psaux.h:638
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
unsigned char FT_Byte
Definition: fttypes.h:154
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
PS_Builder builder
Definition: psaux.h:601
FT_Bool is_t1
Definition: psaux.h:553
FT_Face face
Definition: psaux.h:535

Referenced by cf2_interpT2CharString().

◆ cf2_freeT1SeacComponent()

cf2_freeT1SeacComponent ( PS_Decoder decoder,
CF2_Buffer  buf 
)

Definition at line 767 of file psft.c.

769  {
770  T1_Face face;
771  FT_Data data;
772 
773 
774  FT_ASSERT( decoder );
775 
776 #ifdef FT_CONFIG_OPTION_INCREMENTAL
777  face = (T1_Face)decoder->builder.face;
778 
779  data.pointer = buf->start;
780  data.length = (FT_Int)( buf->end - buf->start );
781 
782  if ( face->root.internal->incremental_interface )
783  face->root.internal->incremental_interface->funcs->free_glyph_data(
784  face->root.internal->incremental_interface->object,
785  &data );
786 #endif /* FT_CONFIG_OPTION_INCREMENTAL */
787  }
FT_Face_Internal internal
Definition: freetype.h:1120
struct T1_FaceRec_ * T1_Face
Definition: t1types.h:196
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
signed int FT_Int
Definition: fttypes.h:220
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
PS_Builder builder
Definition: psaux.h:601
WORD face[3]
Definition: mesh.c:4747
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
FT_Face face
Definition: psaux.h:535
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by cf2_interpT2CharString().

◆ cf2_getBlueMetrics()

cf2_getBlueMetrics ( PS_Decoder decoder,
CF2_Fixed blueScale,
CF2_Fixed blueShift,
CF2_Fixed blueFuzz 
)

Definition at line 549 of file psft.c.

553  {
554  FT_ASSERT( decoder && decoder->current_subfont );
555 
556  *blueScale = FT_DivFix(
558  cf2_intToFixed( 1000 ) );
559  *blueShift = cf2_intToFixed(
561  *blueFuzz = cf2_intToFixed(
563  }
FT_DivFix(FT_Long a, FT_Long b)
Definition: ftcalc.c:608
CFF_SubFont current_subfont
Definition: psaux.h:614
#define cf2_intToFixed(i)
Definition: psfixed.h:60
FT_Pos blue_shift
Definition: cfftypes.h:253
FT_Fixed blue_scale
Definition: cfftypes.h:252
FT_Pos blue_fuzz
Definition: cfftypes.h:254
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
CFF_PrivateRec private_dict
Definition: cfftypes.h:301

Referenced by cf2_blues_init().

◆ cf2_getBlueValues()

cf2_getBlueValues ( PS_Decoder decoder,
size_t count,
FT_Pos **  data 
)

Definition at line 569 of file psft.c.

572  {
573  FT_ASSERT( decoder && decoder->current_subfont );
574 
576  *data = (FT_Pos*)
578  }
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:58
FT_Pos blue_values[14]
Definition: cfftypes.h:247
GLuint GLuint GLsizei count
Definition: gl.h:1545
CFF_SubFont current_subfont
Definition: psaux.h:614
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
CFF_PrivateRec private_dict
Definition: cfftypes.h:301
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
FT_Byte num_blue_values
Definition: cfftypes.h:242

Referenced by cf2_blues_init().

◆ cf2_getDefaultWidthX()

cf2_getDefaultWidthX ( PS_Decoder decoder)

Definition at line 843 of file psft.c.

844  {
845  FT_ASSERT( decoder && decoder->current_subfont );
846 
847  return cf2_intToFixed(
849  }
CFF_SubFont current_subfont
Definition: psaux.h:614
#define cf2_intToFixed(i)
Definition: psfixed.h:60
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
CFF_PrivateRec private_dict
Definition: cfftypes.h:301
FT_Pos default_width
Definition: cfftypes.h:269

Referenced by cf2_interpT2CharString().

◆ cf2_getFamilyBlues()

cf2_getFamilyBlues ( PS_Decoder decoder,
size_t count,
FT_Pos **  data 
)

Definition at line 595 of file psft.c.

598  {
599  FT_ASSERT( decoder && decoder->current_subfont );
600 
602  *data = (FT_Pos*)
604  }
FT_Byte num_family_blues
Definition: cfftypes.h:244
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:58
GLuint GLuint GLsizei count
Definition: gl.h:1545
CFF_SubFont current_subfont
Definition: psaux.h:614
FT_Pos family_blues[14]
Definition: cfftypes.h:249
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
CFF_PrivateRec private_dict
Definition: cfftypes.h:301
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by cf2_blues_init().

◆ cf2_getFamilyOtherBlues()

cf2_getFamilyOtherBlues ( PS_Decoder decoder,
size_t count,
FT_Pos **  data 
)

Definition at line 608 of file psft.c.

611  {
612  FT_ASSERT( decoder && decoder->current_subfont );
613 
615  *data = (FT_Pos*)
617  }
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:58
GLuint GLuint GLsizei count
Definition: gl.h:1545
CFF_SubFont current_subfont
Definition: psaux.h:614
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
FT_Byte num_family_other_blues
Definition: cfftypes.h:245
CFF_PrivateRec private_dict
Definition: cfftypes.h:301
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
FT_Pos family_other_blues[10]
Definition: cfftypes.h:250

Referenced by cf2_blues_init().

◆ cf2_getLanguageGroup()

cf2_getLanguageGroup ( PS_Decoder decoder)

Definition at line 621 of file psft.c.

622  {
623  FT_ASSERT( decoder && decoder->current_subfont );
624 
626  }
CFF_SubFont current_subfont
Definition: psaux.h:614
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
FT_Int language_group
Definition: cfftypes.h:265
CFF_PrivateRec private_dict
Definition: cfftypes.h:301

Referenced by cf2_blues_init().

◆ cf2_getMaxstack()

cf2_getMaxstack ( PS_Decoder decoder)

Definition at line 468 of file psft.c.

469  {
470  FT_ASSERT( decoder && decoder->cff );
471 
472  return decoder->cff->top_font.font_dict.maxstack;
473  }
CFF_FontRecDictRec font_dict
Definition: cfftypes.h:300
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
CFF_Font cff
Definition: psaux.h:613
CFF_SubFontRec top_font
Definition: cfftypes.h:373

Referenced by cf2_interpT2CharString().

◆ cf2_getNominalWidthX()

cf2_getNominalWidthX ( PS_Decoder decoder)

Definition at line 853 of file psft.c.

854  {
855  FT_ASSERT( decoder && decoder->current_subfont );
856 
857  return cf2_intToFixed(
859  }
CFF_SubFont current_subfont
Definition: psaux.h:614
#define cf2_intToFixed(i)
Definition: psfixed.h:60
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
CFF_PrivateRec private_dict
Definition: cfftypes.h:301
FT_Pos nominal_width
Definition: cfftypes.h:270

Referenced by cf2_doStems(), and cf2_interpT2CharString().

◆ cf2_getOtherBlues()

cf2_getOtherBlues ( PS_Decoder decoder,
size_t count,
FT_Pos **  data 
)

Definition at line 582 of file psft.c.

585  {
586  FT_ASSERT( decoder && decoder->current_subfont );
587 
589  *data = (FT_Pos*)
591  }
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:58
FT_Pos other_blues[10]
Definition: cfftypes.h:248
GLuint GLuint GLsizei count
Definition: gl.h:1545
CFF_SubFont current_subfont
Definition: psaux.h:614
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
CFF_PrivateRec private_dict
Definition: cfftypes.h:301
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
FT_Byte num_other_blues
Definition: cfftypes.h:243

Referenced by cf2_blues_init().

◆ cf2_getPpemY()

cf2_getPpemY ( PS_Decoder decoder)

Definition at line 504 of file psft.c.

505  {
506  FT_ASSERT( decoder &&
507  decoder->builder.face &&
508  decoder->builder.face->size );
509 
510  /*
511  * Note that `y_ppem' can be zero if there wasn't a call to
512  * `FT_Set_Char_Size' or something similar. However, this isn't a
513  * problem since we come to this place in the code only if
514  * FT_LOAD_NO_SCALE is set (the other case gets caught by
515  * `cf2_checkTransform'). The ppem value is needed to compute the stem
516  * darkening, which is disabled for getting the unscaled outline.
517  *
518  */
519  return cf2_intToFixed(
520  decoder->builder.face->size->metrics.y_ppem );
521  }
FT_Size size
Definition: freetype.h:1106
#define cf2_intToFixed(i)
Definition: psfixed.h:60
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
PS_Builder builder
Definition: psaux.h:601
FT_Size_Metrics metrics
Definition: freetype.h:1677
FT_UShort y_ppem
Definition: freetype.h:1641
FT_Face face
Definition: psaux.h:535

Referenced by cf2_font_setup().

◆ cf2_getSeacComponent()

cf2_getSeacComponent ( PS_Decoder decoder,
CF2_Int  code,
CF2_Buffer  buf 
)

Definition at line 660 of file psft.c.

663  {
664  CF2_Int gid;
665  FT_Byte* charstring;
666  FT_ULong len;
667  FT_Error error;
668 
669 
670  FT_ASSERT( decoder );
671  FT_ASSERT( !decoder->builder.is_t1 );
672 
673  FT_ZERO( buf );
674 
675 #ifdef FT_CONFIG_OPTION_INCREMENTAL
676  /* Incremental fonts don't necessarily have valid charsets. */
677  /* They use the character code, not the glyph index, in this case. */
678  if ( decoder->builder.face->internal->incremental_interface )
679  gid = code;
680  else
681 #endif /* FT_CONFIG_OPTION_INCREMENTAL */
682  {
683  gid = cff_lookup_glyph_by_stdcharcode( decoder->cff, code );
684  if ( gid < 0 )
685  return FT_THROW( Invalid_Glyph_Format );
686  }
687 
688  error = decoder->get_glyph_callback( (TT_Face)decoder->builder.face,
689  (CF2_UInt)gid,
690  &charstring,
691  &len );
692  /* TODO: for now, just pass the FreeType error through */
693  if ( error )
694  return error;
695 
696  /* assume input has been validated */
697  FT_ASSERT( charstring + len >= charstring );
698 
699  buf->start = charstring;
700  buf->end = charstring + len;
701  buf->ptr = buf->start;
702 
703  return FT_Err_Ok;
704  }
#define CF2_UInt
Definition: pstypes.h:64
int FT_Error
Definition: fttypes.h:300
FT_Face_Internal internal
Definition: freetype.h:1120
unsigned long FT_ULong
Definition: fttypes.h:253
#define error(str)
Definition: mkdosfs.c:1605
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
cff_lookup_glyph_by_stdcharcode(CFF_Font cff, FT_Int charcode)
Definition: cffdecode.c:419
return FT_Err_Ok
Definition: ftbbox.c:511
unsigned char FT_Byte
Definition: fttypes.h:154
#define FT_THROW(e)
Definition: ftdebug.h:213
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
PS_Builder builder
Definition: psaux.h:601
FT_Bool is_t1
Definition: psaux.h:553
#define FT_ZERO(p)
Definition: ftmemory.h:237
CFF_Decoder_Get_Glyph_Callback get_glyph_callback
Definition: psaux.h:637
GLenum GLsizei len
Definition: glext.h:6722
int code
Definition: i386-dis.c:3591
#define CF2_Int
Definition: pstypes.h:65
CFF_Font cff
Definition: psaux.h:613
FT_Face face
Definition: psaux.h:535

Referenced by cf2_interpT2CharString().

◆ cf2_getStdHW()

cf2_getStdHW ( PS_Decoder decoder)

Definition at line 538 of file psft.c.

539  {
540  FT_ASSERT( decoder && decoder->current_subfont );
541 
542  return cf2_intToFixed(
544  }
CFF_SubFont current_subfont
Definition: psaux.h:614
#define cf2_intToFixed(i)
Definition: psfixed.h:60
FT_Pos standard_width
Definition: cfftypes.h:255
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
CFF_PrivateRec private_dict
Definition: cfftypes.h:301

Referenced by cf2_font_setup().

◆ cf2_getStdVW()

cf2_getStdVW ( PS_Decoder decoder)

Definition at line 528 of file psft.c.

529  {
530  FT_ASSERT( decoder && decoder->current_subfont );
531 
532  return cf2_intToFixed(
534  }
CFF_SubFont current_subfont
Definition: psaux.h:614
#define cf2_intToFixed(i)
Definition: psfixed.h:60
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
CFF_PrivateRec private_dict
Definition: cfftypes.h:301
FT_Pos standard_height
Definition: cfftypes.h:256

Referenced by cf2_font_setup().

◆ cf2_getSubfont()

cf2_getSubfont ( PS_Decoder decoder)

Definition at line 448 of file psft.c.

449  {
450  FT_ASSERT( decoder && decoder->current_subfont );
451 
452  return decoder->current_subfont;
453  }
CFF_SubFont current_subfont
Definition: psaux.h:614
#define FT_ASSERT(condition)
Definition: ftdebug.h:211

Referenced by cf2_font_setup().

◆ cf2_getT1SeacComponent()

cf2_getT1SeacComponent ( PS_Decoder decoder,
FT_UInt  glyph_index,
CF2_Buffer  buf 
)

Definition at line 721 of file psft.c.

724  {
725  FT_Data glyph_data;
727  T1_Face face = (T1_Face)decoder->builder.face;
728  T1_Font type1 = &face->type1;
729 
732  face->root.internal->incremental_interface;
733 
734 
735  /* For incremental fonts get the character data using the */
736  /* callback function. */
737  if ( inc )
738  error = inc->funcs->get_glyph_data( inc->object,
739  glyph_index, &glyph_data );
740  else
741 #endif
742  /* For ordinary fonts get the character data stored in the face record. */
743  {
744  glyph_data.pointer = type1->charstrings[glyph_index];
745  glyph_data.length = (FT_Int)type1->charstrings_len[glyph_index];
746  }
747 
748  if ( !error )
749  {
750  FT_Byte* charstring_base = (FT_Byte*)glyph_data.pointer;
751  FT_ULong charstring_len = (FT_ULong)glyph_data.length;
752 
753 
754  FT_ASSERT( charstring_base + charstring_len >= charstring_base );
755 
756  FT_ZERO( buf );
757  buf->start =
758  buf->ptr = charstring_base;
759  buf->end = charstring_base + charstring_len;
760  }
761 
762  return error;
763  }
FT_Int length
Definition: fttypes.h:409
int FT_Error
Definition: fttypes.h:300
unsigned long FT_ULong
Definition: fttypes.h:253
struct T1_FaceRec_ * T1_Face
Definition: t1types.h:196
#define error(str)
Definition: mkdosfs.c:1605
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
signed int FT_Int
Definition: fttypes.h:220
const FT_Byte * pointer
Definition: fttypes.h:408
return FT_Err_Ok
Definition: ftbbox.c:511
unsigned char FT_Byte
Definition: fttypes.h:154
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
#define FT_CONFIG_OPTION_INCREMENTAL
Definition: ftoption.h:358
PS_Builder builder
Definition: psaux.h:601
#define FT_ZERO(p)
Definition: ftmemory.h:237
if(!(yy_init))
Definition: macro.lex.yy.c:714
FT_Face face
Definition: psaux.h:535
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by cf2_interpT2CharString().

◆ cf2_getVStore()

cf2_getVStore ( PS_Decoder decoder)

Definition at line 458 of file psft.c.

459  {
460  FT_ASSERT( decoder && decoder->cff );
461 
462  return &decoder->cff->vstore;
463  }
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
CFF_VStoreRec vstore
Definition: cfftypes.h:399
CFF_Font cff
Definition: psaux.h:613

Referenced by cf2_font_setup().

◆ cf2_initGlobalRegionBuffer()

cf2_initGlobalRegionBuffer ( PS_Decoder decoder,
CF2_Int  subrNum,
CF2_Buffer  buf 
)

Definition at line 632 of file psft.c.

635  {
636  CF2_UInt idx;
637 
638 
639  FT_ASSERT( decoder );
640 
641  FT_ZERO( buf );
642 
643  idx = (CF2_UInt)( subrNum + decoder->globals_bias );
644  if ( idx >= decoder->num_globals )
645  return TRUE; /* error */
646 
647  FT_ASSERT( decoder->globals );
648 
649  buf->start =
650  buf->ptr = decoder->globals[idx];
651  buf->end = decoder->globals[idx + 1];
652 
653  return FALSE; /* success */
654  }
#define CF2_UInt
Definition: pstypes.h:64
FT_UInt num_globals
Definition: psaux.h:622
#define TRUE
Definition: types.h:120
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
FT_Byte ** globals
Definition: psaux.h:628
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
unsigned int idx
Definition: utils.c:41
FT_Int globals_bias
Definition: psaux.h:625
#define FT_ZERO(p)
Definition: ftmemory.h:237

Referenced by cf2_interpT2CharString().

◆ cf2_initLocalRegionBuffer()

cf2_initLocalRegionBuffer ( PS_Decoder decoder,
CF2_Int  subrNum,
CF2_Buffer  buf 
)

Definition at line 791 of file psft.c.

794  {
795  CF2_UInt idx;
796 
797 
798  FT_ASSERT( decoder );
799 
800  FT_ZERO( buf );
801 
802  idx = (CF2_UInt)( subrNum + decoder->locals_bias );
803  if ( idx >= decoder->num_locals )
804  return TRUE; /* error */
805 
806  FT_ASSERT( decoder->locals );
807 
808  buf->start = decoder->locals[idx];
809 
810  if ( decoder->builder.is_t1 )
811  {
812  /* The Type 1 driver stores subroutines without the seed bytes. */
813  /* The CID driver stores subroutines with seed bytes. This */
814  /* case is taken care of when decoder->subrs_len == 0. */
815  if ( decoder->locals_len )
816  buf->end = buf->start + decoder->locals_len[idx];
817  else
818  {
819  /* We are using subroutines from a CID font. We must adjust */
820  /* for the seed bytes. */
821  buf->start += ( decoder->lenIV >= 0 ? decoder->lenIV : 0 );
822  buf->end = decoder->locals[idx + 1];
823  }
824 
825  if ( !buf->start )
826  {
827  FT_ERROR(( "cf2_initLocalRegionBuffer (Type 1 mode):"
828  " invoking empty subrs\n" ));
829  }
830  }
831  else
832  {
833  buf->end = decoder->locals[idx + 1];
834  }
835 
836  buf->ptr = buf->start;
837 
838  return FALSE; /* success */
839  }
#define CF2_UInt
Definition: pstypes.h:64
FT_UInt num_locals
Definition: psaux.h:621
FT_UInt * locals_len
Definition: psaux.h:644
#define TRUE
Definition: types.h:120
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define FT_ERROR(varformat)
Definition: ftdebug.h:181
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
unsigned int idx
Definition: utils.c:41
PS_Builder builder
Definition: psaux.h:601
FT_Bool is_t1
Definition: psaux.h:553
#define FT_ZERO(p)
Definition: ftmemory.h:237
FT_Byte ** locals
Definition: psaux.h:627
FT_Int lenIV
Definition: psaux.h:643
FT_Int locals_bias
Definition: psaux.h:624

Referenced by cf2_interpT2CharString().

◆ cf2_outline_close()

cf2_outline_close ( CF2_Outline  outline)

Definition at line 877 of file psft.c.

878  {
879  PS_Decoder* decoder = outline->decoder;
880 
881 
882  FT_ASSERT( decoder );
883 
884  ps_builder_close_contour( &decoder->builder );
885 
886  FT_GlyphLoader_Add( decoder->builder.loader );
887  }
FT_GlyphLoader loader
Definition: psaux.h:537
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
ps_builder_close_contour(PS_Builder *builder)
Definition: psobjs.c:2278
FT_GlyphLoader_Add(FT_GlyphLoader loader)
Definition: ftgloadr.c:328
PS_Builder builder
Definition: psaux.h:601
Definition: mesh.c:5329

Referenced by cf2_getGlyphOutline().

◆ cf2_outline_reset()

cf2_outline_reset ( CF2_Outline  outline)

Definition at line 863 of file psft.c.

864  {
865  PS_Decoder* decoder = outline->decoder;
866 
867 
868  FT_ASSERT( decoder );
869 
870  outline->root.windingMomentum = 0;
871 
873  }
FT_GlyphLoader loader
Definition: psaux.h:537
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
PS_Builder builder
Definition: psaux.h:601
Definition: mesh.c:5329
FT_GlyphLoader_Rewind(FT_GlyphLoader loader)
Definition: ftgloadr.c:88

Referenced by cf2_getGlyphOutline().