I am using the Fixed_10x20 font and would like to use the degree symbol. It doesn't seem to be available in the .c file that comes in the distribution. It is in the .bdf file, so I thought I would would convert the .bdf file to a .c using the online font converter. The online font converter does not work with the file and always gives a "Could not move file" error message.
So I used the mcufont.exe program in the tools directory. I converted the .bdf file to a .dat file first. Than I converted the .dat file to a .c file. Using the .c font file, I was able to use the degree symbol as expected. The problem that I have is the font characteristics for my converted .c file is not the same as the fixed_10x20.c file that comes with the distribution.
The code below is from the distribution copy of the fixed_10x20.c file:
static const struct mf_bwfont_char_range_s mf_bwfont_fixed_10x20_char_ranges[] = {
{
32, /* first char */
95, /* char count */
0, /* offset x */
0, /* offset y */
3, /* height in bytes */
17, /* height in pixels */
0, /* width */
mf_bwfont_fixed_10x20_glyph_widths_0, /* glyph widths */
mf_bwfont_fixed_10x20_glyph_offsets_0, /* glyph offsets */
mf_bwfont_fixed_10x20_glyph_data_0, /* glyph data */
},
};
const struct mf_bwfont_s mf_bwfont_fixed_10x20 = {
{
"-Misc-Fixed-Medium-R-Normal--20-200-75-75-C-100-ISO8859-15",
"fixed_10x20",
9, /* width */
17, /* height */
10, /* min x advance */
10, /* max x advance */
-1, /* baseline x */
13, /* baseline y */
20, /* line height */
3, /* flags */
63, /* fallback character */
&mf_bwfont_character_width,
&mf_bwfont_render_character,
},
4, /* version */
1, /* char range count */
mf_bwfont_fixed_10x20_char_ranges,
};
This code is from the .c file that mcufont created:
static const struct mf_bwfont_char_range_s mf_bwfont_fixed_10x20_all_char_ranges[] = {
{
0, /* first char */
127, /* char count */
0, /* offset x */
0, /* offset y */
3, /* height in bytes */
20, /* height in pixels */
10, /* width */
0, /* glyph widths */
0, /* glyph offsets */
mf_bwfont_fixed_10x20_all_glyph_data_0, /* glyph data */
},
{
160, /* first char */
96, /* char count */
0, /* offset x */
0, /* offset y */
3, /* height in bytes */
20, /* height in pixels */
10, /* width */
0, /* glyph widths */
0, /* glyph offsets */
mf_bwfont_fixed_10x20_all_glyph_data_1, /* glyph data */
},
};
const struct mf_bwfont_s mf_bwfont_fixed_10x20_all = {
{
"-Misc-Fixed-Medium-R-Normal--20-200-75-75-C-100-ISO8859-15",
"fixed_10x20_all",
10, /* width */
20, /* height */
10, /* min x advance */
10, /* max x advance */
-1, /* baseline x */
13, /* baseline y */
17, /* line height */
3, /* flags */
0, /* fallback character */
&mf_bwfont_character_width,
&mf_bwfont_render_character,
},
4, /* version */
2, /* char range count */
mf_bwfont_fixed_10x20_all_char_ranges,
};
Notice the differences in the height, width and baseline values. When I use this converted font my line spacing is different from the distributed copy of the font. I would assume that that the .bdf file converted to a .c file using mcufont should create an identical .c file with the addition of the special characters.
What could I be doing wrong?
Thanks