Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: mbertrand on August 03, 2012, 10:50:18 AM

Title: Adding true type fonts
Post by: mbertrand on August 03, 2012, 10:50:18 AM
I'm deploying QT apps built on Ubuntu to Tiny Core. How do I add, configure fonts in Tiny Core?
Title: Re: Adding true type fonts
Post by: curaga on August 03, 2012, 11:22:40 AM
Add is simply copy them to the correct dir (/usr/local/share/fonts or /usr/share/fonts for system wide, ~/.fonts for per-user).

Configure, that depends on what you want. Fontconfig config files are under /etc, the anti-aliasing, preference, subpixel etc settings are set there. I don't recall the per-user location for those, but that exists too.
Title: Re: Adding true type fonts
Post by: mbertrand on August 03, 2012, 11:28:40 AM
I know QT uses Fontconfig. Would just copying them to usr/share/fonts would allow QT to see them are I need to do more.
I'm not familiar with fontconfig.
Title: Re: Adding true type fonts
Post by: curaga on August 03, 2012, 11:52:26 AM
Just copying is enough to add fonts.
Title: Re: Adding true type fonts
Post by: tinypoodle on August 03, 2012, 12:33:30 PM
See also:
http://forum.tinycorelinux.net/index.php/topic,8262.0.html
Title: Re: Adding true type fonts
Post by: mbertrand on August 03, 2012, 02:12:05 PM
Not working. Here is my test. I created a form in designer with a label only on it using lets say font "Arial" On my Ubuntu machine.
I copied this font to my Tiny Core in /usr/share/fonts. When I run my program on Tiny Core it is not using that font.
Another try was to use QT QFontCombo witch lists all font it knows about in your system. This does not list my "Arial" that I copied.

Title: Re: Adding true type fonts
Post by: tinypoodle on August 03, 2012, 02:18:15 PM
Have you read the thread I linked to?
Title: Re: Adding true type fonts
Post by: mbertrand on August 03, 2012, 02:37:13 PM
Yes, I'm not using Opera but understand the thread. This did not help me. I did install fontconfig at the very begining.
I don't know how to use it. I will look in to it.
Title: Re: Adding true type fonts
Post by: mbertrand on August 03, 2012, 02:42:47 PM
I installed Opera for fun to see and it lists the fonts I copied. So what I'm doing wrong.
Opera is listing different fonts then My QT test app. My test app has fonts I don't even know like:
Fixed[Misc]
Fixed[Sony]
Helvitica
Nil

And Opera is listing font that I've actually herd of like:
Arail
Courier New
Times New Roman

I'm LOST !!!

Title: Re: Adding true type fonts
Post by: mbertrand on August 03, 2012, 03:12:49 PM
Well it seems what ever font I copy Opera sees it but not my QT app. Maybe something additional as to be done???
Title: Re: Adding true type fonts
Post by: tinypoodle on August 03, 2012, 04:21:36 PM
Hmm, I had hoped your app would behave in the same way as opera...
Obviously not :(
Title: Re: Adding true type fonts
Post by: curaga on August 03, 2012, 05:15:52 PM
Why is your qt app only using bitmap fonts? What Qt are you using?
Title: Re: Adding true type fonts
Post by: mbertrand on August 06, 2012, 07:47:42 AM
Oh is that what it is doing I didn't know this. See these fonts that I've listed in the previous post are bitmap fonts?
Title: Re: Adding true type fonts
Post by: tinypoodle on August 06, 2012, 08:13:27 AM
Yes, and once opera is picking up the fonts you added you can exclude any systemwide issue.
Title: Re: Adding true type fonts
Post by: mbertrand on August 06, 2012, 08:41:13 AM
I'm confused here , does Tiny Core support TTF?
I'm trying to educate my self regarding fonts but there a vast earea to cover!!
I got Tiny Core, X, QT, Fontconfig ect.to look at. Do you know of any good links I can start?
Title: Re: Adding true type fonts
Post by: curaga on August 06, 2012, 09:16:34 AM
Yes, TC obviously supports TTF fonts ;) But it sounds like your Qt doesn't. You didn't answer on what Qt you're using.
Title: Re: Adding true type fonts
Post by: mbertrand on August 06, 2012, 09:49:09 AM
I'm using QT 4.8.2
Title: Re: Adding true type fonts
Post by: mbertrand on August 06, 2012, 10:26:58 AM
Could I be missing extension. This is what I have now:

