[comp.lang.pascal] Text attribute in Graphics mode

cncst3@unix.cis.pitt.edu (Chunqing N. Cheng) (08/25/90)

When working with BGI, you cannot use pascal's WRITE or WRITELN unless
you set DIRECTVIDEO=FASLE.  I do not like the tiny characters from
OUTTEXT or OUTTEXTXY.  But in both cases (either WRITE or OUTTEXT),
I cannot set up BACKGROUND color freely. If I use OUTTEXT, whenever
I change background color, whole screen change.  When I use WRITE,
TEXTBACKGROUND does not function at all.

I saw some programs do use different colors for background color in
graphics mode, how can I do this in Turbo Pascal? 

ts@uwasa.fi (Timo Salmi LASK) (08/26/90)

In article <31799@unix.cis.pitt.edu> cncst3@unix.cis.pitt.edu (Chunqing N. Cheng) writes:
>When working with BGI, you cannot use pascal's WRITE or WRITELN unless
>you set DIRECTVIDEO=FASLE.  I do not like the tiny characters from
>OUTTEXT or OUTTEXTXY.  But in both cases (either WRITE or OUTTEXT),

Graphics programming is not easy, and thus your dilemmas are
understandable, but you have things just slightly confused.  The
outtext characters need not be tiny.  You can multiply their size
both in height, and in width.  It is a case of read the manual. 
(See SetTextStyle in your reference). 

>I cannot set up BACKGROUND color freely. If I use OUTTEXT, whenever
>I change background color, whole screen change.  When I use WRITE,
>TEXTBACKGROUND does not function at all.

You a right, but one can work around this problem by drawing the
background.  The easiest way to do that is apply the Bar command
appropriately. 

Note that mixing write-command and graphics mode is not the intended
way of going about these things.  And if you do not like the way
OutText characters are drawn, you can device fonts yourself or read
textmode fonts from memory using interrupts.  But this can already
be considered fairly advanced. 

>I saw some programs do use different colors for background color in
>graphics mode, how can I do this in Turbo Pascal? 

As per above.  The colors in the background are not really
background colors, but foreground made to look like background. 

...................................................................
Prof. Timo Salmi        (Moderating at anon. ftp site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

milne@ci4.ics.uci.edu (Alastair Milne) (08/29/90)

In <1990Aug25.214403.12139@uwasa.fi> ts@uwasa.fi (Timo Salmi LASK) writes:

>The outtext characters need not be tiny.  You can multiply their size
>both in height, and in width.  It is a case of read the manual.
>(See SetTextStyle in your reference).

   Please verify this.  My understanding is that the scaling of characters
   applies *only* to stroked fonts, read from CHR files.  I don't believe
   that OutText uses these scalings.

   And I'm afraid that, at least to my eye, the visual quality of the
   stroked fonts is quite inferior to that of OutText's.  Enough so that,
   even though I needed to use a character set with some different
   fonts in it, I couldn't afford to use a stroked font.

   Does anybody know where the font comes from that OutText uses?


   Alastair Milne

CDCKAB%EMUVM1.BITNET@cunyvm.cuny.edu ( Karl Brendel) (08/29/90)

In article <26DB5C09.19687@ics.uci.edu>
  Alastair Milne <milne@ci4.ics.uci.edu> writes:

>In <1990Aug25.214403.12139@uwasa.fi> ts@uwasa.fi (Timo Salmi LASK) writes:
>
>>The outtext characters need not be tiny.  You can multiply their size
>>both in height, and in width.  It is a case of read the manual.
>>(See SetTextStyle in your reference).
>
>   Please verify this.  My understanding is that the scaling of characters
>   applies *only* to stroked fonts, read from CHR files.  I don't believe
>   that OutText uses these scalings.

You are probably confusing SetUserCharSize with SetTextStyle.

Please refer to the procedure SetTextStyle documentation in the 5.X Ref
Guide. Note particularly 'Affects all text output by OutText and
OutTextXY. One 8x8 bit-mapped font and several "stroked" fonts are
available.' Note also the example program which uses the default font.
(I don't think you're going to be crazy about the default font when you
get it scaled up.)

+=========================================================================+
| Karl Brendel                                Centers for Disease Control |
| phone 404/639-2709                          Epidemiology Program Office |
| fts       236-2709                          Atlanta, GA                 |
|                                                                         |
|                        Home of Epi Info 5.0                             |
+=========================================================================+