Merge branch 'master' into randr

This commit is contained in:
Fred Kiefer 2020-01-27 23:19:03 +01:00 committed by GitHub
commit f0395f07ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 76 additions and 2843 deletions

View file

@ -42,6 +42,26 @@
* config.h.in: added default value for Xrandr usage.
* configure: regenerate.
2020-01-17 Sergii Stoian <stoyan255@gmail.com>
* Source/art/shfill.m:,
* Source/art/path.m:,
* Source/art/image.m (DPSimage:::::::::::):
fixed type formatting specifiers.
* Source/art/ftfont.m: removed include to ftfont-old.m.
(drawString:at::to::::::::color::::transform:deltas:::widthChar:drawinfo:):,
(drawGlyphs::at::to::::::color::::transform:drawinfo:):,
(drawGlyphs::at::to::::::alpha::color::::transform:drawinfo:):,
(bezierpath_funcs):,
fixed type formatting specifiers; moved interface declaration of FTFontInfo
to ftfont.h; removed GCCism.
* Source/art/ftfont.h: moved interface declaration of FTFontInfo here.
* Source/art/composite.m: fixed type formatting specifiers.
* Source/art/FTFontEnumerator.m (load_font_configuration): fixed type
formatting specifiers.
2020-01-16 Sergii Stoian <stoyan255@gmail.com>
* Source/x11/XGServerEvent.m (_handleTakeFocusAtom:forContext:): use

View file

