#include <ft2build.h>
#include "sfdriver.h"
#include "ttload.h"
#include "sfobjs.h"
#include "sferrors.h"
#include "ttcmap.h"
#include "ttkern.h"
#include "ttmtx.h"
Go to the source code of this file.
|
static void * | get_sfnt_table (TT_Face face, FT_Sfnt_Tag tag) |
|
static FT_Error | sfnt_table_info (TT_Face face, FT_UInt idx, FT_ULong *tag, FT_ULong *offset, FT_ULong *length) |
|
| FT_DEFINE_SERVICE_SFNT_TABLEREC (sfnt_service_sfnt_table,(FT_SFNT_TableLoadFunc) tt_face_load_any,(FT_SFNT_TableGetFunc) get_sfnt_table,(FT_SFNT_TableInfoFunc) sfnt_table_info) static const unsigned char sfnt_ps_map[16] |
|
static int | sfnt_is_postscript (int c) |
|
static char * | get_win_string (FT_Memory memory, FT_Stream stream, TT_Name entry, char_type_func char_type, FT_Bool report_invalid_characters) |
|
static char * | get_apple_string (FT_Memory memory, FT_Stream stream, TT_Name entry, char_type_func char_type, FT_Bool report_invalid_characters) |
|
static FT_Bool | sfnt_get_name_id (TT_Face face, FT_UShort id, FT_Int *win, FT_Int *apple) |
|
static const char * | sfnt_get_ps_name (TT_Face face) |
|
| FT_DEFINE_SERVICE_PSFONTNAMEREC (sfnt_service_ps_name,(FT_PsName_GetFunc) sfnt_get_ps_name) FT_DEFINE_SERVICE_TTCMAPSREC(tt_service_get_cmap_info |
|
TT_CMap_Info_GetFunc tt_get_cmap_info | FT_DEFINE_SERVICEDESCREC3 (sfnt_services, FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table, FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name, FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info) sfnt_get_interface(FT_Module module |
|
return | ft_service_list_lookup (sfnt_services, module_interface) |
|
◆ FT_COMPONENT
◆ IS_APPLE
Value: ( (
n)->platformID == 1 && \
Definition at line 471 of file sfdriver.c.
◆ IS_WIN
Value: ( (
n)->platformID == 3 && \
( (
n)->encodingID == 1 || (
n)->encodingID == 0 ) )
Definition at line 468 of file sfdriver.c.
◆ PUT_COLOR_LAYERS
◆ PUT_EMBEDDED_BITMAPS
◆ PUT_PS_NAMES
◆ char_type_func
typedef int(* char_type_func) (int c) |
◆ FT_DEFINE_SERVICE_PSFONTNAMEREC()
FT_DEFINE_SERVICE_PSFONTNAMEREC |
( |
sfnt_service_ps_name |
, |
|
|
(FT_PsName_GetFunc) |
sfnt_get_ps_name |
|
) |
| |
◆ FT_DEFINE_SERVICE_SFNT_TABLEREC()
◆ FT_DEFINE_SERVICEDESCREC3()
◆ ft_service_list_lookup()
◆ get_apple_string()
Definition at line 534 of file sfdriver.c.
539 {
541
546
548
549
552
555 goto get_apple_string_error;
556
559
561 {
562 if ( char_type( *
p ) )
564 else
565 {
566 if ( report_invalid_characters )
568 " Character `%c' (0x%X) invalid in PS name string\n",
570 break;
571 }
572 }
575
577
580
581 get_apple_string_error:
583
584 entry->stringOffset = 0;
585 entry->stringLength = 0;
587
589 }
#define FT_TRACE0(varformat)
#define FT_ALLOC(ptr, size)
#define FT_FRAME_ENTER(size)
#define FT_STREAM_SEEK(position)
GLdouble GLdouble GLdouble r
Referenced by sfnt_get_ps_name().
◆ get_sfnt_table()
Definition at line 80 of file sfdriver.c.
82 {
84
85
87 {
90 break;
91
94 break;
95
98 break;
99
102 break;
103
106 break;
107
110 break;
111
114 break;
115
116 default:
118 }
119
121 }
GLenum GLuint GLint GLenum face
◆ get_win_string()
Definition at line 475 of file sfdriver.c.
480 {
482
487
489
490
493
496 goto get_win_string_error;
497
500
502 {
503 if (
p[0] == 0 && char_type(
p[1] ) )
505 else
506 {
507 if ( report_invalid_characters )
509 " Character 0x%X invalid in PS name string\n",
510 ((
unsigned)
p[0])*256 + (
unsigned)
p[1] ));
511 break;
512 }
513 }
516
518
521
522 get_win_string_error:
524
525 entry->stringLength = 0;
526 entry->stringOffset = 0;
528
530 }
Referenced by sfnt_get_ps_name().
◆ sfnt_get_name_id()
Definition at line 593 of file sfdriver.c.
597 {
599
600
602 *apple = -1;
603
604 for (
n = 0;
n <
face->num_names;
n++ )
605 {
607
608
609 if (
name->nameID ==
id &&
name->stringLength > 0 )
610 {
613
616 }
617 }
618
619 return ( *
win >= 0 ) || ( *apple >= 0 );
620 }
Referenced by sfnt_get_ps_name().
◆ sfnt_get_ps_name()
Definition at line 1031 of file sfdriver.c.
1032 {
1035
1036
1037 if (
face->postscript_name )
1038 return face->postscript_name;
1039
1040#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
1044 {
1045 face->postscript_name = sfnt_get_var_ps_name(
face );
1046 return face->postscript_name;
1047 }
1048#endif
1049
1050
1051
1053 if ( !found )
1055
1056
1059 face->name_table.stream,
1062 1 );
1063 if ( !
result && apple != -1 )
1065 face->name_table.stream,
1066 face->name_table.names + apple,
1068 1 );
1069
1071
1073 }
#define FT_IS_VARIATION(face)
#define FT_IS_NAMED_INSTANCE(face)
static char * get_win_string(FT_Memory memory, FT_Stream stream, TT_Name entry, char_type_func char_type, FT_Bool report_invalid_characters)
static char * get_apple_string(FT_Memory memory, FT_Stream stream, TT_Name entry, char_type_func char_type, FT_Bool report_invalid_characters)
static FT_Bool sfnt_get_name_id(TT_Face face, FT_UShort id, FT_Int *win, FT_Int *apple)
static int sfnt_is_postscript(int c)
#define TT_NAME_ID_PS_NAME
◆ sfnt_is_postscript()
static int sfnt_is_postscript |
( |
int |
c | ) |
|
|
static |
Definition at line 249 of file sfdriver.c.
250 {
252
253
254 if ( c < 0 || c >= 0x80 )
255 return 0;
256
258
259 return sfnt_ps_map[
cc >> 3] & ( 1 << (
cc & 0x07 ) );
260 }
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Referenced by sfnt_get_ps_name().
◆ sfnt_table_info()
Definition at line 125 of file sfdriver.c.
130 {
132 return FT_THROW( Invalid_Argument );
133
136 else
137 {
140
144 }
145
147 }
GLuint GLsizei GLsizei * length
◆ module_interface