From 3e2f09cdab193af73b69f14d5449a51de2484480 Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Tue, 7 Aug 2007 16:04:47 +0000 Subject: [PATCH] Use local FT_Size variable instead of ivar. The ivar is sometimes invalid. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@25381 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/art/ftfont.m | 29 ++++++++++++++++++----------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index b0b4cc5..f4f7787 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-08-07 Fred Kiefer + + * Source/art/ftfont.m (-coveredCharacterSet): Use local FT_Size + variable instead of ivar. The ivar is sometimes invalid. + Cleaned up compiler warnings. + 2007-08-02 Fred Kiefer * Source/x11/XGServer.m (+initializeBackend): Handle SIGINT by diff --git a/Source/art/ftfont.m b/Source/art/ftfont.m index 5515c0d..191a3a8 100644 --- a/Source/art/ftfont.m +++ b/Source/art/ftfont.m @@ -876,11 +876,16 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_ { NSMutableCharacterSet *m = [NSMutableCharacterSet new]; unsigned count = 0; - FT_Face face = ft_size->face; + FT_Face face; FT_ULong charcode; FT_UInt glyphindex; + FT_Size size; - charcode = FT_Get_First_Char(face, &glyphindex); + if (FTC_Manager_LookupSize(ftc_manager, &scaler, &size)) + return nil; + face = size->face; + + charcode = FT_Get_First_Char(face, &glyphindex); if (glyphindex != 0) { NSRange range; @@ -2409,7 +2414,7 @@ p(t)=q(t) /* TODO: try to combine charpath and NSBezierPath handling? */ -static int charpath_move_to(FT_Vector *to, void *user) +static int charpath_move_to(const FT_Vector *to, void *user) { GSGState *self = (GSGState *)user; NSPoint d; @@ -2420,7 +2425,7 @@ static int charpath_move_to(FT_Vector *to, void *user) return 0; } -static int charpath_line_to(FT_Vector *to, void *user) +static int charpath_line_to(const FT_Vector *to, void *user) { GSGState *self = (GSGState *)user; NSPoint d; @@ -2430,7 +2435,7 @@ static int charpath_line_to(FT_Vector *to, void *user) return 0; } -static int charpath_conic_to(FT_Vector *c1, FT_Vector *to, void *user) +static int charpath_conic_to(const FT_Vector *c1, const FT_Vector *to, void *user) { GSGState *self = (GSGState *)user; NSPoint a, b, c, d; @@ -2447,7 +2452,8 @@ static int charpath_conic_to(FT_Vector *c1, FT_Vector *to, void *user) return 0; } -static int charpath_cubic_to(FT_Vector *c1, FT_Vector *c2, FT_Vector *to, void *user) +static int charpath_cubic_to(const FT_Vector *c1, const FT_Vector *c2, + const FT_Vector *to, void *user) { GSGState *self = (GSGState *)user; NSPoint b, c, d; @@ -2471,7 +2477,7 @@ static FT_Outline_Funcs charpath_funcs = { }; -static int bezierpath_move_to(FT_Vector *to, void *user) +static int bezierpath_move_to(const FT_Vector *to, void *user) { NSBezierPath *path = (NSBezierPath *)user; NSPoint d; @@ -2482,7 +2488,7 @@ static int bezierpath_move_to(FT_Vector *to, void *user) return 0; } -static int bezierpath_line_to(FT_Vector *to, void *user) +static int bezierpath_line_to(const FT_Vector *to, void *user) { NSBezierPath *path = (NSBezierPath *)user; NSPoint d; @@ -2492,7 +2498,7 @@ static int bezierpath_line_to(FT_Vector *to, void *user) return 0; } -static int bezierpath_conic_to(FT_Vector *c1, FT_Vector *to, void *user) +static int bezierpath_conic_to(const FT_Vector *c1, const FT_Vector *to, void *user) { NSBezierPath *path = (NSBezierPath *)user; NSPoint a, b, c, d; @@ -2509,7 +2515,8 @@ static int bezierpath_conic_to(FT_Vector *c1, FT_Vector *to, void *user) return 0; } -static int bezierpath_cubic_to(FT_Vector *c1, FT_Vector *c2, FT_Vector *to, void *user) +static int bezierpath_cubic_to(const FT_Vector *c1, const FT_Vector *c2, + const FT_Vector *to, void *user) { NSBezierPath *path = (NSBezierPath *)user; NSPoint b, c, d; @@ -3224,7 +3231,7 @@ fb04 'ffl' unsigned int i,j; unsigned int ch,ch2,ch3; - FTFontInfo *fi = [run->font fontInfo]; + FTFontInfo *fi = (FTFontInfo *)[run->font fontInfo]; NSCharacterSet *cs = [NSCharacterSet controlCharacterSet]; IMP characterIsMember = [cs methodForSelector: @selector(characterIsMember:)];