FontLab Forum
2012-05-16, 12:29:02 *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to the FontLab forum, read how to use it! Update: Archives from old MSN forums are now available on our forum.
 
   Home   Help Search Calendar Downloads Tags Login Register  
Del.icio.us Digg FURL FaceBook Stumble Upon Reddit SlashDot

Pages: [1] 2
  Print  
Author Topic: [Tips / Composites] Generate Glyphs tricks  (Read 7800 times)
ArchivePoster
Guest
« on: 2003-06-21, 06:37:00 »

Posted by: Adam Twardoch
         

         
Logged
ArchivePoster
Guest
« Reply #1 on: 2003-06-21, 10:05:00 »

Posted by: 
         
This message has been deleted due to termination of membership.
         
Logged
ArchivePoster
Guest
« Reply #2 on: 2005-11-26, 16:15:00 »

Posted by: Adam Twardoch
         
I'll take the opportunity and explain some new aspects of generating glyphs in FontLab Studio 5.

In FontLab Studio 5, we have created a completely new alias.dat file that contains over 3,500 glyph composition recipes for over 2,500 glyphs. We have used the canonical decomposition rules from the Unicode Standard 4.1 as well as other sources, plus we devised many mappings ourselves.

This means that for some glyphs, we have more than one recipe. An excerpt of alias.dat looks like the following:
obreve o+uni0306
obreve o+breve

This means that when the user calls Generate Glyphs with "obreve" as a parameter, or double-clicks on an empty obreve cell, FLS5 will first look for the glyphs "o" and "uni0306" in the font. If both are present, FLS5 will generate a composite "obreve" glyph using these as components. If not all of the components are found in the font, FLS5 will try the next recipe, i.e. will look for the presence of "o" and "breve". If both are found, it will generate "obreve" using these.

If not all components are found and there are no more alternate recipes to process, FLS5 will attempt to generate the "obreve" glyph using as many components as can be found in the font, based on the first examined recipe. So if only "o" is present in the font, FLS5 will generate "obreve" as a composite glyph only referencing "o" as a component. If the lines were:
obreve a+uni0306
obreve b+breve
and both "uni0306" and "breve" were not present in the font, then FLS5 would generate "obreve" as a composite glyph referencing "a" as the only component.

Alias.dat also contains the following line:
uni0306 breve%

This means that if one tries to generate "uni0306", a *decomposed* (which here means: outline-based, not composite-based) glyph "uni0306" will be used that will be a copy of "breve". The "%" sign indicates that the glyph should be decomposed into outlines after creation. This is because you cannot chain composite glyphs in FLS5 (a composite glyph cannot be used as a component in a different composite glyphs).

Double-clicking on an empty glyph cell always uses the glyph recipes from the alias.dat file. But if you use Glyph / Generate Glyphs and type in some text there, you can either use the glyph recipes from alias.dat, or you can override them locally using your own recipes.

As I said, alias.dat specifies "uni0306 breve%" which means that "uni0306" will be create as an outline glyph, not a composite glyph. If somebody still wishes to generate a "uni0306" as a composite glyph referencing the "breve" component, without decomposition into outlines, he can override the recipe specified in the alias.dat. In Generate Glyphs, if you type "uni0306", then the alias.dat recipe will be used ("breve%" which causes the decomposition into outlines). But if you type "breve=uni0306" in Generate Glyphs, then the recipe that was specified before the equation sign will be used (which does not include the "%" therefore the glyph will be kept as a composite).

In FontLab Studio 5, we have also added a two-tier structure of data files (encoding files, naming files, Python macros). Alias.dat is also such a data file. FontLab Studio 5 ships with an "alias.dat" file that gets installed into "C:Program FilesCommon FilesFontLabData" (on Windows). This is the "factory" file that is used by default. However, the user can override the factory data files by user data files. If you place a file named "alias.dat" in "C:Documents and Settings(username)Application DataFontLabSharedData", then FLS5 will ignore the factory file and use your file instead. We recommend that you don't tweak the factory files anymore (as you might have done in FontLab 4.6) but make a user copy and use that instead. This way, you will prevent FontLab Studio 5 from ever overwriting your customized data files by new factory files.
You can specify a different location for your user data files in Tools / Options / Folders and paths. For example, my own data files are in "D:FontLabShared" rather than "C:Documents and SettingsAdam TwardochApplication DataFontLabShared".

