Re: QD Text Transfer Modes

Info-Mac discussion from 1984 - 2002.
Locked
User avatar
Info-Mac
Administrator
Posts:13716
Joined:December 21st, 1988, 11:00 am
Re: QD Text Transfer Modes

Post by Info-Mac » November 28th, 1984, 11:37 pm

Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 UW 5/3/83; site uw-beaver
Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!houxm!vax135!cornell!uw-beaver!info-mac
From: info-mac@uw-beaver (info-mac)
Newsgroups: fa.info-mac
Subject: Re: QD Text Transfer Modes
Message-ID:
Date: Wed, 24-Oct-84 07:00:14 EDT
Article-I.D.: uw-beave.2012
Posted: Wed Oct 24 07:00:14 1984
Date-Received: Thu, 25-Oct-84 03:54:37 EDT
Sender: daemon@uw-beave
Organization: U of Washington Computer Science
Lines: 62

From: [email protected] (Dan Winkler)
We went through this a few months ago. Here's a reprint:

From [email protected] Mon Jul 16 21:56:45 1984
Return-Path:
Received: from safe by SUMEX-AIM.ARPA with TCP; Sun 15 Jul 84 21:32:36-PDT
Date: Sun, 15 Jul 84 21:36:43 pdt
From: Bill Croft
To: info-mac@sumex
Subject: quickdraw glitch when drawing text in srcCopy mode
Resent-Date: Mon 16 Jul 84 09:30:44-PDT
Resent-From: Ed Pattermann
Resent-To: ;@info-mac
Status: R

Date: Sat, 14 Jul 84 17:52:08 edt
From: [email protected] (Dan Winkler)

The DrawChar and DrawString procedures draw several extra spaces after
the char or string they're supposed to draw when the TextMode is
something other than srcOr, like srcCopy, and the background is
something other than white, like gray. Here is a short program that
demonstrates the problem:

#include "mac/quickdraw.h"

struct QDVar QDVar ;

main()
{
int delay ;

QD = & QDVar ; InitGraf( & thePort ) ; InitFonts() ; InitWindows() ;

FillRect(&thePort->portBits.bounds, &(QD->gray)); TextMode ( srcCopy ) ;

MoveTo ( 50, 50 ) ; DrawChar ('A') ;
MoveTo ( 50, 70 ) ; DrawString ("Test") ;

for ( delay = 0 ; delay < 100000 ; delay ++ ) ; ExitToShell() ;
}

From: [email protected] (Dan Winkler)
Subject: the answer

I took this question directly to the man who should know. "Sorry about
that" said Bill Atkinson. I told him it was ok.

SrcCopy is not a fully supported mode for text, he explained, because
of problems that arise with kerning and italics. For example, in the
string "Jeff", the tail of the first f could curve under and clobber
the corner of the e. So if you want to draw text in copy mode, you
should erase the rectangle that bounds it and then draw it using or
mode. But text drawing using or mode is so highly optimized in
QuickDraw, he said, that this is still about as fast as a fully
supported copy mode could ever be. The amount of white space you see
after a character when drawing in srcCopy mode is, by the way, just the
amount you need to account for the worst possible slant of an italic
character.

Dan.
Locked