Problems with personal font map

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Problems with personal font map

Post by Karlosoft »

Hi! I'm working in 640x480 24bit graphic mode, and i need to add a character function. This is the font map (8x16) taken from an other source.
(It's the attached file)

Well when i compile the kernel the bin contains only the characters up to 26. Why the other 230 chars aren't "saved"?
Attachments
font.rar
(7.71 KiB) Downloaded 166 times
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Problems with personal font map

Post by neon »

:shock:
...This makes me happy of using bitmap resources.

Im not to sure why it would only take the first 26 characters though. What happens if you add another label after the 26th character?
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Blue
Member
Member
Posts: 31
Joined: Thu Aug 02, 2007 6:34 am
Location: on the stack

Re: Problems with personal font map

Post by Blue »

After some playing around with the source, I found out that the error happens on this line (26th character):

Code: Select all

DB    000H            ; 00000000  °°°°°°°°   |          |"→"|        |
If you remove the arrow from the comment, it compiles to 4 KiB which fixes it.
On the other hand I have no idea of why it happens since the arrow actually is placed in a comment.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Problems with personal font map

Post by neon »

Hm, that is weird. Perhaps its an assembler bug?
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Blue
Member
Member
Posts: 31
Joined: Thu Aug 02, 2007 6:34 am
Location: on the stack

Re: Problems with personal font map

Post by Blue »

That is my thought too. It is an unicode character, so my wild guess would be that the assembler has problems handling unicode. The strange thing about that the character is placed in a comment :?
User avatar
~
Member
Member
Posts: 1228
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Re: Problems with personal font map

Post by ~ »

Yes, I think that NASM has problems with those characters. Maybe you should edit the file in real text mode, not using something like Notepad or avoid using those characters. Anyway, if the 1's and 0's of the bitmap are seen with attention and with a monospaced font like Courier, it should be easy to distinguish the character.
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Re: Problems with personal font map

Post by Karlosoft »

In fact the 26th character wasn't shown all, but only up to the arrow. Now it work :)
Wow a bug in nasm... well thanks for the help :)
Attachments
vesaCharactersWork.PNG
vesaCharactersWork.PNG (7.05 KiB) Viewed 6610 times
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Problems with personal font map

Post by jal »

Blue wrote:That is my thought too. It is an unicode character, so my wild guess would be that the assembler has problems handling unicode. The strange thing about that the character is placed in a comment :?
Err... guys... That is character 26, you know, ^Z? The "end of file" marker?


JAL
User avatar
~
Member
Member
Posts: 1228
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Re: Problems with personal font map

Post by ~ »

It also has failed with this character ° that resembles degrees.
User avatar
Blue
Member
Member
Posts: 31
Joined: Thu Aug 02, 2007 6:34 am
Location: on the stack

Re: Problems with personal font map

Post by Blue »

jal wrote:Err... guys... That is character 26, you know, ^Z? The "end of file" marker?
That makes sense today after sleeping #-o Thanks for clarifying
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Re: Problems with personal font map

Post by Karlosoft »

This is my new font :)
Attachments
screenshot7.PNG
screenshot7.PNG (11.21 KiB) Viewed 6401 times
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Re: Problems with personal font map

Post by Karlosoft »

Why? what characters are difficult to read?
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Re: Problems with personal font map

Post by Karlosoft »

Is this better?
Attachments
screenshot8.PNG
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Problems with personal font map

Post by Combuster »

Adding to that, the L character is now identical to the 1 character
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Firestryke31
Member
Member
Posts: 550
Joined: Sat Nov 29, 2008 1:07 pm
Location: Throw a dart at central Texas
Contact:

Re: Problems with personal font map

Post by Firestryke31 »

A quick tip: Choose some brighter colors. The first pink part is good, but the purple font demo is too hard for me to see. I'd suggest something closer to #7010F0. Also, the dark pink number suffixes are a bit hard to read.

The X and Y characters are a bit top-heavy, as well as the P and R. Move the intersections down just a bit. You also might try a little more padding between characters (i.e. keep the cells the same width, but make the characters in the cells 1 pixel thinner). Finally, the entire lowercase f might need to be shifted one pixel up. I may also suggest adding one pixel to the height of most of the lowercase letters.

If we're talking about custom fonts, here's my own font I've developed over the past couple of years. This particular version is a 2 bit, 8pt, outlined version of my font, "Fawkes UI." It was manualy anti-aliased. It's supposed to be a proportionally-spaced font where the outline overlaps.
l
Fawkes UI, 8pt, Outlined, 2 bit.
Fawkes UI, 8pt, Outlined, 2 bit.
FawkesUI-8pt-2bit.gif (968 Bytes) Viewed 5899 times
I originally designed it to caption a little GIF movie I was going to make (hence the useless musical note). It was created pixel-by-pixel in an editor called Usenti (which includes a very useful Export function that includes a C array or a GAS syntax ASM array which can be converted to NASM syntax with a couple of Finds/Replaces, as well as complete control of the palette). I have no idea how many people here know about it.
Owner of Fawkes Software.
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
Post Reply