[Gnome-print] Font database



Hello!

I do not know, which features there are {planned|implemented}
for XST font installation - I'll outline here my last ideas
about gnome-print font database - which I hope will be moved
out from gnome-print one day.

The base database files (0.26+) are:
$PREFIX/share/fonts/fontmap2
$HOME/.gnome/fonts/fontmap
User database has precendence, i.e. if font with same name is
specified in both, the user one will be used.

Database is xml file, there are 3(4) font formats:

1. Type1 font
  <font format="type1"
        name="Nimbus Mono L Bold"
        version="1.05"
        familyname="Nimbus Mono L"
        speciesname="Bold"
        psname="NimbusMonL-Bold"
        weight="Bold"
        italicangle="0">
    <file type="afm"
          path="/usr/share/fonts/default/Type1/n022004l.afm" 
          size="31779"
          mtime="963602466"/>
    <file type="pfb"
          path="/usr/share/fonts/default/Type1/n022004l.pfb" 
          size="50493"
          mtime="963602466"/>
  </font>

2. TrueType font
  <font format="truetype"
        name="Arial Bold"
        version="1.0"
        familyname="Arial"
        speciesname="Bold"
        psname="Arial-Bold"
        weight="Bold"
        italicangle="0">
    <file type="ttf"
          path="/home/lauris/fonts/arialbd.ttf"
          size="66080"
          mtime="987467477"/>
  </font>

3. Font alias
  <font format="alias"
        name="Times Roman"
        familyname="Times"
        speciesname="Roman"
        psname="Times-Roman"
        original="Nimbus Roman No9 L Regular"
        hideoriginal="true"/>

The fourth font format is type1alias - i.e. type1 font with afm and pfb
files from different fonts - but these will be deprecated and 
substituted with true aliases.

Some comments:
XML is loose, i.e. unknown types and attributes are simply ignored
Size and mtime are there to quickly test, whether there is reason to
expect that font is changed
Version number is important for deciding, which alternative to pick
from different files describing the same font.

Now I had idea, that similar concept could be extended to build complete
list of all fonts in system. Instead of separate type1, truetype font
formats we (XST?) could generate font nodes, like:

<font
  name="Helvetica"
  familyname="Helvetica"
  speciesname="Regular"
  ...
  <file type="pfb" version="1.05" ...
  <file type="pfb" version="1.02" ...
  <file type="pfa" version="1.05" ...
  <file type="afm" version="1.02" ...
  <file type="ttf" version="1.0" ...
  <file type="pcf" version="1.0" encoding="iso-8859-1" ...
  <file type="pcf" version="1.0" encoding="iso-8859-2" ...

And so on. As XST generates X fonts also, maybe also to specify
generated fonts in addition to files.

  <Xfont name="...." ...
  <XFont name="...." ...

etc.
There probably is no need in specifying gnome-print fonts explicitly,
as gnome-print can build fonts itself, as long as there is either
pfb or ttf file present. But given database would help a lot programs,
that have to find best X font for given gnome-print (i.e. printable)
font - and vice versa.
I like the idea, having all files listed and sorted, as the most
time-consuming process is cheking given file validity. Having
timestamps of files would leave it solely for installation tool,
and other subsystems can simply pick up whatever files are suitable
for them.
Also it would (at last) give semi-standard way to access the actual
source of X font (networked xfs aside), which would be useful on
several occasions (like syncronizing gdk/antialiased canvas).
My main concern is, that the file would be quite large and parsing it
in gnome-print may take some time.

Ideas?
Comments?

Best wishes,
Lauris Kaplinski










[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]