ReactOS 0.4.16-dev-1067-ge98bba2
t1load.h File Reference
#include <ft2build.h>
#include "t1parse.h"
Include dependency graph for t1load.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  T1_Loader_
 

Macros

#define T1_PRIVATE   ( 1 << 0 )
 
#define T1_FONTDIR_AFTER_PRIVATE   ( 1 << 1 )
 

Typedefs

typedef FT_BEGIN_HEADER struct T1_Loader_ T1_LoaderRec
 
typedef FT_BEGIN_HEADER struct T1_Loader_T1_Loader
 

Functions

 T1_Open_Face (T1_Face face)
 
 T1_Get_Multi_Master (T1_Face face, FT_Multi_Master *master)
 
 T1_Get_MM_Var (T1_Face face, FT_MM_Var **master)
 
 T1_Set_MM_Blend (T1_Face face, FT_UInt num_coords, FT_Fixed *coords)
 
 T1_Get_MM_Blend (T1_Face face, FT_UInt num_coords, FT_Fixed *coords)
 
 T1_Set_MM_Design (T1_Face face, FT_UInt num_coords, FT_Long *coords)
 
 T1_Reset_MM_Blend (T1_Face face, FT_UInt instance_index)
 
 T1_Get_Var_Design (T1_Face face, FT_UInt num_coords, FT_Fixed *coords)
 
 T1_Set_Var_Design (T1_Face face, FT_UInt num_coords, FT_Fixed *coords)
 
 T1_Done_Blend (T1_Face face)
 
 T1_Set_MM_WeightVector (T1_Face face, FT_UInt len, FT_Fixed *weightvector)
 
 T1_Get_MM_WeightVector (T1_Face face, FT_UInt *len, FT_Fixed *weightvector)
 

Macro Definition Documentation

◆ T1_FONTDIR_AFTER_PRIVATE

#define T1_FONTDIR_AFTER_PRIVATE   ( 1 << 1 )

Definition at line 61 of file t1load.h.

◆ T1_PRIVATE

#define T1_PRIVATE   ( 1 << 0 )

Definition at line 60 of file t1load.h.

Typedef Documentation

◆ T1_Loader

◆ T1_LoaderRec

Function Documentation

◆ T1_Done_Blend()

T1_Done_Blend ( T1_Face  face)

Definition at line 710 of file t1load.c.

711 {
712 FT_Memory memory = face->root.memory;
713 PS_Blend blend = face->blend;
714
715
716 if ( blend )
717 {
718 FT_UInt num_designs = blend->num_designs;
719 FT_UInt num_axis = blend->num_axis;
720 FT_UInt n;
721
722
723 /* release design pos table */
724 FT_FREE( blend->design_pos[0] );
725 for ( n = 1; n < num_designs; n++ )
726 blend->design_pos[n] = NULL;
727
728 /* release blend `private' and `font info' dictionaries */
729 FT_FREE( blend->privates[1] );
730 FT_FREE( blend->font_infos[1] );
731 FT_FREE( blend->bboxes[1] );
732
733 for ( n = 0; n < num_designs; n++ )
734 {
735 blend->privates [n] = NULL;
736 blend->font_infos[n] = NULL;
737 blend->bboxes [n] = NULL;
738 }
739
740 /* release weight vectors */
741 FT_FREE( blend->weight_vector );
743
744 /* release axis names */
745 for ( n = 0; n < num_axis; n++ )
746 FT_FREE( blend->axis_names[n] );
747
748 /* release design map */
749 for ( n = 0; n < num_axis; n++ )
750 {
751 PS_DesignMap dmap = blend->design_map + n;
752
753
754 FT_FREE( dmap->design_points );
755 dmap->num_points = 0;
756 }
757
758 FT_FREE( face->blend );
759 }
760 }
#define NULL
Definition: types.h:112
#define FT_FREE(ptr)
Definition: ftmemory.h:328
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:65
unsigned int FT_UInt
Definition: fttypes.h:231
GLdouble n
Definition: glext.h:7729
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
static char memory[1024 *256]
Definition: process.c:116
PS_DesignMapRec design_map[T1_MAX_MM_AXIS]
Definition: t1tables.h:303
FT_Fixed * default_weight_vector
Definition: t1tables.h:306
PS_Private privates[T1_MAX_MM_DESIGNS+1]
Definition: t1tables.h:309
FT_BBox * bboxes[T1_MAX_MM_DESIGNS+1]
Definition: t1tables.h:313
PS_FontInfo font_infos[T1_MAX_MM_DESIGNS+1]
Definition: t1tables.h:308
FT_Fixed * design_pos[T1_MAX_MM_DESIGNS]
Definition: t1tables.h:302
FT_UInt num_designs
Definition: t1tables.h:298
FT_Fixed * weight_vector
Definition: t1tables.h:305
FT_UInt num_axis
Definition: t1tables.h:299
FT_String * axis_names[T1_MAX_MM_AXIS]
Definition: t1tables.h:301
FT_Byte num_points
Definition: t1tables.h:286
FT_Long * design_points
Definition: t1tables.h:287

