Go Down

Topic: Proportional/TTF/OTF Fonts using UTFT and windows (Read 10323 times) previous topic - next topic

Dimdim

Hi there DB,

I would just like to say thanks for a wonderful add-on to my already favorite UTFT library!
It has provided me with much needed screen real estate.


arduinodlb

Hi Dim,

Thanks for the post and the screenshot. It's always great to see people getting use out of these things.

Cheers,

DB.
Do not IM me. I will not respond. Ask questions in the forum.

rowboteer

Hi, you may be interested in this Instructable where I have published my solution with kerned proportional fonts.

http://www.instructables.com/id/Arduino-TFT-display-and-font-library/

Fonts have been added to the Adafruit_GFX library and it has been renamed Adafruit_GFX_AS

If you use a different display driver library then you just need to change the references in that library from Adafruit_GFX to Adafruit_GFX_AS.

Cheers,
Alan

Magicj

Hi DB

I would also like to echo the sentiments of others and thank you for this great library - it makes everything look so much better!!

My question - UTFT_DLB works with the standard UTFT library but does it replace it? I note that you have a 'print' function in your library but there is nothing equivalent to the printNumI or printNumF functions found in the original library. When I try to use these functions nothing is displayed on the screen. I have been able to overcome this issue by converting the number using dtostrf and then using the print function but is this the best way to do it?

I am also using your button library - the original button library allows the use of bitmaps as buttons. Is it possible to use both button types in a sketch i.e. some bitmap buttons and some buttons using your proportional fonts? Or, can I only use one or the other?

Thanks

arduinodlb

#19
Apr 03, 2015, 03:43 am Last Edit: Apr 03, 2015, 06:54 am by arduinodlb
Hi Magic,

UTFT_DLB extends the UTFT library, but I didn't extend every function. I was trying to minimize the size of the additional code and as you discovered, decided that the functionality of printNumF and printNumI could be replicated by converting to a string. Yes, it's slower, but it makes the library smaller and I think in most cases, is a satisfactory solution. Alternatively, you could extend UTFT_DLB and add your own printNumF and printNumI functions, but I'd just do what you're doing. Or add a local printNumF/printNumI that converts it to a string and uses UTFT_DLB. The only disadvantage is slightly slower speed.

Good question about the buttons. My instinct says two things:
1) You could probably mix them.
2) More importantly, there is no reason to mix them. Just make them all UTFT_DLB buttons. UTFT_DLB buttons can use standard UTFT bitmaps, UTFT fonts, as well as UTFT_DLB type fonts as far as I can recall. Apart from proportional fonts in buttons, the library also allows the buttons to be different colours, which was important for my application.

Not sure how helpful that is, but my Arduino stuff is currently in another country.

If you test these combinations, please report back here with the results so we know for sure.

Cheers,

David.
Do not IM me. I will not respond. Ask questions in the forum.

k_samsonov

Hi, David!

Can you send me or share ttf2c_vc2003.exe source code or add to this utility codepage select argument.

Thanks.

ghlawrence2000

Extremely unlikely. He is out of the country, doesn't have an old 2003 based assembler set up any more, so fairly much, what you see is what you get.

Regards,

Graham
UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

arduinodlb

#22
Apr 07, 2015, 07:56 am Last Edit: Apr 07, 2015, 01:54 pm by arduinodlb
Hi, David!

Can you send me or share ttf2c_vc2003.exe source code or add to this utility codepage select argument.

Thanks.
As Graham has said, unfortunately for a number of reasons I cannot share the source, nor can I easily add functionality as I am not in Australia.

I do describe the resulting font format in the font files themselves, so you can write your own converter. You could also move the glyphs you want into the first 256 characters of the font using a font editor, then convert that, although the UTFT_DLB print functions will only work with non-Unicode character numbers. That is, your text would be limited to only using 256 characters per font.
Do not IM me. I will not respond. Ask questions in the forum.

k_samsonov

OK, don't worry!  8)

I allready write such application from scratch for UTFT lib.

Now I try add support for UTFT_DLB.

k0$t

nacho_rz

Hello,

Thank you for your library. It's really something amazing.
Due to complication between libraries, it will be best for me to print out Strings directly to the screen but as far as I have seen that is not possible with your library. Is it possible to rework the library like the original one?

ghlawrence2000

You do not make it clear what complications between libraries you are talking about? It is indeed possible to print directly to screen using UTFT_DLB, you only need to run the demo to see that.....

Regards,

Graham
UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

Mixe

Hi all. I'm trying to get this to work. Unfortunately I'm on Mac, but I installed Parallels and have been able to produce .c- files through the attached application and a command prompt. Now I get the "const uint_8t"- problem. How do you get around that? And please be gentle, I'm a newbie.

arduinodlb

Hi,

See answer #13. Basically, generate the .c files, then hand-edit and put the const keyword in front of the variable definition.
Do not IM me. I will not respond. Ask questions in the forum.

Roger_D

Hi DB,
I am new to this forum and quite new to Arduino at all. I have taken a closer look at your UTFT_DLB library and your font conversion tool and found that the concept is much better than that of other Arduino libraries that allow the use of proportional fonts.
Then I started to implement the following modifications for my personal needs:
  • In rotatePropChar a background rectangle is always drawn for non-transparent text if the rotation angle is rectangular (deg=0°, 90°, 180°, 270°). In this case the procedure draws only the foreground pixels (like for transparent text) --> works faster.
  • The background rectangle is also drawn if fontChar.width==0 --> also blanks have background now.
  • For non rectangular rotation angles the text is always drawn transparent. I have done this because the procedure is in this case anyway not able to draw the background properly. Of course it would be able to add some filled rotated rectangle, but I was not willing to spend the effort for it.
  • If the rotation angle is rectangular, the x/y transformations are done as integer calculations --> faster.
  • With the above changes, rotatePropChar is much faster. Thus there is no need to use a special procedure for deg=0° --> smaller code.
  • I have added an optional parameter to setFont(..) that allows to increase the space from char to char. This can be useful e.g. for buttons.
So far everything appears to work fine and I am happy with the results. I have attached the cpp and h files. Now I would like to make the modified library available to other users and have the following questions:
  • Is that ok for you?
  • Do you want to review and/or test the code?
  • Where can I upload it?
  • What else has to be regarded?
Any help how to proceed is appreciated, of course also from other users.

Thanks,
Roger

synt4ks

This is amazing!

I finally got it working after a hundred efforts but it was so worth it!

Many, many thanks to the creators of UTFT_DLB!!!

Go Up