ImpulseAdventure / GUIslice-Builder

Cross-platform drag & drop GUI builder for GUIslice
Other
163 stars 35 forks source link

A Bug Report! #249

Closed MRcode2102 closed 5 months ago

MRcode2102 commented 7 months ago

Hello dear Paul Are you in a good mood? I hope you have a good time. Dear Paul, After the steps we went through together in Issue #245, I came to this point where I ran into a new problem. After you have added the tft_eFEX library to the Arabic language feature of your library, if you have noticed, the tft_eFEX library displays Arabic texts (like a typist), which has created a big problem for me; Because it takes about a few seconds to display the Arabic texts and this is annoying Even I used a Popup page inside your Builder, but due to the problem of the Arabic tft_eFEX library, this problem is more visible I have attached a short video of how it works and your Builder output file I hope you can help me dear please

https://mega.nz/file/5M0kwZbY#aKu2BSzm6K1lpMtUChQ0IcdmijVDL5peJBRr35_hzUM

cooler_main_proj_v2.zip

Pconti31 commented 7 months ago

@MRcode2102 Your problem is similar to Issue 174. If you read down the comments section (its rather long) you will notice this:

[ Today I viewed some code of text drawing in GUISlice,and found the speed decrease may because load and unload smooth fonts frequently.] Hmmm, maybe so. I did a quick hack (attached in a zip file) to track current smooth font and avoid loading if already loaded. Limited testing so... Let me know if it works for you. Basically:

    #ifdef SMOOTH_FONT
      if (pFont->eFontRefType  == GSLC_FONTREF_FNAME){
        if (strcmp(m_acCurrentFont, (char*)pFont->pvFont) != 0) {
          m_disp.loadFont((const char*)pFont->pvFont);
          strcpy(m_acCurrentFont, (char*)pFont->pvFont);
        }
      } else {

As you can see from the code I added to GUIslice API it now caches one font that is stored in SPIFFS. This avoids the overhead of reading the font in on each call. However, the drawback is that this only works for ONE font. You are using two fonts stored in SPIFFS (size 16 and 20) so likely this flushes out the stored cached font and is giving you the performance hit.

Try using only the size 16 font to see if my guess is correct. Paul--

Pconti31 commented 5 months ago

@MRcode2102 Since I haven't heard back from you I'll close this issue for now. Happy to reopen if new information is provided.