How to install new our TTF or PHF into photon 2.0 ?

Hi,

We are trying to port our customized font onto Photon 2.0.
Our own font is X bitmap font named ‘*.bdf’ and converted it
to PHF font by using the tool 'bdftophf2. I am puzzled what to do next.

Please let me know how to install new true-type or phf font which
is made by customer into photon 2.0 under QNX 6.1.
And I want to know the infomation about the format of file ‘fontdir’
under directory of ‘/usr/photon/font_repository’

Thanks in advance.

Byoung-Hweh Huh
purunsan@rtsolutions.co.kr

Byoung-Hweh Huh <purunsan@orgio.net> wrote:

Hi,
From: Derek Leach <> dleach@qnx.com

Subject: Re: How to install new our TTF or PHF into photon 2.0 ?
Newsgroups: qdn.public.qnxrtp.photon
References: <a2gvdt$hvs$1@inn.qnx.com>
Organization:
User-Agent: tin/1.4.3-20000502 (“Marian”) (UNIX) (QNX/6.2.0 (x86pc))

Byoung-Hweh Huh <purunsan@orgio.net> wrote:

Hi,

We are trying to port our customized font onto Photon 2.0.
Our own font is X bitmap font named ‘*.bdf’ and converted it
to PHF font by using the tool 'bdftophf2. I am puzzled what to do next.

Please let me know how to install new true-type or phf font which
is made by customer into photon 2.0 under QNX 6.1.
And I want to know the infomation about the format of file ‘fontdir’
under directory of ‘/usr/photon/font_repository’

Thanks in advance.

Byoung-Hweh Huh
purunsan@rtsolutions.co.kr

Hello Byoung-Hweh Huh,

You copy the file into /usr/photon/font_repository, either while running
Photon, or not. If you are not running Photon when you copy the file
into /usr/photon/font_repository, the next time you start Photon, it will
be installed.

NOTE:

If you are using a PHF, and you wish to use it as an extension font,
like Chinese, Japanese, Korean, you must do the following:

  1. Exit Photon to text mode.

  2. cp myfont.phf /tmp

  3. mkfontdir -d /tmp -i /tmp/t

  4. As root, edit the fontdir file, and add the contents of /tmp/t
    to the file.

  5. As root, edit the fontext, and add the ‘stem’ name as follows:

;
; fontext config file, Mon Dec 13 15:36:21 1999
;
+normal = primasansbts, primasansmonobts, phcursor, mystem

  1. mv /tmp/myfont.phf /usr/photon/font_repository
  2. Start Photon.


    Thank You.


    P.S. Below is an old article describing the configuration files.


    fontdir entries:

char08,.phf,Charter,8,0020-00FF,MIp,10x10,4K
pcs08,.phf,PC Serif,8,0000-00FF,Nf,8x8,12K
dutchs,0@latin.pfr,Dutch801 BT,0,0020-20AC,MIp,109x121,14K


Above are some examples. The fields are as follows:

stem,filename,Descriptive Name, point size, style flags,
unicode range, attribute flags, bounding box size, file size

caveat: In most cases you should not have to modify the
fontdir, unless you like
to delete lines to quickly uninstall a font.
mkfontdir generates this file.

stem - Used by the font API to identify the font to render.
Bitmap fonts have a digit, because each point size
has its own file. If a conflict exists, this can
be modified to correct the conflict. Under QNX4,
this value should not exceed 16 symbols, including
NULL.

filename - If it is a bitmap file, .phf is present, because
the file name is stem + filename. If the font
is scalable, something like 0@latin.pfr will be
present.

The number before the ‘@’ sign indicates the font
within the font file. With scalable fonts, it is
possible to have a collection of fonts within one
font file. Supported scalable fonts in 114 have
a .pfr extension.

Descriptive Name - This is the foundry name assigned to the font.
For a particular font, this usually does not
change. If it does change, you can assume
it is a new font. The field, under QNX4, should
not exceed 32 symbols, including NULL.

point size - The point size of the font. The field will be set
to zero for scalable fonts, for obvious reasons.

style flags - Blank → Plain
B → Bold
I → Italic/Oblique

Unicode Range - The coarse unicode range of the font, in hex.

attribute flags - N - PHF2 format - Photon 2.0 (Rtp)
S - TTF Specific ID 0 - Photon 2.0 (Rtp)
p - proportional
f - fixed width
M - PHFONT_CHAR_METRIC - a PHF file with individual metrics for each glyph.
I - PHFONT_CHAR_INDEX - An index is used to reference the image data, and
the size of each image can vary. If this flag is
not present for a bitmap font, then the BPC (bytes
per character) is used to determine the size of the
glyph image.
W - PHFONT_CHAR_WIDTH - a PHF file with individual widths for each glyph.

bounding box size - General bounding box size of the font. In pixels for
bitmap fonts.
For scalables, I believe this is an unscaled value.
I am actually
unsure if it is even used by the scalable engine :slight_smile: .

file size - Approximate size of the file in kilobytes.


fontext entries:

+normal = primasansbts, primasansmonobts, phcursor

rule = stem list

The font manager searches this list of fonts, represented by the stem names
in the list, when it cannot render a requested symbol in the current font.
The list is comma delimited. In 113, and possible beta versions of 114,
there was a limit to this line of 500 symbols (I think). Now it does not
matter how long the line is.

fontopt entries:

-Enormal
-a
-c200k

A list of options for ‘phfont’ to pass to the appropriate font manager.
One option per line.

fontmap entries:

BalloonFont = primasansbts
FixedFont = primasansmonobts
HeadingFont = primasansbts
MenuFont = primasansbts
MessageFont = primasansbts
TextFont = primasansbts
TitleFont = primasansbts
Helvetica = swis721bts
Verdana = primasansbts
monospace = primasansmonobts
sans-serif = swis721bts
serif = dutch801rmbts
web = webnormals
arial = swis721bts
term = pcterm
geneva = swis721bts
monaco = courier10bts
ny = dutch801rmbts
courier = couriers
dutch = dutchs
swiss = swisss
times = time
wingbats = wingbatss
helv = *swisss
ncen = *dutchs
time = *dutchs
? = courier10bts


The ‘?’ line is the font used by the font manager, when it cannot locate
the requested font, after running through a tonne of mapping rules.

A line such as ‘serif = dutch801rmbts’ is basically a string replacement.
If an appication used the stem ‘serif12’, the font manager would convert
it to ‘dutch801rmbts12’.

helv = *swisss
helv = +swisss
helv = -swisss
helv = #swisss
In this mapping rule, both font and scalefont must exist. When there isn’t
an exact PHF file for font, then a scaled
version of scalefont is made according to the when character used:

  • always scale when no exact PHF file exists for font
  • scale only when above the largest size PHF defined for font
  • scale only when below the smallest size PHF defined for font

scale when outside the range of sizes of PHF files for font

Some of this documentation was taken from the documentation on ‘phfont’.
Now you people have enough information to be dangerous, good luck.

Thank you.

Thank you Derek Leach

It is good information for me to understand Photon font.
but, I still cannot install Korean bitmap font.

I did the following:

at text mode

bdftophf2 -Ouk24.phf Gulim24.bdf

or

bdftophf2 -OKorean24.phf Gulim24.bdf

cp uk24.phf /tmp

cp uk24.phf /usr/photon/font_repository

mkfontdir -d /tmp -i /tmp/t

cat /tmp/t

uk24,.phf,uk,24,2121-487E,Np,25x24,614K
or
uk24,.phf,Korean,24,2121-487E,Np,25x24,614K

add the result to /usr/photon/font_repository/fontdir
add “uk24”, “uk”, “Korean” or “Korean24” to
/usr/photon/font_repository/fontext
add “Korean” or “uk” to /usr/photon/font_repository/fontorient

and, start Photon

but I couldn’t see Korean.

What’s wrong?
and, Is there special meaning of stem and Descritive name especially on the
Orient languages(Like CJK)?

Thanks for your reading!



<dleach@node315.org> wrote in message news:a2hgjo$gr$1@inn.qnx.com

Byoung-Hweh Huh <> purunsan@orgio.net> > wrote:
Hi,
From: Derek Leach <> dleach@qnx.com
Subject: Re: How to install new our TTF or PHF into photon 2.0 ?
Newsgroups: qdn.public.qnxrtp.photon
References: <a2gvdt$hvs$> 1@inn.qnx.com
Organization:
User-Agent: tin/1.4.3-20000502 (“Marian”) (UNIX) (QNX/6.2.0 (x86pc))

Byoung-Hweh Huh <> purunsan@orgio.net> > wrote:
Hi,

We are trying to port our customized font onto Photon 2.0.
Our own font is X bitmap font named ‘*.bdf’ and converted it
to PHF font by using the tool 'bdftophf2. I am puzzled what to do next.

