#107788 - diggla - Thu Nov 02, 2006 12:34 am
Hi,
i cannot find any tutorials etc. on how to initialize a text console with a small fixed fontset. Here is an example of a homebrew which uses a small fixed console font: http://www.nightmode.org/dscrawl/
Thanks in advance :)
#107804 - Ant6n - Thu Nov 02, 2006 5:08 am
i dont know about the DS, but for the gba you could use this tutorial
http://user.chem.tue.nl/jakvijn/tonc/text.htm
(which is part of the tonc collection)
maybe you can still get something out of it ;)
anton
#107807 - TJ - Thu Nov 02, 2006 5:51 am
libnds comes with a demo that shows how to use a custom font for the system console, have you looked into that?
#107809 - DekuTree64 - Thu Nov 02, 2006 6:17 am
The libnds console can only do 8x8 fonts. You'll have to write your own system if you want other sizes, and it will have to actually write to char data instead of just setting screen map entries to point to preloaded chars.
Looks like the font in that screenshot you posted is 5x8, which means you'll have to deal with glyphs that are half on one char and half on another. Either that or just use a full bitmap layer.
I had a nice idea for a high-speed variable size font system a while back, but wound up being too busy with work to make much progress on it. I do still need it for my tracker though, so it will have to be finished sooner or later. Perhaps I'll give it a go right now, even :)
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku
#107951 - PypeBros - Fri Nov 03, 2006 11:10 am
if i was to do 5x8 font on the DS, i guess i'd just use 2 or more layers and give them proper scrolling values so that the first 5x8 character on layer 2 appears to be just next to the the first character of layer 1.
E.g. layer 1 would have scrollx=0
layer 2 would have scrollx=5
layer 3 would have scrollx=10
Then if i'm to display "Hello", that'd mean
layer 1: H_l
layer 2: e_o
layer 3: l
In other words, you'll have 'H' at (0,0), 'e' at (5,0), 'l' at (10,0), then a new 'l' at (16,0) and finally 'o' at (21,0).
Okay, that means you have an extra white space (of one pixel) every 3 character ... maybe it won't be too much noticable
_________________
SEDS: Sprite Edition on DS :: modplayer
#107966 - tepples - Fri Nov 03, 2006 3:15 pm
That or use a rot/scale layer, as seen in my 6x8 demo for GBA.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#107971 - PypeBros - Fri Nov 03, 2006 4:47 pm
That's what i'd have done in first place, but won't there be some kind of ugly unpredictable pixel squeezing due to the scaling ?
I mean, you'll still have to submit an 8x8 font and the hardware will have to 'drop' two columns out of it ... can you tell in advance which pixels will be dropped so that you're not unfortunately missing what distinguish an lowercase 'l' from a lowercase 't', for instance?
_________________
SEDS: Sprite Edition on DS :: modplayer
#107972 - diggla - Fri Nov 03, 2006 4:47 pm
Thanks for your input. I'll try the bitmap text approach first as shown for the GBA at http://user.chem.tue.nl/jakvijn/tonc/text.htm#sec-bm . Rot/scale looks promising too. There is also a rot/scale demo in the CVS repo at devkitPro/examples/nds/Graphics/2D/rotscale_text. But scaling down an 8x8 font will lead to a somewhat chopped font face.
I have to see what looks best :) I'm pretty new to NDS homebrew so it'll take quite a while to see promising results :)
#107983 - tepples - Fri Nov 03, 2006 7:41 pm
PypeBros wrote: |
but won't there be some kind of ugly unpredictable pixel squeezing due to the scaling ?
I mean, you'll still have to submit an 8x8 font and the hardware will have to 'drop' two columns out of it ... can you tell in advance which pixels will be dropped so that you're not unfortunately missing what distinguish an lowercase 'l' from a lowercase 't', for instance? |
Lots and lots of experimentation. Make a pattern that's red-green-blue-blue and tweak the x origin and pa values of the background matrix until you can get a steady stream of red-green-blue.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#108016 - HyperHacker - Sat Nov 04, 2006 7:27 am
Seems like a waste of space though, to define those extra pixels in the first place when you aren't using them.
_________________
I'm a PSP hacker now, but I still <3 DS.
#108079 - tepples - Sun Nov 05, 2006 2:47 am
Using a 4-bit or 8-bit hardware tile set for a 1-bit font already wastes space. Just think of this internal fragmentation as yet another limitation of the DS that you have to work around.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.