From 35a79cf85d53e84af274669524eee3e3a258f15a Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Sat, 20 Feb 2010 16:33:30 +0000 Subject: [PATCH] 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 --- ChangeLog | 16 ++++++++++++++++ Headers/cairo/CairoFontInfo.h | 2 +- Headers/xlib/GSXftFontInfo.h | 4 ++-- Headers/xlib/XGFontSetFontInfo.h | 19 +++++++------------ Source/art/ftfont-old.m | 8 ++++---- Source/art/ftfont.m | 8 ++++---- Source/cairo/CairoFontInfo.m | 6 +++--- Source/cairo/CairoGState.m | 2 +- Source/gsc/GSStreamContext.m | 2 +- Source/winlib/WIN32FontInfo.m | 4 ++-- Source/xlib/GSXftFontInfo.m | 10 +++++----- Source/xlib/XGFont.m | 8 ++++---- Source/xlib/XGFontSetFontInfo.m | 4 ++-- 13 files changed, 52 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index f9d9eea..93e7799 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2010-02-20 Fred Kiefer + + * 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 * Documentation/Back/GNUmakefile: Do not try including the diff --git a/Headers/cairo/CairoFontInfo.h b/Headers/cairo/CairoFontInfo.h index 4d7d8c1..9f84240 100644 --- a/Headers/cairo/CairoFontInfo.h +++ b/Headers/cairo/CairoFontInfo.h @@ -38,7 +38,7 @@ cairo_scaled_font_t *_scaled; CairoFaceInfo *_faceInfo; BOOL _screenFont; - float lineHeight; + CGFloat lineHeight; unsigned int _cacheSize; unsigned int *_cachedGlyphs; diff --git a/Headers/xlib/GSXftFontInfo.h b/Headers/xlib/GSXftFontInfo.h index 0c6a83a..ad1d782 100644 --- a/Headers/xlib/GSXftFontInfo.h +++ b/Headers/xlib/GSXftFontInfo.h @@ -33,7 +33,7 @@ #include #undef id -#include +#import @interface FcFontEnumerator : GSFontEnumerator { @@ -51,7 +51,7 @@ - (void) draw: (const char*) s length: (int) len onDisplay: (Display*) xdpy drawable: (Drawable) draw 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; @end diff --git a/Headers/xlib/XGFontSetFontInfo.h b/Headers/xlib/XGFontSetFontInfo.h index 12f2c6d..d34835b 100644 --- a/Headers/xlib/XGFontSetFontInfo.h +++ b/Headers/xlib/XGFontSetFontInfo.h @@ -30,7 +30,7 @@ #define __XGFontSetFontInfo_h #include -#include +#import #ifdef X_HAVE_UTF8_STRING @@ -58,23 +58,18 @@ int _num_fonts; } -- (id) initWithFontName: (NSString *)name - matrix: (const float *)matrix +- (id) initWithFontName: (NSString*)name + matrix: (const CGFloat*)matrix screenFont: (BOOL)screenFont; -- (void) dealloc; -- (NSSize) advancementForGlyph: (NSGlyph)glyph; -- (NSRect) boundingRectForGlyph: (NSGlyph)glyph; -- (BOOL) glyphIsEncoded: (NSGlyph)glyph; -- (NSGlyph) glyphWithName: (NSString *)glyphName; -- (void) drawGlyphs: (const NSGlyph *)glyphs +- (void) drawGlyphs: (const NSGlyph*)glyphs length: (int)len - onDisplay: (Display *)dpy + onDisplay: (Display*)dpy drawable: (Drawable)win with: (GC)gc at: (XPoint)xp; -- (float) widthOfGlyphs: (const NSGlyph *)glyphs +- (CGFloat) widthOfGlyphs: (const NSGlyph*)glyphs length: (int)len; -- (void) setActiveFor: (Display *)dpy +- (void) setActiveFor: (Display*)dpy gc: (GC)gc; @end // XGFontSetFontInfo : GSFontInfo diff --git a/Source/art/ftfont-old.m b/Source/art/ftfont-old.m index 05f2359..c79b75e 100644 --- a/Source/art/ftfont-old.m +++ b/Source/art/ftfont-old.m @@ -107,7 +107,7 @@ static int subpixel_text; unsigned int cachedGlyph[CACHE_SIZE]; NSSize cachedSize[CACHE_SIZE]; - float lineHeight; + CGFloat lineHeight; } @end @@ -154,7 +154,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_ @implementation FTFontInfo - initWithFontName: (NSString *)name - matrix: (const float *)fmatrix + matrix: (const CGFloat *)fmatrix screenFont: (BOOL)p_screenFont { 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; } @@ -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; int i, c = [string length]; diff --git a/Source/art/ftfont.m b/Source/art/ftfont.m index 1b683b9..86faddf 100644 --- a/Source/art/ftfont.m +++ b/Source/art/ftfont.m @@ -113,7 +113,7 @@ static int subpixel_text; unsigned int cachedGlyph[CACHE_SIZE]; NSSize cachedSize[CACHE_SIZE]; - float lineHeight; + CGFloat lineHeight; } @end @@ -167,7 +167,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, @implementation FTFontInfo - (id) initWithFontName: (NSString *)name - matrix: (const float *)fmatrix + matrix: (const CGFloat *)fmatrix screenFont: (BOOL)p_screenFont { NSArray *rfi; @@ -411,7 +411,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, return coveredCharacterSet; } -- (float) defaultLineHeightForFont +- (CGFloat) defaultLineHeightForFont { 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; int i, c = [string length]; diff --git a/Source/cairo/CairoFontInfo.m b/Source/cairo/CairoFontInfo.m index 3409567..9cf8bf2 100644 --- a/Source/cairo/CairoFontInfo.m +++ b/Source/cairo/CairoFontInfo.m @@ -145,7 +145,7 @@ } - (id) initWithFontName: (NSString *)name - matrix: (const float *)fmatrix + matrix: (const CGFloat *)fmatrix screenFont: (BOOL)p_screenFont { self = [super init]; @@ -189,7 +189,7 @@ [super dealloc]; } -- (float) defaultLineHeightForFont +- (CGFloat) defaultLineHeightForFont { return lineHeight; } @@ -278,7 +278,7 @@ BOOL _cairo_extents_for_NSGlyph(cairo_scaled_font_t *scaled_font, NSGlyph glyph, return NSZeroRect; } -- (float) widthOfString: (NSString *)string +- (CGFloat) widthOfString: (NSString *)string { cairo_text_extents_t ctext; diff --git a/Source/cairo/CairoGState.m b/Source/cairo/CairoGState.m index a7ab31a..d67fac7 100644 --- a/Source/cairo/CairoGState.m +++ b/Source/cairo/CairoGState.m @@ -390,7 +390,7 @@ static float floatToUserSpace(NSAffineTransform *ctm, float f) - (void) GSSetFont: (GSFontInfo *)fontref { cairo_matrix_t font_matrix; - const float *matrix; + const CGFloat *matrix; [super GSSetFont: fontref]; diff --git a/Source/gsc/GSStreamContext.m b/Source/gsc/GSStreamContext.m index 7a69206..c25d9c8 100644 --- a/Source/gsc/GSStreamContext.m +++ b/Source/gsc/GSStreamContext.m @@ -263,7 +263,7 @@ fpfloat(FILE *stream, float f) - (void) GSSetFont: (void *)fontref { - const float *m = [(GSFontInfo *)fontref matrix]; + const CGFloat *m = [(GSFontInfo *)fontref matrix]; fprintf(gstream, "/%s findfont ", [[(GSFontInfo *)fontref fontName] cString]); fprintf(gstream, "["); diff --git a/Source/winlib/WIN32FontInfo.m b/Source/winlib/WIN32FontInfo.m index 78a5cc9..8ca4653 100644 --- a/Source/winlib/WIN32FontInfo.m +++ b/Source/winlib/WIN32FontInfo.m @@ -43,7 +43,7 @@ NSString *win32_font_family(NSString *fontName); @implementation WIN32FontInfo - initWithFontName: (NSString*)name - matrix: (const float *)fmatrix + matrix: (const CGFloat *)fmatrix screenFont: (BOOL)screenFont { if (screenFont) @@ -75,7 +75,7 @@ NSString *win32_font_family(NSString *fontName); [super dealloc]; } -- (float) widthOfString: (NSString*)string +- (CGFloat) widthOfString: (NSString*)string { SIZE size; HDC hdc; diff --git a/Source/xlib/GSXftFontInfo.m b/Source/xlib/GSXftFontInfo.m index c21bc5c..8948caf 100644 --- a/Source/xlib/GSXftFontInfo.m +++ b/Source/xlib/GSXftFontInfo.m @@ -269,7 +269,7 @@ static NSArray *faFromFc(FcPattern *pat) @implementation GSXftFontInfo - initWithFontName: (NSString*)name - matrix: (const float *)fmatrix + matrix: (const CGFloat*)fmatrix screenFont: (BOOL)screenFont { if (screenFont) @@ -374,7 +374,7 @@ Ones(unsigned int n) return coveredCharacterSet; } -- (float) widthOfString: (NSString*)string +- (CGFloat) widthOfString: (NSString*)string { XGlyphInfo extents; int len = [string length]; @@ -390,7 +390,7 @@ Ones(unsigned int n) return extents.width; } -- (float) widthOfGlyphs: (const NSGlyph *) glyphs length: (int) len +- (CGFloat) widthOfGlyphs: (const NSGlyph *) glyphs length: (int) len { XGlyphInfo extents; XftChar16 buf[len]; @@ -477,7 +477,7 @@ Ones(unsigned int n) } /* -- (float) pointSize +- (CGFloat) pointSize { 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; diff --git a/Source/xlib/XGFont.m b/Source/xlib/XGFont.m index 6b6d883..afc2d8b 100644 --- a/Source/xlib/XGFont.m +++ b/Source/xlib/XGFont.m @@ -103,7 +103,7 @@ static BOOL XGInitAtoms(Display *dpy) } - initWithFontName: (NSString*)name - matrix: (const float *)fmatrix + matrix: (const CGFloat*)fmatrix screenFont: (BOOL)screenFont { if (screenFont) @@ -228,7 +228,7 @@ static BOOL XGInitAtoms(Display *dpy) XDrawString(xdpy, draw, xgcntxt, xp.x, xp.y, buf, len); } -- (float) widthOfString: (NSString*)string +- (CGFloat) widthOfString: (NSString*)string { NSData *d = [string dataUsingEncoding: mostCompatibleStringEncoding allowLossyConversion: YES]; @@ -239,12 +239,12 @@ static BOOL XGInitAtoms(Display *dpy) 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); } -- (float) widthOfGlyphs: (const NSGlyph *) glyphs length: (int) len +- (CGFloat) widthOfGlyphs: (const NSGlyph *) glyphs length: (int) len { char buf[len]; int i; diff --git a/Source/xlib/XGFontSetFontInfo.m b/Source/xlib/XGFontSetFontInfo.m index 335c9a4..cb25eeb 100644 --- a/Source/xlib/XGFontSetFontInfo.m +++ b/Source/xlib/XGFontSetFontInfo.m @@ -84,7 +84,7 @@ static BOOL char_struct_for_glyph(NSGlyph glyph, XFontSet font_set, @implementation XGFontSetFontInfo : GSFontInfo - (id) initWithFontName: (NSString *)name - matrix: (const float *)fmatrix + matrix: (const CGFloat*)fmatrix screenFont: (BOOL)screenFont { 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 { UTF8Str ustr;