nanogui: How to use nano-X fonts in fltk 1.1.9


Previous by date: 23 Feb 2010 14:37:57 -0000 Re: How to use nano-X fonts in fltk 1.1.9, Ricardo Jasinski
Next by date: 23 Feb 2010 14:37:57 -0000 Re: How to use nano-X fonts in fltk 1.1.9, yut616
Previous in thread: 23 Feb 2010 14:37:57 -0000 Re: How to use nano-X fonts in fltk 1.1.9, Ricardo Jasinski
Next in thread: 23 Feb 2010 14:37:57 -0000 Re: How to use nano-X fonts in fltk 1.1.9, yut616

Subject: AW: [nanogui] How to use nano-X fonts in fltk 1.1.9
From: Michael Heiser ####@####.####
Date: 23 Feb 2010 14:37:57 -0000
Message-Id: <4b83e83b.0437560a.2342.4870@mx.google.com>

The problem with fltk2 is done. I have a simple test application like yours
U mentioned in post before.

I copied all available arial fonts from nano-X project to target and I
created a fonts.list. When I start my application the call
fltk::list_fonts()
gives 0 as return and so I cant assign the font to the label.

What am I doing wrong? Did you set libfreetype anywhere? Do I hve to Compile
the app using -lfreetype?

And my other questions to the community are:

How do I have to use the fontconfig-file which is mentioned in arg_list of
nano-X Server?
When I call nano-X -c path/to/font.cfg where I want to set my fonts, the app
doesn't start.
Instead of starting it prints out the usage of arguments.

root:/usr/fonts/truetype> nano-X -c /media/fonts/font.cfg
Usage: nano-X [-e] [-p] [-A] [-NLRD] [-x#] [-y#] [-c <fontconfig-file> ...]

Do you have any suggestions? It is essential for me to get fonts running....
Please help me

-----Ursprüngliche Nachricht-----
Von: Ricardo Jasinski ####@####.#### 
Gesendet: Donnerstag, 21. Januar 2010 13:22
An: ####@####.####
Betreff: Re: [nanogui] How to use nano-X fonts in fltk 1.1.9

Hi Michael,

please take a look at the message below, I posted it a while ago in
the Altera Forum (www.alteraforum.com).

I am using nano-X version 0.91, Fltk 2.0.0 and Freetype 2.3.5, which
came in bundled with my distribution (uClinux).

Mfg,

Ricardo.


----------------------------------------------------------------------------
--------------------------------
Hello,

i want to change the font and the fontsize in my app but not even the
label or fonts-demo is working.

is there a known bug about this?

----------------------------------------------------------------------------
--------------------------------

It works. Try the following (modified) demo app. Name it hello.cpp:

Code:
----------------------------------------------------------------------------
--------------------------------
#include <fltk/Window.h>
#include <fltk/Widget.h>
#include <fltk/Font.h>
#include <fltk/run.h>
using namespace fltk;

int main(int argc, char **argv)
{
    fltk::Font** FontsList;
    int FontsCount = fltk::list_fonts(FontsList);

    Window *window = new Window(300, 180);
    window->begin();
    Widget *box = new Widget(20, 40, 260, 100, "Hello, World!");
    box->labelfont(FontsList[0]);
    box->labelsize(36);
    box->labeltype(SHADOW_LABEL);
    window->end();
    window->show(argc, argv);

    return run();
}
----------------------------------------------------------------------------
--------------------------------

Compile it with:

----------------------------------------------------------------------------
--------------------------------
$ nios2-linux-uclibc-g++
-I/home/jars/nios2-linux/uClinux-dist/lib/fltk -c hello.cpp
$ nios2-linux-uclibc-g++ hello.o
/home/jars/nios2-linux/uClinux-dist/lib/fltk/lib/libfltk2.a
/home/jars/nios2-linux/uClinux-dist/staging/usr/lib/libX11.a
/home/jars/nios2-linux/uClinux-dist/user/microwin/src/lib/libnano-X.a
-lpthread -o hello
----------------------------------------------------------------------------
--------------------------------

Remember to change the paths above to reflect your own system. You can
have any font size by modifying the line:
box->labelsize(36);

Somethings to consider:
- I never got to compile the FLTK demo apps by simply selecting the
item in menuconfig; I think it's broken;
- in /usr/fonts/truetype you should have your ttf fonts and a fonts.dir
file:

----------------------------------------------------------------------------
--------------------------------

/usr/fonts/truetype # ls
DejaVuLGCSans.ttf                DejaVuLGCSansCondensed-Bold.ttf
dejavulgcsans.ttf                dejavulgcsanscondensedbold.ttf
fonts.dir
/usr/fonts/truetype # cat fonts.dir
2
dejavulgcsanscondensedbold.ttf
-dejavu-DejaVuLGCSans-medium-r-bold--0-0-0-0-p-0-iso8859-1
dejavulgcsans.ttf
-dejavu-DejaVuLGCSans-medium-r-normal--0-0-0-0-p-0-iso8859-1
/usr/fonts/truetype #

----------------------------------------------------------------------------
--------------------------------

Cheers,

Ricardo.






2010/1/21 Michael Heiser ####@####.####
>
> Hey guys,
>
>
>
> Great Work! On my Blackfin nano-X does ist Job really well. The only thing
> which is really annoying, is, that I can't use fonts like Helvetica when I
> add Helvetica to a text-widget (Fl_Text_Display) in fltk. Nano-X shows
only
> ascii text in little size in the Widget.
>
> Is there any hint that I can follow? How do I add font support to nano-X
> that fltk can use standard fonts like Sans Serif and Helvetica.
>
>
>
> Michael
>

---------------------------------------------------------------------
To unsubscribe, e-mail: ####@####.####
For additional commands, e-mail: ####@####.####



Previous by date: 23 Feb 2010 14:37:57 -0000 Re: How to use nano-X fonts in fltk 1.1.9, Ricardo Jasinski
Next by date: 23 Feb 2010 14:37:57 -0000 Re: How to use nano-X fonts in fltk 1.1.9, yut616
Previous in thread: 23 Feb 2010 14:37:57 -0000 Re: How to use nano-X fonts in fltk 1.1.9, Ricardo Jasinski
Next in thread: 23 Feb 2010 14:37:57 -0000 Re: How to use nano-X fonts in fltk 1.1.9, yut616


Powered by ezmlm-browse 0.20.