* src/cff/cffload.c (CFF_Load_Charset): Improved error messages. (CFF_Load_Charset, CFF_Load_Encoding): Remove unnecessary variable definition. * src/cff/t2gload.c (t2_lookup_glyph_by_stdcharcode, t2_operator_seac): Added these functions for use in implementing the seac emulation provided by the Type 2 endchar operator. (T2_Parse_CharStrings): Added seac emulation for the endchar operator. CFF_Done_Encoding, CFF_Done_Charset): Extended to load and parse the charset/encoding tables, and free the memory used by them when the CFF driver is finished with them. Added tables
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737
diff --git a/ChangeLog b/ChangeLog
index fce13b0..9cbcc3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-12-30 Werner Lemberg <wl@gnu.org>
+
+ * src/cff/cffload.c (CFF_Load_Charset): Improved error messages.
+ (CFF_Load_Charset, CFF_Load_Encoding): Remove unnecessary variable
+ definition.
+
2000-12-30 Tom Kacvinsky <tjk@ams.org>
* include/freetype/internal/t2types.h,
@@ -5,15 +11,16 @@
CFF_Encoding and CFF_Encoding for the new implementations of the
charset and encoding parsers in the CFF driver.
- * src/cff/t2gload.c (t2_lookup_glyph_by_stdcharcode, t2_operator_seac):
- Added these functions for use in implementing the seac emulation
- provided by the Type 2 endchar operator.
- (T2_Parse_CharStrings): Added seac emulation for the endchar operator.
+ * src/cff/t2gload.c (t2_lookup_glyph_by_stdcharcode,
+ t2_operator_seac): Added these functions for use in implementing the
+ seac emulation provided by the Type 2 endchar operator.
+ (T2_Parse_CharStrings): Added seac emulation for the endchar
+ operator.
* src/cff/cffload.c (CFF_Load_Encoding, CFF_Load_Charset,
- CFF_Done_Encoding, CFF_Done_Charset): Extended to load and parse the
- charset/encoding tables, and free the memory used by them when the CFF
- driver is finished with them. Added tables
+ CFF_Done_Encoding, CFF_Done_Charset): Extended to load and parse the
+ charset/encoding tables, and free the memory used by them when the
+ CFF driver is finished with them. Added tables
cff_isoadobe_charset
cff_expert_charset
diff --git a/include/freetype/internal/cfftypes.h b/include/freetype/internal/cfftypes.h
index c245931..f1a0fdf 100644
--- a/include/freetype/internal/cfftypes.h
+++ b/include/freetype/internal/cfftypes.h
@@ -64,7 +64,7 @@ FT_BEGIN_HEADER
/* a compact CFF Charset table */
- typedef struct CFF_Charset_
+ typedef struct CFF_Charset_
{
FT_UInt format;
FT_ULong offset;
@@ -75,7 +75,7 @@ FT_BEGIN_HEADER
/* a compact CFF Encoding table */
- typedef struct CFF_Encoding_
+ typedef struct CFF_Encoding_
{
FT_UInt format;
FT_ULong offset;
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index a6bf98a..5ce05da 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -27,6 +27,7 @@
#include FT_SOURCE_FILE(cff,cffload.h)
#include FT_SOURCE_FILE(cff,cffparse.h)
+
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
@@ -36,7 +37,9 @@
#undef FT_COMPONENT
#define FT_COMPONENT trace_t2load
- static const FT_UShort cff_isoadobe_charset[229] =
+
+ static
+ const FT_UShort cff_isoadobe_charset[229] =
{
0,
1,
@@ -269,7 +272,8 @@
228
};
- static const FT_UShort cff_expert_charset[166] =
+ static
+ const FT_UShort cff_expert_charset[166] =
{
0,
1,
@@ -439,7 +443,8 @@
378
};
- static const FT_UShort cff_expertsubset_charset[87] =
+ static
+ const FT_UShort cff_expertsubset_charset[87] =
{
0,
1,
@@ -530,7 +535,8 @@
346
};
- static const FT_UShort cff_standard_encoding[256] =
+ static
+ const FT_UShort cff_standard_encoding[256] =
{
0,
0,
@@ -790,8 +796,8 @@
0
};
-
- static const FT_UShort cff_expert_encoding[256] =
+ static
+ const FT_UShort cff_expert_encoding[256] =
{
0,
0,
@@ -1492,12 +1498,14 @@
{
FT_Memory memory = stream->memory;
+
FREE( charset->sids );
charset->format = 0;
charset->offset = 0;
charset->sids = 0;
}
+
static
FT_Error CFF_Load_Charset( CFF_Charset* charset,
FT_UInt num_glyphs,
@@ -1505,9 +1513,10 @@
FT_ULong base_offset,
FT_ULong offset )
{
- FT_Memory memory = stream->memory;
- FT_Error error = 0;
- FT_UShort glyph_sid;
+ FT_Memory memory = stream->memory;
+ FT_Error error = 0;
+ FT_UShort glyph_sid;
+
charset->offset = base_offset + offset;
@@ -1522,8 +1531,9 @@
{
FT_UInt j;
+
/* Allocate memory for sids. */
- if ( ALLOC( charset->sids, num_glyphs * sizeof( FT_UShort ) ) )
+ if ( ALLOC( charset->sids, num_glyphs * sizeof ( FT_UShort ) ) )
goto Exit;
/* assign the .notdef glyph */
@@ -1532,7 +1542,6 @@
switch ( charset->format )
{
case 0:
-
for ( j = 1; j < num_glyphs; j++ )
{
if ( READ_UShort( glyph_sid ) )
@@ -1548,6 +1557,7 @@
FT_UInt nleft;
FT_UInt i;
+
j = 1;
while ( j < num_glyphs )
@@ -1572,7 +1582,6 @@
/* Fill in the range of sids -- `nleft + 1' glyphs. */
for ( i = 0; i <= nleft; i++, j++, glyph_sid++ )
charset->sids[j] = glyph_sid;
-
}
}
break;
@@ -1582,85 +1591,80 @@
error = FT_Err_Invalid_File_Format;
goto Exit;
}
-
}
else
{
-
/* Parse default tables corresponding to offset == 0, 1, or 2. */
/* CFF specification intimates the following: */
/* */
/* In order to use a predefined charset, the following must be */
- /* true: the charset constructed for the glyphs in the font's */
+ /* true: The charset constructed for the glyphs in the font's */
/* charstrings dictionary must match the predefined charset in */
/* the first num_glyphs, and hence must match the predefined */
/* charset *exactly*. */
switch ( offset )
{
-
case 0:
-
if ( num_glyphs != 229 )
{
- FT_ERROR(("CFF_Load_Charset: implicit charset not equal to predefined charset!\n" ));
+ FT_ERROR(("CFF_Load_Charset: implicit charset not equal to\n"
+ "predefined charset (Adobe ISO-Latin)!\n" ));
error = FT_Err_Invalid_File_Format;
goto Exit;
}
/* Allocate memory for sids. */
- if ( ALLOC( charset->sids, num_glyphs * sizeof( FT_UShort ) ) )
+ if ( ALLOC( charset->sids, num_glyphs * sizeof ( FT_UShort ) ) )
goto Exit;
- /* Copy the predefined charset into the allocated memory. */
+ /* Copy the predefined charset into the allocated memory. */
MEM_Copy( charset->sids, cff_isoadobe_charset,
- num_glyphs * sizeof( FT_UShort ) );
+ num_glyphs * sizeof ( FT_UShort ) );
break;
case 1:
-
if ( num_glyphs != 166 )
{
- FT_ERROR(( "CFF_Load_Charset: implicit charset not equal to predefined charset!\n" ));
+ FT_ERROR(( "CFF_Load_Charset: implicit charset not equal to\n"
+ "predefined charset (Adobe Expert)!\n" ));
error = FT_Err_Invalid_File_Format;
goto Exit;
}
/* Allocate memory for sids. */
- if ( ALLOC( charset->sids, num_glyphs * sizeof( FT_UShort ) ) )
+ if ( ALLOC( charset->sids, num_glyphs * sizeof ( FT_UShort ) ) )
goto Exit;
/* Copy the predefined charset into the allocated memory. */
MEM_Copy( charset->sids, cff_expert_charset,
- num_glyphs * sizeof( FT_UShort ) );
+ num_glyphs * sizeof ( FT_UShort ) );
break;
case 2:
-
if ( num_glyphs != 87 )
{
- FT_ERROR(( "CFF_Load_Charset: implicit charset not equal to predefined charset!\n" ));
+ FT_ERROR(( "CFF_Load_Charset: implicit charset not equal to\n"
+ "predefined charset (Adobe Expert Subset)!\n" ));
error = FT_Err_Invalid_File_Format;
goto Exit;
}
/* Allocate memory for sids. */
- if ( ALLOC( charset->sids, num_glyphs * sizeof( FT_UShort ) ) )
+ if ( ALLOC( charset->sids, num_glyphs * sizeof ( FT_UShort ) ) )
goto Exit;
/* Copy the predefined charset into the allocated memory. */
MEM_Copy( charset->sids, cff_expertsubset_charset,
- num_glyphs * sizeof( FT_UShort ) );
+ num_glyphs * sizeof ( FT_UShort ) );
break;
default:
-
error = FT_Err_Invalid_File_Format;
goto Exit;
-
}
}
@@ -1670,8 +1674,6 @@
if ( error )
if ( charset->sids )
{
- FT_Memory memory = stream->memory;
-
if ( charset->sids )
FREE( charset->sids );
charset->format = 0;
@@ -1682,6 +1684,7 @@
return error;
}
+
static
FT_Error CFF_Load_Encoding( CFF_Encoding* encoding,
CFF_Charset* charset,
@@ -1690,14 +1693,15 @@
FT_ULong base_offset,
FT_ULong offset )
{
- FT_Memory memory = stream->memory;
- FT_Error error = 0;
+ FT_Memory memory = stream->memory;
+ FT_Error error = 0;
FT_UInt count;
FT_UInt j;
FT_UShort glyph_sid;
FT_Byte glyph_code;
- /* Check for charset->sids. If we do not have this, we fail. */
+
+ /* Check for charset->sids. If we do not have this, we fail. */
if ( !charset->sids )
{
error = FT_Err_Invalid_File_Format;
@@ -1706,18 +1710,18 @@
/* Allocate memory for sids/codes -- there are at most 256 sids/codes */
/* for an encoding. */
- if ( ALLOC( encoding->sids, 256 * sizeof( FT_UShort ) ) ||
- ALLOC( encoding->codes, 256 * sizeof( FT_UShort ) ) )
+ if ( ALLOC( encoding->sids, 256 * sizeof ( FT_UShort ) ) ||
+ ALLOC( encoding->codes, 256 * sizeof ( FT_UShort ) ) )
goto Exit;
- /* Zero out the code to gid/sid mappings. */
+ /* Zero out the code to gid/sid mappings. */
for ( j = 0; j < 255; j++ )
{
encoding->sids [j] = 0;
encoding->codes[j] = 0;
}
- /* Note: the encoding table in a CFF font is indexed by glyph index, */
+ /* Note: The encoding table in a CFF font is indexed by glyph index, */
/* where the first encoded glyph index is 1. Hence, we read the char */
/* code (`glyph_code') at index j and make the assignment: */
/* */
@@ -1743,7 +1747,6 @@
switch ( encoding->format & 0x7F )
{
case 0:
-
for ( j = 1; j <= count; j++ )
{
if ( READ_Byte( glyph_code ) )
@@ -1757,7 +1760,6 @@
encoding->codes[glyph_code] = j;
/* Assign code to SID mapping. */
-
encoding->sids[glyph_code] = charset->sids[j];
}
@@ -1769,25 +1771,24 @@
FT_Byte i = 1;
FT_Byte k;
+
/* Parse the Format1 ranges. */
for ( j = 0; j < count; j++, i += nleft )
{
-
- /* Read the first glyph code of the range. */
+ /* Read the first glyph code of the range. */
if ( READ_Byte( glyph_code ) )
goto Exit;
- /* Read the number of codes in the range. */
+ /* Read the number of codes in the range. */
if ( READ_Byte( nleft ) )
goto Exit;
/* Increment nleft, so we read `nleft + 1' codes/sids. */
nleft++;
- /* Fill in the range of codes/sids. */
+ /* Fill in the range of codes/sids. */
for ( k = i; k < nleft + i; k++, glyph_code++ )
{
-
/* Make sure k is not too big. */
if ( k > num_glyphs )
goto Exit;
@@ -1797,15 +1798,13 @@
/* Assign code to SID mapping. */
encoding->sids[glyph_code] = charset->sids[k];
-
}
}
}
-
break;
default:
- FT_ERROR(( "CFF.Load_Encoding: invalid table format!\n" ));
+ FT_ERROR(( "CFF_Load_Encoding: invalid table format!\n" ));
error = FT_Err_Invalid_File_Format;
goto Exit;
}
@@ -1815,27 +1814,25 @@
{
FT_UInt glyph_id;
+
/* count supplements */
if ( READ_Byte( count ) )
goto Exit;
for ( j = 0; j < count; j++ )
{
-
- /* Read supplemental glyph code. */
+ /* Read supplemental glyph code. */
if ( READ_Byte( glyph_code ) )
goto Exit;
- /* Read the SID associated with this glyph code */
+ /* Read the SID associated with this glyph code. */
if ( READ_UShort( glyph_sid ) )
goto Exit;
- /* Assign code to SID mapping. */
+ /* Assign code to SID mapping. */
encoding->sids[glyph_code] = glyph_sid;
- /* Assign code to GID mapping. */
-
- /* First, lookup GID which has been assigned */
+ /* First, lookup GID which has been assigned to */
/* SID glyph_sid. */
for ( glyph_id = 0; glyph_id < num_glyphs; glyph_id++ )
{
@@ -1843,17 +1840,16 @@
break;
}
- /* Now, make the assignment. */
+ /* Now, make the assignment. */
encoding->codes[glyph_code] = glyph_id;
-
}
}
-
}
else
{
FT_UInt i;
+
/* We take into account the fact a CFF font can use a predefined */
/* encoding without containing all of the glyphs encoded by this */
/* encoding (see the note at the end of section 12 in the CFF */
@@ -1861,12 +1857,10 @@
switch ( offset )
{
-
case 0:
-
- /* First, copy the code to SID mapping. */
+ /* First, copy the code to SID mapping. */
MEM_Copy( encoding->sids, cff_standard_encoding,
- 256 * sizeof( FT_UShort ) );
+ 256 * sizeof ( FT_UShort ) );
/* Construct code to GID mapping from code */
/* to SID mapping and charset. */
@@ -1875,7 +1869,6 @@
/* If j is encoded, find the GID for it. */
if ( encoding->sids[j] )
{
-
for ( i = 1; i < num_glyphs; i++ )
/* We matched, so break. */
if ( charset->sids[i] == encoding->sids[j] )
@@ -1893,14 +1886,12 @@
encoding->codes[j] = i;
}
}
-
break;
case 1:
-
/* First, copy the code to SID mapping. */
MEM_Copy( encoding->sids, cff_expert_encoding,
- 256 * sizeof( FT_UShort ) );
+ 256 * sizeof ( FT_UShort ) );
/* Construct code to GID mapping from code to SID mapping */
/* and charset. */
@@ -1909,7 +1900,6 @@
/* If j is encoded, find the GID for it. */
if ( encoding->sids[j] )
{
-
for ( i = 1; i < num_glyphs; i++ )
/* We matched, so break. */
if ( charset->sids[i] == encoding->sids[j] )
@@ -1927,15 +1917,13 @@
encoding->codes[j] = i;
}
}
-
break;
default:
- FT_ERROR(( "CFF.Load_Encoding: invalid table format!\n" ));
+ FT_ERROR(( "CFF_Load_Encoding: invalid table format!\n" ));
error = FT_Err_Invalid_File_Format;
goto Exit;
break;
-
}
}
@@ -1946,8 +1934,6 @@
{
if ( encoding->sids || encoding->codes )
{
- FT_Memory memory = stream->memory;
-
if ( encoding->sids )
FREE( encoding->sids );
@@ -1961,7 +1947,6 @@
}
return error;
-
}
@@ -2231,8 +2216,12 @@
if ( error )
goto Exit;
- error = CFF_Load_Encoding( &font->encoding, &font->charset, font->num_glyphs,
- stream, base_offset, dict->encoding_offset );
+ error = CFF_Load_Encoding( &font->encoding,
+ &font->charset,
+ font->num_glyphs,
+ stream,
+ base_offset,
+ dict->encoding_offset );
if ( error )
goto Exit;
diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c
index ff4ab71..81dab42 100644
--- a/src/cff/cffparse.c
+++ b/src/cff/cffparse.c
@@ -310,6 +310,7 @@
FT_Error error;
FT_Fixed temp;
+
error = T2_Err_Stack_Underflow;
if ( parser->top >= parser->stack + 6 )
diff --git a/src/cff/t2gload.c b/src/cff/t2gload.c
index 9dd83e3..bd43080 100644
--- a/src/cff/t2gload.c
+++ b/src/cff/t2gload.c
@@ -513,6 +513,7 @@
outline->contours[outline->n_contours - 1] = outline->n_points - 1;
}
+
static
FT_Int t2_lookup_glyph_by_stdcharcode( CFF_Font* cff,
FT_Int charcode )
@@ -520,6 +521,7 @@
FT_UInt n;
FT_UShort glyph_sid;
+
/* check range of standard char code */
if ( charcode < 0 || charcode > 255 )
return -1;
@@ -530,7 +532,6 @@
for ( n = 0; n < cff->num_glyphs; n++ )
{
-
if ( cff->charset.sids[n] == glyph_sid )
return n;
}
@@ -538,6 +539,7 @@
return -1;
}
+
static
FT_Error t2_operator_seac( T2_Decoder* decoder,
FT_Pos adx,
@@ -554,6 +556,7 @@
FT_Byte* charstring;
FT_ULong charstring_len;
+
bchar_index = t2_lookup_glyph_by_stdcharcode( cff, bchar );
achar_index = t2_lookup_glyph_by_stdcharcode( cff, achar );
@@ -564,7 +567,7 @@
return T2_Err_Syntax_Error;
}
- /* if we are trying to load a composite glyph, do not load the */
+ /* If we are trying to load a composite glyph, do not load the */
/* accent character and return the array of subglyphs. */
if ( decoder->builder.no_recurse )
{
@@ -607,7 +610,6 @@
&charstring, &charstring_len );
if ( !error )
{
-
error = T2_Parse_CharStrings( decoder, charstring, charstring_len );
if ( error )
@@ -618,7 +620,7 @@
n_base_points = base->n_points;
- /* save the left bearing and width of the base character */
+ /* Save the left bearing and width of the base character */
/* as they will be erased by the next load. */
left_bearing = decoder->builder.left_bearing;
@@ -627,12 +629,11 @@
decoder->builder.left_bearing.x = 0;
decoder->builder.left_bearing.y = 0;
- /* Now load `achar' on top of the base outline */
+ /* Now load `achar' on top of the base outline. */
error = CFF_Access_Element( &cff->charstrings_index, achar_index,
&charstring, &charstring_len );
if ( !error )
{
-
error = T2_Parse_CharStrings( decoder, charstring, charstring_len );
if ( error )
@@ -641,15 +642,17 @@
CFF_Forget_Element( &cff->charstrings_index, &charstring );
}
- /* restore the left side bearing and advance width of the base character */
+ /* Restore the left side bearing and advance width */
+ /* of the base character. */
decoder->builder.left_bearing = left_bearing;
decoder->builder.advance = advance;
- /* Finally, move the accent */
+ /* Finally, move the accent. */
if ( decoder->builder.load_points )
{
FT_Outline dummy;
+
dummy.n_points = base->n_points - n_base_points;
dummy.points = base->points + n_base_points;
@@ -1008,8 +1011,8 @@
break;
case t2_op_endchar:
- /* If there is a width specified for endchar, we either have 1 */
- /* argument or 5 arguments. We like to argue. */
+ /* If there is a width specified for endchar, we either have */
+ /* 1 argument or 5 arguments. We like to argue. */
set_width_ok = ( ( num_args == 5 ) || ( num_args == 1 ) );
break;
@@ -1579,12 +1582,11 @@
FT_TRACE4(( " endchar" ));
/* We are going to emulate the seac operator. */
- if ( num_args == 4)
+ if ( num_args == 4 )
{
-
error = t2_operator_seac( decoder, args[0] >> 16, args[1] >> 16,
args[2] >> 16, args[3] >> 16 );
- args += 4;
+ args += 4;
}
if ( !error )
@@ -2099,6 +2101,7 @@
FT_Matrix font_matrix;
FT_Vector font_offset;
+
if ( load_flags & FT_LOAD_NO_RECURSE )
load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
@@ -2151,13 +2154,13 @@
/* bearing the yMax. */
if ( !error )
{
-
- /* for composite glyphs, return only left side bearing and */
- /* advance width */
+ /* For composite glyphs, return only left side bearing and */
+ /* advance width. */
if ( load_flags & FT_LOAD_NO_RECURSE )
{
FT_Slot_Internal internal = glyph->root.internal;
+
glyph->root.metrics.horiBearingX = decoder.builder.left_bearing.x;
glyph->root.metrics.horiAdvance = decoder.glyph_width;
internal->glyph_matrix = font_matrix;
@@ -2171,8 +2174,8 @@
/* copy the _unscaled_ advance width */
- metrics->horiAdvance = decoder.glyph_width;
- glyph->root.linearHoriAdvance = decoder.glyph_width;
+ metrics->horiAdvance = decoder.glyph_width;
+ glyph->root.linearHoriAdvance = decoder.glyph_width;
glyph->root.internal->glyph_transformed = 0;
/* make up vertical metrics */