Messages - bpcw001 [ switch to compact view ]

Pages: [1] 2 3next
1
Jibz's Tools / Re: Dina for Linux/X11 - solved !
« on: January 08, 2008, 09:42 AM »
Can anyone provide directions for installing Dina on Ubuntu Gutsy?  In particular I would like to use it with emacs.  tia

Ubuntu has bitmapped fonts disabled by default.
You need to run "dpkg-reconfigure fontconfig-config". At some point of the dialogs that come up you will be asked if you'd like to enable bitmapped fonts. Answer this with yes.
Then, unpack the Dina PCF files in any directory below /usr/share/fonts (e. g. into /usr/share/fonts/Dina) and run "dpkg-reconfigure fontconfig".
Open a console and check with "fc-list | grep Dina" that Dina is there as medium, bold, italic, and bold italic.

Now that the font should be available to X11, Gnome and KDE.

Emacs may have its own font configuration mechanism. Since I don't use emacs, I wouldn't know about that. Sorry.
Maybe someone else here can fill us in on the emacs font selection.


2
Jibz's Tools / Re: Dina for Linux/X11 - solved !
« on: March 23, 2007, 05:04 AM »
Sure. For example: Dina 8pt, italic, medium

fnt2bdf conversion generates a .BDF containing the old style font name. However, it misses to incorporate
significant info contained in this font string into the BDF properties part. The important bulding blocks for our purpose are:
                                                                                                         
                                                                Name        Slant   X and Y resolution in DPI      original encoding
                                                                  |              |                      |    |               |
-> generated old style X font name: -windows-Dina-medium-i-normal--13-80-96-96-c-70-microsoft-cp1252
                                                                          |                     |   |   
                                                                        Weight       Pixelsize   Pointsize                               

So what I added in the properties section of the BDF is:

FACE_NAME "Dina"                  -> font face
FAMILY_NAME "Dina"               -> font family
WEIGHT_NAME "Medium"          -> "Medium" or "Bold", dependent on what we have
SLANT "I"                              -> "I" for Italic, "R" for regular non-italics. Without this, fontconfig can't tell the difference between Italic and Regular font shapes!
PIXEL_SIZE 13                       -> this is the pixelsize found in the generated old-style X font name
POINT_SIZE 80                      -> this is the point size found in the generated old-style X font name
RESOLUTION_X 96                  -> X-resolution found in the generated old-style X font name
RESOLUTION_Y 96                  -> Y-resolution found in the generated old-style X font name
CHARSET_REGISTRY "ISO8859" -> encoding: first part
CHARSET_ENCODING "1"          -> encoding: second part, so whole encoding will be iso8859-1

The encoding stuff is bit of magic and I admit that I'm not perfectly clear why this works, since the original encoding is Microsoft cp1252 and I claim it to be ISO8859-1 in the BDF.
I found out that it needs to be done that way for fontconfig to pick the font up, and it is the way other bitmapped fonts converted from Windows do it too.
Contrary to my first attempts where I actually tried to re-encode the fonts from Microsoft encoding to iso8859-1, this is just a "redeclaration" of the encoding.
Maybe it works because the first 128 or 255 characters are at the same places in both encodings anyway.

The properties section in a BDF is enclosed by the keywords STARTPROPERTIES and ENDPROPERTIES. The number found after STARTPROPERTIES is the number of properties actually found between these two key words, so if you add/remove property entries, be sure to adjust this number accordingly, otherwise bdftopcf will bail out with an error when compilation into .PCF is attempted.

I'm just wondering about providing a custom version of fnt2bdf which does all that or at least allows to specify things via command line parameters.
Once I'll find the time, I might have a look at the fnt2bdf source code.


bpcw001

3
Jibz's Tools / Re: Dina for Linux/X11 - solved !
« on: March 23, 2007, 04:32 AM »
Learned how to use the "modify" function  ;)

4
Jibz's Tools / Re: Dina for Linux/X11 - solved !
« on: March 23, 2007, 04:29 AM »
Sure. No secret here. It's basically the procedure I described in my previous thread about Dina.

1. Take the Windows .FON file and convert it to .BDF files with fnt2bdf (which comes with Wine).
2. The .BDF files generated by this tool are pretty incomplete in terms of header information. That's why the fonts basically work in X, but fontconfig
    requires well-formed BDFs so it doesn't pick them up.
    Since .BDF files are text files, I found out which header information to add by reading the BDF spec and comparing the Dina headers to the headers of a bitmap font that already worked
    with X and fontconfig.
    Hence, I completed the missing info in the Dina .BDF headers. It is basically information like slant, weight, font name and - as seems most important - the encoding info which is needs
    to be set to ISO8859-1 for fontconfig to pick it up.
3. Convert .BDF files to .PCF files with bdftopcf (standard X tool).

Yeah, it's always easy as soon as you know how to do it right  ;)

Installation of the fonts
=================
1. In theory, you can use either the .BDF files or the .PCF files. The .PCF files are compiled and may provide better performance in X. I only tested with .PCFs.
2. Just copy the set of font files to a directory which is in X's and fontconfig's font path.
3. run "mkfontdir" in the respective font directory.
4. run "xset fp rehash"
5. run "fc-cache -f"
6. check with "fc-list | grep Dina" that Dina is there as medium, bold, italic, and bold italic.
7. Restart KDE or GNOME or whatever desktop environment you might use in order to have Dina available
   in the font selection dialogs.

bpcw001

5
Jibz's Tools / Re: Dina for Linux/X11 - solved !
« on: March 22, 2007, 07:09 PM »
Oh, I didn't realize that. OK. Here come the files. Enjoy!

Pages: [1] 2 3next
Go to full version