How do I make a font with special glyphs that replace specific sequences of normal glyphs

Hi there,

I am extremely new to this and it’s my first time attempting anything that has to do with making fonts. I would appreciate any indication on where I should start if I wanted to make a font that would replace various sequences of glyphs with special glyphs. For instance, the font would draw a magic wand (that I design) everytime somebody types “magic”

Thanks in advance!

After a bit of research, it seems that I can achieve it with open type ligatures.

Would anyone have any advice on how to proceed if let’s say I wanted the font to only ever show the special sequences? (I have control over the input and I would like to exclude certain characters from displaying

As opposed to what?

Can you give an example, perhaps show your design?

I don’t really have finished designs but let me try to explain better.

A font is probably not the best solution to what I’m trying to achieve but given my constraints, it is the only solution.

  • I have an input text coming from a third party. Let’s take as an example to illustrate dates that are formatted as Month + Day + TimeFrame (ex: “July 17 from 9 to 10”)
  • In the client context that I have, I can only use text with the possibility of custom fonts. And I want to display a drawing instead of the text. So following my dates example, I would like to have a drawing that shows a square with the month abbreviation and the date number beneath it. I would look like this icon :calendar:
  • Form my understanding so far, I need to create a ligature for “July 17” and every other date combination (still looking into how to automate it) but I also want the part that says “from 9 to 10” to be completely ignored and not take any space

I feel that I’m making very small steps in understanding how things might work but still far from having a “production” solution, so I would appreciate any help that I can get.

This shouldn’t entöle be solved in a font but in the software processing the entry and . Because you need to normalize the input first.

However, I would split into several glyphs, one for the month (e.g. the square with the month name) and the figures for the day, adapted in size so they fit in the square. Otherwise you end up with 365 ligatures.

The deletion of the excess letters cannot be done inside the font, or only in a dissatisfying way.

Is it supposed to work in a web browser?

As I said, I agree this shouldn’t be solved in a font but given my constraints it would be the only way if possible.

I cannot share a lot because of an NDA but the context is not a Web browser and doesn’t support editing or selection but it is only for display. Also the example I gave is only to illustrate because I can’t really share my actual example.

The deletion of the excess letters cannot be done inside the font, or only in a dissatisfying way.

What would be the dissatisfying way?

That makes it hard to help you.

The dissatisfying way is that you use ligature substitutions, turning two glyphs into one. At least as an intermediary step. You may need to organize the substitutions in separate lookups.

I’d do as Mekkablue, create one glyph for the calendar icon, and play around with the spacings so the Month and Day Numbers don’t move.

Edit

yup, as Mekkablue says, one kind of laborious way to do it would be:

  • 12 components for the months: January-December
  • 10 components for the 1-31 day of the month numbers (or 31, as you prefer)
  • 365 glyphs for the each day of the year

and then you name each of those 365 glyphs as m_o_n_t_h_day.liga:

j_a_n_u_a_r_y_1.liga
j_a_n_u_a_r_y_2.liga
...
d_e_c_e_m_b_e_r_3_1.liga

after that, open font info (Cmd-I), and then click the Update button, to generate all the ligatures automatically.

Tutorial: Ligatures | Glyphs