Ok, it was a long night, but finally I solved a problem that was bugging me for quite a while.
I love Kaffeine, it's a great player, but at one point, it stopped displaying subtitles. What's worst, I couldn't find how to load them from external file and well, I stopped using it.
Today, I finally found out how to deal with Kaffeine.
To load subtitles, following the instructions here:
Click on Playlist, right-click on the movie file you're displaying and in the context menu you'll find: Load subtitles.
Another serious problem is that the subtitles are ridiculously small. It was a real pain figuring that out, but with the help of link1 and link2, I managed it.
To change the size of the subtitles:
1. Open the file: /home/user/.kde4/share/apps/kaffeine/xine-config
2. Find the line saying subtitles.separate.subtitle_size: tiny
3. Uncomment that line (remove the #) if it is commented, and change "tiny" to whatever size you prefer (tiny small normal large very large huge). I tried with "large" and the subs became visibly big. So this one is working. You can also change the font from here, uncommenting the line: #subtitles.separate.font:sans but I didn't need to do that.
Well, that's it.
The mystery called subtitles in Kaffeine was solved. Weee!
P.S. If you need to replace some font of Xine, you can do it in the following directory:
/usr/share/xine/libxine1/fonts/
понеделник, 5 декември 2011 г.
петък, 2 декември 2011 г.
Convert png to eps
Yesterday, I had to convert some png files to high quality eps files and it wasn't an option to directly export the figures to eps files. It turned out the problem is not so simple, but anyway, here's what I've found.
First, there are some free programs which enable you to make pretty vector graphs, diagrams and so on: Inkscape, graphviz, TikZ and Ipe. source
The problem in my case was that I have to use png files. What's more, they had to use pretty. Well, the biggest problem seemed to be the resolution. Before exporting the figure to whatever, zoom it to the max. You need at least 300dpi, some say 600dpi. That means a figure which covers the whole computer screen (well, mine is a laptop screen). If you capture it from pdf, then zoom to 300% and then capture the figure. This should produce a decent-looking figure.
More on the issue of resolution:
*Try png2pdf or a similar tool specifying in it interpolation to be off source
* \setlength{\pdfpxdimen}{1in/150} % Define resolution of PDF source
* Convert the png->eps->pdf->eps
1.The resolution of the image in pixels should be 300 times the size of the image in inches as it appears in the document. So for example a 2 inch by 3 inch image should have a resolution of at least 600 by 900.
2. ps2pdf -sPAPERSIZE=letter -dMaxSubsetPct=100 -dCompatibilityLevel=1.3 -dSubsetFonts=true -dEmbedAllFonts=true -dAutoFilterColorImages=false -dAutoFilterGrayImages=false -dColorImageFilter=/FlateEncode -dGrayImageFilter=/FlateEncode -dMonoImageFilter=/FlateEncode Fig1_a.eps Fig1_a.pdf
pdftops -eps Fig1_a.pdf Fig1_a
ps2eps Fig1_a
/home/denijane/Fig1_a.eps source
3. I tried also the following step (but they didn't help)
1. Save a Matlab figure from Matlab to EPS format.
2. Run ps2pdf14 -dPDFSETTINGS=/prepress unembedded_fig.eps embedded_fig.pdf.
Note: You can check the font is embedded by running
pdffonts embedded_fig.pdf
and check that the normal Helvetica font is embedd as BGISHF+Helvetica, for example.
3. You can either build your latex document with pdflatex, usepackage{graphicx} & \includegraphics{embedded_fig.pdf}, OR
4. run pdftops -eps embedded_fig.pdf embedded_fig.eps
5. run ps2eps embedded_fig.eps
which will crop eps to bounding box.
6. rename embedded_fig.eps.eps to embedded_fig.eps
7. Build your latex document with latex, usepackage{graphicx} & \includegraphics{embedded_fig.eps}.
Finally, check the font is embedded by running
pdffonts ~/my_article.pdf
and check that the normal Helvetica font is embedd as BGISHF+Helvetica. source
4. The package bmeps: To convert from png to high level eps use:
bmeps -a -leps image.png
bmeps image.png image.eps
bmeps -l eps2 fbt.png fbt2.eps
And also, the following packages might help:
\usepackage[T1]{fontenc}
\usepackage{ifpdf}
\usepackage{graphicx}
source
For eps file level 3:
bmeps -l eps3 Fig9_b.png Fig9_b.eps
or
convert Fig1_a.png EPS3:Fig1_a.eps
First, there are some free programs which enable you to make pretty vector graphs, diagrams and so on: Inkscape, graphviz, TikZ and Ipe. source
The problem in my case was that I have to use png files. What's more, they had to use pretty. Well, the biggest problem seemed to be the resolution. Before exporting the figure to whatever, zoom it to the max. You need at least 300dpi, some say 600dpi. That means a figure which covers the whole computer screen (well, mine is a laptop screen). If you capture it from pdf, then zoom to 300% and then capture the figure. This should produce a decent-looking figure.
More on the issue of resolution:
*Try png2pdf or a similar tool specifying in it interpolation to be off source
* \setlength{\pdfpxdimen}{1in/150} % Define resolution of PDF source
* Convert the png->eps->pdf->eps
1.The resolution of the image in pixels should be 300 times the size of the image in inches as it appears in the document. So for example a 2 inch by 3 inch image should have a resolution of at least 600 by 900.
2. ps2pdf -sPAPERSIZE=letter -dMaxSubsetPct=100 -dCompatibilityLevel=1.3 -dSubsetFonts=true -dEmbedAllFonts=true -dAutoFilterColorImages=false -dAutoFilterGrayImages=false -dColorImageFilter=/FlateEncode -dGrayImageFilter=/FlateEncode -dMonoImageFilter=/FlateEncode Fig1_a.eps Fig1_a.pdf
pdftops -eps Fig1_a.pdf Fig1_a
ps2eps Fig1_a
/home/denijane/Fig1_a.eps source
3. I tried also the following step (but they didn't help)
1. Save a Matlab figure from Matlab to EPS format.
2. Run ps2pdf14 -dPDFSETTINGS=/prepress unembedded_fig.eps embedded_fig.pdf.
Note: You can check the font is embedded by running
pdffonts embedded_fig.pdf
and check that the normal Helvetica font is embedd as BGISHF+Helvetica, for example.
3. You can either build your latex document with pdflatex, usepackage{graphicx} & \includegraphics{embedded_fig.pdf}, OR
4. run pdftops -eps embedded_fig.pdf embedded_fig.eps
5. run ps2eps embedded_fig.eps
which will crop eps to bounding box.
6. rename embedded_fig.eps.eps to embedded_fig.eps
7. Build your latex document with latex, usepackage{graphicx} & \includegraphics{embedded_fig.eps}.
Finally, check the font is embedded by running
pdffonts ~/my_article.pdf
and check that the normal Helvetica font is embedd as BGISHF+Helvetica. source
4. The package bmeps: To convert from png to high level eps use:
bmeps -a -leps image.png
bmeps image.png image.eps
bmeps -l eps2 fbt.png fbt2.eps
And also, the following packages might help:
\usepackage[T1]{fontenc}
\usepackage{ifpdf}
\usepackage{graphicx}
source
For eps file level 3:
bmeps -l eps3 Fig9_b.png Fig9_b.eps
or
convert Fig1_a.png EPS3:Fig1_a.eps
сряда, 9 ноември 2011 г.
How to enable/disable/empty the swap
My Sabayon seems to have the habit of writing stuff into the swap and then forgetting about them. So I thought for a while, why not just empty the swap when it's full and I'm sure nothing is using it. Well, it turned out it's possible to do so. Thanks to this forum post, now I know how.
So, there are the commands:
>$swapoff
>$swapon
which can be safely used to turn on and off the swap. Now, the source site suggests using ">$swapoff /dev/hdxx" but if you have only one swap partition (like I do) this is unnecessary.
All you need to do is (as sudo, of course):
>$swapoff -a
and after it finishes emptying your swap,
>$swapon -a
And it's done. You have a fresh swap file, which you can start trashing immediately.
Now, if you do that when a program is still writing to the swap, I don't know what will happen. Maybe something ugly, maybe not. I tested it when nothing was using the swap even though my ram was almost full, and I haven't noticed any problems for now.
Enjoy!
Абонамент за:
Публикации (Atom)