Referenced by T1_Face_Done(), and T1_Open_Face().

◆ T1_Get_MM_Blend()

T1_Get_MM_Blend ( T1_Face  face,
FT_UInt  num_coords,
FT_Fixed coords 
)

Definition at line 449 of file t1load.c.

452 {
453 PS_Blend blend = face->blend;
454
455 FT_Fixed axiscoords[4];
456 FT_UInt i, nc;
457
458
459 if ( !blend )
460 return FT_THROW( Invalid_Argument );
461
463 axiscoords,
464 blend->num_axis );
465
466 nc = num_coords;
467 if ( num_coords > blend->num_axis )
468 {
469 FT_TRACE2(( "T1_Get_MM_Blend: only using first %d of %d coordinates\n",
470 blend->num_axis, num_coords ));
471 nc = blend->num_axis;
472 }
473
474 for ( i = 0; i < nc; i++ )
475 coords[i] = axiscoords[i];
476 for ( ; i < num_coords; i++ )
477 coords[i] = 0x8000;
478
479 return FT_Err_Ok;
480 }
return FT_Err_Ok
Definition: ftbbox.c:527
#define FT_THROW(e)
Definition: ftdebug.h:241
#define FT_TRACE2(varformat)
Definition: ftdebug.h:187
signed long FT_Fixed
Definition: fttypes.h:287
GLuint coords
Definition: glext.h:7368
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static void mm_weights_unmap(FT_Fixed *weights, FT_Fixed *axiscoords, FT_UInt axis_count)
Definition: t1load.c:260

◆ T1_Get_MM_Var()

T1_Get_MM_Var ( T1_Face  face,
FT_MM_Var **  master 
)

Definition at line 302 of file t1load.c.

