1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

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]
This commit is contained in:
Ben Harris 1999-03-30 19:44:52 +00:00
parent 3b65b371d0
commit bd7698ddcc
2 changed files with 19 additions and 10 deletions

View File

@ -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);

View File

@ -13,7 +13,6 @@
#include <Controls.h>
#include <Windows.h>
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;