Skip to main content

Posts

Showing posts from August, 2012

Non-English characters: How are they displayed

We have come a long way since every time we needed to read some non-English texts we needed to install special fonts in Windows. After I started using Linux I always wondered how does all these types of characters display so perfectly. I knew that it was Unicode. But what I didn't grasp immediately is how the OS can display such an enormous variety of characters. Unicode is not just a character set like we learnt in school. Instead it is an encoding algorithm (in some sense). What it does is that it assigns numbers different basic characters and then any characters can be constructed out of these elementary characters. What happens is that two characters like a and '   are merged to get  รก. People who know LaTeX would instantly realize that this is how LaTeX also works. But this composting is done in the browser directly in the OS itself not as a separate software. This process is called "pre-composition" or "decomposition" depending on how the mergi

How to add and synchronize subtitles

This is tutorial on Adding subtitle to a video clip and synchronizing it correctly.  Shifting the subtitles correctly for out of sync subtitles. Adding subtitle to a video clip Lets say that the video clip is from a movie and we want to cut the subtitles from that portion of the movie and add it to this clip. The only problem is that the subtitles files are written in a continuous manner which makes it difficult to plain cut and paste operation of the relevant section.  The steps involved are -- 1.Get the subtitle file.  2. Get the relevant portion of the subtitle file from the whole srt file and save it in another srt file. If for eg. we want know some words at the beginning and the end we can extract the text from the srt file using grep. Example file : The relevant section is in yellow. 1220 01:53:46,980 --> 01:53:48,140 Father-in-law! 1221 01:54:17,648 --> 01:54:23,780 I'm a foreigner , I came from foreign... 1222 01:

Ubuntu screen lock freeze

Ubuntu screen lock freeze is a OpenGL problem. Fix it by setting  --- Install Compiz Settings Manager: Code: sudo apt-get install compizconfig-settings-manager -Go to OpenGL plug-in & uncheck the Sync to VBlank option. http://www.preshweb.co.uk/2011/05/ubuntu-11-04-x-freezing-after-screensaver-active-laptop-lid-closed/ If you are already into the fix restart X by opening a tty Ctrl+Fn > root login . Type /etc/init.d/lightdm restart for Ubuntu 12.04 or later or /etc/init.d/gdm restart for others. If you are using any other display manager then restart it instead.