Please let me know how to install new true-type or phf font which
is made by customer into photon 2.0 under QNX 6.1.
And I want to know the infomation about the format of file ‘fontdir’
under directory of ‘/usr/photon/font_repository’

Thanks in advance.

Byoung-Hweh Huh
purunsan@rtsolutions.co.kr


Hello Byoung-Hweh Huh,

You copy the file into /usr/photon/font_repository, either while running
Photon, or not. If you are not running Photon when you copy the file
into /usr/photon/font_repository, the next time you start Photon, it will
be installed.

NOTE:

If you are using a PHF, and you wish to use it as an extension font,
like Chinese, Japanese, Korean, you must do the following:

  1. Exit Photon to text mode.

  2. cp myfont.phf /tmp

  3. mkfontdir -d /tmp -i /tmp/t

  4. As root, edit the fontdir file, and add the contents of /tmp/t
    to the file.

  5. As root, edit the fontext, and add the ‘stem’ name as follows:

;
; fontext config file, Mon Dec 13 15:36:21 1999
;
+normal = primasansbts, primasansmonobts, phcursor, mystem

  1. mv /tmp/myfont.phf /usr/photon/font_repository
  2. Start Photon.


    Thank You.

hmetal <hmetal@rtsolutions.co.kr> wrote:

Thank you Derek Leach

It is good information for me to understand Photon font.
but, I still cannot install Korean bitmap font.

I did the following:

at text mode

Use this one:

bdftophf2 -Ouk24.phf Gulim24.bdf

cp uk24.phf /tmp

cp uk24.phf /usr/photon/font_repository

mkfontdir -d /tmp -i /tmp/t

cat /tmp/t

Use this one:

uk24,.phf,Korean,24,2121-487E,Np,25x24,614K

add the result to /usr/photon/font_repository/fontdir
add “uk24”, “uk”, “Korean” or “Korean24” to
/usr/photon/font_repository/fontext

Add “Korean” to fontorient file.



and, start Photon

but I couldn’t see Korean.

What’s wrong?
and, Is there special meaning of stem and Descritive name especially on the
Orient languages(Like CJK)?

No. There is no special meaning of stem and descriptive name for Orient
languages.

After you perform the above, it should work.

You must ensure you are using a Unicode
bdf file, otherwise it will not work. Your
resultant uk24.phf seems too small for a Korean
font, but I could be mistaken since the Unicode
range is relatively small.

If this still does not work, please post
your fontdir, fontext, and fontorient
files.

Also, ensure you have no fontdir, fontext,
or fontorient files in $HOME/.ph/font.

Thank You.

Thank you very much Derek Leach;

Now, I can see Korean with true type and bitmap font.

You are right. it is the bdf source file that is problem of bitmap font
installation.

I have various type of bdf file. so I have mistaked.

Thank you.

<dleach@node315.org> wrote in message news:a33pvk$9cm$1@inn.qnx.com

hmetal <> hmetal@rtsolutions.co.kr> > wrote:
Thank you Derek Leach

It is good information for me to understand Photon font.
but, I still cannot install Korean bitmap font.

I did the following:

at text mode

Use this one:

bdftophf2 -Ouk24.phf Gulim24.bdf

cp uk24.phf /tmp

cp uk24.phf /usr/photon/font_repository

mkfontdir -d /tmp -i /tmp/t

cat /tmp/t

Use this one:
uk24,.phf,Korean,24,2121-487E,Np,25x24,614K

add the result to /usr/photon/font_repository/fontdir
add “uk24”, “uk”, “Korean” or “Korean24” to
/usr/photon/font_repository/fontext

Add “Korean” to fontorient file.



and, start Photon

but I couldn’t see Korean.

What’s wrong?
and, Is there special meaning of stem and Descritive name especially on
the
Orient languages(Like CJK)?

No. There is no special meaning of stem and descriptive name for Orient
languages.

After you perform the above, it should work.

You must ensure you are using a Unicode
bdf file, otherwise it will not work. Your
resultant uk24.phf seems too small for a Korean
font, but I could be mistaken since the Unicode
range is relatively small.

If this still does not work, please post
your fontdir, fontext, and fontorient
files.

Also, ensure you have no fontdir, fontext,
or fontorient files in $HOME/.ph/font.

Thank You.

hmetal <hmetal@rtsolutions.co.kr> wrote:

Thank you very much Derek Leach;

Now, I can see Korean with true type and bitmap font.

You are right. it is the bdf source file that is problem of bitmap font
installation.

I have various type of bdf file. so I have mistaked.

Thank you.
[snip]

You are welcome.