Welcome Guest.   Make a donation to an author on the site September 03, 2014, 02:19:42 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Read the Practical Guide to DonationCoder.com Forum Search Features
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Dina for Linux/X11 - solved !  (Read 23623 times)
bpcw001
Honorary Member
**
Posts: 11

View Profile Give some DonationCredits to this forum member
« on: March 22, 2007, 06:33:54 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 smiley

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

Logged
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: March 22, 2007, 06:58:56 PM »

bpcw001: you can just attach it to a post here! smiley
Logged

bpcw001
Honorary Member
**
Posts: 11

View Profile Give some DonationCredits to this forum member
« Reply #2 on: March 22, 2007, 07:09:58 PM »

Oh, I didn't realize that. OK. Here come the files. Enjoy!

* Dina-BDF.tar.gz (42.18 KB - downloaded 1537 times.)
* Dina-PCF.tar.gz (35.59 KB - downloaded 3826 times.)
Logged
mouser
First Author
Administrator
*****
Posts: 33,295



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: March 22, 2007, 09:12:37 PM »

wonderful!
I hope jibz will add these to his official download page for Dina as well.
Logged
f0dder
Charter Honorary Member
***
Posts: 8,774



[Well, THAT escalated quickly!]

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: March 23, 2007, 01:55:11 AM »

Great for the linux users! smiley

You might want to tell the world how you managed to do it?
Logged

- carpe noctem
bpcw001
Honorary Member
**
Posts: 11

View Profile Give some DonationCredits to this forum member
« Reply #5 on: March 23, 2007, 04:29:37 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  Wink

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
« Last Edit: March 23, 2007, 05:19:45 AM by bpcw001 » Logged
bpcw001
Honorary Member
**
Posts: 11

View Profile Give some DonationCredits to this forum member
« Reply #6 on: March 23, 2007, 04:32:54 AM »

Learned how to use the "modify" function  Wink
« Last Edit: March 23, 2007, 05:18:11 AM by bpcw001 » Logged
f0dder
Charter Honorary Member
***
Posts: 8,774



[Well, THAT escalated quickly!]

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: March 23, 2007, 04:36:46 AM »

You can use 'edit post' instead of posting another one smiley

Just to be pesky, perhaps you can outline which header entries you needed to fix? Sorry for bugging, but this could end up being a good little cookbook recipe, perhaps something to add as a MINI-HOWTO.
Logged

- carpe noctem
bpcw001
Honorary Member
**
Posts: 11

View Profile Give some DonationCredits to this forum member
« Reply #8 on: March 23, 2007, 05:04:41 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
« Last Edit: March 23, 2007, 05:16:02 AM by bpcw001 » Logged
donarique
Participant
*
Posts: 1

View Profile Give some DonationCredits to this forum member
« Reply #9 on: June 04, 2007, 02:22:17 PM »

This is just what I was looking for.
Thanks a lot bpcw001!
Logged
jsyjr
Participant
*
Posts: 1

View Profile Give some DonationCredits to this forum member
« Reply #10 on: November 10, 2007, 10:18:12 AM »

Can anyone provide directions for installing Dina on Ubuntu Gutsy?  In particular I would like to use it with emacs.  tia
Logged
bpcw001
Honorary Member
**
Posts: 11

View Profile Give some DonationCredits to this forum member
« Reply #11 on: January 08, 2008, 09:42:37 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.

Logged
rxantos
Supporting Member
**
Posts: 100


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #12 on: May 20, 2010, 11:06:41 PM »

This worked for me on ubuntu 10 LTS

[copy or print]
sudo mkdir /usr/share/fonts/Dina
sudo cp Dina-PCF.tar.gz /usr/share/fonts/Dina
cd /usr/share/fonts/Dina
sudo tar -xvf Dina-PCF.tar.gz
sudo rm Dina-PCF.tar.gz
sudo rm /etc/fonts/conf.d/70-no-bitmaps.conf
sudo fc-cache -f -v

The last 2 lines I got from here:
http://www.alanbriolat.co...p-fonts-on-ubuntu-jaunty/


@bpcw001 Thank you for passing this to linux.  I really like this font.
Logged
msx_
Participant
*
Posts: 1


View Profile Give some DonationCredits to this forum member
« Reply #13 on: February 05, 2012, 02:32:26 PM »

This worked for me on ubuntu 10 LTS

[copy or print]
sudo mkdir /usr/share/fonts/Dina
sudo cp Dina-PCF.tar.gz /usr/share/fonts/Dina
cd /usr/share/fonts/Dina
sudo tar -xvf Dina-PCF.tar.gz
sudo rm Dina-PCF.tar.gz
sudo rm /etc/fonts/conf.d/70-no-bitmaps.conf
sudo fc-cache -f -v

The last 2 lines I got from here:
http://www.alanbriolat.co.uk/2009/04/enable-bitmap-fonts-on-ubuntu-jaunty/


@bpcw001 Thank you for passing this to linux.  I really like this font.

Thanks the autor of this awesome font for releasing it free and the rest of the guys for posting the tuto to make it work in buntuland! (Linux Mint 12 here).
I confirm that as this Sunday February 5th Dina's .PCF font files still works smooth.
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.059s | Server load: 0.03 ]