Quantcast
Channel: Glyphs Tutorials
Viewing all 88 articles
Browse latest View live

Additional masters for individual glyphs: the brace trick

$
0
0

For interpolation, two-master setups work surprisingly well. Well, except that sometimes you need an extra step in between. Sure, you could sort of fake it with the Bracket Trick, or an alternative glyph that kicks in in some instances only. But that can turn out to be complicated, as we may have to add (and redraw) many masters per glyph.

Create and name a brace Layer

In Glyphs 2 or later, you can employ something called the ‘Brace Trick’. Similar to the Bracket Trick, we copy one of the master layers, and adjust the name. You do that by opening the Palette sidebar (Window > Palette, Cmd-Opt-P), selecting your first master in the Layers palette, and clicking the Copy button.

Double click the name of the new layer, and type in a brace layer name. The name structure is as follows:

optionalDescription {weightValue, widthValue}

In short, it is curly braces containing a comma-separated list of interpolation values. If you like, you can use a descriptive prefix such as ‘Intermediate’. What it does is insert an intermediate master for this very glyph at that very position in the interpolation space. For instance, a layer called Intermediate {120, 100} will act as a master at 120 on the weight axis, and at 100 on the width axis.

All that rests to be done now, is actually draw the layer. You can get a head start if you choose Re-Interpolate from the gear menu in the bottom right of the Layers palette. This will put a new interpolation into the brace layer. Careful, it overwrites what is there.

brace-4

By the way, you can temporarily deactivate the brace layer by deleting a curly brace or writing a suffix between braces, e.g. Intermediate {90, 100 off}. You can check if the layer is active or inactive by choosing Show all instances from the instance pop-up in the Preview section of the Edit tab.

Example

A typical use case would be the lowercase e, interpolating from Light to Heavy. While the stems can increase equally up until a medium weight, the horizontals cannot grow as quickly as the verticals in heavier weights. If we just have a Light and a Bold master, the horizontals thin out too soon. Pay attention to the middle bar of the e:

brace-2

We can fix the wacky interpolations with an intermediate master for this glyph. Like described above, we add a brace layer with a sensible descriptive name and an appropriate weight value. We can leave the width value at its default. So, in our example, this happens to be Intermediate {90, 100}:

brace-1

Now you have an extra master, just for this glyph, and the e interpolates much better. Look how well the middle bar behaves, while the outer masters remain the same:

brace-3

That’s it. High five.


Working with UFO

$
0
0

The Unified Font Object is an XML-based file format for storing font data. It was developed by type designers and developers Tal Leming, Just van Rossum, and Erik van Blokland. While the specs for version 3 have been released, UFO 2 is currently in most widespread use.

While you can produce a font or font family in Glyphs alone, the UFO format makes the exchange with other tools possible. UFO gives you access to a variety of other tools. This is why Glyphs supports it out of the box. But why would you want to do that in the first place? Easy: Typically, UFO tools are highly specialized apps, entirely dedicated to a specific task. That means that those tools can pick up where the in-app functionality of Glyphs leaves off. Read on for a few examples.

UFO does not store everything

One thing to keep in mind is that many Glyphs-specific settings, like enabled or disabled automatic alignment of components, or things like the bracket trick, cannot be stored in UFO files. So take extra care and double-check your files where necessary.

Very important: UFOs are single masters. Multiple Master information cannot be stored within a single UFO file. This means that if you want to interpolate, you will need to use one UFO file per master.

Preferences and file settings

If you want to be prepared for tapping into a UFO workflow, you will find two important options in Glyphs > Preferences > User Settings. What they have in common is that they are applied to all non-native files opened in Glyphs, e.g. a file with a .ufo suffix.

ufo-1

Firstly, enabling the option Keep glyph names from imported files will prevent Glyphs from converting the names of the glyphs to its own naming scheme. In a pure Glyphs workflow, there are certain advantages if you stick to the internal naming scheme. But when you are moving a lot between applications, you will usually want to keep the names as set in the file.

Secondly, you may want to keep the placement of components in your file. In other words, you may want to keep Glyphs from enforcing automatic alignment of composite letters. In that case, selecting the option Disable automatic alignment in imported files is a good idea.

What these two settings do, is set the two corresponding options in File > Font Info > Other Settings, namely Use custom naming (or Don’t use nice names in older versions of Glyphs) and Disable automatic alignment. There, of course, you can also set these options manually.

ufo-2

Of course, if you go the opposite direction, i.e., take your .glyphs file for a UFO ride, you can keep the settings at their defaults, and take full advantage of automatic alignment and nice names.

Now that we are prepared, we can get down and dirty with UFO files!

Exporting UFOs

If you want to create a UFO copy of your current font project, pick File > Export > UFO. In the upcoming dialog, you can choose which masters you want to export, and in the following dialog, where you want to save the UFO files.

ufo-3

The option Convert Glyph Names to Production Names will convert the human-readable nice names, such as Zhe-cy, for Cyrillic uppercase Zhe, to their industry-standard counterparts, like uni0416. While these names may be hard to memorize, they are more compatible. Some tools may expect them to be in place. Our advise: Testrun your workflow with nice names, and if it does not work, you can still choose to convert the names.

Important: Please make sure you update to version 1.4.4, which fixes a bug in the UFO export of multiple masters.

UFO as saving format

If you already have a UFO file lying around, you can open it in Glyphs, and stay in UFO mode. Saving (Cmd-S) will save directly to the UFO.

ufo-4

You can also use File > Save As… (Cmd-Shift-S) to save a copy of your frontmost file as a UFO. In order to achieve that, you need to pick Unified Font Object as File Format in the export dialog. Glyphs will warn you if saving as UFO is not possible, e.g., when the file in question has more than one master. In that case, you would need to use File > Export (Cmd-E).

Once you have your UFO files ready, you are ready to work with a multitude of specialized applications and tools.

RoboFont

Belgian type designer Frederik Berlaen’s UFO editor RoboFont was built from the ground up for ultimate workflow flexibility. To achieve that, he made it very simple to build your own tools with the easy-to-learn programming language Python. No wonder that, for RoboFont, a wide variety of plugins and scripts are available on GitHub and other places across the web. Many extensions are listed on the RoboFont website itself. To get an idea of the power of the underlying API, take a look at Loïc Sander’s ‘An experiment in parametric type design’ video.

ufo-5

MetricsMachine

Tal Leming’s MetricsMachine is an app completely dedicated to kerning. With specialized tools for kerning group and kerning pair creation, stack views, automatically adapting contextual strings, a range of presets, etc., the app offers a more systematic and analytical approach to kerning than Glyphs can.

The app sports a Pair List Builder for creating all possible kerning pairs out of selected glyphs. Once you have your pairs set up, step through your kerning list with up and down arrows, adjust the kerning in steps of 10 units with left and right arrows, hold down the Shift key for steps of 5 units, the Option key for single-unit steps. Finally, the Spreadsheet function helps you get a grip on your kern table: filter and analyze to your heart’s content.

One little catch: What Glyphs calls a right group (based on the side of the glyph that is involved), MetricsMachine calls a left group (based on the side of the kern pair).

ufo-6

By the way, you can also incorporate MetricsMachine in a pure Glyphs workflow. All you need to do is export your UFOs, and kern them in MetricsMachine. Now, you can bring all the kerning info back into your Glyphs file by selecting all glyphs and choosing File > Import > Metrics… And in the upcoming dialog, pick whether you want to just import the kerning, or also the kerning groups.

ufo-7

Important: all glyphs that are supposed to be affected, need to be selected before you import. So, probably the best idea is to simply select all glyphs, and then import.

Superpolator

While you can do Multiple Masters in Glyphs alone, Erik van Blokland’s Superpolator opens up a whole new universe of inter- and extrapolation. Since the app is entirely dedicated to interpolation, you get things like immediate preview and live measuring options, any number of masters on any number of axes, individual interpolations for any number of glyphs, you name it. For a brief introduction, watch Erik’s Superpolator 3 presentation at Robothon 2012.

More UFO tools

Actually, these are just three examples for UFO-based applications. Keep your eyes open and you will find many tools, like RoboFont author Frederik Berlaen’s roundingUFO, which has proved very handy for creating ink traps. And if you want to go ahead and plunge into the Superpolator universe, Tal Leming’s Prepolator helps you prepare UFO files for interpolation.

Interestingly, also many command line tools work with UFO files. For instance, take a look at ufo2otf, which allows you to compile a ready-to-use webfonts and OTFs directly from a UFO. Speaking of OpenType, Adobe’s own Font Development Kit for OpenType can make use of UFO files. Tal Leming’s ufo2fdk can prove helpful if you make use of it.

Don’t use UFO for FontLab

If you want to move your font project between Glyphs and FontLab Studio, however, it is a bad idea to use UFO as exchange format, because too many things may get lost on the way. In this case, it is better to use the Glyphs Import and Glyphs Export macros for FontLab Studio, provided by Georg on his GitHub repository.

Mark Attachment

$
0
0

There are two ways of having accented letters in your font. Firstly, you can simply pre-build them as compound glyphs. We have covered this in a Diacritics tutorial. At CFF export, the components are decomposed, and wherever necessary, overlaps are removed. Even though this means that you have a lot of path duplicates throughout your font, this method is widely used because it is most compatible. And if you cannot predict in which environment your font is going to appear, you may have to stick to this way anyway.

Secondly, however, you can just keep marks and and base glyphs around, and have the rendering engine stick them together on the fly. This is called mark attachment. The big advantage, as you may have guessed, is a drastically reduced file size of the final font. You are even free to put any accent on any base glyph by the means of something called Mark-to-Base Attachment. What’s more, you can even stack accents on top of each other. This also has a name: font experts refer to it as Mark-to-Mark Attachment.

The downside of all this fun stuff is the lack of application support. But gradually, more and more software is supporting mark attachment. So, the best way to cope with this reality is to put both things into your font: prebuilt compounds and marks for attachment.

Adding combining accents

For mark attachment to work, we need something called combining marks, or, non-spacing marks. Mark attachment does not work with legacy spacing marks.

Typically, combining marks have a comb at the end of their name, and, apart from the scripts that have their own combining marks, usually live in these Unicode ranges:

  • U+0300-036F COMBINING DIACRITICAL MARKS
  • U+20D0-20FF COMBINING DIACRITICAL MARKS FOR SYMBOLS
  • U+1DC0-1DFF COMBINING DIACRITICAL MARKS SUPPLEMENT
  • U+FE20-FE2F COMBINING HALF MARKS

‘But which ones do I need for the languages I want to add to my font?’, I hear you ask. Fear not, in the language category in the sidebar, you can add them by right-clicking on the Language entry:

markattachment1

You may want to scroll down to see the combining marks. For instance, for Western Latin, these are necessary:

acutecomb
cedillacomb
circumflexcomb
dieresiscomb
dotaccentcomb
gravecomb
ringcomb
strokeshortoverlaycomb
tildecomb

Adding anchors

Basically, all we need now, is a set of defined positions where the letters and marks can connect. You do this by adding anchors to your base letters and accents. In other words, anchors serve as position markers that tell Glyphs where the letters and marks are going to be hooked up with each other. You can quickly add default anchors to selected glyphs with Glyph > Set Anchors (Cmd-U). If you think you have messed up, you can hold down the Option key and choose Glyph > Reset Anchors (Cmd-Opt-U).

Anchors inside a glyph have unique names. The base glyph has anchors called top, bottom, center and ogonek. If anchors are selected, you can see a cloud of marks that can connect with the anchors in the current glyphs:

markattachment2

The mark glyphs have anchors with the same names, except for additional preceding underscores, i.e., _top, _bottom, _center and _ogonek. Actually, marks contain both anchors, so the anchors can stack:

markattachment3

Most important for us are top and bottom anchors, as well as their underscored variants in the marks. Default anchors are a good start, and Glyphs has a big built-in database of which anchors are associated with which glyph. When you add default anchors as described above, Glyphs even tries to put them into default places. So, you may need to adjust the anchor positions in many glyphs. And if you want to add your own, you can do so by right-clicking inside a glyph and choosing Add Anchor from the context menu.

Now, here’s the deal: The underscored anchors will try to connect to the corresponding base anchor in the nearest preceding glyph. If the mark does not find a corresponding anchor in the mark immediately before itself, it will look in the mark before that, until it hits the base letter.

For example, the acute (glyph name acutecomb) knows where to go exactly on a lowercase e, by connecting its _top anchor with the base glyph’s top anchor. If there is a diaeresis (a.k.a. dieresiscomb) between them, it will use the top inside the dieresiscomb, if it is there.

