CINXE.COM

Unit 3 | Graphite

<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <link rel="stylesheet" href="/assets/css/just-the-docs-default.css"> <script src="/assets/js/vendor/lunr.min.js"></script> <script src="/assets/js/just-the-docs.js"></script> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" href="/assets/images/favicon.ico" type="image/x-icon"> <!-- Begin Jekyll SEO tag v2.8.0 --> <title>Unit 3 | Graphite</title> <meta name="generator" content="Jekyll v4.3.2" /> <meta property="og:title" content="Unit 3" /> <meta property="og:locale" content="en_US" /> <meta name="description" content="Site for Graphite" /> <meta property="og:description" content="Site for Graphite" /> <link rel="canonical" href="https://silnrsi.github.io/graphite/tutorial/graide_tutorial3.html" /> <meta property="og:url" content="https://silnrsi.github.io/graphite/tutorial/graide_tutorial3.html" /> <meta property="og:site_name" content="Graphite" /> <meta property="og:type" content="website" /> <meta name="twitter:card" content="summary" /> <meta property="twitter:title" content="Unit 3" /> <script type="application/ld+json"> {"@context":"https://schema.org","@type":"WebPage","description":"Site for Graphite","headline":"Unit 3","url":"https://silnrsi.github.io/graphite/tutorial/graide_tutorial3.html"}</script> <!-- End Jekyll SEO tag --> </head> <body> <a class="skip-to-main" href="#main-content">Skip to main content</a> <svg xmlns="http://www.w3.org/2000/svg" class="d-none"> <symbol id="svg-link" viewBox="0 0 24 24"> <title>Link</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"> <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path> </svg> </symbol> <symbol id="svg-menu" viewBox="0 0 24 24"> <title>Menu</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"> <line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line> </svg> </symbol> <symbol id="svg-arrow-right" viewBox="0 0 24 24"> <title>Expand</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"> <polyline points="9 18 15 12 9 6"></polyline> </svg> </symbol> <!-- Feather. MIT License: https://github.com/feathericons/feather/blob/master/LICENSE --> <symbol id="svg-external-link" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-external-link"> <title id="svg-external-link-title">(external link)</title> <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line> </symbol> <symbol id="svg-doc" viewBox="0 0 24 24"> <title>Document</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file"> <path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline> </svg> </symbol> <symbol id="svg-search" viewBox="0 0 24 24"> <title>Search</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"> <circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line> </svg> </symbol> <!-- Bootstrap Icons. MIT License: https://github.com/twbs/icons/blob/main/LICENSE.md --> <symbol id="svg-copy" viewBox="0 0 16 16"> <title>Copy</title> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard" viewBox="0 0 16 16"> <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"/> <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z"/> </svg> </symbol> <symbol id="svg-copied" viewBox="0 0 16 16"> <title>Copied</title> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard-check-fill" viewBox="0 0 16 16"> <path d="M6.5 0A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3Zm3 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3Z"/> <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1A2.5 2.5 0 0 1 9.5 5h-3A2.5 2.5 0 0 1 4 2.5v-1Zm6.854 7.354-3 3a.5.5 0 0 1-.708 0l-1.5-1.5a.5.5 0 0 1 .708-.708L7.5 10.793l2.646-2.647a.5.5 0 0 1 .708.708Z"/> </svg> </symbol> </svg> <div class="side-bar"> <div class="site-header" role="banner"> <a href="/" class="site-title lh-tight"> Graphite </a> <button id="menu-button" class="site-button btn-reset" aria-label="Toggle menu" aria-pressed="false"> <svg viewBox="0 0 24 24" class="icon" aria-hidden="true"><use xlink:href="#svg-menu"></use></svg> </a> </div> <nav aria-label="Main" id="site-nav" class="site-nav"> <ul class="nav-list"><li class="nav-list-item"><a href="/" class="nav-list-link">Home</a></li><li class="nav-list-item"><button class="nav-list-expander btn-reset" aria-label="toggle items in About Graphite category" aria-pressed="false"> <svg viewBox="0 0 24 24" aria-hidden="true"><use xlink:href="#svg-arrow-right"></use></svg> </button><a href="/graphite_about.html" class="nav-list-link">About Graphite</a><ul class="nav-list"><li class="nav-list-item "><a href="/graphite_aboutWhy.html" class="nav-list-link">Why was Graphite developed?</a></li><li class="nav-list-item "><button class="nav-list-expander btn-reset" aria-label="toggle items in Graphite and OpenType category" aria-pressed="false"> <svg viewBox="0 0 24 24" aria-hidden="true"><use xlink:href="#svg-arrow-right"></use></svg> </button><a href="/graphite_aboutOT.html" class="nav-list-link">Graphite and OpenType</a><ul class="nav-list"><li class="nav-list-item "> <a href="/graphite_otcompare.html" class="nav-list-link">Comparison of OpenType and Graphite shaping speeds in a Nastaliq context</a> </li></ul></li><li class="nav-list-item "><a href="/graphite_techAbout.html" class="nav-list-link">Graphite technical overview</a></li></ul></li><li class="nav-list-item"><a href="/graphite_news.html" class="nav-list-link">News</a></li><li class="nav-list-item"><button class="nav-list-expander btn-reset" aria-label="toggle items in Using Graphite category" aria-pressed="false"> <svg viewBox="0 0 24 24" aria-hidden="true"><use xlink:href="#svg-arrow-right"></use></svg> </button><a href="/graphite_appsParent.html" class="nav-list-link">Using Graphite</a><ul class="nav-list"><li class="nav-list-item "><a href="/graphite_apps.html" class="nav-list-link">Applications that support Graphite</a></li><li class="nav-list-item "><a href="/graphite_firefox.html" class="nav-list-link">Graphite and Firefox</a></li><li class="nav-list-item "><a href="/graphite_fontdemo.html" class="nav-list-link">Graphite Font Demo</a></li><li class="nav-list-item "><a href="/graphite_fonts.html" class="nav-list-link">Graphite-enabled Fonts</a></li></ul></li><li class="nav-list-item active"><button class="nav-list-expander btn-reset" aria-label="toggle items in Developers category" aria-pressed="true"> <svg viewBox="0 0 24 24" aria-hidden="true"><use xlink:href="#svg-arrow-right"></use></svg> </button><a href="/graphite_dev.html" class="nav-list-link">Developers</a><ul class="nav-list"><li class="nav-list-item "><a href="/graphite_devFont.html" class="nav-list-link">Font Development</a></li><li class="nav-list-item "><a href="/graide.html" class="nav-list-link">Graide</a></li><li class="nav-list-item active"><button class="nav-list-expander btn-reset" aria-label="toggle items in Graphite Tutorial category" aria-pressed="true"> <svg viewBox="0 0 24 24" aria-hidden="true"><use xlink:href="#svg-arrow-right"></use></svg> </button><a href="/graide_tutorial.html" class="nav-list-link">Graphite Tutorial</a><ul class="nav-list"><li class="nav-list-item "> <a href="/tutorial/graide_tutorial1.html" class="nav-list-link">Unit 1</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial2.html" class="nav-list-link">Unit 2</a> </li><li class="nav-list-item active"> <a href="/tutorial/graide_tutorial3.html" class="nav-list-link active">Unit 3</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial4.html" class="nav-list-link">Unit 4</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial5.html" class="nav-list-link">Unit 5</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial6.html" class="nav-list-link">Unit 6</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial7.html" class="nav-list-link">Unit 7</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial8.html" class="nav-list-link">Unit 8</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial8a.html" class="nav-list-link">Intermission</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial9.html" class="nav-list-link">Unit 9</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial10.html" class="nav-list-link">Unit 10</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial11.html" class="nav-list-link">Unit 11</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial12.html" class="nav-list-link">Unit 12</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial13.html" class="nav-list-link">Unit 13</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial14.html" class="nav-list-link">Unit 14</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial15.html" class="nav-list-link">Unit 15</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial16.html" class="nav-list-link">Unit 16</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial17.html" class="nav-list-link">Unit 17</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial18.html" class="nav-list-link">Unit 18</a> </li><li class="nav-list-item "> <a href="/tutorial/graide_tutorial_end.html" class="nav-list-link">Conclusion</a> </li><li class="nav-list-item "> <a href="/tutorial/graphite_tut_solutions.html" class="nav-list-link">Solutions to Tutorial Exercises</a> </li></ul></li><li class="nav-list-item "><a href="/graphite_codeSnippets.html" class="nav-list-link">GDL Code Snippets</a></li><li class="nav-list-item "><a href="/graphite_devApp.html" class="nav-list-link">Adding Graphite to Your Application</a></li></ul></li><li class="nav-list-item"><a href="/graphite_download.html" class="nav-list-link">Download</a></li><li class="nav-list-item"><a href="/graphite_support.html" class="nav-list-link">Support</a></li><li class="nav-list-item"><a href="/graphite_contact.html" class="nav-list-link">Contact</a></li></ul> </nav> <footer class="site-footer"> This site uses <a href="https://github.com/just-the-docs/just-the-docs">Just the Docs</a>, a documentation theme for Jekyll. </footer> </div> <div class="main" id="top"> <div id="main-header" class="main-header"> <div class="search" role="search"> <div class="search-input-wrap"> <input type="text" id="search-input" class="search-input" tabindex="0" placeholder="Search Graphite site" aria-label="Search Graphite site" autocomplete="off"> <label for="search-input" class="search-label"><svg viewBox="0 0 24 24" class="search-icon"><use xlink:href="#svg-search"></use></svg></label> </div> <div id="search-results" class="search-results"></div> </div> <nav aria-label="Auxiliary" class="aux-nav"> <ul class="aux-nav-list"> <li class="aux-nav-list-item"> <a href="https://github.com/silnrsi/graphite" class="site-button" > Repository </a> </li> </ul> </nav> </div> <div id="main-content-wrap" class="main-content-wrap"> <nav aria-label="Breadcrumb" class="breadcrumb-nav"> <ol class="breadcrumb-nav-list"> <li class="breadcrumb-nav-list-item"><a href="/graphite_dev.html">Developers</a></li> <li class="breadcrumb-nav-list-item"><a href="/graide_tutorial.html">Graphite Tutorial</a></li> <li class="breadcrumb-nav-list-item"><span>Unit 3</span></li> </ol> </nav> <div id="main-content" class="main-content"> <main> <div class="table-wrapper"><table class="tut-nav-bar"> <tbody> <tr> <td><a href="graide_tutorial2">◀ Unit 2: A very simple GDL program</a></td> <td><a href="../graide_tutorial#contents">▲ Contents</a></td> <td><a href="graide_tutorial4">Unit 4: Corresponding glyph classes ▶</a></td> </tr> </tbody> </table></div> <h1 id="unit-3-the-glyph-table"> <a href="#unit-3-the-glyph-table" class="anchor-heading" aria-labelledby="unit-3-the-glyph-table"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Unit 3: The glyph table </h1> <p><a href="graide_tutorial3#exercise-3a">Exercises</a></p> <h2 id="discussion"> <a href="#discussion" class="anchor-heading" aria-labelledby="discussion"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Discussion </h2> <p>In addition to the tables that contain rules, there are tables containing other information. One of these is the glyph table. Among other purposes, the glyph table can be used to define classes of glyphs, and/or give meaningful names to single glyphs. The glyph table is marked by the following syntax:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>table(glyph) &lt;glyph class definitions&gt; endtable; </code></pre></div></div> <p>The glyph class definitions include lists of glyphs or codepoints that comprise the members of the class. The syntax of the glyph class definition is the following:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>class-name = &lt;list-of-glyphs&gt;; </code></pre></div></div> <p>For instance, you can give names to a group of digit characters as follows:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gZero = U+0030; gOne = U+0031; gTwo = U+0032; gThree = U+0033; gFour = U+0034; gFive = U+0035; gSix = U+0036; gSeven = U+0037; gEight = U+0038; gNine = U+0039; clsDigit = (U+0030..U+0039); </code></pre></div></div> <p>Notice the final statement defines a class of glyphs that includes ten digits. It could also have been written as follows:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>clsDigit = (gZero, gOne, gTwo, gThree, gFour, gFive, gSix, gSeven, gEight, gNine); </code></pre></div></div> <p>Parentheses are needed around the list of glyphs when more than one item is included. (Note: the use of an initial “g” to indicate single-glyph definitions and “cls” to indicate multiple-glyph classes is simply a convention.)</p> <p>In Unit 2 we mentioned briefly that glyphid can be used to reference a glyph directly, i.e.:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>glyphid(&lt;number&gt;); </code></pre></div></div> <p>where the number is the ID of the glyph in the font. (Note that glyphid can be less useful than postscript because it is more font-specific and therefore makes a program that is not as easily converted to work with a different font.)</p> <p>A fourth way to identify a glyph is using the codepoint function. It takes as an argument either a string that contains a list of characters or a numerical value. The codepage can be included as an optional second argument (Codepage 1252 is the default).</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>codepoint(“a”); codepoint(97, 1252); </code></pre></div></div> <p>As indicated in the example above, the codepoint, unicode, and glyphid functions can specify ranges of values by including the “..” syntax, for instance:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>clsLowercase = codepoint(97..122); // a through z </code></pre></div></div> <p>(Note that a comment is preceded by two slashes as shown above.) When a glyph has been given a name within the glyph table, that name can be used within a rule in place of the functions. The following is equivalent to the rule discussed in Unit 2 that replaces a’s with b’s.</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>table(glyph) g_a = unicode(0x61); g_b = unicode(0x62); endtable; table(sub) g_a &gt; g_b; endtable; </code></pre></div></div> <h2 id="exercise-3a"> <a href="#exercise-3a" class="anchor-heading" aria-labelledby="exercise-3a"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Exercise 3a </h2> <p>Rewrite your program from Exercise 2 to define the dollar and pound glyphs in the glyph table.</p> <p><a href="graphite_tut_solutions#exercise-3a">Solution</a></p> <h3 id="exploring-graide-the-passes-and-glyph-tab"> <a href="#exploring-graide-the-passes-and-glyph-tab" class="anchor-heading" aria-labelledby="exploring-graide-the-passes-and-glyph-tab"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Exploring Graide: the Passes and Glyph tab </h3> <p>After Exercise 3a is correct, let’s take a few minutes to explore a couple features of Graide. Enter the following data in the text data pane: $hello$. Click the right-pointing arrow to run it. The result should look like: <strong>£hello£</strong>.</p> <p>The Passes pane is displayed automatically. It shows the original glyphs (labeled “Init”) and the result of Graphite’s rendering for each pass. Since there is only one pass in this program, there are two rows in the Passes pane: the original glyphs (“Init”) and the output of Pass 1. The second column shows the glyphs that were output for the pass, and the third column shows the corresponding glyph names.</p> <p class="image-tight"><img src="../assets/images/graide3_1_passesTestsTabs.png" alt="Passes tab in Graide" /></p> <figcaption>Passes tab in Graide</figcaption> <p>Glyph names are the names given to single glyphs in your GDL program. For instance, if your GDL source code included the line</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gDollar = unicode(0x0024); </code></pre></div></div> <p>you will see “gDollar” twice in the third column of the first row.</p> <p>Click on one instance of “gDollar”, and then click on the Glyph tab. This area shows basic information about the dollar (‘$’) glyph from the font and your GDL program.</p> <p class="image-tight"><img src="../assets/images/graide3_2_passesGlyphTabs.png" alt="Passes and Glyph tab in Graide" /></p> <figcaption>Passes and Glyph tab in Graide</figcaption> <p>You can also click on the glyph itself in the second column of the Passes tab to select it. But notice that you must carefully click on the black part of the glyph; clicking on white pixels inside or near the glyph will have no effect. (So clicking on the glyph name in the third column may be easier!)</p> <p>Notice that some of the glyphs in your test data were not given names in your GDL program. For these glyphs Graide generates a name based on the Postscript name from the font. The autogenerated name has “g_” prepended, and any uppercase letters are replaced by an underscore plus the lowercase letter. For instance:</p> <div class="table-wrapper"><table> <thead> <tr> <th style="text-align: left">Glyph</th> <th style="text-align: left">Postscript name</th> <th style="text-align: left">Graide name</th> </tr> </thead> <tbody> <tr> <td style="text-align: left">a</td> <td style="text-align: left">a</td> <td style="text-align: left">g_a</td> </tr> <tr> <td style="text-align: left">B</td> <td style="text-align: left">B</td> <td style="text-align: left">g__b</td> </tr> <tr> <td style="text-align: left">5</td> <td style="text-align: left">five</td> <td style="text-align: left">g_five</td> </tr> <tr> <td style="text-align: left">(</td> <td style="text-align: left">parenleft</td> <td style="text-align: left">g_parenleft</td> </tr> <tr> <td style="text-align: left">È</td> <td style="text-align: left">Egrave</td> <td style="text-align: left">g__egrave</td> </tr> </tbody> </table></div> <h2 id="exericse-3b"> <a href="#exericse-3b" class="anchor-heading" aria-labelledby="exericse-3b"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Exericse 3b </h2> <p>Write a program to replace all digits with an asterisk. Use the glyph table to define a class containing the digit characters.</p> <p><a href="graphite_tut_solutions#exercise-3b">Solution</a></p> <h3 id="exploring-graide-the-passes-and-glyph-tab-1"> <a href="#exploring-graide-the-passes-and-glyph-tab-1" class="anchor-heading" aria-labelledby="exploring-graide-the-passes-and-glyph-tab-1"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Exploring Graide: the Passes and Glyph tab </h3> <p>After Exercise 3b is correct, let’s explore another feature of Graide. Enter the following test data: 234.5; click the arrow to render it. The result should be: <strong>***.*</strong>.</p> <p class="image-tight"><img src="../assets/images/graide3_3_PassesTestsTab2.png" alt="Passes tab in Graide" /></p> <figcaption>Passes tab</figcaption> <p>The Passes pane is displayed automatically. It shows the initial glyphs and the result of Graphite’s rendering for the single pass in this program.</p> <p>The row labeled <strong>Pass: 1 – substitution</strong> is highlighted in yellow, indicating that there was at least one rule matched in that pass. When you double-click on the yellow cell, the Rules tab appears. Each row of the Rules pane corresponds to one instance of a rule that was matched in pass 1. For this example, if your code looks like the supplied solution, all the rows are labeled <strong>Rule: 0</strong> since that is the only rule in the program.</p> <p class="image-tight"><img src="../assets/images/graide3_4_RulesTab.png" alt="Rules tab in Graide" /></p> <figcaption>Rules tab</figcaption> <p>Note that the output of any rule becomes the input to the next rule fired. So the glyphs shown in row 2 are the output of the first application of the rule, but are also the glyphs that are matched in order to fire the rule the second time.</p> <p>In each row, the glyphs that are generated—that is, modified—by a rule are highlighted in green. For this program, these are the asterisks. The glyphs that were matched in the previous row are highlighted in pink. As you can see, each row in the Rules tab represents an instance of <strong>Rule 0</strong> applied to successive glyphs in the data.</p> <p>Double-clicking on any of the cells labeled Rule: 0 will highlight the rule in the code pane.</p> <p class="image-tight"><img src="../assets/images/graide3_5_RulesHighlightRule.png" alt="Highlighting a rule from the Rules tab" /></p> <figcaption>Highlighting a rule from the Rules tab</figcaption> <div class="table-wrapper"><table class="tut-nav-bar"> <tbody> <tr> <td><a href="graide_tutorial2">◀ Unit 2: A very simple GDL program</a></td> <td><a href="../graide_tutorial#contents">▲ Contents</a></td> <td><a href="graide_tutorial4">Unit 4: Corresponding glyph classes ▶</a></td> </tr> </tbody> </table></div> </main> <hr> <footer> <p class="text-small text-grey-dk-100 mb-0">Copyright &copy; 2012-2023 SIL International and released under the <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 license (CC-BY-SA)</a> unless noted otherwise.</p> </footer> </div> </div> <div class="search-overlay"></div> </div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10