Showing posts with label fonts. Show all posts
Showing posts with label fonts. Show all posts

15 March 2014

566. Briefly: Annoying warnings when plotting using gnuplot and octave on wheezy March 2014.

Note: I'm not going to give a proper fix for this, but rather a work-around -- and one which isn't very good at that.

When using gnuplot or plotting in octave on wheezy I keep getting the following warnings.
Fontconfig warning: "/etc/fonts/conf.d/41-arphic-ukai.conf", line 16: Having multiple  in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/41-arphic-ukai.conf", line 16: Having multiple  in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/41-arphic-ukai.conf", line 16: Having multiple  in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/41-arphic-ukai.conf", line 16: Having multiple  in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/41-arphic-ukai.conf", line 16: Having multiple  in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/41-arphic-uming.conf", line 16: Having multiple  in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/41-arphic-uming.conf", line 16: Having multiple  in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/41-arphic-uming.conf", line 16: Having multiple  in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/41-arphic-uming.conf", line 16: Having multiple  in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/41-arphic-uming.conf", line 16: Having multiple  in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/41-arphic-uming.conf", line 28: Having multiple  in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/41-arphic-uming.conf", line 28: Having multiple  in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/41-arphic-uming.conf", line 28: Having multiple  in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/41-arphic-uming.conf", line 28: Having multiple  in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/41-arphic-uming.conf", line 28: Having multiple  in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/64-arphic-uming.conf", line 8: Having multiple values in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/64-arphic-uming.conf", line 21: Having multiple values in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/64-arphic-uming.conf", line 34: Having multiple values in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/64-arphic-uming.conf", line 47: Having multiple values in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/65-droid-sans-fonts.conf", line 103: Having multiple values in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/65-droid-sans-fonts.conf", line 138: Having multiple values in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/90-fonts-baekmuk.conf", line 10: Having multiple values in  isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/90-fonts-baekmuk.conf", line 23: Having multiple values in  isn't supported and may not work as expected

