Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed





























































Rev Author Line No. Line
4349 Serge 1
2
"http://www.w3.org/TR/html4/loose.dtd">
3
4
5
6
FreeType-2.5.0 API Reference
7
32
33
34
 
35
[Index]
36
37
[TOC]
38

FreeType-2.5.0 API Reference

39
 
40

41
TrueType Tables
42
43

Synopsis

44
45
TT_PLATFORM_XXXTT_Postscript
46
TT_APPLE_ID_XXXTT_PCLT
47
TT_MAC_ID_XXXTT_MaxProfile
48
TT_ISO_ID_XXXFT_Sfnt_Tag
49
TT_MS_ID_XXXFT_Get_Sfnt_Table
50
TT_ADOBE_ID_XXXFT_Load_Sfnt_Table
51
TT_HeaderFT_Sfnt_Table_Info
52
TT_HoriHeaderFT_Get_CMap_Language_ID
53
TT_VertHeaderFT_Get_CMap_Format
54
TT_OS2FT_PARAM_TAG_UNPATENTED_HINTING
55


56
 
57
58

This section contains the definition of TrueType-specific tables as well as some routines used to access and process them.

59

60
61

TT_PLATFORM_XXX

62
63
Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h).
64

65
66
 
67
#define TT_PLATFORM_APPLE_UNICODE  0
68
#define TT_PLATFORM_MACINTOSH      1
69
#define TT_PLATFORM_ISO            2 /* deprecated */
70
#define TT_PLATFORM_MICROSOFT      3
71
#define TT_PLATFORM_CUSTOM         4
72
#define TT_PLATFORM_ADOBE          7 /* artificial */
73
 
74

75
76

A list of valid values for the ‘platform_id’ identifier code in FT_CharMapRec and FT_SfntName structures.

77

78
values
79

80
81
TT_PLATFORM_APPLE_UNICODE
82
83

Used by Apple to indicate a Unicode character map and/or name entry. See TT_APPLE_ID_XXX for corresponding ‘encoding_id’ values. Note that name entries in this format are coded as big-endian UCS-2 character codes only.

84
85
TT_PLATFORM_MACINTOSH
86

Used by Apple to indicate a MacOS-specific charmap and/or name entry. See TT_MAC_ID_XXX for corresponding ‘encoding_id’ values. Note that most TrueType fonts contain an Apple roman charmap to be usable on MacOS systems (even if they contain a Microsoft charmap as well).

87
88
TT_PLATFORM_ISO
89

This value was used to specify ISO/IEC 10646 charmaps. It is however now deprecated. See TT_ISO_ID_XXX for a list of corresponding ‘encoding_id’ values.

90
91
TT_PLATFORM_MICROSOFT
92

Used by Microsoft to indicate Windows-specific charmaps. See TT_MS_ID_XXX for a list of corresponding ‘encoding_id’ values. Note that most fonts contain a Unicode charmap using (TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS).

93
94
TT_PLATFORM_CUSTOM
95

Used to indicate application-specific charmaps.

96
97
TT_PLATFORM_ADOBE
98

This value isn't part of any font format specification, but is used by FreeType to report Adobe-specific charmaps in an FT_CharMapRec structure. See TT_ADOBE_ID_XXX.

99
100
101
102
103

104
[Index]
105
106
[TOC]
107
 
108
109

TT_APPLE_ID_XXX

110
111
Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h).
112

113
114
 
115
#define TT_APPLE_ID_DEFAULT           0 /* Unicode 1.0 */
116
#define TT_APPLE_ID_UNICODE_1_1       1 /* specify Hangul at U+34xx */
117
#define TT_APPLE_ID_ISO_10646         2 /* deprecated */
118
#define TT_APPLE_ID_UNICODE_2_0       3 /* or later */
119
#define TT_APPLE_ID_UNICODE_32        4 /* 2.0 or later, full repertoire */
120
#define TT_APPLE_ID_VARIANT_SELECTOR  5 /* variation selector data */
121
 
122

123
124

A list of valid values for the ‘encoding_id’ for TT_PLATFORM_APPLE_UNICODE charmaps and name entries.

125

126
values
127

128
129
TT_APPLE_ID_DEFAULT
130

Unicode version 1.0.

131
132
TT_APPLE_ID_UNICODE_1_1
133
134

Unicode 1.1; specifies Hangul characters starting at U+34xx.

135
136
TT_APPLE_ID_ISO_10646
137

Deprecated (identical to preceding).

