Small opal changes.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@40047 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2016-08-02 20:48:01 +00:00
parent 41f4e770ae
commit ef2088d3c7
4 changed files with 14 additions and 12 deletions

View file

@ -1,3 +1,12 @@
2016-08-02 Fred Kiefer <FredKiefer@gmx.de>
* Source/opal/OpalFontInfo.m
Correct the calculation of line height.
* Source/opal/OpalGState.m
Adjust font placement to changed height.
* Source/opal/OpalSurface.m
Better debug output.
2016-07-15 Fred Kiefer <FredKiefer@gmx.de>
* Source/gsc/GSStreamContext.m:

View file

@ -108,7 +108,7 @@
// lineHeight = font_extents.height
// alternatively: line spacing = (ascent + descent + "external leading")
// (internal discussion between ivucica and ericwa, 2013-09-17)
lineHeight = leading + ascender - descender;
lineHeight = leading + ascender + descender;
#if 0
// Get default font options

View file

@ -209,8 +209,8 @@ static inline NSPoint _NSPointFromCGPoint(CGPoint cgpoint)
}
CGPoint pt = CGContextGetPathCurrentPoint(cgctx);
// FIXME: why * 0.66?
pt.y += [self->font defaultLineHeightForFont] * 0.66;
// FIXME: why?
pt.y += [self->font defaultLineHeightForFont] * 0.5;
CGContextSetTextPosition(cgctx, pt.x, pt.y);
CGContextShowGlyphsWithAdvances(cgctx, cgglyphs, (const CGSize *)advances,
length);
@ -239,14 +239,6 @@ static inline NSPoint _NSPointFromCGPoint(CGPoint cgpoint)
{
NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__);
if (!pat && size != 0)
{
NSLog(@"%s: null 'pat' passed with size %d. Fixing by setting size to 0.", pat, (int)size);
size = 0;
// TODO: looking at opal, it does not seem to have a tolerance for
// pat=NULL although CGContextSetLineDash() explicitly specifies that
// as a possible argument
}
CGContextRef cgctx = CGCTX;
if (cgctx)

View file

@ -109,7 +109,8 @@ static CGContextRef createCGBitmapContext(int pixelsWide,
_gsWindowDevice->buffer_height);
}
NSDebugLLog(@"OpalSurface", @"Created CGContexts: X11=%p, backing=%p", _x11CGContext, _backingCGContext);
NSDebugLLog(@"OpalSurface", @"Created CGContexts: X11=%p, backing=%p, width=%d height=%d",
_x11CGContext, _backingCGContext, _gsWindowDevice->buffer_width, _gsWindowDevice->buffer_height);
}