diff --git a/ChangeLog b/ChangeLog index 9bc3b27..56d13fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2016-08-02 Fred Kiefer + + * 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 * Source/gsc/GSStreamContext.m: diff --git a/Source/opal/OpalFontInfo.m b/Source/opal/OpalFontInfo.m index 35907a5..0b904bf 100644 --- a/Source/opal/OpalFontInfo.m +++ b/Source/opal/OpalFontInfo.m @@ -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 diff --git a/Source/opal/OpalGState.m b/Source/opal/OpalGState.m index fdcfdb9..42b1a6a 100644 --- a/Source/opal/OpalGState.m +++ b/Source/opal/OpalGState.m @@ -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) diff --git a/Source/opal/OpalSurface.m b/Source/opal/OpalSurface.m index 87f8295..c49d8d1 100644 --- a/Source/opal/OpalSurface.m +++ b/Source/opal/OpalSurface.m @@ -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); }