138
139
TT_APPLE_ID_UNICODE_2_0
140
141

Unicode 2.0 and beyond (UTF-16 BMP only).

142
143
TT_APPLE_ID_UNICODE_32
144

Unicode 3.1 and beyond, using UTF-32.

145
146
TT_APPLE_ID_VARIANT_SELECTOR
147
148

From Adobe, not Apple. Not a normal cmap. Specifies variations on a real cmap.

149
150
151
152
153

154
[Index]
155
156
[TOC]
157
 
158
159

TT_MAC_ID_XXX

160
161
Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h).
162

163
164
 
165
#define TT_MAC_ID_ROMAN                 0
166
#define TT_MAC_ID_JAPANESE              1
167
#define TT_MAC_ID_TRADITIONAL_CHINESE   2
168
#define TT_MAC_ID_KOREAN                3
169
#define TT_MAC_ID_ARABIC                4
170
#define TT_MAC_ID_HEBREW                5
171
#define TT_MAC_ID_GREEK                 6
172
#define TT_MAC_ID_RUSSIAN               7
173
#define TT_MAC_ID_RSYMBOL               8
174
#define TT_MAC_ID_DEVANAGARI            9
175
#define TT_MAC_ID_GURMUKHI             10
176
#define TT_MAC_ID_GUJARATI             11
177
#define TT_MAC_ID_ORIYA                12
178
#define TT_MAC_ID_BENGALI              13
179
#define TT_MAC_ID_TAMIL                14
180
#define TT_MAC_ID_TELUGU               15
181
#define TT_MAC_ID_KANNADA              16
182
#define TT_MAC_ID_MALAYALAM            17
183
#define TT_MAC_ID_SINHALESE            18
184
#define TT_MAC_ID_BURMESE              19
185
#define TT_MAC_ID_KHMER                20
186
#define TT_MAC_ID_THAI                 21
187
#define TT_MAC_ID_LAOTIAN              22
188
#define TT_MAC_ID_GEORGIAN             23
189
#define TT_MAC_ID_ARMENIAN             24
190
#define TT_MAC_ID_MALDIVIAN            25
191
#define TT_MAC_ID_SIMPLIFIED_CHINESE   25
192
#define TT_MAC_ID_TIBETAN              26
193
#define TT_MAC_ID_MONGOLIAN            27
194
#define TT_MAC_ID_GEEZ                 28
195
#define TT_MAC_ID_SLAVIC               29
196
#define TT_MAC_ID_VIETNAMESE           30
197
#define TT_MAC_ID_SINDHI               31
198
#define TT_MAC_ID_UNINTERP             32
199
 
200

201
202

A list of valid values for the ‘encoding_id’ for TT_PLATFORM_MACINTOSH charmaps and name entries.

203

204
values
205

206
207
TT_MAC_ID_ROMAN
208

209
210
TT_MAC_ID_JAPANESE
211

212
213
TT_MAC_ID_TRADITIONAL_CHINESE
214
215

216
217
TT_MAC_ID_KOREAN
218

219
220
TT_MAC_ID_ARABIC
221

222
223
TT_MAC_ID_HEBREW
224

225
226
TT_MAC_ID_GREEK
227

228
229
TT_MAC_ID_RUSSIAN
230

231
232
TT_MAC_ID_RSYMBOL
233

234
235
TT_MAC_ID_DEVANAGARI
236

237
238
TT_MAC_ID_GURMUKHI
239

240
241
TT_MAC_ID_GUJARATI
242

243
244
TT_MAC_ID_ORIYA
245

246
247
TT_MAC_ID_BENGALI
248

249
250
TT_MAC_ID_TAMIL
251

252
253
TT_MAC_ID_TELUGU
254

255
256
TT_MAC_ID_KANNADA
257

258
259
TT_MAC_ID_MALAYALAM
260

261
262
TT_MAC_ID_SINHALESE
263

264
265
TT_MAC_ID_BURMESE
266

267
268
TT_MAC_ID_KHMER
269

270
271
TT_MAC_ID_THAI
272

273
274
TT_MAC_ID_LAOTIAN
275

276
277
TT_MAC_ID_GEORGIAN
278

279
280
TT_MAC_ID_ARMENIAN
281

282
283
TT_MAC_ID_MALDIVIAN
284

285
286
TT_MAC_ID_SIMPLIFIED_CHINESE
287
288

289
290
TT_MAC_ID_TIBETAN
291

292
293
TT_MAC_ID_MONGOLIAN
294

295
296
TT_MAC_ID_GEEZ
297

