|
Computers & Writing Systems
You are here: General > Initiative B@bel Project SILA: A Graphite-enabled Web Browser
From January to October of 2003, SIL International was engaged in a cooperative project with SILA is a version of Mozilla that is capable of rendering text using SIL's Graphite rendering technology. This document defines the goal, requirements, and dependency of the project. It also discusses the high level architecture of project SILA after a high level overview of the Mozilla text processing and display subsystem. The complete design document is available on this page, but can also be downloaded in both Word and PDF formats:
Installation: SILA can be installed by downloading and executing the installer available at IntroductionSILA is a version of Mozilla that is capable of rendering text using SIL's Graphite rendering technology. In every other aspect this software is a standards-compliant program and behaves similarly to other versions of Mozilla, including the ability to display standard HTML and XHTML with CSS stylesheets. Purpose of This DocumentThis document defines the goal, requirements, and dependency of project SILA. This document also discusses the high level architecture of project SILA after a high level overview of the Mozilla text processing and display subsystem. Project GoalTo enable minority language communities to publish on the Internet by integrating the Mozilla Internet application suite (Browser, Email , Newsgroups, HTML Composer, Address Book, IRC Chat program) with SIL's Graphite technology in order to display complex writing systems correctly. Project RequirementsPlatform Requirements: Microsoft Windows 2000 or Microsoft Windows XP. Functional Requirements:
Language Requirements: The following language data will be used to test SILA
Mozilla Requirements:
Due to the limit of project time, we decided the following are BEYOND THE SCOPE of this project. We may work on the following issues in future releases.
Project DependencyThis project is heavily dependent on the following software technologies still under development:
In additional, this project also depends on the following stable software technology:
DesignThis section discusses how we architected project SILA. Since Mozilla is the foundation of this project, we need first to review the Mozilla components which handle text processing and display. We will also briefly review the key features provided by silgraphite. Finally, we will outline the high level architecture of SILA. Mozilla Text Processing Subsystems OverviewThe following components in Mozilla process text information: 1. The network library, Necko, receives byte streams in TCP/IP packets, block by block. 2. Necko passes blocks of the byte stream to the HTML parser, XML parser, JavaScript interpreter, or CSS parser, depending on the MIME type 3. The HTML parser, XML parser, JavaScript interpreter or CSS parser
4. The view system invokes the layout subsystem reflow process to build up the frame model. It
5. The Windows specific GFX (Graphics) subsystem is a very powerful and complex subsystem. Basically, the interface provides three main features for the purpose of text display:
The Design, Features and Architecture of Mozilla Text Display SubsystemsSince the goal of the SILA project is to render the text of complex writing systems on Microsoft Windows, most (if not all) of the integration points reside in the Windows specific GFX (Graphics) subsystem. We review the design of this component in detail in this section. The ultimate text display code is inside the Windows specific GFX subsystem. We will only discuss the part which is related to virtual fonts, text measuring and text rendering. Each virtual font in the Mozilla GFX subsystem has a defined order to access (if necessary) all the installed fonts to measure or render a given Unicode string. The order depends on:
When the subsystem performs Unicode text measurement and rendering, it will first use the highest priority font to render all the text. It examines the ‘CMAP’ of each font to decide which Unicode characters could be measured / rendered by the first font. If the ‘CMAP’ of such font does not have a valid slot for such Unicode code point, then the GFX will load the next font in the order to measure/render those particular characters which cannot be rendered by the first font. GFX repeats this process through the list until all the Unicode code points could be rendered or it examines every single installed font. In summary, the real font(s) used by the Mozilla for a given text node is mainly controlled by the following three factors:
Key Features provided by GraphiteGraphite helps Windows-based applications to render text in complex writing systems by reading data from Graphite-enabled TTF fonts. Graphite reads the additional Graphite-specific TrueType table and analyzes the given Unicode text to perform text measuring and rendering of complex writing systems. Please see the Graphite documentation for details. We will not discuss them in this section. In order to work with Graphite, the calling software needs to implement two helper classes. The first one implements the IGrTextSrc interface to maintain the text data. The second class implements the IGrGraphics interface to read the TrueType font table and call the operating system to measure / render the “glyphs” (not the “characters”). The calling software should create a GrEngine for a specific font. It should associate an IGrGraphics to the GrEngine when initializing the GrEngine. It then passes the Unicode string to the FindBreakPoint method of the GrEngine object to create one or more IGrSegment. Then it calls the measurement and rendering method of the IGrSegment. These methods will call the methods implemented in the IGrGraphics to interact with the operating system. High Level Architecture of SILAIn order to integrate Graphite into Mozilla, we need to address the following architecture issues first: 1. When should Mozilla call Graphite 2. How should Mozilla call Graphite When to call GraphiteTo answer the first question, we first need to look into the Graphite-enabled font. A Graphite-enabled font is really just a standard TrueType font (possible also OpenType or AAT) with an additional Graphite-specific table. The ‘CMAP’ of the Graphite-enabled font follows the same rule as a standard TrueType font. Therefore, we can share the same ‘CMAP’ exams code with other TrueType fonts. Mozilla should call the silgraphite only when it tries to use the Graphite-enabled font to measure or render Unicode text which is covered by it. Since every Graphite-enabled font includes an ‘Silf’ table, we can distinguish a Graphite-enabled font by checking the existence of this table in the TrueType font directory. If a font includes such TrueType table, then we will call silgraphite to perform the text measurement or rendering. How to call GraphiteTo reduce the maintainance cost and reduce the need to use most of the code across different versions of Mozilla, we defined a generic COM-based interface to separate the Graphite-specific code from the Mozilla-specific code. The Graphite-specific part is implemented in a COM-based DLL, currently named mg2.dll (Mozilla Graphite Together). This DLL includes a statically linked Graphite library of a stable version. It hides all the details of how to work with the Graphite APIs. The Mozilla code will be changed to call this generic COM interface. The Mozilla patch implements all the details of how to work under the Mozilla GFX virtual font look up and text measurement/rendering subsystem. Project SILA1. ISpecialTTFFont.h: A COM interface definition which measures and renders text 2. Mozilla
3. Mg2.dll
How to Generate Web Content to Work Nicely with SILATo make content (HTML) work nicely with SILA, we need to:
Please refer to the CSS1, CSS2 and HTML 4.01 specification from w3c.org site for details. Project Risks & SolutionStability of Mozilla: Since this project heavily depends on Mozilla, the status of the Mozilla project is the biggest risk of this project. To address this, we decided the following:
Stability of Graphite: The bugs and stability of Graphite also greatly impact this project. In order to reduce the risk, we decided to statically link the Graphite library into the mg2.dll. The version of Graphite will depend on the addressed issues in the Graphite source, number of changes around the date, and trial testing result. Project Release PlanBased on the status of the project, we will release the binary in the following format:
InstallationThe installation program is called sila20030625inst.exe. It requires 27 megabytes of disk space. To install Mozilla, Using Graphite fontsTo use a Graphite-enabled font within Mozilla, simply install the font into your Fonts control panel in the normal way. Any text that is marked up to use that font will use the Graphite tables to perform the rendering. Click here to download sample Graphite fonts. Links
Copyright notice (c) Copyright 2003 Frank Tang, SIL International Inc., Netscape Inc. This material is released under GPL/LGPL/NPL licenses. Details of these © 2003-2023 SIL International, all rights reserved, unless otherwise noted elsewhere on this page. |