FTDI Community

General Category => Discussion - Software => Topic started by: gokhannsahin on October 24, 2017, 01:33:09 PM

Title: Lower case letter problem
Post by: gokhannsahin 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?
Title: Re: Lower case letter problem
Post by: FTDI Community 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
Title: Re: Lower case letter problem
Post by: gokhannsahin 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.

Title: Re: Lower case letter problem
Post by: FTDI Community 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
Title: Re: Lower case letter problem
Post by: gokhannsahin 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)
Title: Re: Lower case letter problem
Post by: gokhannsahin on November 02, 2017, 11:53:15 AM
After the font converter tool has been updated, the error has been fixed.
Thanks a lot.
Title: Re: Lower case letter problem
Post by: gokhannsahin 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.
Title: Re: Lower case letter problem
Post by: FTDI Community 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



Title: Re: Lower case letter problem
Post by: gokhannsahin 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?
Title: Re: Lower case letter problem
Post by: gokhannsahin on November 21, 2017, 11:12:08 AM
Is there any problem using the setfont2? or I'm making mistake?