298
299
TT_MAC_ID_SLAVIC
300

301
302
TT_MAC_ID_VIETNAMESE
303

304
305
TT_MAC_ID_SINDHI
306

307
308
TT_MAC_ID_UNINTERP
309

310
311
312
313
314

315
[Index]
316
317
[TOC]
318
 
319
320

TT_ISO_ID_XXX

321
322
Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h).
323

324
325
 
326
#define TT_ISO_ID_7BIT_ASCII  0
327
#define TT_ISO_ID_10646       1
328
#define TT_ISO_ID_8859_1      2
329
 
330

331
332

A list of valid values for the ‘encoding_id’ for TT_PLATFORM_ISO charmaps and name entries.

333

Their use is now deprecated.

334

335
values
336

337
338
TT_ISO_ID_7BIT_ASCII
339

ASCII.

340
341
TT_ISO_ID_10646
342

ISO/10646.

343
344
TT_ISO_ID_8859_1
345

Also known as Latin-1.

346
347
348
349
350

351
[Index]
352
353
[TOC]
354
 
355
356

TT_MS_ID_XXX

357
358
Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h).
359

360
361
 
362
#define TT_MS_ID_SYMBOL_CS    0
363
#define TT_MS_ID_UNICODE_CS   1
364
#define TT_MS_ID_SJIS         2
365
#define TT_MS_ID_GB2312       3
366
#define TT_MS_ID_BIG_5        4
367
#define TT_MS_ID_WANSUNG      5
368
#define TT_MS_ID_JOHAB        6
369
#define TT_MS_ID_UCS_4       10
370
 
371

372
373

A list of valid values for the ‘encoding_id’ for TT_PLATFORM_MICROSOFT charmaps and name entries.

374

375
values
376

377
378
TT_MS_ID_SYMBOL_CS
379

Corresponds to Microsoft symbol encoding. See FT_ENCODING_MS_SYMBOL.

380
381
TT_MS_ID_UNICODE_CS
382

Corresponds to a Microsoft WGL4 charmap, matching Unicode. See FT_ENCODING_UNICODE.

383
384
TT_MS_ID_SJIS
385

Corresponds to SJIS Japanese encoding. See FT_ENCODING_SJIS.

386
387
TT_MS_ID_GB2312
388

Corresponds to Simplified Chinese as used in Mainland China. See FT_ENCODING_GB2312.

389
390
TT_MS_ID_BIG_5
391

Corresponds to Traditional Chinese as used in Taiwan and Hong Kong. See FT_ENCODING_BIG5.

392
393
TT_MS_ID_WANSUNG
394

Corresponds to Korean Wansung encoding. See FT_ENCODING_WANSUNG.

395
396
TT_MS_ID_JOHAB
397

Corresponds to Johab encoding. See FT_ENCODING_JOHAB.

398
399
TT_MS_ID_UCS_4
400

Corresponds to UCS-4 or UTF-32 charmaps. This has been added to the OpenType specification version 1.4 (mid-2001.)

401
402
403
404
405

406
[Index]
407
408
[TOC]
409
 
410
411

TT_ADOBE_ID_XXX

412
413
Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h).
414

415
416
 
417
#define TT_ADOBE_ID_STANDARD  0
418
#define TT_ADOBE_ID_EXPERT    1
419
#define TT_ADOBE_ID_CUSTOM    2
420
#define TT_ADOBE_ID_LATIN_1   3
421
 
422

423
424

A list of valid values for the ‘encoding_id’ for TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension!

425

426
values
427

428
429
TT_ADOBE_ID_STANDARD
430

Adobe standard encoding.

431
432
TT_ADOBE_ID_EXPERT
433

Adobe expert encoding.

434
435
TT_ADOBE_ID_CUSTOM
436

Adobe custom encoding.

437
438
TT_ADOBE_ID_LATIN_1
439

Adobe Latin 1 encoding.

440
441
442
443
444

445
[Index]
446
447
[TOC]
448
 
449
450

TT_Header

451
452
Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
453

454
455
 
456
  typedef struct  TT_Header_
