Font anti-aliasing in Tk applications

I wanna tell you about font anti-aliasing in Tk applications, for example in Python IDLE

look, aliased fonts view, it is harmful for your eyes!

 

 

 

 

Ok, to solve this problem, i talk to your a little info about why it so :

Tk didn’t supported anti-aliasing before 8.5 version of Tk, for  more information

Font rendering: Now uses anti-aliased text under X11, and a more modern text engine (ATSUI) on Mac OS X.

http://www.tcl.tk/software/tcltk/8.5.html

First, must be installed all the necessary packages, then Tk compiled with Xft support.

1.Download Xft sources

http://xorg.freedesktop.org/releases/individual/lib/libXft-2.3.0.tar.bz2

unpack, configure by default

you, may be see something like this

checking if gcc -std=gnu99 supports -Werror… yes
checking if gcc -std=gnu99 supports -Werror=attributes… yes
Package xorg-macros was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-macros.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘xorg-macros’ found
checking for XRENDER… yes
checking for FREETYPE… yes
checking for FONTCONFIG… configure: error: Package requirements (fontconfig >= 2.5.92) were not met:

No package ‘fontconfig’ found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables FONTCONFIG_CFLAGS
and FONTCONFIG_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Install fontconfig(fontconfig, fontconfig-dev), xrender (libxrender, xrender-dev), freetype(freetype, freetype-dev), etc ..

After installing all the necessary packages you will see something like this

checking for XRENDER… yes
checking for FREETYPE… yes
checking for FONTCONFIG… yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating xft.pc
config.status: creating src/Makefile
config.status: creating man/Makefile
config.status: creating config.h
config.status: creating include/X11/Xft/Xft.h
config.status: include/X11/Xft/Xft.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

then make and make install

by default it will be installed in    /usr/local/lib, not in /usr/local/X11R6/lib

ice@ice:~> ls /usr/X11R6/lib/
fglrx          libfglrx_dm.so    libfglrx_dm.so.1.0  libGL.so.1    modules
libfglrx_dm.a  libfglrx_dm.so.1  libGL.so            libGL.so.1.2
ice@ice:~>

ice@ice:~> ls /usr/local/lib
libpython3.2m.a  libtkstub8.5.a  libXft.so.2      python2.6   tcl8.5
libtcl8.5.so     libXft.a        libXft.so.2.3.0  python3.2   tclConfig.sh
libtclstub8.5.a  libXft.la       perl5            python.png  tk8.5
libtk8.5.so      libXft.so       pkgconfig        tcl8        tkConfig.sh
ice@ice:~>

 

then unpack Tk, and configure with option –enable-xft2

ice@ice:~/python/tk8.5.11/unix> ./configure –enable-xft2
checking for Tcl configuration… found /home/ice/python/tcl8.5.11/unix/tclConfig.sh
checking for existence of /home/ice/python/tcl8.5.11/unix/tclConfig.sh… loading
checking for tclsh… /usr/local/bin/tclsh8.5
checking for tclsh in Tcl build directory… /home/ice/python/tcl8.5.11/unix/tclsh
- – -  - – -  - – -  - – -  - – -  - – -  - – -  - – -  - – -  - – -  - – -  - – -  - – -  - – -  - – -

make && make install

after all that, start Python IDLE and enjoy from different view, anti-aliasing is enabled!

 

 

 

 

 

/usr/bin/google-chrome: error while loading shared libraries: libudev.so.0: cannot open shared object file: No such file or directory

For solving problem with this error

ice@linux:~> google-chrome
/usr/bin/google-chrome: error while loading shared libraries: libudev.so.0: cannot open shared object file: No such file or directory
ice@linux:~>

install this packages libudev and libudev-devel

 

i586-suse-linux/bin/ld: cannot find -lXext

