How to make "ão" a single character?

Hello
First I just want to congratulate this program, for the range of things you can do combined with the fact that its easy to use.

The problem is: I want to create a character that will be activated when I type separated characters
In this case, if I type “~” + “a” + “o”, i want the font to give me a custom character as a result, like “▒” or “╝” or something like that.
Just as typing japanese higanara characters on the keyboard, you tipe “ka” (“k” + “a”) and as a result you will have “か”

Sorry for any english mistake, I’m brazilian.
Thank you!

This question comes up quite frequently.

The feature you want is not supported directly by FontCreator. You can create the extra glyph easily enough, like creating æ from a + e, but to get Windows applications to substitute that when you type a, then e, or ã then o in your case, requires two things:

  • The application must support OpenType Features
  • The font must contain them.

See this tutorial on Adding OpenType Features for a relatively easy way to add them. You can also use VOLT, which I found too difficult.

Not many applications support OpenType features. Word 2010 will do, but currently InDesign is one of the few choices. This is why there is currently little incentive to add OpenType feature support to FontCreator, although it has been requested several times.

To the same thing in applications that don’t support OpenType, you could use Autocorrect, or define shortcut keys, or use a custom Windows keyboard.

Hmm, thanks for the help. I will take a look at the tutorial and see if I can manage to do it.

But you said that a few apps support opentype. I found it wierd, beacuse I can easily type japanese characters on notepad, on Word 2003 and any browser. Does japanese characters use another sytem or something? If so, maybe I can use it. What do you think?

And again, thank you for answering.

I don’t have Word 2003, but I expect it can use these ligature features. Notepad can if complex scripts are enabled in Windows Control Panel. You can test some of my free OpenType fonts such as Guru in Word 2003, by typing combinations like ff, fi, fl, ffi, or ffl. If you see the characters in the bottom row, then the application supports OpenType glyph substitutions.
OpenTypeGuru.png

Hmm, ok. Yeah, about notepad I know that I’ve allowed something for more characters in CP, so that must be the reason. About Word I haven’t tryed anything, but I’m almost sure It does suport as well.

Now, It’s being really hard to follow that tutorial, and even if I succeed to turn my True Type into Open Type, I won’t know how to create this ligatures for my font.

“- Open a text editor (preferably one displaying line numbers for easier debugging) and write your OpenType script, let’s call it YourFont.ot”

I didn’t understand. How “write your Open Type script”? I don’t even know exately what a script is. I’m not very used to programming and this sort of language, http was the only “language” I’ve programed so far, and I’m not sure what “compilation” means.

Well, I’m trying hard to get the answers for my own here. But if you give me a hand here Pesala, it will be wellcome, beacuse I’m lost in all that stuff :blush:

The letters æ Æ are ligatures. You can add them to your font as explained in this tutorial.

Since the ão ligature has no standard Unicode mapping, add them to the Private Use Area. They will also need unique postscript names, e.g. “ao” and “AO”. I can easily do that for you to get you started if you attach your font to the forum. How many ligatures do you need?

There are several examples of scripts in the OpenType tutorial thread. Here is a very simple script for adding just two ligatures to your font:

#input "Your Font Name.ttf" 
#output "Your Font Name.otf" 

script latn {  
    feature ligatures; 
} 
feature ligatures liga { 
    lookup ligaSub; 
} 

lookup ligaSub { 

    sub a o  -> ao; 
    sub A O -> AO; 
}



The OpenType Compiler (direct download link) is a command line program that runs in a DOS window. It reads your text file (the “script”), opens the font “Your Font Name.ttf” as defined in the script, and writes a new OpenType font called “Your Font Name.otf” in the same folder.

Create a new folder, let’s use C:\TEMP\ for now, and save the OTComp.exe in that folder, save the plain text file script in that folder as “Your Font Name.txt” (lets call it linck.txt for this demonstration), save a copy of your Truetype font there too, and compile the OpenType font.

To open a DOS command line window, press the Windows key + R to open the Run dialogue, type CMD, and press enter. At the DOS command line, type cd \temp\ to change directory to where OTComp.exe and linck.txt are saved. Then enter this command on the command line:

