ReactOS 0.4.16-dev-1067-ge98bba2
afglobal.h File Reference
#include "aftypes.h"
#include "afmodule.h"
#include "afshaper.h"
#include "afscript.h"
#include "afstyles.h"
Include dependency graph for afglobal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  AF_FaceGlobalsRec_
 

Macros

#define SCRIPT(s, S, d, h, H, ss)    AF_DECLARE_SCRIPT_CLASS( af_ ## s ## _script_class )
 
#define STYLE(s, S, d, ws, sc, ss, c)    AF_DECLARE_STYLE_CLASS( af_ ## s ## _style_class )
 
#define AF_STYLE_FALLBACK   AF_STYLE_NONE_DFLT
 
#define AF_SCRIPT_DEFAULT   AF_SCRIPT_LATN
 
#define AF_STYLE_MASK   0x3FFF
 
#define AF_STYLE_UNASSIGNED   AF_STYLE_MASK
 
#define AF_DIGIT   0x8000U
 
#define AF_NONBASE   0x4000U
 
#define AF_PROP_INCREASE_X_HEIGHT_MIN   6
 
#define AF_PROP_INCREASE_X_HEIGHT_MAX   0
 

Typedefs

typedef struct AF_FaceGlobalsRec_ AF_FaceGlobalsRec
 

Functions

 af_face_globals_new (FT_Face face, AF_FaceGlobals *aglobals, AF_Module module)
 
 af_face_globals_get_metrics (AF_FaceGlobals globals, FT_UInt gindex, FT_UInt options, AF_StyleMetrics *ametrics)
 
 af_face_globals_free (AF_FaceGlobals globals)
 
 af_face_globals_is_digit (AF_FaceGlobals globals, FT_UInt gindex)
 

Variables

FT_BEGIN_HEADER af_writing_system_classes []
 
 af_script_classes []
 
 af_style_classes []
 

Macro Definition Documentation

◆ AF_DIGIT

#define AF_DIGIT   0x8000U

Definition at line 82 of file afglobal.h.

◆ AF_NONBASE

#define AF_NONBASE   0x4000U

Definition at line 84 of file afglobal.h.

◆ AF_PROP_INCREASE_X_HEIGHT_MAX

#define AF_PROP_INCREASE_X_HEIGHT_MAX   0

Definition at line 88 of file afglobal.h.

◆ AF_PROP_INCREASE_X_HEIGHT_MIN

#define AF_PROP_INCREASE_X_HEIGHT_MIN   6

Definition at line 87 of file afglobal.h.

◆ AF_SCRIPT_DEFAULT

#define AF_SCRIPT_DEFAULT   AF_SCRIPT_LATN

Definition at line 74 of file afglobal.h.

◆ AF_STYLE_FALLBACK

#define AF_STYLE_FALLBACK   AF_STYLE_NONE_DFLT

Definition at line 71 of file afglobal.h.

◆ AF_STYLE_MASK

#define AF_STYLE_MASK   0x3FFF

Definition at line 77 of file afglobal.h.

◆ AF_STYLE_UNASSIGNED

#define AF_STYLE_UNASSIGNED   AF_STYLE_MASK

Definition at line 79 of file afglobal.h.

◆ SCRIPT