304 {
305 FT_Memory memory = face->root.memory;
306 FT_MM_Var *mmvar = NULL;
307 FT_Multi_Master mmaster;
309 FT_UInt i;
310 FT_Fixed axiscoords[T1_MAX_MM_AXIS];
311 PS_Blend blend = face->blend;
312
313
314 error = T1_Get_Multi_Master( face, &mmaster );
315 if ( error )
316 goto Exit;
317 if ( FT_ALLOC( mmvar,
318 sizeof ( FT_MM_Var ) +
319 mmaster.num_axis * sizeof ( FT_Var_Axis ) ) )
320 goto Exit;
321
322 mmvar->num_axis = mmaster.num_axis;
323 mmvar->num_designs = mmaster.num_designs;
324 mmvar->num_namedstyles = 0; /* Not supported */
325 mmvar->axis = (FT_Var_Axis*)&mmvar[1];
326 /* Point to axes after MM_Var struct */
327 mmvar->namedstyle = NULL;
328
329 for ( i = 0; i < mmaster.num_axis; i++ )
330 {
331 mmvar->axis[i].name = mmaster.axis[i].name;
332 mmvar->axis[i].minimum = INT_TO_FIXED( mmaster.axis[i].minimum );
333 mmvar->axis[i].maximum = INT_TO_FIXED( mmaster.axis[i].maximum );
334 mmvar->axis[i].def = ( mmvar->axis[i].minimum +
335 mmvar->axis[i].maximum ) / 2;
336 /* Does not apply. But this value is in range */
337 mmvar->axis[i].strid = ~0U; /* Does not apply */
338 mmvar->axis[i].tag = ~0U; /* Does not apply */
339
340 if ( !mmvar->axis[i].name )
341 continue;
342
343 if ( ft_strcmp( mmvar->axis[i].name, "Weight" ) == 0 )
344 mmvar->axis[i].tag = FT_MAKE_TAG( 'w', 'g', 'h', 't' );
345 else if ( ft_strcmp( mmvar->axis[i].name, "Width" ) == 0 )
346 mmvar->axis[i].tag = FT_MAKE_TAG( 'w', 'd', 't', 'h' );
347 else if ( ft_strcmp( mmvar->axis[i].name, "OpticalSize" ) == 0 )
348 mmvar->axis[i].tag = FT_MAKE_TAG( 'o', 'p', 's', 'z' );
349 }
350
352 axiscoords,
353 blend->num_axis );
354
355 for ( i = 0; i < mmaster.num_axis; i++ )
356 mmvar->axis[i].def = mm_axis_unmap( &blend->design_map[i],
357 axiscoords[i] );
358
359 *master = mmvar;
360
361 Exit:
362 return error;
363 }
#define U(x)
Definition: wordpad.c:45
#define INT_TO_FIXED(x)
Definition: ftcalc.h:448
#define FT_ALLOC(ptr, size)
Definition: ftmemory.h:302
#define ft_strcmp
Definition: ftstdlib.h:86
int FT_Error
Definition: fttypes.h:299
#define FT_MAKE_TAG(_x1, _x2, _x3, _x4)
Definition: fttypes.h:488
#define error(str)
Definition: mkdosfs.c:1605
static void Exit(void)
Definition: sock.c:1330
FT_Var_Axis * axis
Definition: ftmm.h:248
FT_UInt num_designs
Definition: ftmm.h:246
FT_UInt num_namedstyles
Definition: ftmm.h:247
FT_UInt num_axis
Definition: ftmm.h:245
FT_Var_Named_Style * namedstyle
Definition: ftmm.h:249
FT_MM_Axis axis[T1_MAX_MM_AXIS]
Definition: ftmm.h:112
FT_UInt num_designs
Definition: ftmm.h:111
FT_UInt num_axis
Definition: ftmm.h:110
FT_ULong tag
Definition: ftmm.h:164
FT_UInt strid
Definition: ftmm.h:165
FT_Fixed def
Definition: ftmm.h:161
FT_Fixed maximum
Definition: ftmm.h:162
FT_String * name
Definition: ftmm.h:158
FT_Fixed minimum
Definition: ftmm.h:160
static FT_Fixed mm_axis_unmap(PS_DesignMap axismap, FT_Fixed ncv)
Definition: t1load.c:231
T1_Get_Multi_Master(T1_Face face, FT_Multi_Master *master)
Definition: t1load.c:192
#define T1_MAX_MM_AXIS
Definition: t1tables.h:277
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

◆ T1_Get_MM_WeightVector()

T1_Get_MM_WeightVector ( T1_Face  face,
FT_UInt len,
FT_Fixed weightvector 
)

Definition at line 524 of file t1load.c.

527 {
528 PS_Blend blend = face->blend;
529 FT_UInt i;
530
531
532 if ( !blend )
533 return FT_THROW( Invalid_Argument );
534
535 if ( *len < blend->num_designs )
536 {
537 *len = blend->num_designs;
538 return FT_THROW( Invalid_Argument );
539 }
540
541 for ( i = 0; i < blend->num_designs; i++ )
542 weightvector[i] = blend->weight_vector[i];
543 for ( ; i < *len; i++ )
544 weightvector[i] = (FT_Fixed)0;
545
546 *len = blend->num_designs;
547
548 return FT_Err_Ok;
549 }
GLenum GLsizei len
Definition: glext.h:6722
#define for
Definition: utility.h:88