OTComp linck.txt

When you press enter, the program will run and compile the new font using your script. If there are any syntax errors in the text file, or if it cannot find your font, it will report an error.

I didn’t understand clearly what to do in this Private Use Area, witch I also didn’t find. If you will do it for me, I’m very thankful, but I will need to know how to do it by myself, so I can add further new ligature characters.

I attached the font file here. And for now I need 12 ligatures (ão, ÃO, sc, SC, ch, CH, rr, RR, ss, SS, 00, 000).
Please, if you will, do one of them and let me do the rest.


About the compilation, I understood quite clearly and I’m sure I’m not going to have problems with that. Thanks

But about the script, let me see if I understand:

I just need to open a text editor, paste this script you posted here, change the “#input/#output “Your Font Name.ttf”” for the name of my font file, and change this “sub ao → ao;” for the characters that my single ligature character will require to appear. So, if I want a “SC” (“S” + “C”) to turn into an “ƒ”, I need to put “sub SC → SC;” In the list.

Than it would be this way.

    #input "PUBON5.ttf"
    #output "PUBON5.ttf"

    script latn { 
        feature ligatures;
    }
    feature ligatures liga {
        lookup ligaSub;
    }

    lookup ligaSub {

        sub ão  -> ão;
        sub ÃO -> ÃO;
        sub sc -> sc;
        sub SC -> SC;
        sub ch -> ch;
        sub CH -> CH;
        sub rr -> rr;
        sub RR -> RR;
        sub ss -> ss;
        sub SS -> SS;
        sub 00 -> 00;
        sub 000 -> 000;
    }

After that, I need to compile this script and generate a new font file with the .otf extension.
Is it right?

And when I finish, what I need to do in FontCreator? That is, I will open the .otf file with FontCreator, and how I’m going to configure my custom character to appear when I type two different characters?

Thank you!

OK, I have added ao and AO to your font with suitable mappings in the Private Use Area, and valid postscript names. Accents don’t seem to be allowed, so I have used “ao” and “AO”.

Your script was almost correct. There are four errors that I can see. One was mine.

  1. The output file must be named as *.otf not *.ttf
  2. Postscript names with accents don’t seem to work, so use “ao” and “AO”
  3. The substitution sub 00 will be done before 000, so the second one will never be used. Switch the order so that sub 000 comes before sub 00 in the script.
  4. A space is needed on the left side of each sub: thus a o → ao etc.

Other than that, the script won’t run until all the ligatures with their correct postscript names exist in PUBON5.ttf. The actual glyph outlines don’t need to be defined for the script to run without error, but the glyphs must be there, and must have the valid postscript names as are used in the script.

#input "PUBON5.ttf"
    #output "PUBON5.otf"

    script latn { 
        feature ligatures;
    }
    feature ligatures liga {
        lookup ligaSub;
    }

    lookup ligaSub {

        sub a o  -> ao;
        sub A O -> AO;
        sub s c -> sc;
        sub S C -> SC;
        sub c h -> ch;
        sub C H -> CH;
        sub r r -> rr;
        sub R R -> RR;
        sub s s -> ss;
        sub S S -> SS;
        sub 0 0 0 -> 000;
        sub 0 0 -> 00;
    }



The font must be completed and saved from FontCreator as a TTF before running the script. I managed to get the script to run successfully with the attached font, after deleting the undefined substitutions (sc to 00).

I will explain how to add the ligatures in the Private Use Area later, but it varies depending on which version of FontCreator you’re using. Is it the Home Edition, the Professional Edition, or the Trial Edition?

This is how the OpenType font looks in TrueType Viewer with the Ligature feature enabled.
Glyph Substitutions.png

The version I’m using is FontCreator 6.0 Professional Edition.

Oh, several mistakes on the script
About the ã: I think you have an idea of how a portuguese keyboard works, but I will explain in case you don’t. There is a key only for the “~” and the “^” (if you press shift you’ll get ^ and without shift it’s ~). Than first I have to press the “~/^” key without shift, than the “a” key. The result will be a “ã”. If I pressed the “~/^” key holding shift, and than “a”, I would get a “â”.
Well, in this sense, maybe accent doesn’t work beacuse you were trying to put “sub ã o → ao;”, instead of “sub ~ a o → ao;”.