#define SCRIPT (   s,
  S,
  d,
  h,
  H,
  ss 
)     AF_DECLARE_SCRIPT_CLASS( af_ ## s ## _script_class )

Definition at line 37 of file afglobal.h.

◆ STYLE

#define STYLE (   s,
  S,
  d,
  ws,
  sc,
  ss,
  c 
)     AF_DECLARE_STYLE_CLASS( af_ ## s ## _style_class )

Definition at line 47 of file afglobal.h.

Typedef Documentation

◆ AF_FaceGlobalsRec

Function Documentation

◆ af_face_globals_free()

af_face_globals_free ( AF_FaceGlobals  globals)

Definition at line 382 of file afglobal.c.

383 {
384 if ( globals )
385 {
386 FT_Memory memory = globals->face->memory;
387 FT_UInt nn;
388
389
390 for ( nn = 0; nn < AF_STYLE_MAX; nn++ )
391 {
392 if ( globals->metrics[nn] )
393 {
394 AF_StyleClass style_class =
396 AF_WritingSystemClass writing_system_class =
398
399
400 if ( writing_system_class->style_metrics_done )
401 writing_system_class->style_metrics_done( globals->metrics[nn] );
402
403 FT_FREE( globals->metrics[nn] );
404 }
405 }
406
407#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
408 hb_font_destroy( globals->hb_font );
409 hb_buffer_destroy( globals->hb_buf );
410#endif
411
412 /* no need to free `globals->glyph_styles'; */
413 /* it is part of the `globals' array */
414 FT_FREE( globals );
415 }
416 }
af_style_classes[]
Definition: afglobal.c:102
af_writing_system_classes[]
Definition: afglobal.c:74
@ AF_STYLE_MAX
Definition: aftypes.h:442
#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
static char memory[1024 *256]
Definition: process.c:116
AF_StyleMetrics metrics[AF_STYLE_MAX]
Definition: afglobal.h:119
AF_WritingSystem writing_system
Definition: aftypes.h:451
AF_WritingSystem_DoneMetricsFunc style_metrics_done
Definition: aftypes.h:285
FT_Memory memory
Definition: freetype.h:1085

Referenced by af_face_globals_new(), af_loader_reset(), and af_property_get_face_globals().

◆ af_face_globals_get_metrics()

af_face_globals_get_metrics ( AF_FaceGlobals  globals,
FT_UInt  gindex,
FT_UInt  options,
AF_StyleMetrics ametrics 
)

Definition at line 420 of file afglobal.c.

424 {
426
428 AF_WritingSystemClass writing_system_class;
429 AF_StyleClass style_class;
430
432
433
434 if ( gindex >= (FT_ULong)globals->glyph_count )
435 {
436 error = FT_THROW( Invalid_Argument );
437 goto Exit;
438 }
439
440 /* if we have a forced style (via `options'), use it, */
441 /* otherwise look into `glyph_styles' array */
442 if ( style == AF_STYLE_NONE_DFLT || style + 1 >= AF_STYLE_MAX )
443 style = (AF_Style)( globals->glyph_styles[gindex] &
445
446 style_class = af_style_classes[style];
447 writing_system_class = af_writing_system_classes
448 [style_class->writing_system];
449
450 metrics = globals->metrics[style];
451 if ( !metrics )
452 {
453 /* create the global metrics object if necessary */
454 FT_Memory memory = globals->face->memory;
455
456
457 if ( FT_ALLOC( metrics, writing_system_class->style_metrics_size ) )
458 goto Exit;
459
460 metrics->style_class = style_class;
461 metrics->globals = globals;
462
463 if ( writing_system_class->style_metrics_init )
464 {
465 error = writing_system_class->style_metrics_init( metrics,
466 globals->face );
467 if ( error )
468 {
469 if ( writing_system_class->style_metrics_done )
470 writing_system_class->style_metrics_done( metrics );
471
472 FT_FREE( metrics );
473 goto Exit;
474 }
475 }
476
477 globals->metrics[style] = metrics;
478 }
479
480 Exit:
481 *ametrics = metrics;
482
483 return error;
484 }
#define AF_STYLE_UNASSIGNED
Definition: afglobal.h:79
Arabic default style
Definition: afstyles.h:94
enum AF_Style_ AF_Style
#define NULL
Definition: types.h:112
return FT_Err_Ok
Definition: ftbbox.c:527
#define FT_THROW(e)
Definition: ftdebug.h:241
#define FT_ALLOC(ptr, size)
Definition: ftmemory.h:302
unsigned long FT_ULong
Definition: fttypes.h:253
int FT_Error
Definition: fttypes.h:299
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
Definition: glext.h:11745
#define error(str)
Definition: mkdosfs.c:1605
static void Exit(void)
Definition: sock.c:1330
FT_UShort * glyph_styles
Definition: afglobal.h:109
FT_Long glyph_count
Definition: afglobal.h:108
FT_Offset style_metrics_size
Definition: aftypes.h:282
AF_WritingSystem_InitMetricsFunc style_metrics_init
Definition: aftypes.h:283

Referenced by af_loader_load_glyph().

◆ af_face_globals_is_digit()

af_face_globals_is_digit ( AF_FaceGlobals  globals,
FT_UInt  gindex 
)

Definition at line 488 of file afglobal.c.

490 {
491 if ( gindex < (FT_ULong)globals->glyph_count )
492 return FT_BOOL( globals->glyph_styles[gindex] & AF_DIGIT );
493
494 return FT_BOOL( 0 );
495 }
#define AF_DIGIT
Definition: afglobal.h:82
#define FT_BOOL(x)
Definition: fttypes.h:591

Referenced by af_loader_load_glyph().

◆ af_face_globals_new()

af_face_globals_new ( FT_Face  face,
AF_FaceGlobals aglobals,
AF_Module  module 
)

Definition at line 331 of file afglobal.c.

334 {
337 AF_FaceGlobals globals = NULL;
338
339
340 memory = face->memory;
341
342 /* we allocate an AF_FaceGlobals structure together */
343 /* with the glyph_styles array */
344 if ( FT_ALLOC( globals,
345 sizeof ( *globals ) +
346 (FT_ULong)face->num_glyphs * sizeof ( FT_UShort ) ) )
347 goto Exit;
348
349 globals->face = face;
350 globals->glyph_count = face->num_glyphs;
351 /* right after the globals structure come the glyph styles */
352 globals->glyph_styles = (FT_UShort*)( globals + 1 );
353 globals->module = module;
354 globals->stem_darkening_for_ppem = 0;
355 globals->darken_x = 0;
356 globals->darken_y = 0;
357 globals->standard_vertical_width = 0;
358 globals->standard_horizontal_width = 0;
359 globals->scale_down_factor = 0;
360
361#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
362 globals->hb_font = hb_ft_font_create( face, NULL );
363 globals->hb_buf = hb_buffer_create();
364#endif
365
367 if ( error )
368 {
369 af_face_globals_free( globals );
370 globals = NULL;
371 }
372 else
374
375 Exit:
376 *aglobals = globals;
377 return error;
378 }
af_face_globals_free(AF_FaceGlobals globals)
Definition: afglobal.c:382
static FT_Error af_face_globals_compute_style_coverage(AF_FaceGlobals globals)
Definition: afglobal.c:130
#define AF_PROP_INCREASE_X_HEIGHT_MAX
Definition: afglobal.h:88
WORD face[3]
Definition: mesh.c:4747
unsigned short FT_UShort
Definition: fttypes.h:209
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
AF_Module module
Definition: afglobal.h:137
FT_UShort stem_darkening_for_ppem
Definition: afglobal.h:123
FT_Pos standard_horizontal_width
Definition: afglobal.h:129
FT_Pos standard_vertical_width
Definition: afglobal.h:126
FT_UInt increase_x_height
Definition: afglobal.h:117
FT_Fixed scale_down_factor
Definition: afglobal.h:136
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

Referenced by af_loader_reset(), and af_property_get_face_globals().

Variable Documentation

◆ af_script_classes

af_script_classes[]

Definition at line 43 of file afglobal.h.

◆ af_style_classes

af_style_classes[]

Definition at line 53 of file afglobal.h.

◆ af_writing_system_classes

FT_BEGIN_HEADER af_writing_system_classes[]

Definition at line 33 of file afglobal.h.