So, choose your anchor positions wisely. We strongly recommend the following:

  • Keep anchors on vertical metric lines wherever possible, e.g., keep bottom on the baseline, top on the x-height or ascender in lowercase letters, and on the cap height in uppercase letters.
  • Since you have wisely put the _top anchor on the x-height, keep your lowercase marks above the x-height.
  • Use case variants for your uppercase marks: Duplicate the marks (Cmd-D), move them above cap height, reset the anchors (Cmd-Opt-U), and change their suffix to .case. Now when you compose uppercase compounds, .case variants will be preferred if available. You can re-compose existing compounds with Glyph > Make Component Glyph (Cmd-Opt-Shift-C).

Derive spacing accents

So, starting in Glyphs version 2.0, combining marks are the default. Yet, there still need to be legacy spacing marks in your font for compatibility reasons. This is how the smart kids do it these days: You first create your combining marks with the anchors described above, then you choose Glyph > Add Glyphs... (Cmd-Shift-G), paste these lines into the dialog sheet that appears, and press Generate:

acutecomb=acute
brevecomb=breve
caroncomb=caron
cedillacomb=cedilla
circumflexcomb=circumflex
dieresiscomb=dieresis
dotaccentcomb=dotaccent
gravecomb=grave
hungarumlautcomb=hungarumlaut
macroncomb=macron
ogonekcomb=ogonek
ringcomb=ring
tildecomb=tilde
caroncomb.alt=caron.alt

This creates spacing accents as component copies of the combining accents. This means that they always stay in sync. And now you are backwards compatible, yay!

markattachment4

Typing combining accents

In order to test mark attachment the font, you need to be able to type the non-spacing accents in an application like InDesign. First, export your font into the Adobe Fonts folder, then create a new document, type a base glyph like a and then, add a combining accent. Here is how:

First, choose Show Character Viewer from your Input Methods menu in the toolbar (the one with the flag symbol in your menu bar). If you don’t have such a menu, activate it in System Preferences > Keyboard > Input Sources and turn on the option Show Input menu in menu bar:

markattachment5

Then, if Unicode does not show up in the left sidebar of your Character Viewer, choose Customize List... from the gear menu in the top left oft the window:

markattachment6

... and choose Code Tables > Unicode in the dialog sheet that appears:

markattachment7

Now you can select Unicode in the sidebar, scroll down to the 0300 area between Latin and Greek, pick any of the combining accents there, and insert it by double clicking:

markattachment8

Don’t worry. You only need to set this up once. InDesign even allows you to separately select and color your combining accents:

markattachment9

Again, the smart kids actually build their own keyboard layout with Ukelele from the nice people at SIL. But that is another story.

Edit View

$
0
0

The Edit View is where you can type text, in order to edit and test your font. To access Edit View, you can either double click a glyph in Font View, or open a tab with View > Open Tab (Cmd-T). The selected glyphs are then opened in the Edit View, and the Text tool (T) is active.

You can now type any text you want, and edit any of the typed glyphs. That is one of the key features of the software: to edit in a word context. Because when making a font, we do not just want to make a group of beautiful letters, but rather a beautiful group of letters, to paraphrase Matthew Carter:

edit-iceberg

Switch to glyph editing

In order to actually edit the outlines of a glyph, you can double click it, and the glyph is ready for your vector edits. You can achieve the same thing by clicking on an edit or select tool in the toolbar.

You cannot type the tool shortcut (e.g., S for the Scale Tool), because that would type the letter rather than switch to the tool. If, however, you do not want to lift your hands from the keyboard, simply press the Esc key, and the current glyph (the one to the right of the cursor) becomes editable.

Pro tip: If you type a letter twice, and double click one of them, you get an immediate high-res preview in real time, right next to your vectors.

edit-hello

Switching through glyphs

In text mode, you can quickly go from one glyph to the following by first moving the cursor in front of it, and then pressing the Home and End keys on your keyboard. On a MacBook keyboard, you can press Fn and the left and right arrow keys to advance or go back through your glyph set:

edit-switch

Pro tip: If you hold down the Shift key, the advancement stays within the glyph set currently displayed in the Font tab. So if you just want to switch through your basic ASCII letters, select Languages > Latin > Basic in your Font tab, then go back to your Edit tab, and hold down your Shift key while switching through the glyphs.

Sample strings

And of course, you can define your own set of sample texts in Glyphs > Preferences > Sample Strings. They are great for spacing and kerning. You can step through these strings if you choose Edit > Select Sample Text (Cmd-Opt-F):

edit-samplestrings

Some people prefer to step to the next sample text with Edit > Other > Select Next Sample String and Select Previous Sample String. Want a shortcut for that? You can define one in System Preferences > Keyboard > Shortcuts > App Shortcuts:

edit-samplestringsshortcut

SAMPLE FONT: PRAKASHAN ITALIC, COURTESY OF ALESSIA MAZZARELLA.

Reusing Shapes: Smart Components

$
0
0

Imagine you want to re-use the shoulder of your lowercase n, for example, in your lowercase m or h. Sure, you could do that with components like we did with slab serifs. There is one problem with using regular components, though: they are static.

But we need to adjust the shoulders in the m. Most people like to have them a little narrower. That is because the two shoulders would add up too much whitespace in a single letter.

shoulder-m

Also, on the lowercase h, most designers will drag down the crotch to make the white incision appear as deep as in the n. That is because the stem of the h cannot be adjusted as easily as the upper serif of the n.

shoulder-h

That is why normal, static components are of no use for us here. We need a better solution.

Setting up a Smart Glyph

We will turn the shoulder into a Smart Component. Double click the shoulder of the n to select it. Then right-click to bring up the context menu, and pick Component from selection:

componentFromSelection

When you are prompted for a Name of the Component Glyph, you enter a name that starts with _part, because it is a part we can reuse in other glyphs. Also, Glyphs created with an underscore at the beginning will be set to non-exporting by default, which makes sense for us. Assuming that you will have more than one Smart Component in your font, you should finish it with a dot suffix. In our case, I suggest .shoulder:

nameOfTheComponentGlyph

A separate glyph called _part.shoulder will be created. Let’s add anchors so the art can connect to other parts. First, we can add an anchor for the following part to connect. We can call it connect and align it to the right edge of the stem.

Then, we need an anchor, so _part.shoulder can connect to a preceding part. Assuming that the preceding one has a connect anchor in it, the corresponding anchor must be called _connect with an underscore at the beginning. Since they should all have the same height (i.e., y coordinate), I suggest keeping the anchors on the baseline. Once we are done, it could look like this:

partWithAnchors

Because it starts with _part, it is recognized as a Smart Glyph. But as long as it does not have any extra layers, it is not very smart yet. So, let us copy the current layer twice, and name the layers NarrowShoulder and LowCrotch. You can do that in the Layers section of the Panel sidebar (Cmd-Opt-P):

layersPanel

Now, you can activate the NarrowShoulder layer, and nudge it a little tighter: Select the right half of the shoulder, hold down the Ctrl and Option keys, and press the left arrow key. The selected part will move to the left, and the surrounding handles will be adjusted proportionally. Add Shift for increments of 10 units:

nudgeShoulder

Do the same on the LowCrotch layer, but this time, you select the two leftmost nodes and nudge them down to achieve a lower crotch. The simple nudging should do as a start. You can refine the shape later.

Now, with _part.shoulder still active, right-click in the canvas to bring up the context menu, and choose Show Smart Glyph Settings. Or, with the same effect, choose Edit > Info for Selection (Cmd-Opt-I):

showSmartGlyphSettings

In the dialog sheet that appears, you add a property called shoulderWidth with the Plus button, and enter 0 and 100 as its Limits. The name and the numbers are more or less arbitrary, the Bottom limit is required to be smaller than the Top limit, though. And the values should make sense to you. I choose zero to represent the minimum width of the shoulder, and a hundred for its maximum.

Then, add a second property called crotchDepth with -100 and 0 as its limits. To me, -100 best represents the lowest crotch, and zero the normal crotch.

smartProperties

Then, switch to the Layers tab of the dialog sheet. Here, you tell Glyphs which property values apply to which of the layers. In our case, this could be:

  • Regular: crotchDepth 0 and shoulderWidth 100
  • NarrowShoulder: crotchDepth 0 and shoulderWidth 0
  • LowCrotch: crotchDepth -100 and shoulderWidth 100
smartLayers

Once you set all properties for all layers, you can confirm the dialog by clicking on the OK button.

Adjusting the Smart Component

Now, back in glyphs like h, m, and n, you can delete the vector shoulders, and insert _part.shoulder as a component with Glyph > Add Component (Cmd-Shift-C).

Now, if you right-click on the component, and choose Show Smart Component Settings from its context menu, or, alternatively, select the component and choose Edit > Info for Selection (Cmd-Opt-I), you will be presented with a slider dialog. Use the sliders to interpolate the Smart Component in place:

sliders

In order to make use of the anchors, it makes sense to also turn the stem into a smart glyph with a connect anchor. And perhaps add an extra layer for different bends on the top serif, so you can achieve various degrees of incisions. In any event, this is what _part.stem could look like:

stem

Automatic alignment with anchors only works if all parts of the glyph are components. As soon as there is a regular path in the glyph, automatic alignment is cancelled, and anchors are ignored.

Now, for instance in the lowercase m, place _part.stem as the first component, and subsequently _part.shoulder twice. You will see that they connect nicely at the anchors. And again, you can adjust the parameters for the Smart Components:

smartM

SAMPLE FONT: VESPER, COURTESY OF ROB KELLER AND KIMYA GANDHI

Smart Components as CJK radicals

The original intention of Smart Components was a better way for designing CJK glyphs. In Chinese, Japanese and Korean, some characters get reused in other, more complex ideographs. These characters are therefore called radicals, because they form the root (latin ‘radix’) for other characters.

For that reason, not only glyphs that start with _part count as Smart Glyphs, but also all CJK radicals. Naturally, that is also where Smart Component setups tend to become more complex:

CJKradical

Custom Sidebar Entries in Font View

$
0
0

You can add your own categories or languages to the sidebar in Font View. Glyphs will look for a file called Groups.plist in ~/Library/Application Support/Glyphs/Info/. To navigate there quickly, choose Script > Open Scripts Folder (Cmd-Shift-Y), and look for a folder called Info next to Scripts. If it is not there, create it with the Finder command File > New Folder (Cmd-Shift-N).

And inside the Info folder, you create Groups.plist with a text editor, preferably one with syntax colouring for Apple Property list files (file suffix .plist). I can recommend TextWrangler, TextMate, BBEdit, or SublimeText.

Custom entries for categories and languages have the following format:

{
    categories = (
        {
            name = "Compatibility";
            icon = compatibilityTemplate;
            subGroup = (
                {
                    name = "Web";
                    coverage = (
                        .notdef,
                        hyphen,
                        space
                    );
                }
            );
            subGroup = (
                {
                    name = "Windows";
                    coverage = (
                        nbspace,
                        softhyphen
                    );
                }
            );
        },
    );
    languages = (
        {
            name = "Esperanto";
            icon = EsperantoTemplate;
            script = esperanto;
            subGroup = (
                {
                    name = "Letters";
                    coverage = (
                        Ccircumflex,
                        ccircumflex,
                        Gcircumflex,
                        gcircumflex,
                        Hcircumflex,
                        hcircumflex,
                        Jcircumflex,
                        jcircumflex,
                        Scircumflex,
                        scircumflex,
                        Ubreve,
                        ubreve
                    );
                }
            );
            subGroup = (
                {
                    name = "Marks";
                    coverage = (
                        circumflexcomb,
                        brevecomb
                    );
                }
            );
        },
    );
}

Copy and paste this sample Groups.plist content into your preferred text editor, adjust it to your liking, and save it as explained above. Then restart Glyphs, and the sidebar should look approximately like this:

esperanto

Things to Consider

When setting up your Categories and Languages, you have to stick to a few rules:

  • Put Category entries into categories=(...);.
  • Put Language entries into languages=(...);.
  • Each entry must have a name. You can leave out the straight quotes if the specified name has no spaces in it.
  • Each item in an entry must be terminated with a semicolon.
  • Each entry can either have a subGroup for nesting entries, or a comma-separated coverage list. They are mutually exclusive.
  • Top level entries can also have a script attribute. They will filter for the script tag if it is selected in the sidebar.
  • Entries can have an icon. The name specified must end in Template. You do not need to specify the file suffix. See below for details.

Adding Icons

