Add modules modules/indic/indic-xft.c, indic-ot.c, indic-ot.h,

Mon May 06 15:07:39 2002 Eric Mader <mader@jtcsv.com>
	* Add modules modules/indic/indic-xft.c, indic-ot.c, indic-ot.h, indic-ot-class-tables.c

	* pango/opentype/ftxgdef.c: Compute full offset for mark attachment class table

	* pango/opentype/ftxgpos.c: Only return TTO_Err_Not_Covered if nothing matches

	* pango/opentype/pango-ot-ruleset.c: enable GPOS processing
This commit is contained in:
Eric Mader 2002-05-07 20:39:14 +00:00 committed by Eric Mader
parent cf00f8217c
commit a63dbbbeeb
3 changed files with 56 additions and 22 deletions

View File

@ -230,9 +230,15 @@
/* OpenType 1.2 has introduced the `MarkAttachClassDef' field. We
first have to scan the LookupFlag values to find out whether we
must load it or not. Here we only store the current file offset. */
must load it or not. Here we only store the offset of the table. */
new_offset = GET_UShort();
if ( new_offset )
gdef->MarkAttachClassDef_offset = new_offset + base_offset;
else
gdef->MarkAttachClassDef_offset = 0;
gdef->MarkAttachClassDef_offset = FILE_Pos();
gdef->MarkAttachClassDef.loaded = FALSE;
gdef->LastGlyph = 0;

View File

@ -267,19 +267,6 @@
if ( lo[i].LookupFlag & IGNORE_SPECIAL_MARKS )
{
if ( FILE_Seek( gdef->MarkAttachClassDef_offset ) ||
ACCESS_Frame( 2L ) )
goto Fail1;
new_offset = GET_UShort();
FORGET_Frame();
if ( !new_offset )
return TTO_Err_Invalid_GDEF_SubTable;
new_offset += base_offset;
if ( FILE_Seek( new_offset ) ||
( error = Load_ClassDefinition( &gdef->MarkAttachClassDef,
256, stream ) ) != TT_Err_Ok )
goto Fail1;
@ -2409,6 +2396,7 @@
&x_mark_value, &y_mark_value );
if ( error )
return error;
error = Get_Anchor( gpi, base_anchor, in->string[j],
&x_base_value, &y_base_value );
if ( error )
@ -6116,7 +6104,7 @@
TTO_GSUB_String* in,
TTO_GPOS_Data* out )
{
FT_Error error = TTO_Err_Not_Covered;
FT_Error error, retError = TTO_Err_Not_Covered;
TTO_GPOSHeader* gpos = gpi->gpos;
FT_UShort* properties = gpos->LookupList.Properties;
@ -6158,9 +6146,11 @@
if ( error == TTO_Err_Not_Covered )
(in->pos)++;
else
retError = error;
}
return error;
return retError;
}
@ -6253,7 +6243,7 @@
FT_Bool r2l )
{
FT_Memory memory = gpos->memory;
FT_Error error = TTO_Err_Not_Covered;
FT_Error error, retError = TTO_Err_Not_Covered;
GPOS_Instance gpi;
FT_UShort j;
@ -6282,11 +6272,16 @@
if ( !properties || properties[j] )
{
error = Do_String_Lookup( &gpi, j, in, *out );
if ( error && error != TTO_Err_Not_Covered )
return error;
if ( error )
{
if ( error != TTO_Err_Not_Covered )
return error;
}
else
retError = error;
}
return error;
return retError;
}
/* END */

View File

@ -24,6 +24,9 @@
#include <pango/pango-ot.h>
#include "pango-ot-private.h"
#define PANGO_SCALE_26_6 (PANGO_SCALE / (1<<6))
#define PANGO_UNITS_26_6(d) (PANGO_SCALE_26_6 * (d))
typedef struct _PangoOTRule PangoOTRule;
struct _PangoOTRule
@ -234,6 +237,36 @@ pango_ot_ruleset_shape (PangoOTRuleset *ruleset,
else
result_string = in_string;
if (gpos)
{
TTO_GPOS_Data *outgpos = NULL;
if (!TT_GPOS_Apply_String (ruleset->info->face, gpos, 0, result_string, &outgpos,
FALSE /* enable device-dependant values */,
FALSE /* Even though this might be r2l text, RTL is handled elsewhere */))
{
for (i = 0; i < result_string->length; i++)
{
int j;
glyphs->glyphs[i].geometry.x_offset += PANGO_UNITS_26_6 (outgpos[i].x_pos);
glyphs->glyphs[i].geometry.y_offset += PANGO_UNITS_26_6 (outgpos[i].y_pos);
for (j = i - outgpos[i].back; j < i; j++)
glyphs->glyphs[i].geometry.x_offset -= glyphs->glyphs[j].geometry.width;
if (outgpos[i].new_advance)
/* Can't set new x offset for marks, so just make sure not to increase it.
Can do better than this by playing with ->x_offset. */
glyphs->glyphs[i].geometry.width = 0;
else
glyphs->glyphs[i].geometry.width += PANGO_UNITS_26_6(outgpos[i].x_advance);
}
FT_Free(gpos->memory, (void *)outgpos);
}
}
pango_glyph_string_set_size (glyphs, result_string->length);
last_cluster = -1;