diff --git a/ChangeLog b/ChangeLog index 50792b0..09fc5bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2011-05-25 Eric Wasylishen + + * Source/winlib/WIN32GState.m: + * Source/art/ARTGState.m: + * Source/cairo/CairoGState.m: + * Source/xlib/XGGState.m: + * Source/gsc/GSContext.m: + * Source/gsc/GSGState.m: + * Headers/gsc/GSGStateOps.h: + Add a new interface, GSShowGlyphsWithAdvances, which replaces + GSShowGlyphs as the primitive text drawing method. + + None of the backends implement it properly yet; I simply renamed + the existing -GSShowGlyphs:: methods to -GSShowGlyphsWithAdvances:::, + so they currently ignore the glyph advances. + 2011-05-19 Fred Kiefer * Headers/cairo/CairoFontEnumerator.h, diff --git a/Headers/gsc/GSGStateOps.h b/Headers/gsc/GSGStateOps.h index 1b7106e..8e42564 100644 --- a/Headers/gsc/GSGStateOps.h +++ b/Headers/gsc/GSGStateOps.h @@ -74,6 +74,7 @@ - (void) GSSetTextPosition: (NSPoint)loc; - (void) GSShowText: (const char *)string : (size_t) length; - (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length; +- (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length; /* ----------------------------------------------------------------------- */ /* Gstate operations */ diff --git a/Source/art/ARTGState.m b/Source/art/ARTGState.m index d6a0d84..34e1a5b 100644 --- a/Source/art/ARTGState.m +++ b/Source/art/ARTGState.m @@ -356,8 +356,9 @@ draw_info_t ART_DI; } -- (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length +- (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length { + // FIXME: Currently advances is ignored NSPoint p; int x, y; diff --git a/Source/cairo/CairoGState.m b/Source/cairo/CairoGState.m index 8b33ce4..6c43db3 100644 --- a/Source/cairo/CairoGState.m +++ b/Source/cairo/CairoGState.m @@ -433,8 +433,9 @@ static float floatToUserSpace(NSAffineTransform *ctm, float f) } } -- (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t)length +- (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length { + // FIXME: Currently advances is ignored if (_ct) { cairo_matrix_t local_matrix; @@ -458,8 +459,8 @@ static float floatToUserSpace(NSAffineTransform *ctm, float f) cairo_transform(_ct, &local_matrix); [(CairoFontInfo *)font drawGlyphs: glyphs - length: length - on: _ct]; + length: length + on: _ct]; cairo_restore(_ct); } } diff --git a/Source/gsc/GSContext.m b/Source/gsc/GSContext.m index 76bc483..84128f9 100644 --- a/Source/gsc/GSContext.m +++ b/Source/gsc/GSContext.m @@ -427,6 +427,11 @@ static NSMapTable *gtable; [gstate GSShowGlyphs: glyphs : length]; } +- (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length +{ + [gstate GSShowGlyphsWithAdvances: glyphs : advances : length]; +} + /* ----------------------------------------------------------------------- */ /* Gstate Handling */ /* ----------------------------------------------------------------------- */ diff --git a/Source/gsc/GSGState.m b/Source/gsc/GSGState.m index 6db2495..4fb4743 100644 --- a/Source/gsc/GSGState.m +++ b/Source/gsc/GSGState.m @@ -630,9 +630,21 @@ typedef enum { - (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length { - [self subclassResponsibility: _cmd]; + int i; + NSSize advances[length]; + + for (i=0; i