Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents


Text in documents can be accessed by finding the glyphs nodes on a page. Each glyphs node will contain a run of text.


Code Block
using var originalFont = glyphs.getFont();

if (originalFont.getFontType() != IDOMFont.eFontType.eFontTypeOpenType)
    throw new InvalidOperationException("Font is not compatible with Mako.");

var originalTrueTypeFont = IDOMFontOpenType.fromRCObject(originalFont.toRCObject());
var fontName = originalTrueTypeFont.getFullName(factory, (int) glyphs.getFontIndex());

    return jawsMako.findFont(fontName, out _);
catch (Exception e)
    Console.WriteLine($"Failed to find font on local system: {e.Message}");
    // Fallback to Arial for testing.
    return jawsMako.findFont("Arial", out _);

Converting Text to Paths

In some cases, it may be desired to convert all text into paths. Thankfully Mako makes this very simple.

The code below calls getEquivalentPath(...) to get a new IDOMPathNode. This IDOMPathNode contains the vector content that represents the orignal text. It's been setup correctly so the next step is simple to replace the existing IDOMGlyphs node.

Code Block
using var path = glyphs.getEquivalentPath();
glyphs.getParentNode().replaceChild(glyphs, path);