Shop OBEX P1 Docs P2 Docs Learn Events
Code blocks should use monospaced font — Parallax Forums

Code blocks should use monospaced font

mparkmpark Posts: 1,307
edited 2011-01-31 09:12 in General Discussion
Snippet from http://forums.parallax.com/showthread.php?129168-Considering-the-release-a-Joystick-hack-Object&p=972304&viewfull=1#post972304:
           test     temp,   pinn13    wz '9                                          
    if_z   or       button, butt9                                                    
    if_nz  andn     button, butt9                                                    
           test     temp,   pinn14    wz '10                                         
    if_z   or       button, butt10                                                   
    if_nz  andn     button, butt10                                                   
           test     temp,   pinn12    wz '11                                         
    if_z   or       button, butt11                                                   
    if_nz  andn     button, butt11                                                   
           test     temp,   pinn11    wz '12                                         

In code, I expect columns of text to be visually aligned, but on my screen at least, the above code does not line up visually.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-01-30 09:05
    Michael,

    The columns are aligned on my screen (OS/X, Opera 10). Which OS and browser are you using? Can you post a screenshot? It might be a font issue. If your computer doesn't have any of the fixed-width fonts specified by the stylesheet, it may be substituting a proportionally-spaced font.

    -Phil
  • mparkmpark Posts: 1,307
    edited 2011-01-31 00:03
    Windows 7, Opera 11. Screen cap attached. I just now took a look in IE8 and the columns line up nicely (same computer) but I prefer to use Opera, darnit.
    387 x 212 - 8K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-01-31 01:08
    Michael,

    I see the problem. It is a monospaced font, but the space character is ever so slightly narrower than the other characters. I've seen this happen when boldface characters are displayed -- especially with fonts like the Parallax font, which doesn't come with its own boldface glyphs. But this is a first for normal characters.

    That typeface looks like Consolas. Try this: When in Opera, type Alt-P to bring up the Options panel, then select Advanced->Fonts. Under font-family Monospaced, if Consolas is displayed, change it to Courier New.

    This is, admittedly, a shot in the dark. When I changed my default from Courier New to Consolas, the columns still lined up okay.

    -Phil
  • mparkmpark Posts: 1,307
    edited 2011-01-31 09:12
    Thanks, Phil. I changed from Consolas to Courier New and Lucida Console and they all were misaligned the same way.
    I guess it's a problem with this version of Opera.
Sign In or Register to comment.