Can not change font size in Kubuntu 16.04

72 views
Skip to first unread message

petter...@yahoo.com

unread,
Aug 13, 2016, 10:19:05 PM8/13/16
to fltk.general
Kubuntu 16.04:
Can not change font size in FLTK programs.
In standard hello world program:
box->labelsize (36); gives smallish font approx 10.
Font sizing worked OK at Kubuntu 14.04.
Could there be some conflict with the new KDE Plasma 5?


Ian MacArthur

unread,
Aug 14, 2016, 5:24:54 AM8/14/16
to fltk.general

Hm, that sounds very odd.

Looking at the text, would you say that the font face looks like it is anti-aliased, or is it a pixel font?

From your description, I suspect what you are seeing is a fallback font face, likely to be a small, fixed size, bitmap font.

This can happen when the installation does not have the XFT and Fontconfig stuff installed (or at least, does not have the dev packages for them) or if you simply do not have the fonts installed.

Is this a clean install of 16.04, or did you upgrade a working 14.04 system?

If it is a clean install, then I'd speculate that you have omitted to install the necessary dev packages, and when you build fltk it simply thinks you do not have XFT support available.

If you updated a previously working installation, well... I do not know to be honest, but I'd start out by checking the fonts are available and that the dev packages for XFT and fontconfig are installed anyway...


 

petter...@yahoo.com

unread,
Aug 14, 2016, 8:43:00 AM8/14/16
to fltk.general
It is a clean 16.04 install.
Howeever I had not install XFT and Fontconfig.
Now I have installed all PREREQUISITES in README.Unix.txt.
Have uninstalled fltk, make uninstall, make clean, make all, make install. Rebooted PC.

Still same problem

>I suspect what you are seeing is a fallback font face, likely to be a small, fixed size, bitmap font.
Have tried some of the other test programs, and indeed the fonts are small, fixed size, bitmap font.
So that make sense.

But how do I enable the correct fonts, or troubleshoot further on?

Albrecht Schlosser

unread,
Aug 14, 2016, 9:23:49 AM8/14/16
to fltkg...@googlegroups.com
On 14.08.2016 14:43 petter.pripp via fltk.general wrote:
> It is a clean 16.04 install.
> Howeever I had not install XFT and Fontconfig.
> Now I have installed all PREREQUISITES in README.Unix.txt.

Well, this list might be incomplete, but I see libxft-dev is included.

A good thing to install is package build-essential, but there might be
even more you need to be complete. I'll check if I can find something.

> Have uninstalled fltk, make uninstall, make clean, make all, make
> install. Rebooted PC.
> Still same problem
>
>>I suspect what you are seeing is a fallback font face, likely to be a small, fixed size, bitmap font.
> Have tried some of the other test programs, and indeed the fonts are
> small, fixed size, bitmap font.
> So that make sense.
>
> But how do I enable the correct fonts, or troubleshoot further on?

I can't tell you much about how to enable the correct fonts, but first
step in troubleshooting should be to examine the generated file
config.h: Does it enable xft? Mine shows:

$ grep -i xft config.h
* USE_XFT
* Use the new Xft library to draw anti-aliased text.
#define USE_XFT 1

Another empirical test would be to run test/rotated_text. Use the
"Angle" slider, check if the text in the box "Widget with rotated text"
rotates when you move the slider.

If it doesn't you don't have XFT support, and you should see one or more
messages in your console window (where you started the program).

petter...@yahoo.com

unread,
Aug 14, 2016, 10:35:01 AM8/14/16
to fltk.general, Albrech...@online.de
SOLVED! It was indeed XFT not enabled.

In config.h
#define USE_XFT 0
changed to
#define USE_XFT 1

$ make clean
$ make
$ sudo make install

Now all font's look good again.
Thank you very much for good tips :)

Greg Ercolano

unread,
Aug 14, 2016, 12:45:16 PM8/14/16
to fltkg...@googlegroups.com
On 08/14/16 07:35, petter.pripp via fltk.general wrote:
> SOLVED! It was indeed XFT not enabled.
>
> In config.h
> #define USE_XFT 0
> changed to
> #define USE_XFT 1

Perhaps configure is not detecting the presence of XFT on this version
of kubuntu properly?

I've pulled a copy of kubuntu 16.04.1 -- if I have time I'll try to
poke at it.


Albrecht Schlosser

unread,
Aug 14, 2016, 1:13:29 PM8/14/16
to fltkg...@googlegroups.com
On 14.08.2016 18:45 Greg Ercolano wrote:
>
> I've pulled a copy of kubuntu 16.04.1 -- if I have time I'll try to
> poke at it.

That would be a good chance to check the packages that need to be
installed and to update README.Unix.txt if something is missing ;-)

