Shop OBEX P1 Docs P2 Docs Learn Events
Font type and size in VGA ( LCD adaptation) — Parallax Forums

Font type and size in VGA ( LCD adaptation)

T ChapT Chap Posts: 4,223
edited 2014-06-01 04:35 in Propeller 1
  case c
    $00..$FF:           'character?
      k := color << 1 + c & 1
      i := k << 10 + $200 + c & $FE
      screen[row * cols + col] := i
      screen[(row + 1) * cols + col] := i | 1
      if ++col == cols
        newline

In Print, this is formatting the screen. In the object NH4_LCDdriver, I do not where and how text is being created, nor in the Print fuction. I am trying to figure out how to change the font type and size as the type and size that is the default is not matching with other bitmaps I have created that contain text and numbers. If it is not possible to change this, I can always just create my own bitmaps of letters and numbers but was hoping to avoid that path.

Any thoughts?

Comments

  • RaymanRayman Posts: 14,658
    edited 2014-05-31 09:10
    That code is using the ROM font, just like the TV and VGA drivers...

    Clemens came up with a way of resizing the ROM font to be about half size.
    But, other than that, I don't think there's much you can do there...
  • T ChapT Chap Posts: 4,223
    edited 2014-05-31 09:54
    PRI DrawBitmap(pBitmap,  pInfo)|c,i,j,BmpAddress,xPos, yPos, xSize, ySize,bpp,clr
      bpp:=byte[pInfo++]
      xSize:=byte[pInfo++]
      ySize:=byte[pInfo++]
      xPos:=byte[pInfo++]
      yPos:=byte[pInfo++]
      clr:=byte[pInfo++] + grcol
      row:=yPos
      col:=xPos
      c:=0
      BmpAddress:=pBitmap
      repeat j from 0 to (ySize-1) step 2    '2
        repeat i from 0 to (xSize-1)
          screen[row * cols + col] := (clr<<1+1) << 10 + BmpAddress>>6 +c
          screen[(row+1) * cols + col] := (clr<<1) << 10 + BmpAddress>>6 +c
          c++
          col++
        row+=2
        col:=xPos
    

    Thanks Ray, I assumed.

    Is there anything in this drawbitmap that would allow the row/col values to be overridden? ie lets say I want to generate a number, letter, group of letters or words in a bitmap to .dat file, then display something on a pixel boundary and not the fixed row/col boundaries. Is that possible? I would think it could be easier to be able to draw a letter using %00001000 type format to be used as data and skip the pixel creating software>bmp>.dat file. Drawing pixels boundary items does not seem possible with this driver, it seems it is either one or the other.
  • RaymanRayman Posts: 14,658
    edited 2014-05-31 11:56
    That type of bitmap is really something like custom font characters that make your bitmap out of the same kind of tiles as the ROM font...
    So, the bitmap has to be aligned, like the regular display characters, to 16 pixel by 16 pixel tiles...
  • RaymanRayman Posts: 14,658
    edited 2014-05-31 11:57
    if you have the RAM, you can make some of the display into a graphics area using "Graphics.spin" and then be able to set individual pixels and use the vector font...
  • T ChapT Chap Posts: 4,223
    edited 2014-05-31 18:43
    I am working on making externally loaded bitmaps as dat files to handle all text since the ROM fonts are not adequate. I realized there are problems with this, the first being that that I am already out of memory in the main program. I am trying now to see if it is possible to load some of the dat files into another cog just for storage purposes. Is is possible to load a cog that doesn't do anything except hold a repeating dummy loop, and put the .dat files for the bitmaps inside those other storage cogs, but still access the data from the main program?


    If this is possible, what would be the method to point the addresses in Drawbitmap to the other cogs?

    DrawBitmap(@graphic76_data, @graphics76_info)

    I can easily use space on the eeprom but that is a last resort due to the slow load speed.

    Heck what am I talking about. If I have hit 8000 longs, then there is no storage space left anywhere except for external methods.
  • RaymanRayman Posts: 14,658
    edited 2014-06-01 04:35
    I find it very easy to run out of memory doing graphics on P1... Hopefully, we'll get P2 soon...

    You can use monochrome (1-bit) graphics as much as possible.
    If you don't need all the graphics on the screen at the same time, you could swap them in and out from external memory...

    Also, I just made a 1/2 resolution driver for NH4. The screen is then 240x136 (instead of the native 480x272) and everything is 2X bigger...
Sign In or Register to comment.