Project

General

Profile

Actions

Bug #712

open

The columns and lines parameters on Screen Open don't appear to work because the font size is incorrect on the text windows.

Added by Brian Flanagan about 3 years ago. Updated almost 3 years ago.

Status:
Feedback
Priority:
High
Target version:
-
Start date:
04/03/2021
Due date:
% Done:

0%

Estimated time:
1:00 h
Affected version:

Description

The font size for the text window should be automatically adjusted to accommodate the specified columns and lines parameters, but it is not.

Example: (in AOZ manifest)

#displayWidth: 320
#displayHeight: 256
scrWidth=320
scrHeight=256
Screen Open 0,scrWidth,scrHeight,32,Lowres,40,32
Locate 0,0 : Print "0123456789012345678901234567890123456789"; ' 40 columns
For row=0 To 4
    Locate 0,row
    Print row;
Next row
Locate 0,1 : Print X Graphic(1),Y Graphic(1);" ";
Wait Key

Instead of the 40 x 32 display I asked for, I got approximately 13x6.
In the example, the font size should be adjusted from 24x43.2 px to 8x8 px to accommodate the specified rows and lines.

It also does not adjust the other direction. If, for example I have a 1920 x 1080 pixel screen, and I tell it I want 40 columns x 20 lines, I still get the default of 80x25.

scrWidth=1920
scrHeight=1080
Screen Open 0,scrWidth,scrHeight,32,Lowres,40,20
Locate 0,0 : Print "0123456789012345678901234567890123456789"; ' 40 columns
Print "0123456789012345678901234567890123456789"; ' 40 more
For row=0 To 23 // 4
    Locate 0,row
    Print row;
Next row
Locate 0,1 : Print X Graphic(1),Y Graphic(1);" ";
Wait Key

Files

Text_Font_Size_Wrong.png (242 KB) Text_Font_Size_Wrong.png Brian Flanagan, 07/13/2021 11:26 PM
Actions #1

Updated by Francois Lionet about 3 years ago

  • Status changed from New to Resolved
  • Assignee set to Francois Lionet

Strange, I updated this bug a couple of days ago and it was forgotten.

Actions #2

Updated by Francois Lionet about 3 years ago

Strange, I updated this bug a couple of days ago and it was forgotten.
Or I forgot to do it.

This is normal. Calculation of the manifest parameter were wrong. You have to create a new application and not use the tags.

Tags affecting the manifest will be removed, or only in advanced developer mode (us and people who can cope with it and such side effects).

Actions #3

Updated by Brian Flanagan about 3 years ago

  • Status changed from Resolved to Feedback

The tags have nothing to do with the issue I'm addressing here.
If you remove the tags from Example #1, the result is identical.

The issue is that the cols and lines parameters on Screen Open have NO EFFECT.

If you remove the tags from the first example, and the result is still incorrect.

In example 1: Even though I specify a 40 x 32 text window, I only get 12 x 5
(Font should scale down to fit 320 x 256 screen)

In example 2: Even though I specify a 40 x 20 text window, I still get 80 x 25
(Font should scale up to fit 1920 x 1080 screen)

To clarify the issue, here are a couple more examples:

The following should produce an error:

scrWidth = 1920 : scrHeight = 1080
cols=0 : lines=-10
Screen Open 0,scrWidth,scrHeight,32,Lowres,cols,lines

...but instead an 80 x 25 text window is used.

This example should create a 120 column by 32 line text window for the 1920 x 1080 screen

scrWidth = 1920 : scrHeight = 1080
cols=120 : lines=32
Screen Open 0,scrWidth,scrHeight,32,Lowres,cols,lines

...but the result is still an 80 x 25 text window.

My guess is that although the cols and lines parameters are accepted, they are ignored.

Are we not planning on having the cols and lines parameters available in version 1? If so, I'll just change this to a Feature Request. Also if so, we need to annotate in the documentation that this feature will be implemented in a future version of AOZ.

Actions #4

Updated by Brian Flanagan almost 3 years ago

  • File Text_Font_Size_Wrong.png Text_Font_Size_Wrong.png added
  • Subject changed from Apparently the columns and lines parameters on Screen Open are not working at this time. to The columns and lines parameters on Screen Open don't appear to work because the font size is incorrect on the text windows.
  • Estimated time changed from 4:00 h to 1:00 h
  • Affected version changed from 1.0.0 (B7) to 1.0.0 (B8) u15

Apparently, the columns and lines parameters are working now, however, since the font size is wrong, the text windows are all messed up. Here's a better example of the current problem. Even with the default screen size of 1920 x 1080 pixels graphic, and 80 x 25 columns text, the font size is still wrong. (See screen snapshot for an illustration.) See also bug #801 to show the problem when columns and lines are specified:

cols=80 : lines=25
scrWidth=1920 : scrHeight=1080
Screen Open 0,scrWidth,scrHeight,32,Lowres
Curs Off : Flash Off : Palette 0,$FFFFFF,$77FF77 : Pen 1 : Paper 0 : Ink 1 : Cls 0
tb$=Chr$(9)
Box 0,0 To scrWidth-1,scrHeight-1
Draw 0,0 To scrWidth-1,scrHeight-1
Draw 0,scrHeight-1 To scrWidth-1,0
Ink 1
' Show columns
Locate 0,0
For c=1 to cols
    Print Chr$(48+(c Mod 10));
Next
Print : Print "Above line is 60 chars long."
Print
Fix 3
f$="####.#### pixels."
Print "Font width is:  "; : Print Using f$; X Graphic(1)
Print "    should be:  "; : Print Using f$; scrWidth/cols
Print "Font height is: "; : Print Using f$; Y Graphic(1)
Print "     should be: "; : Print Using f$; scrHeight/lines
' Show lines
Locate 0,7
For r=8 to lines-1
    Print Chr$(48+(r Mod 10))
Next r
Print Chr$(48+(r Mod 10));
Locate 2,19 : Print "The numbers across show the";cols;" columns."
Locate 2, : Print "The numbers across the left edge show the";lines;" lines."
Ink 2
Box 0,0 To cols*X Graphic(1),lines*Y Graphic(1)
Locate 2, : Print "The area bounded by the green rectangle should fill the screen!"
Do
    Wait Vbl
Loop
Actions

Also available in: Atom PDF