◆ T1_Get_Multi_Master()

T1_Get_Multi_Master ( T1_Face  face,
FT_Multi_Master master 
)

Definition at line 192 of file t1load.c.

194 {
195 PS_Blend blend = face->blend;
196 FT_UInt n;
198
199
200 error = FT_THROW( Invalid_Argument );
201
202 if ( blend )
203 {
204 master->num_axis = blend->num_axis;
205 master->num_designs = blend->num_designs;
206
207 for ( n = 0; n < blend->num_axis; n++ )
208 {
209 FT_MM_Axis* axis = master->axis + n;
210 PS_DesignMap map = blend->design_map + n;
211
212
213 axis->name = blend->axis_names[n];
214 axis->minimum = map->design_points[0];
215 axis->maximum = map->design_points[map->num_points - 1];
216 }
217
219 }
220
221 return error;
222 }
Definition: _map.h:48
FT_BEGIN_HEADER struct FT_MM_Axis_ FT_MM_Axis

Referenced by T1_Get_MM_Var().

◆ T1_Get_Var_Design()

T1_Get_Var_Design ( T1_Face  face,
FT_UInt  num_coords,
FT_Fixed coords 
)

Definition at line 674 of file t1load.c.

677 {
678 PS_Blend blend = face->blend;
679
680 FT_Fixed axiscoords[4];
681 FT_UInt i, nc;
682
683
684 if ( !blend )
685 return FT_THROW( Invalid_Argument );
686
688 axiscoords,
689 blend->num_axis );
690
691 nc = num_coords;
692 if ( num_coords > blend->num_axis )
693 {
694 FT_TRACE2(( "T1_Get_Var_Design:"
695 " only using first %d of %d coordinates\n",
696 blend->num_axis, num_coords ));
697 nc = blend->num_axis;
698 }
699
700 for ( i = 0; i < nc; i++ )
701 coords[i] = mm_axis_unmap( &blend->design_map[i], axiscoords[i] );
702 for ( ; i < num_coords; i++ )
703 coords[i] = 0;
704
705 return FT_Err_Ok;
706 }

◆ T1_Open_Face()

T1_Open_Face ( T1_Face  face)

Definition at line 2481 of file t1load.c.

