Shop OBEX P1 Docs P2 Docs Learn Events
Looking for updated P2 VGA Text & Graphics driver — Parallax Forums

Looking for updated P2 VGA Text & Graphics driver

The new P2 VGA drivers are great and have fantastic resolution. But the text is super small and low resolution 8x8 or 8x16 Many times I need the high screen resolution but with text 1/2 inch high, maybe 1-inch high, for industrial controls and instrumentation projects. I always liked the P1 ROM font, but with the new P2 so many other font possibilities should exist. BIT-mapped fonts are easy to work with and I can add custom / special characters easily using the original 16x32 pixel (maybe higher) font size format. Good text and graphics can make a project shine! As I recall the older P1 text drivers also had text boxes, buttons, check boxes, radio buttons, and slider controls. I can do the SPIN2 but PASM not so much.

Comments

  • The high-res scalable text is on my to-do list since I need it for the same thing.
  • jmgjmg Posts: 15,173
    PropGuy2 wrote: »
    ... Good text and graphics can make a project shine! As I recall the older P1 text drivers also had text boxes, buttons, check boxes, radio buttons, and slider controls. I can do the SPIN2 but PASM not so much.

    Did you see this ?
    https://forums.parallax.com/discussion/171223/1080p-tiled-gui/p1

  • @PropGuy2 , I was going to point you to my driver which can do arbitrary sized < 256 pixel high but you mention you need wider fonts which is doesn't support natively. Mine only does 8 pixel or double wide 8->16 pixel fonts in its text mode. You could combine 2-4 characters to widen but then you'd drop to 64 or 128 characters. Maybe that's okay?

    Until something gets developed more specific for your particular text needs the only other way is to use a frame buffer approach and render pixels directly into it yourself. If you can spare the HUB RAM for the needed resolution and colour depth used this is doable but you will of course trade off character redraw speed.
  • rogloh - Yes I have looked at your VGA driver and most of the other ones as well. I liked the P1 tile formats 40x15 or 50x18 screen with 16x32 bit mapped text fonts. A good combination for industrial controls and instrumentation. The larger text fonts are important for reading the screen at a longer distance 4 to 6 feet. Refresh and redraw speed is not that important - not doing fast moving video, mostly static screen displays. Larger Font and static graphics - knobs, buttons, switches, check boxes, text boxes - would be nice to have and user BIT-mapped definable. P2 palette colors are great but I will take what I can get. See attachment for an example.
  • RaymanRayman Posts: 14,646
    My 2-bit tiled driver that @jmg pointed to might work for you. It uses fonts the same way as P1. Actually, it uses the P1 rom font as is. And, it's fairly easy to add new characters...
  • RaymanRayman Posts: 14,646
    Maybe there's a way to define graphics as text like that, but it's a big complicated with the P1 style font as it consists of a pair of 1bpp characters merged together into 2bpp data...

    Still, I seem to remember you can do it using quadinary instead of binary format...

    However, I find it easier to work with bitmaps and then convert those to tile data. There's a tool here for doing this: https://forums.parallax.com/discussion/171223/1080p-tiled-gui/p3

    Better yet, you can define your own whole font using RaysFontEditor and then export in P1 format and you're all set: http://www.rayslogic.com/Software/RaysFontEditor/RaysFontEditor.htm

    There should be plenty of room left in 512kB RAM for another 16kB font...
  • Here's a version of my VGA tile driver that supports 16 pixel wide fonts as well as 8 pixel wide ones. The font supplied is not the parallax font, it's one called "spleen"; converting the parallax font to the appropriate format is left as an exercise for the reader :) (there's a program called makebitmap.c that will convert a BDF font file to the correct binary format, so you could use that as a starting point). Basically the only tricky part of the binary font format is that it's arranged by lines rather than by characters, as if it were a giant image 32 pixels high and 16*256 pixels wide.

    Source code is included, and it's on my github page at https://github.com/totalspectrum/p2_vga_text.
  • Actually, converting the P1 font was really easy, so here's a .bin file suitable for use with vgatext_1024_16x32.spin. Just change "spleen-16x32.bin" in that file to "P1FONT.bin".
  • ersmith - The VGA code example works great, and the P1 Font makes everything look really professional. I recommend the P1 Font be the default font for all VGA demos. I am in the process of writing a generic VGA demo with the P1 font to show off some of these features.
    I can do it but with some difficulty, but is there a P1 font to P2 text font Character Map available to easily pick and place "non-printable" letters and symbols into VGA string functions? There was one in the original Prop IDE that made doing simple stick diagrams and graphics so much easier.
Sign In or Register to comment.