FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: Lower case letter problem  (Read 22325 times)

gokhannsahin

  • Newbie
  • *
  • Posts: 21
    • View Profile
Lower case letter problem
« on: October 24, 2017, 01:33:09 PM »

I need to use a fixed-width font in an application. I have tried to convert the Consolas font is 29 size via fnt_cvt.
I have used the code is being shown in below as ASCII table, also converting code for fnt_cvt.
Code: [Select]
" !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
fnt_cvt.exe -i consola.ttf -s 29 -u ANSI_32_126.txt -c setfont2
Everything is normal while using upper case letters/number or other special ch. in a text.
However, I have a problem while using the lower case letters.
While writing a new lower case letter, it writes over a previous one.
I guess that the lower case letters' width is zero. What should I do in order to solve this problem?
« Last Edit: October 25, 2017, 11:04:27 AM by gokhannsahin »
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 892
    • View Profile
Re: Lower case letter problem
« Reply #1 on: October 25, 2017, 01:16:53 PM »

Hi,

Could we ask you to send us the code used to load and display the resulting font along with the files you used for the font conversion (consola.ttf and the output files).

Please send them by email to support1@ftdichip.com as a zip file

Thanks,
FTDI Community
Logged

gokhannsahin

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Lower case letter problem
« Reply #2 on: October 26, 2017, 06:23:46 AM »

I have tried that condition in FTDI EVE Screen Editor too as I have mentioned above. The result is same.
I have attached the images about FTDI Eve Editor and the converted raw font data.

Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 892
    • View Profile
Re: Lower case letter problem
« Reply #3 on: October 27, 2017, 10:13:01 AM »

Hello,

We advise to use the -a switch instead as shown below.

fnt_cvt.exe -i consola.ttf -s 29 -a -c setfont2

We tested this with the same consola font file and it works well.

Best Regards,
FTDI Community
Logged

gokhannsahin

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Lower case letter problem
« Reply #4 on: October 27, 2017, 01:40:43 PM »

Thank you for your interest, but I get an error while trying the code which sent.

Code: [Select]
converting ASCII coding file ansi_32_126.txt
Traceback (most recent call last):
  File "<string>", line 427, in <module>
  File "<string>", line 135, in run
  File "C:\Users\xin.tang\Downloads\pyinstaller-develop\pyinstaller-develop\fnt_cvt\build\fnt_cvt\out00-PYZ.pyz\codecs", line 668, in read
  File "C:\Users\xin.tang\Downloads\pyinstaller-develop\pyinstaller-develop\fnt_cvt\build\fnt_cvt\out00-PYZ.pyz\codecs", line 474, in read
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)
Logged

gokhannsahin

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Lower case letter problem
« Reply #5 on: November 02, 2017, 11:53:15 AM »

After the font converter tool has been updated, the error has been fixed.
Thanks a lot.
Logged

gokhannsahin

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Lower case letter problem
« Reply #6 on: November 13, 2017, 09:24:26 AM »


Sorry, I have a question again about font using.
How can I use both image and font on the same page? I can't display the image after any font has been uploaded and set.
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 892
    • View Profile
Re: Lower case letter problem
« Reply #7 on: November 13, 2017, 12:58:10 PM »

Hello,

Yes, you can use images and fonts on the same page of your application.

Please ensure that the font data and image data are not overlapping in the RAM_G or overrunning the end of the RAM_G(especially if your image is being inflated from a compressed file and will therefore be larger when de-compressed). It is also necessary to assign the font and your image with different handles.

Does the font work well when used without the image and likewise does the image work well without the font? And if you display other items after the font (e.g. some points or other shapes) do they display correctly?

Best Regards,
FTDI Community



Logged

gokhannsahin

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Lower case letter problem
« Reply #8 on: November 13, 2017, 01:24:29 PM »

when the images want to display before the setfont2 function, then everything is normal, so both the image and font are displaying on the page.
Code: [Select]
vCommandImageCoBuf(&xHomeImages[4]);
        vCommandCoBuf(BITMAP_HANDLE(3));
vCommandCoBuf(BITMAP_SOURCE(xHomeImages[2].ulGraphicRamAddr));
vCommandCoBuf(BITMAP_LAYOUT(L4, 21, 55));
vCommandCoBuf( BITMAP_SIZE(NEAREST, BORDER, BORDER, 42, 55));
vCommandSetFont2CoBuf(xNumberSpeed.w_font, xHomeImages[2].ulGraphicRamAddr, 32);

The image after the setfont2 function isn't displaying but the first image and font are displaying well.
Code: [Select]
vCommandImageCoBuf(&xHomeImages[4]);
        vCommandCoBuf(BITMAP_HANDLE(3));
vCommandCoBuf(BITMAP_SOURCE(xHomeImages[2].ulGraphicRamAddr));
vCommandCoBuf(BITMAP_LAYOUT(L4, 21, 55));
vCommandCoBuf( BITMAP_SIZE(NEAREST, BORDER, BORDER, 42, 55));
vCommandSetFont2CoBuf(xNumberSpeed.w_font, xHomeImages[2].ulGraphicRamAddr, 32);
        vCommandImageCoBuf(&xHomeImages[2]);  // this image isn't displaying

Note: BITMAP_HANDLEs are different.
Should I call the bitmap commands before setfont2 function for the font using? Or after?
« Last Edit: November 13, 2017, 02:01:32 PM by gokhannsahin »
Logged

gokhannsahin

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Lower case letter problem
« Reply #9 on: November 21, 2017, 11:12:08 AM »

Is there any problem using the setfont2? or I'm making mistake?
Logged