achimdoebler / UGUI

µGUI - Open Source GUI module for embedded systems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

https://github.com/deividAlfa/UGUI adds UTF-8 support, new font structure to allow font stripping, ranges...

deividAlfa opened this issue · comments

Given this project seems no longer alive, I'm providing the fork for anyone who might be searching new enhancements...
https://github.com/deividAlfa/UGUI

Nice, UTF-8 support is great!

I also have a fork, https://github.com/0x3333/UGUI, with those features:

  • Fonts, Components, Colors have been externalized to a separated file
  • Pseudo Theme created(See ugui_theme.h)
  • Added flush function. In case the display driver uses Framebuffer, this function will be called after UG_Update is called
  • Prefixed all defines with UGUI_
  • Touch support is optional using UGUI_USE_TOUCH define
  • Added UGUI_USE_COLOR_BW for monochromatic displays, also added theme support
  • Added X11 Simulator. Based on the fork https://github.com/MarioIvancic/UGUI. Tested only on MacOS 10.14.
  • Added Simulation config
  • Added Simulation example
  • Added Function to convert from RGB565 to RGB888
  • Added a check to UG_DrawRoundFrame, draw a rect frame in case radius 0
  • Added ProgressBar object
  • Console support is optional using UGUI_USE_CONSOLE define.
  • Created a UG_DEVICE struct to hold device information.

Nice!
Will have a look, shouldn't be too hard to add the code.
This library deserves more attention!

I've checking your code. The externalization actually complicates things.
Instead of simply including ugui.h, you have to include:

#include "ugui.h"
#include "ugui_button.h"
#include "ugui_checkbox.h"
#include "ugui_textbox.h"
#include "ugui_image.h"
#include "ugui_progress.h"

Which is a poor implementation. it should be simpler.
Giving some issues due that...

Sure, I had this in my backlog for a while. Thanks

I fixed it in a simple way: Adding the includes after the defines and typedefs
ugui.h:455
#define UG_STATUS_WAIT_FOR_UPDATE (1<<0)
#include "ugui_button.h"
#include "ugui_checkbox.h"
#include "ugui_fonts_data.h"
#include "ugui_image.h"
#include "ugui_progress.h"
#include "ugui_textbox.h"

This works perfectly, no more messsing with includes. I'm almost done at merging my code.

Finished!
I have some simple demos using current uGUI version here:
https://github.com/deividAlfa/ST7789-STM32-uGUI

Also check my ttf2ugui fork to generate fonts using the new structure.
I ported the old fonts, adding a bit to disable UTF8 when these fonts are selected, as they use codepage 850 encoding.

It is missing the simulator files, like ugui_sim_x11.c.

Yep, ugui_sim.c was left when uploading the files. Fixed

Me again, missing the X11 sim, ugui_sim_x11.c. Super helpful to debug on Mac or Linux the output(I used it to print my screenshots, see README.md in my fork).

Yeah, I noticed that file too, I was going to update the comment but I was late

hey,dude,you still there??I tried your enhancement.A very good job.
I've noticed an issue with your program when handling CJK characters whose encoding falls above 0x8000; they fail to display. The problem doesn't seem to lie with the font array itself, but rather with the positioning logic in _UG_GetCharData, specifically the line curr_offset & 0x8000.

OK,let my adjust my words:when the font array contains the characters over 0x8000,device will display nothing including any asciis or latin or CJK.
when regain the font array without 0x8000+,everything goes fine.

Hope there will be a fix

Yes, it only works with Unicode below 0x8000.
I just enabled issues in the repo.

I might extend the range to full Unicode (0-65535).

Dude,many many thanks