This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ttmkfdir TrueType font directory prep tool (binary for Cygwin)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Harold Hunt" <huntharo@msu.edu> wrote in message
NHEELHJHHFKPMAEAFMFCKEEHCMAA.huntharo@msu.edu">news:NHEELHJHHFKPMAEAFMFCKEEHCMAA.huntharo@msu.edu...

> I downloaded ttmkfdir, ran it, and successfully added my TrueType
> fonts to the available fonts in XWin using xset.  However, I have
> tried numerous times, all unsuccessful, to start XWin with only the
> TrueType fonts via the -fp and -fn parameters to XWin.
> The first modification to make is obviously:
> XWin -fp /cygdrive/c/WINNT/Fonts
> I know that the above is correct, because if you drop the trailing
> 's' you'll get an error that the font path can't be added.  Thus,
> the font path command is correct.  However, you then get the "could
> not open default font 'fixed'" error.
> To fix the default font error I have tried to change the default
> font with the -fn paramter:
> XWin -fp /cygdrive/c/WINNT/Fonts -fn "Microsoft Sans Serif"
> or
> XWin -fp /cygdrive/c/WINNT/Fonts -fn Verdana
> I have tried tons of variations on the above, including lower case
> versions of the font names, quotes, no quotes, etc., but all of
> them result in the error of the form "could not open default font
> 'Microsoft Sans Serif'". I'm stumped.  I can't understand why I can
> see the Microsoft Sans Serif (albeit, in all lower-case) font in
> the list of fonts provided by
> 'xfontsel', yet I can't seem to specify a new default font.
> Specifying the font path and a new default font on the command line
> is highly desireable for the people that are trying to develop the
> absolute minimum size Cygwin/XFree86 distribution as possible.
> If anyone has any hints, I'd appreciate it.

Harold,

I'm glad you're finding it useful. It's certainly made my X desktop a
little less bland. I'm using Comic Sans for the font specifications
in system.twmrc! ;-)

Anyway, back to the problem.

First of all, you need to use X font naming for parameters like "-fn"
so the line you want might be something like;

XWin -fp <font-path> -fn
'-*-verdana-medium-r-*-*-12-*-*-*-*-*-iso8859-1' &

Make sure that you include the quotes otherwise the shell (or
cygwin1.dll) will expand the font name as a filename. You can use the
interactive xfontsel program to choose which font you want and to
copy the resultant name to the X clipboard using the "Select" button.
(If you're using a non-X editor, run xwinclip first to copy the X
clipboard to the Windows one as well.)

I've not tried it but XWin is probably assuming that certain basic
fonts are always available. You may therefore need to keep some of
the supplied X fonts. Either check the source or do a little more
trial and error to eliminate first the unneeded font directories and
then the unneeded fonts from the remaining ones.

Remember that if you use the "-fp" parameter you need to include all
the font directories i.e. it doesn't add the directory you specify to
the default font path that it already has.

I'm using something very similar to the following in startxwin.sh;

# Assemble the font path string
addfp () {
  if [ -r "$1/fonts.dir" ]; then
    if [ -z "$fp" ]; then
      fp="$1"
    else
      fp="$fp,$1"
    fi
  fi
}
unset fp
addfp /usr/X11R6/lib/X11/fonts/misc
addfp /usr/X11R6/lib/X11/fonts/Speedo
addfp /usr/X11R6/lib/X11/fonts/Type1
addfp /usr/X11R6/lib/X11/fonts/CID
addfp /usr/X11R6/lib/X11/fonts/75dpi
addfp /usr/X11R6/lib/X11/fonts/100dpi
addfp /cygdrive/c/WINNT/Fonts
addfp /cygdrive/c/WINNT/Fonts/Uninstalled
# Start the X Server.
XWin -fp $fp &

The small shell function allows me to look in various places for X
font directories without lots of empty ones needlessly slowing things
down. It also makes editing the script less error prone. (The
Uninstalled folder is created by a ZDNet Windows utility called
FontViewer 2.0, by the way.)

- -- 
Sam Edge

-----BEGIN PGP SIGNATURE-----
Version: PGP 7.0.4

iQA/AwUBPJAJrTHHXnAhdFsfEQL2rwCg9MMjBCujLIIUu90khr+PXyJI7EkAoLGP
RM0VC063pqe9K7za8r8LvUtu
=wNvr
-----END PGP SIGNATURE-----





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]