/* 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;
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;
&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 )
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;
if ( error == TTO_Err_Not_Covered )
(in->pos)++;
+ else
+ retError = error;
}
- return error;
+ return retError;
}
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;
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 */
#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
}
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;