How do I use the 24064 fonts in the download section?

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
BoB-O
LCD?
Posts: 6
Joined: Mon Feb 09, 2004 12:43 am

How do I use the 24064 fonts in the download section?

Post by BoB-O »

Hello,

So I posted a while back about an emulator. Well, I'm writing one and it's coming along well. However, WinXP doesn't have any good fonts for this. The fonts are getting tiresome, so I wanted to add the real fonts. Unfortunately, the fonts in the download section are a big pile of files instead of the long stream that the dev docs say the 24064 wants. How can I get them in the right format?

Anyone at MO care to share some conversion code?

Thanks,
BoB
Miles
Matrix Orbital
Matrix Orbital
Posts: 1105
Joined: Mon Mar 04, 2002 4:00 pm

Post by Miles »

You can contact me at myero@matrixorbital.ca to discuss!! :D
Miles Y.
Head of Technical Support
Product Manager
Matrix Orbital
Dormouse
LCD!
Posts: 16
Joined: Sat Mar 27, 2004 5:16 pm

Post by Dormouse »

Hey guys,

I'm writing an emulator too and am about to run into the same issue. I already wrote some code to read the "folder of BMPs" format so that the emulator would have the right default font, but the next step of course is to write a client program that can send a byte-stream font to a serial port (or named pipe, in the case of my emulator) and emulator code to parse the byte stream. Can you guys cc me on the discussion or something please? If there are any shortcuts or code for doing this that'd be great. <:)

BTW I'm working in C++ on linux, so BoB it sounds like we're on different OSes but maybe there's some opportunity to share work anyway? I dunno, just a thought...
Miles
Matrix Orbital
Matrix Orbital
Posts: 1105
Joined: Mon Mar 04, 2002 4:00 pm

Post by Miles »

There really isn't an easy way to do this. As described in the manual, the byte stream will have to correspond to how we intrepret data. You cannot just convert from a bitmap to a hex file and assume it will work without the proper format.
Miles Y.
Head of Technical Support
Product Manager
Matrix Orbital
Dormouse
LCD!
Posts: 16
Joined: Sat Mar 27, 2004 5:16 pm

Post by Dormouse »

:roll: Cmon Miles did my post really sound like a newbie message asking "hey I just sent the zip file to the LCD display by uploading it using hyperterminal and zmodem and it didn't work, why not"? :P

Just kidding. Yeah I know there's a conversion required and I can write the code myself but you were so helpful before with the flow control code snippet that I thought I'd give it a shot... just in case you also happened to have some code lying around to encode/decode the font format that the manual describes. But it looks well documented and not that hard, so I'll just code it up myself. No worries, thanks anyway.
Miles
Matrix Orbital
Matrix Orbital
Posts: 1105
Joined: Mon Mar 04, 2002 4:00 pm

Post by Miles »

Sorry...unfortunately no code laying aroung for that! Can you let me know how you make out? I would be curious on how you would incorporate it!! :D
Miles Y.
Head of Technical Support
Product Manager
Matrix Orbital
Dormouse
LCD!
Posts: 16
Joined: Sat Mar 27, 2004 5:16 pm

Post by Dormouse »

Aright, so far so good. I decided to implement it first in python because it's a bit easier, and then convert to C (and anyway I eventually want an implementation in both languages, actually). I can parse a pile of BMPs just fine, but what's an ".mgf" file? Is there a spec for that somewhere? I can see that it contains the name of the font and I'm sure that some of the bytes in there are font metrics, but how about the rest of it? Is there any documentation?

(As always, thanks in advance Miles :-D)

-g.
Miles
Matrix Orbital
Matrix Orbital
Posts: 1105
Joined: Mon Mar 04, 2002 4:00 pm

Post by Miles »

The mgf file sets the outline, as follows:

Byte 0 = number of characters in the font name
bytes = Font name - Max 20 Characters

byte 21 = Height
byte 22 = Width
byte 23 = Start Character
byte 24 = End Character
Miles Y.
Head of Technical Support
Product Manager
Matrix Orbital
Post Reply