ReactOS 0.4.15-dev-7953-g1f49173
psfont.h File Reference
#include "psft.h"
#include "psblues.h"
Include dependency graph for psfont.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CF2_FontRec_
 

Macros

#define CF2_OPERAND_STACK_SIZE   48
 
#define CF2_MAX_SUBR   16 /* maximum subroutine nesting; */
 
#define CF2_STORAGE_SIZE   32
 

Functions

 cf2_getGlyphOutline (CF2_Font font, CF2_Buffer charstring, const CF2_Matrix *transform, CF2_F16Dot16 *glyphWidth)
 

Macro Definition Documentation

◆ CF2_MAX_SUBR

#define CF2_MAX_SUBR   16 /* maximum subroutine nesting; */

Definition at line 53 of file psfont.h.

◆ CF2_OPERAND_STACK_SIZE

#define CF2_OPERAND_STACK_SIZE   48

Definition at line 52 of file psfont.h.

◆ CF2_STORAGE_SIZE

#define CF2_STORAGE_SIZE   32

Definition at line 59 of file psfont.h.

Function Documentation

◆ cf2_getGlyphOutline()

cf2_getGlyphOutline ( CF2_Font  font,
CF2_Buffer  charstring,
const CF2_Matrix transform,
CF2_F16Dot16 glyphWidth 
)

Definition at line 487 of file psfont.c.

491 {
492 FT_Error lastError = FT_Err_Ok;
493
494 FT_Vector translation;
495
496#if 0
497 FT_Vector advancePoint;
498#endif
499
500 CF2_Fixed advWidth = 0;
501 FT_Bool needWinding;
502
503
504 /* Note: use both integer and fraction for outlines. This allows bbox */
505 /* to come out directly. */
506
507 translation.x = transform->tx;
508 translation.y = transform->ty;
509
510 /* set up values based on transform */
512 if ( font->error )
513 goto exit; /* setup encountered an error */
514
515 /* reset darken direction */
516 font->reverseWinding = FALSE;
517
518 /* winding order only affects darkening */
519 needWinding = font->darkened;
520
521 while ( 1 )
522 {
523 /* reset output buffer */
524 cf2_outline_reset( &font->outline );
525
526 /* build the outline, passing the full translation */
528 charstring,
529 (CF2_OutlineCallbacks)&font->outline,
530 &translation,
531 FALSE,
532 0,
533 0,
534 &advWidth );
535
536 if ( font->error )
537 goto exit;
538
539 if ( !needWinding )
540 break;
541
542 /* check winding order */
543 if ( font->outline.root.windingMomentum >= 0 ) /* CFF is CCW */
544 break;
545
546 /* invert darkening and render again */
547 /* TODO: this should be a parameter to getOutline-computeOffset */
548 font->reverseWinding = TRUE;
549
550 needWinding = FALSE; /* exit after next iteration */
551 }
552
553 /* finish storing client outline */
554 cf2_outline_close( &font->outline );
555
556 exit:
557 /* FreeType just wants the advance width; there is no translation */
558 *glyphWidth = advWidth;
559
560 /* free resources and collect errors from objects we've used */
561 cf2_setError( &font->error, lastError );
562
563 return font->error;
564 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
return FT_Err_Ok
Definition: ftbbox.c:511
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
int FT_Error
Definition: fttypes.h:300
GLuint GLenum GLenum transform
Definition: glext.h:9407
Definition: mk_font.cpp:20
cf2_setError(FT_Error *error, FT_Error value)
Definition: pserror.c:44
#define CF2_Fixed
Definition: psfixed.h:48
static void cf2_font_setup(CF2_Font font, const CF2_Matrix *transform)
Definition: psfont.c:242
cf2_outline_reset(CF2_Outline outline)
Definition: psft.c:863
cf2_outline_close(CF2_Outline outline)
Definition: psft.c:877
cf2_interpT2CharString(CF2_Font font, CF2_Buffer buf, CF2_OutlineCallbacks callbacks, const FT_Vector *translation, FT_Bool doingSeac, CF2_Fixed curX, CF2_Fixed curY, CF2_Fixed *width)
Definition: psintrp.c:471
#define exit(n)
Definition: config.h:202
FT_Pos x
Definition: ftimage.h:76
FT_Pos y
Definition: ftimage.h:77

Referenced by cf2_decoder_parse_charstrings().