Glyphs will look for an image file with the specified name in a subfolder called Icons next to the Groups.plist file.

The icons can be in any image format that is supported by Mac OS. We recommend using black and white PDFs, because they scale. Make sure it is no more than 16 pixels high (16 pt at 72 dpi), and more or less as wide as it is high, so it fits nicely next to the name in the sidebar.

If you desperately want to use a pixel image, you will need to have two files in order to also support Retina screens: One must have 16×16 pixels, the other one 32×32 pixels. The large image needs to have a @2x extension in the file name, right before the dot suffix, e.g., esperantoTemplate.png and esperantoTemplate@2x.png. Again, the image name should end with Template. Then, the image is used as a mask to only use the alpha value. All color information is overwritten for the purpose.

Making Small Caps

$
0
0

So, you've finished all your uppercase glyphs, and you’re still not exhausted? Here’s a first step on how you can generate small caps off your uppercase.

Duplicating and Renaming

Glyphs employs a special naming scheme for small caps: a lowercase name plus the suffix .sc. Alternatively, there are the suffixes .smcp for lowercase to small caps, and .c2sc for uppercase to small caps.

First of all, you need to duplicate all the letters you want small caps for. Generally, that would be all uppercase letters which do not consist of components. You can easily filter them by clicking on the gear icon in the bottom left corner in the Font view, and selecting Add Smart Filter. Then, select Count of Paths, is greater than and enter 0:

smallcaps-8

Now, select your filter and Letter > Uppercase at the same time by holding down Cmd while selecting. That will give you all uppercase letters without components.

smallcaps-9

If your design requires it, don’t forget about small caps variations for figures, punctuation and marks. In this example, we will stick with uppercase letters. Select all your chosen letters and go to Glyph > Duplicate Glyph (Cmd-D). Now, all the duplicated glyphs have the suffix .001:

smallcaps-1

Now, you need to rename them, because small caps have the suffix .sc. But, you don’t have to rename them one by one. Just select all your .001 glyphs and press Shift-Cmd-F, or go to Edit > Find > Find and Replace. Enter .001 in the Find box, .sc in the Replace box, and press Replace.

smallcaps-2

To easily toggle the names of your glyphs from uppercase to lowercase, simply use the Lowercase.py script in the Glyph Names folder of mekkablue’s scripts. It automatically changes the names of selected glyphs to lowercase.

Or, for the geeks amongst you, there’s a cooler, built-in way to do it. You can do both renaming steps (adding the suffix and lowercase) at once with this little trick:

smallcaps-4

Again, select your glyphs, go to Edit > Find > Find and Replace (Shift-Cmd-F) and enter (.*)\.001 in the Find field. The (.*) means any number of any characters, and \.001 means a literal dot, followed by ‘001’. Then, in the Replace field, enter \L\1.sc. \L turns anything that follows into lowercase, \1 stands for the first expression in parentheses, in our case (.*). And .sc is our preferred name suffix for small caps. This time, you also have to check Regex, which means Regular Expressions, which in turn are these funny dots, asterisks and parentheses that mean something. Super easy!

Scaling and Fine Tuning

Well, it’s not really small caps if it isn’t small. So, you need to 'scale' your glyphs, but keep the stem width intact at the same time. Again, you don’t have to do that all manually. If you have more than one master on the weight axis, you can use the RMX Scaler feature of Tim Ahrens’ Font Remix Tools. But they actually do much more than just scaling: The RMX Scaler tries to preserve your stem width, which is what we want for small caps. But RMX cannot guess your stem width, so you need to define a horizontal and vertical stem width for every master in Font Info > Masters (Cmd-I).

smallcaps-6

Then select your prospective small cap glyphs in Font or Edit view, run Filter > RMX Scaler, and enter values that make sense for your design:

smallcaps-3

Every column represents one master. When you place your cursor in a column, RMX Scaler will switch the Edit view to the respective master, so you always get a good preview of what you are doing. You’ll probably want your Width value to be higher than your Height value, and the height of your small caps a little above the x-height. You can also change the stems’ Weight by specifying a unit value by which your outlines will be expanded. That is, in case your small caps appear too thin, which sometimes happens in small caps, at the end of the spectrum. Usually, small caps also need a little more spacing. Enter a unit value in the Adjust Spacing field. The Vertical Shift field is for superscript glyphs, so you can ignore it here.

Remember that while RMX is a great help, and it will get you very far in one step, it wont give you finished small caps. You will still have to do some fine-tuning manually.

So, this is what we achieved so far:

smallcaps-13

Small Cap Height

You have an x-height and a cap height, so you should also have a small cap height. Go to Font Info > Masters, add a new Custom Parameter and select smallCapHeight in every master. For Value, enter the height respective of your small caps. This way, you won’t need to clutter your Edit view with dozens of guidelines. Finally, don’t forget about your overshoots: press the refresh button for Alignment Zones and adjust them as needed, or add it manually with the plus button.

smallcaps-5

Now, whenever you edit a .sc glyph, the small caps height is displayed instead of the x-height in your Edit view:

smallcaps-7

Diacritics

If you also want your small caps to have accents and whatnot, there’s an easier way than to generate them all manually. We will add small caps for all lowercase components! Here’s how: Again, add a Smart filter, but this time, select First Master has components and Yes.

smallcaps-10

Now, select your filter and Lowercase at the same time, just like we did before with the uppercase. You know, by holding down Cmd. Select all these letters, right click and select Copy Glyph Names > Space Separated. Now all glyph names of lowercase components are in your clipboard.

smallcaps-11

Open the text editor of your choice, like TextMate, TextWrangler, Sublime, or BBEdit and paste it there. Use the Find and Replace function to replace every space with .sc plus space.

smallcaps-12

This should turn aacute, abreve, acaron, … into aacute.sc, abreve.sc, acaron.sc, …. Copy your new list and switch back to Glyphs again. Go to Glyph > Add Glyphs (Shift-Cmd-G), paste the list and press Generate. Glyphs will then build your small cap glyphs and prefer .sc components wherever possible. Done!

You can also add glyphs manually by pressing the plus button in the bottom left of the Font View, and rename them. For example, name the small cap variant of the a with the dieresis adieresis.sc, and go to Glyph > Make Component Glyph (Opt-Shift-Cmd-C). Now the glyph will be put together with the components a.sc and dieresiscomb.sc. Glyphs prefers glyphs with the same suffix, wherever possible. So, if you don’t have a dieresiscomb.sc in your font, it will default to dieresiscomb instead.

Open Type Features

For adding a small caps feature, go to Font Info > Features and click Update, then Compile. You should now have two additional features called smcp and c2sc. The first one, smcp, turns your lowercase glyphs into small caps, and c2sc (short for ‘caps to small caps’) does the same with your uppercase letters.

And after all that hard work, you want to know if it actually works. Read more about testing your fonts in Adobe programs.

Reusing Shapes: Component Tricks

$
0
0

You already know that you can build serif components, smart components and corner components. Still craving more components? Here are some tips and tricks.

Build your Q

Basically, the Q is just an O with a tail in some designs. So, to make things easier, and if your design allows for it, you can use your O as a component for your Q. Open your Q in Edit view by either double-clicking it in Font view, or typeing it in Text mode. Go to Glyph > Add Component (Shift-Cmd-C) and select O. Then, draw a nice tail. This is ours:

tricks1

But, you shouldn’t mix components with paths, because if you do, automatic alignment will be turned off. That means, when you shift your O, the tail and the O will get out of sync. So, we also make the tail a component. To do so, just press Cmd-A once to select all paths, right click to bring up the context menu, and select Component from Selection. The name of the new glyph is arbitrary, just make sure it makes sense to you and that there is an underscore first. That way, the glyph will be set to non-exporting straight away. We’ll call ours _tail.Q.

tricks2

To stick the tail to a certain place of the O, just add an anchor in your O. You can do that by opening the context menu and selecting Add Anchor. The name will be automatically selected for you to rename.

tricks14

Name it something striking, like qtail. Select it and drag it to where you want your tail. Then, in your _tail.Q, add an anchor and name it the same as in your O, but with an underscore in front of it. The underscore tells the anchor that it is linked to the qtail anchor.

tricks3

Ta-daah! There’s your all-component Q:

tricks7

Build your y

Just like the Q, you can also construct the y with a tail and your v, if it makes sense for your design or workflow. In my experience, designs that are modular, geometric, light, high-contrast, or aimed at low-resolution screens can be candidates for such an approach. Sure enough, you will have to have your eye judge if it really works or not. But also in other designs, this construction can be useful at an early design stage, where you eventually will decompose and apply optical adjustments. But until that point is reached, making use of components and automatic alignment helps maintain consistency when you are still changing a lot.

Open your v in Edit view by double-clicking it in Font view or type it in Text mode. Again, go to Glyph > Add Component (Shift-Cmd-C) and select v. Draw a nice tail to go with your v. To make sure that the tail matches the v, here’s a little trick: select two nodes on your v-stem. Now, right-click to open the context menu and select Add Guideline.

tricks8

Now, a blue guideline should appear over the two selected points:

tricks9

Select the guideline and copy it by pressing Cmd-C. Then, open your _tail.y and paste the guideline by pressing Cmd-V. That way, you can easily match the tail angle with the stem. Make sure anchors and points are on the same coordinate to avoid shifts in the unit grid.

The tail should stick to the v, so we’ll add an anchors to the v. This time, we’ll call it ytail, but again the name is arbitrary. You can copy the anchor by pressing Cmd-C. Open your _tail.y and paste the anchor with Cmd-V, then double-click it to rename it. Again, this one should have the same name as your v anchor, but with an underscore at the beginning.

tricks6

This way the anchors are on the same height, which is important, because the both components share the same y coordinate. By having them on the same height we avoid the risk of vertical shifts in the compound y.

Just like with the Q, we make the tail a component. Press Cmd-A to select all paths, right click and select Component from Selection. Again, the name of the new glyph can be arbitrary, it just needs to have an underscore at the beginning so that it won’t export. Ours will be called _tail.y.

tricks5

That’s it. Yay!

tricks10

Other Glyphs

Depending on your design, you can also build other glyphs out of components. For example Eng out of N and a descender part, ae out of an a part and e, oe out of an o part and e, w out of a w part and v, and if you have a sans-serif font you can also build eng out of n and a descender part or thorn out of p and a stem part.

tricks11

But wait a minute… take a closer look at ae, oe and w in the screenshot. They are a little different from the above examples.

Ligature Compounds

In fact, they are ligatures of multiple shapes. So, in order to make the most of automatic alignment, we could build special ligature letters, adjust the sidebearings where necessary, and simply build a ligature by adding them as components. That way we do not even need anchors.

E.g., you can build ae out of a special a.ae and an e. Into the a.ae, you copy the paths of the a, remove the spur, and perhaps adjust the stem width a little. The a.ae needs an =a as metric key for the LSB, and a negative RSB, just as much that it would form a nice ligature with e. Open your ae, and add a.ae, then e as components. They should align automatically.

tricks12

And because the a.ae should not export, go into the glyph, right-click to open the context menu, and select Export to remove the checkmark.

tricks13

The glyph name a.ae is the name of a letter plus a suffix. This name structure allows automatic alignment in the ligature compound, but requires this last step of turning off export. Since version 2.3, you can also do it the other way around: create _a.ae, which will be created as non-exporting because of the preceding underscore, and then, inside ae, you can force alignment by right-clicking on it and choosing Enable Automatic Alignment from the context menu.

Sample Font: Sephora Serif by Mucca/Schriftlabor
Update 2016-01-18: added some explanatory lines, thanks to Benedikt Bramböck and many others for their valued input.


Reusing Shapes: Corner Components

$
0
0

So, you read all about serif components and their benefits. And they are great for slab serifs. But what if you do not want to mix components and paths, because you do not want to risk accidental shifts? And, what if you want bracketed serifs with a smooth transition, rather than clunky slabs?

cornercomponents-1

There’s a simple solution for that problem: corner components. They are connected to individual nodes in your glyph, like this:

cornercomponents-2

Cool, looks like magic. Here’s how we do that:

Building the Corner Components

All we need is two new glyphs with special naming: A corner component must start with _corner and have an arbitrary dot suffix. The underscore at the beginning of the name ensures that the glyph will be created as non-exporting. Add two new glyphs, and call them, for example, _corner.leftSerif for the left serif, and _corner.rightSerif for the right serif. The best way to do this is Glyph > Add Glyphs (Cmd-Shift-G), typing _corner.leftSerif _corner.rightSerif, and pressing the Generate button.

But let’s begin with drawing a serif. Our left serif could look like this:

cornercomponents-3

As you can see, the serif is located largely outside the glyph’s width, and the part where the serif should stick to the stem is on the left sidebearing. The same goes for the right side:

cornercomponents-4

There are two things you need to pay attention to: Firstly, the path direction needs to be counter-clockwise. The arrows at both ends of the path indicate the path’s direction. If you want to flip the path’s direction, you can do so with Paths > Reverse Contours (Crtl-Opt-Cmd-R), or via Reverse Selected Contours in the context menu of a path.

Secondly, the vertical end point should be on the left sidebearing, and the horizontal end point on the baseline.

Pro tip: If you add an anchor named origin, then the path doesn’t have to be on the left side-bearing. But keep in mind that the path should wind around the origin anchor exactly as it would around the origin point.

Adding the Corners

Now, how do we get our serifs to stick to our glyphs? Easy. Go to your glyph and select a corner node, then right-click on it to open the drop-down menu, and select Add Corner.

cornercomponents-5

In the dialog that follows, select the serif, and voilà, your serif gets injected into the path! You can also copy and paste multiple corners, if you have a lot of serifs.

cornercomponents-11

Corner Components on Diagonal Stems

Corner on diagonal stems are adjusted automatically, by slanting the outermost segment of the corner component into the angle of the stem. Glyphs needs to do some guessing, and can’t always guess right, so sometimes you will need to adjust the alignment of the corner component. You can do that in the grey info box:

cornercomponents-10

Use the left alignment for left serifs, and the right alignment for right serifs. The center alignment can be useful for ink traps. Spoiler alert: you can't only use corner components for serifs, but anything you can hang on a corner. Like, spikes, or something.

You can add anchors named left for the left serif, and right for the right serif. The left/right anchors control the way the corner component is inserted. The further away from the origin point, the bigger the adjustment:

cornercomponents-8

For bracketed serifs, the anchor usually has to be a bit above the visual thickness of the serif.

cornercomponents-9

In case of slab serifs, the left/right anchor has to be in the corner of the serif:

cornercomponents-7

Adjustments

If you click on your corner component node, you will see a second grey box, next to the grey glyph info box beneath your glyph. If you can’t see the nodes, go to View > Show Hints. That is because technically, corner components are hints. There you can change a few things regarding the serif. In our example, we changed the width of one serif, by changing the percentage here:

cornercomponents-6

Mirroring Serifs

Since version 2.2, you can mirror your serifs horizontally and/or vertically. That way, if your serifs are symmetrical, you only have to draw one serif, and mirror it, where necessary. All paths will be reversed, and anchors adapted accordingly, i.e., left anchors will be treated as right anchors and vice versa. You can do that by putting -100% for the width or height in the grey info box of the serif:

cornercomponents-12

More Tricks with Corner Components

You can actually do much more fun things with your corner components. All you need to do is play around a bit with those left and right anchors. For example, you can create funny inktraps easily. Or, you can experiment with shapes:

cornercomponents-15

You can even add corners to round shapes, all you need to do is double click the node you want to add your corner to (it should be blue). Have fun!

Complex Corner Components

Also, since version 2.2, you can add any number of closed paths in a _corner glyph to compliment the open corner path. Their path direction is preserved, of course. So, now you can make even more cool things with your serifs, like the (long overdue return of the) page curl:

cornercomponents-13

Well, pretty easy. So, have fun with your serifs!

Why There is no Windows Version of Glyphs

$
0
0

Every once in a while, we receive a request for a Windows version of Glyphs. While we do not generally say no to going cross-platform, such a venture currently appears economically unfeasible. Even if every request would translate into a sold license (which is a very optimistic assumption), the sales would not cover the additional costs for development and support. And we are sad to say, not by long shot.

To make matters worse, most of these few requests are not for the full version of Glyphs, but for Glyphs Mini. So, we would have to invest a six-figure number for an expected revenue of a few hundred dollars per year. We cannot do that. However, if you believe the Windows market deserves that investment, and you are that investor willing to take such a risk, please do get in touch. However, be advised that you will probably lose a lot of money this way.

Type Design is a Mac Business

For now, all we can say is that type design seems to be happening almost exclusively on the Mac platform. We see that at every conference we visit, at every school at which we give workshops, and in the many personal conversations we have with fellow type designers. In other words, it would be cheaper for us to hand out Macs to all the people asking for a Windows version than to actually produce and manage a Windows version. But we do not do that either, obviously.

Until that changes, we have to decline those requests. Sorry.

How to Make a Monoline Font

$
0
0

Monoline fonts are fonts that share the same stem thickness vertically and horizontally. It is great for handwritten fonts, or display fonts like this one:

monoline18

Drawing Paths

The first step to create a font is, of course, to draw paths. Duh. But monoline fonts need open paths. The ends of open paths are displayed as flat nodes instead of round ones, and there is an arrow, showing you the path direction:

monoline1

Looks good! But those paths are only the ‘skeleton’ of a monoline font. Open paths can’t be exported. So, now we need to put some flesh on its bones. There’s a few ways to do that. Read on.

Offset Curve Filter

The first way is the Filter Offset Curve. Just go to Filter > Offset Curve to invoke it.

monoline3

Enter the values of your choice and check the Make Stroke option. You should then see an expanded preview of your glyph. The Position setting controls the distribution of the expansion. At 0%, the path will only expand to the right. At 100%, the path will only expand to the left. At 50%, the expansion will be evenly distributed to both sides of the path, which is probably what you want. Right and left sides are determined by the path orientation.

monoline13

With the Auto Stroke option, the vertical dimensions will be kept intact. In that case, the offset position will be assumed at 50%.

But don’t press the Offset button yet. Instead, click on the gear wheel. Choose Copy Custom Parameter. Because if you do that, this will put the values into our clipboard as a custom parameter, and thus, we will be able to work non-destructively.

monoline4

Now, press Cancel in the Offset Curve window, then go to File > Font Info (Cmd-I), and choose the Instances tab. Click the plus button in the bottom left corner of the window to add a new instance, and name it something striking. I call mine ‘Offset 20’ because I feel totally creative today. Now click in the white area of the Custom Parameters field to set the focus, and press Cmd-V to paste the previously copied custom parameter.

monoline5

Now, when you export your font, the custom parameter will set in and you’ll see your offset active. To export the font, go to File > Export (Cmd-E) and choose a file format. Leave Remove Overlap unchecked, though. Because this option would delete our precious open paths. We suggest to test your font in Adobe programs.

For a preview of what your exported font will look like, you can activate View > Show Offset Preview. Glyphs will show a grey preview in Edit view, provided the filter was used once before. If it was, Glyphs saves the value in its preferences and the preview reads its values from there. Tip: Just apply Offset Curve once and undo it straight afterwards with Cmd-Z.

monoline6

Round Corners

Sometimes, corners and endings can look weird. In this example, the corner looks really ugly and the ending is pretty weird, too. Yuck!

monoline14

If you want your font to have rounded corners, there’s an easy way to get there. Go to Filter > Round Corners and choose your radius. By checking Visual Corrections, Glyphs adjusts the radius of your corner roundings, so they appear the same size.

monoline10

Again, copy the custom parameter code by clicking on the gear wheel and choosing Copy Custom Parameter. Go to File > Font Info (Cmd-I) and press Cmd-V to paste the custom parameter after the Offset Curve parameter. Now, export again, and choose the file format.

Noodler Filter

To get the results of Offset Curve and Round Corners in one step. Just download mekkablue’s Noodler filter. To install it, double click on the glyphsFilter file and confirm the installation dialog. It should be available after restarting Glyphs. You can find it at Filter > Noodler.

monoline8

Change the value of Thicknesses according to your design. Like before, you can work non-destructively, don’t apply it directly, but click on the gear wheel and choose Copy Custom Parameter. Go to Font Info > Instances > Custom Parameters (Cmd-I) and, like before, paste the code with Cmd-V. Alternatively, you can add a new Instance and paste it there. This way, you’ll have two separate versions of your font for comparison.

But there is a difference between Noodler on the one hand, and Offset Curve plus Round Corners, on the other hand. The Noodler filter adds a round ending to the path, while Round Corners rounds the end of the path:

monoline9

Problems

Problems can occur if you have a path with double bends, i.e. a segment that first bends clockwise, and then counter-clockwise, and vice versa. In this case, you should add a node on the inflection point of the segment to keep your thickness. To do that, hold Shift while clicking on the path. Glyphs will find the nearest extremum or inflection point, and insert a node there. Here is an example of how a double bended path looks like with and without an inflection point when Offset Curve is active:

monoline16

Or you can use mekkablue’s Insert Inflections filter.

There could also be problems when your curves are too narrow.

monoline17

To prevent that, well, you should draw wider curves. Sometimes extremum points and infliction nodes can help, too.

If you have acute corners and Round Corner gives you weird results, you can split the path in two. To do so, select the Pen Tool (P) and click onto the node you want to divide.

monoline19

BroadNibber Filter

If you want to turn your glyphs into broad-nib strokes, you can use mekkablue’s BroadNibber filter. Again, you install it by double clicking the glyphsFilter file, confirming the dialog that pops up and restarting Glyphs. After the restart you will have the menu item Filter > Broad Nibber.

monoline11

The filter simulates a broad-nibbed pen. Experiment with the values in the dialog, then click the gear wheel, choose Copy Custom Parameter from the context menu and paste the code in the Custom Parameters field of an instance in Font Info > Instances (Cmd-I).

Roughen

This one is a rather funny filter. Go to Filter > Roughen.

monoline7

Your path gets chopped up into little straight path segments and the nodes are randomly scattered. If you have your Offset Curve preview on, you’ll see the end result straight away. Again, copy the custom parameter code by clicking on the gear wheel and choosing Copy Custom Parameter. Go to your Font Info (Cmd-I) and paste the code with Cmd-V, or add a new Instance and paste it there.

Combining the Filters

If you want to combine multiple filters, you need to watch out. The order of the custom parameters is really important.

monoline15

For The Geeks

If you’re into monoline fonts a lot, you should check out mekkablue’s plugin ‘ShowOffsetCurveParameterPreview’. It calculates the GlyphsFilterOffsetCurve parameters in active instances for the given glyph and draws those instances behind your paths. It quietly adds extremum and inflection nodes to your preview outlines. But it does not give you a full preview of the final instance, because it does not show the effect of any other parameters. This plugin is focused on helping you spot path offset problems. By default, it draws all active instances on top of each other using a semitransparent color, changing its hue from instance to instance:

monoline12

All instances are shown live. Again, to install it, double click the glyphsFilter file, confirm the intallation dialog, and restart Glyphs. After installation, it will add the menu item View > Show OffsetCurve Parameter Preview.

Another one for the geeks: You can add multiple values in mekkablue’s Noodler filter. Check it out:

monoline20

Have fun experimenting!

SAMPLE FONT: Bussi by Stella Chupik (first example)

How to Install Your Glyphs License

$
0
0

You finally got your download link for your Glyphs license via mail and now you don’t know what to do with it? Well, first you need to be quick, because the download link in your email is only active for two weeks. Before you can install your Glyphs license, you need to meet those conditions:

  1. You are running the minimum OS version that the app requires
  2. You have the latest Glyphs 2 version
  3. The app is called Glyphs.app and in the Applications folder
  4. You opened the app at least once

If you checked all these things, you should be able to simply double click the license file. Be sure that the file has the suffix .glyphs2License, otherwise it won’t work.

license2

After double clicking the file, a dialog should appear:

license1

Now click OK and that’s basically it. Yay!

Troubleshooting

Glyphs won’t open?

Maybe Glyphs won’t even open in the first place, and you get this security dialog:

license4

If that is the case, open your System Preferences and choose Security & Privacy. In the tab General you should see options to change which programs will be allowed to be opened.

license5 license6

Check the one saying Mac App Store and identified developers. Now you should be able to open Glyphs.
If double clicking the file doesn’t open Glyphs, try right clicking the license file and selecting Open with, then choose Glyphs.

license3

File Permissions

Still doesn’t work? Maybe there’s something wrong with your file permissions. Go to ~/Library/Preferences and find a folder called ByHost. Right click on the folder and choose Get Info from the context menu. Alternatively, you can press Cmd-I. In the info window that appears, you will find a Sharing and Permission options. Check if your user has the permissions to Read and Write.

license8

Back to the ByHost folder. You should find one or more files starting with com.GeorgSeifert.Glyphs....

license7

Delete all those files, then try again.

Install Glyphs for All Users

$
0
0

Deploying Glyphs in a Mac lab? Read this.

Download the latest stable version

There is a download link that always point to the latest stable version of the app. You can curl it right into the App folder:

curl https://updates.glyphsapp.com/latest2.php > ~/Desktop/Glyphs.app.zip
unzip -o /Desktop/Glyphs.app.zip -d /Applications
rm ~/Desktop/Glyphs.app.zip

Unlocking Glyphs for all users

When you open the .glyphs2license file on a Mac, Glyphs will be registered in the current user. But what if every (future) user is supposed to access a registered Glyphs?

Here’s the trick. If you sudo the install process, the registration will be stored in the Mac-wide Library rather than in the user’s Library. So what you do, is place your .glyphs2license file on your Desktop, and run this command in Terminal:

sudo /Applications/Glyphs.app/Contents/MacOS/Glyphs -disableUI 1 "~/Desktop/file.glyphs2license"

Needless to say, replace file.glyphs2license with the name of your license file (the one you probably received via e-mail). This assumes that you have put your copy of Glyphs in the /Applications folder and that you did not rename the app after download. Ans you probably guessed that the disableUI 1 option runs Glyphs in a headless mode, without starting the user interface.

Oh, and if you are deploying in a school lab, please do not leave the license file on the machine. Be so kind:

rm ~/Desktop/*.glyphs2license

Thank you.

Scripts and plugins for all users

Actually, you can do the same for scripts and plug-ins. Just move scripts folder and your plug-ins folder into the system-wide Application Support folder of Glyphs. Just run these lines in Terminal to create the necessary folders:

sudo mkdir "/Library/Application Support/Glyphs/"
sudo mkdir "/Library/Application Support/Glyphs/Scripts/"
sudo mkdir "/Library/Application Support/Glyphs/Plugins/"

Now, you can easily clone your favourite GitHub script repositories, and make them available for all users on your Mac:

sudo git clone https://github.com/DeutschMark/Glyphsapp-Scripts.git "/Library/Application Support/Glyphs/Scripts/DeutschMark/"
sudo git clone https://github.com/huertatipografica/huertatipografica-scripts.git "/Library/Application Support/Glyphs/Scripts/huertatipografica/"
sudo git clone https://github.com/mekkablue/Glyphs-Scripts.git "/Library/Application Support/Glyphs/Scripts/mekkablue/"
sudo git clone https://github.com/schriftgestalt/Glyphs-Scripts.git "/Library/Application Support/Glyphs/Scripts/schriftgestalt/"
sudo git clone https://github.com/Tosche/Glyphs-Scripts.git "/Library/Application Support/Glyphs/Scripts/Tosche/"
sudo git clone https://github.com/weiweihuanghuang/wei-glyphs-scripts.git "/Library/Application Support/Glyphs/Scripts/weiweihuanghuang/"

If you do install these scripts, it is a good idea to also install a library called Vanilla. It is a popular wrapper for accessing Cocoa user interface classes in Python scripts:

cd ~/Desktop/
curl http://download.robofab.com/RoboFab_599_plusAllDependencies.zip > robofab.zip
unzip -o robofab.zip -d Python_Installs
rm robofab.zip
cd Python_Installs/Vanilla/
sudo python2.7 setup.py install
sudo rm -R ~/Desktop/Python_Installs/

Pretty epic.

Write access for the Adobe Fonts folder

While you're at it, you should change the read and write permissions for the Adobe fonts folder. Just copy and paste this line into your Terminal:

sudo chmod o+rw /Library/Application\ Support/Adobe/Fonts/

Then all users can test their fonts in Adobe apps, cool!

Creating a Pixel Font

$
0
0

Creating a pixel font is easy if you know how it’s done. You probably have seen the video-tutorial about pixel fonts we made some time ago. But there’s more to it.

Start a New Font

First, open Glyphs (duh!) and select File > New (Cmd-N), to create a new font document. Now, before you start building your letters, go to File > Font Info (Cmd-) and name your font something striking, we’ll call ours ‘Pixelfont’, because we’re so creative. Then, select Other Settings, where you’ll find the options for Grid Spacing. The Grid Spacing value defines how coordinates get rounded. The default value is 1. For pixel fonts, we want all tools and all modifications to always snap to the grid, so we set higher values. This ensures that ‘pixels’ in your font are automatically on the correct position. Let’s set our Grid Spacing to 50:

pixel1

Why a grid step of 50? In a nutshell, we choose 50 because it divides 1000 comfortably, and it gives a pixel perfect rendering at certain sizes.

Calculating screen sizes: Screen size is measured in PPM, pixels per em. If one em contains 1000 units, which is the default UPM (units per em) value in PostScript-based fonts, then (1000÷50=) 20 grid steps, or pixels, fit into one em. In other words, one font pixel will be exactly one screen pixel at 20 PPM. For a screen resolution of 72 ppi (pixels per inch), (20 PPM ÷ 72 ppi × 72 points in an inch =) 20 points. This is the default resolution assumed for Macs and Adobe apps. On Windows, we calculate with 96 ppi, so we reach 20 PPM at (20÷96×72=) 15 points.

Drawing a Pixel

In Font View, click on the plus button on the bottom left to add a new glyph. Double click on the name (newGlyph) and rename it to pixel:

pixel2

Double click the glyph area to open the glyph in a new Edit tab. You’ll see a grid according to your grid settings. Select the Rectangle tool (F) from the tool bar and draw a rectangle exactly as wide and high as one grid square is. You will notice that the path automatically snaps to the grid. Draw the square at the origin point, i.e., where the baseline crosses the left sidebearing.

pixel3

Right-click anywhere on the canvas to open the context menu. Un-check the Export option. We don’t want to export our pixel, because it can’t be typed anyway and it would just waste bandwidth in our final font.

pixel6

That’s basically all the paths you need for a pixel font. Yay!

Building the Glyphs

To start with your alphabet, open a glyph you like very much by double clicking on it in Font view. I’ll start with the f, because I like fluffy bunnies. Go to Glyph > Add Component (Shift-Cmd-C), select pixel from the dialog menu, and press Select.

pixel4

Select the pixel component and press Cmd-C to copy it. Now, press Cmd-V to paste it and move it with your arrow keys or your mouse. Repeat this step until you are satisfied with your Glyph. Alternatively, you can also drag the component while pressing the Option key to duplicate it. And you can do all this with multiple pixel components at once, so you’ll be even quicker. You can also drag your mouse to select multiple components, but don’t forget to press the Option key while doing so, because a regular rectangular selection only selects paths.

Well, this is our f:

pixel5

Now, have fun building your glyphs!

Batch-Edit

The default glyph width is 600 units. That does not look so nice:

pixel17

To start with the spacing, you can make sure all your glyphs have the same left and right sidebearings. First select all glyphs (Cmd-A). Then, in Font view, enter the values in the bottom left window. The values for your left and right sidebearing should be multiples of your grid spacing, in our case, we simply set them to 50.

pixel11

Now, it is easy to make indiviual changes. If you want to know more about spacing, read our tutorial on Spacing.

pixel18

Looks much better now, don't you think?

Pixel Variants

Of course, you can play around a little with your pixel. For instance, you don’t have to make a square:

pixel7

To do that, you can either change the shape of your pixel or add a new glyph called pixel.circle, for example. You’ll notice that, when drawing a circle, it will be build to something like this:

pixel8

This is because the Subdivision subdivides the grid step, so snapping happens on the grid subdivisions, not directly on the grid. If you set this value to 25, for example, your circles will look like this:

pixel9

Starting with version 2.3, offcurve points will not be rounded to the grid anymore. So, in this case, a subdivision value of 2 would suffice.

Set the Subdivision value to something that makes sense for your pixel design. For full flexibility, set it to the same value as your Grid Spacing.

So, you have two (or more) pixel variants, but how to use them? Go to your Font Info (Cmd-I) and select the Instances tab. Add two new instances by clicking the plus button twice. The instances will be called Regular by default, but you can rename them in the Style Name field. We named ours square and circle, because we want to have one instance with square pixels and one with circle-shaped pixels. Make sure you have two pixel-glyphs in your font, e.g. pixel and pixel.circle. Now, add a custom parameter in the instance you want to have an alternative pixel, by clicking the plus button next to Custom Parameter. In the Property field, write Rename Glyphs, or choose it from the dropdown menu after clicking the arrows. If you double click the Value field, a dialog will open. Write the glyph you want to replace, in our case we want the pixel.circle glyph to replace the pixel glyph, so we type:

pixel.circle=pixel
pixel26

When creating multiple instances with different pixel shapes, you can use them as a layer font. In this example we superimposed a square pixel instance, a circle pixel instance and a triangle pixel instance:

pixel27

Hinting

If you have more complex pixels, you have to make sure that hinting is turned off. So, when you export your file (Cmd-E), uncheck the Autohint option. Why? Read all about what hinting can do, and what not, in our tutorial about PostScript Autohinting.

pixel10

Post-Processing with Filters

If you want to experiment a little with your font, you can try some of the built-in filters. Again, check your Subdivision value, or some filters might give you an unsatisfying result. For example, if you apply the filter Round Corners to your pixel square, you’ll get this:

pixel12

You can either apply the filter directly with OK, or, what I recommend, add it as a custom parameter. To do the latter, do not press OK in the filter dialog, but instead click on the gear wheel in the left bottom corner and select Copy Custom Parameter. Then, press Cancel, and open the Font Info (Cmd-I), go to the Instances tab, click on the plus button in the left bottom corner, and add a new instance. Change the style name (I call mine Rounded) and click anywhere inside the Custom Parameter field to activate it for pasting. Now, simply press Cmd-V to paste the parameter we just copied in the filter dialog. Ta-dah!

It’s a good idea to set the grid spacing with a custom parameter, too. Click the plus button to add a new parameter. For Property, simply write Grid Spacing after double clicking the Property field, or choose it from the dropdown menu after clicking on the arrows. Next, double click the Value field and write 1 for a grid spacing of 1.

pixel13 pixel21

With custom parameters, you can apply filters on different instances at export time, and thus don’t have to destroy the original pixel path. In other words, you can non-destructively build a pixel complete font family!

In this example, we used the filter Roughen. The pixel outline gets chopped up and the nodes are randomly scattered:

pixel20

Again, copy the custom parameter code by clicking on the gear wheel and choosing Copy Custom Parameter. Go to your Font Info (Cmd-I) and paste the code with Cmd-V, or add a new Instance and paste it there.

Here we used the filter Offset Curve without the Make Stroke option:

pixel22

Click on the gear wheel and copy the custom parameter code. Go to the Font Info (Cmd-I) and paste the code with Cmd-V, or add a new Instance and paste it there.

Of course, you can apply multiple filters on one instance. In our example, we applied the filters Round Corner, Offset Curve and Remove Overlap:

pixel14

Look closely: The order of the filters is very important. Glyphs will execute them from first to last. In our case, we first apply Offset Curve to expand the outline by 3 units, so the pixels overlap a little bit. Then we apply Remove Overlap in order to, you may have guessed it, remove the overlap and unite the pixels into one path. Then again, Offset Curve with -3 units brings the outline back to its original dimension. After that, we apply Round Corners to make our font smooth. The positive value (+20) in the first Round Corner parameter takes care of the outer corners, and the negative value (-20) in the second Round Corner parameter rounds the inner corners. Although, the negative value can only be added as a custom parameter manually. If you copy the custom parameter via the filter dialog, you'll only get the positive value.

pixel15

But, why all the fuss? Easy. If we hadn’t used multiple filters and had just used Round Corners straight away, we would have received a very different result:

pixel16

In the next example, we use Offset Curve to expand the outline by 3 units again, apply Remove Overlap to unite the pixels and apply Offset Curve with -3 units to move the outline back to where it was, just like in the previous example. But this time, we use also the Roughen filter:

pixel23

In the following example, we wanted our pixel font to have a contour only. To achieve that, we use Offset Curve +3 units again, apply Remove Overlap and apply Offset Curve with -3 units, just like in the previous examples. Then we add one more Offset Curve filter, but this time with the Make Stroke option activated.

pixel28

So, have fun with playing around, but keep the order of the filters in mind!

Third-Party Filters

Want to try more filters than the default ones in Glyphs?
Mekkablue’s Shadow filter is designed to turn your glyphs into shadowed versions of themselves. Take a look:

pixel19 pixel29

Another fun filter is mekkablue’s filter Cut and Shake. It exercises cuts across the glyphs, and then both moves and rotates the resulting parts by random amounts, for which the user can specify maximums. In our case, we again used Offset Curve to expand the outline by 3 units, applied Remove Overlap and applied Offset Curve with -3 units to move the outline, before using the Cut and Shake filter:

pixel24 pixel25

Scripts for Pixel Fonts

There are a few handy scripts for Glyphs that help you with your pixel fonts. In mekkablue’s GitHub repository you'll find a folder dedicated to pixelfonts. For more info and installation instructions take a look at the readme.

Mekkablue’s script Pixelate, for example, turns outline glyphs into pixel glyphs by inserting pixel components, resetting widths and moving outlines to the background.

Writing Plug-ins

$
0
0

Plug-ins provide additional features to software applications, usually provided by third parties. This tutorial provides you with an overview of how to go about plug-in development. You will find detailed descriptions in the Readme.md files on our GlyphsSDK repository.

Don’t be shy, grab a cup of great coffee, and relax: Others have done it before you.

1. Get Your Plug-in Template

We’re providing plug-in skeletons for various purposes (such as for file export, custom outline filters etc.) on our GitHub page. If you’re already familiar with Git, you may check out the folder structure in your favourite versioning app (Git’s own, or one of the many other apps available). Although being a Subversion client, Versions.app is the recommendation of this tutorial’s author).

If you’re too unfamiliar with the concept of code-versioning, even if it is just as a subscriber to someone else’s code, you can also simply download a ZIP file containing the entire Glyphs SDK (Software Development Kit) from the Glyphs SDK main page.

Pro tip: Get yourself comfortable with code versioning systems. You’ll benefit from them later in various fields of your work.

So, our SDK page is here: https://github.com/schriftgestalt/GlyphsSDK, and the plug-in templates are in a sub-folder called Python Templates. There you will find plug-in skeletons that are waiting to be brought to life by you. Each of these plug-in templates contains fully functional sample code for better understanding.

  • File format: Exporting your own font formats
  • Filter without dialog: Change the font through a Filter menu or upon export
  • Filter with dialog: Same as above, with the use of a user interface dialog
  • General plug-in: No special purpose. We’ll see what happens
  • Palette: Add a palette view to the side bar
  • Reporter: Draw into the Edit View and Preview to illustrate features of your glyphs
  • Select Tool: Enhance the Select Tool with your own features

For Glyphs.app, plug-ins come in the form of the Mac’s so-called packages, and they need to be put into Glyphs’ Plugins folder located at ~/Library/Application Support/Glyphs/Plugins (~ stands for your user account’s home folder). Glyphs will put it there automatically if you open it by either dragging it on the app icon or double-clicking it. These packages look and behave like single files in the Finder, but they’re in fact folders, whose content you can access by right-clicking on such a package in the Finder and choosing Show package content.

This is how such a plug-in’s folder structure would look like. Your main code goes into the Contents/Resources/plugins.py file. Other noteworthy files are the Info.plist which holds various information about the plug-in and, in plugins with a dialog, the two .nib/.xib files that contain a user interface dialog view.

folderstructure

Many contemporary text editors will also open a whole folder at once, providing you with a tree view of files to edit in a side panel. So you can open the whole .glyphsFilter file package in your text editor at once:

textmate

Currently, the most popular text editors for this purpose are TextMate, SublimeText, and Atom.

2. Rename some ____Names____

The Python Templates page in our GitHub repository contains detailed information about how to set up the file structure in the plug-in. You will have to rename everything that contains quadruple underscores (such as ____PluginClassName____) in up to three of the files.

For the plug-in name, we are dealing with two different name variations:

  • ____PluginName____ is a human readable name that will show up in places such as the Plugins tab of Glyphs’ Preferences window. This name may contain spaces and Unicode characters.
  • ____PluginClassName____ is the machine-readable name of the Python class in your code and needs to be put into a few places. It needs to be unique. You can’t install two plug-ins next to each other that have the same class name. Although I wrote ‘machine-readable’, there is one interaction where the user of the plug-in will get to see this class name: calling filters through Custom Parameters upon file export. So make it a friendly and unique name. Only ASCII characters and no spaces allowed here. We recommend camelCaseNames.

A section in the Info.plist tells Glyphs where it finds updates to your plug-in, so it can notify users when their plug-in becomes outdated. For that to work, you need to put in a URL to an online Info.plist that contains the current version number. This could be a manually edited file, or it could be an automatically generated file, such as from an online shop, or it can be the very same Info.plist inside the downloadable plug-in.

In case you are using GitHub for distributing, the deep link to your Info.plist will be: https://raw.githubusercontent.com/*user*/*plugin*/master/*filename*/Contents/Info.plist. Replace *user* with your GitHub username, *plugin* with the name of the GitHub repository, and *filename* with the name of your plugin including its suffix, e.g., MyPlugin.glyphsFilter.

