mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-25 08:51:03 +00:00
2004-11-09 23:15 Alexander Malmberg <alexander@malmberg.org>
* Source/art/ftfont.m (fix_path): Don't prepend the path to absolute file names. (-initWithFontName:matrix:screenFont:): Initialize cachedGlyph. (-advancementForGlyph:): Handle NSNullGlyph. (-glyphForCharacter:): Return NSNullGlyph if there's no glyph for the character. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@20331 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a3e997eca6
commit
32f5af3e08
2 changed files with 32 additions and 5 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2004-11-09 23:15 Alexander Malmberg <alexander@malmberg.org>
|
||||||
|
|
||||||
|
* Source/art/ftfont.m (fix_path): Don't prepend the path to absolute
|
||||||
|
file names.
|
||||||
|
(-initWithFontName:matrix:screenFont:): Initialize cachedGlyph.
|
||||||
|
(-advancementForGlyph:): Handle NSNullGlyph.
|
||||||
|
(-glyphForCharacter:): Return NSNullGlyph if there's no glyph for
|
||||||
|
the character.
|
||||||
|
|
||||||
2004-11-09 19:00 Alexander Malmberg <alexander@malmberg.org>
|
2004-11-09 19:00 Alexander Malmberg <alexander@malmberg.org>
|
||||||
|
|
||||||
* Tools/gpbs.m (main): If we get a -GSStartupNotification argument,
|
* Tools/gpbs.m (main): If we get a -GSStartupNotification argument,
|
||||||
|
|
|
@ -296,6 +296,9 @@ static NSArray *fix_path(NSString *path, NSArray *files)
|
||||||
nfiles = [[NSMutableArray alloc] init];
|
nfiles = [[NSMutableArray alloc] init];
|
||||||
for (i = 0; i < c; i++)
|
for (i = 0; i < c; i++)
|
||||||
{
|
{
|
||||||
|
if ([[files objectAtIndex: i] isAbsolutePath])
|
||||||
|
[nfiles addObject: [files objectAtIndex: i]];
|
||||||
|
else
|
||||||
[nfiles addObject: [path stringByAppendingPathComponent:
|
[nfiles addObject: [path stringByAppendingPathComponent:
|
||||||
[files objectAtIndex: i]]];
|
[files objectAtIndex: i]]];
|
||||||
}
|
}
|
||||||
|
@ -845,6 +848,15 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_
|
||||||
advancementImgd = cur;
|
advancementImgd = cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Here, we simply need to make sure that we don't get any false matches
|
||||||
|
the first time a particular cache entry is used. Thus, we only need to
|
||||||
|
initialize the first entry. For all other entries, cachedGlyph[i] will
|
||||||
|
be 0, and that's a glyph that can't possibly hash to any entry except
|
||||||
|
entry #0, so it won't cause any false matches.
|
||||||
|
*/
|
||||||
|
cachedGlyph[0] = 1;
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2098,10 +2110,10 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
|
||||||
if (glyph == NSControlGlyph
|
if (glyph == NSControlGlyph
|
||||||
|| glyph == GSAttachmentGlyph
|
|| glyph == GSAttachmentGlyph)
|
||||||
|| glyph == NSNullGlyph)
|
|
||||||
return NSZeroSize;
|
return NSZeroSize;
|
||||||
|
|
||||||
|
if (glyph != NSNullGlyph)
|
||||||
glyph--;
|
glyph--;
|
||||||
if (screenFont)
|
if (screenFont)
|
||||||
{
|
{
|
||||||
|
@ -3143,6 +3155,7 @@ static int filters[3][7]=
|
||||||
-(NSGlyph) glyphForCharacter: (unichar)ch
|
-(NSGlyph) glyphForCharacter: (unichar)ch
|
||||||
{
|
{
|
||||||
FTFontInfo *fi=fontInfo;
|
FTFontInfo *fi=fontInfo;
|
||||||
|
NSGlyph g;
|
||||||
|
|
||||||
FTC_CMapDescRec cmap;
|
FTC_CMapDescRec cmap;
|
||||||
|
|
||||||
|
@ -3150,7 +3163,11 @@ static int filters[3][7]=
|
||||||
cmap.u.encoding = ft_encoding_unicode;
|
cmap.u.encoding = ft_encoding_unicode;
|
||||||
cmap.type = FTC_CMAP_BY_ENCODING;
|
cmap.type = FTC_CMAP_BY_ENCODING;
|
||||||
|
|
||||||
return FTC_CMapCache_Lookup(ftc_cmapcache, &cmap, ch) + 1;
|
g = FTC_CMapCache_Lookup(ftc_cmapcache, &cmap, ch);
|
||||||
|
if (g)
|
||||||
|
return g + 1;
|
||||||
|
else
|
||||||
|
return NSNullGlyph;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(NSString *) nameOfGlyph: (NSGlyph)glyph
|
-(NSString *) nameOfGlyph: (NSGlyph)glyph
|
||||||
|
@ -3385,3 +3402,4 @@ static char buf[1024]; /* !!TODO!! */
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue