Start a new topic

Font size between 16 and 24

Is there any chance to have font sizes between 16 and 24 in the font generator?

Or we could set *any* custom size in a text box instead of the combo box?


10 people like this idea

I second this.  The jump between 16 and 24 is too large.

So... in the last few days I started to investigate if I could make my own font generator. I made some progress and now I know why there is no font size between 16 and 24 (actually the font size in pixels must be multiples of 8 - even though may overcome this issue with blank areas).
Anyway here are some shots I made after conversion of some true type fonts:

The first one is about conversion "strength" - how dark/light the original font gets converted... On the picture you can see the same "Arial" font converted with strength set to 50/150/210/254.

 On the second picture you can see "Times New Roman" font converted at different sizes (as I remember 10/12/13 - but not too sure about it anymore).

And the final pic is how it looks in the fonts list of the Nextion Editor... as you can see the font sizes differ in width, but the height go up in multiples of 8.

1 person likes this
I had some time to experiment with the fonts of Nextion Editor. And I have sad news...
My idea was to create a special font to overcome the fixed with font-type. Basically I wanted to convert text to a special font so whenever I type "ABCDE..." into a text component I could get my desired (non-fixed-width-font) text back.
Here is how it looks in the preview area:

Looks neat isn't it? Now how it looks in a text component:


As you can see Nextion Editor adds an extra *space* between every letter :(

 

Okay. Looks alike I was able to solve the issue. I can convert any text into a font:

The upper line is the font I made, the lower is the font included in one of the examples (12223.zi)

Here is a screenshot of the application I made:


On the top I can select the font, the size, boldness, and set the darkness (with the slider). If any setting is changed the white/black box will show how it will look on screen. Of course the sample is _not_ fixed width as it will be in Nextion Editor.

At the lower part I can set the internal font name stored within the font file and with "singularity generator" the sample text will be converted into a special font which contains only one character (a space) which will display the full text. So load into editor, add a text component, select font number and for "txt" type in a single space (may need to adjust xcen/ycen aswell).

If anyone feels like experimenting with it I attached the program (and Delphi source code) to the message. The source code is a chaos but it's open for improvement...

zip

4 people like this
wow !
this is so cool !
thanks for your work

@Ferenc Kovacs:
would you allow ITEAD to use your source/code within a future Version of the Nextion editor ?

@ITEAD:
do you think you can use this method of font generation within a future Version of the Nextion editor ?

 

Of course ITead (or anyone else) can use it for whatever they like the program as well as the source. But... Nextion Editor is a Microsoft Visual Studio program, my font converter is a Borland Delphi one, so...
At the moment there are two problems with the text component and fonts:
- fonts are fixed width (monospaced/non-proportional), the fileformat for the fonts also for fixed width only (harder to fix)
- text component adds a *space* of few pixels after every character (easy to fix)

For now I have a new "idea" to make fonts: If you have pre-defined text you would like to display (lets say 20 or 30 labels you would like to display), the converter would include them all in one font. If you input "A" then the 1st line of text appears, for "B" the second appears and so on... If I have some time I will implement it.

 


2 people like this
For me there is a next one problem with fonts and text elements. I want to use background color for text element of height 23px. Font height 16px is too small and 24px is not possible to use, because is not displayed if height of text element is 23px. :-(

 

png
Here we go with font generator v0.2
Now you can enter multiple lines of example text in the preview area and it will get converted into the font with singularity mode. The first line will be letter "A", the second letter "B" and so on. You can align it to left/center/right as well, as the shorter text gets padded with blank space (on the right, both sides or left - depending on alignment). Don't forget to set the text component to the same width as the font to make alignment work. Hope it will work for everyone!

 

zip

2 people like this
So I understand,
that to overcome the bug with the variable width font,
you have to use your "singularity mode", right ?

If the bug with the variable width font is solved by ITEAD,
then your "singularity mode" is not needed anymore, right ?

 

Yes, basically "singularity mode" will put the whole line of text into one character. You input a single "A" but a full line will appear and it will look alike the preview in my program.
I think variable font width is _not_ on the "to do" list of ITEAD, only UTF-8 support (which is also cool). At the moment the English version of .zi (font file) only supports maximum 95 characters per file afaik (from ASCII 32 to 127).
Btw my next idea (for v0.3) is to be able to include any character in the font file. So if you don't need numbers (0..9) but you would like to include some national characters then you could swap the numbers to those, or replace capitals to cyrillic characters...

 


3 people like this
I do not want to spam the forums, but if anyone interested I made an unicode version of the program. So in the singularity mode it is possible to generate string with greek/cyrillic/chinese/japanese/etc. characters.

Should I upload this version?

 


4 people like this

>> "I think variable font width is _not_ on the "to do" list of ITEAD"


really, do you have any more information than we do? ;-)
That would be really not good...   :-(


>>"...but if anyone interested I made an unicode version of the program.

>> ...
>>  Should I upload this version?"


yes, I would definitely be interested
and I would use it as well in a project.


No, I have no "insider" information. I just think it's not a Nextion Editor issue. But from the controller side it sounds far more complicated to implement variable width fonts to me. While adding UTF-8 "support" is a lot easier, just more data in the controller.

Tomorrow I'll upload the unicode version of the program.

 


1 person likes this
Here we go... Heavily modified version to support character editing. On the lower left corner push "Edit Character Set" to edit the character table. For example if you replace "A" to "B", then whenever you push "A" in the editor, the letter "B" will appear. If I made no major mistake this will work for greek, cyrillic or any other characters. Please post your results!
To be able to compile the code, you will need Tnt Delphi Unicode Controls installed (available here) and settings will be stored in registry ("HKLM/Software/Nextion Font Generator" in older windows and "HKLM/Software/Wow6432Node/Nextion Font Generator" in 64-bit/newer windows)


 

zip

7 people like this
Login or Signup to post a comment