From: Ben Harris Date: Tue, 30 Mar 1999 19:44:52 +0000 (+0000) Subject: Fonts where boldface is wider than usual are now beaten up so they fit. X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=bd7698ddccfd4617cffe7f10513e50d077057912;p=PuTTY.git Fonts where boldface is wider than usual are now beaten up so they fit. Note that this doesn't happen for non-COlor QuickDraw yet, due to the lack of CharExtra(). [originally from svn r141] --- diff --git a/macterm.c b/macterm.c index afc60aa9..84d88969 100644 --- a/macterm.c +++ b/macterm.c @@ -1,4 +1,4 @@ -/* $Id: macterm.c,v 1.1.2.32 1999/03/29 19:50:23 ben Exp $ */ +/* $Id: macterm.c,v 1.1.2.33 1999/03/30 19:44:51 ben Exp $ */ /* * Copyright (c) 1999 Simon Tatham * Copyright (c) 1999 Ben Harris @@ -180,6 +180,11 @@ static void mac_initfont(Session *s) { s->font_ascent = fi.ascent; s->font_leading = fi.leading; s->font_height = s->font_ascent + fi.descent + s->font_leading; + if (!s->cfg.bold_colour) { + TextFace(bold); + s->font_boldadjust = s->font_width - CharWidth('W'); + } else + s->font_boldadjust = 0; mac_adjustsize(s, s->rows, s->cols); } @@ -765,9 +770,20 @@ void do_text(Session *s, int x, int y, char *text, int len, TextFace(style); TextSize(s->cfg.fontheight); SetFractEnable(FALSE); /* We want characters on pixel boundaries */ + if (mac_gestalts.qdvers > gestaltOriginalQD) + if (style & bold) { + SpaceExtra(s->font_boldadjust << 16); + CharExtra(s->font_boldadjust << 16); + } else { + SpaceExtra(0); + CharExtra(0); + } textrgn = NewRgn(); RectRgn(textrgn, &a.textrect); - DeviceLoop(textrgn, &do_text_for_device_upp, (long)&a, 0); + if (mac_gestalts.qdvers == gestaltOriginalQD) + do_text_for_device(1, 0, NULL, (long)&a); + else + DeviceLoop(textrgn, &do_text_for_device_upp, (long)&a, 0); DisposeRgn(textrgn); /* Tell the window manager about it in case this isn't an update */ ValidRect(&a.textrect); diff --git a/putty.h b/putty.h index 4c78be66..87f05d2f 100644 --- a/putty.h +++ b/putty.h @@ -13,7 +13,6 @@ #include #include typedef UInt32 DWORD; -struct mac_session; #endif /* macintosh */ #ifndef TRUE @@ -48,13 +47,6 @@ struct mac_session; #define ATTR_MASK 0xFFFFFF00UL #define CHAR_MASK 0x000000FFUL -#ifdef macintosh -struct mac_session; -typedef struct mac_session *Context; -#else /* not macintosh */ -typedef HDC Context; -#endif /* not macintosh */ - #ifdef macintosh #define SEL_NL { 13 } #else @@ -252,6 +244,7 @@ typedef struct Session { short fontnum; int font_ascent; int font_leading; + int font_boldadjust; WindowPtr window; PaletteHandle palette; ControlHandle scrollbar;