Menu

#29 TEXTAREA : tabsize and fontsize

open
None
1
2007-04-09
2006-03-10
dmaz
No

confirmed on - PC,mac

open tool.bmx and set your code fontsize to 11 or 12
and your tabsize to 4. On a pc make sure you
restart(bug 1446957). all the numbers for the const
will line up correctly.

now set you fontsize to 8 or 9(?) and restart (PC) the
const will now not line up correctly. it seems that
the tabsize in pixels is incorrect for these lower
resolutions. could not duplicate this problem on other
editors.

Discussion

  • Mark Tiffany

    Mark Tiffany - 2006-03-10

    Logged In: YES
    user_id=102488

    I suspect that like bug 1446957 and friends, this is going
    to be a BlitzMax problem, not a problem with the IDE code.
    You may want to try to reproduce it in a short sample code
    and post it in the BlitzMax bug reports.

     
  • dmaz

    dmaz - 2006-03-13

    Logged In: YES
    user_id=1429218

    on the PC this also occurs in WordPad so it seems that's is
    a RTF textarea problem.... this doesn't explain the problem
    on the mac

     
  • Mark Tiffany

    Mark Tiffany - 2006-05-09
    • assigned_to: nobody --> skidracer
     
  • Mark Tiffany

    Mark Tiffany - 2006-05-09

    Logged In: YES
    user_id=102488

    Caused by a problem in BlitzMax, raised in this topic:

    http://www.blitzbasic.com/Community/posts.php?topic=59526

    Assigned to skid as we can't do naff all about it.

     
  • Mark Tiffany

    Mark Tiffany - 2006-06-03

    Logged In: YES
    user_id=102488

    Example code:

    Local w:TGadget=CreateWindow("test textarea",100,100,300,300)
    Local ta:TGadget=CreateTextArea(0,0,300,150,w)
    Local b:TGadget = CreateButton("Size = 8" , 0 , 150 , 100 ,
    50 , w)
    Local b2:TGadget = CreateButton("Size = 12" , 150 , 150 ,
    100 , 50 , w)
    f:TGUIFont=LoadGuiFont("Courier New",12)
    f2:TGUIFont=LoadGuiFont("Courier New",8)
    SetTextAreaFont ta,f
    SetTextAreaText ta,"Const TOOLRESET:Int=~t~t0~nConst
    TOOLSHOW:Int=~t~t1~nConst TOOLREFRESH:Int=~t~t2~nConst
    TOOLNEW:Int=~t~t3~nConst TOOLOPEN:Int=~t~t4~nConst
    TOOLCLOSE:Int=~t~t5"

    Repeat
    WaitEvent()
    Select EventSource()
    Case b ; SetTextAreaFont ta , f2
    Case b2 ; SetTextAreaFont ta, f
    Case w
    If EventID()=EVENT_WINDOWCLOSE Then End
    End Select
    Forever
    End

     
  • Mark Tiffany

    Mark Tiffany - 2007-02-11

    Logged In: YES
    user_id=102488
    Originator: NO

    Aha, this is caused by the tabsize being set as a GRAPHICAL size, not a CHARACTER size. i.e. the size of a "tab" in 8 point and in 12 point is the same number of PIXELS, not the same number of characters. As such, it is easy for the tabs to go askew.

    No to find out if you can alter this behaviour...

     
  • Mark Tiffany

    Mark Tiffany - 2007-02-11

    Logged In: YES
    user_id=102488
    Originator: NO

    I've done some more digging into this one, and raised a bug report on the BB forum for this, as it looks like the tab width is set based on a fixed width (8), whereas as it ought to use the width of the font.

    http://www.blitzbasic.com/Community/posts.php?topic=67295

    Someone with more C++ skills than me may be able to fix this up themselves?

     
  • Mark Tiffany

    Mark Tiffany - 2007-02-11

    Logged In: YES
    user_id=102488
    Originator: NO

    After a response from skidracer on the bb forum, it is working as intended. In order to have tabs sized based on CHARACTERS in the font, we need to change the code to set the tab size based on the font width.

     
  • Mark Tiffany

    Mark Tiffany - 2007-02-11
    • assigned_to: skidracer --> sgtbilko
     
  • Mark Tiffany

    Mark Tiffany - 2007-04-09
    • priority: 5 --> 1
    • summary: tabsize and fontsize --> TEXTAREA : tabsize and fontsize
     
  • Mark Tiffany

    Mark Tiffany - 2007-04-09

    Logged In: YES
    user_id=102488
    Originator: NO

    Priority dropped as we will have our own codearea soon.

     
  • Mark Tiffany

    Mark Tiffany - 2007-10-31

    Logged In: YES
    user_id=102488
    Originator: NO

    Or if not our own textarea, this is dependent on skid adding a TGUIFont.Width() for proportional fonts

     

Log in to post a comment.

Auth0 Logo