Professional Documents
Culture Documents
FONT SIMULATION
AND PROTOTYPING
ENGINE
BDF Font Compostion and Rendering – Manual
CONTENTS
Introduction 3
Font Types 12
Vector Fonts
Bitmapped Fonts
Composition Rules 16
Normal Glyph
Accent Glyph
Kern Glyph 19
Appendix
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 3 of 28|
Introduction
Akruti BDF Hindi Font Rendering Engine is a Hindi Composing and Rendering Software in the
MS Windows environment. This software is a customized extension to the Akruti
Software Development Kit (SDK) and is available for embedded software developers to
simulate and test the composition of Akruti Hindi BDF fonts in the Windows environment.
Using the composition and rendering logic followed in this software the developer can port
the logic into specific embedded devices and can compose the Unicode or ISCII text
strings and render them correctly on the device. It is a friendly simulation and testing tool
designed to make a novice in Indian Scripts understand and appreciate the nuances and
simplify the seemingly complex rendering of Hindi script into easily understandable stuff. It
also provides two perfectly formed Akruti BDF fonts in 16 and 24 dot sizes to be used for
the simulation and testing and eventually in the embedded device. These fonts are licensed
to be used royalty free in the target embedded devices.
The Akruti SDK has already covered the characteristics of the Hindi monolingual and bi-
lingual fonts and has explained the various coding methods for Hindi like Unicode and Iscii.
We have also seen how the Truetype Hindi font is coded as an ANSI font and the methods
of keying in Hindi in the selected font type (monolingual or bilingual) and the selected
keyboard layout (Inscript, Phonetic or Typewriter). The emphasis in the Akruti SDK is to
teach how to develop applications with an Indian language interface, but it does not go into
the details of how the script is composed or rendered. The ANSI Text box displays the
selected Hindi Truetype font at the point size and style selected. The Truetype rendering
is done by the Windows OS, so the developer is totally unaware of the exact method of
placement and rendering used to deliver the perfect looking Hindi strings.
This manual explains the basics of Hindi script, the font glyph types, composition logic,
basics of BDF bitmap fonts and its rendering.
The Akruti BDF Hindi Font Rendering Engine has two main objectives:
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 4 of 28|
The job of the BDF Font Analyzer and Renderer is to give a feel of the details of each
Hindi Glyph and its attributes and parameters as well as show at the lowest level how a
glyph string is rendered into a legitimate Hindi bitmap string. By using the analyzer and
renderer, the developer can test out and simulate the display on a Windows machine at a low
level, viewing how each low level glyph bitmap interacts with the other to produce the final
output. The objective of showing this detail is to teach the developer to build a similar
renderer for the target embedded system so that displaying Hindi on the device can be
achieved with minimal effort.
Additional references
Additional references are given in the Appendix to help the developer in the course of
developing BDF Hindi font composition and rendering by giving information about the
Unicode Hindi Chart, ISCII code chart, ANSI Glyph Code chart, BDF Font Standard and
examples of proper composition and rendering.
In the sections that follow, BDF Hindi font composition and rendering with the help of the
Akruti BDF Hindi Font rendering engine will be explained in detail.
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 5 of 28|
2. It will then ask you to choose a directory. You may choose to install in the
default directory, or can choose using the browse button.
3. Then it will ask you to select the program folders to install the shortcuts. Again
you can either choose the default folder or choose a custom folder.
4. Then it will start the process of copying the files to the selected folders and
show a progress bar as displayed in the following diagram.
5. It will copy all the files and update the fonts and the registries.
6. After finishing with the process, it will display the finished setup message and
create two icons on the desktop, one for launching the Akruti BDF Hindi Font
Rendering Engine and the other a shortcut to the PDF version of this manual.
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 6 of 28|
If the Akruti SDK Server or Client is installed then the Rendering Engine Form with 5 tabs
will be displayed. The Akruti BDF Font Rendering Engine has five tabs used for various
simulation, testing and development activities as shown below:
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 7 of 28|
The BDF Viewer is useful in relating the shape and the encoding value of the glyphs, which
can in turn be used to see the detailed properties and shape in the BDF Glyph and Bitmap
Tabs. This is a free third party tool and is useful for any BDF font. The enlarged image of
the glyph can be seen by double clicking the character or by pressing space bar.
1. You can pick a glyph by clicking on the dropdown and selecting the required one. The
Glyph properties text box will show the current glyph properties like:
• Glyph Name, Glyph Encoding
• Glyph sWidth(X), Glyph sWidth(Y)
• Glyph dWidth(X), Glyph dWidth(Y)
• Bounding Box Width, Bounding Box Height
• Bounding Box Offset(X), Bounding Box Offset(Y)
The type of glyph can be judged by checking its XOffset and dWidthX values as to whether
it is a normal, accent or kern glyph.
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 8 of 28|
1. By clicking on the Glyph Code dropdown box, a particular glyph character can be
examined for the following:
a. Glyph Properties in the Glyph properties box
b. Font Properties in the Glyph properties box.
c. Hex Bitmap in the Hex Bitmap box
d. Bitmap Dot pattern in the Glyph bitmap dot pattern box.
i. The height of the displayed pattern is the exact number of raster
lines in the font-bounding box.
ii. The left and right padding as well as the top and bottom padding is
done to ensure correct relative position of the Glyph Bounding Box.
iii. The following convention is used to indicate the type of glyph bitmap:
• Normal Bit: [@] is an ON bit and [.] is the OFF bit
• Kern Bit: [*] is an ON bit and [~] is the OFF bit
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 9 of 28|
1. This tab can be used to view the rendering of a string of text in the String Bitmap
Dot pattern text box.
2. As soon as some text is copied from the clipboard or keyed into the BDF String
Operations text box, the appropriate glyph bitmap dot patterns are picked up and
placed side by side for rendering the string.
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 10 of 28|
3. Depending on the settings in the Settings tab the following rendering effects are
applied:
a. Accent: If this setting is checked, then the Accented glyphs are moved to
the left (negative offset) and placed over the previous glyphs.
b. Kern: If this setting is checked then the Kerning Glyphs cause the following
glyph to be pulled closer by the Kerning value and it is overlapped with the
succeeding character.
c. Reverse: This setting if checked reverses the bitmap pattern and ON bits
become OFF; OFF bits become ON to creates a white on black effect.
d. Mirror: This setting if checked creates a mirror image of the bitmap
pattern.
1. The Default Font Settings frame has controls for setting the default font for the
text boxes in the engine.
2. By pressing the Select button in line with the Ansi label, the default Ansi text font
can be selected in the BDF String Operation text box.
3. By pressing the Select button in line with the BDF label, the default BDF Bitmap
Dot Pattern font can be selected.
• Note: It is suggested that only mono spaced fonts like Courier be selected so
as to display proper rendering. Proportionate fonts (like Arial or Times) if
selected can totally distort the bitmap pattern.
4. By pressing the Done button, the changes effected above can be applied to the text
boxes in the other tabs.
5. The Cancel button when pressed returns you to the BDF String tab.
6. The Exit button when pressed closes the application.
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 11 of 28|
Prerequisites
The reference manual for the Akruti BDF Hindi Font rendering Engine is intended to teach
the basics of Hindi BDF Font composition and rendering and as such expects the knowledge
of usage of the Akruti SDK.
It assumes that the user is already familiar with the basic concepts of fonts in Akruti SDK
and is aware of issues like Hindi character coding (Unicode or Iscii) and glyph encoding
(ANSI) covered in the SDK. It also assumes that the user has basic knowledge of Hindi
text input and is able to key in sample text using the SDK.
The manual will only touch upon those issues, which impinge on the usage of these
development tools and techniques for BDF Hindi Bitmap Font composition and rendering.
It is not possible to exhaustively cover specific embedded devices and the treatment is
generic enough to be applicable to any embedded device. Any specific queries regarding
usage in specific environments may be addressed to Akruti SDK Support Team at
support@cyberscapeindia.com.
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 12 of 28|
Some of the key concepts to be understood in order to render an Indian Script Font on any
target system are:
• Font Types
o Vector Fonts
o Bitmapped Fonts
• BDF Font Basics
• Akruti BDF Fonts
• Structure of Hindi Script
• Encoding of Hindi Script
• Unicode or ISCII to Hindi Glyph Composition
• Composition Rules
• BDF Glyph String Rendering
Each of these issues will be examined in detail in the sections that follow. It is highly
recommended not to skip these sections even for experienced developers since it covers
the fundamentals of multilingual composition and rendering.
The coding system used by the file storage system and the display, are totally independent
of each other and there may not be any on-to-one relationship between them. This is
especially so in case of Indian scripts, whereas in simple languages like English there usually
is one-to-one relationship between the two like in the most frequently used coding system
the ANSI standard (extended ASCII). One has to bear in mind this important difference to
appreciate the nuances of computing in Indian scripts.
Font Types
The most important entity when it comes to display of text in a GUI environment is the font
in which it is displayed. A font is a collection of glyphs or basic shapes of a character in a
particular language like English or Hindi. Besides the shapes (glyphs) these fonts need to
have information on identifying and positioning the glyphs (metrics).
There are many types of fonts, namely bitmap fonts, stroke fonts and outline fonts,
depending on whether the glyph shapes are defined by a set of dots (bit map fonts), set of
lines (stroke fonts) or closed outline curves (outline fonts). Fonts are also classified as
fixed size fonts or scalable fonts. Fixed size fonts as the names suggest are available only
in fixed sizes like 12, 14, 16, 24 dots etc whereas scalable fonts can be scaled from as low
as 2 points right up to 144 points.
Bitmapped Fonts:
Bitmapped fonts are those where the shape of the character or glyph is defined by a set of
dots (bit maps) and are available in fixed sizes.
Vector Fonts:
Vector fonts are those in which the shapes are defined by set of points, lines and curves.
The enclosed regions are filled to display the shape. Most vector fonts are scalable.
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 13 of 28|
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 14 of 28|
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 15 of 28|
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 16 of 28|
The way computers handle text usually is by manipulating what are called strings, which are
essentially an array of characters, which are in turn numbers represented by bytes in the 8
or 16 bit encoding system like ANSI or Unicode. In simple linear languages like English, each
character of a string corresponds to a character or alphabet according to the ANSI
encoding system and a simple one-to-one relationship exists between the display character
and the file storage.
Each character in Hindi has a unique sound (or phonetic) value. So each glyph in the script
has direct relation with phonetics. Once this is known, the task of composition becomes
relatively easy. Both ISCII and Unicode (which is derived or based on ISCII) recognized
this fact and hence are phonetic in nature. Also if it is realized that all sounds can be
broken down into two basic types namely Vowels and Consonants and combinations of these,
then the madness becomes decipherable.
Composition Rules
To analyze a Unicode or ISCII string we will follow the notation given below and apply the
specified rules for Hindi:
V - Vowel H - Halant
M - Matra R - Reph
N – Nasal (modifier) E – End Char
C - Consonant { } – Represents none or multiple occurrence
D – Nukta dot [ ] – Represents none or single occurrence
Type Form
Complex block {C + [D] + H} + C + [M] + [N] + [E]
Consonant block {C + [D] + H} + C + H
Vowel block V + [N] + [E]
The composing engine should find the base consonant of the syllable, using the algorithm:
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 17 of 28|
• Starting from the end of the syllable, move backwards until a consonant is found
that does not have a below-base or post-base form (post-base forms have to follow
below-base forms), or arrive at the first consonant. The consonant stopped at will
be the base.
• If the syllable starts with Ra + H, Ra should be excluded from candidates for base
consonants.
• If the base consonant is not the last one, the composing engine should move the
halant from the base consonant to the last one.
• If the syllable starts with Ra + H, Composing engine should move this combination so
that it follows the post-base 'matra' (if any) or the base consonant
• Composing engine should split two or three-part matras into their parts. This
splitting is a character-to-character operation). Then;
o Composing engine should move the left 'matra' part to the beginning of the
syllable.
o Composing engine should classify consonants and 'matra' parts as pre-base,
above-base (Reph), below-base or post-base.
• Composing engine then should group elements of the syllable (consonants and
'matras') according to this classification. Pre-base elements will precede the base
consonant. The above-base, below-base and post-base components will follow the
base glyph.
• Reph (Ra + H) and nasal modifiers should be positioned in the syllable after the
post-base 'matra' (if any); since these become marks on the 'matra', not on the
base glyph.
• 'Halants' and 'nukta' marks should move with the consonants they affect.
After performing the character reordering steps, the sequence of glyph characters should
have one of the following forms:
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 18 of 28|
Normal Glyph
Normal glyphs are those which do not have a negative value in the glyph bounding box for
their X offset so that they are always drawn to the right of the cursor. Also their dWidth
value is always greater than or equal to their bounding box width so that the succeeding
glyph does not overlap with it. Typical examples of these are almost all the English
characters as well as some of the Hindi standalone vowels and consonants. Their rendering
is quite simple; the whole glyph box is just placed next to the previous glyph.
As can be seen above the normal glyphs are just placed next to each other to render the
string, without any overhang or overlaps.
Accent Glyph
Accent glyphs are those which have a negative value for their X Offset in their glyph
bounding box. Usually all the matra characters in Hindi script are accent characters and
when they are placed after the normal consonant glyph they will move to the left and sit on
top (above base forms) or below the previous glyph (below base forms). The amount of left
movement is equal to the value of the X Offset. An example of the accent character and its
rendering is shown below.
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 19 of 28|
Kerning Glyph
A kerning glyph has its dWidthX less than the Width of its glyph bounding box so that the
cursor movement after the glyph is drawn stands before the edge of the glyph. Because of
this the next glyph, which is drawn, overlaps on the previous one by the amount of the kern
(difference between the dWidthX and Width). This characteristic is used very often in the
Hindi font to enable a seamless overlap and continuous appearance of the rendered string.
Most of the conjunct characters and consonants are formed by combination of a half (or
cut) consonant and the matra. The example below will illustrate the concept.
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 20 of 28|
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 21 of 28|
The string’s bitmap buffer array will contain the properly rendered Hindi Text in a
bitmap form.
Then depending on the target system, this bitmap buffer array can be reproduced
on the appropriate hardware display (LCD / CRT etc.)
This logic can be tried out using the simple Ascii string of “@” and “.” as used in the BDF
Rendering engine to see if the logic is properly implemented since it is easier to manipulate
simple Ascii text strings even in a simple text editor. Once the logic passes test, it can be
coded to create the binary bitmaps for the actual device.
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 22 of 28|
Appendix
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
0A 10
0B 11
0C 12
0D 13
0E 14
0F 15
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 23 of 28|
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
0A 10
0B 11
0C 12
0D 13
0E 14
0F 15
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 24 of 28|
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 25 of 28|
0 1 2 3 4 5 6 7 8 9 a b c d e f
Note: As can be seen all the glyphs in the Iscii code chart can be formed by juxtaposing
the appropriate Akruti Bilingual Fonts glyphs, but not vice versa. The characters from 32
decimal (20 hex) to 159 decimal (9F hex) in both the charts are the same as the normal
ANSI or ASCII chart and are not show here.
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 26 of 28|
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 27 of 28|
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.
Akruti Hindi BDF Font Simulation and Prototyping Engine - |Page 28 of 28|
Cyberscape Multimedia Ltd, 941, 21st Main, 22nd “A” Cross, BSK II, Bangalore - 560070.