Results 1 to 10 of 14

Thread: Text output pixel by pixel 8x8

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Oh, sorry, I had to tell you that I am using SDL2 for this task.
    Best regards,
    Cybermonkey

  2. #2
    As Athena already pointed out making a predefined images/graphics for various charactes would be the best solution.
    To learn more about this process search the web for "Bitmap Fonts".
    Main advantage of Bitmap Fonts is that your font characters can actually be made from different colored pixels.
    The main disadvantage of Bitmap Fonts is that in order to scale them nicely you would wanna use several diferent sized images for each characters to not loose to much quality by scaling them.

  3. #3
    Yes, I know about bitmap fonts and will implement some functions for them. But I also want a "built-in" font which needn't to be loaded. So, yes, I want both.
    Best regards,
    Cybermonkey

  4. #4
    Pardon me but I don't see why you will even need "built in" font. You can achieve same results using Bitmap Fonts. You can even change fonts bitmap pixel bx pixel if that is what you need.
    Also wouldn't the use of "built in" font require you to render it pixel bx pixel which is much slower than rendering it as a whole graphics?

  5. #5
    Two reasons: first one needn't ship any external bitmap files. Second I can easily change the size of the font, for e.g. title, score etc. It's just for lazyness if one uses my interpreter so he/she needn't take care of that. Just a "drawtext" and that's it. But no one is forced to use the built-in font but can use his own bitmap font.
    In my old version of EGSL I am using SDL_gfx which has a built-in bitmap font and I recognized that a lot of people use it for a simple text output (and even input).
    Best regards,
    Cybermonkey

  6. #6
    Quote Originally Posted by Cybermonkey View Post
    Two reasons: first one needn't ship any external bitmap files. Second I can easily change the size of the font, for e.g. title, score etc.
    1. You can still generate these bitmas programatically at apprication start if you want.
    2. Why not use some TrueType font to Bitmap Font converter which would alow you to easily make BitmapFonts of any desired size. And since TrueType Fonts (athleast never versions) are vector based you will get best results when scaling them.

  7. #7
    why not embedding the bitmaps for different resolutions fonts? I think that rendering pixel per pixel is just a waste of time. you can even create you beautiful font in any good graphical tool and then convert it to text include files.

  8. #8
    Nevermind, the thread tree is confusing me ...
    Last edited by Solstice Project; 01-11-2013 at 12:32 AM.

  9. #9
    You could use that array to generate a bitmap font, and draw it as quads same way you would use other fonts. If i understood you are drawing each unique pixel per frame, and is something i'd not recommend for performance reasons.

  10. #10
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2
    My suggestion was to use the data you have to pre-render a bitmap during application startup (i.e. it only ever lives in memory) and then do exactly as User137 is suggesting... simply draw your letters as quads and stick the relevant section of your pre-rendered bitmap to it as the texture.

    That's how I'd go about doing it. Clean, relatively efficient and simple.
    :: AthenaOfDelphi :: My Blog :: My Software ::

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •