diff --git a/ChangeLog b/ChangeLog index f2f973517..8cc958353 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-01-31 Richard Frith-Macdoanld + + * Source/GSFontInfo.m: + * Source/NSFont.m: + * Headers/Additions/GNUstepGUI/GSFontInfo.h: + Add stubs for numberOfGlyphs and coveredCharacterSet + 2007-01-30 Fred Kiefer * Source/NSCell.m (-_setupTextWithFrame:inView:editor:delegate:range:, diff --git a/Headers/Additions/GNUstepGUI/GSFontInfo.h b/Headers/Additions/GNUstepGUI/GSFontInfo.h index 83cec3434..4518b0300 100644 --- a/Headers/Additions/GNUstepGUI/GSFontInfo.h +++ b/Headers/Additions/GNUstepGUI/GSFontInfo.h @@ -79,70 +79,68 @@ values. Backends may override these. */ BOOL isBaseFont; int weight; NSFontTraitMask traits; + unsigned numberOfGlyphs; + NSCharacterSet *coveredCharacterSet; } -+ (void) setDefaultClass: (Class)defaultClass; + (GSFontInfo*) fontInfoForFontName: (NSString*)fontName matrix: (const float *)fmatrix screenFont: (BOOL)screenFont; - -+ (int) weightForString: (NSString *)weightString; ++ (void) setDefaultClass: (Class)defaultClass; + (NSString *) stringForWeight: (int)weight; - -- (NSDictionary *)afmDictionary; -- (NSString *)afmFileContents; -- (NSRect)boundingRectForFont; -- (NSString *)displayName; -- (NSString *)familyName; -- (NSString *)fontName; -- (NSString *)encodingScheme; -- (const float*) matrix; -- (BOOL)isFixedPitch; -- (BOOL)isBaseFont; -- (float)ascender; -- (float)descender; -- (float)capHeight; -- (float)italicAngle; -- (NSSize)maximumAdvancement; -- (NSSize)minimumAdvancement; -- (float)underlinePosition; -- (float)underlineThickness; -- (float)xHeight; -- (float) widthOfString: (NSString*)string; -- (float)defaultLineHeightForFont; ++ (int) weightForString: (NSString *)weightString; - (NSSize) advancementForGlyph: (NSGlyph)aGlyph; +- (NSDictionary *) afmDictionary; +- (NSString *) afmFileContents; +- (void) appendBezierPathWithGlyphs: (NSGlyph *)glyphs + count: (int)count + toBezierPath: (NSBezierPath *)path; +- (float) ascender; - (NSRect) boundingRectForGlyph: (NSGlyph)aGlyph; +- (NSRect) boundingRectForFont; +- (float) capHeight; +- (NSCharacterSet*) coveredCharacterSet; +- (float) defaultLineHeightForFont; +- (float) descender; +- (NSString *) displayName; +- (NSString *) encodingScheme; +- (NSString *) familyName; +- (NSString *) fontName; - (BOOL) glyphIsEncoded: (NSGlyph)aGlyph; -- (NSMultibyteGlyphPacking)glyphPacking; +- (NSMultibyteGlyphPacking) glyphPacking; - (NSGlyph) glyphWithName: (NSString*)glyphName; +- (BOOL) isFixedPitch; +- (BOOL) isBaseFont; +- (float) italicAngle; +- (const float*) matrix; +- (NSSize) maximumAdvancement; +- (NSSize) minimumAdvancement; +- (NSStringEncoding) mostCompatibleStringEncoding; +- (unsigned) numberOfGlyphs; +- (NSPoint) positionOfGlyph: (NSGlyph)aGlyph + forCharacter: (unichar)aChar + struckOverRect: (NSRect)aRect; - (NSPoint) positionOfGlyph: (NSGlyph)curGlyph precededByGlyph: (NSGlyph)prevGlyph isNominal: (BOOL*)nominal; -- (NSPoint)positionOfGlyph:(NSGlyph)aGlyph - forCharacter:(unichar)aChar - struckOverRect:(NSRect)aRect; -- (NSPoint)positionOfGlyph:(NSGlyph)aGlyph - struckOverGlyph:(NSGlyph)baseGlyph - metricsExist:(BOOL *)flag; -- (NSPoint)positionOfGlyph:(NSGlyph)aGlyph - struckOverRect:(NSRect)aRect - metricsExist:(BOOL *)flag; -- (NSPoint)positionOfGlyph:(NSGlyph)aGlyph - withRelation:(NSGlyphRelation)relation - toBaseGlyph:(NSGlyph)baseGlyph - totalAdvancement:(NSSize *)offset - metricsExist:(BOOL *)flag; - -- (NSStringEncoding)mostCompatibleStringEncoding; - +- (NSPoint) positionOfGlyph: (NSGlyph)aGlyph + struckOverGlyph: (NSGlyph)baseGlyph + metricsExist: (BOOL *)flag; +- (NSPoint) positionOfGlyph: (NSGlyph)aGlyph + struckOverRect: (NSRect)aRect + metricsExist: (BOOL *)flag; +- (NSPoint) positionOfGlyph: (NSGlyph)aGlyph + withRelation: (NSGlyphRelation)relation + toBaseGlyph: (NSGlyph)baseGlyph + totalAdvancement: (NSSize *)offset + metricsExist: (BOOL *)flag; - (NSFontTraitMask) traits; +- (float) underlinePosition; +- (float) underlineThickness; - (int) weight; - - --(void) appendBezierPathWithGlyphs: (NSGlyph *)glyphs - count: (int)count - toBezierPath: (NSBezierPath *)path; +- (float) widthOfString: (NSString*)string; +- (float) xHeight; @end diff --git a/Source/GSFontInfo.m b/Source/GSFontInfo.m index 07bbae026..909c1c975 100644 --- a/Source/GSFontInfo.m +++ b/Source/GSFontInfo.m @@ -22,7 +22,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #include @@ -221,6 +222,7 @@ static GSFontEnumerator *sharedEnumerator = nil; - (void) dealloc { + RELEASE(coveredCharacterSet); RELEASE(fontDictionary); RELEASE(fontName); RELEASE(familyName); @@ -332,6 +334,11 @@ static GSFontEnumerator *sharedEnumerator = nil; return nil; } +- (NSCharacterSet*) coveredCharacterSet +{ + return coveredCharacterSet; +} + - (NSString*) encodingScheme { return encodingScheme; @@ -357,6 +364,11 @@ static GSFontEnumerator *sharedEnumerator = nil; return matrix; } +- (unsigned) numberOfGlyphs +{ + return numberOfGlyphs; +} + - (float) pointSize { return matrix[0]; diff --git a/Source/NSFont.m b/Source/NSFont.m index 19f282086..d413f3e3c 100644 --- a/Source/NSFont.m +++ b/Source/NSFont.m @@ -1005,14 +1005,12 @@ static BOOL flip_hack; - (unsigned) numberOfGlyphs { - // FIXME - return 0; + return [fontInfo numberOfGlyphs]; } - (NSCharacterSet*) coveredCharacterSet { - // FIXME - return nil; + return [fontInfo coveredCharacterSet]; } - (NSFontDescriptor*) fontDescriptor