Code Monkey home page Code Monkey logo

Comments (2)

kiliman avatar kiliman commented on July 29, 2024

I originally used FontForge, an open source font editor. https://fontforge.github.io/en-US/

Basically, I edit the fonts and save it as OTF. Put the .otf file in the ligature_source folder, then run extract. It will then generate the XML files for you.

If you're going to add a new ligature, you need to do a few things:

  1. When you name the glyph, use the format: 'glyph1_glyph2_glyph3.liga' where each glyph is the component name, like 'equal_greater.liga'
  2. Make sure the width is a multiple of 550 for the normal OM font and 625 for ScreenSmart. So if you have a ligature of 3 characters, it will be 3 * 550 = 1650 or 3 * 625 = 1875.
  3. I typically try to set my LSB (Left-Side Bearing) to 87 and then stretch and make the RSB 87 as well. If you're making a glyph like && or ??, then I typically center the glyph. Sometimes you'll want to "optically" center instead of mathematically center. That is, move the glyph around until it looks balanced on both sides. Curves and slants tend to fool the eye. The Glyphs app had a nice feature where you can add text around the glyph so you could see it better in context. Check out the YouTube video from the README to see what I mean.

You'll also need to do the following outside the font editor:

  1. Update the file /ligatures/glyphs.xml and add your new glyphs. Don't worry about the id, they'll be renumbered when building the new font. Just make it the next sequence.
  2. Update the file /ligatures/lookup.xml to add your ligature mapping. Look for the first character in your glyph (like equal and find the corresponding <LigatureSet glyph="equal">. Add a new <Ligature/> entry, where components="..." the remaining characters (comma separated for multiple). NOTE: Make sure you order them with the longest sequence first as the first match will be the one that is displayed.

This is just a quick summary off the top of my head. One of the issues is that the extract and build tools expect all ligatures be present in each font weight. That's why I've been slow to add new ligatures for now. You can also run extract and build scripts by passing in the font name: build OperatorMonoLig-Book to build individual fonts.

Anyway, if you have any questions, post them here and I'll try to answer.

from operator-mono-lig.

Orillian avatar Orillian commented on July 29, 2024

Awesome. Thanks for the directions. I'll start fiddling around with this this weekend!

from operator-mono-lig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.