Good. That makes it easier to explain. Insert Characters and select the Private Use Area from the “Go to Unicode Block” drop list. Double-click to insert a character and then Shift Double-click on another one to insert a range of PUA characters. All will be correctly mapped, and will have valid postscript names such as uniE032. You can use those names in your script if you prefer, or edit them to something more memorable, like sc, SC, etc.

To edit postscript names, select a glyph, and press Alter Enter, or do several together from the Format, Post… dialogue.

Yes, I know about dead keys, I use them myself for Pāli, and the occasional grave or diaeresis accent.

I couldn’t get accents to work at all in the script, but I will leave you to debug that and use whatever postscript names you like.

I think that typing a o to get ao will be easier than typing ã o, but you know best how you want the glyph substitutions to work.

I think you will not find the rest too difficult now. Just ask again if you get stuck at any stage.

I did it! I created my ot file with the script, I opened the ot file with FontCreator, and I tested the ligatures and It worked, I typed 2 characters and it turned into another =)
Everything went perfect but one thing: my opentype font is not apearing in word 2003 neither in notepad.
I took my opentype font that had been just created, copied, and pasted on the C WINDOWS FONTS folder.
When I open Word or Notepad, the font is not on the list.

Since the OTF has the same Typeface name as the TTF you will need to uninstall the TTF first.

But I did. And I also put another name to be sure.

EDIT: Problem solved, there was a file that my search engine couldn’t find for some reason.

Thank You Very Much for everything Pesala! Without your help I wouldn’t be able to do it.

Also, I really need to put the “~” on the script, and I’m having problems with the 0 (zero) too.
Do you know anywhere on the internet where they can help me?

The postscript name of 0 is zero so I think in the script you must use:

zero zero zero → anysuitablepostscriptname (e.g.uniE030)

To generate a valid postscript name in your font, delete the existing one and click on Generate. It seems that only ASCII characters are allowed and no spaces.

The postscript name of the ~ is asciitilde and the postscript name of of ã is atilde so use

atilde o → ao
or
asciitilde o → ao
etc.
Glyph Substitions Tilde.png

Oh, it worked. Thank you again.

There is still one last problem (yes, I am bothering you again, sorry ._.), and this one seems to be a little more complicated: Those “zero zero zero”, were supposed to make the zeros get together.
So, if there was a blank space between every number, one million would be like this: 1 0 0 0 0 0 0
With this feature, it is like this instead: 1 000 000

And with one million it works, the problem, witch I weren’t able to predict, was that if I try to write ten thousand, instead of this: 1 0 000, it goes like this: 1 000 0

I thought about making a character for every possible combination with zero, but It would be too mutch work. I would have to draw more than a thousand characters.

So, if there is some other way on the script I would like to learn it, otherwise I will leave the zeros the way they were on the beginning.

Just design your “thousand” glyph with some white space either side of it. Add more glyphs and subs for 10,000, 100,000, 1,000,000 etc., as far as you need, but you don’t need for every possible combination — just for the zeros.

sub zero zero zero zero zero zero zero zero → hundredmillions
sub zero zero zero zero zero zero zero → tenmillions
sub zero zero zero zero zero zero → millions
sub zero zero zero zero zero → hundredthousands
sub zero zero zero zero → tenthousands
sub zero zero zero → thousands
sub zero zero → hundreds

There would be a limit for how far I can type numbers with zero. If i want to type a number with 30 zeros, there would have to have about 30 glyphs and subs for it.
Also, I don’t want the zeros alone to get together. Like “00000”, I don’t want it to become “00 000”.

It was a bad idea since the beginning, especially beacuse the regular way to goup numbers, is by putting a “.” between them, and we have a digit for it, so the typer is who controls it.

I won’t add this feature for my font anymore.

Again, thank you for everything.

I would like to learn more about this script language for fonts.
Could you recomment any website where I can learn? Or just tell me the name of the programming language.