- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It works. Try the following (modified) demo app. Name it hello.cpp:
#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);
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
$ nios2-linux-uclibc-g++ fltk_font.o /home/z125188/nios2-linux/uClinux-dist/lib/fltk/lib/libfltk2.a /home/z125188/nios2-linux/uClinux-dist/staging/usr/lib/libX11.a /home/z125188/nios2-linux/uClinux-dist/user/microwin/src/lib/libnano-X.a -lpthread -o fltk_font
/opt/nios2/usr/bin/nios2-linux-uclibc-ld.real: /home/z125188/nios2-linux/uClinux-dist/lib/fltk/lib/libfltk2.a(args.o): Relocations in generic ELF (EM: 3) /home/z125188/nios2-linux/uClinux-dist/lib/fltk/lib/libfltk2.a: could not read symbols: File in wrong format collect2: ld returned 1 exit status thats hopefully my last error.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please don't use the lib/fltk, as it was broken. Please enable nxlib under microwin. Then it will build nxlib and fltk with demos.
- Hippo- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
lib/fltk is good if you do some changes in the makefile
but fltk2 keyboard works not correctly
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page