summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-dump.c8
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-global.h2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h39
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-gpos.c85
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper.h8
5 files changed, 72 insertions, 70 deletions
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-dump.c b/src/3rdparty/harfbuzz/src/harfbuzz-dump.c
index a1ef6b6..54d42e9 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-dump.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-dump.c
@@ -519,13 +519,13 @@ Dump_ValueRecord (HB_ValueRecord *ValueRecord, FILE *stream, int indent, HB_Type
if (value_format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE)
DUMP_FINT (ValueRecord, XAdvance);
if (value_format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE)
- RECURSE (Device, Device, &*ValueRecord->XPlacementDevice);
+ RECURSE (Device, Device, &*ValueRecord->DeviceTables[VR_X_PLACEMENT_DEVICE]);
if (value_format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE)
- RECURSE (Device, Device, &*ValueRecord->YPlacementDevice);
+ RECURSE (Device, Device, &*ValueRecord->DeviceTables[VR_Y_PLACEMENT_DEVICE]);
if (value_format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE)
- RECURSE (Device, Device, &*ValueRecord->XAdvanceDevice);
+ RECURSE (Device, Device, &*ValueRecord->DeviceTables[VR_X_ADVANCE_DEVICE]);
if (value_format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE)
- RECURSE (Device, Device, &*ValueRecord->YAdvanceDevice);
+ RECURSE (Device, Device, &*ValueRecord->DeviceTables[VR_Y_ADVANCE_DEVICE]);
#ifdef HB_SUPPORT_MULTIPLE_MASTER
if (value_format & HB_GPOS_FORMAT_HAVE_X_ID_PLACEMENT)
DUMP_FUINT (ValueRecord, XIdPlacement);
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-global.h b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
index bccd6a2..5b2b679 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-global.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
@@ -39,7 +39,7 @@
#define HB_END_HEADER /* nothing */
#endif
-#if defined(__GNUC__) || defined(_MSC_VER)
+#if defined(__GNUC__) || defined(__ARMCC__) || defined(__CC_ARM) || defined(_MSC_VER)
#define HB_USE_PACKED_STRUCTS
#endif
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
index d513c27..3a4952b 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
@@ -38,6 +38,11 @@ HB_BEGIN_HEADER
/* shared tables */
+#define VR_X_PLACEMENT_DEVICE 0
+#define VR_Y_PLACEMENT_DEVICE 1
+#define VR_X_ADVANCE_DEVICE 2
+#define VR_Y_ADVANCE_DEVICE 3
+
struct HB_ValueRecord_
{
HB_Short XPlacement; /* horizontal adjustment for
@@ -48,14 +53,10 @@ struct HB_ValueRecord_
advance */
HB_Short YAdvance; /* vertical adjustment for
advance */
- HB_Device* XPlacementDevice; /* device table for horizontal
- placement */
- HB_Device* YPlacementDevice; /* device table for vertical
- placement */
- HB_Device* XAdvanceDevice; /* device table for horizontal
- advance */
- HB_Device* YAdvanceDevice; /* device table for vertical
- advance */
+
+ HB_Device** DeviceTables; /* device tables for placement
+ and advance */
+
#ifdef HB_SUPPORT_MULTIPLE_MASTER
HB_UShort XIdPlacement; /* horizontal placement metric ID */
HB_UShort YIdPlacement; /* vertical placement metric ID */
@@ -70,6 +71,8 @@ typedef struct HB_ValueRecord_ HB_ValueRecord;
/* Mask values to scan the value format of the ValueRecord structure.
We always expand compressed ValueRecords of the font. */
+#define HB_GPOS_FORMAT_HAVE_DEVICE_TABLES 0x00F0
+
#define HB_GPOS_FORMAT_HAVE_X_PLACEMENT 0x0001
#define HB_GPOS_FORMAT_HAVE_Y_PLACEMENT 0x0002
#define HB_GPOS_FORMAT_HAVE_X_ADVANCE 0x0004
@@ -533,18 +536,18 @@ typedef struct HB_ContextPos_ HB_ContextPos;
struct HB_ChainPosRule_
{
+ HB_UShort* Backtrack; /* array of backtrack glyph IDs */
+ HB_UShort* Input; /* array of input glyph IDs */
+ HB_UShort* Lookahead; /* array of lookahead glyph IDs */
+ HB_PosLookupRecord* PosLookupRecord;
+ /* array of PosLookupRecords */
HB_UShort BacktrackGlyphCount;
/* total number of backtrack glyphs */
- HB_UShort* Backtrack; /* array of backtrack glyph IDs */
HB_UShort InputGlyphCount;
/* total number of input glyphs */
- HB_UShort* Input; /* array of input glyph IDs */
HB_UShort LookaheadGlyphCount;
/* total number of lookahead glyphs */
- HB_UShort* Lookahead; /* array of lookahead glyph IDs */
HB_UShort PosCount; /* number of PosLookupRecords */
- HB_PosLookupRecord* PosLookupRecord;
- /* array of PosLookupRecords */
};
typedef struct HB_ChainPosRule_ HB_ChainPosRule;
@@ -574,20 +577,20 @@ typedef struct HB_ChainContextPosFormat1_ HB_ChainContextPosFormat1;
struct HB_ChainPosClassRule_
{
+ HB_UShort* Backtrack; /* array of backtrack classes */
+ HB_UShort* Input; /* array of context classes */
+ HB_UShort* Lookahead; /* array of lookahead classes */
+ HB_PosLookupRecord* PosLookupRecord;
+ /* array of substitution lookups */
HB_UShort BacktrackGlyphCount;
/* total number of backtrack
classes */
- HB_UShort* Backtrack; /* array of backtrack classes */
HB_UShort InputGlyphCount;
/* total number of context classes */
- HB_UShort* Input; /* array of context classes */
HB_UShort LookaheadGlyphCount;
/* total number of lookahead
classes */
- HB_UShort* Lookahead; /* array of lookahead classes */
HB_UShort PosCount; /* number of PosLookupRecords */
- HB_PosLookupRecord* PosLookupRecord;
- /* array of substitution lookups */
};
typedef struct HB_ChainPosClassRule_ HB_ChainPosClassRule;
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
index 61e42fd..1933f3d 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
@@ -256,6 +256,20 @@ static HB_Error Load_ValueRecord( HB_ValueRecord* vr,
else
vr->YAdvance = 0;
+ if ( format & HB_GPOS_FORMAT_HAVE_DEVICE_TABLES )
+ {
+ if ( ALLOC_ARRAY( vr->DeviceTables, 4, HB_Device ) )
+ return error;
+ vr->DeviceTables[VR_X_ADVANCE_DEVICE] = 0;
+ vr->DeviceTables[VR_Y_ADVANCE_DEVICE] = 0;
+ vr->DeviceTables[VR_X_PLACEMENT_DEVICE] = 0;
+ vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] = 0;
+ }
+ else
+ {
+ vr->DeviceTables = 0;
+ }
+
if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE )
{
if ( ACCESS_Frame( 2L ) )
@@ -271,18 +285,11 @@ static HB_Error Load_ValueRecord( HB_ValueRecord* vr,
cur_offset = FILE_Pos();
if ( FILE_Seek( new_offset ) ||
- ( error = _HB_OPEN_Load_Device( &vr->XPlacementDevice,
+ ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[VR_X_PLACEMENT_DEVICE],
stream ) ) != HB_Err_Ok )
return error;
(void)FILE_Seek( cur_offset );
}
- else
- goto empty1;
- }
- else
- {
- empty1:
- vr->XPlacementDevice = 0;
}
if ( format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE )
@@ -300,18 +307,11 @@ static HB_Error Load_ValueRecord( HB_ValueRecord* vr,
cur_offset = FILE_Pos();
if ( FILE_Seek( new_offset ) ||
- ( error = _HB_OPEN_Load_Device( &vr->YPlacementDevice,
+ ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[VR_Y_PLACEMENT_DEVICE],
stream ) ) != HB_Err_Ok )
goto Fail3;
(void)FILE_Seek( cur_offset );
}
- else
- goto empty2;
- }
- else
- {
- empty2:
- vr->YPlacementDevice = 0;
}
if ( format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE )
@@ -329,18 +329,11 @@ static HB_Error Load_ValueRecord( HB_ValueRecord* vr,
cur_offset = FILE_Pos();
if ( FILE_Seek( new_offset ) ||
- ( error = _HB_OPEN_Load_Device( &vr->XAdvanceDevice,
+ ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[VR_X_ADVANCE_DEVICE],
stream ) ) != HB_Err_Ok )
goto Fail2;
(void)FILE_Seek( cur_offset );
}
- else
- goto empty3;
- }
- else
- {
- empty3:
- vr->XAdvanceDevice = 0;
}
if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE )
@@ -358,18 +351,11 @@ static HB_Error Load_ValueRecord( HB_ValueRecord* vr,
cur_offset = FILE_Pos();
if ( FILE_Seek( new_offset ) ||
- ( error = _HB_OPEN_Load_Device( &vr->YAdvanceDevice,
+ ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[VR_Y_ADVANCE_DEVICE],
stream ) ) != HB_Err_Ok )
goto Fail1;
(void)FILE_Seek( cur_offset );
}
- else
- goto empty4;
- }
- else
- {
- empty4:
- vr->YAdvanceDevice = 0;
}
if ( format & HB_GPOS_FORMAT_HAVE_X_ID_PLACEMENT )
@@ -447,13 +433,15 @@ static HB_Error Load_ValueRecord( HB_ValueRecord* vr,
return HB_Err_Ok;
Fail1:
- _HB_OPEN_Free_Device( &vr->YAdvanceDevice );
+ _HB_OPEN_Free_Device( &vr->DeviceTables[VR_Y_ADVANCE_DEVICE] );
Fail2:
- _HB_OPEN_Free_Device( &vr->XAdvanceDevice );
+ _HB_OPEN_Free_Device( &vr->DeviceTables[VR_X_ADVANCE_DEVICE] );
Fail3:
- _HB_OPEN_Free_Device( &vr->YPlacementDevice );
+ _HB_OPEN_Free_Device( &vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] );
+
+ FREE( vr->DeviceTables );
return error;
}
@@ -462,13 +450,14 @@ static void Free_ValueRecord( HB_ValueRecord* vr,
HB_UShort format )
{
if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE )
- _HB_OPEN_Free_Device( &vr->YAdvanceDevice );
+ _HB_OPEN_Free_Device( &vr->DeviceTables[VR_Y_ADVANCE_DEVICE] );
if ( format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE )
- _HB_OPEN_Free_Device( &vr->XAdvanceDevice );
+ _HB_OPEN_Free_Device( &vr->DeviceTables[VR_X_ADVANCE_DEVICE] );
if ( format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE )
- _HB_OPEN_Free_Device( &vr->YPlacementDevice );
+ _HB_OPEN_Free_Device( &vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] );
if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE )
- _HB_OPEN_Free_Device( &vr->XPlacementDevice );
+ _HB_OPEN_Free_Device( &vr->DeviceTables[VR_X_PLACEMENT_DEVICE] );
+ FREE( vr->DeviceTables );
}
@@ -511,24 +500,34 @@ static HB_Error Get_ValueRecord( GPOS_Instance* gpi,
{
/* pixel -> fractional pixel */
+ if ( format & HB_GPOS_FORMAT_HAVE_DEVICE_TABLES )
+ {
+ if ( ALLOC_ARRAY( vr->DeviceTables, 4, HB_Device ) )
+ return error;
+ vr->DeviceTables[VR_X_ADVANCE_DEVICE] = 0;
+ vr->DeviceTables[VR_Y_ADVANCE_DEVICE] = 0;
+ vr->DeviceTables[VR_X_PLACEMENT_DEVICE] = 0;
+ vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] = 0;
+ }
+
if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE )
{
- _HB_OPEN_Get_Device( &vr->XPlacementDevice, x_ppem, &pixel_value );
+ _HB_OPEN_Get_Device( &vr->DeviceTables[VR_X_PLACEMENT_DEVICE], x_ppem, &pixel_value );
gd->x_pos += pixel_value << 6;
}
if ( format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE )
{
- _HB_OPEN_Get_Device( &vr->YPlacementDevice, y_ppem, &pixel_value );
+ _HB_OPEN_Get_Device( &vr->DeviceTables[VR_Y_PLACEMENT_DEVICE], y_ppem, &pixel_value );
gd->y_pos += pixel_value << 6;
}
if ( format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE )
{
- _HB_OPEN_Get_Device( &vr->XAdvanceDevice, x_ppem, &pixel_value );
+ _HB_OPEN_Get_Device( &vr->DeviceTables[VR_X_ADVANCE_DEVICE], x_ppem, &pixel_value );
gd->x_advance += pixel_value << 6;
}
if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE )
{
- _HB_OPEN_Get_Device( &vr->YAdvanceDevice, y_ppem, &pixel_value );
+ _HB_OPEN_Get_Device( &vr->DeviceTables[VR_Y_ADVANCE_DEVICE], y_ppem, &pixel_value );
gd->y_advance += pixel_value << 6;
}
}
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
index 32f5781..ab5c07a 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
@@ -258,6 +258,10 @@ typedef struct HB_Font_ {
void *userData;
} HB_FontRec;
+#ifdef HB_USE_PACKED_STRUCTS
+#pragma pack(pop)
+#endif
+
typedef struct HB_ShaperItem_ HB_ShaperItem;
struct HB_ShaperItem_ {
@@ -285,10 +289,6 @@ struct HB_ShaperItem_ {
HB_Bool HB_ShapeItem(HB_ShaperItem *item);
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(pop)
-#endif
-
HB_END_HEADER
#endif