This is handy for backup. I don't have to go to the FontLab application folder anymore and laborously separate the factory files from the ones I customized. I just zip my D:FontLab folder which includes ALL of customized encodings, mapping files, codepages, Python macros, alias.dat etc. I can backup the .zip file, do a clean FontLab Studio 5 install on a different machine, and then unzip the backup zip into a new folder. Finally, I go to Tools / Options / Folders and paths, point FontLab Studio 5 to that new folder, restart FLS5 and I'm done. This functionality also allows you to place your data files on a server that is accessible through a local network.

Of course, if any of you makes some interesting customizations to any of the files and is willing to share these customizations (of mappings, encodings, alias.dat, kerning and metric files etc.) with other FontLab Studio 5 users, please send the customized files to us and we'll consider incorporating them into the next release!

More on alias.dat: If one starts with a plain ANSI font, then generates "uni0306" and then "obreve", he'll first get an outline copy of "breve" named "uni0306" and then "obreve" will be generated from "o+uni0306". If "uni0306" were a composite glyph, FLS5 would fail to process the "o+uni0306" recipe and would make "obreve" from "o+breve".

When developing this system, we have even considered a chaining glyph generation system. Let's say we only have the lines
uni0306 breve%
obreve o+uni0306
in alias.dat. Based on this definition, currently, FLS5 will generate "obreve" as a composite glyph only containing one component glyph: "o". So when FLS5 looks at the "o+uni0306" recipe and it fails because "uni0306" is not found, FLS5 will currently not
attempt to generate "uni0306" based on the "breve%" recipe. In other words, the current implementation does not support recurrence. We have decided that it would be potentially problematic: a badly-written alias.dat could lead to circular references, and also, the user could potentially get more glyphs generated than he specified (since all the intermediates would automatically generate).
Needless to say, a recurrential implementation can still be done in Python if one wants it Smiley

There's even more to the Generate Glyph syntax, with fancy modifier operators but I just discovered that one of the superfancy operators (|) does not work as advertised in FLS5. Also, negative values don't work: "m+>200macron" works but "m+>-200macron" doesn't. I'll wait for Yuri to fix it before writing the rest of the tutorial Smiley

Adam Twardoch
Fontlab Ltd.


         
Logged
ArchivePoster
Guest
« Reply #3 on: 2005-11-26, 19:22:00 »

Posted by: Adam Twardoch
         
Postscriptum: Actually, I have the recipe "o+uni0306", if you have an existing glyph "uni0306" which is a composite glyph referencing the "breve" glyph as a component, and if you then try to generate the glyph "obreve", FLS5 will generate the "obreve" glyph as "o+breve". FLS5 does not support composite glyphs that reference other composite glyphs. So, when FLS5 is generating a composite glyph that would reference another composite glyph, it will collect the "final" components that are flat (outline) glyphs and will insert them into the generated glyph.

Adam
         
Logged
ArchivePoster
Guest
« Reply #4 on: 2006-10-21, 15:16:00 »

Posted by: Timotheus
         
Adam,
 
Is there any trick to getting FontLab to recognize custom .enc files? I have added one of my own and reorganized some downloaded ones (from you and Tiro). When I open FontLab, nothing has changed.
 
Tim

         
Logged
ArchivePoster
Guest
« Reply #5 on: 2006-10-21, 17:06:00 »

Posted by: Timotheus
         
Never mind, figured it out. Wink
 
For anyone else making custom encoding files, be sure you pay attention to those first few lines. That's where you define the name, group (folder), etc.
 
Tim

         
Logged
ArchivePoster
Guest
« Reply #6 on: 2007-08-28, 10:12:00 »

Posted by: Supremo22
         
Hi Adam,

