PDA

View Full Version : [ubuntu] how to check if a font is installed or not ?



winzip
November 14th, 2012, 07:59 AM
I have a font-installation manual as this ...




As root/superuser, run:
apt-get install ttf-sinhala-lklug ibus im-switch ibus-m17n m17n-db m17n-contrib
language-pack-si-base



From your user account (i.e. not root) run:
rm -f ~/.xinput.d/* ; im-switch -z all_ALL -s ibus



Logout and login again. Environment variables need to be set/updated (NO NEED TO REBOOT)

From your user account (i.e. not root) select your keyboard layouts by running:
ibus-setup




How do I check if this font has already been installed or not in the system ? Is there any command to check ?

OS: Ubuntu 10 Server Edition

carl4926
November 14th, 2012, 08:04 AM
Check in
/usr/share/fonts

winzip
November 14th, 2012, 08:10 AM
Check in
/usr/share/fonts

There would be many font listing ...is not it ? How do I check if this particular font has been installed or not ? what to search ?

pkadeel
November 14th, 2012, 08:23 AM
There would be many font listing ...is not it ? How do I check if this particular font has been installed or not ? what to search ?
most probably font name will be sinhala.ttf lklug.ttf or something like that. Alternately you can open any text editor like gedit and the installed font shall be present in that list.

NikTh
November 14th, 2012, 08:26 AM
Hi ,

I guess the font is this => ttf-sinhala-lklug
you can see if installed with

dpkg -l | grep -i sinhalaor search in /usr/share/fonts like this

rgrep -i sinhala /usr/share/fonts/

Thanks

raja.genupula
November 14th, 2012, 08:36 AM
Actually there is command to list all the fonts installed . that is fc-list
http://manpages.ubuntu.com/manpages/hardy/man1/fc-list.1.html

winzip
November 14th, 2012, 08:39 AM
Alternately you can open any text editor like gedit and the installed font shall be present in that list.

its UBUNTU 10 SERVER EDITION ....no GUI supported.

raja.genupula
November 14th, 2012, 08:42 AM
its UBUNTU 10 SERVER EDITION ....no GUI supported.


Then you got cat command which display the content of a file .


cat <filename>

pkadeel
November 14th, 2012, 08:45 AM
its UBUNTU 10 SERVER EDITION ....no GUI supported.
In that case you can do

fc-list | grep -i lklug

NikTh
November 14th, 2012, 08:49 AM
Actually there is command to list all the fonts installed . that is fc-list

Didn't know that .
Learning every day :)
Thanks

Elfy
November 14th, 2012, 08:49 AM
Use color and font properties for highlighting portions of your text, and not for all of the text in your post. Please use the default font color and properties unless you need to highlight or draw attention to a part of your post. ALL CAPS is interpreted as screaming. Funky non-uniform font size/color is difficult for those who are visually impaired. If you are having problems with reading the font, please adjust your browser.

Color removed.

raja.genupula
November 14th, 2012, 09:00 AM
Didn't know that .
Learning every day :)
Thanks

Welcome My friend .

winzip
November 14th, 2012, 09:07 AM
Actually there is command to list all the fonts installed . that is fc-list
http://manpages.ubuntu.com/manpages/hardy/man1/fc-list.1.html

I get this ....

$ fc -list
-bash: fc: -i: invalid option
fc: usage: fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]

winzip
November 14th, 2012, 09:11 AM
Hi ,

rgrep -i sinhala /usr/share/fonts/Thanks


I get this ...

$ rgrep -i sinhala /usr/share/fonts/
grep: /usr/share/fonts/: No such file or directory

raja.genupula
November 14th, 2012, 09:12 AM
I get this ....

$ fc -list
-bash: fc: -i: invalid option
fc: usage: fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]


See there is no space between fc & -list

actual command

fc-list

pkadeel
November 14th, 2012, 09:13 AM
I get this ....

$ fc -list
-bash: fc: -i: invalid option
fc: usage: fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]
-list is not an aurgument to fc command here. fc-list is itself a cammand. and this fc-list will list all installed fonts which might become quite difficult to read so use grep to find the most probable font name as I mentioned in my last post. That command shall spit out all possible entries with "lklug" which in your case is the font name "lklug.ttf" which is a sinhala language font.

raja.genupula
November 14th, 2012, 09:15 AM
I get this ...

$ rgrep -i sinhala /usr/share/fonts/
grep: /usr/share/fonts/: No such file or directory


actually you have to read something
here you go


There are various locations in GNU/Linux in which fonts can be kept. These locations are defined in /etc/fonts/fonts.conf; standard ones include /usr/share/fonts, /usr/local/share/fonts, and /home/<username>/.fonts (where <username> is your user name).
The easiest way to install a truetype font is to press alt-F2 and enter the following code (this will open nautilus in the right directory):

gksu nautilus /usr/share/fonts/truetypeThen create a new directory, name the directory whatever you like (choose a name that you remember if you ever need to backup your fonts personal fonts). Copy the fonts into that directory and finally rebuild the font information files by pressing alt-F2, mark 'run in terminal' so you can see the progress and entering the following code:

sudo fc-cache -f -v

source:https://wiki.ubuntu.com/Fonts

winzip
November 14th, 2012, 09:19 AM
See there is no space between fc & -list

actual command

fc-list

I get this ...

$ fc-list
The program 'fc-list' is currently not installed. To run 'fc-list' please ask your administrator to install the package 'fontconfig'

I'm not administrator. Is there any other way I can check whether font ttf-sinhala-lklug is installed or not ?

raja.genupula
November 14th, 2012, 09:21 AM
I get this ...

$ fc-list
The program 'fc-list' is currently not installed. To run 'fc-list' please ask your administrator to install the package 'fontconfig'

I'm not administrator. Is there any other way I can check whether font ttf-sinhala-lklug is installed or not ?

in the post No. #17 , there are all possible locations to have fonts and they all wort a try.

winzip
November 14th, 2012, 09:21 AM
actually you have to read something
here you go



source:https://wiki.ubuntu.com/Fonts

Is there any command which could search all these required font-paths to check if ttf-sinhala-lklug has been installed or not ?
I may not be sure how many such font-paths would be in the system.

NikTh
November 14th, 2012, 09:26 AM
I get this ...

I'm not administrator. Is there any other way I can check whether font ttf-sinhala-lklug is installed or not ?

If you are not administrator (you have not root privileges) then you cannot install anything. So I assume the installation you described in first post not permitted.

Alternatively you can try to search in various folders (see @raja.genupula's post above) or use the locate command


locate sinhala
or

locate lklug

raja.genupula
November 14th, 2012, 09:47 AM
If you are not administrator (you have not root privileges) then you cannot install anything. So I assume the installation you described in first post not permitted.

Alternatively you can try to search in various folders (see @raja.genupula's post above) or use the locate command


locate sinhalaor

locate lklug


Yeah +1 .

winzip
November 14th, 2012, 09:56 AM
So I assume the installation you described in first post not permitted.


I'm not installing . I a checking whether administrator has installed or forgot to install. I looked up the manual to find the font-name. Now I am trying to find whether it has been installed or not .



Alternatively you can try to search in various folders (see @raja.genupula's post above) or use the locate command


locate sinhalaor

locate lklug

Will try this and post result here ........is not locate ttf-sinhala-lklug should be better here ?

pkadeel
November 14th, 2012, 10:14 AM
I'm not installing . I a checking whether administrator has installed or forgot to install. I looked up the manual to find the font-name. Now I am trying to find whether it has been installed or not .



Will try this and post result here ........is not locate ttf-sinhala-lklug should be better here ?
if the install was done recently and the .deb package is still in the apt cache then using
locate ttf-sinhala-lklug
might also work. to confirm this you can look in /var/cache/apt/archives folder were all the downloaded .debs are kept till cache cleaning.

winzip
November 14th, 2012, 10:21 AM
I'm not installing . I a checking whether administrator has installed or forgot to install. I looked up the manual to find the font-name. Now I am trying to find whether it has been installed or not .



Will try this and post result here ........is not locate ttf-sinhala-lklug should be better here ?

I get this ...

$locate sinhala
/usr/share/vim/vim72/keymap/sinhala-phonetic_utf-8.vim
/usr/share/vim/vim72/keymap/sinhala.vim

$locate lklug ------------> returns nothing

$locate ttf-sinhala-lklug -----------> returns nothing


Does this mean sinhala fonts are installed ?

raja.genupula
November 14th, 2012, 10:34 AM
$locate sinhala
/usr/share/vim/vim72/keymap/sinhala-phonetic_utf-8.vim
/usr/share/vim/vim72/keymap/sinhala.vim

That means they got for VIM and not for total system .

raja.genupula
November 14th, 2012, 10:35 AM
ask your administrator to get them installed and fc-list for future need .

winzip
November 14th, 2012, 10:38 AM
That means they got for VIM and not for total system .


What it would have returned if it were for total system ?

raja.genupula
November 14th, 2012, 10:40 AM
What it would have returned if it were for total system ?
it should return from the any location that i have mentioned in the post # 17.

winzip
November 14th, 2012, 10:45 AM
Thanks.

I have got a sudo access now .... I'll try installing now....can you please tell how to install fcconfig first so that I can use fc-list in future need ?

Also does fcconfig installation requires a reboot ? I am using putty

I'll keep on posting updates here.

winzip
November 14th, 2012, 11:07 AM
<I'm closing this thread now >

pkadeel
November 14th, 2012, 11:26 AM
Is this the correct command to install font config ?

sudo apt-get install fontconfig

Do I need a reboot ?
yes the format of command is correct.
I don't think a reboot shall be required.

winzip
November 14th, 2012, 11:31 AM
Can you please tell whether fontconfig installation is successful ?

I don't see any success message here and hence I'm worried.


$sudo apt-get install fontconfig


Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
openbravo-erp : Depends: openjdk-6-jdk but it is not going to be installed
Depends: postgresql but it is not going to be installed
Depends: postgresql-contrib but it is not going to be installed
Depends: postgresql-client
Depends: ant
Depends: ant-optional
Depends: libapache2-mod-jk but it is not going to be installed
Depends: libtcnative-1 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

pkadeel
November 14th, 2012, 11:46 AM
No it was not installed and it recommends that you first check your system for unmet dependencies using


apt-get -f install

I suggest though you better focus on installing the font and other things required which you mention in your other thread instead of going for the fontconfig package.

winzip
November 14th, 2012, 11:56 AM
No it was not installed and it recommends that you first check your system for unmet dependencies using


apt-get -f install
I suggest though you better focus on installing the font and other things required which you mention in your other thread instead of going for the fontconfig package.

Thanks...you are right.

when I do this apt-get -f install ...it says "After this operation, 96.2MB of additional disk space will be used".

I aborted this....its not high priority.



Well, I'm going ahead with the font installation then...

manual says this ...


As root/superuser, run:
apt-get install ttf-sinhala-lklug ibus im-switch ibus-m17n m17n-db m17n-contrib
From your user account (i.e. not root) run:
rm -f ~/.xinput.d/* ; im-switch -z all_ALL -s ibus
Logout and login again. Environment variables need to be set/updated (NO NEED TO REBOOT)
From your user account (i.e. not root) select your keyboard layouts by running:
ibus-setup





Can you please tell what are ibus im-switch ibus-m17n m17n-db m17n-contrib ? I don't think these are fonts. what are these ?

shall I skip these and run this instead ..

apt-get install ttf-sinhala-lklug

pkadeel
November 14th, 2012, 12:15 PM
Thanks...you are right.

when I do this apt-get -f install ...it says "After this operation, 96.2MB of additional disk space will be used".

I aborted this....its not high priority.



Well, I'm going ahead with the font installation then...

manual says this ...


As root/superuser, run:
apt-get install ttf-sinhala-lklug ibus im-switch ibus-m17n m17n-db m17n-contrib
From your user account (i.e. not root) run:
rm -f ~/.xinput.d/* ; im-switch -z all_ALL -s ibus
Logout and login again. Environment variables need to be set/updated (NO NEED TO REBOOT)
From your user account (i.e. not root) select your keyboard layouts by running:
ibus-setup





Can you please tell what are ibus im-switch ibus-m17n m17n-db m17n-contrib ? I don't think these are fonts. what are these ?

shall I skip these and run this instead ..

apt-get install ttf-sinhala-lklug
As far as I know, these are input method switcher packages means keyboard layout switcher. Might be required if you want to type in sinhali. I am not sure about the studio version you are using but on a normal desktop version these a preinstalled yet I never had to use these to switch my keyboard layout for complex text languages.

winzip
November 14th, 2012, 12:25 PM
I am not sure about the studio version you are using

I'm using Ubuntu 10 server edition.

I put a locate command to check if these are per-installed or not.. ...this is what I get


$locate ibus
/lib/libusb-0.1.so.4
/lib/libusb-0.1.so.4.4.4
/lib/modules/2.6.35-22-generic-pae/kernel/drivers/media/dvb/dvb-usb/dvb-usb-dibusb-common.ko
/lib/modules/2.6.35-22-generic-pae/kernel/drivers/media/dvb/dvb-usb/dvb-usb-dibusb-mb.ko
/lib/modules/2.6.35-22-generic-pae/kernel/drivers/media/dvb/dvb-usb/dvb-usb-dibusb-mc.ko
/usr/lib/libusb-0.1.so.4
/usr/share/doc/libusb-0.1-4
/usr/share/doc/libusb-0.1-4/README.Debian
/usr/share/doc/libusb-0.1-4/changelog.Debian.gz
/usr/share/doc/libusb-0.1-4/changelog.gz
/usr/share/doc/libusb-0.1-4/copyright
/usr/src/linux-headers-2.6.35-22/arch/ia64/include/asm/sn/pcibus_provider_defs.h
/usr/src/linux-headers-2.6.35-22-generic-pae/include/config/dvb/usb/dibusb
/usr/src/linux-headers-2.6.35-22-generic-pae/include/config/dvb/usb/dibusb/mb.h
/usr/src/linux-headers-2.6.35-22-generic-pae/include/config/dvb/usb/dibusb/mc.h
/var/lib/dpkg/info/libusb-0.1-4.list
/var/lib/dpkg/info/libusb-0.1-4.md5sums
/var/lib/dpkg/info/libusb-0.1-4.postinst
/var/lib/dpkg/info/libusb-0.1-4.postrm
/var/lib/dpkg/info/libusb-0.1-4.shlibs


$locate im-switch
/usr/share/language-selector/data/im-switch.blacklist


$locate ibus-m17n ---->returns nothing

$locate m17n-db ---->returns nothing

$locate m17n-contrib ---->returns nothing



Shall I just shoot .....

apt-get install ttf-sinhala-lklug

or

apt-get install ttf-sinhala-lklug ibus im-switch ibus-m17n m17n-db m17n-contrib

?

pkadeel
November 14th, 2012, 12:28 PM
I'm using Ubuntu 10 server edition.
That is what I ment. I am not sure about it because I have never used it.

winzip
November 14th, 2012, 12:33 PM
That is what I ment. I am not sure about it because I have never used it.

have updated my post with findings ...which command to shoot ? what do you think ?

I may not require keyboard stuff at this moment .....but rather interested to install the font.


(because my web application hosted in this Box is generating pdf files and characters becoming scrambled)

pkadeel
November 14th, 2012, 12:37 PM
first only install the font

sudo apt-get install ttf-sinhala-lklug
Then check if your actual requirement is met or not. If your actaul requirement is not satisfied then you can always install the remaining packages.

winzip
November 14th, 2012, 12:39 PM
first only install the font

sudo apt-get install ttf-sinhala-lklugThen check if your actual requirement is met or not. If your actaul requirement is not satisfied then you can always install the remaining packages.

Ok thanks...

will check installation and update here soon.

winzip
November 14th, 2012, 12:42 PM
first only install the font

sudo apt-get install ttf-sinhala-lklugThen check if your actual requirement is met or not. If your actaul requirement is not satisfied then you can always install the remaining packages.


font not installed .....I get this ....

$sudo apt-get install ttf-sinhala-lklug

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
openbravo-erp : Depends: openjdk-6-jdk but it is not going to be installed
Depends: postgresql but it is not going to be installed
Depends: postgresql-contrib but it is not going to be installed
Depends: postgresql-client
Depends: ant
Depends: ant-optional
Depends: libapache2-mod-jk but it is not going to be installed
Depends: libtcnative-1 but it is not going to be installed
ttf-sinhala-lklug : Depends: defoma but it is not going to be installed
Recommends: x-ttcidfont-conf but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

winzip
November 14th, 2012, 12:48 PM
is not this font exist in the system by default ?

or I need to download from the internet first ?

winzip
November 14th, 2012, 12:51 PM
Here is the font download link tinyurl

http://tinyurl.com/czcympj

Can you please check if you are able to install this font...

Please tell me the steps if you get any success.

pkadeel
November 14th, 2012, 12:54 PM
font not installed .....I get this ....

$sudo apt-get install ttf-sinhala-lklug

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
openbravo-erp : Depends: openjdk-6-jdk but it is not going to be installed
Depends: postgresql but it is not going to be installed
Depends: postgresql-contrib but it is not going to be installed
Depends: postgresql-client
Depends: ant
Depends: ant-optional
Depends: libapache2-mod-jk but it is not going to be installed
Depends: libtcnative-1 but it is not going to be installed
ttf-sinhala-lklug : Depends: defoma but it is not going to be installed
Recommends: x-ttcidfont-conf but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Well as you are not the admin of this machine and have borrowed sudo access to frank, let me suggest you a simple and easy method to achieve your goal.

All you need right now is to have a simple font file installed on your system. Correct me if I am wrong.

Now download the font from the web and put it in /usr/share/fonts/truetype/sinhala folder and rebuild font cache.

winzip
November 14th, 2012, 01:21 PM
Well as you are not the admin of this machine and have borrowed sudo access to frank, let me suggest you a simple and easy method to achieve your goal.



I am testing and simulating in a local system now where I am logging into the system with root userid..

Here is what happens without sudo

$apt-get install ttf-sinhala-lklug

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
openbravo-erp : Depends: openjdk-6-jdk but it is not going to be installed
Depends: postgresql but it is not going to be installed
Depends: postgresql-contrib but it is not going to be installed
Depends: postgresql-client
Depends: ant
Depends: ant-optional
Depends: libapache2-mod-jk but it is not going to be installed
Depends: libtcnative-1 but it is not going to be installed
ttf-sinhala-lklug : Depends: defoma but it is not going to be installed
Recommends: x-ttcidfont-conf but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

winzip
November 14th, 2012, 01:24 PM
Now download the font from the web and put it in /usr/share/fonts/truetype/sinhala folder and rebuild font cache.

I have downloaded from the web.....Its a .tar.gz file.

I have a /usr/share/fonts/truetype/ folder.

I think you suggest me to make a sinhala folder here and put .tar.gz file here.

Don't I require to uncompress it ? also how a admin rebuild font cache ?

pkadeel
November 14th, 2012, 01:26 PM
Here is the font download link tinyurl

http://tinyurl.com/czcympj

Can you please check if you are able to install this font...

Please tell me the steps if you get any success.
The package present on this link contains a fonts folder besides other installable things.

Now I don't about the folder structure of your computer so you have to choose a location where you can download this package and replace "/path/where/you/can/download" with that path. replace "http://package_url with the complete file url"
first check whether sinhala and tamil folders are present in your fonts dir or not



cd /usr/share/fonts/truetype
ls -l
if the folders are present then skip the next 2 mkdir commands otherwise do


sudo mkdir sinhala
sudo mkdir tamil


cd /path/where/you/can/download
wget -v http://tinyurl.com/czcympj -O icta_sinhala_tamil_installer_ubuntu_0.2.tar.gz
tar -zxf icta_sinhala_tamil_installer_ubuntu_0.2.tar.gz
cd icta_sinhala_tamil_installer_ubuntu/files/fonts/sinhala
sudo cp *.ttf /usr/share/fonts/truetype/sinhala/
cd ..
cd tamil
sudo cp *.ttf /usr/share/fonts/truetype/tamil/
sudo fc-cache -fv

raja.genupula
November 14th, 2012, 01:29 PM
<I'm closing this thread now >


Hey

have you solved the issue ?

winzip
November 14th, 2012, 01:33 PM
The package present on this link contains a fonts folder besides other installable things.

Now I don't about the folder structure of your computer so you have to choose a location where you can download this package and replace "/path/where/you/can/download" with that path. replace "http://package_url with the complete file url"
first check whether sinhala and tamil folders are present in your fonts dir or not



cd /usr/share/fonts/truetype
ls -l
if the folders are present then skip the next 2 mkdir commands otherwise do


sudo mkdir sinhala
sudo mkdir tamil


cd /path/where/you/can/download
wget -v http://tinyurl.com/czcympj -O icta_sinhala_tamil_installer_ubuntu_0.2.tar.gz
tar -zxf icta_sinhala_tamil_installer_ubuntu_0.2.tar.gz
cd icta_sinhala_tamil_installer_ubuntu/files/fonts/sinhala
sudo cp *.ttf /usr/share/fonts/truetype/sinhala/
cd ..
cd tamil
sudo cp *.ttf /usr/share/fonts/truetype/tamil/
sudo fc-cache -fv


Thanks.....this is very much helpful.....I'll try this....I'll update here my findings ....please visit this post again....I'll have a break for 2 hours now....I'll post after 2 hours.

pkadeel
November 14th, 2012, 01:42 PM
Hey

have you solved the issue ?
nope he is on another thread now.
http://ubuntuforums.org/showthread.php?t=2083986

uRock
November 14th, 2012, 01:52 PM
Duplicate threads merged.

winzip
November 15th, 2012, 12:35 PM
font cache build not working

# fc-cache -fv
The program 'fc-cache' is currently not installed. You can install it by typing:
apt-get install fontconfig

pkadeel
November 15th, 2012, 01:58 PM
font cache build not working

# fc-cache -fv
The program 'fc-cache' is currently not installed. You can install it by typing:
apt-get install fontconfig
After sending my last post I realized that you will again get stuck at cache update stage. Well I do not know about any other method to update font cache except this command. So you have only two options left I guess
Either get fontconfig package installed somehow
Or wait for someone else who knows how to rebuild font cache.