Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: Zivo on June 10, 2007, 01:14:49 PM

Title: edit bdf on Xp
Post by: Zivo on June 10, 2007, 01:14:49 PM
hello


is there any program that i can use to edit bdf fonts on XP

 ???
Title: Re: edit bdf on Xp
Post by: Chronon on June 11, 2007, 02:57:07 PM
I've heard people mention FontForge (http://fontforge.sourceforge.net/).  Although it looks like you need Cygwin installed to use it.
Title: Re: edit bdf on Xp
Post by: Zivo on June 12, 2007, 06:23:28 AM
what is cygwin and how?/where? can i find and install it

maybe there is someone that control the fontfrog real good
and can help me change a letter in a font
(i already made the bitmaps)

so i beleive that its a simple thing for one who knows the program very good

hoping for help

Zivo
Title: Re: edit bdf on Xp
Post by: GodEater on June 12, 2007, 07:34:13 AM
http://www.google.com/search?q=cygwin
Title: Re: edit bdf on Xp
Post by: Multiplex on June 12, 2007, 07:58:32 AM
*IF* it is a single character you want to change *AND* if you already have the bitmap designed *AND* you are comfortable with hexadecimal or want to learn then it is not too much trouble to edit the bdf in notepad or other text editor.

If any one of the above are not true then it isn't such a good idea ;-)

I have a busy few days comming up but if you have not resolved your problem I'll have a look (with notepad) early next week.
Title: Re: edit bdf on Xp
Post by: Lear on June 12, 2007, 09:51:00 AM
I've actually done a fair bit of BDF editing using a text editor. But I wrote a script to make things easier. It changes the hex values into strings with "." and "#" (and back), so I don't need to worry about those details. I have it in both Ruby and Python flavors, if anyone's interested.
Title: Re: edit bdf on Xp
Post by: Zivo on June 12, 2007, 10:10:29 AM
*IF* it is a single character you want to change *AND* if you already have the bitmap designed *AND* you are comfortable with hexadecimal or want to learn then it is not too much trouble to edit the bdf in notepad or other text editor.

If any one of the above are not true then it isn't such a good idea ;-)

every thing is like you said
all i need is to learn how to change it with HEX
and how to know the exact letter bitmap size

Title: Re: edit bdf on Xp
Post by: Multiplex on June 13, 2007, 04:17:50 AM
If you open the bdf file with notepad (might need something else because of unix style line endings - I use PFE, but wordpad usually works) you will see the file header then the individual characters, each character has its own header (name, width, offset, etc) then the bitmap data in hex.

Each row will have a set of hex digits 0-F, convert them to binary (use windows calculator if you want - each charactrer is 4 bits '0'=0000, '1'=0001, '2'=0010 ... 'E'=1110, 'F'=1111). Then as Lear points out the easiest way of visualising the character is to represent 1s with '#' and 0 with '.' (and use a fixed pitch font to view it);
0=....
2=..#.
5=.#.#
7=.###
5=.#.#

You might find that there is not enough data. this will be because the character header can have some offset type values to give the inter-character space, others have it explicitly.

Sorry to be a bit vague - I don't have the source here to have a real font to look at and I didn't have time last night - have a play and see if it starts to make sense.

Edit: I assume you have a build environment and the source (to get from bdf to Rockbox format) so you should look for a utility called something like bdf2bmp () - it has a mode where the whole font is dumped in .# bitmap format - that will make decoding bdf easier - I'm still not near my PC with all that stuff so I'm guessing the name
Title: Re: edit bdf on Xp
Post by: Zivo on June 13, 2007, 11:24:25 AM
first thanks to Multiplex
you really helpd me, i succeeded to change the letter
to what i wanted
but i want to learn more about all the values so ill be able to improve it
i think the other values are the key


this is a sample of some font i pick

STARTCHAR afii57672
ENCODING 1496
SWIDTH 1000 0 <------what is this & how its change the way its displayed
DWIDTH 8 0 <------what is this & how its change the way its displayed
BBX 6 9 1 0 <------what is this & how its change the way its displayed
BITMAP
D8
CC
CC
CC
CC
CC
CC
CC
78
ENDCHAR
_______________________

thanks to the helpers
Title: Re: edit bdf on Xp
Post by: Lear on June 13, 2007, 12:47:20 PM
One good source of information is the BDF specification (http://www.adobe.com/devnet/font/pdfs/5005.BDF_Spec.pdf).

Briefly, Rockbox doesn't care about SWIDTH, DWIDTH is the total with of the character, including any spacing, BBX is the "bounding box", specifying how much of BITMAP to use, basically, as well as how to offset this in the resulting glyph.

So, in this case, the character is 8 pixels wide, but only (the left) 6 pixels of the bitmap is used (and the top 9). The x offset is 1, so that the bitmap data is put in the middle of the character. The y offset is 0, which means that the used part of the bitmap starts at the text baseline (and extends upwards). This means that for letters like g and j, the y offset is usually negative.
Title: Re: edit bdf on Xp
Post by: Zivo on June 14, 2007, 03:40:55 AM
thanks a lot to all of you that helped
i succeeded to change the letter i want

i m attaching the fixed font

NIMBUS-12 (change the suffix to fnt)
fix: the letter "Yud" in hebrew
baiscally this fix is for hebrew speaking users
enjoy ;D

if you think any other letters need fixing
you can write in private


[attachment deleted by admin for age]
Title: Re: edit bdf on Xp
Post by: rasher on June 14, 2007, 04:05:44 AM
You might want to upload the fixed bdf to the tracker so it can be included in Rockbox and everyone can benefit from the fixed font (see link in the menu to the left).
Title: Re: edit bdf on Xp
Post by: Llorean on June 14, 2007, 04:10:44 AM
And also to not be in violation of the forum posting restrictions: You should ask why the extension restriction exists before willfully violating it.
Title: Re: edit bdf on Xp
Post by: Zivo on June 14, 2007, 06:17:33 AM
Sorry for the violating, wont happen again

Can you please give me a direct link to where i should upload it
Because i am not sure


thanks
Title: Re: edit bdf on Xp
Post by: Llorean on June 14, 2007, 06:19:14 AM
The patch tracker, since it's a fix to an official font.
Title: Re: edit bdf on Xp
Post by: Zivo on June 14, 2007, 09:13:38 AM
Do you mean opening a new task
and there to upload the BDF file
Title: Re: edit bdf on Xp
Post by: Multiplex on June 15, 2007, 04:45:45 AM
Good Stuff - glad you managed to do this, it's good to put something back to the Rockbox community isn't it?

First you need to make a patch
http://www.rockbox.org/twiki/bin/view/Main/WorkingWithPatches

Then load it to the patch tracker with a description - you have to register seperately for that.