457
  {
458
    FT_Fixed   Table_Version;
459
    FT_Fixed   Font_Revision;
460
 
461
    FT_Long    CheckSum_Adjust;
462
    FT_Long    Magic_Number;
463
 
464
    FT_UShort  Flags;
465
    FT_UShort  Units_Per_EM;
466
 
467
    FT_Long    Created [2];
468
    FT_Long    Modified[2];
469
 
470
    FT_Short   xMin;
471
    FT_Short   yMin;
472
    FT_Short   xMax;
473
    FT_Short   yMax;
474
 
475
    FT_UShort  Mac_Style;
476
    FT_UShort  Lowest_Rec_PPEM;
477
 
478
    FT_Short   Font_Direction;
479
    FT_Short   Index_To_Loc_Format;
480
    FT_Short   Glyph_Data_Format;
481
 
482
  } TT_Header;
483
 
484

485
486

A structure used to model a TrueType font header table. All fields follow the TrueType specification.

487

488
489

490
[Index]
491
492
[TOC]
493
 
494
495

TT_HoriHeader

496
497
Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
498

499
500
 
501
  typedef struct  TT_HoriHeader_
502
  {
503
    FT_Fixed   Version;
504
    FT_Short   Ascender;
505
    FT_Short   Descender;
506
    FT_Short   Line_Gap;
507
 
508
    FT_UShort  advance_Width_Max;      /* advance width maximum */
509
 
510
    FT_Short   min_Left_Side_Bearing;  /* minimum left-sb       */
511
    FT_Short   min_Right_Side_Bearing; /* minimum right-sb      */
512
    FT_Short   xMax_Extent;            /* xmax extents          */
513
    FT_Short   caret_Slope_Rise;
514
    FT_Short   caret_Slope_Run;
515
    FT_Short   caret_Offset;
516
 
517
    FT_Short   Reserved[4];
518
 
519
    FT_Short   metric_Data_Format;
520
    FT_UShort  number_Of_HMetrics;
521
 
522
    /* The following fields are not defined by the TrueType specification */
523
    /* but they are used to connect the metrics header to the relevant    */
524
    /* `HMTX' table.                                                      */
525
 
526
    void*      long_metrics;
527
    void*      short_metrics;
528
 
529
  } TT_HoriHeader;
530
 
531

532
533

A structure used to model a TrueType horizontal header, the ‘hhea’ table, as well as the corresponding horizontal metrics table, i.e., the ‘hmtx’ table.

534

535
fields
536

537
538
Version
539

The table version.

540
541
Ascender
542

The font's ascender, i.e., the distance from the baseline to the top-most of all glyph points found in the font.

543

This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII).

544

You should use the ‘sTypoAscender’ field of the OS/2 table instead if you want the correct one.

545
546
Descender
547

The font's descender, i.e., the distance from the baseline to the bottom-most of all glyph points found in the font. It is negative.

548

This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII).

549

You should use the ‘sTypoDescender’ field of the OS/2 table instead if you want the correct one.

550
551
Line_Gap
552

The font's line gap, i.e., the distance to add to the ascender and descender to get the BTB, i.e., the baseline-to-baseline distance for the font.

553
554
advance_Width_Max
555

This field is the maximum of all advance widths found in the font. It can be used to compute the maximum width of an arbitrary string of text.

556
557
min_Left_Side_Bearing
558

The minimum left side bearing of all glyphs within the font.

559
560
min_Right_Side_Bearing
561

The minimum right side bearing of all glyphs within the font.

562
563
xMax_Extent
564

The maximum horizontal extent (i.e., the ‘width’ of a glyph's bounding box) for all glyphs in the font.

565
566
caret_Slope_Rise
567

The rise coefficient of the cursor's slope of the cursor (slope=rise/run).

568
569
caret_Slope_Run
570

The run coefficient of the cursor's slope.

571
572
Reserved
573

8 reserved bytes.

574
575
metric_Data_Format
576

Always 0.

577
578
number_Of_HMetrics
579

Number of HMetrics entries in the ‘hmtx’ table -- this value can be smaller than the total number of glyphs in the font.

580
581
long_metrics
582

A pointer into the ‘hmtx’ table.

583
584
short_metrics
585

A pointer into the ‘hmtx’ table.

586
587
588
589
note
590

IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should be identical except for the names of their fields which are different.

591

This ensures that a single function in the ‘ttload’ module is able to read both the horizontal and vertical headers.

592
593
594

595
[Index]
596
597
[TOC]
598
 
599
600

TT_VertHeader

601
602
Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
603

604
605
 
606
  typedef struct  TT_VertHeader_
607
  {
608
    FT_Fixed   Version;
609
    FT_Short   Ascender;
610
    FT_Short   Descender;
611
    FT_Short   Line_Gap;
612
 
613
    FT_UShort  advance_Height_Max;      /* advance height maximum */
614
 
615
    FT_Short   min_Top_Side_Bearing;    /* minimum left-sb or top-sb       */
616
    FT_Short   min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb   */
617
    FT_Short   yMax_Extent;             /* xmax or ymax extents            */
618
    FT_Short   caret_Slope_Rise;
619
    FT_Short   caret_Slope_Run;
620
    FT_Short   caret_Offset;
621
 
622
    FT_Short   Reserved[4];
623
 
624
    FT_Short   metric_Data_Format;
625
    FT_UShort  number_Of_VMetrics;
626
 
627
    /* The following fields are not defined by the TrueType specification */
628
    /* but they're used to connect the metrics header to the relevant     */
629
    /* `HMTX' or `VMTX' table.                                            */
630
 
631
    void*      long_metrics;
632
    void*      short_metrics;
633
 
634
  } TT_VertHeader;
635
 
636

637
638

A structure used to model a TrueType vertical header, the ‘vhea’ table, as well as the corresponding vertical metrics table, i.e., the ‘vmtx’ table.

639

640
fields
641

642
643
Version
644

The table version.

645
646
Ascender
647

The font's ascender, i.e., the distance from the baseline to the top-most of all glyph points found in the font.

648

This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII).

