mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-23 20:01:22 +00:00
Give more information on failed font face access.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@27587 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
cf452fb2b4
commit
af8b2e7883
2 changed files with 31 additions and 11 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2009-01-13 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/art/ftfont.m: Give more information on failed font face access.
|
||||||
|
|
||||||
2008-12-21 Adam Fedor <fedor@gnu.org>
|
2008-12-21 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* Version 0.16.0
|
* Version 0.16.0
|
||||||
|
|
|
@ -128,16 +128,19 @@ static FTC_ImageCache ftc_imagecache;
|
||||||
static FTC_SBitCache ftc_sbitcache;
|
static FTC_SBitCache ftc_sbitcache;
|
||||||
static FTC_CMapCache ftc_cmapcache;
|
static FTC_CMapCache ftc_cmapcache;
|
||||||
|
|
||||||
|
/*
|
||||||
static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_Face *pface)
|
* Helper method used inside of FTC_Manager to create an FT_FACE.
|
||||||
|
*/
|
||||||
|
static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib,
|
||||||
|
FT_Pointer data, FT_Face *pface)
|
||||||
{
|
{
|
||||||
FT_Error err;
|
FT_Error err;
|
||||||
NSArray *rfi = (NSArray *)fid;
|
NSArray *rfi = (NSArray *)fid;
|
||||||
int i, c = [rfi count];
|
int i, c = [rfi count];
|
||||||
|
const char *face_name = [[rfi objectAtIndex: 0] fileSystemRepresentation];
|
||||||
|
|
||||||
// NSLog(@"ft_get_face: %@ '%s'", rfi, [[rfi objectAtIndex: 0] cString]);
|
NSDebugLLog(@"ftfont", @"ft_get_face: %@ '%s'", rfi, face_name);
|
||||||
|
err = FT_New_Face(lib, face_name, 0, pface);
|
||||||
err = FT_New_Face(lib, [[rfi objectAtIndex: 0] cString], 0, pface);
|
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
NSLog(@"Error when loading '%@' (%08x)", [rfi objectAtIndex: 0], err);
|
NSLog(@"Error when loading '%@' (%08x)", [rfi objectAtIndex: 0], err);
|
||||||
|
@ -146,14 +149,17 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_
|
||||||
|
|
||||||
for (i = 1; i < c; i++)
|
for (i = 1; i < c; i++)
|
||||||
{
|
{
|
||||||
// NSLog(@" do '%s'", [[rfi objectAtIndex: i] cString]);
|
face_name = [[rfi objectAtIndex: i] fileSystemRepresentation];
|
||||||
err = FT_Attach_File(*pface, [[rfi objectAtIndex: i] cString]);
|
|
||||||
|
NSDebugLLog(@"ftfont", @" do '%s'", face_name);
|
||||||
|
err = FT_Attach_File(*pface, face_name);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
NSLog(@"Error when loading '%@' (%08x)", [rfi objectAtIndex: i], err);
|
NSLog(@"Error when loading '%@' (%08x)", [rfi objectAtIndex: i], err);
|
||||||
/* pretend it's alright */
|
/* pretend it's alright */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,6 +181,8 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_
|
||||||
}
|
}
|
||||||
|
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
if (!self)
|
||||||
|
return nil;
|
||||||
|
|
||||||
screenFont = p_screenFont;
|
screenFont = p_screenFont;
|
||||||
|
|
||||||
|
@ -188,7 +196,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_
|
||||||
font_entry = [FTFontEnumerator fontWithName: name];
|
font_entry = [FTFontEnumerator fontWithName: name];
|
||||||
if (!font_entry)
|
if (!font_entry)
|
||||||
{
|
{
|
||||||
[self release];
|
RELEASE(self);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +258,8 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_
|
||||||
{
|
{
|
||||||
NSLog(@"FTC_Manager_LookupSize() failed for '%@', error %08x!",
|
NSLog(@"FTC_Manager_LookupSize() failed for '%@', error %08x!",
|
||||||
name, error);
|
name, error);
|
||||||
return self;
|
RELEASE(self);
|
||||||
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: these are _really_ messed up when fonts are flipped */
|
/* TODO: these are _really_ messed up when fonts are flipped */
|
||||||
|
@ -278,6 +287,13 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_
|
||||||
FT_Encoding e;
|
FT_Encoding e;
|
||||||
unicodeCmap = 0;
|
unicodeCmap = 0;
|
||||||
|
|
||||||
|
if (!face)
|
||||||
|
{
|
||||||
|
NSLog(@"Found no face for font '%@'", name);
|
||||||
|
RELEASE(self);
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < face->num_charmaps; i++)
|
for (i = 0; i < face->num_charmaps; i++)
|
||||||
{
|
{
|
||||||
cmap = face->charmaps[i];
|
cmap = face->charmaps[i];
|
||||||
|
@ -1886,7 +1902,7 @@ p(t)=q(t)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* TODO: try to combine charpath and NSBezierPath handling? */
|
/* TODO: try to combine charpath and NSBezierPath handling? */
|
||||||
|
#if 0
|
||||||
static int charpath_move_to(const FT_Vector *to, void *user)
|
static int charpath_move_to(const FT_Vector *to, void *user)
|
||||||
{
|
{
|
||||||
GSGState *self = (GSGState *)user;
|
GSGState *self = (GSGState *)user;
|
||||||
|
@ -1948,7 +1964,7 @@ static FT_Outline_Funcs charpath_funcs = {
|
||||||
shift:10,
|
shift:10,
|
||||||
delta:0,
|
delta:0,
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
static int bezierpath_move_to(const FT_Vector *to, void *user)
|
static int bezierpath_move_to(const FT_Vector *to, void *user)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue