BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Author Topic: UNIOCDE fonts bigger than 18  (Read 6365 times)

Craggan

  • Newbie
  • *
  • Posts: 12
    • View Profile
UNIOCDE fonts bigger than 18
« on: March 16, 2024, 01:10:26 PM »

Hi there,

is there a failure in the font converter?

When i create UNICODE fonts bigger than 18 the distance between the letters are to big, please see attachment.

In this case font "Ubuntu".

Or am i wrong?
« Last Edit: March 16, 2024, 01:13:28 PM by Craggan »
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 746
    • View Profile
Re: UNIOCDE fonts bigger than 18
« Reply #1 on: March 16, 2024, 06:08:01 PM »

Hi,

Could you please advise what settings you used to convert the font in EVE Asset Builder and also which version of the EAB you use?

Best Regards, BRT Community
Logged

Craggan

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: UNIOCDE fonts bigger than 18
« Reply #2 on: March 17, 2024, 05:24:41 PM »


EAB 2.10.2
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
Re: UNIOCDE fonts bigger than 18
« Reply #3 on: March 19, 2024, 12:24:27 PM »

As I just got a new company style guide to comply with I went thru a number of different fonts and font-sizes today using EAB 2.10.2.
I am using the fourth flash image now with only Roboto font in sizes 12/14/16/18/20/22/24/26/28.
I also tried Ubunto-Light, a couple of other fonts and using odd sizes 19/21/23/25/27.

And well, it just works in all sizes.
My input character file is this:
" !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~©«°±²³´µ¹»¼½¾ÄÖ×Üßäëö÷øü"
So only "Basic Latin" and a selection from "Latin-1 Supplement".


I encountered three "issues".
First one was that EAB 2.10.2 is using the correct size for the .xfont files now and adds a meta-file .pad in between the entries.
And at first I just copied the size for the .xfont file from the .map and used it with CMD_FLASHREAD - but the number of bytes read must be a multiple of 4.
In earlier versions of EAB there was no .pad and the .xfont ended up beeing shown with a size of 320 bytes.

My second issue was that I tried to use bitmap handle 15 for one of the fonts, just counting up from 12, which does not work by default as this is the scratch bitmap handle.

And my third issue was that the bandwith of the external flash is of course limited, even more so with random access, so I can not use the six fonts I set up for display from the external flash at the same time.
Well, I could use the font-cache for at least the largest font and copy all 9 fonts to RAM_G as the flash image is only 275kiB (copying the .glyph to RAM-G also requires to adapt the .xfont file to use the new memory location).
But this is not a real project anyways.

Edit: I tried a couple of things including over-clocking (looked stable at 96MHz but I went back to 72MHz)
I set REG_AH_HCYCLE_MAX to 4000 and now I have the line "Quick fox at 120°C" printed out in six different sizes: 18/20/22/24/26/28 and reading REG_FRAMES once per second and calculating the delta to the previous value shows rather stable 58 to 59.
So that really makes the last point a non-issue as well, even without copying any of the .glyph files to RAM_G.



In regards of EAB 2.10.2 I found a couple of things a bit odd.
- why is "Reserve Space" not set as default?
- why is "L8" selected by default for "Extended Format"?
- why is the ASTC set to 4x4 by default instead of a more reasonable 8x8?
- why is this SampleApp generated every single time? can we please have a switch for that which defaults to off?
« Last Edit: March 19, 2024, 09:31:32 PM by Rudolph »
Logged

Craggan

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: UNIOCDE fonts bigger than 18
« Reply #4 on: March 20, 2024, 03:24:00 PM »

Meanwhile i changed also to the same fontnumber 12 and string, as you did.



    while( EVE_init() != E_OK );

    EVE_init_flash();

    EVE_cmd_flashread( EVE_RAM_G,  113536, 312 ) ; // Ubuntu 19, multiple of 4
   
    EVE_cmd_dl( CMD_DLSTART );
    EVE_cmd_dl(CLEAR_COLOR_RGB(51,51,51));
    EVE_cmd_dl( CLEAR( 1, 1, 1 ) );
    EVE_cmd_dl( VERTEX_FORMAT(0) );
    EVE_cmd_setfont2( 12, EVE_RAM_G,       0 );
    EVE_cmd_dl( END() );
    EVE_cmd_dl( DISPLAY() );
    EVE_cmd_dl( CMD_SWAP );
    EVE_execute_cmd();
   
   
    EVE_cmd_dl( CMD_DLSTART );
    EVE_cmd_dl(CLEAR_COLOR_RGB(0,0,18));
    EVE_cmd_dl( CLEAR( 1, 1, 1 ) );

    EVE_cmd_text( 10,  10, 12, 0, "Quick fox at 120°C ");

    EVE_cmd_dl( END() );
    EVE_cmd_dl( DISPLAY() );
    EVE_cmd_dl( CMD_SWAP );
    EVE_execute_cmd();   
   
    //trap here
    while(1) {}



I'm using a Riverdi 7" 1024x600 display.

The display starts, Flash is loaded, taken address also from map-file, don't know what going on?

Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 746
    • View Profile
Re: UNIOCDE fonts bigger than 18
« Reply #5 on: March 21, 2024, 07:56:19 AM »

Hi,
Thanks for your update, we are doing some testing and are discussing with our R&D team to understand this issue, and will update very soon,

Thanks Rudolph, we have also passed those to our R&D team, they seem like some good suggestions:

In regards of EAB 2.10.2 I found a couple of things a bit odd.
- why is "Reserve Space" not set as default?
- why is "L8" selected by default for "Extended Format"?
- why is the ASTC set to 4x4 by default instead of a more reasonable 8x8?
- why is this SampleApp generated every single time? can we please have a switch for that which defaults to off?

Best Regards, BRT Community
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
Re: UNIOCDE fonts bigger than 18
« Reply #6 on: March 21, 2024, 01:31:30 PM »

Ok, I went back and converted Ubuntu-Light.ttf with exactly your settings.
The output is the same, only my "Font Preview" is showing the font at perhaps half the size than in your screen shot.
My .map file has the .xfont at 113536.

I almost copied your code:

Code: [Select]
    if (E_OK == EVE_init_flash())
    {
        EVE_cmd_flashread(MEM_FONT1, 113536, (309|3)+1); /* copy .xfont from FLASH to RAM_G, offset and length are from the .map file */
    }

    EVE_cmd_dl( CMD_DLSTART );
    EVE_cmd_dl(CLEAR_COLOR_RGB(51,51,51));
    EVE_cmd_dl( CLEAR( 1, 1, 1 ) );
    EVE_cmd_dl( VERTEX_FORMAT(0) );
    EVE_cmd_setfont2( 12, MEM_FONT1,       0 );
    EVE_cmd_dl( DL_END ); // does not do anything here
    EVE_cmd_dl( DL_DISPLAY );
    EVE_cmd_dl( CMD_SWAP );
    EVE_execute_cmd();

Code: [Select]
    EVE_cmd_dl( CMD_DLSTART );
    EVE_cmd_dl(CLEAR_COLOR_RGB(0,0,18));
    EVE_cmd_dl( CLEAR( 1, 1, 1 ) );
    EVE_cmd_text( 10,  10, 12, 0, "Quick fox at 120°C ");
    EVE_cmd_dl( DL_END ); // does not do anything here
    EVE_cmd_dl( DL_DISPLAY );
    EVE_cmd_dl( CMD_SWAP );
    EVE_execute_cmd();

And it still works, I get the line displayed at the top of the screen.

I am re-installing EAB now, I may have changed something before.
I redid it all, looks like I either modified EAB or previously did not install from scratch, or both.
The new .glyph file is different for some reason.
But the result is still the same, the line is printed just fine.
« Last Edit: March 21, 2024, 01:55:36 PM by Rudolph »
Logged

Craggan

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: UNIOCDE fonts bigger than 18
« Reply #7 on: March 23, 2024, 07:09:10 PM »

After remembering to a layout width of "96" ??? and Rudolph's wish to use 8x8 as a standard
i tried also 8x8 compression instead of 4x4.

Now the layout width is "64" and wonder it works. Also the file size of the glyph is about the half.

Further tries with a font size of 28, 29 and 32 failed again (Ubuntu Light, 8x8).

A font size of 31 with 12x12 workes fine.

A font size of 41 with 12x12 doesn't work.

A font size of 37 with 12x12 workes fine.


It seems the result is depending on a relationship of the font size to compression ratio.
As Rudolph's and my experience differ slighty, i asume that we have possible different sources of the ttf-files.

Some relations fit, some not.


I also would suggest to add one point more to Rudolph's wish list:

Please store "automatically" all parameters entered on closing EAB and restore them while starting again.
Especially the last used directories for opening and creating.
« Last Edit: March 24, 2024, 08:40:19 AM by Craggan »
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
Re: UNIOCDE fonts bigger than 18
« Reply #8 on: March 25, 2024, 03:12:13 PM »

I did compress Ubuntu-Light.ttf with 4x4, although this makes the binary pretty huge without benefit.
I also saw this huge "layout width" but it just worked for me.

Very strange.
Logged

Craggan

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: UNIOCDE fonts bigger than 18
« Reply #9 on: March 26, 2024, 09:14:58 AM »

Meanwhile i don't know, where to seek else. I just can make assumptions.

My display is about 1 year old, maybe i have an older silicon of the BT817Q?

Rudolph, could you make your startup sequence public( initialization parameters )?

BRT Community, do you have any advice meanwhile?

Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
Re: UNIOCDE fonts bigger than 18
« Reply #10 on: March 28, 2024, 04:26:19 PM »

Hmm?
Check my footer, it is *all* public.  :)
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 746
    • View Profile
Re: UNIOCDE fonts bigger than 18
« Reply #11 on: March 29, 2024, 04:29:25 PM »

Hi Craggan,

We have been doing some testing and we were able to see the issue on some compiler platforms, where it seemed to be caused by the encoding.

For example, we can see the issue on Visual Studio but the same string and the same code on various MCUs is fine, and so it seems to be data type related. If the wrong data at byte level is passed into the EVE Text command by the IDE (which may not be apparent from the top-level code that you run) then you could see issues like this. This may explain why Rudolph also did not see the issue,

A second factor is to ensure that you convert all of the characters needed. If converting in higher quality and larger sizes of font, make sure that your converted data all fits into RAM_G depending on data size and address where you load it etc. With this you may see the wrong character in the string (as opposed to the 'tab' effect which seems caused by the compiler handling of unicode as above)

Best Regards, BRT Community
Logged

Craggan

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: UNIOCDE fonts bigger than 18
« Reply #12 on: March 31, 2024, 05:51:38 PM »

I work currently with the XC16 Compiler from MicroChip on a dsPIC33 within MPLAB X IDE 5.5.

After Rudolph's comment to check the editor for UTF8-mode, i changed my settings from LatinX to UTF8.

But nevertheless, if i don't use encoding like this here, i will have no success:
EVE_cmd_text( 10, 10, 1, 0, "\n\u00A9\u00BA\u00C4\u00D6\u00DC\u00E4\u00F6\u00FC\n   The quick brown fox");

I also opened the related file with another editor and saved it there in UTF8 mode.



Thanks for your assistance!
« Last Edit: March 31, 2024, 06:31:43 PM by Craggan »
Logged