URL:
<http://savannah.gnu.org/bugs/?17787>
Summary: Unimplemented methods of NSFont and patch
Project: GNUstep
Submitted by: yjchen
Submitted on: Monday 09/18/2006 at 00:13
Category: Backend
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
_______________________________________________________
Details:
Two methods have no implementation in NSFont:
- (unsigned) numberOfGlyphs
- (NSCharacterSet*) coveredCharacterSet
Here is code to get these information from font in art backend,
which use FreeType:
{
// FT_Face *pface;
NSLog(@"Face 0x%x", pface);
NSLog(@"Number of glyphs %d", (*pface)->num_glyphs);
FT_ULong charcode; /* Char index */
FT_UInt gindex; /* Glyph index */
charcode = FT_Get_First_Char(*pface, &gindex);
while (gindex != 0)
{
charcode = FT_Get_Next_Char(*pface, charcode, &gindex);
NSLog(@"Char %c(%ld), Glyph %d", charcode, charcode, gindex);
}
}
I don't know where to use the code and have the information
back to NSFont.
I test it in back/art/Source/ftfont.m:
static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data,
FT_Face *pface)
As long as FT_Face is available,
these information can be obtained anywhere.
Maybe someone knows better where to put it.
And I don't know how fast to go through all characters,
especially for CJK users.
Maybe a cache would be nice.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?17787>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnustep