Make handling of non-integer sized screen fonts consistent.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@17066 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2003-06-29 15:36:28 +00:00
parent 419f8c9e8c
commit c4122018aa
2 changed files with 17 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2003-06-29 17:34 Alexander Malmberg <alexander@malmberg.org>
* Source/art/ftfont.m (-initWithFontName:matrix:screenFont:): Round
the matrix entries for screen fonts to integers to get consistent
handling of non-integer sized screen fonts.
2003-06-28 15:27 Alexander Malmberg <alexander@malmberg.org>
* Source/art/ftfont.m: Use a specific table when translating

View file

@ -641,6 +641,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_
self = [super init];
screenFont = p_screenFont;
NSDebugLLog(@"ftfont", @"[%@ -initWithFontName: %@ matrix: (%g %g %g %g %g %g)] %i\n",
self, name,
@ -670,11 +671,19 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib, FT_Pointer data, FT_
mostCompatibleStringEncoding = NSUTF8StringEncoding;
encodingScheme = @"iso10646-1";
if (screenFont)
{
/* Round up; makes the text more legible. */
matrix[0] = ceil(matrix[0]);
if (matrix[3] < 0.0)
matrix[3] = floor(matrix[3]);
else
matrix[3] = ceil(matrix[3]);
}
imgd.font.pix_width = fabs(matrix[0]);
imgd.font.pix_height = fabs(matrix[3]);
screenFont = p_screenFont;
rfi = font_entry->files;
if (screenFont && font_entry->num_sizes &&
imgd.font.pix_width == imgd.font.pix_height)