2482 {
2483 T1_LoaderRec loader;
2485 T1_Font type1 = &face->type1;
2486 PS_Private priv = &type1->private_dict;
2488
2489 PSAux_Service psaux = (PSAux_Service)face->psaux;
2490
2491
2492 t1_init_loader( &loader, face );
2493
2494 /* default values */
2495 face->ndv_idx = -1;
2496 face->cdv_idx = -1;
2497 face->len_buildchar = 0;
2498
2499 priv->blue_shift = 7;
2500 priv->blue_fuzz = 1;
2501 priv->lenIV = 4;
2502 priv->expansion_factor = (FT_Fixed)( 0.06 * 0x10000L );
2503 priv->blue_scale = (FT_Fixed)( 0.039625 * 0x10000L * 1000 );
2504
2505 parser = &loader.parser;
2507 face->root.stream,
2508 face->root.memory,
2509 psaux );
2510 if ( error )
2511 goto Exit;
2512
2513 FT_TRACE4(( " top dictionary:\n" ));
2514 error = parse_dict( face, &loader,
2515 parser->base_dict, parser->base_len );
2516 if ( error )
2517 goto Exit;
2518
2519 error = T1_Get_Private_Dict( parser, psaux );
2520 if ( error )
2521 goto Exit;
2522
2523 FT_TRACE4(( " private dictionary:\n" ));
2524 error = parse_dict( face, &loader,
2525 parser->private_dict, parser->private_len );
2526 if ( error )
2527 goto Exit;
2528
2529 /* ensure even-ness of `num_blue_values' */
2530 priv->num_blue_values &= ~1;
2531
2532#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
2533
2534 /* we don't support Multiple Master fonts with intermediate designs; */
2535 /* this implies that `num_designs' must be equal to `2^^num_axis' */
2536 if ( face->blend &&
2537 face->blend->num_designs != ( 1U << face->blend->num_axis ) )
2538 {
2539 FT_ERROR(( "T1_Open_Face:"
2540 " number-of-designs != 2 ^^ number-of-axes\n" ));
2542 }
2543
2544 if ( face->blend &&
2545 face->blend->num_default_design_vector != 0 &&
2546 face->blend->num_default_design_vector != face->blend->num_axis )
2547 {
2548 /* we don't use it currently so just warn, reset, and ignore */
2549 FT_ERROR(( "T1_Open_Face(): /DesignVector contains %u entries "
2550 "while there are %u axes.\n",
2551 face->blend->num_default_design_vector,
2552 face->blend->num_axis ));
2553
2554 face->blend->num_default_design_vector = 0;
2555 }
2556
2557 /* the following can happen for MM instances; we then treat the */
2558 /* font as a normal PS font */
2559 if ( face->blend &&
2560 ( !face->blend->num_designs || !face->blend->num_axis ) )
2562
2563 /* another safety check */
2564 if ( face->blend )
2565 {
2566 FT_UInt i;
2567
2568
2569 for ( i = 0; i < face->blend->num_axis; i++ )
2570 if ( !face->blend->design_map[i].num_points )
2571 {
2573 break;
2574 }
2575 }
2576
2577 if ( face->blend )
2578 {
2579 if ( face->len_buildchar > 0 )
2580 {
2581 FT_Memory memory = face->root.memory;
2582
2583
2584 if ( FT_NEW_ARRAY( face->buildchar, face->len_buildchar ) )
2585 {
2586 FT_ERROR(( "T1_Open_Face: cannot allocate BuildCharArray\n" ));
2587 face->len_buildchar = 0;
2588 goto Exit;
2589 }
2590 }
2591 }
2592 else
2593 face->len_buildchar = 0;
2594
2595#endif /* !T1_CONFIG_OPTION_NO_MM_SUPPORT */
2596
2597 /* now, propagate the subrs, charstrings, and glyphnames tables */
2598 /* to the Type1 data */
2599 type1->num_glyphs = loader.num_glyphs;
2600
2601 if ( loader.subrs.init )
2602 {
2603 type1->num_subrs = loader.num_subrs;
2604 type1->subrs_block = loader.subrs.block;
2605 type1->subrs = loader.subrs.elements;
2606 type1->subrs_len = loader.subrs.lengths;
2607 type1->subrs_hash = loader.subrs_hash;
2608
2609 /* prevent `t1_done_loader' from freeing the propagated data */
2610 loader.subrs.init = 0;
2611 loader.subrs_hash = NULL;
2612 }
2613
2614 if ( !IS_INCREMENTAL )
2615 if ( !loader.charstrings.init )
2616 {
2617 FT_ERROR(( "T1_Open_Face: no `/CharStrings' array in face\n" ));
2618 error = FT_THROW( Invalid_File_Format );
2619 }
2620
2621 loader.charstrings.init = 0;
2622 type1->charstrings_block = loader.charstrings.block;
2623 type1->charstrings = loader.charstrings.elements;
2624 type1->charstrings_len = loader.charstrings.lengths;
2625
2626 /* we copy the glyph names `block' and `elements' fields; */
2627 /* the `lengths' field must be released later */
2628 type1->glyph_names_block = loader.glyph_names.block;
2629 type1->glyph_names = (FT_String**)loader.glyph_names.elements;
2630 loader.glyph_names.block = NULL;
2631 loader.glyph_names.elements = NULL;
2632
2633 /* we must now build type1.encoding when we have a custom array */
2635 {
2636 FT_Int charcode, idx, min_char, max_char;
2637 FT_Byte* glyph_name;
2638
2639
2640 /* OK, we do the following: for each element in the encoding */
2641 /* table, look up the index of the glyph having the same name */
2642 /* the index is then stored in type1.encoding.char_index, and */
2643 /* the name to type1.encoding.char_name */
2644
2645 min_char = 0;
2646 max_char = 0;
2647
2648 charcode = 0;
2649 for ( ; charcode < loader.encoding_table.max_elems; charcode++ )
2650 {
2651 FT_Byte* char_name;
2652
2653
2654 type1->encoding.char_index[charcode] = 0;
2655 type1->encoding.char_name [charcode] = (char *)".notdef";
2656
2657 char_name = loader.encoding_table.elements[charcode];
2658 if ( char_name )
2659 for ( idx = 0; idx < type1->num_glyphs; idx++ )
2660 {
2661 glyph_name = (FT_Byte*)type1->glyph_names[idx];
2662 if ( ft_strcmp( (const char*)char_name,
2663 (const char*)glyph_name ) == 0 )
2664 {
2665 type1->encoding.char_index[charcode] = (FT_UShort)idx;
2666 type1->encoding.char_name [charcode] = (char*)glyph_name;
2667
2668 /* Change min/max encoded char only if glyph name is */
2669 /* not /.notdef */
2670 if ( ft_strcmp( (const char*)".notdef",
2671 (const char*)glyph_name ) != 0 )
2672 {
2673 if ( charcode < min_char )
2674 min_char = charcode;
2675 if ( charcode >= max_char )
2676 max_char = charcode + 1;
2677 }
2678 break;
2679 }
2680 }
2681 }
2682
2683 type1->encoding.code_first = min_char;
2684 type1->encoding.code_last = max_char;
2685 type1->encoding.num_chars = loader.num_chars;
2686 }
2687
2688 /* some sanitizing to avoid overflows later on; */
2689 /* the upper limits are ad-hoc values */
2690 if ( priv->blue_shift > 1000 || priv->blue_shift < 0 )
2691 {
2692 FT_TRACE2(( "T1_Open_Face:"
2693 " setting unlikely BlueShift value %d to default (7)\n",
2694 priv->blue_shift ));
2695 priv->blue_shift = 7;
2696 }
2697
2698 if ( priv->blue_fuzz > 1000 || priv->blue_fuzz < 0 )
2699 {
2700 FT_TRACE2(( "T1_Open_Face:"
2701 " setting unlikely BlueFuzz value %d to default (1)\n",
2702 priv->blue_fuzz ));
2703 priv->blue_fuzz = 1;
2704 }
2705
2706 Exit:
2707 t1_done_loader( &loader );
2708 return error;
2709 }
unsigned int idx
Definition: utils.c:41
#define FT_ERROR(varformat)
Definition: ftdebug.h:209
#define FT_TRACE4(varformat)
Definition: ftdebug.h:189
#define FT_NEW_ARRAY(ptr, count)
Definition: ftmemory.h:332
unsigned char FT_Byte
Definition: fttypes.h:154
unsigned short FT_UShort
Definition: fttypes.h:209
char FT_String
Definition: fttypes.h:187
signed int FT_Int
Definition: fttypes.h:220
if(dx< 0)
Definition: linetemp.h:194
struct PSAux_ServiceRec_ * PSAux_Service
FT_Int blue_fuzz
Definition: t1tables.h:155
FT_Fixed expansion_factor
Definition: t1tables.h:168
FT_Int lenIV
Definition: t1tables.h:140
FT_Int blue_shift
Definition: t1tables.h:154
FT_Byte num_blue_values
Definition: t1tables.h:142
FT_Fixed blue_scale
Definition: t1tables.h:153
PS_PrivateRec private_dict
Definition: t1types.h:101
T1_EncodingType encoding_type
Definition: t1types.h:104
FT_Byte * subrs_block
Definition: t1types.h:107
FT_Byte ** subrs
Definition: t1types.h:112
FT_Int num_glyphs
Definition: t1types.h:116
FT_UInt * charstrings_len
Definition: t1types.h:119
FT_String ** glyph_names
Definition: t1types.h:117
T1_EncodingRec encoding
Definition: t1types.h:105
FT_Int num_subrs
Definition: t1types.h:111
FT_Byte * charstrings_block
Definition: t1types.h:108
FT_Hash subrs_hash
Definition: t1types.h:114
FT_Byte ** charstrings
Definition: t1types.h:118
FT_UInt * subrs_len
Definition: t1types.h:113
FT_Byte * glyph_names_block
Definition: t1types.h:109
Definition: import.c:81
static void t1_init_loader(T1_Loader loader, T1_Face face)
Definition: t1load.c:2448
#define IS_INCREMENTAL
Definition: t1load.c:78
T1_Done_Blend(T1_Face face)
Definition: t1load.c:710
static void t1_done_loader(T1_Loader loader)
Definition: t1load.c:2458
static FT_Error parse_dict(T1_Face face, T1_Loader loader, FT_Byte *base, FT_ULong size)
Definition: t1load.c:2250
FT_BEGIN_HEADER struct T1_Loader_ T1_LoaderRec
T1_New_Parser(T1_Parser parser, FT_Stream stream, FT_Memory memory, PSAux_Service psaux)
Definition: t1parse.c:136
T1_Get_Private_Dict(T1_Parser parser, PSAux_Service psaux)
Definition: t1parse.c:261
FT_BEGIN_HEADER struct T1_ParserRec_ * T1_Parser
@ T1_ENCODING_TYPE_ARRAY
Definition: t1tables.h:567

Referenced by T1_Face_Init().

◆ T1_Reset_MM_Blend()

T1_Reset_MM_Blend ( T1_Face  face,
FT_UInt  instance_index 
)

Definition at line 640 of file t1load.c.

642 {
643 FT_UNUSED( instance_index );
644
645 return T1_Set_MM_Blend( face, 0, NULL );
646 }
#define FT_UNUSED(arg)
Definition: ftconfig.h:100
T1_Set_MM_Blend(T1_Face face, FT_UInt num_coords, FT_Fixed *coords)
Definition: t1load.c:428

◆ T1_Set_MM_Blend()

T1_Set_MM_Blend ( T1_Face  face,
FT_UInt  num_coords,
FT_Fixed coords 
)

Definition at line 428 of file t1load.c.

431 {
433
434
435 error = t1_set_mm_blend( face, num_coords, coords );
436 if ( error )
437 return error;
438
439 if ( num_coords )
440 face->root.face_flags |= FT_FACE_FLAG_VARIATION;
441 else
442 face->root.face_flags &= ~FT_FACE_FLAG_VARIATION;
443
444 return FT_Err_Ok;
445 }
#define FT_FACE_FLAG_VARIATION
Definition: freetype.h:1225
static FT_Error t1_set_mm_blend(T1_Face face, FT_UInt num_coords, FT_Fixed *coords)
Definition: t1load.c:367

Referenced by T1_Reset_MM_Blend().

◆ T1_Set_MM_Design()

T1_Set_MM_Design ( T1_Face  face,
FT_UInt  num_coords,
FT_Long coords 
)

Definition at line 553 of file t1load.c.

556 {
558 PS_Blend blend = face->blend;
559 FT_UInt n, p;
560 FT_Fixed final_blends[T1_MAX_MM_DESIGNS];
561
562
563 if ( !blend )
564 return FT_THROW( Invalid_Argument );
565
566 if ( num_coords > blend->num_axis )
567 num_coords = blend->num_axis;
568
569 /* compute the blend coordinates through the blend design map */
570
571 for ( n = 0; n < blend->num_axis; n++ )
572 {
573 FT_Long design;
574 FT_Fixed the_blend;
575 PS_DesignMap map = blend->design_map + n;
576 FT_Long* designs = map->design_points;
577 FT_Fixed* blends = map->blend_points;
578 FT_Int before = -1, after = -1;
579
580
581 /* use a default value if we don't have a coordinate */
582 if ( n < num_coords )
583 design = coords[n];
584 else
585 design = ( designs[map->num_points - 1] - designs[0] ) / 2;
586
587 for ( p = 0; p < (FT_UInt)map->num_points; p++ )
588 {
589 FT_Long p_design = designs[p];
590
591
592 /* exact match? */
593 if ( design == p_design )
594 {
595 the_blend = blends[p];
596 goto Found;
597 }
598
599 if ( design < p_design )
600 {
601 after = (FT_Int)p;
602 break;
603 }
604
605 before = (FT_Int)p;
606 }
607
608 /* now interpolate if necessary */
609 if ( before < 0 )
610 the_blend = blends[0];
611
612 else if ( after < 0 )
613 the_blend = blends[map->num_points - 1];
614
615 else
616 the_blend = FT_MulDiv( design - designs[before],
617 blends [after] - blends [before],
618 designs[after] - designs[before] );
619
620 Found:
621 final_blends[n] = the_blend;
622 }
623
624 error = t1_set_mm_blend( face, blend->num_axis, final_blends );
625 if ( error )
626 return error;
627
628 if ( num_coords )
629 face->root.face_flags |= FT_FACE_FLAG_VARIATION;
630 else
631 face->root.face_flags &= ~FT_FACE_FLAG_VARIATION;
632
633 return FT_Err_Ok;
634 }
return Found
Definition: dirsup.c:1270
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
Definition: ftcalc.c:416
signed long FT_Long
Definition: fttypes.h:242
GLfloat GLfloat p
Definition: glext.h:8902
#define T1_MAX_MM_DESIGNS
Definition: t1tables.h:274
__inline int before(__u32 seq1, __u32 seq2)
Definition: tcpcore.h:2390
__inline int after(__u32 seq1, __u32 seq2)
Definition: tcpcore.h:2395