Is there any placement modifiers which will shift a glyph upward or downwards, with value specified on it? Like for example, If I like to shift my glyph to the right, I will just simply add > plus the desired value (eg. >100acute)

Hope to hear from you soon!
         
Logged
ArchivePoster
Guest
« Reply #7 on: 2007-11-15, 21:56:00 »

Posted by: Supremo22
         
Hi,

When generating glyphs for dotless i, I always got an output of decomposed "i". Is there a way to remove the dot of "i" automatically? Hope to hear from you soon. And thanks in advance!
         
Logged
ArchivePoster
Guest
« Reply #8 on: 2007-11-17, 12:45:00 »

Posted by: graphity
         
There was an error in some early versions of the alias.dat file in which the ordinary 'i' was mistakenly used instead of 'dotlessi' but I think this was fixed around the time of version 4.6.

Unfortunately, if you're still using FontLab v4.x you can't simply update to the current v5 alias.dat file (in which most such errors have been corrected) because the v5 version is not compatible with v4.

But the problem is easy to fix yourself. If you search for your 'alias.dat' file, open it in a plain text editor, then look for lines like:

iacute i+acute

and edit it to read:

iacute dotlessi+acute

However, be careful that you don't change ALL instances of 'i' to 'dotlessi' because in some cases (eg when the diacritic is placed below the letter) the use of 'i' is correct. For instance, this is the case with uni1E2D and uni1ECB.

Kevin
         
Logged
ArchivePoster
Guest
« Reply #9 on: 2007-11-17, 05:40:00 »

Posted by: Supremo22
         
Thanks for the info. But what I mean is that when you tried to generate the "dotlessi", the glyph that appears is i instead of i without dot. Is there a way wherein when you create a glyph for dotlessi character, i without a dot will appear instead? Thanks in advance

         
Logged
ArchivePoster
Guest
« Reply #10 on: 2007-11-17, 08:00:00 »

Posted by: graphity
         
The answer has to be "no". To create 'dotlessi', Generate Glyphs (or 'Create Glyphs') is really just doing what you could just as easily achieve by copying and pasting ie to create 'dotlessi' you paste 'i' to the correct character position and then manually remove the dot. Generate Glyphs decomposes the 'i' so you can remove the dot.

Generate Glyphs can't remove the dot automatically if that's what you're suggesting. For Generate Glyphs to create the 'i' without a dot, you would already need to have a 'dotlessi' so you wouldn't need to generate it!!! Hope I've understood you better this time.

Kevin
         
Logged
ArchivePoster
Guest
« Reply #11 on: 2007-11-18, 17:39:00 »

Posted by: 
         
This message has been deleted by the author.
         
Logged
ArchivePoster
Guest
« Reply #12 on: 2007-11-19, 08:17:00 »

Posted by: 
         
This message has been deleted by the author.
         
Logged
ArchivePoster
Guest
« Reply #13 on: 2007-11-19, 08:20:00 »

Posted by: zzsido
         
Hi!
Just one more little trick. Instead of change the alias.dat, you can use any selfdefined script (as a .txt file), to generate glyphs, glyph-ranges. The rules identical with which explained by Adam. For example for
 
A.small+breve=Abreve.small
A.small+caron=Acaron.small
A.small+macron=Amacron.small
etc;
 
saveing this script to any folder on disk, than in the Glyphs > Generate Glyphs pane pushing the 'Open glyph list' button, you can looking for the saved script and import it into the working panel. Select any option on the pane (I used mostly the 'Mark new glyphs'), then OK.
 
From the imported script can delete, overwrite or add 'commands' by continuing an existing line (do not use the ENTER button to get a new line!)
 
I wrote such scripts for accented Western, Central Europe and Easter Europe glyphs, Small Caps and some Alternate sets.
 
Regards,
Z

         
Logged
ArchivePoster
Guest
« Reply #14 on: 2007-11-20, 18:27:00 »

Posted by: Supremo22
         
You got me right. It's sad to know that there is no way that I can do that. Can't we do it even using a script? Thanks for your answer and I really learn a lot in this forum. More power!!!
         
Logged
Tags:
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!