[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

2112.0. "Font help please" by SMAC10::VINER (Sometimes I lead,sometimes I follow ) Tue Jan 23 1990 11:53

    Oh no not FONTs again !
    
    Please can someone point me to a good source of info,maybe even
    an example, that will let me/my customer do the following :-
                                
    Create his own BDF font file - I have a .PS Adobe description
    Convert and load this font onto his VAXstation
    Access the font from an Application.
    
    The eventual usage is to create a font of "graphic" characters that
    will represent resources , such as lorries,aircraft etc , on a map
    background.
    
    yours hopefully
    
    SteveV
    
T.RTitleUserPersonal
Name
DateLines
2112.1or help fontTOOLEY::B_WACKERTue Jan 23 1990 16:032
Once you have the bdf the rest is in appendix A of one of the xlib 
manuals.
2112.2Font compiler infoSTAR::VATNEPeter Vatne, VMS DevelopmentTue Jan 23 1990 17:1011
See Appendix A of the VMS DECwindows Guide to Xlib Programming:
MIT C Binding (or VAX Binding).  This describes how to run the
font compiler from DCL to produce the DECW$FONT binary file.
You can use any text editor to create the source BDF file.

Once you've compiled the font, you should copy it to the directory
SYS$COMMON:[SYSFONT.DECW.USER_75DPI] or [SYSFONT.DECW.USER_100DPI],
and then reset the server by logging out and logging in again.

To use the font, the application should specify whatever font name
appears in the BDF file.
2112.3ThanksSMAC10::VINERSometimes I lead,sometimes I follow Wed Jan 24 1990 04:207
    .2 Thanks for the pointer
    
    My doc says *** To be supplied ***
    
    Time to pull the latest verion over I think !
    
    
2112.4Bit ordering too.TALLIS::ZANZERKIAWed Jan 24 1990 10:0921
    RE: .0
    	If you plan to use the BITMAP editor to create the bitmap you need to 
    convert the output to BDF style bitmap info. (bit ordering is different)
    
    i.e	"------***"	- blank * filled.
    
    	BITMAP will write out                     
    	0xc0 0x01
    	
    Following is needed for BDF bitmap information.
    
    	Flip bits within each byte (x0c0 [11000000] becomes 03 [00000011])
    	03    80
    
    	NOTE: You must maintain # of rows as per font height (i.e 9x22
    		font should have 22 rows of hex data)
    
    	I have a very primitive program to do the above. Send me mail
    	if you need a copy.
    
    Robert
2112.5BDF font editorNRMACP::WATSONBecause Daddy says so...thats whyWed Jan 24 1990 12:01189
    RE: .0
    
    (Hi Steve!)
    
    Well, your lucks in!  I've just this minute finished writing a rudimentary 
    BDF font editor.  It's been posted to ELKTRA::DW_EXAMPLES, note 337.
    Go there for the sources...
    
    Have fun!
    
    Rob
    
          <<< ELKTRA::NOTESPUBLIC:[NOTES$LIBRARY]DW_EXAMPLES.NOTE;1 >>>
                           -< "DECwindows examples" >-
================================================================================
Note 337.0                       BDF Font editor                       3 replies
NRMACP::WATSON "Because Daddy says so...thats why"  170 lines  24-JAN-1990 11:25
--------------------------------------------------------------------------------
    Well, I finally got so fed up of saying "No we don't have a font editor
    for DECwindows" to customers that I decided to write my own.  No
    guarantees, but it seems adequate for most purposes.
    
    I've tested it on VMS, VAX/Ultrix and RISC/Ultrix.
    
    Here is the README file, replies will contain C source, UIL and a
    sample font.  If anyone manages to produce any really useful fonts,
    please let me know.
    
    -- Rob
    
    
    << FONT_EDITOR.README >>
    

	SIMPLE DECWINDOWS BDF FONT EDITOR
	---------------------------------

Author:	Rob Watson
	Workstation specialist
	NRMACP::WATSON
	DTN 841-3115

This is a simple DECwindows font editor.  It can be used to create BDF (Binary
Distribution Format) fonts, which can then be converted into SNF (Server Natural
Format) using the font compiler.

There are lots of limitations and bugs, but it is OK for most purposes.

Main limitations (some may be removed if I get time):

	All glyphs (characters) must have the same bounding box, with the
	character origin being within the bounding box.
		(the compiler can optimise the bounding boxes anyway)
	Fonts are limited to maximum size of 32x32 pixels
	Can only edit BDF files created by this program
	Very little error checking!
	Maximum of 128 characters per font 
	Assumes 75 DPI resolution
	Cannot specify many font characteristics 
		(e.g. caps height, x height, foundry, weight etc)

	Assumes left to right fonts only


Instructions
------------
To compile the program:

	(VMS)	$ cc font_editor
		$ link font_editor,sys$input/opt
		sys$library:decw$dwtlibshr.exe/share
		<cntl/Z>
		$ uil font_editor

	(Ultrix) % cc -o font_editor font_editor.c -ldwt -lX11
		 % dxuil -o font_editor.uid font_editor
	

To use the font editor 

	(VMS)	$ Run font_editor

or	(Ultrix) % font_editor

There is a simple example font in the file demo.bdf

To read this in enter "demo" in the font name field and hit "Open". Make changes
to the font by selecting the character you require with the character index
slider, then edit the bitmap.  The pixels in the bitmap are changed using any
mouse button.  Pixels are either set, cleared or inverted in the rectangle
between where the button is pressed and where it is released.

The small square window shows the current glyph at actual size, with the ASCII
representation (in the default X font) directly underneath.  The "show font"
button displays a separate window with the complete font displayed.  The
characters are displayed within the font bounding box, not using the character
spacing.

The font name, height, width, character origin and number of characters can also
be changed.  When finished, change the name of the font if required, then save
the font using  the "Save" button.  

Fonts can either be fixed or variable width.  The font width specifies the size
of the maximum bounding box of the font, and is the same for all glyphs.  The
glyph width is the actual width of the character, and may be different for each
character in a variable width font.  Changing the glyph width of a fixed width
font changes it for all characters.

To compile and load the font (VMS):
-----------------------------------

Compile the font using

	 $ font  name.bdf [/min/report]

replacing "name" with the name of your font to produce a name.decw$font file. 
The /report option produces a name.decw$rep file which gives a full description
of the font, and the /min option minimises the bounding boxes to improve font
drawing performance.

Copy the resulting name.DECW$FONT to SYS$COMMON:[SYSFONT.DECW.USER_75DPI]
You need system privileges to do this. 
Reset the font path using:

	$ run set_font_path

If you do not have system privileges, you can add one of your own directories to
the font search path using this program.

To try the font out, start up Notepad (DECwindows V2 only), choose the
"Customize font" menu option, and you should see your font (with the foundry
name "Digital" unless you have changed it) in the list.

Some fonts don't seem to work in Notepad - I havent worked out why, but am
willing to be educated.  Other applications can use the font via the Xdefaults
mechanism.

You can also list the available fonts to check that yours has been loaded using:

	$ run list_fonts

For VAX/Ultrix 
--------------

Compile the font using:

	dxfc [-m -r reportfile] name.bdf >name.dwf

Copy the name.dwf file to one of the directories in the font path.
Use  the xset utility to find and reset the font path:

	xset -q			To query the font path

75 DPI fonts are usually in    /usr/lib/dwf/75dpi

	xset fp rehash		To rescan the font directories

	xlsfonts		To check in font is loaded

	xfd name		To display the font


For RISC/Ultrix
---------------

The font compiler on RISC is different from VAX/Ultrix.  It does not like
the "COPYRIGHT" line in the bdf file.  Edit the name.bdf file to remove this
line and change the STARTPROPERTIES line from 23 to 22.

Compile the font using

	xfc name.bdf >name.snf

Copy the .snf file to a font directory (use xset -q to find the font path).
Normally this is /usr/lib/X11/fonts/decwin/screen75.
In this directory there is a "fonts.dir" file which must be edited (the file is
set read only by default).  Edit this, increasing the number in the first line
of the file by one, and adding a new line at the bottom of the file which looks
like this:

name.snf -Digital-name-Medium-R-Normal--12-115-75-75-P-80-Digital-FONTSPECIFIC

replacing "name.snf" by the filename of your font, and using the full font name
as specified in the name.bdf file.

Then rescan the font directories using xset fp rehash as for VAX/Ultrix.

    
    
2112.6Example of BDF fileCALL::SWEENEYPatrick Sweeney in New YorkSun Jan 28 1990 13:372
    ELKTRA::DW_EXAMPLES note 199 has a simple example of a BDF file and
    some instructions on how to use it for defining your own fonts.