Now is a good time to read the details on the Python Templates page.

3. Dialogs with Interface Builder

Some plug-in types can open a dialog inside Glyphs.app:

filterwithdialog

Like all of the Glyphs application, we use Apple’s own Cocoa for creating dialogs, specifically the Interface Builder. For this, you need to install Apple’s Xcode, available free of charge in the AppStore. If you don’t have it yet, now would be a good time to find a high-speed internet connection, and start the download. It clocks in at a hefty four gigabytes.

In case you want to use Tal Leming’s Vanilla library instead, you will find useful information in the Readme files of all plug-ins with dialogs.

Your Python code and the Cocoa user interface communicate with each other using IBOutlets (your code talks to the user interface) and IBActions (the user interface talks to your code).

They get defined in the Python code as follows. IBOutlets are defined as class variables like this:

class CSVFileExport (FileFormatPlugin):
    textField = objc.IBOutlet() # A text field in the user interface

And IBActions are class methods, prefixed with @objc.IBAction:

    @objc.IBAction
    def buttonClicked_(self, sender):
        # do stuff when the button has been clicked

And this is what it is going to look like when you create a dialog in Xcode’s Interface Builder:

interfacebuilder

All necessary details are described on the Python Templates page. Go through the step-by-step guides, and you can cross the bridge when you get there.

4. Step-by-step guides

How to deal with each plug-in is described in detail on the respective plug-in’s Github page:

5. Plug-in Manager

Once you’re done, you can make your plug-in available for easy installation via Window > Plugin Manager in app versions 2.3 and later. To do that, simply make a pull request for the packages.plist file in the glyphs-packages repository. All you need to add in that file are these few lines:

{
    name = "PluginNameWithExtension.glyphsPlugin";
    url = "https://github.com/userName/repositoryName";
    description = "Single-line description. Careful: WITHOUT LINEBREAKS! Use \n instead.";
}

Entries must be separated by commas. So don’t forget a comma right after the closing curly brace } if another entry is following. (And on the previous line if you add your entry at the end.) The order of entries does not matter, the manager will sort all registered plug-ins alphabetically.

There are a few more options available for your entry, like specifying a screenshot, or a minimum or maximum version. Make sure you read the glyphs-packages readme for all details.

Congratulations

And that’s it! This should do to get you started with your Glyphs plug-in. If you get stuck somewhere, please feel free to ask questions on our Forum.

Written by Jan Gerner (Yanone), edited by Rainer Erich Scheichelbauer.


Adding Glyphs to Your Font

$
0
0

There are quite a few ways of adding new glyphs to your font. Let’s start with the most obvious one:

Adding from Sidebar

Probably the best way to add new glyphs is through the lists and categories in the sidebar of the Font tab. Some of the categories, language entries and lists have number badges indicating how many glyphs of this group are already in the font, and how many glyphs there are in total. E.g., 8/24 means that there are 24 glyphs in this group, and 8 of them are already in the font:

categories

Right-click any of these number-badged entries, and you will be presented a list of glyph names of glyphs recorded in this group but still missing in the font. Select any glyph, or multiple glyphs (click and drag, or Shift- or Cmd-click multiple glyphs), or even all of them (Cmd-A). Then click the Generate button or press the Return key to add them to the font.

addmissingglyphs

There are three kinds of groups: categories, languages, and filters.

  • Categories such as letters, ligatures and figures, are mainly intended for narrowing down what is shown in the Font tab. Some of them have number badges and allow adding missing glyphs through right-clicking.
  • Languages help you keep control over whether you have enough glyphs for covering certain languages, or actually language groups or even complete script systems. They often subgroups that make sense for technical or linguistic reasons. Almost all of the language groups have number badges.
  • And at the bottom, there are customisable filters. There are smart filters and list filters. The latter are simple lists of glyph names, and carry a number badge.

Categories and languages are predefined, but you can add your own sidebar entries. List filters are easy to create: click on the gear menu in the bottom left, choose Add List Filter:

addlistfilter

And in the upcoming dialog, pick a name for your list filter, and add glyph names, one per line:

customiselistfilter

Glyphs will pre-fill the dialog with the names of the glyphs that you had selected. If you had selected any glyphs, of course. When you pick glyph names, make sure they are valid.

The common advantage of all these sidebar entries is that they are available in all Glyphs files. In other words, they help you create fonts with consistent glyph sets, or sync the glyph sets across multiple files.

Adding Glyph Variants

Alternate glyphs are supposed o carry the same name as the respective original glyphs, except for an additional dot suffix. Since glyph variants usually do not have a Unicode value assigned, and therefore cannot be typed, they have to be accessed through an OpenType feature, a stylistic set for instance. The dot suffix usually reflects the name of the OpenType feature. E.g., the first stylistic set variant of adieresis would be called adieresis.ss01.

Tip: Glyphs can automate the code for some OpenType features based on the glyph name suffix. For a complete list of features, and how to trigger them, see the Appendix of the Glyphs Handbook.

A quick way to create glyph variants is to select one ore more glyphs, either in Edit or Font view, and then choose Glyph > Duplicate Glyph (Cmd-D). Glyphs will then create copies of the selected glyphs with a .001 suffix, or, if that suffix is already taken, .002, and so on. After their creation, the duplicate glyphs are selected automatically for further processing.

To quickly change the suffix of the new duplicate glyphs, keep the selection, and choose Edit > Find > Find and Replace… (Cmd-Shift-F). In the dialog search for the suffix of your duplicates, e.g., .001, and replace it with the intended suffix:

searchandreplace

Add Glyphs Dialog

When you choose Glyph > Add Glyphs … (Cmd-Shift-G), you are presented with a dialog containing a multi-purpose text entry field. In it, you can add any number of glyphs, in various ways:

  • Pasted or typed characters (use spaces, newlines or tabs as separators): Ä Ö Ü ä ö ü ß
  • Glyph names: a.ss02 adieresis.ss02 aacute.ss02
  • Unicode ranges with a colon: a:z or uni0300:uni033F
  • Recipes: y.alt+dotbelowcomb=ydotbelow or f.connect+f=f_f.liga

After you click on the Generate button, the respective glyphs will be added to their font, and their name will be converted to human-readable glyph names according to the built-in glyph database, a.k.a. nice names. This includes legacy or production glyph names such as uni0421 or dotlessi. If you want to prevent the name conversion, activate the setting File > Font Info > Other Settings > Use Custom Naming (Cmd-I).

addglyphs

If you know the Unicode of the glyph you want to add, you can type uniXXXX for unicode values 0000 through FFFF, or uXXXXX for Unicode values 10000 and above.

Apart from being the only way for employing recipes, this method is ideal for covering Unicode ranges and glyph lists you take from elsewhere, but do not want to add permanently to the sidebar. Also, it is the quickest method if you know how to type certain letters, but do not know their glyph names.

Adding Glyphs from Glyph Info

With Window > Glyph Info, you can take a glimpse at the built-in glyph database. Each entry lists glyph name, Unicode value, category and subcategory, its script, and its composition if applicable:

glyphinfo

Use the search field for searching in glyph names, Unicode values or characters. Select one or more glyphs in the list (click and drag, or Shift or Cmd-click multiple entries), then push the Add to Font button. That’s it.

This way, you can access any glyph the app knows about, even if it is not listed anywhere in the sidebar. The Glyph Info window is also a quick method for finding all glyphs in the database belonging to a certain script, simply by typing the script extension, e.g., -deva.

If some or all of the glyphs you want to create are already in the font, Glyphs will ask you what you want to do:

alreadypresent

The Add Button

For adding single glyphs, you can also press the little plus button at the bottom of the Font tab. Glyphs will add a glyph called newGlyph to the font. If you do not see anything at first, you may need to scroll down all the way to the Other category. Perhaps you also need to switch back to the All category.

The glyph name should already be selected, so you can type the desired glyph name right away. If you wait for a second, you will be offered autocomplete options:

autocomplete

Similar to Glyph > Add Glyphs, the entry takes legacy glyph names or even plain character entries, and will convert them to proper nice names once you press the Return key.

