{"id":236,"date":"2015-09-02T11:41:23","date_gmt":"2015-09-02T11:41:23","guid":{"rendered":"http:\/\/software.sil.org\/harmattan\/?page_id=236"},"modified":"2025-08-11T16:04:14","modified_gmt":"2025-08-11T16:04:14","slug":"developer","status":"publish","type":"page","link":"https:\/\/software.sil.org\/harmattan\/developer\/","title":{"rendered":"Developer"},"content":{"rendered":"<h2>Welcome font developers!<\/h2>\n<p>We welcome other developers who wish to get involved in supporting and enhancing these fonts or who want to modify them.<\/p>\n<h2>Permissions granted by the OFL<\/h2>\n<p>SIL\u2019s fonts are licensed according to the terms of the <a href=\"https:\/\/openfontlicense.org\/\" target=\"_blank\" rel=\"noopener\">SIL Open Font License<\/a>. The OFL allows the fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. For details see the OFL.txt and OFL-FAQ.txt files in the package.<\/p>\n<h2>Building the fonts from source code<\/h2>\n<p>Font sources are published in a <a href=\"https:\/\/github.com\/silnrsi\/font-harmattan\" target=\"_blank\" rel=\"noopener\">Github project<\/a>. The build process requires <a href=\"https:\/\/github.com\/silnrsi\/smith\" target=\"_blank\" rel=\"noopener\">smith<\/a> and project build parameters are set in the <a href=\"https:\/\/github.com\/silnrsi\/smith\/blob\/master\/wscript\" target=\"_blank\" rel=\"noopener\">wscript<\/a>.<\/p>\n<p>Font sources are in the <a href=\"https:\/\/unifiedfontobject.org\/versions\/ufo3\/\" target=\"_blank\" rel=\"noopener\">UFO3<\/a> format with font family structures defined using <a href=\"https:\/\/github.com\/fonttools\/fonttools\/tree\/master\/Doc\/source\/designspaceLib\" target=\"_blank\" rel=\"noopener\">designspace<\/a>. OpenType source code is stored in the <a href=\"https:\/\/adobe-type-tools.github.io\/afdko\/OpenTypeFeatureFileSpecification.html\" target=\"_blank\" rel=\"noopener\">.fea<\/a> format in the UFO (features.fea) but is maintained in a separate file using the more efficient and powerful <a href=\"https:\/\/github.com\/silnrsi\/feax\/blob\/main\/docs\/feaextensions.md\" target=\"_blank\" rel=\"noopener\">.feax<\/a> format.<\/p>\n<p>The fonts are built using a completely free and open source workflow using industry-standard tools (<a href=\"https:\/\/github.com\/fonttools\/fonttools\" target=\"_blank\" rel=\"noopener\">fonttools<\/a>), a package of custom python scripts (<a href=\"https:\/\/github.com\/silnrsi\/pysilfont\" target=\"_blank\" rel=\"noopener\">pysilfont<\/a>), and a build and packaging system (<a href=\"https:\/\/github.com\/silnrsi\/smith\" target=\"_blank\" rel=\"noopener\">Smith<\/a>). The whole toolchain is available as a Docker container.<\/p>\n<p>Full instructions for setting up the tools and building SIL fonts are available on a dedicated web site: <a href=\"https:\/\/silnrsi.github.io\/silfontdev\/\" target=\"_blank\" rel=\"noopener\">SIL Font Development Guide<\/a>. Additional developer information specific to SIL\u2019s Arabic fonts can be found at <a href=\"https:\/\/github.com\/silnrsi\/font-arab-tools\/blob\/master\/documentation\/developer\/README.md\" target=\"_blank\" rel=\"noopener\">font-arab-tools README<\/a>.<\/p>\n<p>In addition, much of the code for Scheherazade New, Harmattan, and Lateef is shared. Carefully review the <a href=\"https:\/\/github.com\/silnrsi\/font-arab-tools\/blob\/master\/documentation\/developer\/developer.md\" target=\"_blank\" rel=\"noopener\">font-arab-tools developer<\/a> documentation to see how the code is shared.<\/p>\n<h2>Building<\/h2>\n<p>The Harmattan project can be built from source using <a href=\"https:\/\/github.com\/silnrsi\/smith\" target=\"_blank\" rel=\"noopener\">smith<\/a>. This is done via the sequence:<\/p>\n<pre><code>    smith distclean\n    smith configure\n    smith build\n    smith alltests\n<\/code><\/pre>\n<p>Because of the complex kerning and collision avoidance logic, builds can take up to 15 minutes or longer, depending on hardware. If the complex kerning is <em>not<\/em> needed (such as for debugging other font logic), the <code>--quick<\/code> parameter can be supplied:<\/p>\n<pre><code>    smith distclean\n    smith configure\n    smith build --quick\n<\/code><\/pre>\n<p>The resulting files will not have functional kerning or collision avoidance, but will be otherwise usable.<\/p>\n<p>This project implements two additional <code>smith build<\/code> options that are useful during development:<\/p>\n<ul>\n<li><code>--regOnly<\/code> &#8212; build only the Regular weight instead of all weights<\/li>\n<li><code>--norename<\/code> &#8212; keep the working names for glyphs rather than change them to production names <\/li>\n<\/ul>\n<p>Finally, to include Graphite smarts (which are used during development for generating kerning rules &#8212; see <code>updateKerning.sh<\/code> below), use the <code>--graphite<\/code> option as follows:<\/p>\n<pre><code>    smith distclean\n    smith configure --graphite\n    smith build --graphite --quick --norename\n<\/code><\/pre>\n<h3>Adding characters<\/h3>\n<p>After adding glyphs (other than used only as components for building other glyphs) to the font, the following files will also need updating:<\/p>\n<ul>\n<li><code>glyph_data.csv<\/code> &#8212; used to set glyph orders and psnames in the built font<\/li>\n<li><code>classes.xml<\/code> &#8212; used to define classes used by both OpenType and Graphite. Note that some of the classes defined therein are marked \u201cautomatically generated\u201d &#8212; these will be updated (from glyph_data.csv) the next time <code>.\/preflight<\/code> is run.<\/li>\n<li><code>opentype\/*.feax<\/code> &#8212; modify as needed to add needed OpenType behavior<\/li>\n<li><code>graphite\/*.gd*<\/code> &#8212; modify as needed to add needed Graphite behavior<\/li>\n<li><code>tests\/*.ftml<\/code> &#8212; see below<\/li>\n<\/ul>\n<p>Additionally the <code>*-octabox.json<\/code> files will need to be regenerated in order to add optimal<br \/>\noctaboxes for the isolate and initial forms of the newly added characters. If unencoded variants<br \/>\nof isolate and initial forms have been added, these must be manually added to the <code>cComplexShape<\/code><br \/>\nclass defined in <code>source\/graphite\/caBasedKerning.gdl<\/code> so they get optimized as well.<\/p>\n<h3>Generated source files<\/h3>\n<p>Five of the source files needed for the build are actually generated files but, because they<br \/>\nrequire compute-intensive tools to create or update, are generated offline and committed to the repo. The files that fall into this category are:<\/p>\n<ul>\n<li><code>source\/kerndata.ftml<\/code> \u2014 contains strings with all possible combinations of reh-like and<br \/>\nfollowing initials or isolates. This is used to extract graphite collision-avoidance-based<br \/>\nkerning data.<\/li>\n<li><code>source\/graphite\/*-octabox.json<\/code> \u2014 optimized octaboxes to enable Graphite to do more accurate kerning<br \/>\nof reh-like characters to what follows.<\/li>\n<li><code>source\/opentype\/caKern-*.fea<\/code> \u2014 contextual kerning rules that approximate the kerning effected<br \/>\nby the Graphite collision avoidance.<\/li>\n<\/ul>\n<p>If the <em>design<\/em> of any Arabic glyphs in the font changes, it is important to:<\/p>\n<ul>\n<li>rebuild the optimized octabox.json files so that Graphite collision-avoidance-based kerning is accurate,<br \/>\nand then <\/li>\n<li>rebuild the OpenType kerning rules from the graphite results. <\/li>\n<\/ul>\n<p>A script to do this is in <code>tools\/updateKerning.sh<\/code>. This should be run from the root of the project. Be aware<br \/>\nthis can take up to 30 minutes or more to complete.<\/p>\n<p>Important notes: The <code>updateKerning.sh<\/code> tool requires:<\/p>\n<ul>\n<li>fully functioning <a href=\"https:\/\/github.com\/silnrsi\/smith\" target=\"_blank\" rel=\"noopener\"><code>smith<\/code><\/a> build system<\/li>\n<li>a Graphite-enabled Harfbuzz library<\/li>\n<li>a Graphite library with tracing enabled. The library provided by default Ubuntu<br \/>\ndoes not include tracing. You&#8217;ll need to compile the source with -DGRAPHITE2_NTRACING:BOOL=OFF <\/li>\n<li>the <a href=\"https:\/\/scikit-learn.org\/\" target=\"_blank\" rel=\"noopener\">scikit-learn<\/a> python module. For ubuntu try:<\/li>\n<\/ul>\n<pre><code>sudo apt-get install python3-sklearn python3-sklearn-lib\n<\/code><\/pre>\n<p>To generate <code>kerndata.ftml<\/code> and the <code>*-octabox.json<\/code> files, run:<\/p>\n<pre><code>    tools\/updateKerning.sh --ftml --octalap\n<\/code><\/pre>\n<h3>Generated test files<\/h3>\n<p>After adding characters or additional behaviors to the font, test files should be created or enhanced to test the new behaviors. The test files:<\/p>\n<ul>\n<li><code>tests\/AllChars-auto.ftml<\/code><\/li>\n<li><code>tests\/ALsorted-auto.ftml<\/code><\/li>\n<li><code>tests\/DaggerAlef-auto.ftml<\/code><\/li>\n<li><code>tests\/DiacTest1-auto.ftml<\/code><\/li>\n<li><code>tests\/DiacTest1-short-auto.ftml<\/code><\/li>\n<li><code>tests\/FeatLang-auto.ftml<\/code><\/li>\n<li><code>tests\/Kern-auto.ftml<\/code><\/li>\n<li><code>tests\/SubtendingMarks-auto.ftml<\/code><\/li>\n<li><code>tests\/Yehbarree-auto.ftml<\/code><\/li>\n<\/ul>\n<p>are generated automatically using <code>tools\/genftmlfiles.sh<\/code>. This script, in turn, calls <code>tools\/absgenftml.py<\/code><br \/>\nto create each test file. A lot of test generation logic is driven by Unicode character properties and the <code>glyph_data.csv<\/code> file, but sometimes <code>absgenftml.py<\/code> itself needs to be enhanced.<\/p>\n<p>For more information about testing, see <a href=\"https:\/\/github.com\/silnrsi\/font-arab-tools\/blob\/master\/documentation\/developer\/testing.md\" target=\"_blank\" rel=\"noopener\">font-arab-tools testing<\/a>.<\/p>\n<h2>Contributing to the project<\/h2>\n<p>We warmly welcome contributions to the fonts, such as new glyphs, enhanced smart font code, or bug fixes. The <a href=\"https:\/\/silnrsi.github.io\/silfontdev\/en-US\/Contributing_Changes.html\" target=\"_blank\" rel=\"noopener\">brief overview of contributing changes<\/a> is a good place to begin. The next step is to contact us by responding to an existing issue or creating an issue in the Github repository and expressing your interest. We can then work together to plan and integrate your contributions.<\/p>\n<p>To enable us to accept contributions in a way that honors your contribution and respects your copyright while preserving long-term flexibility for open source licensing, you would also need to agree to the <strong>SIL Global Contributor License Agreement for Font Software (v1.0)<\/strong> prior to sending us your contribution. To read more about this requirement and find out how to submit the required form, please visit the <a href=\"https:\/\/software.sil.org\/fontcla\">CLA information page<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome font developers! We welcome other developers who wish to get involved in supporting and enhancing these fonts or who want to modify them. Permissions granted by the OFL SIL\u2019s fonts are licensed according to the terms of the SIL Open Font License. The OFL allows the fonts to be used, studied, modified and redistributed [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"hide_sidebar":false,"hide_h1":false,"footnotes":""},"class_list":["post-236","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/software.sil.org\/harmattan\/wp-json\/wp\/v2\/pages\/236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/software.sil.org\/harmattan\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/software.sil.org\/harmattan\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/software.sil.org\/harmattan\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/software.sil.org\/harmattan\/wp-json\/wp\/v2\/comments?post=236"}],"version-history":[{"count":25,"href":"https:\/\/software.sil.org\/harmattan\/wp-json\/wp\/v2\/pages\/236\/revisions"}],"predecessor-version":[{"id":1046,"href":"https:\/\/software.sil.org\/harmattan\/wp-json\/wp\/v2\/pages\/236\/revisions\/1046"}],"wp:attachment":[{"href":"https:\/\/software.sil.org\/harmattan\/wp-json\/wp\/v2\/media?parent=236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}