crr[index].End = end;
crr[index].Class = class;
- cd->Defined[class] = TRUE;
-
return HB_Err_Ok;
}
gcd->ClassFormat = 2;
- /* A GlyphClassDef table contains at most 5 different class values */
-
- if ( ALLOC_ARRAY( gcd->Defined, 5, HB_Bool ) )
- return error;
-
gcd->cd.cd2.ClassRangeCount = 0;
gcd->cd.cd2.ClassRangeRecord = NULL;
FREE( gcd->cd.cd2.ClassRangeRecord );
Fail4:
- FREE( gcd->Defined );
return error;
}
HB_UShort* c;
HB_PosLookupRecord* plr;
- HB_Bool* d;
if ( ACCESS_Frame( 4L ) )
return error;
c = pcr->Class;
- d = cpf2->ClassDef.Defined;
if ( ACCESS_Frame( count * 2L ) )
goto Fail2;
for ( n = 0; n < count; n++ )
- {
c[n] = GET_UShort();
- /* We check whether the specific class is used at all. If not,
- class 0 is used instead. */
-
- if ( !d[c[n]] )
- c[n] = 0;
- }
-
FORGET_Frame();
pcr->PosLookupRecord = NULL;
HB_UShort* i;
HB_UShort* l;
HB_PosLookupRecord* plr;
- HB_Bool* d;
if ( ACCESS_Frame( 2L ) )
return error;
b = cpcr->Backtrack;
- d = ccpf2->BacktrackClassDef.Defined;
if ( ACCESS_Frame( count * 2L ) )
goto Fail4;
for ( n = 0; n < count; n++ )
- {
b[n] = GET_UShort();
- /* We check whether the specific class is used at all. If not,
- class 0 is used instead. */
-
- if ( !d[b[n]] )
- b[n] = 0;
- }
-
FORGET_Frame();
if ( ACCESS_Frame( 2L ) )
goto Fail4;
i = cpcr->Input;
- d = ccpf2->InputClassDef.Defined;
if ( ACCESS_Frame( count * 2L ) )
goto Fail3;
for ( n = 0; n < count; n++ )
- {
i[n] = GET_UShort();
- if ( !d[i[n]] )
- i[n] = 0;
- }
-
FORGET_Frame();
if ( ACCESS_Frame( 2L ) )
goto Fail3;
l = cpcr->Lookahead;
- d = ccpf2->LookaheadClassDef.Defined;
if ( ACCESS_Frame( count * 2L ) )
goto Fail2;
for ( n = 0; n < count; n++ )
- {
l[n] = GET_UShort();
- if ( !d[l[n]] )
- l[n] = 0;
- }
-
FORGET_Frame();
if ( ACCESS_Frame( 2L ) )
HB_UShort* c;
HB_SubstLookupRecord* slr;
- HB_Bool* d;
if ( ACCESS_Frame( 4L ) )
return error;
c = scr->Class;
- d = csf2->ClassDef.Defined;
if ( ACCESS_Frame( count * 2L ) )
goto Fail2;
for ( n = 0; n < count; n++ )
- {
c[n] = GET_UShort();
- /* We check whether the specific class is used at all. If not,
- class 0 is used instead. */
- if ( !d[c[n]] )
- c[n] = 0;
- }
-
FORGET_Frame();
scr->SubstLookupRecord = NULL;
HB_UShort* i;
HB_UShort* l;
HB_SubstLookupRecord* slr;
- HB_Bool* d;
if ( ACCESS_Frame( 2L ) )
return error;
b = cscr->Backtrack;
- d = ccsf2->BacktrackClassDef.Defined;
if ( ACCESS_Frame( count * 2L ) )
goto Fail4;
for ( n = 0; n < count; n++ )
- {
b[n] = GET_UShort();
- /* We check whether the specific class is used at all. If not,
- class 0 is used instead. */
-
- if ( !d[b[n]] )
- b[n] = 0;
- }
-
FORGET_Frame();
if ( ACCESS_Frame( 2L ) )
goto Fail4;
i = cscr->Input;
- d = ccsf2->InputClassDef.Defined;
if ( ACCESS_Frame( count * 2L ) )
goto Fail3;
for ( n = 0; n < count; n++ )
- {
i[n] = GET_UShort();
- if ( !d[i[n]] )
- i[n] = 0;
- }
-
FORGET_Frame();
if ( ACCESS_Frame( 2L ) )
goto Fail3;
l = cscr->Lookahead;
- d = ccsf2->LookaheadClassDef.Defined;
if ( ACCESS_Frame( count * 2L ) )
goto Fail2;
for ( n = 0; n < count; n++ )
- {
l[n] = GET_UShort();
- if ( !d[l[n]] )
- l[n] = 0;
- }
-
FORGET_Frame();
if ( ACCESS_Frame( 2L ) )
HB_UShort n, count;
HB_UShort* cva;
- HB_Bool* d;
HB_ClassDefFormat1* cdf1;
if ( ALLOC_ARRAY( cdf1->ClassValueArray, count, HB_UShort ) )
return error;
- d = cd->Defined;
cva = cdf1->ClassValueArray;
if ( ACCESS_Frame( count * 2L ) )
error = ERR(HB_Err_Invalid_SubTable);
goto Fail;
}
- d[cva[n]] = TRUE;
}
FORGET_Frame();
HB_UShort n, count;
HB_ClassRangeRecord* crr;
- HB_Bool* d;
HB_ClassDefFormat2* cdf2;
if ( ALLOC_ARRAY( cdf2->ClassRangeRecord, count, HB_ClassRangeRecord ) )
return error;
- d = cd->Defined;
crr = cdf2->ClassRangeRecord;
if ( ACCESS_Frame( count * 6L ) )
n--;
count--;
}
- else
- d[crr[n].Class] = TRUE;
}
FORGET_Frame();
{
HB_Error error;
- if ( ALLOC_ARRAY( cd->Defined, limit, HB_Bool ) )
- return error;
-
if ( ACCESS_Frame( 2L ) )
- goto Fail;
+ return error;
cd->ClassFormat = GET_UShort();
}
if ( error )
- goto Fail;
+ return error;
cd->loaded = TRUE;
return HB_Err_Ok;
-
-Fail:
- FREE( cd->Defined );
- return error;
}
{
HB_Error error;
- if ( ALLOC_ARRAY( cd->Defined, 1, HB_Bool ) )
- return error;
-
cd->ClassFormat = 1; /* Meaningless */
- cd->Defined[0] = FALSE;
if ( ALLOC_ARRAY( cd->cd.cd1.ClassValueArray, 1, HB_UShort ) )
- goto Fail;
+ return error;
return HB_Err_Ok;
-
-Fail:
- FREE( cd->Defined );
- return error;
}
HB_INTERNAL HB_Error
if ( !cd->loaded )
return;
- FREE( cd->Defined );
-
switch ( cd->ClassFormat )
{
case 1: Free_ClassDef1( &cd->cd.cd1 ); break;
typedef struct HB_ClassDefFormat2_ HB_ClassDefFormat2;
-/* The `Defined' field is not defined in the OpenType specification but
- apparently needed for processing fonts like trado.ttf: This font
- refers to a class which contains not a single element. We map such
- classes to class 0. */
-
struct HB_ClassDefinition_
{
HB_Bool loaded;
- HB_Bool* Defined; /* array of Booleans.
- If Defined[n] is FALSE,
- class n contains no glyphs. */
HB_UShort ClassFormat; /* 1 or 2 */
union