Support and General Use > Theming and Appearance Customization
edit bdf on Xp
Lear:
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.
Zivo:
--- Quote from: 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 ;-)
--- End quote ---
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
Multiplex:
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
Zivo:
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
Lear:
One good source of information is the BDF specification.
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.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version