mirror of
https://github.com/gnustep/libs-back.git
synced 2025-05-31 01:11:00 +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
1b26d9be44
commit
07638f13fc
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>
|
2011-05-19 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Headers/cairo/CairoFontEnumerator.h,
|
* Headers/cairo/CairoFontEnumerator.h,
|
||||||
|
|
|
@ -74,6 +74,7 @@
|
||||||
- (void) GSSetTextPosition: (NSPoint)loc;
|
- (void) GSSetTextPosition: (NSPoint)loc;
|
||||||
- (void) GSShowText: (const char *)string : (size_t) length;
|
- (void) GSShowText: (const char *)string : (size_t) length;
|
||||||
- (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length;
|
- (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length;
|
||||||
|
- (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length;
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Gstate operations */
|
/* 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;
|
NSPoint p;
|
||||||
int x, y;
|
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)
|
if (_ct)
|
||||||
{
|
{
|
||||||
cairo_matrix_t local_matrix;
|
cairo_matrix_t local_matrix;
|
||||||
|
@ -458,8 +459,8 @@ static float floatToUserSpace(NSAffineTransform *ctm, float f)
|
||||||
cairo_transform(_ct, &local_matrix);
|
cairo_transform(_ct, &local_matrix);
|
||||||
|
|
||||||
[(CairoFontInfo *)font drawGlyphs: glyphs
|
[(CairoFontInfo *)font drawGlyphs: glyphs
|
||||||
length: length
|
length: length
|
||||||
on: _ct];
|
on: _ct];
|
||||||
cairo_restore(_ct);
|
cairo_restore(_ct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -427,6 +427,11 @@ static NSMapTable *gtable;
|
||||||
[gstate GSShowGlyphs: glyphs : length];
|
[gstate GSShowGlyphs: glyphs : length];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length
|
||||||
|
{
|
||||||
|
[gstate GSShowGlyphsWithAdvances: glyphs : advances : length];
|
||||||
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Gstate Handling */
|
/* Gstate Handling */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
|
|
@ -630,9 +630,21 @@ typedef enum {
|
||||||
|
|
||||||
- (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length
|
- (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 */
|
/* Gstate operations */
|
||||||
|
|
|
@ -1144,8 +1144,10 @@ HBITMAP GSCreateBitmap(HDC hDC, int pixelsWide, int pixelsHigh,
|
||||||
[self releaseHDC: hDC];
|
[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];
|
NSPoint current = [path currentPoint];
|
||||||
POINT p;
|
POINT p;
|
||||||
HDC hDC;
|
HDC hDC;
|
||||||
|
|
|
@ -1296,8 +1296,10 @@ static Region emptyRegion;
|
||||||
[path relativeMoveToPoint: NSMakePoint(width * scale.width, 0)];
|
[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;
|
int width;
|
||||||
NSSize scale;
|
NSSize scale;
|
||||||
XPoint xp;
|
XPoint xp;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue