Adjust to the CGFloat change for NSFont

and NSAffineTransform done in base and gui.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@29689 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2010-02-20 16:33:30 +00:00
parent 4661c2abaa
commit 35a79cf85d
13 changed files with 52 additions and 41 deletions

View file

@ -1,3 +1,19 @@
2010-02-20 Fred Kiefer <FredKiefer@gmx.de>
* Source/gsc/GSStreamContext.m
* Headers/cairo/CairoFontInfo.h
* Source/cairo/CairoFontInfo.m
* Source/cairo/CairoGState.m
* Source/winlib/WIN32FontInfo.m
* Source/art/ftfont.m
* Source/art/ftfont-old.m
* Headers/xlib/GSXftFontInfo.h
* Headers/xlib/XGFontSetFontInfo.h
* Source/xlib/XGFontSetFontInfo.m
* Source/xlib/GSXftFontInfo.m
* Source/xlib/XGFont.m: Adjust to the CGFloat change for NSFont
and NSAffineTransform done in base and gui.
2010-02-11 Nicola Pero <nicola.pero@meta-innovation.com> 2010-02-11 Nicola Pero <nicola.pero@meta-innovation.com>
* Documentation/Back/GNUmakefile: Do not try including the * Documentation/Back/GNUmakefile: Do not try including the

View file

@ -38,7 +38,7 @@
cairo_scaled_font_t *_scaled; cairo_scaled_font_t *_scaled;
CairoFaceInfo *_faceInfo; CairoFaceInfo *_faceInfo;
BOOL _screenFont; BOOL _screenFont;
float lineHeight; CGFloat lineHeight;
unsigned int _cacheSize; unsigned int _cacheSize;
unsigned int *_cachedGlyphs; unsigned int *_cachedGlyphs;

View file

@ -33,7 +33,7 @@
#include <X11/Xft/Xft.h> #include <X11/Xft/Xft.h>
#undef id #undef id
#include <GNUstepGUI/GSFontInfo.h> #import <GNUstepGUI/GSFontInfo.h>
@interface FcFontEnumerator : GSFontEnumerator @interface FcFontEnumerator : GSFontEnumerator
{ {
@ -51,7 +51,7 @@
- (void) draw: (const char*) s length: (int) len - (void) draw: (const char*) s length: (int) len
onDisplay: (Display*) xdpy drawable: (Drawable) draw onDisplay: (Display*) xdpy drawable: (Drawable) draw
with: (GC) xgcntxt at: (XPoint) xp; with: (GC) xgcntxt at: (XPoint) xp;
- (float) widthOf: (const char*) s length: (int) len; - (CGFloat) widthOf: (const char*) s length: (int) len;
- (void) setActiveFor: (Display*) xdpy gc: (GC) xgcntxt; - (void) setActiveFor: (Display*) xdpy gc: (GC) xgcntxt;
@end @end

View file

@ -30,7 +30,7 @@
#define __XGFontSetFontInfo_h #define __XGFontSetFontInfo_h
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <GNUstepGUI/GSFontInfo.h> #import <GNUstepGUI/GSFontInfo.h>
#ifdef X_HAVE_UTF8_STRING #ifdef X_HAVE_UTF8_STRING
@ -58,23 +58,18 @@
int _num_fonts; int _num_fonts;
} }
- (id) initWithFontName: (NSString *)name - (id) initWithFontName: (NSString*)name
matrix: (const float *)matrix matrix: (const CGFloat*)matrix
screenFont: (BOOL)screenFont; screenFont: (BOOL)screenFont;
- (void) dealloc; - (void) drawGlyphs: (const NSGlyph*)glyphs
- (NSSize) advancementForGlyph: (NSGlyph)glyph;
- (NSRect) boundingRectForGlyph: (NSGlyph)glyph;
- (BOOL) glyphIsEncoded: (NSGlyph)glyph;
- (NSGlyph) glyphWithName: (NSString *)glyphName;
- (void) drawGlyphs: (const NSGlyph *)glyphs
length: (int)len length: (int)len
onDisplay: (Display *)dpy onDisplay: (Display*)dpy
drawable: (Drawable)win drawable: (Drawable)win
with: (GC)gc with: (GC)gc
at: (XPoint)xp; at: (XPoint)xp;
- (float) widthOfGlyphs: (const NSGlyph *)glyphs - (CGFloat) widthOfGlyphs: (const NSGlyph*)glyphs
length: (int)len; length: (int)len;
- (void) setActiveFor: (Display *)dpy - (void) setActiveFor: (Display*)dpy
gc: (GC)gc; gc: (GC)gc;
@end // XGFontSetFontInfo : GSFontInfo @end // XGFontSetFontInfo : GSFontInfo

View file

@ -107,7 +107,7 @@ static int subpixel_text;
unsigned int cachedGlyph[CACHE_SIZE]; unsigned int cachedGlyph[CACHE_SIZE];
NSSize cachedSize[CACHE_SIZE]; NSSize cachedSize[CACHE_SIZE];
float lineHeight; CGFloat lineHeight;
} }
@end @end
@ -154,7 +154,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_
@implementation FTFontInfo @implementation FTFontInfo
- initWithFontName: (NSString *)name - initWithFontName: (NSString *)name
matrix: (const float *)fmatrix matrix: (const CGFloat *)fmatrix
screenFont: (BOOL)p_screenFont screenFont: (BOOL)p_screenFont
{ {
FT_Face face; FT_Face face;
@ -335,7 +335,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_
} }
-(float) defaultLineHeightForFont -(CGFloat) defaultLineHeightForFont
{ {
return lineHeight; return lineHeight;
} }
@ -1841,7 +1841,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_
} }
- (float) widthOfString: (NSString*)string - (CGFloat) widthOfString: (NSString*)string
{ {
unichar ch; unichar ch;
int i, c = [string length]; int i, c = [string length];

View file

@ -113,7 +113,7 @@ static int subpixel_text;
unsigned int cachedGlyph[CACHE_SIZE]; unsigned int cachedGlyph[CACHE_SIZE];
NSSize cachedSize[CACHE_SIZE]; NSSize cachedSize[CACHE_SIZE];
float lineHeight; CGFloat lineHeight;
} }
@end @end
@ -167,7 +167,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib,
@implementation FTFontInfo @implementation FTFontInfo
- (id) initWithFontName: (NSString *)name - (id) initWithFontName: (NSString *)name
matrix: (const float *)fmatrix matrix: (const CGFloat *)fmatrix
screenFont: (BOOL)p_screenFont screenFont: (BOOL)p_screenFont
{ {
NSArray *rfi; NSArray *rfi;
@ -411,7 +411,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib,
return coveredCharacterSet; return coveredCharacterSet;
} }
- (float) defaultLineHeightForFont - (CGFloat) defaultLineHeightForFont
{ {
return lineHeight; return lineHeight;
} }
@ -1753,7 +1753,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib,
} }
- (float) widthOfString: (NSString*)string - (CGFloat) widthOfString: (NSString*)string
{ {
unichar ch; unichar ch;
int i, c = [string length]; int i, c = [string length];

View file

@ -145,7 +145,7 @@
} }
- (id) initWithFontName: (NSString *)name - (id) initWithFontName: (NSString *)name
matrix: (const float *)fmatrix matrix: (const CGFloat *)fmatrix
screenFont: (BOOL)p_screenFont screenFont: (BOOL)p_screenFont
{ {
self = [super init]; self = [super init];
@ -189,7 +189,7 @@
[super dealloc]; [super dealloc];
} }
- (float) defaultLineHeightForFont - (CGFloat) defaultLineHeightForFont
{ {
return lineHeight; return lineHeight;
} }
@ -278,7 +278,7 @@ BOOL _cairo_extents_for_NSGlyph(cairo_scaled_font_t *scaled_font, NSGlyph glyph,
return NSZeroRect; return NSZeroRect;
} }
- (float) widthOfString: (NSString *)string - (CGFloat) widthOfString: (NSString *)string
{ {
cairo_text_extents_t ctext; cairo_text_extents_t ctext;

View file

@ -390,7 +390,7 @@ static float floatToUserSpace(NSAffineTransform *ctm, float f)
- (void) GSSetFont: (GSFontInfo *)fontref - (void) GSSetFont: (GSFontInfo *)fontref
{ {
cairo_matrix_t font_matrix; cairo_matrix_t font_matrix;
const float *matrix; const CGFloat *matrix;
[super GSSetFont: fontref]; [super GSSetFont: fontref];

View file

@ -263,7 +263,7 @@ fpfloat(FILE *stream, float f)
- (void) GSSetFont: (void *)fontref - (void) GSSetFont: (void *)fontref
{ {
const float *m = [(GSFontInfo *)fontref matrix]; const CGFloat *m = [(GSFontInfo *)fontref matrix];
fprintf(gstream, "/%s findfont ", fprintf(gstream, "/%s findfont ",
[[(GSFontInfo *)fontref fontName] cString]); [[(GSFontInfo *)fontref fontName] cString]);
fprintf(gstream, "["); fprintf(gstream, "[");

View file

@ -43,7 +43,7 @@ NSString *win32_font_family(NSString *fontName);
@implementation WIN32FontInfo @implementation WIN32FontInfo
- initWithFontName: (NSString*)name - initWithFontName: (NSString*)name
matrix: (const float *)fmatrix matrix: (const CGFloat *)fmatrix
screenFont: (BOOL)screenFont screenFont: (BOOL)screenFont
{ {
if (screenFont) if (screenFont)
@ -75,7 +75,7 @@ NSString *win32_font_family(NSString *fontName);
[super dealloc]; [super dealloc];
} }
- (float) widthOfString: (NSString*)string - (CGFloat) widthOfString: (NSString*)string
{ {
SIZE size; SIZE size;
HDC hdc; HDC hdc;

View file

@ -269,7 +269,7 @@ static NSArray *faFromFc(FcPattern *pat)
@implementation GSXftFontInfo @implementation GSXftFontInfo
- initWithFontName: (NSString*)name - initWithFontName: (NSString*)name
matrix: (const float *)fmatrix matrix: (const CGFloat*)fmatrix
screenFont: (BOOL)screenFont screenFont: (BOOL)screenFont
{ {
if (screenFont) if (screenFont)
@ -374,7 +374,7 @@ Ones(unsigned int n)
return coveredCharacterSet; return coveredCharacterSet;
} }
- (float) widthOfString: (NSString*)string - (CGFloat) widthOfString: (NSString*)string
{ {
XGlyphInfo extents; XGlyphInfo extents;
int len = [string length]; int len = [string length];
@ -390,7 +390,7 @@ Ones(unsigned int n)
return extents.width; return extents.width;
} }
- (float) widthOfGlyphs: (const NSGlyph *) glyphs length: (int) len - (CGFloat) widthOfGlyphs: (const NSGlyph *) glyphs length: (int) len
{ {
XGlyphInfo extents; XGlyphInfo extents;
XftChar16 buf[len]; XftChar16 buf[len];
@ -477,7 +477,7 @@ Ones(unsigned int n)
} }
/* /*
- (float) pointSize - (CGFloat) pointSize
{ {
Display *xdpy = [XGServer currentXDisplay]; Display *xdpy = [XGServer currentXDisplay];
@ -546,7 +546,7 @@ Ones(unsigned int n)
} }
} }
- (float) widthOf: (const char*) s length: (int) len - (CGFloat) widthOf: (const char*) s length: (int) len
{ {
XGlyphInfo extents; XGlyphInfo extents;

View file

@ -103,7 +103,7 @@ static BOOL XGInitAtoms(Display *dpy)
} }
- initWithFontName: (NSString*)name - initWithFontName: (NSString*)name
matrix: (const float *)fmatrix matrix: (const CGFloat*)fmatrix
screenFont: (BOOL)screenFont screenFont: (BOOL)screenFont
{ {
if (screenFont) if (screenFont)
@ -228,7 +228,7 @@ static BOOL XGInitAtoms(Display *dpy)
XDrawString(xdpy, draw, xgcntxt, xp.x, xp.y, buf, len); XDrawString(xdpy, draw, xgcntxt, xp.x, xp.y, buf, len);
} }
- (float) widthOfString: (NSString*)string - (CGFloat) widthOfString: (NSString*)string
{ {
NSData *d = [string dataUsingEncoding: mostCompatibleStringEncoding NSData *d = [string dataUsingEncoding: mostCompatibleStringEncoding
allowLossyConversion: YES]; allowLossyConversion: YES];
@ -239,12 +239,12 @@ static BOOL XGInitAtoms(Display *dpy)
return XTextWidth(font_info, cstr, length); return XTextWidth(font_info, cstr, length);
} }
- (float) widthOf: (const char*) s length: (int) len - (CGFloat) widthOf: (const char*) s length: (int) len
{ {
return XTextWidth(font_info, s, len); return XTextWidth(font_info, s, len);
} }
- (float) widthOfGlyphs: (const NSGlyph *) glyphs length: (int) len - (CGFloat) widthOfGlyphs: (const NSGlyph *) glyphs length: (int) len
{ {
char buf[len]; char buf[len];
int i; int i;

View file

@ -84,7 +84,7 @@ static BOOL char_struct_for_glyph(NSGlyph glyph, XFontSet font_set,
@implementation XGFontSetFontInfo : GSFontInfo @implementation XGFontSetFontInfo : GSFontInfo
- (id) initWithFontName: (NSString *)name - (id) initWithFontName: (NSString *)name
matrix: (const float *)fmatrix matrix: (const CGFloat*)fmatrix
screenFont: (BOOL)screenFont screenFont: (BOOL)screenFont
{ {
Display *dpy; Display *dpy;
@ -217,7 +217,7 @@ static BOOL char_struct_for_glyph(NSGlyph glyph, XFontSet font_set,
} }
} }
- (float) widthOfGlyphs: (const NSGlyph *)glyphs - (CGFloat) widthOfGlyphs: (const NSGlyph *)glyphs
length: (int)len length: (int)len
{ {
UTF8Str ustr; UTF8Str ustr;