topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday March 29, 2024, 8:32 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - bpcw001 [ switch to compact view ]

Pages: [1]
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!

6
Jibz's Tools / Dina for Linux/X11 - solved !
« on: March 22, 2007, 06:33 PM »
Hallo,

I just wanted to let you know that I finally managed to create a set of .BDF and .PCF files
that work with Linux X11 in both the "old" X font system as well as with fontconfig :)

I'd like to share these for every Linux user out there who wants to use the excellent Dina programming
font.
Hence, if somebody feels like hosting two 40K tar.gz files somewhere, please let me know

bpcw001


7
Jibz's Tools / Re: Dina programming font for X11 use
« on: March 14, 2007, 11:53 AM »
Hi f0dder,

thanks for your input.

However, the remaining problems are of different nature. So let me reiterate:

Dina can be made to work in X. Hence any application that uses X's font system or an own font customization mechanism can be configured to use Dina.
This is the case with VIM, EMACS and the genuine XTerm.

Unfortunately, not everything running in X uses X's own font system. There is an application called "fontconfig", which sits on top of X and has its own mechanism to
serve fonts to applications which don't use raw X or their own font customization mechanism, but rely on GTK or QT, such as the popular desktop environments
GNOME and KDE and all applications based on their libraries.

The problem is with the "fontconfig" application which does not pick up Dina properly or even doesn't pick Dina up at all.
Thus, if fontconfig does not "see" Dina, GNOME and KDE applications will not be able to use Dina.

Hence, all this boils down to finding a proper configuration for the application "fontconfig" and/or finding out how a bitmapped font must be
crafted in order to be accepted by fontconfig.

Thanks for your attention.

bpcw001




8
Jibz's Tools / Re: Dina programming font for X11 use
« on: March 14, 2007, 04:28 AM »
Hi Jibz,

thanks for your input and the link to the files.
The .BDF files are exactly the ones you get when taking apart the Windows Dina.FON file with fnt2bdf.

Both .BDF and the bdftopcf-converted .pcf and .pcf.gz files will work in X itself. That's the good news.

Bad news is that fontconfig (which is responsible for serving fonts to Desktop Environments like Gnome or KDE)

- picks up the .BDF file and hence Dina displays as choosable font in KDE/Gnome font selection dialogs, but upon choosing
  Dina, a different substitute font is actually used instead

- does not pick up the .pcf or .pcf.gz file at all

Those fontconfig issues are quite known amongst those still willing to use bitmapped fonts in Linux.
The creators of fontconfig apparently decided to no longer give bitmap fonts an appropriate treatment in their software.
They seem to think that nobody uses them any more and everyone wants a blurred, antialiased TrueType desktop (ugh!)

Maybe I can figure out an appropriate configuration of fontconfig, but I'm slowly giving up on this one.

Thanks for your help anyway

bpcw001



9
Jibz's Tools / Re: Dina programming font for X11 use
« on: March 13, 2007, 08:40 AM »
Hi,

thanks for your response.
I'll definitely post a solution to using Dina with Linux if I ever manage to find one, but the situation looks pretty bleak right now  :(
Unfortunately, my knowledge of font internals in general and Linux font specials (X font system, fontconfig etc) is quite limited.

So, I might actually contact Jibz in order to get some qualified input.

bpcw001



10
Jibz's Tools / Re: Dina programming font for X11 use
« on: March 13, 2007, 04:29 AM »
Hi,

just wanted to share with you that I've started messing around with Dina.FON in Linux.
With fnt2bdf (from Wine) I was able to create the .BDF files corresponding to each size and weight provided by Dina.FON

After that, I converted the BDF files with bdftopcf to obtain .PCF files for use with X.

However, something goes awry here since, while I can see the .PCF font in X itself, it does not show up font selection
dialogs of KDE or Gnome. And this is the case because fontconfig does not pick those fonts up.

I read somewhere that fontconfig will pick up bitmapped fonts only if they are encoded either iso8859 or iso10646.

Well, Dina has Windows encoding, so I tried to reencode the .BDFs to iso8859 with fontforge before converting them to .PCF, but fontconfig still doesn't pick up Dina.

I also tried to let fontconfig just pick up the .BDF file. Then, Dina shows up in Gnome's or KDE's font selection dialogs, but the font that is then actually chosen
is not Dina, but some monospace substitute.


I can use other bitmapped fonts (like Clean) in X, KDE and Gnome without any problems.

Anybody has an idea ??

Thanks

bpcw001


11
Jibz's Tools / Dina programming font for X11 use
« on: March 12, 2007, 07:36 AM »
Hi,

recently came across the Dina programming font and for me it's the best font
for coding ever.
It is perfect for Windows, however, I'm using Linux and would like to to ask
if there is any way to make this beautiful font work in X11 and KDE/Gnome.

AFAIK, X11 does not handle Windows .FON files.
Could you point me in some direction as to how to make Dina available on X11/KDE/Gnome?

Thank you

bpcw

Pages: [1]