649

You should use the ‘sTypoAscender’ field of the OS/2 table instead if you want the correct one.

650
651
Descender
652

The font's descender, i.e., the distance from the baseline to the bottom-most of all glyph points found in the font. It is negative.

653

This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII).

654

You should use the ‘sTypoDescender’ field of the OS/2 table instead if you want the correct one.

655
656
Line_Gap
657

The font's line gap, i.e., the distance to add to the ascender and descender to get the BTB, i.e., the baseline-to-baseline distance for the font.

658
659
advance_Height_Max
660

This field is the maximum of all advance heights found in the font. It can be used to compute the maximum height of an arbitrary string of text.

661
662
min_Top_Side_Bearing
663

The minimum top side bearing of all glyphs within the font.

664
665
min_Bottom_Side_Bearing
666
667

The minimum bottom side bearing of all glyphs within the font.

668
669
yMax_Extent
670

The maximum vertical extent (i.e., the ‘height’ of a glyph's bounding box) for all glyphs in the font.

671
672
caret_Slope_Rise
673

The rise coefficient of the cursor's slope of the cursor (slope=rise/run).

674
675
caret_Slope_Run
676

The run coefficient of the cursor's slope.

677
678
caret_Offset
679

The cursor's offset for slanted fonts. This value is ‘reserved’ in vmtx version 1.0.

680
681
Reserved
682

8 reserved bytes.

683
684
metric_Data_Format
685

Always 0.

686
687
number_Of_HMetrics
688

Number of VMetrics entries in the ‘vmtx’ table -- this value can be smaller than the total number of glyphs in the font.

689
690
long_metrics
691

A pointer into the ‘vmtx’ table.

692
693
short_metrics
694

A pointer into the ‘vmtx’ table.

695
696
697
698
note
699

IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should be identical except for the names of their fields which are different.

700

This ensures that a single function in the ‘ttload’ module is able to read both the horizontal and vertical headers.

701
702
703

704
[Index]
705
706
[TOC]
707
 
708
709

TT_OS2

710
711
Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
712

713
714
 
715
  typedef struct  TT_OS2_
716
  {
717
    FT_UShort  version;                /* 0x0001 - more or 0xFFFF */
718
    FT_Short   xAvgCharWidth;
719
    FT_UShort  usWeightClass;
720
    FT_UShort  usWidthClass;
721
    FT_Short   fsType;
722
    FT_Short   ySubscriptXSize;
723
    FT_Short   ySubscriptYSize;
724
    FT_Short   ySubscriptXOffset;
725
    FT_Short   ySubscriptYOffset;
726
    FT_Short   ySuperscriptXSize;
727
    FT_Short   ySuperscriptYSize;
728
    FT_Short   ySuperscriptXOffset;
729
    FT_Short   ySuperscriptYOffset;
730
    FT_Short   yStrikeoutSize;
731
    FT_Short   yStrikeoutPosition;
732
    FT_Short   sFamilyClass;
733
 
734
    FT_Byte    panose[10];
735
 
736
    FT_ULong   ulUnicodeRange1;        /* Bits 0-31   */
737
    FT_ULong   ulUnicodeRange2;        /* Bits 32-63  */
738
    FT_ULong   ulUnicodeRange3;        /* Bits 64-95  */
739
    FT_ULong   ulUnicodeRange4;        /* Bits 96-127 */
740
 
741
    FT_Char    achVendID[4];
742
 
743
    FT_UShort  fsSelection;
744
    FT_UShort  usFirstCharIndex;
745
    FT_UShort  usLastCharIndex;
746
    FT_Short   sTypoAscender;
747
    FT_Short   sTypoDescender;
748
    FT_Short   sTypoLineGap;
749
    FT_UShort  usWinAscent;
750
    FT_UShort  usWinDescent;
751
 
752
    /* only version 1 tables: */
753
 
754
    FT_ULong   ulCodePageRange1;       /* Bits 0-31   */
755
    FT_ULong   ulCodePageRange2;       /* Bits 32-63  */
756
 
757
    /* only version 2 tables: */
758
 
759
    FT_Short   sxHeight;
760
    FT_Short   sCapHeight;
761
    FT_UShort  usDefaultChar;
762
    FT_UShort  usBreakChar;
763
    FT_UShort  usMaxContext;
764
 
765
  } TT_OS2;
766
 
767

768
769

A structure used to model a TrueType OS/2 table. This is the long table version. All fields comply to the TrueType specification.

770

Note that we now support old Mac fonts which do not include an OS/2 table. In this case, the ‘version’ field is always set to 0xFFFF.

771

772
773

774
[Index]
775
776
[TOC]
777
 
778
779

TT_Postscript

780
781
Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
782

783
784
 
785
  typedef struct  TT_Postscript_
786
  {
787
    FT_Fixed  FormatType;
788
    FT_Fixed  italicAngle;
789
    FT_Short  underlinePosition;
790
    FT_Short  underlineThickness;
791
    FT_ULong  isFixedPitch;
792
    FT_ULong  minMemType42;
793
    FT_ULong  maxMemType42;
794
    FT_ULong  minMemType1;
795
    FT_ULong  maxMemType1;
796
 
797
    /* Glyph names follow in the file, but we don't   */
798
    /* load them by default.  See the ttpost.c file.  */
799
 
800
  } TT_Postscript;
801
 
802

803
804

A structure used to model a TrueType PostScript table. All fields comply to the TrueType specification. This structure does not reference the PostScript glyph names, which can be nevertheless accessed with the ‘ttpost’ module.

805

806
807

808
[Index]
809
810
[TOC]
811
 
812
813

TT_PCLT

814
815
Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
816

817
818
 
819
  typedef struct  TT_PCLT_
820
  {
821
    FT_Fixed   Version;
822
    FT_ULong   FontNumber;
823
    FT_UShort  Pitch;
824
    FT_UShort  xHeight;
825
    FT_UShort  Style;
826
    FT_UShort  TypeFamily;
827
    FT_UShort  CapHeight;
828
    FT_UShort  SymbolSet;
829
    FT_Char    TypeFace[16];
830
    FT_Char    CharacterComplement[8];
831
    FT_Char    FileName[6];
832
    FT_Char    StrokeWeight;
833
    FT_Char    WidthType;
834
    FT_Byte    SerifStyle;
835
    FT_Byte    Reserved;
836
 
837
  } TT_PCLT;
838
 
839

840
841

A structure used to model a TrueType PCLT table. All fields comply to the TrueType specification.

842

843
844

845
[Index]
846
847
[TOC]
848
 
849
850

TT_MaxProfile

851
852
Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
853

854
855
 
856
  typedef struct  TT_MaxProfile_
857
  {
858
    FT_Fixed   version;
859
    FT_UShort  numGlyphs;
860
    FT_UShort  maxPoints;
861
    FT_UShort  maxContours;
862
    FT_UShort  maxCompositePoints;
863
    FT_UShort  maxCompositeContours;
864
    FT_UShort  maxZones;
865
    FT_UShort  maxTwilightPoints;
866
    FT_UShort  maxStorage;
867
    FT_UShort  maxFunctionDefs;
868
    FT_UShort  maxInstructionDefs;
869
    FT_UShort  maxStackElements;
870
    FT_UShort  maxSizeOfInstructions;
871
    FT_UShort  maxComponentElements;
872
    FT_UShort  maxComponentDepth;
873
 
874
  } TT_MaxProfile;
875
 
876

877
878

The maximum profile is a table containing many max values which can be used to pre-allocate arrays. This ensures that no memory allocation occurs during a glyph load.

879

880
fields
881

882
883
version
884

The version number.

885
886
numGlyphs
887

The number of glyphs in this TrueType font.

888
889
maxPoints
890

The maximum number of points in a non-composite TrueType glyph. See also the structure element ‘maxCompositePoints’.

891
892
maxContours
893

The maximum number of contours in a non-composite TrueType glyph. See also the structure element ‘maxCompositeContours’.

894
895
maxCompositePoints
896

The maximum number of points in a composite TrueType glyph. See also the structure element ‘maxPoints’.

897
898
maxCompositeContours
899

The maximum number of contours in a composite TrueType glyph. See also the structure element ‘maxContours’.

900
901
maxZones
902

The maximum number of zones used for glyph hinting.

903
904
maxTwilightPoints
905

The maximum number of points in the twilight zone used for glyph hinting.

906
907
maxStorage
908

The maximum number of elements in the storage area used for glyph hinting.

909
910
maxFunctionDefs
911

The maximum number of function definitions in the TrueType bytecode for this font.

912
913
maxInstructionDefs
914

The maximum number of instruction definitions in the TrueType bytecode for this font.

915
916
maxStackElements
917

The maximum number of stack elements used during bytecode interpretation.

918
919
maxSizeOfInstructions
920

The maximum number of TrueType opcodes used for glyph hinting.

921
922
maxComponentElements
923

The maximum number of simple (i.e., non- composite) glyphs in a composite glyph.

924
925
maxComponentDepth
926

The maximum nesting depth of composite glyphs.

927
928
929
930
note
931

This structure is only used during font loading.

932
933
934

935
[Index]
936
937
[TOC]
938
 
939
940

FT_Sfnt_Tag

941
942
Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
943

944
945
 
946
  typedef enum  FT_Sfnt_Tag_
947
  {
948
    ft_sfnt_head = 0,    /* TT_Header     */
949
    ft_sfnt_maxp = 1,    /* TT_MaxProfile */
950
    ft_sfnt_os2  = 2,    /* TT_OS2        */
951
    ft_sfnt_hhea = 3,    /* TT_HoriHeader */
952
    ft_sfnt_vhea = 4,    /* TT_VertHeader */
953
    ft_sfnt_post = 5,    /* TT_Postscript */
954
    ft_sfnt_pclt = 6,    /* TT_PCLT       */
955
 
956
    sfnt_max   /* internal end mark */
957
 
958
  } FT_Sfnt_Tag;
959
 
960

961
962

An enumeration used to specify the index of an SFNT table. Used in the FT_Get_Sfnt_Table API function.

963

964
965

966
[Index]
967
968
[TOC]
969
 
970
971

FT_Get_Sfnt_Table

972
973
Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
974

975
976
 
977
  FT_EXPORT( void* )
978
  FT_Get_Sfnt_Table( FT_Face      face,
979
                     FT_Sfnt_Tag  tag );
980
 
981

982
983

Return a pointer to a given SFNT table within a face.

984

985
input
986

987
988
face
989

A handle to the source.

990
991
tag
992

The index of the SFNT table.

993
994
995
996
return
997

A type-less pointer to the table. This will be 0 in case of error, or if the corresponding table was not found OR loaded from the file.

998

Use a typecast according to ‘tag’ to access the structure elements.

999
1000
note
1001

The table is owned by the face object and disappears with it.

1002

This function is only useful to access SFNT tables that are loaded by the sfnt, truetype, and opentype drivers. See FT_Sfnt_Tag for a list.

1003

Here an example how to access the ‘vhea’ table:

1004
1005
  TT_VertHeader*  vert_header;
1006
 
1007
 
1008
  vert_header =
1009
    (TT_VertHeader*)FT_Get_Sfnt_Table( face, ft_sfnt_vhea );
1010
1011
1012
1013

1014
[Index]
1015
1016
[TOC]
1017
 
1018
1019

FT_Load_Sfnt_Table

1020
1021
Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
1022

1023
1024
 
1025
  FT_EXPORT( FT_Error )
1026
  FT_Load_Sfnt_Table( FT_Face    face,
1027
                      FT_ULong   tag,
1028
                      FT_Long    offset,
1029
                      FT_Byte*   buffer,
1030
                      FT_ULong*  length );
1031
 
1032

1033
1034

Load any font table into client memory.

1035

1036
input
1037

1038
1039
face
1040

A handle to the source face.

1041
1042
tag
1043

The four-byte tag of the table to load. Use the value 0 if you want to access the whole font file. Otherwise, you can use one of the definitions found in the FT_TRUETYPE_TAGS_H file, or forge a new one with FT_MAKE_TAG.

1044
1045
offset
1046

The starting offset in the table (or file if tag == 0).

1047
1048
1049
1050
output
1051

1052
1053
buffer
1054

The target buffer address. The client must ensure that the memory array is big enough to hold the data.

1055
1056
1057
1058
inout
1059

1060
1061
length
1062

If the ‘length’ parameter is NULL, then try to load the whole table. Return an error code if it fails.

1063

Else, if ‘*length’ is 0, exit immediately while returning the table's (or file) full size in it.

1064

Else the number of bytes to read from the table or file, from the starting offset.

1065
1066
1067
1068
return
1069

FreeType error code. 0 means success.

1070
1071
note
1072

If you need to determine the table's length you should first call this function with ‘*length’ set to 0, as in the following example:

1073
1074
  FT_ULong  length = 0;
1075
 
1076
 
1077
  error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
1078
  if ( error ) { ... table does not exist ... }
1079
 
1080
  buffer = malloc( length );
1081
  if ( buffer == NULL ) { ... not enough memory ... }
1082
 
1083
  error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
1084
  if ( error ) { ... could not load table ... }
1085
1086
1087
1088

1089
[Index]
1090
1091
[TOC]
1092
 
1093
1094

FT_Sfnt_Table_Info

1095
1096
Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
1097

1098
1099
 
1100
  FT_EXPORT( FT_Error )
1101
  FT_Sfnt_Table_Info( FT_Face    face,
1102
                      FT_UInt    table_index,
1103
                      FT_ULong  *tag,
1104
                      FT_ULong  *length );
1105
 
1106

1107
1108

Return information on an SFNT table.

1109

1110
input
1111

1112
1113
face
1114

A handle to the source face.

1115
1116
table_index
1117

The index of an SFNT table. The function returns FT_Err_Table_Missing for an invalid value.

1118
1119
1120
1121
inout
1122

1123
1124
tag
1125

The name tag of the SFNT table. If the value is NULL, ‘table_index’ is ignored, and ‘length’ returns the number of SFNT tables in the font.

1126
1127
1128
1129
output
1130

1131
1132
length
1133

The length of the SFNT table (or the number of SFNT tables, depending on ‘tag’).

1134
1135
1136
1137
return
1138

FreeType error code. 0 means success.

1139
1140
note
1141

While parsing fonts, FreeType handles SFNT tables with length zero as missing.

1142
1143
1144

1145
[Index]
1146
1147
[TOC]
1148
 
1149
1150

FT_Get_CMap_Language_ID

1151
1152
Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
1153

1154
1155
 
1156
  FT_EXPORT( FT_ULong )
1157
  FT_Get_CMap_Language_ID( FT_CharMap  charmap );
1158
 
1159

1160
1161

Return TrueType/sfnt specific cmap language ID. Definitions of language ID values are in ‘freetype/ttnameid.h’.

1162

1163
input
1164

1165
1166
charmap
1167

The target charmap.

1168
1169
1170
1171
return
1172

The language ID of ‘charmap’. If ‘charmap’ doesn't belong to a TrueType/sfnt face, just return 0 as the default value.

1173

For a format 14 cmap (to access Unicode IVS), the return value is 0xFFFFFFFF.

1174
1175
1176

1177
[Index]
1178
1179
[TOC]
1180
 
1181
1182

FT_Get_CMap_Format

1183
1184
Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
1185

1186
1187
 
1188
  FT_EXPORT( FT_Long )
1189
  FT_Get_CMap_Format( FT_CharMap  charmap );
1190
 
1191

1192
1193

Return TrueType/sfnt specific cmap format.

1194

1195
input
1196

1197
1198
charmap
1199

The target charmap.

1200
1201
1202
1203
return
1204

The format of ‘charmap’. If ‘charmap’ doesn't belong to a TrueType/sfnt face, return -1.

1205
1206
1207

1208
[Index]
1209
1210
[TOC]
1211
 
1212
1213

FT_PARAM_TAG_UNPATENTED_HINTING

1214
1215
Defined in FT_UNPATENTED_HINTING_H (freetype/ttunpat.h).
1216

1217
1218
 
1219
#define FT_PARAM_TAG_UNPATENTED_HINTING  FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
1220
 
1221

1222
1223

A constant used as the tag of an FT_Parameter structure to indicate that unpatented methods only should be used by the TrueType bytecode interpreter for a typeface opened by FT_Open_Face.

1224

1225
1226

1227
[Index]
1228
1229
[TOC]
1230
 
1231
1232