Referenced by T1_Set_Var_Design().

◆ T1_Set_MM_WeightVector()

T1_Set_MM_WeightVector ( T1_Face  face,
FT_UInt  len,
FT_Fixed weightvector 
)

Definition at line 484 of file t1load.c.

487 {
488 PS_Blend blend = face->blend;
489 FT_UInt i, n;
490
491
492 if ( !blend )
493 return FT_THROW( Invalid_Argument );
494
495 if ( !len && !weightvector )
496 {
497 for ( i = 0; i < blend->num_designs; i++ )
498 blend->weight_vector[i] = blend->default_weight_vector[i];
499 }
500 else
501 {
502 if ( !weightvector )
503 return FT_THROW( Invalid_Argument );
504
505 n = len < blend->num_designs ? len : blend->num_designs;
506
507 for ( i = 0; i < n; i++ )
508 blend->weight_vector[i] = weightvector[i];
509
510 for ( ; i < blend->num_designs; i++ )
511 blend->weight_vector[i] = (FT_Fixed)0;
512
513 if ( len )
514 face->root.face_flags |= FT_FACE_FLAG_VARIATION;
515 else
516 face->root.face_flags &= ~FT_FACE_FLAG_VARIATION;
517 }
518
519 return FT_Err_Ok;
520 }

◆ T1_Set_Var_Design()

T1_Set_Var_Design ( T1_Face  face,
FT_UInt  num_coords,
FT_Fixed coords 
)

Definition at line 655 of file t1load.c.

658 {
659 FT_Long lcoords[T1_MAX_MM_AXIS];
660 FT_UInt i;
661
662
663 if ( num_coords > T1_MAX_MM_AXIS )
664 num_coords = T1_MAX_MM_AXIS;
665
666 for ( i = 0; i < num_coords; i++ )
667 lcoords[i] = FIXED_TO_INT( coords[i] );
668
669 return T1_Set_MM_Design( face, num_coords, lcoords );
670 }
#define FIXED_TO_INT(x)
Definition: ftcalc.h:450
T1_Set_MM_Design(T1_Face face, FT_UInt num_coords, FT_Long *coords)
Definition: t1load.c:553