Tiny Core Linux

Tiny Core Extensions => TCE Talk => Extension requests => Topic started by: polikuo on November 24, 2016, 08:37:12 AM

Title: Enable Xft support for FLTK ?
Post by: polikuo on November 24, 2016, 08:37:12 AM
Sorry for being lengthy :(

The Fast Light Tool Kit for tiny core is compiled without Xft support on all x86,x64,armv6 platform.
http://forum.tinycorelinux.net/index.php/topic,19272.msg118679.html#msg118679 (http://forum.tinycorelinux.net/index.php/topic,19272.msg118679.html#msg118679)
Quote
The fltk extensions are compiled without Xft support.

By enabling the Xft support, it would be able to use a UTF-8 font. ( unifont.pcf.gz , unifont.ttf ) ;D

I've just compiled fltk-1.3.4-1 on both x86, x64 platform. (Upgrades in core 8.x, maybe ?)
(I get error messages on armv6. Better luck, anybody????)

Take a look at these tables
I did NOT patch the source code before compiling.
I tried "heavy approach" on both platform

<x86 platform>
Version1.1.101.3.31.3.4-1_HEAVY
base272.0K440.0K656.0K
dev540.0K1.2M5.4M
docN/AN/A312.0K

<x64 platform>
Version1.1.101.3.31.3.4-1_with_Xft1.3.4-1_HEAVY
base280.0K508.0K576.0K708.0K
dev72.0K1.3M10.1M12.8M
docN/AN/A308.0K312.0K

my compile flags and dependencies
On <x86> I tried to enabled pretty much everything (HEAVY)
Code: [Select]
tce-load -i \
glu-dev.tcz \
cairo-dev.tcz \
libjpeg-turbo-dev.tcz \
alsa-dev.tcz \
zlib_base-dev.tcz \
libpthread-stubs.tcz \
libXft-dev.tcz \
libXcursor-dev.tcz \
compiletc.tcz \
Xorg-7.7-bin.tcz \
man.tcz

./configure --prefix=/usr/local \
--enable-cygwin \
--enable-x11 \
--enable-cairo \
--enable-debug \
--enable-cp936 \
--enable-gl \
--enable-shared \
--enable-threads \
--enable-localjpeg \
--enable-localzlib \
--enable-localpng \
--enable-xinerama \
--enable-xft \
--enable-xdbe \
--enable-xfixes \
--enable-xcursor \
--enable-xrender \
CFLAGS="-march=i486 -mtune=i686 -Os -pipe" \
CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe" \
LDFLAGS="-Wl,-O1"

# Configuration Summary
# -------------------------------------------------------------------------
#     Directories: prefix=/usr/local
#                  bindir=${exec_prefix}/bin
#                  datadir=${datarootdir}
#                  datarootdir=${prefix}/share
#                  exec_prefix=${prefix}
#                  includedir=${prefix}/include
#                  libdir=${exec_prefix}/lib
#                  mandir=${datarootdir}/man
#        Graphics: X11 + Xft + Xdbe + Xfixes + Xinerama + Xcursor + Xrender
# Image Libraries: JPEG=Builtin
#                  PNG=Builtin
#                  ZLIB=Builtin
#                  CAIRO=lib
#     Large Files: YES
#          OpenGL: YES
#         Threads: YES

On <x64> I only load a few extensions
(the HEAVY one is pretty much the same as above)
Code: [Select]
tce-load -i \
libXft-dev.tcz \
libX11-dev.tcz \
compiletc.tcz \
xorg-proto.tcz \
libXext-dev.tcz

./configure --prefix=/usr/local \
--localstatedir=/var \
CC="gcc -flto -fuse-linker-plugin" \
CXX="g++ -flto -fuse-linker-plugin" \
CFLAGS="-mtune=generic -Os -pipe" \
CXXFLAGS="-mtune=generic -Os -pipe" \
LDFLAGS="-Wl,-O1" \
--enable-xdbe \
--enable-xft \
--enable-shared

# Configuration Summary
# -------------------------------------------------------------------------
#     Directories: prefix=/usr/local
#                  bindir=${exec_prefix}/bin
#                  datadir=${datarootdir}
#                  datarootdir=${prefix}/share
#                  exec_prefix=${prefix}
#                  includedir=${prefix}/include
#                  libdir=${exec_prefix}/lib
#                  mandir=${datarootdir}/man
#        Graphics: X11 + Xft + Xdbe + Xrender
# Image Libraries: JPEG=Builtin
#                  PNG=System
#                  ZLIB=System
#     Large Files: YES
#          OpenGL: NO
#         Threads: YES

After enabling Xft support, UTF-8 encoded letters are displayed nicely on both platform. :D
All FLTK programs seem to load the installed font without any problem. 8)
Not necessary to recompile Xprogs and such.

Only dillo constantly switch to BIG5 encoding when browsing with google.
There're patches somewhere on the net that can fix the problem.
I'm not feeling to test that thought.

Why should we add Xft support to FLTK ?
Well, the "base-locale.tcz" extension is useless for people who need UTF-8 support.
Also, you can easily change the desired font for FLTK programs after that.

I suggest we create both "light weight" and "full support" type of FLTK extension
and use the LIGHT one as the default dependence

By the way, we can add a start-up script for HEAVY one to prevent loading of the light one
Code: [Select]
#!/bin/sh
touch /usr/local/tce.installed/fltk-light
Title: Re: Enable Xft support for FLTK ?
Post by: curaga on November 24, 2016, 11:13:50 AM
There used to be a fltk-xft extension. Why not submit one?
Title: Re: Enable Xft support for FLTK ?
Post by: polikuo on November 26, 2016, 05:32:55 AM
There used to be a fltk-xft extension. Why not submit one?

If I were to submit fltk-1.3.3 with (nearly) full support, should I patch the source code ?  ???
I found these patches on both x86 and x64

  fltk-no-printing.patch
  fl_x_core_font.patch

I think I'll name the extension "fltk-1.3-full"

By the way, should I go for fltk-1.3.4-1 ?
I can't compile fltk 1.3.3 downloaded from tinycorelinux.net
I kept getting error messages with the same approach  :o
Code: [Select]
=== making jpeg ===
/bin/sh: cd: line 3: can't cd to jpeg
Title: Re: Enable Xft support for FLTK ?
Post by: mcmkmp on January 30, 2017, 10:48:41 AM
Is this publicly available?
Title: Re: Enable Xft support for FLTK ?
Post by: coreplayer2 on January 30, 2017, 12:59:49 PM
I think I'll name the extension "fltk-1.3-full"
Somewhere in the instructions for Extension creation I remember reading it is recommended not to use version numbers in the extension name
Just and FYI
:)
Title: Re: Enable Xft support for FLTK ?
Post by: polikuo on January 31, 2017, 12:35:22 AM
I just mailed it.
Named fltk-full for both 32-bit 64-bit platform.
Be patient ~~  :)

If you just can't wait, send me a PM.
I'll send you a copy AFAP.