Greg Ercolano

unread,
Aug 15, 2016, 2:46:07 AM8/15/16
to fltkg...@googlegroups.com
It's really late here -- don't want to modify that file right now.
Just reporting what I found; one of us can update it over the next day or two.


Can confirm OP's findings with kubuntu 16.04.1 and a default
build of fltk 1.3 svn current.

Can't change size of text when one just installs "g++" and "libx11-dev".
(One needs to also install xft-dev)

And the test/rotated_text program is a good way to test;
changing the size slider shows no change, and using the angle
slider just changes the text's x/y position to follow a circular
track, without rotating it.

I suppose it's noteworthy that "./configure --enable-xft" had no effect
and gave no errors about the XFT dev libs not being available,
which seems misleading.

To install + build FLTK correctly on kubuntu 16.04, the apt commands
I needed to get FLTK svn to compile correctly were:

apt -y install g++
apt -y install subversion
apt -y install autoconf
apt -y install libx11-dev
apt -y install libxft-dev

From there, the usual to checkout svn current and make it:

cd /usr/local/src
svn co http://seriss.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3.x-svn
make

..and that seemed to work.


Greg Ercolano

unread,
Aug 15, 2016, 3:25:34 AM8/15/16
to fltkg...@googlegroups.com
On 08/14/16 23:46, Greg Ercolano wrote:
> To install + build FLTK correctly on kubuntu 16.04, the apt commands
> I needed to get FLTK svn to compile correctly were:
>
> apt -y install g++
> apt -y install subversion
> apt -y install autoconf
> apt -y install libx11-dev
> apt -y install libxft-dev
>
> From there, the usual to checkout svn current and make it:
>
> cd /usr/local/src
> svn co http://seriss.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3.x-svn
> make
>
> ..and that seemed to work.


I should add.. I did get the following warnings which I've seen before
and thought we addressed in r11810:

----
Compiling screen_xywh.cxx...
screen_xywh.cxx: In function �void screen_init()�:
screen_xywh.cxx:171:7: warning: variable �dpi_by_randr� set but not used [-Wunused-but-set-variable]
int dpi_by_randr = 0;
^
screen_xywh.cxx:172:9: warning: variable �dpih� set but not used [-Wunused-but-set-variable]
float dpih = 0.0f, dpiv = 0.0f;
^
screen_xywh.cxx:172:22: warning: variable �dpiv� set but not used [-Wunused-but-set-variable]
float dpih = 0.0f, dpiv = 0.0f;
^
Compiling fl_utf8.cxx...
Compiling ps_image.cxx...
----

I can make those go away if I install xinerama with:

apt -y install libxinerama-dev

So perhaps that should be added to the 'apt install' list above.

But we should maybe be more robust about preventing these warnings
by localizing the scope of those variables to the #ifdef sections
they're used in.

Also getting these warnings which I've also seen before:

----
Compiling filename_ext.cxx...
Fl_x.cxx: In function ���KeySym fl_KeycodeToKeysym(Display*, KeyCode, unsigned int)���:
Fl_x.cxx:1322:10: warning: ���KeySym XKeycodeToKeysym(Display*, KeyCode, int)��� is deprecated [-Wdeprecated-declarations]
return XKeycodeToKeysym(d, k, i);
^
In file included from ../FL/fl_utf8.h:65:0,
from ../FL/Fl.H:32,
from Fl_x.cxx:30:
/usr/include/X11/Xlib.h:1687:15: note: declared here
extern KeySym XKeycodeToKeysym(
^
Fl_x.cxx:1322:10: warning: ���KeySym XKeycodeToKeysym(Display*, KeyCode, int)��� is deprecated [-Wdeprecated-declarations]
return XKeycodeToKeysym(d, k, i);
^
In file included from ../FL/fl_utf8.h:65:0,
from ../FL/Fl.H:32,
from Fl_x.cxx:30:
/usr/include/X11/Xlib.h:1687:15: note: declared here
extern KeySym XKeycodeToKeysym(
^
Fl_x.cxx:1322:34: warning: ���KeySym XKeycodeToKeysym(Display*, KeyCode, int)��� is deprecated [-Wdeprecated-declarations]
return XKeycodeToKeysym(d, k, i);
^
In file included from ../FL/fl_utf8.h:65:0,
from ../FL/Fl.H:32,
from Fl_x.cxx:30:
/usr/include/X11/Xlib.h:1687:15: note: declared here
extern KeySym XKeycodeToKeysym(
^
Compiling filename_isdir.cxx...
----

IIRC we know about these, but haven't switched to the newer code they
want us to use, or some such.

Reply all
Reply to author
Forward
0 new messages