Tutorial Mi Band 4/5 | How to modify Font file

MagicalUnicorn

Moderator
Staff member
Moderator
Developer
Joined
Jul 4, 2018
Messages
4,714
Likes
4,122
Points
248
#22
I can't understand can we add emojis
This thread explain how to modify the font file, no how to add emoticons ^^.

There is already a font file with lot of emoticons (included in .zip from this thread), so you can edit it if you want :).
 

NiTroGen

Active member
Joined
Jun 29, 2019
Messages
91
Likes
105
Points
43
#23
Can anyone recommend an easy tool for converting a truetype font to multiple 1-bit bmp files?

I saw the one previously posted by dnee (nice job, by the way), but you need to install apache/php server for using it!
 
Joined
Nov 1, 2019
Messages
2
Likes
1
Points
3
#29
I was dreaming with colored emojis, but it's 1bit bmp... damn it
I would like to work on this as well. I am new to hacking on the Mi Band but if anyone has idea for how to implement color emojis let me know and I can look into it. I imagine it would require changes to the FW code that renders the text so that it would point to a different set of image files for rendering emoji.

The screen is so nice, seems like a waste to not have colorful emoji!
 

Miss_Danielle

Active member
Joined
Jun 30, 2019
Messages
242
Likes
69
Points
38
#30
I would like to work on this as well. I am new to hacking on the Mi Band but if anyone has idea for how to implement color emojis let me know and I can look into it. I imagine it would require changes to the FW code that renders the text so that it would point to a different set of image files for rendering emoji.

The screen is so nice, seems like a waste to not have colorful emoji!
Easy one you can't.......
 

Miss_Danielle

Active member
Joined
Jun 30, 2019
Messages
242
Likes
69
Points
38
#32
Challenge accepted :D I wonder if anyone has thought about doing an open-source firmware replacement?

It seems like the development kits for the chip on the Mi Band are readily available. Maybe I’ll get started on something...
Good luck, you're going to need it...
 

AdrianoA3

New member
Joined
Oct 21, 2019
Messages
11
Likes
4
Points
3
#33
Challenge accepted :D I wonder if anyone has thought about doing an open-source firmware replacement?

It seems like the development kits for the chip on the Mi Band are readily available. Maybe I’ll get started on something...
Don't think it's possible dude since source code isn't open.
We can only decompile and recompile elements but can't change fw structure or commands.
It's sad.
 
Joined
Aug 20, 2019
Messages
27
Likes
15
Points
8
#35
Can this tool success to unpack font V2 ?

Because I got an error with

python\mb4.py unpack Mili_cinco.ft
Unpacking Mili_cinco.ft
byte04 chaohu=8_china chaohu=9_intl mib4=1 falcon=a :2
non-Latin: False
Latin: True
offset to fixed size fonts: 0x177338
num_characters: 27990
Traceback (most recent call last):
File ".\mb4.py", line 391, in <module>
unpackFont(sys.argv[2])
File ".\mb4.py", line 76, in unpackFont
int_bytes.append((char_bytes[b*3+0]<<16) + (char_bytes[b*3+1]<<8) + char_bytes[b*3+2])
IndexError: index out of range
 

MagicalUnicorn

Moderator
Staff member
Moderator
Developer
Joined
Jul 4, 2018
Messages
4,714
Likes
4,122
Points
248
#36
Can this tool success to unpack font V2 ?

Because I got an error with

python\mb4.py unpack Mili_cinco.ft
Unpacking Mili_cinco.ft
byte04 chaohu=8_china chaohu=9_intl mib4=1 falcon=a :2
non-Latin: False
Latin: True
offset to fixed size fonts: 0x177338
num_characters: 27990
Traceback (most recent call last):
File ".\mb4.py", line 391, in <module>
unpackFont(sys.argv[2])
File ".\mb4.py", line 76, in unpackFont
int_bytes.append((char_bytes[b*3+0]<<16) + (char_bytes[b*3+1]<<8) + char_bytes[b*3+2])
IndexError: index out of range
Isn't possible unpack Font v2 :/.

For more information : Post #20.
 
Joined
Sep 6, 2019
Messages
53
Likes
27
Points
18
#37
Can this tool success to unpack font V2 ?

Because I got an error with
To unpack V2 font, you can use my script... if you also need to pack the font back, then I can prepare it.

mi4font2.py

The main difference between font V1 and V2 is that the "bigger" font (24x18) is fixed-width. The second part of the font file (16x20) is the same as V1.

Anyway the character resolution is effectivelly even smaller... 18x18 and 10x20




After unpacknig there will be 2 folders: bmp (24x18) and latin (16x20).
 

Attachments

Joined
Aug 20, 2019
Messages
27
Likes
15
Points
8
#38
To unpack V2 font, you can use my script... if you also need to pack the font back, then I can prepare it.

mi4font2.py

The main difference between font V1 and V2 is that the "bigger" font (24x18) is fixed-width. The second part of the font file (16x20) is the same as V1.

Anyway the character resolution is effectivelly even smaller... 18x18 and 10x20

View attachment 8058 View attachment 8059
View attachment 8061 View attachment 8062

After unpacknig there will be 2 folders: bmp (24x18) and latin (16x20).
I will try to pack and unpack for it, Thanks for your work.
 

razz

New member
Joined
Nov 16, 2019
Messages
1
Likes
0
Points
1
#39

Thanks for the detailed instructions, now I have Russian font with different character widths.

But I can not change the length of symbol "space", it turns out very wide.
Because the symbol "space" in miband 4 is NOT the 0020 character. I want the word spacing is 4 or 5 pixels.

Any ideas?

 

Trusted Store

Members online

No members online now.

Our Telegram Channel

Which color of official strap would you like to buy for your Mi Band 3?

  • Black

    Votes: 2,156 52.8%
  • Deep Blue

    Votes: 1,198 29.3%
  • Redish Orange

    Votes: 729 17.9%

Forum statistics

Threads
2,457
Messages
40,626
Members
212,009
Latest member
User1234567890
Top