My 'solution' was a bit radical -- I had already set up a system with apt-pinning (http://verahill.blogspot.com.au/2014/03/562-pulling-in-glibc-214-from-testing.html) so I figured that pulling in the fonts from testing couldn't hurt, assuming there were no dependencies to worry about.

So I did:
sudo apt-get install -t testing fonts-arphic-uming
and this worked fine.

The old 41-arphic-uming.conf:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

<!--
  Serif faces
 -->
        <alias>
                <family>AR PL ShanHeiSun Uni</family>
                <family>AR PL ShanHeiSun Uni MBE</family>
                <family>AR PL UMing CN</family>
                <family>AR PL UMing HK</family>
                <family>AR PL UMing TW</family>
                <family>AR PL UMing TW MBE</family>
                <default><family>serif</family></default>
        </alias>
<!--
  Monospace faces
 -->
        <alias>
                <family>AR PL ShanHeiSun Uni</family>
                <family>AR PL ShanHeiSun Uni MBE</family>
                <family>AR PL UMing CN</family>
                <family>AR PL UMing HK</family>
                <family>AR PL UMing TW</family>
                <family>AR PL UMing TW MBE</family>
                <default><family>monospace</family></default>
        </alias>
</fontconfig>
The new 41-arphic-uming.conf:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

<!--
  Serif faces
 -->
        <alias>
                <family>AR PL ShanHeiSun Uni</family>
                <default><family>serif</family></default>
        </alias>
        <alias>
                <family>AR PL ShanHeiSun Uni MBE</family>
                <default><family>serif</family></default>
        </alias>
        <alias>
                <family>AR PL UMing CN</family>
                <default><family>serif</family></default>
        </alias>
        <alias>
                <family>AR PL UMing HK</family>
                <default><family>serif</family></default>
        </alias>
        <alias>
                <family>AR PL UMing TW</family>
                <default><family>serif</family></default>
        </alias>
        <alias>
                <family>AR PL UMing TW MBE</family>
                <default><family>serif</family></default>
        </alias>
<!--
  Monospace faces
 -->
        <alias>
                <family>AR PL ShanHeiSun Uni</family>
                <default><family>monospace</family></default>
        </alias>
        <alias>
                <family>AR PL ShanHeiSun Uni MBE</family>
                <default><family>monospace</family></default>
        </alias>
        <alias>
                <family>AR PL UMing CN</family>
                <default><family>monospace</family></default>
        </alias>
        <alias>
                <family>AR PL UMing HK</family>
                <default><family>monospace</family></default>
        </alias>
        <alias>
                <family>AR PL UMing TW</family>
                <default><family>monospace</family></default>
        </alias>
        <alias>
                <family>AR PL UMing TW MBE</family>
                <default><family>monospace</family></default>
        </alias>
</fontconfig>
It just remained to pull in the rest of the offending fonts:
sudo apt-get install -t testing fonts-arphic-ukai fonts-droid fonts-baekmuk

09 April 2013

383. WPS for Linux on Debain Wheezy -- Kingsoft Office for Linux

I've covered WPS already here: http://verahill.blogspot.com.au/2013/01/313-which-office-for-linux-users.html

However, given that everything is in Chinese (I'm not Chinese, but I've lived there and can just about struggle my way through a hundred common characters or so) I might as well make a post about how to install it.

Note that this is BETA software -- and there's no shortage of issues as you'll see below..

Intermission
Looking at the different discussion regarding it (e.g. here, here and here) I'm a bit bothered by some of the prejudice and xenophobia that abounds. I originally had a long discussion here, based on actually having lived in China, but it all boils down to:
Use reasonable firewall policies, monitor your computer for compromise, and take a healthy distrust to any commercial or political entity. Just like you always should, in particular with close source software and always with pre-compiled binaries (whether open or closed source). Be a bit more cautious than normal, since you probably don't visit Chinese BBS:s on a regular basis and might not hear about any problems -- security or otherwise --that users have identified.
Intermission over

Installing WPS
Go to http://linux.wps.cn/

You can figure out which link to click by hovering over the options. 下 means 'down', which gives an indication that it might be a link for downloading.
And it takes us here:

Download the package you want.


Note that downloading is very slow (5 kb/s), at least from Australia, as Chinese websites tend to be.

Some direct links are here otherwise -- only download one of the files (i.e. rpm, deb or 'generic'):
http://wdl.cache.ijinshan.com/wps/download/Linux/unstable/wps-office-8.1.0.3724-0.1.b1p2.i686.rpm
http://wdl.cache.ijinshan.com/wps/download/Linux/unstable/wps-office_8.1.0.3724~b1p2_i386.deb
http://wdl.cache.ijinshan.com/wps/download/Linux/unstable/wps-office_8.1.0.3724~b1p2_x86.tar.xz

Install dependencies. I'm presuming that you're on 64 bit linux -- in which case you'll need to add i386 as an architecture (sudo dpkg --add-architecture i386) in addition to installing ia32-libs. If you're on 32 bit linux you can omit ia32-libs. This blog spells out how to switch from Chinese to English
sudo apt-get install ia32-libs ttf-mscorefonts-installer
sudo dpkg -i wps-office_8.1.0.3724~b1p2_i386.deb
cd /opt/kingsoft/wps-office/office6/2052/
sudo rm qt.qm wps.qm wpp.qm et.qm

And then simply start

First look
We're still 'missing' some proprietary Microsoft fonts. So far the only effect of this is that I can't use the equation editor (greyed out), which is a big issue as far as I am concerned. 

On top of that, requiring a certain proprietary font set makes WPS almost useless as an alternative to MS Office, since it can be had for close to free in China.Add to that that in the west e.g. Wingdings 2 (which is useless for all other purposes) costs around $20, which is about 5-10 times more than an entire cracked office copy does in China.

In addition, I DO have libglu (-mesa) installed.

 Here's another big issue -- no open formats to save in.It's a bit TOO close to Office at this point.

If I try to export to PDF I get this error, which I presume is unrelated to the libGLU error before.

When I clicked to change user interface (see arrow) I ended up with this (Docer) which looks like an online directory. Still need someone to help me out with translating that.


Sorting out the fonts
Note that even if you follow all of the steps below you will still not be able to insert equations.

Attempt 1

I added  fonts from an XP iso that I had by following this thread. Note that it didn't actually solve anything and you will most likely gain nothing from following this procedure (but I wrote it up, so I'll post it)
sudo mount -o loop WinXP\ Pro\ US\ with\ SP1\ \&\ MS03-39.iso /mnt
cd /mnt/I386/
cp *.TT_ ~/tmp/fonts
cp *.FO_ ~/tmp/fonts
cd LANG/
cp *.TT_ ~/tmp/fonts
cp *.FO_ ~/tmp/fonts
cd ~/tmp/fonts
sudo apt-get install cabextract
cabextract *
sudo mkdir /usr/share/fonts/ms-truetype
sudo cp *.ttf /usr/share/fonts/ms-truetype
fc-cache -fv

