Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

2008-06-20

When apt-get install hangs

I encountered problems with error prone configuration processed by apt-get. Its usually fault of post-installation scripts. My diagnostic procedure is as follow:

  1. strace -f -o /tmp/strace.log apt-get install whatever

  2. less /tmp/strace.log and search of the package name from the end

  3. If the problem is with post-installation script, you will find some errors around /var/lib/dpkg/info/whatever.postinst

  4. Edit it and inspect why it can/can't start/stop service (for example)



Particularly in the last case /var/lib/dpkg/info/snmpd.postinst called

. /usr/share/debconf/confmodule

which hung. All script returned code error much higher then 0 :-)

How to fix it is another story.

2008-06-09

Font substitution in X Windows

The font technology incorporated in graphics systems (MS Windows, X Windows, printing) is really complicated. As George Williams, FontForge creator, mentioned in an interview, he wasn't concious of all purposes of OpenType features (the fragment about Arabic characters in OpenType).

That is why I'm not surprised how though is to configure fonts in Linux properly. But I found a nice guide on Ubuntu Forum, which can be a how-to for all X Windows systems: HOWTO: Hoary ClearType-like fonts. Don't be confused - you can modify the guide according to your personal preferences, and you don't need to copy MS Windows behavior on your desktop :-)

Here is my ~/.fonts.conf:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
  <test compare="more" name="pixelsize" qual="any">
   <double>12</double>
  </test>
  <edit name="autohint" mode="assign" >
   <bool>true</bool>
  </edit>
</match>
<match target="pattern">
  <test qual="any" name="family">
   <string>Arial</string>
  </test>
  <edit name="family" mode="assign">
   <string>DejaVu Sans Condensed</string>
  </edit>
</match>
<match target="pattern">   <test qual="any" name="family">    <string>Helvetica</string>   </test>   <edit name="family" mode="assign">    <string>DejaVu Sans Condensed</string>
  </edit>
</match>
<match target="pattern">
  <test qual="any" name="family">
   <string>sans-serif</string>
  </test>
  <edit name="family" mode="assign">
   <string>DejaVu Sans Condensed</string>
  </edit>
</match>
<match target="pattern">
  <test qual="any" name="family">
   <string>Times</string>
  </test>
  <edit name="family" mode="assign">
   <string>AntykwaTorunska</string>
  </edit>
</match>
<match target="pattern">
  <test qual="any" name="family">
   <string>serif</string>
  </test>
  <edit name="family" mode="assign">
   <string>AntykwaTorunska</string>
  </edit>
</match>
<match target="pattern">
  <test qual="any" name="family">
   <string>monospaced</string>
  </test>
  <edit name="family" mode="assign">
   <string>Inconsolata</string>
  </edit>
</match>
<match target="pattern">
  <test qual="any" name="family">
   <string>Courier</string>
  </test>
  <edit name="family" mode="assign">
   <string>Inconsolata</string>
  </edit>
</match>
</fontconfig>


After this disposition, you won't see Arial any more. Even on font list in preferences window Arial is substituted to a font specified in your ~/.fonts.conf. And mplayer's subtitles also :-)

PS
Zygfryd Gardzielewski's Antykwa Toruńska from 1960:

2008-06-07

Fonts - accented glyph

Some tricks to build accented glyphs. Its a draft as I'm still investigating the best solution to make diacritics.

I am going to experiment with quite nice monospace font SV Basic Manual designed by Johan Winge. On his page you find what inspired him.

Accented font should be built from base glyph and accent (or any other element changing its meaning). In Polish its kreseczka (similarly to acute, but not the same) and ogonek. Kreseczka creates mollification, similar to ñ. Ogonek - only in "a" and "e" significantly changes sound of the vowel, e.g. 'a' with ogonek sounds like the letter between 'm' and 'b' in word 'mobile'. Without it its as 'a' in 'farm' or 'ham'.

I use FontForge. To build diacritics its necessary to not mix contours and references. Contour is a closed line drawn in place. Reference is a kind of link to another glyph. To create new accented font copy reference to base glyph (<Ctrl+G>), and paste into place designed for that accented glyph in the glyph array. Then go to accent and create appropriate diacritics. To find proper place for it choose View -> Go to(<Ctrl+Shift+>>) and type 'acute' or 'ogonek' or whichever accent you are looking for. Unfortunately FontForge doesn't know kreseczka.

Sometimes its necessary to change shape of acute to create kreseczka,. It means its not possible to create glyphs with kreseczka automatically. During automatic accents build (an automatic process provided by FontForge) ogonek is also entered in wrong place.

TrueType fonts require "instructions" - it can be added automatically in Hints -> Autoinstr

Font with incomplete set of accented glyphs



SV Basic Manual by Johan Winge


Glyph "E"


Glyph "ogonek"

When you have all components ready to use, copy references to it - one by one - and paste to proper place for your new glyph. Then Save and Export Font. Voila!


Glyph "Eogonek"

2008-06-03

Pool



Results are here

Proggy




Lucida




Inoculata




FreeMono




Fixed




Courier




Anonymous




SV Basic




Consolas




Update 2008-06-25
I found similar topic covering the same subject different way. Very useful.

2007-08-07

ubuntu wine fglrx "API ERROR"

After ATI driver update you cannot use WINE. In the console you can see a lot of "API ERROR"s. To solve it you have to replace libGL library for older version. Please download it from this location and copy it to /usr/lib. If you do not know how to paste file in restricted area, you can do it as root: open console (terminal), and enter command:

sudo cp /dir_where_the_file_was_downloaded/libGL.so.1.2 /usr/lib

It works immediately.
You may want to copy the file to safe name /usr/lib/libGL.so.1.2.good, and after the next ATI drivers update use your own copy.

2006-10-19

Burning

Data:
mkisofs -o ./isofile.iso -R -V 'title of disk' ./file1.avi ./file1.txt

and

cdrecord -v -dummy -raw96r -driveropts=overburn,burnfree ./isofile.iso

and

cdrecord -v -raw96r -driveropts=overburn,burnfree ./isofile.iso

where /etc/default/cdrecord contains:
CDR_DEVICE=ATA:1,0,0
CDR_SPEED=24
CDR_FIFOSIZE=8m

Audio:
sudo cdrecord -v -raw96r -pad -audio -driveropts=burnfree,audiomaster ./*wav