Removing Glyphs Again

Unhappy with the glyphs you just added? In Font view, select them, and press the Remove button, the one withe minus located next to the Add button. Or, press Cmd-Delete to remove selected glyphs. The shortcut also works in Edit view. After you confirm the dialog that follows, you have gotten rid of the excess glyphs:

confirm

Scripting

For the scripters among you, you can easily create a glyph by instantiating the GSGlyph class, and appending the GSGlyph object to the glyphs of a GSFont object. Sounds complicated? Nah, here is a Python sample that should be self-explanatory:

myGlyph = GSGlyph()
myGlyph.name = "estimated"
myGlyph.unicode = "212E"
Glyphs.font.glyphs.append(myGlyph)

You can then proceed to access myGlyph’s layers, etc.

Alternatively, you can create a GSGlyph object with the name right away. So, you can replace the first two lines of the code sample with myGlyph = GSGlyph("estimated"). More info on this, and lots of other Python-related stuff, can be found on docu.glyphsapp.com.

The same thing in AppleScript would look like this:

tell application "Glyphs"
    tell font of first document
        make new glyph at the end of glyphs with properties {name:"estimated", unicode:"212E"}
    end tell
end tell

Have fun!

Creating an SVG Color Font

$
0
0

When you look up SVG, you will find that it stands for Scalable Vector Graphics. So far, so good, but when we use the term in the realm of fonts, it can actually mean different things:

The SVG Font Format

Firstly, there used to be SVG as a webfont file format. Its file name suffixes were .svg or the zip-compressed .svgz. Forget about it right away, because it was only really supported by Safari on early iPhones. And luckily, it has become extinct. It was huge compared to other font formats, and it offered nothing but plain outlines. That means: no kerning, no hinting, and none of the other good things OpenType tables can provide. In other words, it was not even an OpenType font. Glyphs is an OpenType font editor, and therefore cannot produce SVG fonts like these.

This tutorial is not about the legacy SVG font file format.

The SVG OpenType table

The webfont file formats in wide use today are WOFF, and, slowly gaining ground, WOFF2. There is more to it of course, but in a nutshell, WOFFs are compressed OpenType fonts. Its desktop brothers, CFF/OTFs and TTFs, are also OpenType formats, both with their peculiarities and not as well-compressed as WOFF. What makes OpenType fonts OpenType fonts is their internal structure, which is a collection of so-called OpenType tables, and one of these tables can be the SVG table, containing SVG-based information. Fonts containing such an SVG table are sometimes referred to as OpenType-SVG color fonts or SVG color font.

This tutorial is about OpenType-SVG color fonts.

In Glyphs, there are two ways of getting SVG information into a font: from separate .svg image files, or from an existing color font setup. The latter can be either a layer font on different masters, or a CPAL/COLR font with indexed Color layers.

Option A: from SVG image files

If you have the SVG graphics available ins separate files already, you can place them in the respective glyphs, and export a font with an SVG table. This method allows you to take full advantage of the capabilities of the SVG file format, including crazy stuff like vector animations.

To prepare, we recommend to save your .glyphs file in the location you desire, and create a subfolder called Images for the SVG files. This is because only the relative paths to the images are stored in the .glyphs file, and it is easier to keep them together when they are in a subfolder.

Now we need an example. Let’s try a rotating red circle animation for the uppercase O. Select and copy (Cmd-C) this SVG code:

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
 width="1000" height="1000" viewBox="-400 -400 800 800">
 <title>SVG animation using SMIL</title>
 <circle cx="0" cy="100" r="200" stroke="none" fill="red">
  <animateTransform
   attributeName="transform"
   attributeType="XML"
   type="rotate"
   from="0"
   to="360"
   begin="0s"
   dur="1s"
   repeatCount="indefinite"></animateTransform>
 </circle>
</svg>

Paste it (Cmd-V) into a new window of a plaintext editor of your choice, such as TextMate, SublimeText, or Atom.

svgintexteditor

Then, save the file in the Images folder as O.svg. So, in Finder, your whole setup may look like this:

findersetup

Back in your .glyphs file, prepare the uppercase O. Open it in Edit view, and in the Layers palette, press the Copy button to add a layer copy, then rename it to svg. When you are done, it should look like this:

svglayer

Now here is the deal: Whatever you put in the master layer is the black-and-white fallback glyph, which is visible in applications that cannot display the color information stored in the SVG table. In case you were wondering, the master layer is the layer in bold text in the Layers palette, in our example the one named ‘Regular’.

But on the new svg layer, you can drag and drop your .svg image file. It should be displayed right away. You will not see the animation, though. You can resize and move the image to your liking:

placedsvgineditview

A note about spacing: the svg layer inherits its width from the master layer, so you have to switch back to that one if you want to space your glyph. For our example here, it makes sense to set the width to 800, assuming that you did not scale or distort the placed SVG. To do that, click on the Regular layer in the Layers palette, then change the width in the grey info box to 800:

setwidthto800

In any event, export the font as a webfont: File > Export > Webfont, use WOFF and WOFF2 as formats. CFF or TTF should not matter:

exportwoff

On the Mac, Firefox is the only browser supporting OpenType-SVG fonts. On Windows, Microsoft Edge supports it too. so these are the browsers you will have to have access to if you want to test your OpenType-SVG font. To that end, you can either drum up an HTML file containing the HTML and CSS code for displaying the WOFF, or you can run the Test > Webfont Test HTML script from the mekkablue script repository. This script creates an HTML file for the current font in the most recently used webfont export destination.

If you are not familiar with scripts yet, take a minute and go through the installation instructions in the readme of the scripts, install the scripts accordingly. Then, hold down the Option key while you choose Script > Reload Scripts (Cmd-Opt-Shift-Y).

The script conveniently opens the enclosing folder for you. All you need to do now is drag the HTML file onto the Firefox icon in your dock (or right click and Open with > Firefox.app), type an uppercase O, et voilà:

animatedredcircle

Ta-daaa! But be careful, animations in fonts tend to be processor-intensive. It can make your computer fans go bonkers, and all mobile users will develop mixed feelings about you for draining their battery. You have been warned.

Option B: from an existing color font

You can depart from a layer font on multiple masters or from a CPAL/COLR setup with indexed layers (a.k.a. Microsoft color font).

In the case of CPAL/COLR: Follow the steps of the tutorial. Make sure you have Color Palettes set up in the Custom Parameters section of File > Font Info > Masters, and numbered Color layers in the glyphs, i.e., Color 0, Color 1, Color 2, and so on.

In the case of a layer font: Follow the steps of the tutorial. Make sure you have set your colours with the Master Color parameter in File > Font Info > Masters.

Once you are done with your setup: In File > Font Info > Instances, create a new instance for the font containing the SVG table. Give it a style name like Regular or Multicolor or SVG or whatever makes sense for you. Then add the custom parameter Color Layers to SVG to your new instance, and make sure its Value is turned on:

colorlayerstosvg

Now export with File > Export > Webfont (Cmd-E). That’s it, nothing more to it. Test the font in Firefox as described above (see Option A).

More custom parameters

In File > Font Info > Instances (Cmd-I), in the Custom Parameters, you can add any or all of these three parameters:

  • Export COLR Table
  • Export SVG Table
  • Export sbix Table

These are for controlling which color tables are generated and actually make it into the OpenType font, and which do not. To cut down on webfont file size, you may want to enable the export of one of the tables, but disable all the others. For instance, if you are using the method described in Option B to export an SVG table based on a CPAL/COLR setup, you may want to suppress the creation of the COLR table.

More about SVG

We have just been scratching the surface. To geek out on SVG and all its possibilities, dig into the specs and some sample code:


Update 2017-01-20: Added Microsoft Edge to the list of supporting browsers.

Creating Fonts with Complex Outlines

$
0
0

Modern font technology is primarily geared towards ‘normal’ typefaces. That means that some of the technologies in use assume that your font:

  • has simple outlines with the smallest possible number of nodes
  • has nodes at extremes (learn more about drawing good paths)
  • has multiple glyphs that share similar shapes (e.g., the shoulders of lowercase n, h and m are close to identical)
  • has a reasonable number of glyphs (for the most part, a three- to four-digit number)

Now, if your font breaks any of these assumptions, we are talking about so-called ‘complex’ outlines. If your font sports these kinds of outlines, you may have to take decisions on subroutinization, hinting, and possibly even adjust your paths. Otherwise your font may not export, or worse, it does export and ships and performs badly for your end users, and you will receive loads of support mails. Not good.

To give you an idea what complex outlines can look like:

adinah fairwater letterpress weingut


Typefaces: Adinah by Andy Lethbridge, Fairwater by Laura Worthington, Letterpress by Marcus Sterz, Weingut by Georg Herold-Wildfellner

Subroutines

Subroutinization is a filesize-saving mechanism in CFF fonts (i.e., fonts containing PostScript outlines, suffix: .otf) that tries to find recurring structures in your outlines and stores them in so-called subroutines, hence the name. It works a little bit like components, but also with paths and curves, not just whole glyphs. And it is done automatically at export time, so you usually do not have to worry about it.

Subroutinization works best if you have many similar shapes in your fonts, and your font has a regular size, like a couple of hundred, perhaps a few thousand glyphs. It reaches its limits if you have too many different shapes, like in grunge or scan fonts. Or if you have very complex or detailed outlines, or a very high number of nodes per glyph. Or, as in many CJK fonts, if you have very many glyphs in your font, say 20,000 or even more. (Want to know more? Read Ken Lunde’s blogpost about subroutinization in CJK fonts.) If any of these are the case, you will notice that exporting takes unusually long. That is the subroutinization algorithm trying to find similar shapes in millions and billions of outlines. It can happen that the subroutines make the font larger, not smaller, because shapes are found in high numbers, but reused only very little. It can even happen that the font does not export at all.

The Disable Subroutines parameter turns subroutinization off. Go through the respective instances in File > Font Info > Instances, and in each instance’s Custom Parameters table, add a new parameter with the plus button, switch its Property to Disable Subroutines, and turn on the checkbox that appears under Value:

disablesubroutines

Consider disabling subroutinization:

  • in fonts with very many glyphs, a few thousand and more,
  • in fonts with non-similar shapes, like grunge, handwriting, letterpress, or ransom-note fonts, where the whole point is that the glyphs look as different as possible,
  • in fonts with highly detailed outlines, like drop caps, symbols, icons, illustrations, dingbats,
  • in fonts with a high node count per glyph, starting at three-digit numbers.

Hinting

Hinting is the process of putting hints on the outline parts. Hints help the rasterizer determine which parts of a glyph are essential stems and need to be maintained or normalized during grid-fitting. Grid-fitting is the process of distorting outlines so they better fit onto the pixel grid.

Yes, you read that right. Hinting does not preserve your shapes, on the contrary, it distorts them. Hinting sacrifices shape fidelity for the higher good of a better fit at small pixel sizes. The result is a cleaner, crisper, more unified, more legible text on the screen. Hinting poses a lot of requirements on your outlines, though: they have to be as clean and ‘normal’ as possible.

Consider no hinting:

  • in fonts with intentionally inconsistent, heterogeneous, non-similar shapes,
  • in connecting script fonts where the outstroke of one letter has to precisely meet the instroke of the following letter,
  • in fonts with highly detailed outlines,
  • in fonts with a high node count per glyph,
  • in fonts without alignment zones in File > Font Info > Masters,
  • in fonts without standard stem definitions in File > Font Info > Masters,
  • in fonts with non-normal outlines that:
    • do not have nodes at extremes
    • show dissimilar, heterogeneous stem thicknesses
    • do not consistently reach into alignment zones
    • have been created with decorative effects such as the Glyphs filters Roughen or Hatch Outline would create, but also inlines, outlines, dotted lines, shadows, 3D effects, etc.

To avoid hints in your font, you have to do two things: disable autohinting and remove manually placed hints. To get rid of autohinting, simply disable the Autohint option in the File > Export dialog. Or, use the Autohint custom parameter in File > Font Info > Instances with the Value off, of course:

autohintingoff

To get rid of already placed manual hints any a font, you can click on the gear button in the lower left corner of the Font view, choose Add Smart Filter. In the upcoming dialog, give your Smart Filter a name that makes sense to you, and set it to Has Hints: Yes. Confirm the dialog by pressing OK and select the Smart Filter in the left sidebar. Then go through the glyphs and delete the hints manually.

glyphswithhints