But it didn't sort out Wingdings 2, Wingdings 3 and MT Extra.

Luckily, MT Extra could be sorted out like this:
Go to http://www.ufonts.com/download/mt-extra/30743.html, and download. Copy the ttf file to /usr/share/fonts/ms-truetype and run fc-cache -fv if the directory didn't already exist.

Attempt 2.
To sort out the rest you need to break the law/help someone break the law (depends on the jurisdiction):
First register at the WPS forums:
http://i.wps.cn/?mod=passport&act=register&do=showReg
 You'll first have to give a nickname.



Then go here: http://bbs.wps.cn/thread-22360374-1-1.html



Download by clicking on fonts.zip.
sudo apt-get install file-roller
cd ~/tmp/fonts
mkdir rpms
cd rpms
mv ~/Downloads/fonts.zip .
unzip fonts.zip

Use file roller to extract the ttf files from the rpms:

Then install them:
sudo mv *.ttf /usr/share/fonts/ms-truetype/

If you start WPS now you should not have any errors about missing fonts.

Conclusion
This is a beta, so we can accept that not everything is working properly. However, a beta is meant to hammer out bugs, not to be feature incomplete, so when there's a reliance on proprietary fonts and a lack of open file formats to save to, this means that the finished product won't be able to do that either.

And that pretty much precludes the use of WPS with just about anyone who has switched to Linux on their own volition.

On the other hand, it may ease the transition from Windows to Linux among computer-illiterate (and -agnostic) users -- the interface is quite familiar to those who have used Office 2007, and WPS renders files extremely faithfully -- much better than even Microsoft Live Office which can't handle Office 2003 files properly.


Links to this post:
http://naatti0.wordpress.com/2013/04/27/kingsoft-office-suite/

08 January 2012

41. Chinese character and input support on debian testing

Update: You should also install support for gtk and gtk3:
sudo apt-get install ibus-gtk3 ibus-gtk
in order to be able to use it with e.g. thunderbird.

Original post:
Here's how to set up Chinese (simplified) support in Gnome 3 /gnome-shell and the terminal (bash).

First install the fonts:
sudo apt-get install fonts-arphic-*

Next. add Chinese via locales:
sudo dpkg-reconfigure locales

Select
zh_CN.UTF-8

(For traditional characters choose zh_HK, zh_SG or zh_TW)

As default language English is probably a good idea
In my case it's en_AU.UTF-8

Edit ~/.bashrc and add the following lines:
LANGUAGE=zh_CN.UTF-8
LANG=zh_CN.UTF-8

Run
source .bashrc

Install ibus:
sudo apt-get install ibus-pinyin 
This pulls another 18 packages with it

Start ibus-daemon in terminal
An icon in the notification tray still appear
Right-click, choose Preferences (P)
Click on the second tab (input methods)
Select an input method -> Chinese -> Pinyin

You should now be able to choose between regular (latin) input and Chinese characters using Ctrl+Space.

To make ibus-daemon start with gnome, run
gnome-session-properties
and add
ibus-daemon

And you're more or less done.

Sogou is a popular pinyin database on the Windows platform -- but afaik it's not available for Linux. On Linux, it seems that the ibus-pinyin-db-open-phrase database is the default ibus database used to guess what characters you intend to type, but you can also install and select either ibus-googlepinyin or ibus-pinyin-db-android. After installation you need to select the database by going to preferences in the ibus daemon and selecting it as input method. Not being Chinese I can't tell whether sogou, google pinyin and android pinyin are comparable.

Sogou does however work with Google Chrome/Chromium on linux -- go to Preferences/Extensions -- Get More Extensions, and install the Sogou Cloud Pinyin Extension for Chrome.