1. A method comprising: receiving, by a processor, an image of at least a portion of a source document comprising textual content; identifying, by the processor, a plurality of glyphs in the image; for each glyph of the plurality of glyphs, determining, by the processor, a width of a respective glyph; determining, by the processor, an advance value for the respective glyph using the width of the respective glyph and the space between the respective glyph and a next glyph following the respective glyph in the image; adding, by the processor, an entry for the respective glyph to an advance table of a font file, wherein the entry in the advance table comprises a glyph identifier of the respective glyph and the advance value of the respective glyph; and adding, by the processor, an entry for the respective glyph to a mapping table and a contour table of the font file, wherein the entry in the mapping table comprises the glyph identifier of the respective glyph and a Unicode code point assigned to the respective glyph, and the entry in the contour table comprises the glyph identifier of the respective glyph and a contour definition for the respective glyph; and generating, by the processor, an electronic document for the textual content based on the plurality of glyphs and the font file.