Shop OBEX P1 Docs P2 Docs Learn Events
TV_Text Font Generator — Parallax Forums

TV_Text Font Generator

matbmatb Posts: 39
edited 2010-01-13 13:15 in Propeller 1
Is there a version of Font Generator and a matching tweaked TV_Text to generate stuff in the 32x16 ROM font format?

I have one in progress, so I figured I had better check before I uploaded it to Obex.

I still have to get the tiles aligned properly to the 128 byte boundary, is there a way to force alignment in DAT sections larger than a LONG?

At the moment I am leaving padding around the font table and (attempting to) copy the font to the correct alignment at runtime.

Mat

Edit... attached version 0.2 with working demo of basic concept.

Post Edited (matb) : 1/12/2010 3:57:59 PM GMT

Comments

  • RaymanRayman Posts: 14,876
    edited 2010-01-11 15:40
    Here's an example:



    http://www.rayslogic.com/propeller/Programming/1-BitBitmap/1-Bit%20Bitmaps.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • trodosstrodoss Posts: 577
    edited 2010-01-11 19:12
    @matb,
    I don't know of any that have been done, so kudos to you [noparse];)[/noparse]

    There is more recent code for FontGenerator in the thread:
    http://forums.parallax.com/showthread.php?p=833043

    The more recent code is not in the OBEX, but is similarly MIT licensed.
    [noparse][[/noparse]Edit:] I have thought about including FontGenerator in the 'Tool Object' list, but have not yet. My only real reservation in posting it by itself is that it is not Spin/PASM/C code itself, but generates .Spin code. Maybe one of the moderators knows if it would be permissible (?) Also, another question would be if distributing a .bmp with the Parallax ROM font (which the post does *NOT* currently contain) would violate their copyright.

    However, for any of your work, feel free to do what you would like. Don't let my (likely unfounded) concerns hinder you in any way from modifying/posting/distributing·in what ever form you would like·[noparse];)[/noparse]

    If/when you get the code working I can merge the code with the AI_Generic and Potato_Text font generation code. Or, if you need additional help let me know.

    --trodoss

    Post Edited (trodoss) : 1/11/2010 8:27:05 PM GMT
  • potatoheadpotatohead Posts: 10,261
    edited 2010-01-11 21:37
    I would suggest adding this code to the wiki. That's the right place for it. Objects are really supposed to be propeller code.

    A quick note to Ken will get the font copyright issue sorted.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    8x8 color 80 Column NTSC Text Object
    Safety Tip: Life is as good as YOU think it is!
  • matbmatb Posts: 39
    edited 2010-01-12 13:44
    Test app attached which shows mixing custom and ROM fonts. Using mpark's 20x7 tv_text variant.


    @potatohead I don't need the Propeller font, its already in rom smile.gif This allows me to draw additional font tiles in a bmp editor, and display them alongside the standard font.
    I guess now I understand the tiles a little bit better, I could probably do this another way, but its looking good for my needs. (Mix of big and small text, no flicker, and some ram for code)

    @trodos Pity I based it on an early version, but is pretty trivial changes really. Merging the code in sounds good, but i need update the alignment stuff into the code generator. I would think its fine to put in Obex, include it alongside a demo app to demonstrate the tool.

    @raynman, Gimp will not open the bmp file in the zip, corrupt maybe? Having only a windows binary without the source code is not much value to me.

    Edit... move fixed attachement to post #1.

    Post Edited (matb) : 1/12/2010 2:24:54 PM GMT
  • RaymanRayman Posts: 14,876
    edited 2010-01-12 13:52
    matb:· I just wanted to show you how to align the data at runtime...

    I think an actual font editor is a great idea...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • matbmatb Posts: 39
    edited 2010-01-12 14:34
    Ah now that makes sense. The code is a bit less clunky than mine!

    Am I correct in my understanding the VGA code is uses a 16x16 tile, and hence the print and boxchr are not expected to work?
  • trodosstrodoss Posts: 577
    edited 2010-01-12 19:09
    @potatohead,
    I asked Ken and he did not think there would be any issues with copyright. Better safe than sorry [noparse];)[/noparse]

    @matb,
    With your permission, I can merge your modified FontGenerator with what I have. I need to put in more 'example code' for the other output methods (AIGeneric, Potato_Text, and Binary). I can set up a SourceForge or CodePlex project in order to manage FontGenerator if you think you will want to further extend it.

    I will see about setting up a makefile for Mono to include with the package (unless you already have one). That way it should be easier for non-Windows users.

    Looks good so far!
    --trodoss
  • RaymanRayman Posts: 14,876
    edited 2010-01-12 21:07
    matb: True, you can't do the regular boxes with 16x32 tiles... I think you're better off with 16x16, unless you need to save space...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • CassLanCassLan Posts: 586
    edited 2010-01-12 21:45
    matb,

    Thats pretty sweet. From your demo your target usage is to display bigger?

    It reads the ROM font then generates additional tiles that add up to a bigger version?

    Can it just create an exact replica of the ROM font but Shifted by a # of pixels?

    Let me be more clear, if I wanted to have a scrolling effect, but wanted it smooth..like 1 pixel at a time instead of a whole line or character at a time, would this be the way to go?

    Read a String
    Get its Bits as stored in the ROM font..into some data structure
    Shift as needed...horizontally or vertically
    Use the Tweaked TV_Text to output these "new" characters?



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    NYC Area Prop Club

    Prop Forum Search (Via Google)

    ·
  • matbmatb Posts: 39
    edited 2010-01-13 13:15
    @CassLan, yep for my app I need 2 lines of big text on a small screen for the main display, plus some other detail in a smaller font. I am using the Graphics driver now, but can't spare the memory for double buffering, and the flickering is not acceptable.

    The big font is not from the Prop font, I just drew up the segments in Gimp. Its basically just a line drawing font elements for digits.

    Yep the tweaks to tv_text would work for that, or at least get you started. I'm not sure I'll keep that interface to TV_TEXT, I think instead I will expose the screen buffer address, and pass to my big text helper object.

    @Rayman, 16x16 would work well with a driver that uses the prop font in 16x16 mode, skipping lines. Not sure if such a beast exists though.

    @trodoss, yes please, merge away. I don't have any further need to tweak the generator side of things. +1 for a makefile, great invention, often overlooked.
Sign In or Register to comment.