Or, more easily, there are scripts for deleting manual hints. In my mekkablue Scripts repository on GitHub, you will find Hinting > Delete all Hints in Font, among others. Find installation instructions in the readme of the repository.

hintingscripts

To make sure that no hints made their way into the resulting OpenType font, you should test your fonts. Open the exported OTF in Glyphs and apply the Smart Filter we discussed a few paragraphs ago. Or, step through your glyphs in apps like DTL OTMaster.

Paths

We have discussed complex paths, i.e., paths with a high amount of nodes. Assume you have complex outlines in your design, and being the good citizen that you are, you have disabled subroutinization and hinting as suggested by your local font authorities. Still, there may be problems, because a high amount of small curve segments can be problematic in CFF-based OTFs.

Firstly, while such a font may work on the screen, a printer may easily yield a Too many subpaths error. When rasterizing, each little curve segment is broken into many small line segments, so-called ‘subpaths’. They are really small, well below the threshold of the rasterizing resolution. On a laser printer, this resolution may be relatively high, meaning that the subpaths have to be very short, and of course, very many, since they have to add up to the complete curve segment they are supposed to be replacing. To give you an idea, this is a zoomed-in view of a curve segment broken into loads of subpaths:

subpaths

Secondly, you may run into performance problems when using the font in Microsoft Windows. Like, you type a word of six letters, and then, you are watching the letters appear one after another for another ten seconds or so. Windows has troubles with CFF outlines in the first place already, but complex CFFs can be a bridge too far for the operating system from our good friends in Redmond.

Two ways to deal with the issue:

Firstly, if your design allows it, replace all your curve segments with straight segments. The rationale behind this solution is that a line segment is significantly easier to render than a curve segment.

There is a plugin that does that for you: Retractor. Find and install it via Window > Plugin Manager. You can trigger it automatically at export time with a Filter custom parameter (more info in the Filter readme). This is usually recommended for fonts with very small curve segments, such as grunge fonts, dirty fonts, letterpress fonts.

If you do have bigger curve segments in your outlines, you may consider the use of the Roughen filter (Filter > Roughen), which turns everything into little line segments. Consider small displacement values, perhaps even zero, but slightly larger Segment Length. Again, you can trigger this filter through a custom parameter, which you can simply copy into your clipboard through the gear menu in the lower left corner of the filter window, and subsequently paste into the Custom Parameters table in File > Font Info > Instances.

roughen

Secondly, if your design requires the curve segments to stay in place cleanly, consider exporting the font with TrueType outlines. Here, the idea is that TrueType actually allows higher complexity than CFF/PostScript does. To export your font as TrueType, you can switch on the Save as TTF option in File > Export, or use the Save as TrueType custom parameter in File > Font Info > Instances. It’s that easy.

Crashes

$
0
0

Sending Crash Reports

After a crash, two crash report dialogs will pop up. The first one is provided by macOS and comes up immediately after the crash. We do not care about this one. Just click Reopen to restart Glyphs:

crashreportsystem

After Glyphs has restarted, there will be a second dialog bothering you. This time, it is carrying the Glyphs (or Glyphs Mini) logo. It looks like this:

crashreportglyphs

This is the one we care about. Please, always send this one. Always, always, always. The more you send us, the better. Let me repeat that slowly: A…L…W…A…Y…S send the report with the Glyphs icon in the top left and the Send button in the lower right corner of the dialog window. In case you are still undecided, here is a handy diagram that covers all possible circumstances:

diagram

And if you fill in the e-mail field, we can get back to you. You only have to fill this in once, and the dialog remembers your info for the next time. Sometimes, we have the suspicion that it is related to a problem in the file. But of course, the crash report does not send any data from your files, and we have no idea what actually triggered the crash. So, if you provide your contact information in the dialog, there is a chance you will receive an e-mail from Glyphs Support asking for a copy of the file you were working on when the crash happened. If you can send us the file, or perhaps just the glyph that is causing the problem, it is much easier for us to figure out what went wrong, and fix the problem.

Can you reliably reproduce the crash? In other words, do you know exactly what you have to do in order to trigger the crash? Please, at least once, describe the steps we can do to recreate the crash. This is very important, because if we know how to trigger a crash, we can fix it very quickly.

Restart the App, Don’t Reopen the File

Want to continue to work on your fonts after a crash? It is advisable to simply start the app again. Do this either with the Reopen button in the crash report dialog, or with a click on the Glyphs icon in the Dock. Glyphs will start up and try to reopen all the files you had open at the time of the crash, in their latest state possible. If they do not open, use the File > Open Recent menu item to reopen your font files.

autosaved

Do not touch the Autosaved copy next to your .glyphs file. This is the copy that the system keeps around for recreating the last file state. Don't mess with it. (Only exception: use it as a last resort if the original file has been damaged, and in that case, make a copy of it and rename it before you open it.)

Update to the latest Cutting Edge Version

Perhaps the problem that causes the app crashes is already fixed in the most recent betas. Here is how to install the latest possible version: Go to Glyphs (Mini) > Preferences > Updates, make sure the Show cutting edge versions option is checked, and click on the Check Now button.

cuttingedge

You will either receive a dialog telling you that you are already up to date, or you will get a notification about a new version being available. In that case, make sure all your files are saved and backed up, click on the Install button, and restart the app when it asks you to:

readytoinstall

Is the problem gone? Congratulations, you’re all set. Is it still around? Keep sending those crash reports, please.

Feeling insecure with running a beta? To go back to the latest stable version, you can always redownload the trial app from the Get App page of this website. ‘Trial? But I paid for it!’ I hear you say. Don’t worry. When you open it on your Mac, it will automatically recognize your license and unlock itself.

Disable Plug-ins

Perhaps the problem is related to an extension you have installed? To find out, run Glyphs without plug-ins. The easiest way to do this is to rename your Plugins folder and restart the app.

Note: Glyphs Mini does not support extensions, so this only applies to Glyphs users.

To access your Plugins folder, Go to Script > Open Scripts Folder (Cmd-Shift-Y). The Plugins folder is located right next to your Scripts folder. To deactivate all plug-ins at once, rename your Plugins folder to something like Plugins OFF and restart Glyphs:

pluginsoff

If that fixes your problem, one of the plug-ins has a severe bug. To find out which one, create a new Plugins folder, and move the plug-ins back, one by one. Restart the app every time and see if the problem is back. If it is, you have most likely found the culprit.

Please let the developer know about it. If you have the plug-in from GitHub, file a GitHub Issue in the repository of the plug-in. If you have the plug-in from the built-in Window > Plugin Manager, click on the GitHub link to access the GitHub page:

githublink

On the GitHub page, switch to the Issues tab, and click on the New Issue button to file a new bug report or feature request:

githubissues

Hint hint: The developer will be very happy if you can describe steps to reproduce the problem.

Try with Different Document

Try to recreate the crash in a new file, or in a copy of a different file. If the problem occurs in one file only, there may be something fishy in that particular file. Describe the problem in the forum and, if possible, offer to send us the file. We either have a quick answer for you, or will be happy to take a closer look.

Or maybe it occurs in only one glyph? If you can indeed trace the problem back to a particular glyph, then check paths, components, anchors, background layers, layer copies. Try cutting everything (Cmd-X) and pasting it immediately back again (Cmd-V). That forces Glyphs to rewrite the information in the file. Still no dice? Please keep sending the crash reports, and make yourself heard in the forum, as described above.


Update 2017-03-04: Fixed typos, clarified the purpose of folder renaming, minor reformulations.

Creating a Webfont in Glyphs Mini

$
0
0

So, you created a font in Glyphs Mini and want to display on a web page? It’s as easy as clicking a button. Read on.

Exporting a WOFF

In order to create a webfont, we will need a file with the suffix .woff. So, what is a WOFF? The Web Open Font Format (WOFF) is a font format for use in web pages. It was developed in 2009 by Erik van Blokland, Tal Leming and Jonathan Kewand and is now a World Wide Web Consortium (W3C) Recommendation. WOFF is essentially OpenType or TrueType with compression and additional metadata. If you want to know more about WOFF, you can read the specifications on the W3C Webpage. You can check which Browsers support WOFF on the State of Webtype Webpage.

To export your font as a WOFF, choose File > Export (Cmd-E) and choose Webfont (WOFF) for file type.

You can now choose to autohint your font, if you wish. The Autohint option applies the AFDKO autohinting algorithm to all glyphs that do not have any manually set hints. This option expects standard stems and alignment zones to be set correctly, so make sure you have the right measurements in your Font Info (Cmd-I). Uncheck this option for fonts that should not be hinted, or in order to speed up export for testing purposes.

The Remove Overlap option applies an algorithm to remove path overlaps at export, similar to the Remove Overlap filter. You can uncheck this option for testing purposes, to speed up the export or if you have already removed overlaps in your file.

The Export Destination option allows you to set a default location into which the fonts will get exported. If you do not set a destination, Glyphs Mini will bring up a save dialog. But watch out, exporting your font will overwrite any previous instances with the same name in the same export location. This can be useful if you use the Adobe Fonts folder as export destination.

Keep Your File Size Low

The main goal here is to keep the file size of your font as low as possible.
First, make sure you are only exporting glyphs you want to display. To do so, uncheck the Export option from the context menu in Edit view, or in the sidebar menu in Font view.



In Font view, non-exporting glyphs will be displayed with a red line across the. glyph cell.



You can also make sure you use as few nodes as possible in your glyphs.

Testing your Fonts in your Browser

In order to see our WOFF in action, we need some HTML and CSS code for testing.

Quoting Wikipedia, HTML means HyperText Markup Language and is the standard markup language for creating web pages. With HTML, fonts, images and other objects can be embedded into the page. And CSS means Cascading Style Sheets and is a style sheet language used for describing the presentation of a document written in a markup language. CSS is designed primarily to enable the seperation of document content from document presentation, including aspects such as the layout, colors and fonts. CSS can be embedded inside an HTML file.

You can test your font in your browser by copying and pasting the following into the plain text editor of your choice (TextMate, SublimeText, Atom, or TextWrangler are popular choices):

<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9">
    <title>your font</title>
    <style type="text/css" media="screen">
        @font-face { font-family: 'yourfont-Regular'; src: url('yourfont-Regular.woff'); }

        body {
            font-family: "yourfont-Regular";
            font-feature-settings: "kern" on, "liga" on;
            -moz-font-feature-settings: "kern" on, "liga" on;
            -webkit-font-feature-settings: "kern" on, "liga" on;
            -ms-font-feature-settings: "kern" on, "liga" on;
            -o-font-feature-settings: "kern" on, "liga" on;
        }
        p { padding: 5px; margin: 10px; }
        p#smallParagraph { font-size: 12pt; }
        p#largeParagraph { font-size: 32pt; }
        p#veryLargeParagraph { font-size: 100pt; }
    </style>
</head>
<body>
    <p id="smallParagraph">abcdefghijklmnopqrstuvwxyz</p>
    <p id="largeParagraph">abcdefghijklmnopqrstuvwxyz</p>
    <p id="veryLargeParagraph">abcdefghijklmnopqrstuvwxyz</p>
</body>

In the HTML code, replace all instances of yourfont with the actual name of your font. Feel free to edit the CSS and choose the font sizes you want to display. If you want to display all of the exporting glyphs in your font, here’s a trick: Add a Smart Filter in Glyphs Mini by clicking the gear wheel in the bottom left corner in Font view. Add to rules to your new filter: Has Unicode and Export Glyph. Choose the Yes option for both of them.

In the sidebar, select the filter you just created. Then select all glyphs displayed in the font tab and choose Edit > Copy (Cmd-C), then paste it into your text file instead of abcdefghijklmnopqrstuvwxyz. Save it with an .html suffix in the same folder as your WOFF:

Then, drag the file into a browser window, voilà:

There are also a few websites out there which let you test your font online. For example, you can test and analyze your webfont with the Webfont Test webpage. You can even compare fonts from different sources (Google Fonts, System Fonts or any font file downloaded from internet), analyze their x-height, weights, characteristics and peculiarities, and display their legibility at different sizes. Neat!

Furthermore, you can test your font with Pablo Impallari’s font tester. Simply drag your font onto the top of the page. You can switch between different ways to display your font, e.g. Text, Layout, or a-z, and test-run your WOFF to your heart’s content.

If you find a mistake in your font, fix it in Glyphs Mini and re-export it. Then, reload the test pages and you should see the updated version of your font.

Have fun!

Sample Font: Bussi by Stella Chupik
Update 2017-03-21: Minor clarifications in HTML setup, 2 extra screenshots.

Viewing all 88 articles
Browse latest View live




Latest Images