1

Basically, I have a few font files that currently have Latin alphabet glyphs and I want to import Arabic characters from a different font file to these font files. Yes, the Arabic glyphs are from a free-for-personal-use font, in case anyone was worried about that, and the Latin characters are from my own intellectual property. I just want to find a way to import all of the Arabic glyphs in a quick way that does not involve doing them one at a time. Is there a known quick-and-easy method? Thanks.

  • ... Why? I can't think of any actual reason to do this: just use both fonts. It's not the 1970s anymore, almost any application you are thinking of can be taught to use a font stack. Or, put another way: I'm pretty sure this is [an XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem) and you need to explain what your original problem was to which "copying the glyphs" was the solution you came up with and are now asking about. Let's solve that original problem, instead. – Mike 'Pomax' Kamermans Aug 09 '17 at 03:43
  • 1
    As much as I would like to do that, this is being used as a display font that does not know to display certain characters in certain fonts, or have an order to display unknown characters in the main font in another font, and I do not know how to tell the OS to look to other fonts specifically for characters that do not exist in the primary display font. If you know how to do that, that would be swell. Otherwise, this seems like the simplest and most useful solution. – Joey Dubois Aug 10 '17 at 19:25
  • 1
    There is nothing simple about moving an entire font's logic into another font. You can't just "copy the letters" and suddenly things work, you need to copy all the metadata around positioning, substitution, etc. etc. and that is an insane amount of work for something that we invented font fallback for in the 80's. So: "this is being used as a display font that does not know to display certain characters in certain fonts" is the real problem you have: please close this question and post a new one asking how to enable font fallback in the GUI framework you're using. – Mike 'Pomax' Kamermans Aug 10 '17 at 19:28
  • For those prepared to risk the perils Pomax warns of, there is [a pretty good overview of solutions at Super User](https://superuser.com/questions/490922/merging-two-fonts). In particular [this answer](https://superuser.com/a/1382162/123017) offers two scripts that programmatically do so, if that's your goal. – Alan De Smet Apr 03 '19 at 19:32

1 Answers1

1

The best solution would be to figure out how to enable fallback fonts in your OS. Any OS that can read modern TTF or OTF fonts should support this. It would let you keep the fonts in their original form, which means less work, less testing and easier maintenance.

FontForge (a free tool) can merge fonts: see here. But I suspect this may not give an optimal result. Arabic fonts tend to contain many ligatures and other complex features, and I don't think all the internal font tables required for these features will be merged across. You'd have to test extensively to ensure that the Arabic results still looked good.

You may have more luck just opening both fonts in FontForge, selecting the full range of your latin glyphs from your own font, and copy-pasting them into the Arabic font. Then save the result as your merged font. That would mean any special tables for Arabic features are retained, while those for Latin glyphs (such as class-based kerning) are lost. Pairwise kerning would be retained. As the author of the Latin font, you'll have some idea of how successful this might be.

There are other font features that won't necessarily work well with both fonts, such as the ascender/descender metrics, blue values, etc. You could end up with poor rendering of Latin at small sizes, or even chopped off tops and bottoms of characters. These can all be fixed, but it takes time and careful testing. A well-made font is a highly tuned machine, and merging two fonts properly is a time-consuming process.

Ben Whitmore
  • 857
  • 1
  • 6
  • 15
  • Merging is never the solution. Fonts are designed for GSUB/GPOS/etc to make sense within that typeface so *really* the only sensible thing here is "just use font fallback, it's 2017, everything you use can do this". – Mike 'Pomax' Kamermans Aug 16 '17 at 23:05