🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fa.info-mac
Article #166

quickdraw glitch when drawing text in srcCopy mode

#166
From: info-mac
Date: Tue, 17 Jul 1984 01:36
47 lines
2287 bytes
From: Bill Croft <croft@safe>
Date: Sat, 14 Jul 84 17:52:08 edt
From: winkler@harvard.ARPA (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: winkler@harvard.ARPA (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 is, by the way, just the amount you need to account
for the worst possible slant of an italic character.

Dan.
Technical Details
Message-ID: <1228@uw-beaver>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!mgnetp!ihnp4!houxm!houxz!vax135!cornell!uw-beaver!info-mac

Show Full Headers
Complete Article Headers
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: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!mgnetp!ihnp4!houxm!houxz!vax135!cornell!uw-beaver!info-mac
From: info-mac@uw-beaver (info-mac)
Newsgroups: fa.info-mac
Subject: quickdraw glitch when drawing text in srcCopy mode
Message-ID: <1228@uw-beaver>
Date: Mon, 16-Jul-84 21:36:47 EDT
Article-I.D.: uw-beave.1228
Posted: Mon Jul 16 21:36:47 1984
Date-Received: Wed, 18-Jul-84 01:53:57 EDT
Sender: daemon@uw-beave
Organization: U of Washington Computer Science
Lines: 47