open_fonts icon indicating copy to clipboard operation
open_fonts copied to clipboard

Issue with lockscreen clock.

Open wietvergiet opened this issue 3 years ago • 14 comments

If I change the font using this module on LineageOS 18.1 it will break the lockscreen clock. photo_2022-10-22_16-06-38

wietvergiet avatar Oct 22 '22 14:10 wietvergiet

Hi,

I, too, have this issue. I have tried all three of the available fonts -- OpenSans, NotoSans and RobotoFlex. I have tried with and without replacing the system emoji font and even the replacement of the monospace font. Could this issue be related to #1?

  • OpenFonts v3.0.1
  • A16s_Stratus_C5_Elite_v3.1_20220609_2004
  • Android Go v11

Please let me know if you need any other details and I would be happy to submit.

Thank you for your development work on this feature!

Screenshot_20221023-144432

i8degrees avatar Oct 23 '22 19:10 i8degrees

At the moment I was already working on giving the possibility to choose whether to replace the clock font. However on LOS19.1, this bug does not occur, I can ask you if this bug is present with all types of lockscreens or only with the one you have selected?

F3FFO avatar Oct 30 '22 19:10 F3FFO

@F3FFO Android Go does not allow me to change anything more than the very basics, such as the display text, whether or not to show notifications.

200165634-61f5eb78-1903-4aeb-8578-29f9dc362248

I can modify the date time as to being 12 hour or 24 hour elsewhere in Settings.

I did notice that you just released a new version of the module and so I have tried v3.1.0 still with no difference in the display. I was sure to say no to installing the lock screen font. Also tried saying yes to the lock screen font.

i8degrees avatar Nov 06 '22 03:11 i8degrees

@F3FFO Okay, so I decided to dive into the codebase myself and check out what all is happening during install, particularly within /system/fonts.

So, after comparing what my /system/fonts directory looks like before and after an install of Open Fonts, it appears to me that AndroidClock.ttf is the one and only font used for my OS build. What I do not understand is that no matter what option I choose during the install of Open Fonts -- yes and no to the clock font, the end result is the same glyph bug.

I have confirmed that this bug occurs even when AndroidClock.ttf is untouched. So I am really confused about all of this now! -_-

Am I missing something else here? Do you have any suggestions for me as to how I could go about debugging the resources used in my lock screen layout? I am somewhat new to Android development.

i8degrees avatar Nov 06 '22 10:11 i8degrees

I think the issue is caused by the character used for the seperator in the lockscreen clock. It probably uses a specific unicode character that only the default font seems to have. I vaguely remember running into this issue years ago as well and you could fix it by replacing what character it uses to just be a character your font supports.

wietvergiet avatar Nov 07 '22 16:11 wietvergiet

@wietvergiet Thank you for your reply. I agree with your assessment and it is the belief that I was under as well.

As soon as I can determine what font my device is using for display, I will have nailed this issue down and will be able to mark it as resolved.

I was trying to use various font identifying web services to accomplish this feat the other night without any avail. I may have found the APK file responsible for the lock screen on my phone, but until I get around to extracting it and diving into all that, I will not know more.

Cheers!

i8degrees avatar Nov 07 '22 21:11 i8degrees

@i8degrees you are right! My message was related to @wietvergiet . Unfortunately during the week I am very busy and I can't develop, so I really appreciate the exchanges you have had!

Anyway, returning to the problem, yours is a common problem, it is not the first time that I encounter it but I having mainly used LOS the problem was solved by changing the type of lockscreen. In your case, however, the problem could be another, namely the fallback font.

Let me explain: I have noticed that in certain contexts, once the module is installed, Android goes as "in protection" and, in certain contexts, uses a font different from all those that have been modified by the module; for example, the small caps font shown on google from the browser is not a problem with the font that is installed but with the fact that Android uses the font: CarroisGothicSC-Regular. Obviously if you try to change this font, Android starts using ComingSoon and so on indefinitely (obviously based on the rom and the version of Android you have the font used will change).

Basically you need to understand what triggers this mechanism and solve the problem at the base, and in my opinion solved this problem you should go back to seeing the clock correctly!

Obviously this is my hypothesis and I hope the problem is much easier to solve.

F3FFO avatar Nov 07 '22 23:11 F3FFO

@F3FFO Ah, thank you so much for all of that information. I was not aware of the majority of the issues you put forth.

I do notice that those fonts that you listed are, in fact, on my phone.

I now have a solid base of ideas to work off of and perhaps over the next few days, I will find the time to dive back into this issue.

Thank you.

i8degrees avatar Nov 08 '22 20:11 i8degrees

I'm having the same issue on my OnePlus 7t Pro running oxygen OS 12. I can give some more details if required. Please do ask is required. I hope it gets solved soon!

rohitghali avatar Nov 20 '22 23:11 rohitghali

I can help with debugging and testing possible fixes as well. I have a bunch of experience with android modding but no real programming experience unfortunately.

wietvergiet avatar Nov 21 '22 00:11 wietvergiet

At the moment I was already working on giving the possibility to choose whether to replace the clock font. However on LOS19.1, this bug does not occur, I can ask you if this bug is present with all types of lockscreens or only with the one you have selected?

I missed this message somehow. I had a look around the settings but there seems to be no options for any different lockscreens.

wietvergiet avatar Nov 21 '22 00:11 wietvergiet

I'm having the same issue on my OnePlus 7t Pro running oxygen OS 12. I can give some more details if required. Please do ask is required. I hope it gets solved soon!

In the case of the OxygenOS I have come to know of fonts that I have not managed, perhaps by managing them properly the problem could be solved. If you want to help me you can take a look:

  • in the file /system/etc/fonts.xml there are entries that contain
    • OpFont- *
    • SysSans- *
  • in the folder /system/fonts/ there are the fonts:
    • SysFont-Static-Regular.ttf
    • SysSans-En-Regular.ttf

F3FFO avatar Nov 25 '22 10:11 F3FFO

I can help with debugging and testing possible fixes as well. I have a bunch of experience with android modding but no real programming experience unfortunately.

These days I don't have much time to try new things but by decompiling the SystemUI.apk file (/system/system_ext/priv-app/), I found that in the /res/font/ folder there is a file: clock.xml where it comes defined the typeface used, perhaps by changing that value to DEFAULT or DEFAULT_BOLD (in accordance with the official documentation https://developer.android.com/reference/android/graphics/Typeface#fields) you could return to having the clock shown correctly.

However, I'm not sure if that file refers to the lockscreen clock, I haven't had the opportunity to investigate the matter yet!

To decompile the apk file from desktop I recommend using apktool: https://ibotpeaches.github.io/Apktool/ To try to make this change you have to use:

  • aapt to modify the apk file by overwriting the clock.xml file with one created earlier
  • use zipsigner to sign the modified apk

The tools can be found in another project of mine where I have already done something similar: https://github.com/Magisk-Modules-Alt-Repo/open_webview

F3FFO avatar Nov 25 '22 10:11 F3FFO

@F3FFO Next time I boot up my computer and find time to do some searching around with the latest information you have graciously provided, I will see what I can turn up and do promise to report back my findings! :-D

Thanks

i8degrees avatar Nov 27 '22 01:11 i8degrees