B2G-flash-tool icon indicating copy to clipboard operation
B2G-flash-tool copied to clipboard

shallow_flash should update the ttf fonts in /system/fonts/hidden

Open jankeromnes opened this issue 9 years ago • 10 comments

(re-posted from https://bugzilla.mozilla.org/show_bug.cgi?id=1090812)

When there is a mismatch for gaia-icons.ttf between what's in a application's zip file and in /system/fonts/hidden, there is a very visible glitch when loading some apps (notably Messages and Contacts) while the font is loading from the application's zip instead of the system.

We should push the right version of the ttf file when shallow flashing too. It should be possible by unzipping one of the apps that use it and push it to the right place. Any cleaner solution is welcome :)

Likely the same for the keyboard font too.

jankeromnes avatar Nov 13 '14 17:11 jankeromnes

(Bug originally filed by @julienw and @Cwiiis, @autonome and @nth10sd were cc/ed.)

jankeromnes avatar Nov 13 '14 18:11 jankeromnes

The gaia.zip compress the files under gaia/profile/, and b2g.xxx.tar.gz compress the files under b2g/. Base on these two files, we try to do the same thing with make reset-gaia and ./flash.sh gecko.

IMO, changing the fonts under /system/fonts/ (which are parts of base image) when flashing gaia is very obscure. (AFAIK, make reset-gaia do not change the /system/fonts/. Will co-work with @cctuan to make sure the real behavior.)

I think there are two solutions we can choose:

  1. Write a new tool for updating the gaia-icons.ttf and Keyboard-Symbols.ttf. (ex: write the update_system_fonts.sh for Bug 1032874.)
  2. Modify the behavior of make reset-gaia to update fonts, add the gaia-icons.ttf and Keyboard-Symbols.ttfto gaia.zip. Then modify the tool to update fonts when flashing gaia.

askeing avatar Nov 14 '14 03:11 askeing

Update: The Keyboard-Symbols.ttf and gaia-icons.ttf in Gaia (master).

~/workspace/gaia$ find . -name "*.ttf"
./tv_apps/smart-settings/style/fonts/gaia-icons.ttf
./shared/style/keyboard_symbols/Keyboard-Symbols.ttf
./shared/elements/gaia-icons/fonts/gaia-icons.ttf
./apps/camera/bower_components/gaia-icons/fonts/gaia-icons.ttf
./apps/music/bower_components/gaia-icons/fonts/gaia-icons.ttf

askeing avatar Nov 14 '14 03:11 askeing

The source ttf is the one in shared/elements that's then copied in all applications. If the file in /system is different than the file in the apps, then Gecko loads the file from the app directory when the app requests it. Otherwise Gecko uses the cached, already loaded, file.

Same happens for Keyboard-Symbols except it's used by the Keyboard app only, as far as I understand.

julienw avatar Nov 14 '14 07:11 julienw

After have the discussion with @cctuan (:gduan), we file a bug [1] to RelEng to add these two fonts into gaia.zip. Then we can modify the tool to push these two files into /system/fonts/hidden/

[1] Bug 1098966

askeing avatar Nov 14 '14 07:11 askeing

Wondering if we could not have a more generic way to shallow flash other gonk bits :)

see my comment in the aforementioned bug

julienw avatar Nov 15 '14 13:11 julienw

Agree. Once more stuff packed, e.g. b2g-info or other tools, we'll add them to flash list.

zapion avatar Nov 16 '14 04:11 zapion

@zapion IMO, adding b2g-info into gaia.zip is a little bit weird?

askeing avatar Nov 18 '14 09:11 askeing

I mean to flash more gonk related stuff

zapion avatar Nov 18 '14 09:11 zapion

@askeing, see my comment in https://bugzilla.mozilla.org/show_bug.cgi?id=1098966#c1, it's clearer than what's been said here :) b2g-info would likely be in another place than gaia.zip for sure!

julienw avatar Nov 18 '14 10:11 julienw