Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
25 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/3rdparty/harfbuzz/src/Makefile.am

    r2 r846  
    1313        harfbuzz-open.c \
    1414        harfbuzz-shaper.cpp \
    15         harfbuzz-tibetan.c \
     15        harfbuzz-greek.c \
     16        harfbuzz-tibetan.c \
    1617        harfbuzz-khmer.c \
    1718        harfbuzz-indic.cpp \
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-buffer.h

    r2 r846  
    4949  HB_UShort  back;            /* number of glyphs to go back
    5050                                 for drawing current glyph   */
     51
     52
     53
    5154  HB_Bool    new_advance;     /* if set, the advance width values are
    5255                                 absolute, i.e., they won't be
    5356                                 added to the original glyph's value
    5457                                 but rather replace them.            */
    55   HB_Short  cursive_chain;   /* character to which this connects,
    56                                  may be positive or negative; used
    57                                  only internally                     */
    5858} HB_PositionRec, *HB_Position;
    5959
     
    6767  HB_UInt    out_pos;
    6868 
    69   HB_Bool       separate_out;
    7069  HB_GlyphItem  in_string;
    7170  HB_GlyphItem  out_string;
     
    7372  HB_Position   positions;
    7473  HB_UShort      max_ligID;
     74
    7575} HB_BufferRec, *HB_Buffer;
    7676
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-dump.c

    r2 r846  
    520520    DUMP_FINT (ValueRecord, XAdvance);
    521521  if (value_format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE)
    522     RECURSE (Device, Device, &ValueRecord->XPlacementDevice);
     522    RECURSE (Device, Device, &);
    523523  if (value_format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE)
    524     RECURSE (Device, Device, &ValueRecord->YPlacementDevice);
     524    RECURSE (Device, Device, &);
    525525  if (value_format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE)
    526     RECURSE (Device, Device, &ValueRecord->XAdvanceDevice);
     526    RECURSE (Device, Device, &);
    527527  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
    529530  if (value_format & HB_GPOS_FORMAT_HAVE_X_ID_PLACEMENT)
    530531    DUMP_FUINT (ValueRecord, XIdPlacement);
     
    535536  if (value_format & HB_GPOS_FORMAT_HAVE_Y_ID_ADVANCE)
    536537    DUMP_FUINT (ValueRecord, XIdAdvance);
     538
    537539}
    538540
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-external.h

    r2 r846  
    147147HB_UChar16 HB_GetMirroredChar(HB_UChar16 ch);
    148148
    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 *);
     149void *HB_Library_Resolve(const char *library, int version, const char *symbol);
    154150
    155151HB_END_HEADER
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-gdef-private.h

    r2 r846  
    3434HB_BEGIN_HEADER
    3535
    36 
    3736/* Attachment related structures */
    3837
    3938struct  HB_AttachPoint_
    4039{
     40
    4141  HB_UShort   PointCount;             /* size of the PointIndex array */
    42   HB_UShort*  PointIndex;             /* array of contour points      */
    4342};
    4443
     
    6362struct  HB_CaretValueFormat3_
    6463{
     64
    6565  HB_Short    Coordinate;             /* x or y value (in design units) */
    66   HB_Device  Device;                 /* Device table for x or y value  */
    6766};
    6867
     
    7069
    7170
     71
    7272struct  HB_CaretValueFormat4_
    7373{
     
    7676
    7777typedef struct HB_CaretValueFormat4_  HB_CaretValueFormat4;
     78
    7879
    7980
    8081struct  HB_CaretValue_
    8182{
    82   HB_UShort  CaretValueFormat;        /* 1, 2, 3, or 4 */
    83 
    8483  union
    8584  {
     
    8786    HB_CaretValueFormat2  cvf2;
    8887    HB_CaretValueFormat3  cvf3;
     88
    8989    HB_CaretValueFormat4  cvf4;
     90
    9091  } cvf;
     92
     93
    9194};
    9295
     
    9699struct  HB_LigGlyph_
    97100{
     101
     102
    98103  HB_Bool          loaded;
    99 
    100   HB_UShort        CaretCount;        /* number of caret values */
    101   HB_CaretValue*  CaretValue;        /* array of caret values  */
    102104};
    103105
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-gdef.c

    r2 r846  
    443443      return error;
    444444
     445
    445446    cv->cvf.cvf4.IdCaretValue = GET_UShort();
     447
     448
     449
    446450
    447451    FORGET_Frame();
     
    459463{
    460464  if ( cv->CaretValueFormat == 3 )
    461     _HB_OPEN_Free_Device( &cv->cvf.cvf3.Device );
     465    _HB_OPEN_Free_Device( cv->cvf.cvf3.Device );
    462466}
    463467
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-gdef.h

    r2 r846  
    4545struct  HB_AttachList_
    4646{
    47   HB_Bool           loaded;
    48 
     47  HB_AttachPoint*   AttachPoint;      /* array of AttachPoint tables */
    4948  HB_Coverage       Coverage;         /* Coverage table              */
    5049  HB_UShort         GlyphCount;       /* number of glyphs with
    5150                                         attachments                 */
    52   HB_AttachPoint*   AttachPoint;      /* array of AttachPoint tables */
     51  HB_
    5352};
    5453
     
    5958struct  HB_LigCaretList_
    6059{
    61   HB_Bool        loaded;
    62 
     60  HB_LigGlyph*   LigGlyph;            /* array of LigGlyph tables  */
    6361  HB_Coverage    Coverage;            /* Coverage table            */
    6462  HB_UShort      LigGlyphCount;       /* number of ligature glyphs */
    65   HB_LigGlyph*   LigGlyph;            /* array of LigGlyph tables  */
     63  HB_
    6664};
    6765
     
    9290struct  HB_GDEFHeader_
    9391{
     92
    9493  HB_UInt             offset;
     94
    9595
    9696  HB_16Dot16             Version;
     
    9999  HB_AttachList        AttachList;
    100100  HB_LigCaretList      LigCaretList;
    101   HB_UInt             MarkAttachClassDef_offset;
    102101  HB_ClassDefinition   MarkAttachClassDef;        /* new in OT 1.2 */
    103102
    104103  HB_UShort            LastGlyph;
    105   HB_UShort**          NewGlyphClasses;
    106104};
    107105
     
    130128                                         HB_UShort*       class_array );
    131129
    132 
    133130HB_END_HEADER
    134131
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h

    r2 r846  
    3333HB_BEGIN_HEADER
    3434
    35 
    3635/* shared tables */
     36
     37
     38
     39
     40
    3741
    3842struct  HB_ValueRecord_
     
    4650  HB_Short    YAdvance;               /* vertical adjustment for
    4751                                         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
    5657  HB_UShort   XIdPlacement;           /* horizontal placement metric ID */
    5758  HB_UShort   YIdPlacement;           /* vertical placement metric ID   */
    5859  HB_UShort   XIdAdvance;             /* horizontal advance metric ID   */
    5960  HB_UShort   YIdAdvance;             /* vertical advance metric ID     */
     61
    6062};
    6163
     
    6567/* Mask values to scan the value format of the ValueRecord structure.
    6668 We always expand compressed ValueRecords of the font.              */
     69
     70
    6771
    6872#define HB_GPOS_FORMAT_HAVE_X_PLACEMENT         0x0001
     
    98102typedef struct HB_AnchorFormat2_  HB_AnchorFormat2;
    99103
     104
     105
    100106
    101107struct  HB_AnchorFormat3_
     
    103109  HB_Short    XCoordinate;            /* horizontal value              */
    104110  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 */
    107112};
    108113
     
    110115
    111116
     117
    112118struct  HB_AnchorFormat4_
    113119{
     
    117123
    118124typedef struct HB_AnchorFormat4_  HB_AnchorFormat4;
     125
    119126
    120127
    121128struct  HB_Anchor_
    122129{
    123   HB_UShort  PosFormat;               /* 1, 2, 3, or 4 -- 0 indicates
     130  HB_               /* 1, 2, 3, or 4 -- 0 indicates
    124131                                         that there is no Anchor table */
    125132
     
    129136    HB_AnchorFormat2  af2;
    130137    HB_AnchorFormat3  af3;
     138
    131139    HB_AnchorFormat4  af4;
     140
    132141  } af;
    133142};
     
    176185struct  HB_SinglePos_
    177186{
    178   HB_UShort     PosFormat;            /* 1 or 2         */
     187  HB_     PosFormat;            /* 1 or 2         */
    179188  HB_Coverage  Coverage;             /* Coverage table */
    180189
     
    256265struct  HB_PairPos_
    257266{
    258   HB_UShort     PosFormat;            /* 1 or 2         */
     267  HB_     PosFormat;            /* 1 or 2         */
    259268  HB_Coverage  Coverage;             /* Coverage table */
    260269  HB_UShort     ValueFormat1;         /* format of ValueRecord table
     
    508517struct  HB_ContextPos_
    509518{
    510   HB_UShort  PosFormat;               /* 1, 2, or 3     */
     519  HB_               /* 1, 2, or 3     */
    511520
    512521  union
     
    525534struct  HB_ChainPosRule_
    526535{
     536
     537
     538
     539
     540
    527541  HB_UShort             BacktrackGlyphCount;
    528542                                      /* total number of backtrack glyphs */
    529   HB_UShort*            Backtrack;    /* array of backtrack glyph IDs     */
    530543  HB_UShort             InputGlyphCount;
    531544                                      /* total number of input glyphs     */
    532   HB_UShort*            Input;        /* array of input glyph IDs         */
    533545  HB_UShort             LookaheadGlyphCount;
    534546                                      /* total number of lookahead glyphs */
    535   HB_UShort*            Lookahead;    /* array of lookahead glyph IDs     */
    536547  HB_UShort             PosCount;     /* number of PosLookupRecords       */
    537   HB_PosLookupRecord*  PosLookupRecord;
    538                                       /* array of PosLookupRecords       */
    539548};
    540549
     
    566575struct  HB_ChainPosClassRule_
    567576{
     577
     578
     579
     580
     581
    568582  HB_UShort             BacktrackGlyphCount;
    569583                                      /* total number of backtrack
    570584                                         classes                         */
    571   HB_UShort*            Backtrack;    /* array of backtrack classes      */
    572585  HB_UShort             InputGlyphCount;
    573586                                      /* total number of context classes */
    574   HB_UShort*            Input;        /* array of context classes        */
    575587  HB_UShort             LookaheadGlyphCount;
    576588                                      /* total number of lookahead
    577589                                         classes                         */
    578   HB_UShort*            Lookahead;    /* array of lookahead classes      */
    579590  HB_UShort             PosCount;     /* number of PosLookupRecords      */
    580   HB_PosLookupRecord*  PosLookupRecord;
    581                                       /* array of substitution lookups   */
    582591};
    583592
     
    657666struct  HB_ChainContextPos_
    658667{
    659   HB_UShort  PosFormat;             /* 1, 2, or 3 */
     668  HB_             /* 1, 2, or 3 */
    660669
    661670  union
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c

    r561 r846  
    5858
    5959
     60
    6061/* the client application must replace this with something more
    6162   meaningful if multiple master fonts are to be supported.     */
     
    7273  return ERR(HB_Err_Not_Covered); /* ERR() call intended */
    7374}
     75
    7476
    7577
     
    98100    return error;
    99101
     102
    100103  gpos->mmfunc = default_mmfunc;
     104
    101105
    102106  /* skip version */
     
    253257    vr->YAdvance = 0;
    254258
     259
     260
     261
     262
     263
     264
     265
     266
     267
     268
     269
     270
     271
     272
    255273  if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE )
    256274  {
    257275    if ( ACCESS_Frame( 2L ) )
    258       return error;
     276      ;
    259277
    260278    new_offset = GET_UShort();
     
    268286      cur_offset = FILE_Pos();
    269287      if ( FILE_Seek( new_offset ) ||
    270            ( error = _HB_OPEN_Load_Device( &vr->XPlacementDevice,
     288           ( error = _HB_OPEN_Load_Device( &vr->,
    271289                                  stream ) ) != HB_Err_Ok )
    272         return error;
     290;
    273291      (void)FILE_Seek( cur_offset );
    274292    }
    275     else
    276       goto empty1;
    277   }
    278   else
    279   {
    280   empty1:
    281     vr->XPlacementDevice.StartSize  = 0;
    282     vr->XPlacementDevice.EndSize    = 0;
    283     vr->XPlacementDevice.DeltaValue = NULL;
    284293  }
    285294
     
    299308      cur_offset = FILE_Pos();
    300309      if ( FILE_Seek( new_offset ) ||
    301            ( error = _HB_OPEN_Load_Device( &vr->YPlacementDevice,
     310           ( error = _HB_OPEN_Load_Device( &vr->,
    302311                                  stream ) ) != HB_Err_Ok )
    303312        goto Fail3;
    304313      (void)FILE_Seek( cur_offset );
    305314    }
    306     else
    307       goto empty2;
    308   }
    309   else
    310   {
    311   empty2:
    312     vr->YPlacementDevice.StartSize  = 0;
    313     vr->YPlacementDevice.EndSize    = 0;
    314     vr->YPlacementDevice.DeltaValue = NULL;
    315315  }
    316316
     
    330330      cur_offset = FILE_Pos();
    331331      if ( FILE_Seek( new_offset ) ||
    332            ( error = _HB_OPEN_Load_Device( &vr->XAdvanceDevice,
     332           ( error = _HB_OPEN_Load_Device( &vr->,
    333333                                  stream ) ) != HB_Err_Ok )
    334334        goto Fail2;
    335335      (void)FILE_Seek( cur_offset );
    336336    }
    337     else
    338       goto empty3;
    339   }
    340   else
    341   {
    342   empty3:
    343     vr->XAdvanceDevice.StartSize  = 0;
    344     vr->XAdvanceDevice.EndSize    = 0;
    345     vr->XAdvanceDevice.DeltaValue = NULL;
    346337  }
    347338
     
    361352      cur_offset = FILE_Pos();
    362353      if ( FILE_Seek( new_offset ) ||
    363            ( error = _HB_OPEN_Load_Device( &vr->YAdvanceDevice,
     354           ( error = _HB_OPEN_Load_Device( &vr->,
    364355                                  stream ) ) != HB_Err_Ok )
    365356        goto Fail1;
    366357      (void)FILE_Seek( cur_offset );
    367358    }
    368     else
    369       goto empty4;
    370   }
    371   else
    372   {
    373   empty4:
    374     vr->YAdvanceDevice.StartSize  = 0;
    375     vr->YAdvanceDevice.EndSize    = 0;
    376     vr->YAdvanceDevice.DeltaValue = NULL;
    377359  }
    378360
     
    382364      goto Fail1;
    383365
     366
    384367    vr->XIdPlacement = GET_UShort();
     368
     369
     370
    385371
    386372    FORGET_Frame();
    387373  }
     374
    388375  else
    389376    vr->XIdPlacement = 0;
     377
    390378
    391379  if ( format & HB_GPOS_FORMAT_HAVE_Y_ID_PLACEMENT )
     
    394382      goto Fail1;
    395383
     384
    396385    vr->YIdPlacement = GET_UShort();
     386
     387
     388
    397389
    398390    FORGET_Frame();
    399391  }
     392
    400393  else
    401394    vr->YIdPlacement = 0;
     395
    402396
    403397  if ( format & HB_GPOS_FORMAT_HAVE_X_ID_ADVANCE )
     
    406400      goto Fail1;
    407401
     402
    408403    vr->XIdAdvance = GET_UShort();
     404
     405
     406
    409407
    410408    FORGET_Frame();
    411409  }
     410
    412411  else
    413412    vr->XIdAdvance = 0;
     413
    414414
    415415  if ( format & HB_GPOS_FORMAT_HAVE_Y_ID_ADVANCE )
     
    418418      goto Fail1;
    419419
     420
    420421    vr->YIdAdvance = GET_UShort();
     422
     423
     424
    421425
    422426    FORGET_Frame();
    423427  }
     428
    424429  else
    425430    vr->YIdAdvance = 0;
     431
    426432
    427433  return HB_Err_Ok;
    428434
    429435Fail1:
    430   _HB_OPEN_Free_Device( &vr->YAdvanceDevice );
     436  if ( vr->DeviceTables )
     437    _HB_OPEN_Free_Device( vr->DeviceTables[VR_Y_ADVANCE_DEVICE] );
    431438
    432439Fail2:
    433   _HB_OPEN_Free_Device( &vr->XAdvanceDevice );
     440  if ( vr->DeviceTables )
     441    _HB_OPEN_Free_Device( vr->DeviceTables[VR_X_ADVANCE_DEVICE] );
    434442
    435443Fail3:
    436   _HB_OPEN_Free_Device( &vr->YPlacementDevice );
     444  if ( vr->DeviceTables )
     445    _HB_OPEN_Free_Device( vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] );
     446
     447Fail4:
     448  FREE( vr->DeviceTables );
    437449  return error;
    438450}
     
    443455{
    444456  if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE )
    445     _HB_OPEN_Free_Device( &vr->YAdvanceDevice );
     457    _HB_OPEN_Free_Device( );
    446458  if ( format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE )
    447     _HB_OPEN_Free_Device( &vr->XAdvanceDevice );
     459    _HB_OPEN_Free_Device( );
    448460  if ( format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE )
    449     _HB_OPEN_Free_Device( &vr->YPlacementDevice );
     461    _HB_OPEN_Free_Device( );
    450462  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 );
    452465}
    453466
     
    458471                                  HB_Position      gd )
    459472{
    460   HB_Fixed           value;
    461473  HB_Short         pixel_value;
    462474  HB_Error         error = HB_Err_Ok;
     475
    463476  HB_GPOSHeader*  gpos = gpi->gpos;
     477
     478
    464479
    465480  HB_UShort  x_ppem, y_ppem;
     
    492507    if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE )
    493508    {
    494       _HB_OPEN_Get_Device( &vr->XPlacementDevice, x_ppem, &pixel_value );
     509      _HB_OPEN_Get_Device( , x_ppem, &pixel_value );
    495510      gd->x_pos += pixel_value << 6;
    496511    }
    497512    if ( format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE )
    498513    {
    499       _HB_OPEN_Get_Device( &vr->YPlacementDevice, y_ppem, &pixel_value );
     514      _HB_OPEN_Get_Device( , y_ppem, &pixel_value );
    500515      gd->y_pos += pixel_value << 6;
    501516    }
    502517    if ( format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE )
    503518    {
    504       _HB_OPEN_Get_Device( &vr->XAdvanceDevice, x_ppem, &pixel_value );
     519      _HB_OPEN_Get_Device( , x_ppem, &pixel_value );
    505520      gd->x_advance += pixel_value << 6;
    506521    }
    507522    if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE )
    508523    {
    509       _HB_OPEN_Get_Device( &vr->YAdvanceDevice, y_ppem, &pixel_value );
     524      _HB_OPEN_Get_Device( , y_ppem, &pixel_value );
    510525      gd->y_advance += pixel_value << 6;
    511526    }
    512527  }
    513528
     529
    514530  /* values returned from mmfunc() are already in fractional pixels */
    515531
     
    546562    gd->y_advance += value;
    547563  }
     564
    548565
    549566  return error;
     
    609626    if ( new_offset )
    610627    {
     628
     629
     630
     631
     632
     633
    611634      new_offset += base_offset;
    612635
    613636      cur_offset = FILE_Pos();
    614637      if ( FILE_Seek( new_offset ) ||
    615            ( error = _HB_OPEN_Load_Device( &an->af.af3.XDeviceTable,
     638           ( error = _HB_OPEN_Load_Device( &an->af.af3.,
    616639                                  stream ) ) != HB_Err_Ok )
    617         return error;
     640        ;
    618641      (void)FILE_Seek( cur_offset );
    619642    }
    620     else
    621     {
    622       an->af.af3.XDeviceTable.StartSize  = 0;
    623       an->af.af3.XDeviceTable.EndSize    = 0;
    624       an->af.af3.XDeviceTable.DeltaValue = NULL;
    625     }
    626643
    627644    if ( ACCESS_Frame( 2L ) )
     
    634651    if ( new_offset )
    635652    {
     653
     654
     655
     656
     657
     658
     659
     660
     661
    636662      new_offset += base_offset;
    637663
    638664      cur_offset = FILE_Pos();
    639665      if ( FILE_Seek( new_offset ) ||
    640            ( error = _HB_OPEN_Load_Device( &an->af.af3.YDeviceTable,
     666           ( error = _HB_OPEN_Load_Device( &an->af.af3.,
    641667                                  stream ) ) != HB_Err_Ok )
    642668        goto Fail;
    643669      (void)FILE_Seek( cur_offset );
    644670    }
    645     else
    646     {
    647       an->af.af3.YDeviceTable.StartSize  = 0;
    648       an->af.af3.YDeviceTable.EndSize    = 0;
    649       an->af.af3.YDeviceTable.DeltaValue = NULL;
    650     }
    651671    break;
    652672
     
    655675      return error;
    656676
     677
    657678    an->af.af4.XIdAnchor = GET_UShort();
    658679    an->af.af4.YIdAnchor = GET_UShort();
     680
     681
     682
     683
    659684
    660685    FORGET_Frame();
     
    668693
    669694Fail:
    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
     698Fail2:
     699  FREE( an->af.af3.DeviceTables );
    671700  return error;
    672701}
     
    675704static void  Free_Anchor( HB_Anchor*  an)
    676705{
    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 );
    681711  }
    682712}
     
    691721  HB_Error  error = HB_Err_Ok;
    692722
     723
    693724  HB_GPOSHeader*  gpos = gpi->gpos;
     725
    694726  HB_UShort        ap;
    695727
     
    744776    if ( !gpi->dvi )
    745777    {
    746       _HB_OPEN_Get_Device( &an->af.af3.XDeviceTable, x_ppem, &pixel_value );
     778      _HB_OPEN_Get_Device( , x_ppem, &pixel_value );
    747779      *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 );
    749781      *y_value = pixel_value << 6;
    750782    }
     
    757789
    758790  case 4:
     791
    759792    error = (gpos->mmfunc)( gpi->font, an->af.af4.XIdAnchor,
    760793                            x_value, gpos->data );
     
    767800      return error;
    768801    break;
     802
     803
     804
    769805  }
    770806
     
    59676003}
    59686004
    5969 
    5970 
     6005#ifdef HB_SUPPORT_MULTIPLE_MASTER
    59716006HB_Error  HB_GPOS_Register_MM_Function( HB_GPOSHeader*  gpos,
    59726007                                        HB_MMFunction   mmfunc,
     
    59816016  return HB_Err_Ok;
    59826017}
     6018
    59836019
    59846020/* If `dvi' is TRUE, glyph contour points for anchor points and device
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-gpos.h

    r2 r846  
    4545#define HB_GPOS_LOOKUP_EXTENSION  9
    4646
     47
    4748/* A pointer to a function which accesses the PostScript interpreter.
    4849   Multiple Master fonts need this interface to convert a metric ID
     
    6061                                    HB_Fixed*      metric_value,
    6162                                    void*        data );
     63
    6264
    6365
     
    7274  HB_GDEFHeader*    gdef;
    7375
     76
    7477  /* this is OpenType 1.2 -- Multiple Master fonts need this
    7578     callback function to get various metric values from the
     
    7881  HB_MMFunction     mmfunc;
    7982  void*              data;
     83
    8084};
    8185
     
    130134
    131135
     136
    132137HB_Error  HB_GPOS_Register_MM_Function( HB_GPOSHeader*  gpos,
    133138                                        HB_MMFunction   mmfunc,
    134139                                        void*            data );
     140
    135141
    136142/* If `dvi' is TRUE, glyph contour points for anchor points and device
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-gsub-private.h

    r2 r846  
    3333HB_BEGIN_HEADER
    3434
    35 
    3635typedef union HB_GSUB_SubTable_  HB_GSUB_SubTable;
    3736
     
    4948struct  HB_SingleSubstFormat2_
    5049{
     50
    5151  HB_UShort   GlyphCount;             /* number of glyph IDs in
    5252                                         Substitute array              */
    53   HB_UShort*  Substitute;             /* array of substitute glyph IDs */
    5453};
    5554
     
    5958struct  HB_SingleSubst_
    6059{
    61   HB_UShort     SubstFormat;          /* 1 or 2         */
    62   HB_Coverage  Coverage;             /* Coverage table */
    63 
    6460  union
    6561  {
     
    6763    HB_SingleSubstFormat2  ssf2;
    6864  } ssf;
     65
     66
     67
    6968};
    7069
     
    7675struct  HB_Sequence_
    7776{
     77
     78
    7879  HB_UShort   GlyphCount;             /* number of glyph IDs in the
    7980                                         Substitute array           */
    80   HB_UShort*  Substitute;             /* string of glyph IDs to
    81                                          substitute                 */
    8281};
    8382
     
    8786struct  HB_MultipleSubst_
    8887{
     88
     89
    8990  HB_UShort      SubstFormat;         /* always 1                  */
    90   HB_Coverage   Coverage;            /* Coverage table            */
    9191  HB_UShort      SequenceCount;       /* number of Sequence tables */
    92   HB_Sequence*  Sequence;            /* array of Sequence tables  */
    9392};
    9493
     
    10099struct  HB_AlternateSet_
    101100{
     101
    102102  HB_UShort   GlyphCount;             /* number of glyph IDs in the
    103103                                         Alternate array              */
    104   HB_UShort*  Alternate;              /* array of alternate glyph IDs */
    105104};
    106105
     
    110109struct  HB_AlternateSubst_
    111110{
     111
     112
    112113  HB_UShort          SubstFormat;     /* always 1                      */
    113   HB_Coverage       Coverage;        /* Coverage table                */
    114114  HB_UShort          AlternateSetCount;
    115115                                      /* number of AlternateSet tables */
    116   HB_AlternateSet*  AlternateSet;    /* array of AlternateSet tables  */
    117116};
    118117
     
    124123struct  HB_Ligature_
    125124{
     125
    126126  HB_UShort   LigGlyph;               /* glyphID of ligature
    127127                                         to substitute                    */
    128128  HB_UShort   ComponentCount;         /* number of components in ligature */
    129   HB_UShort*  Component;              /* array of component glyph IDs     */
    130129};
    131130
     
    135134struct  HB_LigatureSet_
    136135{
     136
    137137  HB_UShort      LigatureCount;       /* number of Ligature tables */
    138   HB_Ligature*  Ligature;            /* array of Ligature tables  */
    139138};
    140139
     
    144143struct  HB_LigatureSubst_
    145144{
     145
     146
    146147  HB_UShort         SubstFormat;      /* always 1                     */
    147   HB_Coverage      Coverage;         /* Coverage table               */
    148148  HB_UShort         LigatureSetCount; /* number of LigatureSet tables */
    149   HB_LigatureSet*  LigatureSet;      /* array of LigatureSet tables  */
    150149};
    151150
     
    169168struct  HB_SubRule_
    170169{
     170
     171
     172
     173
    171174  HB_UShort               GlyphCount; /* total number of input glyphs */
    172175  HB_UShort               SubstCount; /* number of SubstLookupRecord
    173176                                         tables                       */
    174   HB_UShort*              Input;      /* array of input glyph IDs     */
    175   HB_SubstLookupRecord*  SubstLookupRecord;
    176                                       /* array of SubstLookupRecord
    177                                          tables                       */
    178177};
    179178
     
    183182struct  HB_SubRuleSet_
    184183{
     184
    185185  HB_UShort     SubRuleCount;         /* number of SubRule tables */
    186   HB_SubRule*  SubRule;              /* array of SubRule tables  */
    187186};
    188187
     
    192191struct  HB_ContextSubstFormat1_
    193192{
     193
    194194  HB_Coverage     Coverage;          /* Coverage table              */
    195195  HB_UShort        SubRuleSetCount;   /* number of SubRuleSet tables */
    196   HB_SubRuleSet*  SubRuleSet;        /* array of SubRuleSet tables  */
    197196};
    198197
     
    202201struct  HB_SubClassRule_
    203202{
     203
     204
     205
     206
    204207  HB_UShort               GlyphCount; /* total number of context classes */
    205208  HB_UShort               SubstCount; /* number of SubstLookupRecord
    206209                                         tables                          */
    207   HB_UShort*              Class;      /* array of classes                */
    208   HB_SubstLookupRecord*  SubstLookupRecord;
    209                                       /* array of SubstLookupRecord
    210                                          tables                          */
    211210};
    212211
     
    216215struct  HB_SubClassSet_
    217216{
     217
    218218  HB_UShort          SubClassRuleCount;
    219219                                      /* number of SubClassRule tables */
    220   HB_SubClassRule*  SubClassRule;    /* array of SubClassRule tables  */
    221220};
    222221
     
    230229struct  HB_ContextSubstFormat2_
    231230{
    232   HB_UShort            MaxContextLength;
    233                                       /* maximal context length       */
     231  HB_SubClassSet*     SubClassSet;   /* array of SubClassSet tables  */
    234232  HB_Coverage         Coverage;      /* Coverage table               */
    235233  HB_ClassDefinition  ClassDef;      /* ClassDef table               */
    236234  HB_UShort            SubClassSetCount;
    237235                                      /* number of SubClassSet tables */
    238   HB_SubClassSet*     SubClassSet;   /* array of SubClassSet tables  */
     236  HB_UShort            MaxContextLength;
     237                                      /* maximal context length       */
    239238};
    240239
     
    244243struct  HB_ContextSubstFormat3_
    245244{
     245
     246
     247
    246248  HB_UShort               GlyphCount; /* number of input glyphs        */
    247249  HB_UShort               SubstCount; /* number of SubstLookupRecords  */
    248   HB_Coverage*           Coverage;   /* array of Coverage tables      */
    249   HB_SubstLookupRecord*  SubstLookupRecord;
    250                                       /* array of substitution lookups */
    251250};
    252251
     
    256255struct  HB_ContextSubst_
    257256{
    258   HB_UShort  SubstFormat;             /* 1, 2, or 3 */
    259 
    260257  union
    261258  {
     
    264261    HB_ContextSubstFormat3  csf3;
    265262  } csf;
     263
     264
    266265};
    267266
     
    273272struct  HB_ChainSubRule_
    274273{
     274
     275
     276
     277
     278
    275279  HB_UShort               BacktrackGlyphCount;
    276280                                      /* total number of backtrack glyphs */
    277   HB_UShort*              Backtrack;  /* array of backtrack glyph IDs     */
    278281  HB_UShort               InputGlyphCount;
    279282                                      /* total number of input glyphs     */
    280   HB_UShort*              Input;      /* array of input glyph IDs         */
    281283  HB_UShort               LookaheadGlyphCount;
    282284                                      /* total number of lookahead glyphs */
    283   HB_UShort*              Lookahead;  /* array of lookahead glyph IDs     */
    284285  HB_UShort               SubstCount; /* number of SubstLookupRecords     */
    285   HB_SubstLookupRecord*  SubstLookupRecord;
    286                                       /* array of SubstLookupRecords      */
    287286};
    288287
     
    292291struct  HB_ChainSubRuleSet_
    293292{
     293
    294294  HB_UShort          ChainSubRuleCount;
    295295                                      /* number of ChainSubRule tables */
    296   HB_ChainSubRule*  ChainSubRule;    /* array of ChainSubRule tables  */
    297296};
    298297
     
    302301struct  HB_ChainContextSubstFormat1_
    303302{
     303
     304
    304305  HB_Coverage          Coverage;     /* Coverage table                   */
    305306  HB_UShort             ChainSubRuleSetCount;
    306307                                      /* number of ChainSubRuleSet tables */
    307   HB_ChainSubRuleSet*  ChainSubRuleSet;
    308                                       /* array of ChainSubRuleSet tables  */
    309308};
    310309
     
    314313struct  HB_ChainSubClassRule_
    315314{
     315
     316
     317
     318
     319
    316320  HB_UShort               BacktrackGlyphCount;
    317321                                      /* total number of backtrack
    318322                                         classes                         */
    319   HB_UShort*              Backtrack;  /* array of backtrack classes      */
    320323  HB_UShort               InputGlyphCount;
    321324                                      /* total number of context classes */
    322   HB_UShort*              Input;      /* array of context classes        */
    323325  HB_UShort               LookaheadGlyphCount;
    324326                                      /* total number of lookahead
    325327                                         classes                         */
    326   HB_UShort*              Lookahead;  /* array of lookahead classes      */
    327328  HB_UShort               SubstCount; /* number of SubstLookupRecords    */
    328   HB_SubstLookupRecord*  SubstLookupRecord;
    329                                       /* array of substitution lookups   */
    330329};
    331330
     
    335334struct  HB_ChainSubClassSet_
    336335{
     336
     337
     338
    337339  HB_UShort               ChainSubClassRuleCount;
    338340                                      /* number of ChainSubClassRule
    339341                                         tables                      */
    340   HB_ChainSubClassRule*  ChainSubClassRule;
    341                                       /* array of ChainSubClassRule
    342                                          tables                      */
    343342};
    344343
     
    352351struct  HB_ChainContextSubstFormat2_
    353352{
     353
     354
     355
    354356  HB_Coverage           Coverage;    /* Coverage table             */
    355357
    356   HB_UShort              MaxBacktrackLength;
    357                                       /* maximal backtrack length   */
    358358  HB_ClassDefinition    BacktrackClassDef;
    359359                                      /* BacktrackClassDef table    */
    360   HB_UShort              MaxInputLength;
    361                                       /* maximal input length       */
    362360  HB_ClassDefinition    InputClassDef;
    363361                                      /* InputClassDef table        */
    364   HB_UShort              MaxLookaheadLength;
    365                                       /* maximal lookahead length   */
    366362  HB_ClassDefinition    LookaheadClassDef;
    367363                                      /* LookaheadClassDef table    */
     
    370366                                      /* number of ChainSubClassSet
    371367                                         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       */
    375374};
    376375
     
    380379struct  HB_ChainContextSubstFormat3_
    381380{
    382   HB_UShort               BacktrackGlyphCount;
    383                                       /* number of backtrack glyphs    */
    384381  HB_Coverage*           BacktrackCoverage;
    385382                                      /* array of backtrack Coverage
    386383                                         tables                        */
    387   HB_UShort               InputGlyphCount;
    388                                       /* number of input glyphs        */
    389384  HB_Coverage*           InputCoverage;
    390385                                      /* array of input coverage
    391386                                         tables                        */
    392   HB_UShort               LookaheadGlyphCount;
    393                                       /* number of lookahead glyphs    */
    394387  HB_Coverage*           LookaheadCoverage;
    395388                                      /* array of lookahead coverage
    396389                                         tables                        */
     390
     391
     392
     393
     394
     395
     396
     397
    397398  HB_UShort               SubstCount; /* number of SubstLookupRecords  */
    398   HB_SubstLookupRecord*  SubstLookupRecord;
    399                                       /* array of substitution lookups */
    400399};
    401400
     
    405404struct  HB_ChainContextSubst_
    406405{
    407   HB_UShort  SubstFormat;             /* 1, 2, or 3 */
    408 
    409406  union
    410407  {
     
    413410    HB_ChainContextSubstFormat3  ccsf3;
    414411  } ccsf;
     412
     413
    415414};
    416415
     
    422421struct HB_ExtensionSubst_
    423422{
     423
    424424  HB_UShort      SubstFormat;         /* always 1 */
    425425  HB_UShort      LookuptType;         /* lookup-type of referenced subtable */
    426   HB_GSUB_SubTable *subtable;         /* referenced subtable */
    427426};
    428427
     
    434433struct HB_ReverseChainContextSubst_
    435434{
    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    */
    439438  HB_Coverage*  BacktrackCoverage;   /* array of backtrack Coverage
    440439                                         tables                          */
     440
     441
     442
    441443  HB_UShort      LookaheadGlyphCount; /* number of lookahead glyphs      */
    442   HB_Coverage*  LookaheadCoverage;   /* array of lookahead Coverage
    443                                          tables                          */
    444444  HB_UShort      GlyphCount;          /* number of Glyph IDs             */
    445   HB_UShort*     Substitute;          /* array of substitute Glyph ID    */
    446445};
    447446
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-gsub.h

    r2 r846  
    3232HB_BEGIN_HEADER
    3333
    34 
    3534/* Lookup types for glyph substitution */
    3635
     
    6160struct  HB_GSUBHeader_
    6261{
     62
     63
     64
     65
     66
     67
     68
     69
    6370  HB_UInt         offset;
    6471
     
    6875  HB_FeatureList  FeatureList;
    6976  HB_LookupList   LookupList;
    70 
    71   HB_GDEFHeader*  gdef;
    72 
    73   /* the next two fields are used for an alternate substitution callback
    74      function to select the proper alternate glyph.                      */
    75 
    76   HB_AltFunction  altfunc;
    77   void*            data;
    7877};
    7978
     
    136135                                HB_Buffer        buffer );
    137136
    138 
    139137HB_END_HEADER
    140138
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-hangul.c

    r2 r846  
    131131    { HB_MAKE_TAG('c', 'c', 'm', 'p'), CcmpProperty },
    132132    { 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 },
    134134    { HB_MAKE_TAG('t', 'j', 'm', 'o'), CcmpProperty },
    135135    { 0, 0 }
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp

    r769 r846  
    834834    None, None, None, Post,
    835835
    836     Post, None, Below, None,
     836    P, None, Below, None,
    837837    None, Post, None, None,
    838838    None, None, None, None,
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h

    r2 r846  
    7070                                               HB_Stream             input );
    7171HB_INTERNAL HB_Error
    72 _HB_OPEN_Load_Device( HB_Device* d,
     72_HB_OPEN_Load_Device( HB_Device* d,
    7373                       HB_Stream    input );
    7474
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-open.c

    r561 r846  
    12831283
    12841284HB_INTERNAL HB_Error
    1285 _HB_OPEN_Load_Device( HB_Device* d,
     1285_HB_OPEN_Load_Device( HB_Device*,
    12861286                       HB_Stream    stream )
    12871287{
     1288
    12881289  HB_Error   error;
    12891290
     
    12951296  if ( ACCESS_Frame( 6L ) )
    12961297    return error;
     1298
     1299
     1300
     1301
     1302
     1303
     1304
     1305
    12971306
    12981307  d->StartSize   = GET_UShort();
     
    13191328
    13201329  if ( ALLOC_ARRAY( d->DeltaValue, count, HB_UShort ) )
    1321     return error;
     1330  {
     1331    FREE( *device );
     1332    *device = 0;
     1333    return error;
     1334  }
    13221335
    13231336  if ( ACCESS_Frame( count * 2L ) )
    13241337  {
    13251338    FREE( d->DeltaValue );
     1339
     1340
    13261341    return error;
    13271342  }
     
    13411356_HB_OPEN_Free_Device( HB_Device* d )
    13421357{
    1343   FREE( d->DeltaValue );
     1358  if ( d )
     1359  {
     1360    FREE( d->DeltaValue );
     1361    FREE( d );
     1362  }
    13441363}
    13451364
     
    13851404                      HB_Short*    value )
    13861405{
    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;
    13941411    s    = size - d->StartSize;
    13951412    byte = d->DeltaValue[s >> ( 4 - f )];
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-open.h

    r2 r846  
    4343struct  HB_LangSys_
    4444{
     45
    4546  HB_UShort   LookupOrderOffset;      /* always 0 for TT Open 1.0  */
    4647  HB_UShort   ReqFeatureIndex;        /* required FeatureIndex     */
    4748  HB_UShort   FeatureCount;           /* number of Feature indices */
    48   HB_UShort*  FeatureIndex;           /* array of Feature indices  */
    4949};
    5050
     
    5454struct  HB_LangSysRecord_
    5555{
     56
    5657  HB_UInt     LangSysTag;            /* LangSysTag identifier */
    57   HB_LangSys  LangSys;               /* LangSys table         */
    5858};
    5959
     
    6363struct  HB_ScriptTable_
    6464{
     65
    6566  HB_LangSys         DefaultLangSys; /* DefaultLangSys table     */
    6667  HB_UShort           LangSysCount;   /* number of LangSysRecords */
    67   HB_LangSysRecord*  LangSysRecord;  /* array of LangSysRecords  */
    6868};
    6969
     
    8282struct  HB_ScriptList_
    8383{
     84
    8485  HB_UShort          ScriptCount;     /* number of ScriptRecords */
    85   HB_ScriptRecord*  ScriptRecord;    /* array of ScriptRecords  */
    8686};
    8787
     
    9393struct HB_Feature_
    9494{
     95
    9596  HB_UShort   FeatureParams;          /* always 0 for TT Open 1.0     */
    9697  HB_UShort   LookupListCount;        /* number of LookupList indices */
    97   HB_UShort*  LookupListIndex;        /* array of LookupList indices  */
    9898};
    9999
     
    112112struct  HB_FeatureList_
    113113{
     114
     115
    114116  HB_UShort           FeatureCount;   /* number of FeatureRecords */
    115   HB_FeatureRecord*  FeatureRecord;  /* array of FeatureRecords  */
    116   HB_UShort*            ApplyOrder;     /* order to apply features */
    117117  HB_UShort             ApplyCount;     /* number of elements in ApplyOrder */
    118118};
     
    128128struct  HB_Lookup_
    129129{
     130
    130131  HB_UShort      LookupType;          /* Lookup type         */
    131132  HB_UShort      LookupFlag;          /* Lookup qualifiers   */
    132133  HB_UShort      SubTableCount;       /* number of SubTables */
    133   HB_SubTable*  SubTable;            /* array of SubTables  */
    134134};
    135135
     
    145145struct  HB_LookupList_
    146146{
    147   HB_UShort    LookupCount;           /* number of Lookups       */
    148147  HB_Lookup*  Lookup;                /* array of Lookup records */
    149148  HB_UInt*     Properties;            /* array of flags          */
     149
    150150};
    151151
     
    168168struct  HB_CoverageFormat1_
    169169{
     170
    170171  HB_UShort   GlyphCount;             /* number of glyphs in GlyphArray */
    171   HB_UShort*  GlyphArray;             /* array of glyph IDs             */
    172172};
    173173
     
    188188struct  HB_CoverageFormat2_
    189189{
     190
    190191  HB_UShort         RangeCount;       /* number of RangeRecords */
    191   HB_RangeRecord*  RangeRecord;      /* array of RangeRecords  */
    192192};
    193193
     
    197197struct  HB_Coverage_
    198198{
    199   HB_UShort  CoverageFormat;          /* 1 or 2 */
     199  HB_  CoverageFormat;          /* 1 or 2 */
    200200
    201201  union
     
    211211struct  HB_ClassDefFormat1_
    212212{
     213
    213214  HB_UShort   StartGlyph;             /* first glyph ID of the
    214215                                         ClassValueArray             */
    215216  HB_UShort   GlyphCount;             /* size of the ClassValueArray */
    216   HB_UShort*  ClassValueArray;        /* array of class values       */
    217217};
    218218
     
    232232struct  HB_ClassDefFormat2_
    233233{
     234
     235
    234236  HB_UShort              ClassRangeCount;
    235237                                      /* number of ClassRangeRecords */
    236   HB_ClassRangeRecord*  ClassRangeRecord;
    237                                       /* array of ClassRangeRecords  */
    238238};
    239239
     
    243243struct  HB_ClassDefinition_
    244244{
    245   HB_Bool    loaded;
    246 
    247   HB_UShort  ClassFormat;             /* 1 or 2                      */
    248 
    249245  union
    250246  {
     
    252248    HB_ClassDefFormat2  cd2;
    253249  } cd;
     250
     251
     252
    254253};
    255254
     
    259258struct HB_Device_
    260259{
     260
    261261  HB_UShort   StartSize;              /* smallest size to correct      */
    262262  HB_UShort   EndSize;                /* largest size to correct       */
    263   HB_UShort   DeltaFormat;            /* DeltaValue array data format:
     263  HB_   DeltaFormat;            /* DeltaValue array data format:
    264264                                         1, 2, or 3                    */
    265   HB_UShort*  DeltaValue;             /* array of compressed data      */
    266265};
    267266
     
    277276typedef enum HB_Type_  HB_Type;
    278277
    279 
    280278HB_END_HEADER
    281279
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-shaper-all.cpp

    r2 r846  
    2626#include "harfbuzz-indic.cpp"
    2727extern "C" {
     28
    2829#include "harfbuzz-tibetan.c"
    2930#include "harfbuzz-khmer.c"
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h

    r769 r846  
    104104
    105105extern HB_Bool HB_BasicShape(HB_ShaperItem *shaper_item);
     106
    106107extern HB_Bool HB_TibetanShape(HB_ShaperItem *shaper_item);
    107108extern HB_Bool HB_HebrewShape(HB_ShaperItem *shaper_item);
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp

    r561 r846  
    184184            goto next;
    185185
    186         // two complex chars (thai or lao), thai_attributes might override, but here we do a best guess
    187         if (cls == HB_LineBreak_SA && ncls == HB_LineBreak_SA) {
    188             lineBreakType = HB_Break;
    189             goto next;
    190         }
    191 
    192186        {
    193187            int tcls = ncls;
     188
     189
     190
    194191            if (tcls >= HB_LineBreak_SA)
    195                 tcls = HB_LineBreak_ID;
     192                tcls = HB_LineBreak_;
    196193            if (cls >= HB_LineBreak_SA)
    197                 cls = HB_LineBreak_ID;
     194                cls = HB_LineBreak_;
    198195
    199196            int brk = breakTable[cls][tcls];
     
    588585    { HB_BasicShape, 0},
    589586    // Greek
    590     { HB_BasicShape, 0},
     587    { HB_Shape, 0},
    591588    // Cyrillic
    592589    { HB_BasicShape, 0},
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h

    r561 r846  
    3434
    3535HB_BEGIN_HEADER
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
    3648
    3749typedef enum {
     
    124136
    125137typedef 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;
    132144} HB_CharAttributes;
    133145
     
    182194 */
    183195typedef 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;
    190202} HB_GlyphAttributes;
    191203
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-stream.h

    r2 r846  
    3434{
    3535    HB_Byte*       base;
     36
    3637    HB_UInt        size;
    3738    HB_UInt        pos;
    38    
    39     HB_Byte*       cursor;
    4039} HB_StreamRec;
    41 
    4240
    4341HB_END_HEADER
  • trunk/src/3rdparty/harfbuzz/src/harfbuzz-thai.c

    r2 r846  
    2828
    2929#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
    3059
    3160static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttributes *attributes)
    3261{
    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;
    3764    int brp[128];
    3865    int *break_positions = brp;
     
    4067    hb_uint32 i;
    4168
    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();
    5171
    5272    if (!th_brk)
    5373        return;
    5474
    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);
    5877
    59     break_positions = brp;
     78    to_tis620(string, len, cstr);
     79
    6080    numbreaks = th_brk(cstr, break_positions, 128);
    6181    if (numbreaks > 128) {
     
    6484    }
    6585
    66     for (i = 0; i < len; ++i)
     86    for (i = 0; i < len; ++i)
    6787        attributes[i].lineBreakType = HB_NoBreak;
     88
     89
    6890
    6991    for (i = 0; i < numbreaks; ++i) {
    70         if (break_positions[i] > 0)
     92        if (break_positions[i] > 0)
    7193            attributes[break_positions[i]-1].lineBreakType = HB_Break;
     94
     95
    7296    }
    7397
     
    7599        free(break_positions);
    76100
    77     HB_TextCodec_FreeResult(cstr);
     101    if (len >= 128)
     102        free(cstr);
    78103}
    79 
    80104
    81105void 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  
    8080}
    8181
    82 void *HB_Library_Resolve(const char *library, const char *symbol)
     82void *HB_Library_Resolve(const char *library, const char *symbol)
    8383{
    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);
    10685}
    10786
Note: See TracChangeset for help on using the changeset viewer.