Changeset 846 for trunk/src/3rdparty/harfbuzz
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 25 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/3rdparty/harfbuzz/src/Makefile.am
r2 r846 13 13 harfbuzz-open.c \ 14 14 harfbuzz-shaper.cpp \ 15 harfbuzz-tibetan.c \ 15 harfbuzz-greek.c \ 16 harfbuzz-tibetan.c \ 16 17 harfbuzz-khmer.c \ 17 18 harfbuzz-indic.cpp \ -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-buffer.h
r2 r846 49 49 HB_UShort back; /* number of glyphs to go back 50 50 for drawing current glyph */ 51 52 53 51 54 HB_Bool new_advance; /* if set, the advance width values are 52 55 absolute, i.e., they won't be 53 56 added to the original glyph's value 54 57 but rather replace them. */ 55 HB_Short cursive_chain; /* character to which this connects,56 may be positive or negative; used57 only internally */58 58 } HB_PositionRec, *HB_Position; 59 59 … … 67 67 HB_UInt out_pos; 68 68 69 HB_Bool separate_out;70 69 HB_GlyphItem in_string; 71 70 HB_GlyphItem out_string; … … 73 72 HB_Position positions; 74 73 HB_UShort max_ligID; 74 75 75 } HB_BufferRec, *HB_Buffer; 76 76 -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-dump.c
r2 r846 520 520 DUMP_FINT (ValueRecord, XAdvance); 521 521 if (value_format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE) 522 RECURSE (Device, Device, & ValueRecord->XPlacementDevice);522 RECURSE (Device, Device, &); 523 523 if (value_format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE) 524 RECURSE (Device, Device, & ValueRecord->YPlacementDevice);524 RECURSE (Device, Device, &); 525 525 if (value_format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE) 526 RECURSE (Device, Device, & ValueRecord->XAdvanceDevice);526 RECURSE (Device, Device, &); 527 527 if (value_format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE) 528 RECURSE (Device, Device, &ValueRecord->YAdvanceDevice); 528 RECURSE (Device, Device, &*ValueRecord->DeviceTables[VR_Y_ADVANCE_DEVICE]); 529 #ifdef HB_SUPPORT_MULTIPLE_MASTER 529 530 if (value_format & HB_GPOS_FORMAT_HAVE_X_ID_PLACEMENT) 530 531 DUMP_FUINT (ValueRecord, XIdPlacement); … … 535 536 if (value_format & HB_GPOS_FORMAT_HAVE_Y_ID_ADVANCE) 536 537 DUMP_FUINT (ValueRecord, XIdAdvance); 538 537 539 } 538 540 -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-external.h
r2 r846 147 147 HB_UChar16 HB_GetMirroredChar(HB_UChar16 ch); 148 148 149 void *HB_Library_Resolve(const char *library, const char *symbol); 150 151 void *HB_TextCodecForMib(int mib); 152 char *HB_TextCodec_ConvertFromUnicode(void *codec, const HB_UChar16 *unicode, hb_uint32 length, hb_uint32 *outputLength); 153 void HB_TextCodec_FreeResult(char *); 149 void *HB_Library_Resolve(const char *library, int version, const char *symbol); 154 150 155 151 HB_END_HEADER -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-gdef-private.h
r2 r846 34 34 HB_BEGIN_HEADER 35 35 36 37 36 /* Attachment related structures */ 38 37 39 38 struct HB_AttachPoint_ 40 39 { 40 41 41 HB_UShort PointCount; /* size of the PointIndex array */ 42 HB_UShort* PointIndex; /* array of contour points */43 42 }; 44 43 … … 63 62 struct HB_CaretValueFormat3_ 64 63 { 64 65 65 HB_Short Coordinate; /* x or y value (in design units) */ 66 HB_Device Device; /* Device table for x or y value */67 66 }; 68 67 … … 70 69 71 70 71 72 72 struct HB_CaretValueFormat4_ 73 73 { … … 76 76 77 77 typedef struct HB_CaretValueFormat4_ HB_CaretValueFormat4; 78 78 79 79 80 80 81 struct HB_CaretValue_ 81 82 { 82 HB_UShort CaretValueFormat; /* 1, 2, 3, or 4 */83 84 83 union 85 84 { … … 87 86 HB_CaretValueFormat2 cvf2; 88 87 HB_CaretValueFormat3 cvf3; 88 89 89 HB_CaretValueFormat4 cvf4; 90 90 91 } cvf; 92 93 91 94 }; 92 95 … … 96 99 struct HB_LigGlyph_ 97 100 { 101 102 98 103 HB_Bool loaded; 99 100 HB_UShort CaretCount; /* number of caret values */101 HB_CaretValue* CaretValue; /* array of caret values */102 104 }; 103 105 -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-gdef.c
r2 r846 443 443 return error; 444 444 445 445 446 cv->cvf.cvf4.IdCaretValue = GET_UShort(); 447 448 449 446 450 447 451 FORGET_Frame(); … … 459 463 { 460 464 if ( cv->CaretValueFormat == 3 ) 461 _HB_OPEN_Free_Device( &cv->cvf.cvf3.Device );465 _HB_OPEN_Free_Device( cv->cvf.cvf3.Device ); 462 466 } 463 467 -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-gdef.h
r2 r846 45 45 struct HB_AttachList_ 46 46 { 47 HB_Bool loaded; 48 47 HB_AttachPoint* AttachPoint; /* array of AttachPoint tables */ 49 48 HB_Coverage Coverage; /* Coverage table */ 50 49 HB_UShort GlyphCount; /* number of glyphs with 51 50 attachments */ 52 HB_ AttachPoint* AttachPoint; /* array of AttachPoint tables */51 HB_ 53 52 }; 54 53 … … 59 58 struct HB_LigCaretList_ 60 59 { 61 HB_Bool loaded; 62 60 HB_LigGlyph* LigGlyph; /* array of LigGlyph tables */ 63 61 HB_Coverage Coverage; /* Coverage table */ 64 62 HB_UShort LigGlyphCount; /* number of ligature glyphs */ 65 HB_ LigGlyph* LigGlyph; /* array of LigGlyph tables */63 HB_ 66 64 }; 67 65 … … 92 90 struct HB_GDEFHeader_ 93 91 { 92 94 93 HB_UInt offset; 94 95 95 96 96 HB_16Dot16 Version; … … 99 99 HB_AttachList AttachList; 100 100 HB_LigCaretList LigCaretList; 101 HB_UInt MarkAttachClassDef_offset;102 101 HB_ClassDefinition MarkAttachClassDef; /* new in OT 1.2 */ 103 102 104 103 HB_UShort LastGlyph; 105 HB_UShort** NewGlyphClasses;106 104 }; 107 105 … … 130 128 HB_UShort* class_array ); 131 129 132 133 130 HB_END_HEADER 134 131 -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
r2 r846 33 33 HB_BEGIN_HEADER 34 34 35 36 35 /* shared tables */ 36 37 38 39 40 37 41 38 42 struct HB_ValueRecord_ … … 46 50 HB_Short YAdvance; /* vertical adjustment for 47 51 advance */ 48 HB_Device XPlacementDevice; /* device table for horizontal 49 placement */ 50 HB_Device YPlacementDevice; /* device table for vertical 51 placement */ 52 HB_Device XAdvanceDevice; /* device table for horizontal 53 advance */ 54 HB_Device YAdvanceDevice; /* device table for vertical 55 advance */ 52 53 HB_Device** DeviceTables; /* device tables for placement 54 and advance */ 55 56 #ifdef HB_SUPPORT_MULTIPLE_MASTER 56 57 HB_UShort XIdPlacement; /* horizontal placement metric ID */ 57 58 HB_UShort YIdPlacement; /* vertical placement metric ID */ 58 59 HB_UShort XIdAdvance; /* horizontal advance metric ID */ 59 60 HB_UShort YIdAdvance; /* vertical advance metric ID */ 61 60 62 }; 61 63 … … 65 67 /* Mask values to scan the value format of the ValueRecord structure. 66 68 We always expand compressed ValueRecords of the font. */ 69 70 67 71 68 72 #define HB_GPOS_FORMAT_HAVE_X_PLACEMENT 0x0001 … … 98 102 typedef struct HB_AnchorFormat2_ HB_AnchorFormat2; 99 103 104 105 100 106 101 107 struct HB_AnchorFormat3_ … … 103 109 HB_Short XCoordinate; /* horizontal value */ 104 110 HB_Short YCoordinate; /* vertical value */ 105 HB_Device XDeviceTable; /* device table for X coordinate */ 106 HB_Device YDeviceTable; /* device table for Y coordinate */ 111 HB_Device** DeviceTables; /* device tables for coordinates */ 107 112 }; 108 113 … … 110 115 111 116 117 112 118 struct HB_AnchorFormat4_ 113 119 { … … 117 123 118 124 typedef struct HB_AnchorFormat4_ HB_AnchorFormat4; 125 119 126 120 127 121 128 struct HB_Anchor_ 122 129 { 123 HB_ UShort PosFormat;/* 1, 2, 3, or 4 -- 0 indicates130 HB_ /* 1, 2, 3, or 4 -- 0 indicates 124 131 that there is no Anchor table */ 125 132 … … 129 136 HB_AnchorFormat2 af2; 130 137 HB_AnchorFormat3 af3; 138 131 139 HB_AnchorFormat4 af4; 140 132 141 } af; 133 142 }; … … 176 185 struct HB_SinglePos_ 177 186 { 178 HB_ UShortPosFormat; /* 1 or 2 */187 HB_ PosFormat; /* 1 or 2 */ 179 188 HB_Coverage Coverage; /* Coverage table */ 180 189 … … 256 265 struct HB_PairPos_ 257 266 { 258 HB_ UShortPosFormat; /* 1 or 2 */267 HB_ PosFormat; /* 1 or 2 */ 259 268 HB_Coverage Coverage; /* Coverage table */ 260 269 HB_UShort ValueFormat1; /* format of ValueRecord table … … 508 517 struct HB_ContextPos_ 509 518 { 510 HB_ UShort PosFormat;/* 1, 2, or 3 */519 HB_ /* 1, 2, or 3 */ 511 520 512 521 union … … 525 534 struct HB_ChainPosRule_ 526 535 { 536 537 538 539 540 527 541 HB_UShort BacktrackGlyphCount; 528 542 /* total number of backtrack glyphs */ 529 HB_UShort* Backtrack; /* array of backtrack glyph IDs */530 543 HB_UShort InputGlyphCount; 531 544 /* total number of input glyphs */ 532 HB_UShort* Input; /* array of input glyph IDs */533 545 HB_UShort LookaheadGlyphCount; 534 546 /* total number of lookahead glyphs */ 535 HB_UShort* Lookahead; /* array of lookahead glyph IDs */536 547 HB_UShort PosCount; /* number of PosLookupRecords */ 537 HB_PosLookupRecord* PosLookupRecord;538 /* array of PosLookupRecords */539 548 }; 540 549 … … 566 575 struct HB_ChainPosClassRule_ 567 576 { 577 578 579 580 581 568 582 HB_UShort BacktrackGlyphCount; 569 583 /* total number of backtrack 570 584 classes */ 571 HB_UShort* Backtrack; /* array of backtrack classes */572 585 HB_UShort InputGlyphCount; 573 586 /* total number of context classes */ 574 HB_UShort* Input; /* array of context classes */575 587 HB_UShort LookaheadGlyphCount; 576 588 /* total number of lookahead 577 589 classes */ 578 HB_UShort* Lookahead; /* array of lookahead classes */579 590 HB_UShort PosCount; /* number of PosLookupRecords */ 580 HB_PosLookupRecord* PosLookupRecord;581 /* array of substitution lookups */582 591 }; 583 592 … … 657 666 struct HB_ChainContextPos_ 658 667 { 659 HB_ UShort PosFormat;/* 1, 2, or 3 */668 HB_ /* 1, 2, or 3 */ 660 669 661 670 union -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
r561 r846 58 58 59 59 60 60 61 /* the client application must replace this with something more 61 62 meaningful if multiple master fonts are to be supported. */ … … 72 73 return ERR(HB_Err_Not_Covered); /* ERR() call intended */ 73 74 } 75 74 76 75 77 … … 98 100 return error; 99 101 102 100 103 gpos->mmfunc = default_mmfunc; 104 101 105 102 106 /* skip version */ … … 253 257 vr->YAdvance = 0; 254 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 255 273 if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE ) 256 274 { 257 275 if ( ACCESS_Frame( 2L ) ) 258 return error;276 ; 259 277 260 278 new_offset = GET_UShort(); … … 268 286 cur_offset = FILE_Pos(); 269 287 if ( FILE_Seek( new_offset ) || 270 ( error = _HB_OPEN_Load_Device( &vr-> XPlacementDevice,288 ( error = _HB_OPEN_Load_Device( &vr->, 271 289 stream ) ) != HB_Err_Ok ) 272 return error;290 ; 273 291 (void)FILE_Seek( cur_offset ); 274 292 } 275 else276 goto empty1;277 }278 else279 {280 empty1:281 vr->XPlacementDevice.StartSize = 0;282 vr->XPlacementDevice.EndSize = 0;283 vr->XPlacementDevice.DeltaValue = NULL;284 293 } 285 294 … … 299 308 cur_offset = FILE_Pos(); 300 309 if ( FILE_Seek( new_offset ) || 301 ( error = _HB_OPEN_Load_Device( &vr-> YPlacementDevice,310 ( error = _HB_OPEN_Load_Device( &vr->, 302 311 stream ) ) != HB_Err_Ok ) 303 312 goto Fail3; 304 313 (void)FILE_Seek( cur_offset ); 305 314 } 306 else307 goto empty2;308 }309 else310 {311 empty2:312 vr->YPlacementDevice.StartSize = 0;313 vr->YPlacementDevice.EndSize = 0;314 vr->YPlacementDevice.DeltaValue = NULL;315 315 } 316 316 … … 330 330 cur_offset = FILE_Pos(); 331 331 if ( FILE_Seek( new_offset ) || 332 ( error = _HB_OPEN_Load_Device( &vr-> XAdvanceDevice,332 ( error = _HB_OPEN_Load_Device( &vr->, 333 333 stream ) ) != HB_Err_Ok ) 334 334 goto Fail2; 335 335 (void)FILE_Seek( cur_offset ); 336 336 } 337 else338 goto empty3;339 }340 else341 {342 empty3:343 vr->XAdvanceDevice.StartSize = 0;344 vr->XAdvanceDevice.EndSize = 0;345 vr->XAdvanceDevice.DeltaValue = NULL;346 337 } 347 338 … … 361 352 cur_offset = FILE_Pos(); 362 353 if ( FILE_Seek( new_offset ) || 363 ( error = _HB_OPEN_Load_Device( &vr-> YAdvanceDevice,354 ( error = _HB_OPEN_Load_Device( &vr->, 364 355 stream ) ) != HB_Err_Ok ) 365 356 goto Fail1; 366 357 (void)FILE_Seek( cur_offset ); 367 358 } 368 else369 goto empty4;370 }371 else372 {373 empty4:374 vr->YAdvanceDevice.StartSize = 0;375 vr->YAdvanceDevice.EndSize = 0;376 vr->YAdvanceDevice.DeltaValue = NULL;377 359 } 378 360 … … 382 364 goto Fail1; 383 365 366 384 367 vr->XIdPlacement = GET_UShort(); 368 369 370 385 371 386 372 FORGET_Frame(); 387 373 } 374 388 375 else 389 376 vr->XIdPlacement = 0; 377 390 378 391 379 if ( format & HB_GPOS_FORMAT_HAVE_Y_ID_PLACEMENT ) … … 394 382 goto Fail1; 395 383 384 396 385 vr->YIdPlacement = GET_UShort(); 386 387 388 397 389 398 390 FORGET_Frame(); 399 391 } 392 400 393 else 401 394 vr->YIdPlacement = 0; 395 402 396 403 397 if ( format & HB_GPOS_FORMAT_HAVE_X_ID_ADVANCE ) … … 406 400 goto Fail1; 407 401 402 408 403 vr->XIdAdvance = GET_UShort(); 404 405 406 409 407 410 408 FORGET_Frame(); 411 409 } 410 412 411 else 413 412 vr->XIdAdvance = 0; 413 414 414 415 415 if ( format & HB_GPOS_FORMAT_HAVE_Y_ID_ADVANCE ) … … 418 418 goto Fail1; 419 419 420 420 421 vr->YIdAdvance = GET_UShort(); 422 423 424 421 425 422 426 FORGET_Frame(); 423 427 } 428 424 429 else 425 430 vr->YIdAdvance = 0; 431 426 432 427 433 return HB_Err_Ok; 428 434 429 435 Fail1: 430 _HB_OPEN_Free_Device( &vr->YAdvanceDevice ); 436 if ( vr->DeviceTables ) 437 _HB_OPEN_Free_Device( vr->DeviceTables[VR_Y_ADVANCE_DEVICE] ); 431 438 432 439 Fail2: 433 _HB_OPEN_Free_Device( &vr->XAdvanceDevice ); 440 if ( vr->DeviceTables ) 441 _HB_OPEN_Free_Device( vr->DeviceTables[VR_X_ADVANCE_DEVICE] ); 434 442 435 443 Fail3: 436 _HB_OPEN_Free_Device( &vr->YPlacementDevice ); 444 if ( vr->DeviceTables ) 445 _HB_OPEN_Free_Device( vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] ); 446 447 Fail4: 448 FREE( vr->DeviceTables ); 437 449 return error; 438 450 } … … 443 455 { 444 456 if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE ) 445 _HB_OPEN_Free_Device( &vr->YAdvanceDevice);457 _HB_OPEN_Free_Device( ); 446 458 if ( format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE ) 447 _HB_OPEN_Free_Device( &vr->XAdvanceDevice);459 _HB_OPEN_Free_Device( ); 448 460 if ( format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE ) 449 _HB_OPEN_Free_Device( &vr->YPlacementDevice);461 _HB_OPEN_Free_Device( ); 450 462 if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE ) 451 _HB_OPEN_Free_Device( &vr->XPlacementDevice ); 463 _HB_OPEN_Free_Device( vr->DeviceTables[VR_X_PLACEMENT_DEVICE] ); 464 FREE( vr->DeviceTables ); 452 465 } 453 466 … … 458 471 HB_Position gd ) 459 472 { 460 HB_Fixed value;461 473 HB_Short pixel_value; 462 474 HB_Error error = HB_Err_Ok; 475 463 476 HB_GPOSHeader* gpos = gpi->gpos; 477 478 464 479 465 480 HB_UShort x_ppem, y_ppem; … … 492 507 if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE ) 493 508 { 494 _HB_OPEN_Get_Device( &vr->XPlacementDevice, x_ppem, &pixel_value );509 _HB_OPEN_Get_Device( , x_ppem, &pixel_value ); 495 510 gd->x_pos += pixel_value << 6; 496 511 } 497 512 if ( format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE ) 498 513 { 499 _HB_OPEN_Get_Device( &vr->YPlacementDevice, y_ppem, &pixel_value );514 _HB_OPEN_Get_Device( , y_ppem, &pixel_value ); 500 515 gd->y_pos += pixel_value << 6; 501 516 } 502 517 if ( format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE ) 503 518 { 504 _HB_OPEN_Get_Device( &vr->XAdvanceDevice, x_ppem, &pixel_value );519 _HB_OPEN_Get_Device( , x_ppem, &pixel_value ); 505 520 gd->x_advance += pixel_value << 6; 506 521 } 507 522 if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE ) 508 523 { 509 _HB_OPEN_Get_Device( &vr->YAdvanceDevice, y_ppem, &pixel_value );524 _HB_OPEN_Get_Device( , y_ppem, &pixel_value ); 510 525 gd->y_advance += pixel_value << 6; 511 526 } 512 527 } 513 528 529 514 530 /* values returned from mmfunc() are already in fractional pixels */ 515 531 … … 546 562 gd->y_advance += value; 547 563 } 564 548 565 549 566 return error; … … 609 626 if ( new_offset ) 610 627 { 628 629 630 631 632 633 611 634 new_offset += base_offset; 612 635 613 636 cur_offset = FILE_Pos(); 614 637 if ( FILE_Seek( new_offset ) || 615 ( error = _HB_OPEN_Load_Device( &an->af.af3. XDeviceTable,638 ( error = _HB_OPEN_Load_Device( &an->af.af3., 616 639 stream ) ) != HB_Err_Ok ) 617 return error;640 ; 618 641 (void)FILE_Seek( cur_offset ); 619 642 } 620 else621 {622 an->af.af3.XDeviceTable.StartSize = 0;623 an->af.af3.XDeviceTable.EndSize = 0;624 an->af.af3.XDeviceTable.DeltaValue = NULL;625 }626 643 627 644 if ( ACCESS_Frame( 2L ) ) … … 634 651 if ( new_offset ) 635 652 { 653 654 655 656 657 658 659 660 661 636 662 new_offset += base_offset; 637 663 638 664 cur_offset = FILE_Pos(); 639 665 if ( FILE_Seek( new_offset ) || 640 ( error = _HB_OPEN_Load_Device( &an->af.af3. YDeviceTable,666 ( error = _HB_OPEN_Load_Device( &an->af.af3., 641 667 stream ) ) != HB_Err_Ok ) 642 668 goto Fail; 643 669 (void)FILE_Seek( cur_offset ); 644 670 } 645 else646 {647 an->af.af3.YDeviceTable.StartSize = 0;648 an->af.af3.YDeviceTable.EndSize = 0;649 an->af.af3.YDeviceTable.DeltaValue = NULL;650 }651 671 break; 652 672 … … 655 675 return error; 656 676 677 657 678 an->af.af4.XIdAnchor = GET_UShort(); 658 679 an->af.af4.YIdAnchor = GET_UShort(); 680 681 682 683 659 684 660 685 FORGET_Frame(); … … 668 693 669 694 Fail: 670 _HB_OPEN_Free_Device( &an->af.af3.XDeviceTable ); 695 if ( an->af.af3.DeviceTables ) 696 _HB_OPEN_Free_Device( an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE] ); 697 698 Fail2: 699 FREE( an->af.af3.DeviceTables ); 671 700 return error; 672 701 } … … 675 704 static void Free_Anchor( HB_Anchor* an) 676 705 { 677 if ( an->PosFormat == 3 ) 678 { 679 _HB_OPEN_Free_Device( &an->af.af3.YDeviceTable ); 680 _HB_OPEN_Free_Device( &an->af.af3.XDeviceTable ); 706 if ( an->PosFormat == 3 && an->af.af3.DeviceTables ) 707 { 708 _HB_OPEN_Free_Device( an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE] ); 709 _HB_OPEN_Free_Device( an->af.af3.DeviceTables[AF3_Y_DEVICE_TABLE] ); 710 FREE( an->af.af3.DeviceTables ); 681 711 } 682 712 } … … 691 721 HB_Error error = HB_Err_Ok; 692 722 723 693 724 HB_GPOSHeader* gpos = gpi->gpos; 725 694 726 HB_UShort ap; 695 727 … … 744 776 if ( !gpi->dvi ) 745 777 { 746 _HB_OPEN_Get_Device( &an->af.af3.XDeviceTable, x_ppem, &pixel_value );778 _HB_OPEN_Get_Device( , x_ppem, &pixel_value ); 747 779 *x_value = pixel_value << 6; 748 _HB_OPEN_Get_Device( &an->af.af3.YDeviceTable, y_ppem, &pixel_value );780 _HB_OPEN_Get_Device( , y_ppem, &pixel_value ); 749 781 *y_value = pixel_value << 6; 750 782 } … … 757 789 758 790 case 4: 791 759 792 error = (gpos->mmfunc)( gpi->font, an->af.af4.XIdAnchor, 760 793 x_value, gpos->data ); … … 767 800 return error; 768 801 break; 802 803 804 769 805 } 770 806 … … 5967 6003 } 5968 6004 5969 5970 6005 #ifdef HB_SUPPORT_MULTIPLE_MASTER 5971 6006 HB_Error HB_GPOS_Register_MM_Function( HB_GPOSHeader* gpos, 5972 6007 HB_MMFunction mmfunc, … … 5981 6016 return HB_Err_Ok; 5982 6017 } 6018 5983 6019 5984 6020 /* If `dvi' is TRUE, glyph contour points for anchor points and device -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-gpos.h
r2 r846 45 45 #define HB_GPOS_LOOKUP_EXTENSION 9 46 46 47 47 48 /* A pointer to a function which accesses the PostScript interpreter. 48 49 Multiple Master fonts need this interface to convert a metric ID … … 60 61 HB_Fixed* metric_value, 61 62 void* data ); 63 62 64 63 65 … … 72 74 HB_GDEFHeader* gdef; 73 75 76 74 77 /* this is OpenType 1.2 -- Multiple Master fonts need this 75 78 callback function to get various metric values from the … … 78 81 HB_MMFunction mmfunc; 79 82 void* data; 83 80 84 }; 81 85 … … 130 134 131 135 136 132 137 HB_Error HB_GPOS_Register_MM_Function( HB_GPOSHeader* gpos, 133 138 HB_MMFunction mmfunc, 134 139 void* data ); 140 135 141 136 142 /* If `dvi' is TRUE, glyph contour points for anchor points and device -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-gsub-private.h
r2 r846 33 33 HB_BEGIN_HEADER 34 34 35 36 35 typedef union HB_GSUB_SubTable_ HB_GSUB_SubTable; 37 36 … … 49 48 struct HB_SingleSubstFormat2_ 50 49 { 50 51 51 HB_UShort GlyphCount; /* number of glyph IDs in 52 52 Substitute array */ 53 HB_UShort* Substitute; /* array of substitute glyph IDs */54 53 }; 55 54 … … 59 58 struct HB_SingleSubst_ 60 59 { 61 HB_UShort SubstFormat; /* 1 or 2 */62 HB_Coverage Coverage; /* Coverage table */63 64 60 union 65 61 { … … 67 63 HB_SingleSubstFormat2 ssf2; 68 64 } ssf; 65 66 67 69 68 }; 70 69 … … 76 75 struct HB_Sequence_ 77 76 { 77 78 78 79 HB_UShort GlyphCount; /* number of glyph IDs in the 79 80 Substitute array */ 80 HB_UShort* Substitute; /* string of glyph IDs to81 substitute */82 81 }; 83 82 … … 87 86 struct HB_MultipleSubst_ 88 87 { 88 89 89 90 HB_UShort SubstFormat; /* always 1 */ 90 HB_Coverage Coverage; /* Coverage table */91 91 HB_UShort SequenceCount; /* number of Sequence tables */ 92 HB_Sequence* Sequence; /* array of Sequence tables */93 92 }; 94 93 … … 100 99 struct HB_AlternateSet_ 101 100 { 101 102 102 HB_UShort GlyphCount; /* number of glyph IDs in the 103 103 Alternate array */ 104 HB_UShort* Alternate; /* array of alternate glyph IDs */105 104 }; 106 105 … … 110 109 struct HB_AlternateSubst_ 111 110 { 111 112 112 113 HB_UShort SubstFormat; /* always 1 */ 113 HB_Coverage Coverage; /* Coverage table */114 114 HB_UShort AlternateSetCount; 115 115 /* number of AlternateSet tables */ 116 HB_AlternateSet* AlternateSet; /* array of AlternateSet tables */117 116 }; 118 117 … … 124 123 struct HB_Ligature_ 125 124 { 125 126 126 HB_UShort LigGlyph; /* glyphID of ligature 127 127 to substitute */ 128 128 HB_UShort ComponentCount; /* number of components in ligature */ 129 HB_UShort* Component; /* array of component glyph IDs */130 129 }; 131 130 … … 135 134 struct HB_LigatureSet_ 136 135 { 136 137 137 HB_UShort LigatureCount; /* number of Ligature tables */ 138 HB_Ligature* Ligature; /* array of Ligature tables */139 138 }; 140 139 … … 144 143 struct HB_LigatureSubst_ 145 144 { 145 146 146 147 HB_UShort SubstFormat; /* always 1 */ 147 HB_Coverage Coverage; /* Coverage table */148 148 HB_UShort LigatureSetCount; /* number of LigatureSet tables */ 149 HB_LigatureSet* LigatureSet; /* array of LigatureSet tables */150 149 }; 151 150 … … 169 168 struct HB_SubRule_ 170 169 { 170 171 172 173 171 174 HB_UShort GlyphCount; /* total number of input glyphs */ 172 175 HB_UShort SubstCount; /* number of SubstLookupRecord 173 176 tables */ 174 HB_UShort* Input; /* array of input glyph IDs */175 HB_SubstLookupRecord* SubstLookupRecord;176 /* array of SubstLookupRecord177 tables */178 177 }; 179 178 … … 183 182 struct HB_SubRuleSet_ 184 183 { 184 185 185 HB_UShort SubRuleCount; /* number of SubRule tables */ 186 HB_SubRule* SubRule; /* array of SubRule tables */187 186 }; 188 187 … … 192 191 struct HB_ContextSubstFormat1_ 193 192 { 193 194 194 HB_Coverage Coverage; /* Coverage table */ 195 195 HB_UShort SubRuleSetCount; /* number of SubRuleSet tables */ 196 HB_SubRuleSet* SubRuleSet; /* array of SubRuleSet tables */197 196 }; 198 197 … … 202 201 struct HB_SubClassRule_ 203 202 { 203 204 205 206 204 207 HB_UShort GlyphCount; /* total number of context classes */ 205 208 HB_UShort SubstCount; /* number of SubstLookupRecord 206 209 tables */ 207 HB_UShort* Class; /* array of classes */208 HB_SubstLookupRecord* SubstLookupRecord;209 /* array of SubstLookupRecord210 tables */211 210 }; 212 211 … … 216 215 struct HB_SubClassSet_ 217 216 { 217 218 218 HB_UShort SubClassRuleCount; 219 219 /* number of SubClassRule tables */ 220 HB_SubClassRule* SubClassRule; /* array of SubClassRule tables */221 220 }; 222 221 … … 230 229 struct HB_ContextSubstFormat2_ 231 230 { 232 HB_UShort MaxContextLength; 233 /* maximal context length */ 231 HB_SubClassSet* SubClassSet; /* array of SubClassSet tables */ 234 232 HB_Coverage Coverage; /* Coverage table */ 235 233 HB_ClassDefinition ClassDef; /* ClassDef table */ 236 234 HB_UShort SubClassSetCount; 237 235 /* number of SubClassSet tables */ 238 HB_SubClassSet* SubClassSet; /* array of SubClassSet tables */ 236 HB_UShort MaxContextLength; 237 /* maximal context length */ 239 238 }; 240 239 … … 244 243 struct HB_ContextSubstFormat3_ 245 244 { 245 246 247 246 248 HB_UShort GlyphCount; /* number of input glyphs */ 247 249 HB_UShort SubstCount; /* number of SubstLookupRecords */ 248 HB_Coverage* Coverage; /* array of Coverage tables */249 HB_SubstLookupRecord* SubstLookupRecord;250 /* array of substitution lookups */251 250 }; 252 251 … … 256 255 struct HB_ContextSubst_ 257 256 { 258 HB_UShort SubstFormat; /* 1, 2, or 3 */259 260 257 union 261 258 { … … 264 261 HB_ContextSubstFormat3 csf3; 265 262 } csf; 263 264 266 265 }; 267 266 … … 273 272 struct HB_ChainSubRule_ 274 273 { 274 275 276 277 278 275 279 HB_UShort BacktrackGlyphCount; 276 280 /* total number of backtrack glyphs */ 277 HB_UShort* Backtrack; /* array of backtrack glyph IDs */278 281 HB_UShort InputGlyphCount; 279 282 /* total number of input glyphs */ 280 HB_UShort* Input; /* array of input glyph IDs */281 283 HB_UShort LookaheadGlyphCount; 282 284 /* total number of lookahead glyphs */ 283 HB_UShort* Lookahead; /* array of lookahead glyph IDs */284 285 HB_UShort SubstCount; /* number of SubstLookupRecords */ 285 HB_SubstLookupRecord* SubstLookupRecord;286 /* array of SubstLookupRecords */287 286 }; 288 287 … … 292 291 struct HB_ChainSubRuleSet_ 293 292 { 293 294 294 HB_UShort ChainSubRuleCount; 295 295 /* number of ChainSubRule tables */ 296 HB_ChainSubRule* ChainSubRule; /* array of ChainSubRule tables */297 296 }; 298 297 … … 302 301 struct HB_ChainContextSubstFormat1_ 303 302 { 303 304 304 305 HB_Coverage Coverage; /* Coverage table */ 305 306 HB_UShort ChainSubRuleSetCount; 306 307 /* number of ChainSubRuleSet tables */ 307 HB_ChainSubRuleSet* ChainSubRuleSet;308 /* array of ChainSubRuleSet tables */309 308 }; 310 309 … … 314 313 struct HB_ChainSubClassRule_ 315 314 { 315 316 317 318 319 316 320 HB_UShort BacktrackGlyphCount; 317 321 /* total number of backtrack 318 322 classes */ 319 HB_UShort* Backtrack; /* array of backtrack classes */320 323 HB_UShort InputGlyphCount; 321 324 /* total number of context classes */ 322 HB_UShort* Input; /* array of context classes */323 325 HB_UShort LookaheadGlyphCount; 324 326 /* total number of lookahead 325 327 classes */ 326 HB_UShort* Lookahead; /* array of lookahead classes */327 328 HB_UShort SubstCount; /* number of SubstLookupRecords */ 328 HB_SubstLookupRecord* SubstLookupRecord;329 /* array of substitution lookups */330 329 }; 331 330 … … 335 334 struct HB_ChainSubClassSet_ 336 335 { 336 337 338 337 339 HB_UShort ChainSubClassRuleCount; 338 340 /* number of ChainSubClassRule 339 341 tables */ 340 HB_ChainSubClassRule* ChainSubClassRule;341 /* array of ChainSubClassRule342 tables */343 342 }; 344 343 … … 352 351 struct HB_ChainContextSubstFormat2_ 353 352 { 353 354 355 354 356 HB_Coverage Coverage; /* Coverage table */ 355 357 356 HB_UShort MaxBacktrackLength;357 /* maximal backtrack length */358 358 HB_ClassDefinition BacktrackClassDef; 359 359 /* BacktrackClassDef table */ 360 HB_UShort MaxInputLength;361 /* maximal input length */362 360 HB_ClassDefinition InputClassDef; 363 361 /* InputClassDef table */ 364 HB_UShort MaxLookaheadLength;365 /* maximal lookahead length */366 362 HB_ClassDefinition LookaheadClassDef; 367 363 /* LookaheadClassDef table */ … … 370 366 /* number of ChainSubClassSet 371 367 tables */ 372 HB_ChainSubClassSet* ChainSubClassSet; 373 /* array of ChainSubClassSet 374 tables */ 368 HB_UShort MaxBacktrackLength; 369 /* maximal backtrack length */ 370 HB_UShort MaxLookaheadLength; 371 /* maximal lookahead length */ 372 HB_UShort MaxInputLength; 373 /* maximal input length */ 375 374 }; 376 375 … … 380 379 struct HB_ChainContextSubstFormat3_ 381 380 { 382 HB_UShort BacktrackGlyphCount;383 /* number of backtrack glyphs */384 381 HB_Coverage* BacktrackCoverage; 385 382 /* array of backtrack Coverage 386 383 tables */ 387 HB_UShort InputGlyphCount;388 /* number of input glyphs */389 384 HB_Coverage* InputCoverage; 390 385 /* array of input coverage 391 386 tables */ 392 HB_UShort LookaheadGlyphCount;393 /* number of lookahead glyphs */394 387 HB_Coverage* LookaheadCoverage; 395 388 /* array of lookahead coverage 396 389 tables */ 390 391 392 393 394 395 396 397 397 398 HB_UShort SubstCount; /* number of SubstLookupRecords */ 398 HB_SubstLookupRecord* SubstLookupRecord;399 /* array of substitution lookups */400 399 }; 401 400 … … 405 404 struct HB_ChainContextSubst_ 406 405 { 407 HB_UShort SubstFormat; /* 1, 2, or 3 */408 409 406 union 410 407 { … … 413 410 HB_ChainContextSubstFormat3 ccsf3; 414 411 } ccsf; 412 413 415 414 }; 416 415 … … 422 421 struct HB_ExtensionSubst_ 423 422 { 423 424 424 HB_UShort SubstFormat; /* always 1 */ 425 425 HB_UShort LookuptType; /* lookup-type of referenced subtable */ 426 HB_GSUB_SubTable *subtable; /* referenced subtable */427 426 }; 428 427 … … 434 433 struct HB_ReverseChainContextSubst_ 435 434 { 436 HB_ UShort SubstFormat; /* always 1 */437 HB_Coverage Coverage; /* coverage table for input glyphs*/438 HB_UShort BacktrackGlyphCount; /* number of backtrack glyphs*/435 HB_ 436 */ 437 HB_UShort */ 439 438 HB_Coverage* BacktrackCoverage; /* array of backtrack Coverage 440 439 tables */ 440 441 442 441 443 HB_UShort LookaheadGlyphCount; /* number of lookahead glyphs */ 442 HB_Coverage* LookaheadCoverage; /* array of lookahead Coverage443 tables */444 444 HB_UShort GlyphCount; /* number of Glyph IDs */ 445 HB_UShort* Substitute; /* array of substitute Glyph ID */446 445 }; 447 446 -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-gsub.h
r2 r846 32 32 HB_BEGIN_HEADER 33 33 34 35 34 /* Lookup types for glyph substitution */ 36 35 … … 61 60 struct HB_GSUBHeader_ 62 61 { 62 63 64 65 66 67 68 69 63 70 HB_UInt offset; 64 71 … … 68 75 HB_FeatureList FeatureList; 69 76 HB_LookupList LookupList; 70 71 HB_GDEFHeader* gdef;72 73 /* the next two fields are used for an alternate substitution callback74 function to select the proper alternate glyph. */75 76 HB_AltFunction altfunc;77 void* data;78 77 }; 79 78 … … 136 135 HB_Buffer buffer ); 137 136 138 139 137 HB_END_HEADER 140 138 -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-hangul.c
r2 r846 131 131 { HB_MAKE_TAG('c', 'c', 'm', 'p'), CcmpProperty }, 132 132 { HB_MAKE_TAG('l', 'j', 'm', 'o'), CcmpProperty }, 133 { HB_MAKE_TAG(' j', 'j', 'm', 'o'), CcmpProperty },133 { HB_MAKE_TAG('', 'j', 'm', 'o'), CcmpProperty }, 134 134 { HB_MAKE_TAG('t', 'j', 'm', 'o'), CcmpProperty }, 135 135 { 0, 0 } -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp
r769 r846 834 834 None, None, None, Post, 835 835 836 P ost, None, Below, None,836 P, None, Below, None, 837 837 None, Post, None, None, 838 838 None, None, None, None, -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h
r2 r846 70 70 HB_Stream input ); 71 71 HB_INTERNAL HB_Error 72 _HB_OPEN_Load_Device( HB_Device* d,72 _HB_OPEN_Load_Device( HB_Device* d, 73 73 HB_Stream input ); 74 74 -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-open.c
r561 r846 1283 1283 1284 1284 HB_INTERNAL HB_Error 1285 _HB_OPEN_Load_Device( HB_Device* d,1285 _HB_OPEN_Load_Device( HB_Device*, 1286 1286 HB_Stream stream ) 1287 1287 { 1288 1288 1289 HB_Error error; 1289 1290 … … 1295 1296 if ( ACCESS_Frame( 6L ) ) 1296 1297 return error; 1298 1299 1300 1301 1302 1303 1304 1305 1297 1306 1298 1307 d->StartSize = GET_UShort(); … … 1319 1328 1320 1329 if ( ALLOC_ARRAY( d->DeltaValue, count, HB_UShort ) ) 1321 return error; 1330 { 1331 FREE( *device ); 1332 *device = 0; 1333 return error; 1334 } 1322 1335 1323 1336 if ( ACCESS_Frame( count * 2L ) ) 1324 1337 { 1325 1338 FREE( d->DeltaValue ); 1339 1340 1326 1341 return error; 1327 1342 } … … 1341 1356 _HB_OPEN_Free_Device( HB_Device* d ) 1342 1357 { 1343 FREE( d->DeltaValue ); 1358 if ( d ) 1359 { 1360 FREE( d->DeltaValue ); 1361 FREE( d ); 1362 } 1344 1363 } 1345 1364 … … 1385 1404 HB_Short* value ) 1386 1405 { 1387 HB_UShort byte, bits, mask, f, s; 1388 1389 1390 f = d->DeltaFormat; 1391 1392 if ( d->DeltaValue && size >= d->StartSize && size <= d->EndSize ) 1393 { 1406 HB_UShort byte, bits, mask, s; 1407 1408 if ( d && d->DeltaValue && size >= d->StartSize && size <= d->EndSize ) 1409 { 1410 HB_UShort f = d->DeltaFormat; 1394 1411 s = size - d->StartSize; 1395 1412 byte = d->DeltaValue[s >> ( 4 - f )]; -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-open.h
r2 r846 43 43 struct HB_LangSys_ 44 44 { 45 45 46 HB_UShort LookupOrderOffset; /* always 0 for TT Open 1.0 */ 46 47 HB_UShort ReqFeatureIndex; /* required FeatureIndex */ 47 48 HB_UShort FeatureCount; /* number of Feature indices */ 48 HB_UShort* FeatureIndex; /* array of Feature indices */49 49 }; 50 50 … … 54 54 struct HB_LangSysRecord_ 55 55 { 56 56 57 HB_UInt LangSysTag; /* LangSysTag identifier */ 57 HB_LangSys LangSys; /* LangSys table */58 58 }; 59 59 … … 63 63 struct HB_ScriptTable_ 64 64 { 65 65 66 HB_LangSys DefaultLangSys; /* DefaultLangSys table */ 66 67 HB_UShort LangSysCount; /* number of LangSysRecords */ 67 HB_LangSysRecord* LangSysRecord; /* array of LangSysRecords */68 68 }; 69 69 … … 82 82 struct HB_ScriptList_ 83 83 { 84 84 85 HB_UShort ScriptCount; /* number of ScriptRecords */ 85 HB_ScriptRecord* ScriptRecord; /* array of ScriptRecords */86 86 }; 87 87 … … 93 93 struct HB_Feature_ 94 94 { 95 95 96 HB_UShort FeatureParams; /* always 0 for TT Open 1.0 */ 96 97 HB_UShort LookupListCount; /* number of LookupList indices */ 97 HB_UShort* LookupListIndex; /* array of LookupList indices */98 98 }; 99 99 … … 112 112 struct HB_FeatureList_ 113 113 { 114 115 114 116 HB_UShort FeatureCount; /* number of FeatureRecords */ 115 HB_FeatureRecord* FeatureRecord; /* array of FeatureRecords */116 HB_UShort* ApplyOrder; /* order to apply features */117 117 HB_UShort ApplyCount; /* number of elements in ApplyOrder */ 118 118 }; … … 128 128 struct HB_Lookup_ 129 129 { 130 130 131 HB_UShort LookupType; /* Lookup type */ 131 132 HB_UShort LookupFlag; /* Lookup qualifiers */ 132 133 HB_UShort SubTableCount; /* number of SubTables */ 133 HB_SubTable* SubTable; /* array of SubTables */134 134 }; 135 135 … … 145 145 struct HB_LookupList_ 146 146 { 147 HB_UShort LookupCount; /* number of Lookups */148 147 HB_Lookup* Lookup; /* array of Lookup records */ 149 148 HB_UInt* Properties; /* array of flags */ 149 150 150 }; 151 151 … … 168 168 struct HB_CoverageFormat1_ 169 169 { 170 170 171 HB_UShort GlyphCount; /* number of glyphs in GlyphArray */ 171 HB_UShort* GlyphArray; /* array of glyph IDs */172 172 }; 173 173 … … 188 188 struct HB_CoverageFormat2_ 189 189 { 190 190 191 HB_UShort RangeCount; /* number of RangeRecords */ 191 HB_RangeRecord* RangeRecord; /* array of RangeRecords */192 192 }; 193 193 … … 197 197 struct HB_Coverage_ 198 198 { 199 HB_ UShortCoverageFormat; /* 1 or 2 */199 HB_ CoverageFormat; /* 1 or 2 */ 200 200 201 201 union … … 211 211 struct HB_ClassDefFormat1_ 212 212 { 213 213 214 HB_UShort StartGlyph; /* first glyph ID of the 214 215 ClassValueArray */ 215 216 HB_UShort GlyphCount; /* size of the ClassValueArray */ 216 HB_UShort* ClassValueArray; /* array of class values */217 217 }; 218 218 … … 232 232 struct HB_ClassDefFormat2_ 233 233 { 234 235 234 236 HB_UShort ClassRangeCount; 235 237 /* number of ClassRangeRecords */ 236 HB_ClassRangeRecord* ClassRangeRecord;237 /* array of ClassRangeRecords */238 238 }; 239 239 … … 243 243 struct HB_ClassDefinition_ 244 244 { 245 HB_Bool loaded;246 247 HB_UShort ClassFormat; /* 1 or 2 */248 249 245 union 250 246 { … … 252 248 HB_ClassDefFormat2 cd2; 253 249 } cd; 250 251 252 254 253 }; 255 254 … … 259 258 struct HB_Device_ 260 259 { 260 261 261 HB_UShort StartSize; /* smallest size to correct */ 262 262 HB_UShort EndSize; /* largest size to correct */ 263 HB_ UShortDeltaFormat; /* DeltaValue array data format:263 HB_ DeltaFormat; /* DeltaValue array data format: 264 264 1, 2, or 3 */ 265 HB_UShort* DeltaValue; /* array of compressed data */266 265 }; 267 266 … … 277 276 typedef enum HB_Type_ HB_Type; 278 277 279 280 278 HB_END_HEADER 281 279 -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-shaper-all.cpp
r2 r846 26 26 #include "harfbuzz-indic.cpp" 27 27 extern "C" { 28 28 29 #include "harfbuzz-tibetan.c" 29 30 #include "harfbuzz-khmer.c" -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h
r769 r846 104 104 105 105 extern HB_Bool HB_BasicShape(HB_ShaperItem *shaper_item); 106 106 107 extern HB_Bool HB_TibetanShape(HB_ShaperItem *shaper_item); 107 108 extern HB_Bool HB_HebrewShape(HB_ShaperItem *shaper_item); -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
r561 r846 184 184 goto next; 185 185 186 // two complex chars (thai or lao), thai_attributes might override, but here we do a best guess187 if (cls == HB_LineBreak_SA && ncls == HB_LineBreak_SA) {188 lineBreakType = HB_Break;189 goto next;190 }191 192 186 { 193 187 int tcls = ncls; 188 189 190 194 191 if (tcls >= HB_LineBreak_SA) 195 tcls = HB_LineBreak_ ID;192 tcls = HB_LineBreak_; 196 193 if (cls >= HB_LineBreak_SA) 197 cls = HB_LineBreak_ ID;194 cls = HB_LineBreak_; 198 195 199 196 int brk = breakTable[cls][tcls]; … … 588 585 { HB_BasicShape, 0}, 589 586 // Greek 590 { HB_ BasicShape, 0},587 { HB_Shape, 0}, 591 588 // Cyrillic 592 589 { HB_BasicShape, 0}, -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
r561 r846 34 34 35 35 HB_BEGIN_HEADER 36 37 38 39 40 41 42 43 44 45 46 47 36 48 37 49 typedef enum { … … 124 136 125 137 typedef struct { 126 /*HB_LineBreakType*/ unsigned lineBreakType :2;127 /*HB_Bool*/ unsigned whiteSpace :1; /* A unicode whitespace character, except NBSP, ZWNBSP */128 /*HB_Bool*/ unsigned charStop :1; /* Valid cursor position (for left/right arrow) */129 /*HB_Bool*/ unsigned wordBoundary :1;130 /*HB_Bool*/ unsigned sentenceBoundary :1;131 unsigned unused :2;138 /*HB_LineBreakType*/ d lineBreakType :2; 139 /*HB_Bool*/ d whiteSpace :1; /* A unicode whitespace character, except NBSP, ZWNBSP */ 140 /*HB_Bool*/ d charStop :1; /* Valid cursor position (for left/right arrow) */ 141 /*HB_Bool*/ d wordBoundary :1; 142 /*HB_Bool*/ d sentenceBoundary :1; 143 d unused :2; 132 144 } HB_CharAttributes; 133 145 … … 182 194 */ 183 195 typedef struct { 184 unsigned justification :4; /* Justification class */185 unsigned clusterStart :1; /* First glyph of representation of cluster */186 unsigned mark :1; /* needs to be positioned around base char */187 unsigned zeroWidth :1; /* ZWJ, ZWNJ etc, with no width */188 unsigned dontPrint :1;189 unsigned combiningClass :8;196 d justification :4; /* Justification class */ 197 d clusterStart :1; /* First glyph of representation of cluster */ 198 d mark :1; /* needs to be positioned around base char */ 199 d zeroWidth :1; /* ZWJ, ZWNJ etc, with no width */ 200 d dontPrint :1; 201 d combiningClass :8; 190 202 } HB_GlyphAttributes; 191 203 -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-stream.h
r2 r846 34 34 { 35 35 HB_Byte* base; 36 36 37 HB_UInt size; 37 38 HB_UInt pos; 38 39 HB_Byte* cursor;40 39 } HB_StreamRec; 41 42 40 43 41 HB_END_HEADER -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
r2 r846 28 28 29 29 #include <assert.h> 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 30 59 31 60 static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttributes *attributes) 32 61 { 33 typedef int (*th_brk_def)(const char*, int[], int); 34 static void *thaiCodec = 0; 35 static th_brk_def th_brk = 0; 36 char *cstr = 0; 62 char s[128]; 63 char *cstr = s; 37 64 int brp[128]; 38 65 int *break_positions = brp; … … 40 67 hb_uint32 i; 41 68 42 if (!thaiCodec) 43 thaiCodec = HB_TextCodecForMib(2259); 44 45 /* load libthai dynamically */ 46 if (!th_brk && thaiCodec) { 47 th_brk = (th_brk_def)HB_Library_Resolve("thai", "th_brk"); 48 if (!th_brk) 49 thaiCodec = 0; 50 } 69 if (!libthai_resolved) 70 resolve_libthai(); 51 71 52 72 if (!th_brk) 53 73 return; 54 74 55 cstr = HB_TextCodec_ConvertFromUnicode(thaiCodec, string, len, 0); 56 if (!cstr) 57 return; 75 if (len >= 128) 76 cstr = (char *)malloc(len*sizeof(char) + 1); 58 77 59 break_positions = brp; 78 to_tis620(string, len, cstr); 79 60 80 numbreaks = th_brk(cstr, break_positions, 128); 61 81 if (numbreaks > 128) { … … 64 84 } 65 85 66 for (i = 0; i < len; ++i) 86 for (i = 0; i < len; ++i) 67 87 attributes[i].lineBreakType = HB_NoBreak; 88 89 68 90 69 91 for (i = 0; i < numbreaks; ++i) { 70 if (break_positions[i] > 0) 92 if (break_positions[i] > 0) 71 93 attributes[break_positions[i]-1].lineBreakType = HB_Break; 94 95 72 96 } 73 97 … … 75 99 free(break_positions); 76 100 77 HB_TextCodec_FreeResult(cstr); 101 if (len >= 128) 102 free(cstr); 78 103 } 79 80 104 81 105 void HB_ThaiAttributes(HB_Script script, const HB_UChar16 *text, hb_uint32 from, hb_uint32 len, HB_CharAttributes *attributes) -
trunk/src/3rdparty/harfbuzz/tests/linebreaking/harfbuzz-qt.cpp
r2 r846 80 80 } 81 81 82 void *HB_Library_Resolve(const char *library, const char *symbol)82 void *HB_Library_Resolve(const char *library, const char *symbol) 83 83 { 84 return QLibrary::resolve(library, symbol); 85 } 86 87 void *HB_TextCodecForMib(int mib) 88 { 89 return QTextCodec::codecForMib(mib); 90 } 91 92 char *HB_TextCodec_ConvertFromUnicode(void *codec, const HB_UChar16 *unicode, hb_uint32 length, hb_uint32 *outputLength) 93 { 94 QByteArray data = reinterpret_cast<QTextCodec *>(codec)->fromUnicode((const QChar *)unicode, length); 95 // ### suboptimal 96 char *output = (char *)malloc(data.length() + 1); 97 memcpy(output, data.constData(), data.length() + 1); 98 if (outputLength) 99 *outputLength = data.length(); 100 return output; 101 } 102 103 void HB_TextCodec_FreeResult(char *string) 104 { 105 free(string); 84 return QLibrary::resolve(library, version, symbol); 106 85 } 107 86
Note:
See TracChangeset
for help on using the changeset viewer.