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


[<<] [<] Page 1 of 2 [>] [>>]
Subject: How to use nano-X fonts in fltk 1.1.9
From: "Michael Heiser" ####@####.####
Date: 21 Jan 2010 08:09:25 -0000
Message-Id: <4b5808bb.1f205e0a.75d0.5421@mx.google.com>

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 

Subject: Re: [nanogui] How to use nano-X fonts in fltk 1.1.9
From: "phil song" ####@####.####
Date: 21 Jan 2010 09:28:17 -0000
Message-Id: <201001211715388432758@techtrex.com>

HI,Michael Heiser!

	I want to know this question too,whether we need make the font libraray in microwindows?

======= 2010-01-21 15:56:16 The letter which you writted before:=======

>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 
>
>

= = = = = = = = = = = = = = = = = = = =
			

Sincerely
 
phil song
####@####.####
2010-01-21
Subject: Re: [nanogui] How to use nano-X fonts in fltk 1.1.9
From: Ricardo Jasinski ####@####.####
Date: 21 Jan 2010 12:34:17 -0000
Message-Id: <ee9633131001210421q8b1f921t5d3f8005ab9da06@mail.gmail.com>

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
>
Subject: How to use nano-X fonts in fltk 1.1.9
From: "Michael Heiser" ####@####.####
Date: 23 Feb 2010 13:59:16 -0000
Message-Id: <4b83df28.0837560a.7ac5.1e21@mx.google.com>

Hi Ricardo!

Thanks for your advice. But there's a little hint. My Application is driven
by fltk 1.1.8rc3 which is part
Of uClinux-Project. The possibility to use fltk::font_list().... is not
given in FLTK 1.1.x. So I made a change
To FLTK2. But my App cannor compile against FLTK2 obviously I got FLTK2
ported to Blackfin.

I tried a while and I got no hints why my App would not get linked against
fltk2.

So the only way for me to use proper fonts ist nano-X itself.

My question is relatively simple:

How can I use the fonts that are in microwin source folder with fltk? Is
there any hint?

Regards Michael

-----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: ####@####.####



Subject: Re: [nanogui] How to use nano-X fonts in fltk 1.1.9
From: Ricardo Jasinski ####@####.####
Date: 23 Feb 2010 14:34:14 -0000
Message-Id: <ee9633131002230634h5c5ba049td9995680c994807f@mail.gmail.com>

Hi Michael,

it is a shame fltk 2.0 didn't work for you; I find it much more resourceful
than fltk 1.x and easier to use, integrate and undestand. If you haven't
done so yet, maybe you could try to compile a simple demo (one of those
bundled with the fltk distribution) to sort the errors you are finding.

Anyway, I think I can't help much with fltk 1.x fonts; however, there's one
alternative that may be suitable for you. You could change the default
nano-X system font (it is compiled-in with the nano-X server) or add many
other fonts if necessary. This would be completely fltk-independent.

I have outlined the basic steps for that in a previous email that I have
included below.

Good luck,

Ricardo.
*
-------------------------------------------------------------------------
Adding **compiled**-**in** fonts **in** microwindows/nano-x
-------------------------------------------------------------------------

Step 1. Obtain a c-source file for the new font. **In** windows, this can be
bone using the convfnt32.exe tool, for example. You can find this tool **in*
*
src/fonts/tools. At this point, you will specify the font size and attibutes
(bold, italic, etc.).

Step 2. Throw the resulting c-file (say, winArial4x12.c) **in** the
src/fonts
folder. You might want to fix the declaration of the offset table (look for
the comment /* Character->glyph data. */) from 'static unsigned short' to
'static unsigned long', as suggested by Greg.

Step 3. Make note of your new font structure name, as you'll be using it
later. **In** the case, it would be font_winArial4x12, and it would be
located
at the bottom of the file winArial4x12.c. Note: you can have as many fonts
**in** the src/fonts folder as you want, and as long as they are not used by
the
rest of your code they won't take up any memory **in** your system.

Step 4. Announce your new font to the rest of the code. This is done by
editing the src/drivers/genfont.c file. You should add:

   extern MWCFONT font_winArial4x12;

right below the comment line /* **compiled** **in** fonts*/. Also, expand
your
genfonts table with a new font entry. Add as a last element the line:

   {&fontprocs, 0, 0, 0, "Arial", &font_winArial4x12}

Then, increase the NUM_FONTS definition **in** genfont.h line #11. **In** my
case,
it increased from the default value of 4 to 5. That's it. Your new font is
already **in** the system.

(**Stopgap**) Step 5. Test your new font into the system. One
quick-and-dirty way of doing this would be replacing the first entry **in**
 the
genfonts table (file genfont.c, line #72) with the newly created font:

 MWCOREFONT gen_fonts[NUMBER_FONTS] = {
   {&fontprocs, 0, 0, 0, MWFONT_SYSTEM_VAR, &font_winArial4x12},
   ...
 }

Note: a better approach would be changing your default font **in** compile
time
using the specific nano-x functions, but for now I don't know how to do
this. Any ideas? Thanks!!

One last hint: you'll probably have better results with convfnt32.exe if you
turn off you operating system's anti-aliasing capabilities (clear type,
etc.).

That's it!!*




2010/2/23 Michael Heiser ####@####.####