Xlibs.tcz
Xorg-7.5-lib.tcz
Xorg-7.6-lib.tcz
Xprogs.tcz
fltk-1.10.tcz
flwm_topside.tcz
gcc_libs.tcz
libftdi.tcz
libpci.tcz
libusb.tcz
openssh.tcz
openssl-1.0.0.tcz
pci-utils.tcz
usb-serial-3.0.21-tinycore.tcz
usb-utils.tcz
wbar.tcz
xvtouch.tcz
Xvesa.tcz
x11vnc.tcz
nano.tcz
udev-lib.tcz
fontconfig.tcz
opera-11.tcz
Xorg-fonts.tcz
Xorg-7.6-bin.tcz
Title: Re: Adding true type fonts
Post by: tinypoodle on August 06, 2012, 12:28:26 PM
I'd suspect that libxft would be a dep of any of those, but not sure.
For testing purposes I'd suggest you use opera10 which AFAIK is the only version in repo depending on shared qt libs - opera11 is no longer qt based.
Title: Re: Adding true type fonts
Post by: curaga on August 06, 2012, 03:51:31 PM
No, I mean what Qt as in where it comes from, not the version. Is it from our repo, or copied from Ubuntu, or linked statically, or some other way.

Clearly not from our repo, seeing as the version is different.
Title: Re: Adding true type fonts
Post by: mbertrand on August 07, 2012, 08:45:46 AM
It is a dynamic built by me from their source (4.8.2)on my Ubuntu and deployed to my Tiny Core.
I download from your repos QT Designer 4.7.4 just to see how it will list its available fonts and it has no problem.
My Test program on Ubuntu does not list all the fonts that Designer does. I'm really lost now!!


Title: Re: Adding true type fonts
Post by: curaga on August 07, 2012, 09:07:48 AM
That sounds like an issue with your Qt code, then. Maybe ask at a Qt forum?
Title: Re: Adding true type fonts
Post by: mbertrand on August 07, 2012, 09:14:03 AM
Not my code. It does nothing it is a QWindow with a QFontComboBox.
I just stomped on something here, I'm building on my Ubuntu with 4.8.2 and using libs from your repos at 4.7.4.
I built with 4.7.4 and all is well!!! I looks maybe like something is not backwards compatible regarding QT? This looks now more like
a QT problem and therefore I will not bombarded you with question not related to Tiny Core. I appreciate you time and thanks.
I let you you know my final outcome, maybe some else may one day have the same problem.
Title: Re: Adding true type fonts
Post by: curaga on August 07, 2012, 10:54:32 AM
Oh, that's not even supposed to work :) (compiling against a newer version than you're running with)
Title: Re: Adding true type fonts
Post by: mbertrand on August 07, 2012, 11:10:07 AM
QT has good backward compatibility but to some extent! My app compiled against 4.8.2 will run with 4.7.4 libs.
This was not my plan. Anyways it looks like QT's 4.8.1 build works and 4.8.2 does not.
The 4.8.1 is a built I got directly from QT. The build 4.8.2 is a built I did. So, either something is wrong with my build or their source. I'm investigating.

Title: Re: Adding true type fonts
Post by: mbertrand on August 08, 2012, 09:18:38 AM
Well, it turns out to be my build of QT libraries, Why, don't know as of now but for now I'm using pre built from QT and al work well.
But I would like to know what fonts come with Tiny Core and where are they.
Title: Re: Adding true type fonts
Post by: tinypoodle on August 08, 2012, 09:43:48 AM
You could compile under core instead of ubuntu to see if that makes any difference.
Title: Re: Adding true type fonts
Post by: mbertrand on August 10, 2012, 08:54:10 AM
Ok, I found the problem It was as a mentioned my build of QT libs. QT libs need to be built with fonconfig support.
By default it is but if you don't have the fonconfig development lib  on your build system QT lib still builds with no warning, at least I did not see any obvious warnings. So I ended up with a built lib and no fontconfig support.

Thanks for all your support.
Keep the great work.
Title: Re: Adding true type fonts
Post by: tinypoodle on August 11, 2012, 04:59:06 PM
I wouldn't expect a warning when libs for an optional feature are not installed - at best an information of optional features included at the end of output of ./configure.
I'd reckon if you examine the output of ./configure such would be visible.
However, feel free to make suggestions of improvement with upstream. ;)