Hi guys,
What do you think about using Canon's own font in ML menu?
I like it much better than the fixed width fonts.
I've just found the character bitmaps and the parameters in the 7D 1.1.0 dump.
The character codes (UTF-8) have listed in 32 bit format.
ROM:FF617540: 48 43 61 6e 6f 6e 47 6f 74 68 69 63 00 2f 2f 2f HCanonGothic.///
ROM:FF617550: 20 00 00 00 21 00 00 00 22 00 00 00 23 00 00 00 ...!..."...#...
...
The character data starts right after the character codes at 0xFF61C4A8 .
ROM:FF61C4A0: c6 bb 06 00 98 bc 06 00|01 00 01 00 0c 00 00 00 ................
...
The structure of the font data: lW, hW, lH, hH, lCW, hCW, lXO, hXO, lYO, hYO, DT[], PD[]
lW,hW: width of the bitmap (low, high)
lH,hH: height of the bitmap
lCW,hCW: the actual character width
lXO,hXO: X offset of the character bitmap data
lYO,hYO: Y offset of the character bitmap data
DT[]: data bytes of the character bitmap, size: H*round up(W / 8)
PD[]: padding bytes: 0-4(?) zero byte;
We can find the existing routines in the Canon firmware or we can write our own.
How do you like it?
550D 108: 0xFF661A94, 0xFF666464
50D 107: 0xFF05E1C8 , 0xFF063000
Just grabbed the first hundreds of chars from the dump:
There is another font:
ROM:FF688228: 43 61 6e 6f 6e 4d 6f 6e 6f 73 70 61 63 65 00 00 CanonMonospace..
ROM:FF688238: 20 00 00 00 21 00 00 00 22 00 00 00 23 00 00 00 ...!..."...#...
...
We can play with this too...
Can you share the source code for decoding font data?
On Tue, Mar 15, 2011 at 9:32 AM, Pelican <p...@pel.hu> wrote:
> The full font image (800x4249) is here: http://pel.hu/down/HCanonGothic.png
>
>
> --
> http://magiclantern.wikia.com/
>
> To post to this group, send email to ml-d...@googlegroups.com
> To unsubscribe from this group, send email to ml-devel+u...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/ml-devel?hl=en
Wow! What a great find! We should dump the bigtext generated fonts
and switch over to the much nicer builtin ones. It will both save
on RAM usage and make ML look better integrated.
> [...]
> ROM:FF617540: 48 43 61 6e 6f 6e 47 6f 74 68 69 63 00 2f 2f 2f
> HCanonGothic.///
Those looks like it should be easy to locate in other dumps.
It is nice of them to have such clear labels.
--
Trammell
Good catch Pel !
* in 550d 1.0.9 :
Indy
--
OK, thanks. I've found the 7D also has the same addresses in all version.
That looks great. I'm excited about modifying bmp_printf() to use
the new fonts this weekend.
> It seems Canon doesn't use this font for UI, because their fonts have smooth
> edges and this one has not. Probably it's an emergency font (used before the
> SVG graphics engine is fully initialized).
I'm thinking that we will probably still want to include our smallest bitmap
font so that when starting on a new platform (T3i, anyone?) it is possible to
have something to write to the screen before a full ROM dump is created.
--
Trammell
I don't think so. Maybe the software antialiasing on the fly...
From: ml-d...@googlegroups.com
[mailto:ml-d...@googlegroups.com] On Behalf Of Alex
Sent: Tuesday, March 15, 2011 6:43 PM
To: ml-d...@googlegroups.com
Subject: Re: [ML] Re: Using Canon's Built-in Proportional Font
First "hello world" message.
--
Yes, we should keep the small font. Not sure about the medium one
(we'll decide after we see the results from AJ's resizing trick).
AJ,
It may work. But Canon also uses larger smooth fonts, so I'm sure they
don't use this method.
Piers,
Yes, the camera uses SVG, or a subset / modified version of it (see
libcsvg directory). It may be possible that SVG could be already
parsed and stored in the ROM in a binary representation (or maybe it's
just zipped somewhere).
FF4E0F54: 'glyph-name'
FF4E0F60: 'glyph-orientation-horizontal'
FF4E0F80: 'glyph-orientation-vertical'
FF4E0F9C: 'glyphRef'
FF4E10CC: 'http://www.w3.org/1999/xlink:title'
and a ton of other similar strings...
https://bitbucket.org/hudson/magic-lantern/changeset/cfba492ea84d
-----Original Message-----
From: ml-d...@googlegroups.com [mailto:ml-d...@googlegroups.com] On Behalf
Of Alex
-----Original Message-----
From: ml-d...@googlegroups.com [mailto:ml-d...@googlegroups.com] On Behalf
Of Alex
Sent: Thursday, March 17, 2011 10:32 AM
To: ml-d...@googlegroups.com
Subject: Re: RE: [ML] Re: Using Canon's Built-in Proportional Font
Yes. The large font in ML takes a bit more than 10k.
> Does it shrink ML code?Yes. The large font in ML takes a bit more than 10k
On Thu, Mar 17, 2011 at 11:45 PM, Piers <pie...@gmail.com> wrote:
> yes, should be >>1 for a 2-bit buffer, you're right ...
>
Those sound reasonable places to start looking for Canon's drawing
routines. Until then, I've modified bmp_puts() to use the Canon fonts
and also updated the mkfont tool to output font-small.c in Canon
format:
https://bitbucket.org/hudson/magic-lantern/changeset/decc5ed54c93
The attached 5Dm2 2.0.8 firmware will demo the Canon fonts for the menu,
although there are some size issues that need to be worked out.
The font structures all start with "FNT\0", which makes them easy
to find in the ROM dumps. It looks like the only two are HCanonGothic
and CanonMonoSpace, but there are a few versions of each. The font
structure is defined as:
struct font
{
uint32_t magic; // 0x464e5400 == "FNT\0"
uint16_t off_0x4; // 0xffe2 in most of them?
uint16_t font_width; // off_0x6;
uint32_t charmap_offset; // off_0x8, typicaly 0x24
uint32_t charmap_size; // off_0xc
uint32_t bitmap_size; // off_0x10
const char name[16];
};
On the 5D there are the following fonts added to the stubs.S file:
0xf005e99c: HCanonGothic 40 px, utf8 (0xFFD8)
0xf00cdf54: HCanonGothic 30 px, ascii only (0xFFE2)
0xf00d1110: HCanonGothic 36 px, ascii only (0xFFE2)
0xf00d585c: CanonMonoSpace 40 px, ascii only (0xFFD8)
--
Trammell
You are the one who should clear the screenshot timer (that's why it
doesn't update during last 5 seconds). Press some buttons.
Scaling in real-time doesn't give good results; terminus looks better.