/usr/lib/gcc/i586-suse-linux/4.3/../../../../i586-suse-linux/bin/ld: cannot find -lXext
collect2: ld returned 1 exit status
make[1]: *** [_qt.so] Error 1
make[1]: Leaving directory `/home/ice/PYTHON/PyQt-x11-gpl-4.9/_qt’
make: *** [all] Error 2

Must be installed xorg-x11-libXext and xorg-x11-libXext-devel

ImportError: No module named readline

When you compiling python rememeber that some dev packages must be installed before, for example

Python build finished, but the necessary bits to build these modules were not found:
_bsddb    _curses_panel     _sqlite3
_ssl          bsddb185             bz2
dbm          gdbm                    sunaudiodev
zlib            readline
To find the necessary bits, look in setup.py in detect_modules() for the module’s name.

after installing python you could saw something like this

ice@linux:~> python
Python 2.7.3 (default, Apr 29 2012, 14:52:08)
[GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
Traceback (most recent call last):
File “/etc/pythonstart”, line 7, in
import readline
ImportError: No module named readline
>>>

For solving install readline-devel and ncurses-devel

and recompile python again

IDLE can’t import Tkinter. Your Python may not be configured for Tk

If you have this error

ice@ice:~> idle
** IDLE can’t import Tkinter. Your Python may not be configured for Tk. **
ice@ice:~>

do these steps

Install tcl, install tk, then python.

Note :
before all must be installed xorg-x11-libXext and xorg-x11-libXext-devel

linux:/home/ice/PYTHON/tcl8.5.11/unix #./configure
- – - – - – - – - – - – - – - – - – - – - – - – - – - –

linux:/home/ice/PYTHON/tcl8.5.11/unix #make
- – - – - – - – - – - – - – - – - – - – - – - – - – - –

linux:/home/ice/PYTHON/tcl8.5.11/unix # make install
Installing libtcl8.5.so to /usr/local/lib/
Installing tclsh as /usr/local/bin/tclsh8.5
Installing tclConfig.sh to /usr/local/lib/
Installing libtclstub8.5.a to /usr/local/lib/
Installing message catalogs
Creating msgs
Making directory /usr/local/lib/tcl8.5/opt0.4
Making directory /usr/local/lib/tcl8.5/http1.0
Making directory /usr/local/lib/tcl8.5/encoding
Making directory /usr/local/lib/tcl8.5/../tcl8
Making directory /usr/local/lib/tcl8.5/../tcl8/8.3
Making directory /usr/local/lib/tcl8.5/../tcl8/8.4
Making directory /usr/local/lib/tcl8.5/../tcl8/8.4/platform
Making directory /usr/local/lib/tcl8.5/../tcl8/8.5
Installing header files
Installing library files to /usr/local/lib/tcl8.5
Installing library http1.0 directory
Installing package http 2.7.7 as a Tcl Module
Installing library opt0.4 directory
Installing package msgcat 1.4.4 as a Tcl Module
Installing package tcltest 2.3.3 as a Tcl Module
Installing package platform 1.0.10 as a Tcl Module
Installing package platform::shell 1.1.4 as a Tcl Module
Installing library encoding directory
Installing and cross-linking top-level (.1) docs
Installing and cross-linking C API (.3) docs
Installing and cross-linking command (.n) docs
linux:/home/ice/PYTHON/tcl8.5.11/unix #

linux:/home/ice/PYTHON/tk8.5.11/unix # ./configure
- – - – - – - – - – - – - – - – - – - – - – - – - – - –

linux:/home/ice/PYTHON/tk8.5.11/unix # make
- – - – - – - – - – - – - – - – - – - – - – - – - – - –

linux:/home/ice/PYTHON/tk8.5.11/unix # make install
Making directory /usr/local/lib/tk8.5
Creating package index /usr/local/lib/tk8.5/pkgIndex.tcl
Installing libtk8.5.so to /usr/local/lib/
Installing wish as /usr/local/bin/wish8.5
Installing tkConfig.sh to /usr/local/lib/
Installing libtkstub8.5.a to /usr/local/lib/
Making directory /usr/local/lib/tk8.5/images
Making directory /usr/local/lib/tk8.5/msgs
Making directory /usr/local/lib/tk8.5/ttk
Installing header files
Installing library files to /usr/local/lib/tk8.5
Installing library ttk directory
Installing library images directory
Installing translation directory
Making directory /usr/local/lib/tk8.5/demos
Making directory /usr/local/lib/tk8.5/demos/images
Installing demos to /usr/local/lib/tk8.5/demos/
Installing demo images
Installing and cross-linking top-level (.1) docs
Installing and cross-linking C API (.3) docs
Installing and cross-linking command (.n) docs
linux:/home/ice/PYTHON/tk8.5.11/unix #

then you can install python

and now try idle

amd-driver-installer-12-1-x86.x86_64.run install on debian

For 64bit systems before doing anything.

sudo apt-get install ia32-libs

Run each of these, one at the time, if getting any faults ignore it.

sudo sh /usr/share/ati/fglrx-uninstall.sh
sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev*

Remove your xorg.conf file

sudo rm /etc/X11/xorg.conf

Re-install xorg

sudo apt-get install --reinstall libgl1-mesa-glx:i386
 libgl1-mesa-glx:amd64 libgl1-mesa-dri:i386 libgl1-mesa-dri:amd64 xserver-xorg-core

Configure xorg

sudo dpkg-reconfigure xserver-xorg

Reboot:

sudo reboot

After the reboot all the fglrx packages will be gone, you will be using default ones.

Download the newest ATI driver (current version is 12.1)

wget http://www2.ati.com/drivers/linux/amd-driver-installer-12-1-x86.x86_64.run

Once downloaded go to the file location and set it to run as executable

cd /path_of_the_file
chmod 755 amd-driver-installer-12-1-x86.x86_64.run

Use these steps to install

sh ./amd-driver-installer-12-1-x86.x86_64.run --buildpkg Ubuntu/oneiric
sudo dpkg -i fglrx*.deb

Once the driver is installed you need to start up a new xorg.conf file with this command

sudo aticonfig --initial -f

Reboot

sudo reboot

true multi-part support doesn’t exist yet

If you have this error

ice@ice:~/SLED11$ unzip SLED11.zip
Archive:  SLED11.zip
warning [SLED11.zip]:  zipfile claims to be last disk of a multi-part archive;
attempting to process anyway, assuming all parts have been concatenated
together in order.  Expect “errors” and warnings…true multi-part support
doesn’t exist yet (coming soon).
file #1:  bad zipfile offset (local header sig):  4
ice@ice:~/SLED11$

 

I advice you to do so

ice@ice:~/SLED11$ ls
SLED11.md5  SLED11.z02  SLED11.z04  SLED11.z06  SLED11.zip
SLED11.z01  SLED11.z03  SLED11.z05  SLED11.z07

 

all parts must be concatenated

ice@ice:~/SLED11$ cat SLED11.z01 SLED11.z02 SLED11.z03 SLED11.z04 SLED11.z05 SLED11.z06 SLED11.z07 SLED11.zip > SLED11_ALL.zip
ice@ice:~/SLED11$ ls
SLED11_ALL.zip  SLED11.z01  SLED11.z03  SLED11.z05  SLED11.z07
SLED11.md5      SLED11.z02  SLED11.z04  SLED11.z06  SLED11.zip

 

ice@ice:~/SLED11$ unzip SLED11_ALL.zip
Archive:  SLED11_ALL.zip
error: End-of-centdir-64 signature not where expected (prepended bytes?)
(attempting to process anyway)
warning [SLED11_ALL.zip]:  zipfile claims to be last disk of a multi-part archive;
attempting to process anyway, assuming all parts have been concatenated
together in order.  Expect “errors” and warnings…true multi-part support
doesn’t exist yet (coming soon).
warning [SLED11_ALL.zip]:  3670016000 extra bytes at beginning or within zipfile
(attempting to process anyway)
file #1:  bad zipfile offset (local header sig):  3670016004
(attempting to re-compensate)
inflating: SLED11.iso

 

ice@ice:~/SLED11$ more SLED11.md5
# MD5 checksums generated by MD5summer (http://www.md5summer.org)
# Generated 22.07.2010 13:47:179d9df59c63a05168cbdc75fd6a991d21 *SLED11.iso
ice@ice:~/SLED11$ md5sum SLED11.iso
9d9df59c63a05168cbdc75fd6a991d21  SLED11.iso
ice@ice:~/SLED11$

An easy way to create a yum repository on RHEL/CentOS 5.x with ISO images

1 )

# mkdir /media/dvd/

2)

# mount -o loop /root/DISTRO_NAME.iso /media/dvd

for example

# mount -o loop /root/rhel5.1-dvd.iso /media/dvd

3)

# cd /media/dvd/Server/

# find  /media  -iname   ‘createrepo*’
/media/dvd/Server/createrepo-0.4.11-3.el5.noarch.rpm

#rpm -ivh /media/dvd/Server/createrepo-0.4.11-3.el5.noarch.rpm

4)

#cd /media/
#createrepo .

5)

create and open file

/etc/yum.repos.d/dvdiso.repo

paste here

[MailRepo]
name=MailRepo
baseurl=file:///media/
enabled=1
gpgcheck=0

6)

# yum clean all
# yum list

An easy way to sync Gmail contacts with Thunderbird

To synchronize Gmail contacts with Thunderbird’s address book install Google Contacts

Open Thunderbird.Go to Tools->Addons.Type Google Contacts.Install it.

Restart Thunderbird.

Mozilla Firefox 11, Thunderbird 11 in tray

After googling a lot of time i have found addon for it.

Open Thunderbird, the same is applied to FF too.

Tools-> Addons

Search firetray, install it

Restart Thunderbird.After restarting it will be in tray.

 

 

 

« Older posts