jayjiang Posted November 7, 2015 Report Share Posted November 7, 2015 Hi, I upload a .ttf file which include chineese characters to online font converter, but I found it only converted a few characters(I've selected "no filter" option). Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted November 7, 2015 Report Share Posted November 7, 2015 Hello jayjian and welcome to the community!To your original post: Yes, uGFX supports chinese character rendering due to UTF-8 support. We also had at least one customer who successfully uses uGFX with chinese fonts in the past.However, none of the uGFX developers knows chinese. Therefore, it is very difficult for us to verify that it is working properly. It seems like there are different "version" of chienese, with different encodings and even different alphabets. We already fail at the stage where we need to make sure that we got a font that can be used with a random sentence that we copied off the internet somewhere.Anyway: We downloaded a random font and a random sentence and we definitely get something displayed. Whether that is proper chinese or not - we cannot say. The characters seem to match at least and provided the fact that a chinese customer used uGFX with chinese fonts without ever complaining should mean that it can uGFX can be used to handle chinese fonts.We took some free TTF chinese font, uploaded it to the font converted, disabled the filter and got all the converted glyphs back. Seems to work so far on our side.We are sorry that we can't really help you any better.~ Tectu Link to comment Share on other sites More sharing options...
jayjiang Posted November 7, 2015 Author Report Share Posted November 7, 2015 thanks for replying my question! Link to comment Share on other sites More sharing options...
jayjiang Posted November 10, 2015 Author Report Share Posted November 10, 2015 1.For this question, I download the mcufont encoder' s source file and compile it into windows execute file. I found the offset table' s size is limited by 64KB. for Chinese character,is not enough. So may be you guys can check it again.2.I wonder if I could display Chinese on widgets? 3.I want to display the file name(Chinese) which read from FatFs but FatFs will convert it from unicode to cc396(GBK). I must convert it to unicode then to UTF8 for display. So I want to know if ugfx can support UTF16(I know mcufont is support it, but ugfx' s widgets (e.g. list) is not support)? Link to comment Share on other sites More sharing options...
inmarket Posted November 10, 2015 Report Share Posted November 10, 2015 Currently any string handling in ugfx is based on 8 bit characters (ascii, utf8 etc).Changing to 16 bit characters would require appropriate source code modifications.If you would like to attempt this we would love the contribution. I would suggest a new type called "gfxchar" whose definition is based on a gfxconf.h macro eg GFX_NEED_CHAR16. Link to comment Share on other sites More sharing options...
inmarket Posted November 10, 2015 Report Share Posted November 10, 2015 I will look at the offset table problem as soon as possible. Link to comment Share on other sites More sharing options...
jayjiang Posted November 11, 2015 Author Report Share Posted November 11, 2015 I ‘ve read the source code but I think I can't finish it in a short time. I simply use _LFN_UNICODE macro to get this job done(use two funtions unicode_to_utf8(), utf8_to_unicode()). Sorry for not helping. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted November 14, 2015 Report Share Posted November 14, 2015 Not sure what you are talking about. _LFN_UNICODE is a macro that is only used by the FatFS library, it has nothing to do with µGFX text rendering at all.~ Tectu Link to comment Share on other sites More sharing options...
jayjiang Posted November 15, 2015 Author Report Share Posted November 15, 2015 if _LFN_UNICODE marco is disabled, fatfs libary will convert the LFN from unicode to codepage(eg. 936 or ascii). Codepage could not directly convert to utf8 and need convert back to unicode first. I hope you understand what I am saying because my english grammar is poor. Link to comment Share on other sites More sharing options...
mobyfab Posted November 20, 2015 Report Share Posted November 20, 2015 Hey,I don't think you need UTF-16 to make it work if you fix the offset table size limit.However in case of languages not using the latin alphabet (or very little of it), it would be more efficient as most characters will need 3 bytes in UTF-8, and only 2 in UTF-16. Link to comment Share on other sites More sharing options...
inmarket Posted November 21, 2015 Report Share Posted November 21, 2015 While encoding as UTF8 requires more storage than UTF16 for chinese, UTF-16 requires a whole new set of string handling functions which means that unless you have lots and lots of text any gains from moving to UTF-16 is lost in the extra code required.Never the less, I have just finished another little side project (re-invigorating the Arduino port of ugfx) so I will work on this next. The first problem to be solved is the offset table produced by the mcufont encoder (and its corresponding ugfx decoding code). Once that is done I will look at adding UTF-16 support and if it is simple enough I will add that too.Expect the process to take a week or so. Link to comment Share on other sites More sharing options...
jayjiang Posted November 21, 2015 Author Report Share Posted November 21, 2015 you can just find the problem in "compute_char_ranges()" function. Link to comment Share on other sites More sharing options...
jayjiang Posted November 21, 2015 Author Report Share Posted November 21, 2015 Hey,I don't think you need UTF-16 to make it work if you fix the offset table size limit.However in case of languages not using the latin alphabet (or very little of it), it would be more efficient as most characters will need 3 bytes in UTF-8, and only 2 in UTF-16.yes, for now I use a function to convert utf16 to utf8 and then display it. it works fine. Link to comment Share on other sites More sharing options...
inmarket Posted November 25, 2015 Report Share Posted November 25, 2015 Can you please attach (in a zip file) your font that causes the offset table problem. Please also provide the mcufont encoder command line flags you used.This will just make the debugging easier.Thanks. Link to comment Share on other sites More sharing options...
jayjiang Posted November 27, 2015 Author Report Share Posted November 27, 2015 mcufont_encoder.exe import_ttf simfang.ttf 16 bwmcufont_encoder.exe rlefont_export simfang16bw.datsimfang.zip Link to comment Share on other sites More sharing options...
inmarket Posted December 19, 2015 Report Share Posted December 19, 2015 Sorry for the long delay, we have been very busy.The mcufont encoder is now fixed in the ugfx repository but for the source code only. We have not rebuilt the binaries yet or updated the online version. We will do that over the next few days. Link to comment Share on other sites More sharing options...
inmarket Posted December 23, 2015 Report Share Posted December 23, 2015 The binaries in the repository have now been updated.Tectu will update the online converter in the next few days. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted December 23, 2015 Report Share Posted December 23, 2015 We updated the online font converted. Can you please give it a try and let us know whether everything works now?~ Tectu Link to comment Share on other sites More sharing options...
Asaliii Posted April 30, 2018 Report Share Posted April 30, 2018 I am trying to convert .otf format of my font using your linux mcufont converter. I am also missing some characters in different font sizes. Does anyone know what is this about? I am filtering my font so it won't be too big. I am missing some characters in size 14, but when I change my size to 16 it shows it correctly. but there is also a character that I can't show it in either sizes. Is that because I am using otf format and my command in import_ttf ? I didn't find any other solution to create my .c files. Link to comment Share on other sites More sharing options...
inmarket Posted May 1, 2018 Report Share Posted May 1, 2018 Try using a online font converter to convert from otf to ttf. Google will help you find one. The uGFX font converter may or may not work with otf files - I either case it is not on the official support list. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now