2010-11-23 04:06:33     Truetype fonts in Qt-emb

Document created by Aaronwu Employee on Aug 23, 2013
Version 1Show Document
  • View in full screen mode

2010-11-23 04:06:33     Truetype fonts in Qt-emb

Vitaliy Popov (RUSSIAN FEDERATION)

Message: 96128   

 

hello all!

 

I work with uClinux-dist(Linux version 2.6.28.10-ADI-2009R1.1) for blackfin processor and use Qt-embedded 4.5.3

I wont to use truetype fonts, so I compile freetype-2.3.9 library and rebuild Qt with truetype support

I write simple test program(displaying 4 text strings with different FontSize), but it work incorrect on my board(bf548-ezkit),

and work fine on my host PC.

If FontSize of text string less then 40 there is no text at all, if FontSize 40 and abowe, string distlayed correct.

I debug this problem and finded that for fonts witch FontSize less 40 making *.qsf fonts in /tmp/qtembedded-0/fonts/ dir

and this fonts are not displayed! why is it so?

if I remove *.ttf file from /usr/lib/fonts/ I can see all string with one fixed FontSize for all strings(it is *.qpf font used).

Then I finded in file qfontengine_ft.cpp line 358:

    *outline_drawing = (*xsize > (64<<6)) || *ysize > (64<<6));

If I change it to:

    *outline_drawing = (*xsize > (16<<6)) || *ysize > (16<<6));

and now I can see corect Truetype font with FontSize from 10 and abowe.

 

is anybody use Qt with ttf fonts?

 

picture1.jpg

fonttest.tar.bz2

picture2.jpg

QuoteReplyEditDelete

 

 

2010-11-23 04:25:53     Re: Truetype fonts in Qt-emb

Mike Frysinger (UNITED STATES)

Message: 96129   

 

if you have questions about QT and its fonts, you should try asking the QT guys:

    qt.nokia.com/support

 

we arent really familiar with QT internals

QuoteReplyEditDelete

 

 

2010-11-27 10:21:50     Re: Truetype fonts in Qt-emb

Stefan Pledl (GERMANY)

Message: 96258   

 

We also had problems with truetype fonts on qt. After switching to 'qt prerendered fonts' (.qpf2) the things work well for us, but qpf are not scaleable and therefore you need one file for each fontsize.

 

Qt provides a very good tool (makeqpf, <qt>/tools/makeqpf) to convert any *.ttf file to *.qpf2 file.

 

We use makeqpf tool on windows plattform.

 

If you find a solution using ttf, please let me know.

 

kind regards

Stefan

QuoteReplyEditDelete

 

 

2010-11-27 12:07:11     Re: Truetype fonts in Qt-emb

Wojtek Skulski (UNITED STATES)

Message: 96260   

 

Stefan:

 

are you guys displaying on a local TFT screen, or are you using networked display over ethernet? I would be interested in the latter.

 

Thank you -- Wojtek

QuoteReplyEditDelete

 

 

2010-11-27 13:41:57     Re: Truetype fonts in Qt-emb

Stefan Pledl (GERMANY)

Message: 96261   

 

We are using a locally connected TFT but we have also displayed the output via VNC and ethernet.

QuoteReplyEditDelete

 

 

2010-11-27 17:49:49     Re: Truetype fonts in Qt-emb

Wojtek Skulski (UNITED STATES)

Message: 96263   

 

Stefan:

 

My board does not have any display hardware of its own. VNC and ethernet is exactly what is interesting to me. Is there something what I could read? Example applications of any sort showing how to do it?

 

Thank you -- Wojtek

QuoteReplyEditDelete

 

 

2010-11-27 19:14:51     Re: Truetype fonts in Qt-emb

Stefan Pledl (GERMANY)

Message: 96264   

 

just start your application with this options

app -qws -display VNC:0

 

qt must be configured with

-qt-gfx-vnc option

 

  doc.qt.nokia.com/4.5/qt-embedded-vnc.html

QuoteReplyEditDelete

 

 

2010-11-27 19:39:14     Re: Truetype fonts in Qt-emb

Wojtek Skulski (UNITED STATES)

Message: 96265    Stefan:

 

thank you for the prompt answer. At the board side, do I need to use

MicroWindows or any similar X-windows substitute, or is Qt taking care of

the communication by itself? I was asking these questions on MicroWindows

forums, but their answers only confused me.

QuoteReplyEditDelete

 

 

2010-11-27 20:06:52     Re: Truetype fonts in Qt-emb

Stefan Pledl (GERMANY)

Message: 96266   

 

You do not need a X-windows system. Qt handles this via the -qws option (QWSServer -> built in window server)

 

  doc.qt.nokia.com/4.5/qt-embedded-architecture.html

QuoteReplyEditDelete

 

 

2010-11-27 20:28:15     Re: Truetype fonts in Qt-emb

Mike Frysinger (UNITED STATES)

Message: 96267   

 

it depends on what you're talking about.  QT does not provide any X layers, so you cannot run X apps with this.

QuoteReplyEditDelete

 

 

2010-11-27 23:00:51     Re: Truetype fonts in Qt-emb

Wojtek Skulski (UNITED STATES)

Message: 96270   

 

Mike:

 

My board will be deployed 4,000 feet underground and operated remotely from the surface. A reasonably fast and interactive display is necessary. By "interactive" I mean the mouse cursor. Keyboard is less of a problem because the command line interface over telnet is good enough.

 

The description of embedded Qt is encouraging. The display is limited to 640x480, what is not nice but acceptable. The mouse is supported. So Qt looks like a possible way to go.

 

The page   doc.qt.nokia.com/4.5/qt-embedded-vnc.html implies that my requirements can be met with Qt displaying over the VNC connection. Good.

 

I am still not clear about MicroWindows. I described my needs on their mailing list. In response I was immediately buried under a pile of highly technical e-mails who seemed to imply it might be possible, but who knows. I am greatly relieved to find the Qt situation is more clearly spelled out.

QuoteReplyEditDelete

 

 

2010-12-01 00:52:37     Re: Truetype fonts in Qt-emb

Vitaliy Popov (RUSSIAN FEDERATION)

Message: 96349   

 

Hello all!

 

I work with  qpf2 fonts in previos projects, but now I need to display a lot of fonts with different FontSize, so there is not a good way to do 20-30 qpf font files with different size of font in it. I write bug report to Qt, but there is no ansver at thet moment from them. Solution of using ttf with Qt4.5.1 I finded is in file qfontengine_ft.cpp line 358

    *outline_drawing = (*xsize > (64<<6)) || *ysize > (64<<6));

change to

    *outline_drawing = (*xsize > (16<<6)) || *ysize > (16<<6));

 

it make posible to display ttf fonts with FontSize from 10 points and abowe.

I dont now is it correct solution, but I rebuild my previos project from qpf2 fonts to ttf fonts, and all work good

 

PS

 

changing 64 to 32 making posible to display fontsize from 20 points;

 

64 to 16 from 10 points;

 

64 to 8 from 5 points.

Attachments

Outcomes