#143693, Sayamindu Dasgupta

Wed Jun 23 16:13:53 2004  Owen Taylor  <otaylor@redhat.com>

        #143693, Sayamindu Dasgupta

        * pango/opentype/pango-ot-buffer.c (pango_ot_buffer_set_zero_width_marks) pango/opentype/pango-ot-private.h:
        Allow setting for whether marks should be given zero width,
        defaulting to FALSE.

        * modules/arabic/arabic-fc.c (arabic_engine_shape): Turn
        on zero-width-marks setting.
This commit is contained in:
Owen Taylor 2004-06-23 20:33:35 +00:00 committed by Owen Taylor
parent 68d4cedb87
commit 99848cfafe
2 changed files with 24 additions and 3 deletions

View File

@ -42,6 +42,7 @@ pango_ot_buffer_new (PangoFcFont *font)
buffer->font = g_object_ref (font); buffer->font = g_object_ref (font);
buffer->applied_gpos = FALSE; buffer->applied_gpos = FALSE;
buffer->rtl = FALSE; buffer->rtl = FALSE;
buffer->zero_width_marks = FALSE;
pango_fc_font_unlock_face (font); pango_fc_font_unlock_face (font);
@ -82,6 +83,24 @@ pango_ot_buffer_set_rtl (PangoOTBuffer *buffer,
buffer->rtl = rtl; buffer->rtl = rtl;
} }
/**
* pango_ot_buffer_set_zero_width_marks:
* @buffer: a #PangoOTBuffer
* @zero_width_marks: %TRUE if characters with a mark class should
* be forced to zero width.
*
* Sets whether characters with a mark class should be forced to zero width.
* This setting is needed for proper positioning of Arabic accents,
* but will produce incorrect results with standard OpenType indic
* fonts.
**/
void
pango_ot_buffer_set_zero_width_marks (PangoOTBuffer *buffer,
gboolean zero_width_marks)
{
buffer->zero_width_marks = zero_width_marks != FALSE;
}
void void
pango_ot_buffer_get_glyphs (PangoOTBuffer *buffer, pango_ot_buffer_get_glyphs (PangoOTBuffer *buffer,
PangoOTGlyph **glyphs, PangoOTGlyph **glyphs,
@ -228,7 +247,8 @@ pango_ot_buffer_output (PangoOTBuffer *buffer,
FT_UShort property; FT_UShort property;
if (gdef && if (buffer->zero_width_marks &&
gdef &&
TT_GDEF_Get_Glyph_Property (gdef, glyphs->glyphs[i].glyph, &property) == FT_Err_Ok && TT_GDEF_Get_Glyph_Property (gdef, glyphs->glyphs[i].glyph, &property) == FT_Err_Ok &&
(property == TTO_MARK || (property & IGNORE_SPECIAL_MARKS) != 0)) (property == TTO_MARK || (property & IGNORE_SPECIAL_MARKS) != 0))
{ {

View File

@ -84,8 +84,9 @@ struct _PangoOTBuffer
{ {
OTL_Buffer buffer; OTL_Buffer buffer;
PangoFcFont *font; PangoFcFont *font;
gboolean rtl; guint rtl : 1;
gboolean applied_gpos; guint zero_width_marks : 1;
guint applied_gpos : 1;
}; };
GType pango_ot_info_get_type (void); GType pango_ot_info_get_type (void);