2024-07-16 01:37 AM - edited 2024-07-16 01:39 AM
Hello!
I set the wildcard range to 0x0000-0xFFFF to use all characters contained in the "Pretendard JP" font.
However, I get an error when generating code with TouchGFX Designer.
Of course, specifying small wildcard ranges work, but I also want to support multiple languages with as few language packs as possible.
Is there another way to include all characters in one resource without specifying wildcards?
I also tried entering about 20k Unicodes into the Wildcard Characters field, but the error was the same.
== Error message ==
ERROR: Illegal sizeInKerningTable for glyph 0x002C (439 not in range [0..255])
ERROR: While generating font from assets/fonts/PretendardJP-Bold.otf
An error occurred during text conversion
Cleaning generated files from generated/texts and generated/fonts.
Generating generated/fonts/include/fonts/GeneratedFont.hpp
Generating generated/fonts/src/GeneratedFont.cpp
Generating generated/fonts/include/fonts/UnmappedDataFont.hpp
Generating generated/fonts/src/UnmappedDataFont.cpp
Generating generated/fonts/include/fonts/CachedFont.hpp
Generating generated/fonts/src/CachedFont.cpp
Generating generated/fonts/include/fonts/FontCache.hpp
Generating generated/fonts/src/FontCache.cpp
Generating generated/fonts/src/ApplicationFontProvider.cpp
Generating generated/fonts/include/fonts/ApplicationFontProvider.hpp
Generating generated/texts/include/texts/TextKeysAndLanguages.hpp
Generating generated/texts/include/texts/TypedTextDatabase.hpp
Generating generated/texts/src/TypedTextDatabase.cpp
Generating generated/texts/src/Texts.cpp
Generating generated/texts/src/LanguageGb.cpp
Command: "../Middlewares/ST/touchgfx/framework/tools/fontconvert/build/win/fontconvert.out" -f "assets/fonts/PretendardJP-Bold.otf" -i 13 -w 16 -r 16 -o "generated/fonts" -c "generated/fonts/UnicodeListPretendardJP_Bold_otf_16_4.txt" -n "PretendardJP_Bold_otf" -b 4 -v 0 -d 63 -e 0 -ct yes -bf no -ff 0 -ffu 0 -ba
Warning: Skipping font kerning information due to space constraint
WARNING - Char 0x1 is used but does not exist in the font!
WARNING - A total of 43561 Unicode characters did not exist in the font!
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_0.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_1.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_3.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_4.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_5.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_6.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_7.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_9.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_10.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_11.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_12.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_13.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_14.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_15.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_16.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_17.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_18.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_19.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_20.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_21.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_22.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_23.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_24.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_25.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_26.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_28.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_29.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_30.cpp
Generating generated/fonts/src/Font_PretendardJP_Bold_otf_16_4bpp_31.cpp
make[1]: *** [texts] Error 1
generated/simulator/gcc/Makefile:225: recipe for target 'texts' failed
make: *** [assets] Error 2
simulator/gcc/Makefile:32: recipe for target 'assets' failed
Failed
Thanks!
Solved! Go to Solution.
2024-07-17 07:33 AM - edited 2024-07-17 08:37 AM
Hi @potentializ
I downloaded the font
https://fontmeme.com/fonts/pretendard-font/
and got an error as well:
And fontconvert.out ran in CLI
The tool is here
c:\TouchGFX\4.23.2\touchgfx\framework\tools\fontconvert\build\win\fontconvert.out
@GaetanGodartThis error might be something fontconverter Dev team might want to look at. The font does not seem to be 'corrupt' as I was able to open it in FontForge application.
2024-07-16 03:16 AM
Hello @potentializ ,
The Unicode only support 255 characters. This is your first line of error :
" ERROR: Illegal sizeInKerningTable for glyph 0x002C (439 not in range [0..255])"
So the max you can put by default is 0x00-0xFF.
And a warning : "WARNING - A total of 43561 Unicode characters did not exist in the font!"
Standard fonts don't have 65535 (0xFFFF) characters.
If you want to add languages, check this tutorial : Tutorial 6: Using TextAreas ! :smiling_face_with_smiling_eyes:
If this comment solves your problem, I invite you to select it as "best answer".
Regards,
2024-07-16 09:46 AM
Hi @potentializ
My project runs Okay. Only get warning:
WARNING - Char 0x1 is used but does not exist in the font!
WARNING - A total of 64630 Unicode characters did not exist in the font!
Generating generated/fonts/src/Table_verdana_20_4bpp.cpp
It seems there is some error with a specific font internaly in you project, maybe structure broken ?
ERROR: Illegal sizeInKerningTable for glyph 0x002C (439 not in range [0..255])
ERROR: While generating font from assets/fonts/PretendardJP-Bold.otf
An error occurred during text conversion
Maybe you could try to run Gfx font converter tool on its own from Windows CLI to learn more about the issue with specific font file. Or create a dummy project with single font causing a problem.
2024-07-16 05:04 PM - edited 2024-07-16 05:11 PM
Thank you for the reply.
I don't understand what you mean by Unicode only supporting 255 bytes.
Langues and Character | TouchGFX
"Unicodes from 0x0000 to 0xFFFF are supported." <- The TouchGFX guide says it and I know the same.
And I didn't mentioned Standard fonts but "Pretendard JP".
This problem occurs when allocating 0x0000-0xFFFF to the wildcard range.
There was no problem using 2-byte characters in a configuration below.
{0x0020-0x007E,0x1100-0x11FF,0x2000-0x2FFF,0x3000-0x30FF,0x3130-0x318F,0x4E00-0x9FFF,0xA960-0xA97F,0xAC00-0xD7AF,0xD7B0-0xD7FF,0xFF00-0xFFFF}
Looking at ferro's answer below, there is no problem specifying 0x0000-0xFFFF in verdana font(Regardless of whether Unicode Glyphs are supported or not).
Thanks
2024-07-16 05:11 PM
Hi @ferro
Thanks for the good information. I will try other fonts.
If the font is the problem, I may need to consider another.
Thanks!
2024-07-17 07:33 AM - edited 2024-07-17 08:37 AM
Hi @potentializ
I downloaded the font
https://fontmeme.com/fonts/pretendard-font/
and got an error as well:
And fontconvert.out ran in CLI
The tool is here
c:\TouchGFX\4.23.2\touchgfx\framework\tools\fontconvert\build\win\fontconvert.out
@GaetanGodartThis error might be something fontconverter Dev team might want to look at. The font does not seem to be 'corrupt' as I was able to open it in FontForge application.
2024-07-17 05:12 PM - edited 2024-07-17 08:03 PM
Hi, @ferro
Thank you for sharing!
I also had no problems using the Pretendard family fonts with the FontForge application.
I think this happens when the kerning information for a specific character exceeds 255.
As I reduced the number of characters little by little, the error disappeared.
uint8_t | kerningTableSize |
https://support.touchgfx.com/docs/api/classes/structtouchgfx_1_1_glyph_node#kerningtablesize
I tested fonts with TouchGFX 4.24.0 and this happens in the most recent version.
If correct that it has something to do with kerningTableSize, please consider changing the type of this variable to uint16_t or uint32_t.
Thanks!
2024-07-18 02:38 AM
Hello,
@potentializ Sorry, I have read your message quite fast and I used to 255 characters Unicode fonts.
I have downloaded the font and I was able to replicate the problem but only when using the .otf files. When using the .ttf file, it worked fine with wildcard range of 0x0000-0xffff.
Maybe this could be an easy fix to your problem?
It should be possible to modify the type of "kerningTableSize" as it is in Font.hpp which is openly available.
All we have to do is to recompile the file after modifying the type.
I have tried moving / copying the Font.hpp file with the right type in "projectName\TouchGFX\gui\include\gui\screen1_screen" to force it to recompile but it did not work somehow.
@ferro I have created a ticket to change the type of kerningTableSize.
Regards,
2024-07-18 05:48 PM - edited 2024-07-18 05:49 PM
Hi @GaetanGodart,
I think it is necessary to check whether there is a 255 limit not only on the touchgfx library but also on FontConverter's kerning table generation function.
Because this error happens when generating the code by TouchGFX designer.
Many thanks!
2024-07-19 01:28 AM
Hello @potentializ ,
A colleague have checked how the table is filled and it loops from the size of the table to 0. The variable used is a uint16_t so changing the kerning table type to a uint16_t looks like it would work.
Either way, if we decide to increase the table size, we will make sure it works.
I don't know if that answers your question.
Regards,