This project is read-only.

Text in gui

Jan 7, 2012 at 7:13 AM

How would one make font made for the gui mode in cosmos, represent actual letters and numbers to the computer. Code would be helpful. Thanks

Jan 7, 2012 at 5:44 PM
Edited Jan 7, 2012 at 5:44 PM

Well, if you look in the code for Orvid.Graphics, you will find a working loader for .pcx fonts, the .fnt loader has a few issues :P

Jan 8, 2012 at 8:38 PM

wow. That sounds over my head, but i'll look into it. What is orvid graphics?

Jan 8, 2012 at 8:40 PM

It's a library in my user's folder in the main repo. If you find any bugs in the library itself (not bugs because of Cosmos :P), then be sure to tell me :P (I know of one in the triangle drawing method which has an issue, but not sure how to fix it :P)

Jan 11, 2012 at 8:56 AM
blah38621 wrote:

It's a library in my user's folder in the main repo. If you find any bugs in the library itself (not bugs because of Cosmos :P), then be sure to tell me :P (I know of one in the triangle drawing method which has an issue, but not sure how to fix it :P)

Orvid, question. How can you load fonts if there is no Filesystem support working yet? Or is there something I dont know? Because if your loading it as a project resource and that's possible, then I could load images, which would be nice. Anyway just wondering. Thanks - Matt

Jan 11, 2012 at 4:11 PM

I embed the fonts via a byte[], and pass it in as a memory stream.
Also, there is a simple utility to convert a file on disk into a usable byte[] in source2->Tools->File2ByteArrayConverter :P

Jan 11, 2012 at 5:41 PM
Edited Jan 11, 2012 at 5:42 PM
blah38621 wrote:

I embed the fonts via a byte[], and pass it in as a memory stream.
Also, there is a simple utility to convert a file on disk into a usable byte[] in source2->Tools->File2ByteArrayConverter :P

Oh thats smart. I never would have thought of that. Nice work Orvid. Thanks - Matt

We just use a image convertor I wrote and it spits out the image for us. Alot faster than doing it by hand. :p

Jan 11, 2012 at 6:22 PM

That, or you could just embed the bitmap image as a byte[] and load it with the bitmap loader in Orvid.Graphics :P (It's one of the few formats that should work without any issues within cosmos (Jpeg is a lot more complex (and the lib I use uses a large amount of interfaces), and I don't think we have all the math ops needed for a deflate stream implemented, so Png is out of the picture as well. OIF (A custom format, just a very basic bitmap :P), and possibly some variants of dds should work as well. Tga and Xpm might also work, but Tiff very definately won't work (It's based on the jpeg lib). Vbp is a domain specific format, so is pretty much useless here. And Pcx images don't work at all in the first place so :P )

Jan 11, 2012 at 9:49 PM
blah38621 wrote:

That, or you could just embed the bitmap image as a byte[] and load it with the bitmap loader in Orvid.Graphics :P (It's one of the few formats that should work without any issues within cosmos (Jpeg is a lot more complex (and the lib I use uses a large amount of interfaces), and I don't think we have all the math ops needed for a deflate stream implemented, so Png is out of the picture as well. OIF (A custom format, just a very basic bitmap :P), and possibly some variants of dds should work as well. Tga and Xpm might also work, but Tiff very definately won't work (It's based on the jpeg lib). Vbp is a domain specific format, so is pretty much useless here. And Pcx images don't work at all in the first place so :P )

Orvid, two questions. Would it be ok if I used your Font loader and Image loader in PearOs? It is open source and I would give you credit for the orginal. And my other question. I go on IRC to chat with you, and your never on? Are you avoiding me :p. Thanks - Matt

Jan 11, 2012 at 10:06 PM

Yes, that you can, just try to keep the project together :P (will avoid headaches for you later :P), and I'm always on the IRC, I just might not be at the keyboard :P

Jan 11, 2012 at 11:15 PM
blah38621 wrote:

Yes, that you can, just try to keep the project together :P (will avoid headaches for you later :P), and I'm always on the IRC, I just might not be at the keyboard :P

Oh! Ok, I was gonna say, it says your always on, but you never respond. What does try to heep the project together mean? Anyway. Your Friend - Matt