@ -444,7 +444,7 @@ static void load_font_configuration(void)
[families_pending removeAllObjects];
}
NSDebugLLog(@"ftfont", @"got %i fonts in %i families",
NSDebugLLog(@"ftfont", @"got %lu fonts in %lu families",
[fcfg_allFontNames count], [fcfg_allFontFamilies count]);
if (![fcfg_allFontNames count])

View file

@ -1505,7 +1505,7 @@ static BOOL _rect_advance(rect_trace_t *t, int *x0, int *x1)
}
else
{
NSLog(@"unimplemented compositerect: (%g %g)+(%g %g) op: %i",
NSLog(@"unimplemented compositerect: (%g %g)+(%g %g) op: %lu",
aRect.origin.x, aRect.origin.y,
aRect.size.width, aRect.size.height,
op);

File diff suppressed because it is too large Load diff

View file

@ -25,6 +25,8 @@
#ifndef ftfont_h
#define ftfont_h
#import "blit.h"
@class NSAffineTransform;
@protocol FTFontInfo
@ -66,7 +68,40 @@
+(void) initializeBackend;
@end
@class FTFontInfo;
#import <ft2build.h>
#import FT_CACHE_H
#import <GNUstepGUI/GSFontInfo.h>
#import "FTFaceInfo.h"
#define CACHE_SIZE 257
@interface FTFontInfo : GSFontInfo <FTFontInfo>
{
@public
int pix_width, pix_height;
FTC_FaceID faceId;
FTC_ImageTypeRec imageType;
FTC_ScalerRec scaler;
int unicodeCmap;
BOOL screenFont;
FTFaceInfo *face_info;
FT_Size ft_size;
/*
Profiling (2003-11-14) shows that calls to -advancementForGlyph: accounted
for roughly 20% of layout time. This cache reduces it to (currently)
insignificant levels.
*/
unsigned int cachedGlyph[CACHE_SIZE];
NSSize cachedSize[CACHE_SIZE];
CGFloat lineHeight;
}
@end
#endif

View file

@ -22,17 +22,6 @@
Boston, MA 02110-1301, USA.
*/
#include <ft2build.h>
#include FT_FREETYPE_H
#if (FREETYPE_MAJOR==2) && ((FREETYPE_MINOR<1) || ((FREETYPE_MINOR==1) && (FREETYPE_PATCH<8)))
#import "ftfont-old.m"
#else
#include <math.h>
#import <Foundation/NSObject.h>
@ -56,17 +45,12 @@
#import "ftfont.h"
#import "FTFontEnumerator.h"
#import "FTFaceInfo.h"
#import "blit.h"
#define DI (*di)
/** font handling interface **/
#include FT_CACHE_H
#include FT_FREETYPE_H
#include FT_CACHE_IMAGE_H
#include FT_CACHE_SMALL_BITMAPS_H
@ -86,42 +70,9 @@ from the back-art-subpixel-text defaults key
*/
static int subpixel_text;
#define CACHE_SIZE 257
@interface FTFontInfo : GSFontInfo <FTFontInfo>
{
@public
int pix_width, pix_height;
FTC_FaceID faceId;
FTC_ImageTypeRec imageType;
FTC_ScalerRec scaler;
int unicodeCmap;
BOOL screenFont;
FTFaceInfo *face_info;
FT_Size ft_size;
/*
Profiling (2003-11-14) shows that calls to -advancementForGlyph: accounted
for roughly 20% of layout time. This cache reduces it to (currently)
insignificant levels.
*/
unsigned int cachedGlyph[CACHE_SIZE];
NSSize cachedSize[CACHE_SIZE];
CGFloat lineHeight;
}
@end
@interface FTFontInfo_subpixel : FTFontInfo
@end
static FT_Library ft_library;
static FTC_Manager ftc_manager;
static FTC_ImageCache ftc_imagecache;
@ -421,7 +372,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib,
return lineHeight;
}
- (unsigned) numberOfGlyphs
- (NSUInteger) numberOfGlyphs
{
if (coveredCharacterSet == nil)
{
@ -529,7 +480,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib,
real size, just a matrix. Thus, we average pix_width and
pix_height; we'll get the right answer for normal cases, and
we can't really do anything about the weird cases. */
f = fabs(pix_width) + fabs(pix_height);
f = abs(pix_width) + abs(pix_height);
if (f > 1)
f = f / 2.0;
else
@ -615,7 +566,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib,
{
NSLog(@"FTC_SBitCache_Lookup() failed with error %08x "
@"(%08x, %08x, %ix%i, %08x)",
error, glyph, imageType.face_id, imageType.width,
error, glyph, (unsigned)imageType.face_id, imageType.width,
imageType.height, imageType.flags);
continue;
}
@ -1015,7 +966,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib,
float f;
use_sbit = 0;
f = fabs(pix_width) + fabs(pix_height);
f = abs(pix_width) + abs(pix_height);
if (f > 1)
f = f / 2.0;
else
@ -1045,7 +996,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib,
{
NSLog(@"FTC_SBitCache_Lookup() failed with error %08x "
@"(%08x, %08x, %ix%i, %08x)",
error, glyph, imageType.face_id,
error, glyph, (unsigned)imageType.face_id,
imageType.width, imageType.height,
imageType.flags);
continue;
@ -1336,7 +1287,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib,
float f;
use_sbit = 0;
f = fabs(pix_width) + fabs(pix_height);
f = abs(pix_width) + abs(pix_height);
if (f > 1)
f = f / 2.0;
else
@ -1365,7 +1316,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib,
{
if (glyph != 0xffffffff)
NSLog(@"FTC_SBitCache_Lookup() failed with error %08x (%08x, %08x, %ix%i, %08x)",
error, glyph, imageType.face_id, imageType.width, imageType.height,
error, glyph, (unsigned)imageType.face_id, imageType.width, imageType.height,
imageType.flags
);
continue;
@ -1633,7 +1584,7 @@ static FT_Error ft_get_face(FTC_FaceID fid, FT_Library lib,
if ((error = FTC_SBitCache_Lookup(ftc_sbitcache, &imageType, glyph, &sbit, NULL)))
{
NSLog(@"FTC_SBitCache_Lookup() failed with error %08x (%08x, %08x, %ix%i, %08x)",
error, glyph, imageType.face_id,
error, glyph, (unsigned)imageType.face_id,
imageType.width, imageType.height,
imageType.flags
);
@ -2025,12 +1976,12 @@ static int bezierpath_cubic_to(const FT_Vector *c1, const FT_Vector *c2,
}
static FT_Outline_Funcs bezierpath_funcs = {
move_to:bezierpath_move_to,
line_to:bezierpath_line_to,
conic_to:bezierpath_conic_to,
cubic_to:bezierpath_cubic_to,
shift:10,
delta:0,
.move_to = bezierpath_move_to,
.line_to = bezierpath_line_to,
.conic_to = bezierpath_conic_to,
.cubic_to = bezierpath_cubic_to,
.shift = 10,
.delta = 0,
};
@ -2659,5 +2610,3 @@ static char buf[1024]; /* !!TODO!! */
}
@end
#endif /* freetype version check, >=2.1.8 */

View file

@ -759,7 +759,7 @@ seem to cause edges to be off by a pixel
return;
}
NSLog(@"unimplemented DPSimage %ix%i |%@| bips=%i spp=%i bipp=%i bypr=%i planar=%i alpha=%i\n",
NSLog(@"unimplemented DPSimage %lix%li |%@| bips=%li spp=%li bipp=%li bypr=%li planar=%i alpha=%i\n",
pixelsWide, pixelsHigh, matrix,
bitsPerSample, samplesPerPixel, bitsPerPixel, bytesPerRow, isPlanar,
hasAlpha);

View file

@ -731,7 +731,7 @@ static void clip_svp_callback(void *data, int y, int start,
ci.index = malloc(sizeof(unsigned int) * (clip_sy + 1));
if (!ci.index)
{
NSLog(@"Warning: out of memory calculating clipping spans (%i bytes)",
NSLog(@"Warning: out of memory calculating clipping spans (%lu bytes)",
sizeof(unsigned int) * (clip_sy + 1));
return;
}

View file

@ -502,7 +502,7 @@ static BOOL function_setup(NSDictionary * d, function_t *f)
f->encode = NULL;
free(f->decode);
f->decode = NULL;
NSDebugLLog(@"GSArt -shfill", @"Need %i bytes of data, DataSource only has %i bytes.",
NSDebugLLog(@"GSArt -shfill", @"Need %i bytes of data, DataSource only has %lu bytes.",
j, [data length]);
return NO;
}