> Hi Ricardo!
>
> Thanks for your advice. But there's a little hint. My Application is driven
> by fltk 1.1.8rc3 which is part
> Of uClinux-Project. The possibility to use fltk::font_list().... is not
> given in FLTK 1.1.x. So I made a change
> To FLTK2. But my App cannor compile against FLTK2 obviously I got FLTK2
> ported to Blackfin.
>
> I tried a while and I got no hints why my App would not get linked against
> fltk2.
>
> So the only way for me to use proper fonts ist nano-X itself.
>
> My question is relatively simple:
>
> How can I use the fonts that are in microwin source folder with fltk? Is
> there any hint?
>
> Regards Michael
>
> -----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: ####@####.####
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
>
>


-- 
----------------------------------------------
Ricardo Pereira Jasinski
####@####.####
Tel: (41) 9955-2852

LME - Laboratório de Microeletrônica da UTFPR
   UTFPR Microelectronics Lab
   www.lme.cpdtt.cefetpr.br
   Tel: +55 41 3310 4756
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: ####@####.####


Subject: Re: AW: [nanogui] How to use nano-X fonts in fltk 1.1.9
From: "=?utf-8?B?eXV0NjE2?=" ####@####.####
Date: 23 Feb 2010 15:20:38 -0000
Message-Id: <201002232320167794213@21cn.com>

Please try the font demo firstly under src/:
$ ./fontdemo.sh fonts/truetype/arialb.ttf 

$ cat fontdemo.sh 
# Nano-X applications, press <BREAK> key to exit
bin/nano-X & bin/nanowm & bin/fontdemo $1

on X11, you could see the font displayed.

2010-02-23 



yut616 



发件人: Michael Heiser 
发送时间: 2010-02-23  22:40:10 
收件人: ####@####.#### 
抄送: 
主题: AW: [nanogui] How to use nano-X fonts in fltk 1.1.9 
 
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: ####@####.####
---------------------------------------------------------------------
To unsubscribe, e-mail: ####@####.####
For additional commands, e-mail: ####@####.####
Subject: Re: [nanogui] How to use nano-X fonts in fltk 1.1.9
From: "Greg Haerr" ####@####.####
Date: 24 Feb 2010 04:56:14 -0000
Message-Id: <01d401cab50d$87e0cf20$6564a8c0@winXP>

> it is a shame fltk 2.0 didn't work for you; I find it much more 
> resourceful
than fltk 1.x and easier to use, integrate and undestand. If you haven't
done so yet, maybe you could try to compile a simple demo (one of those
bundled with the fltk distribution) to sort the errors you are finding.

I'll have to look into this.  I've been playing around alot with
FLTK 1.1(.10), and making changes to NXLIB for bug
fixes and enhanced font support.


> Anyway, I think I can't help much with fltk 1.x fonts; however, there's 
> one
alternative that may be suitable for you. You could change the default
nano-X system font (it is compiled-in with the nano-X server) or add many
other fonts if necessary. This would be completely fltk-independent.

I have recently updated nano-X to v0.92RC2 and NXLIB
to 0.46RC2, both in the git repository.  There is one
big change that could help, which is support for the
newer X11 fonts.alias file.  This file sits in the X11 font
directory like fonts.dir, and is looked first to find a listed
alias for any requested font.  For instance, FLTK 1.1.10
has it's X11 font list in src/fl_fonts.cxx.  By default,
FLTK asks for a long-named "-adobe-....." font,
which, in Ubuntu 9.10, is aliased to another long named
XLFD font, which ultimately is found in fonts.dir to
be...  HelvR14.pcf.gz, the old-fashioned helvetica 14 point
font.

Now that NXLIB supports the fonts.alias file, this could
be used to translate fonts requested by any X11 application
automatically to installed (or core) nano-X fonts.


Regards,

Greg 

Subject: Re: [nanogui] How to use nano-X fonts in fltk 1.1.9
From: "Greg Haerr" ####@####.####
Date: 24 Feb 2010 04:59:56 -0000
Message-Id: <01e201cab50e$335812a0$6564a8c0@winXP>

> 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.

I don't recommend this outdated method of configuring fonts
for nano-X, which was called FONTCONFIG.  It hasn't
been tested for quite some time, and I was about to
remove it.  The FONTCONFIG method tries to give
nano-X the ability to look at all sorts of glyph, style and
size aspects, and come up with a font that best matches.

I think this sort of thing is best left to programs outside
of nano-X (like NXLIB with fonts.alias, or FLTK's
font handling). Instead, nano-X should always be passed
a full path to a font to be loaded.  This is the way
that NXLIB has been designed, so nano-X doesn't
have to deal with it.

With any luck, your FLTK problem can be solved using
the new NXLIB 0.46RC1 code that handles fonts.alias files.

Regards,

Greg 

Subject: Re: [nanogui] How to use nano-X fonts in fltk 1.1.9
From: "Greg Haerr" ####@####.####
Date: 24 Feb 2010 05:00:59 -0000
Message-Id: <01eb01cab50e$577ab6b0$6564a8c0@winXP>

Ricardo - 

Thanks for writing up how to add compiled fonts to 
nano-X.  I will add this to the FAQ on the website!

Regards,

Greg


-------------------------------------------------------------------------
Adding **compiled**-**in** fonts **in** microwindows/nano-x
-------------------------------------------------------------------------


[<<] [<] Page 1 of 2 [>] [>>]


Powered by ezmlm-browse 0.20.