mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-22 07:21:02 +00:00
* 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. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@33121 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9f61e2a679
commit
b23f4dd6a9
8 changed files with 47 additions and 7 deletions
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
|||
2011-05-25 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* 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 <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/cairo/CairoFontEnumerator.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 */
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
|
|
@ -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<length; i++)
|
||||
{
|
||||
advances[i] = [font advancementForGlyph: glyphs[i]];
|
||||
}
|
||||
|
||||
[self GSShowGlyphsWithAdvances: glyphs : advances : length];
|
||||
}
|
||||
|
||||
- (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
/* Gstate operations */
|
||||
|
|
|
@ -1144,8 +1144,10 @@ HBITMAP GSCreateBitmap(HDC hDC, int pixelsWide, int pixelsHigh,
|
|||
[self releaseHDC: hDC];
|
||||
}
|
||||
|
||||
- (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 current = [path currentPoint];
|
||||
POINT p;
|
||||
HDC hDC;
|
||||
|
|
|
@ -1296,8 +1296,10 @@ static Region emptyRegion;
|
|||
[path relativeMoveToPoint: NSMakePoint(width * scale.width, 0)];
|
||||
}
|
||||
|
||||
- (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length
|
||||
|
||||
- (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length
|
||||
{
|
||||
// FIXME: Currently advances is ignored
|
||||
int width;
|
||||
NSSize scale;
|
||||
XPoint xp;
|
||||
|
|
Loading…
Reference in a new issue