OpenType feature for Turkish i

clauses's picture

I'm trying to slowly build up my opentype features, but I have reached an impasse with my Turkish i in small caps. The InDesign 'Opentype small caps' does no longer work for the languages excluded in 'locl', but it seems to work in Fontlab's opentype 'Preview' panel... that is except the substitution between the small caps I and the dotted Turkish small caps I. What have I done wrong?


@_n1=[a h m n aring adieresis agrave aacute acircumflex];
@_period=[period comma quotesinglbase quotedblbase];
@_n2=[m n r u udieresis uacute ugrave ucircumflex];
@_o1=[b e o p oslash edieresis eacute oacute odieresis ograve egrave ocircumflex ecircumflex];
@_o2=[c d e o q oslash edieresis eacute oacute odieresis ograve egrave ocircumflex ecircumflex];
@_i3=[i j dotlessi iacute igrave icircumflex];
@_v3=[v w x y ydieresis yacute];
@_dashes=[hyphen endash emdash];
@_upperquote=[quotesingle quoteleft quoteright quotedblleft quotedblright];
@_k1=[k ];
@_l2=[h l k];
@_O2=[C Ccedilla G O Oslash Q];
@_O1=[D O Oslash Q];
@_H2=[B D E F H I K L M N P R U];
@_H1=[H I M N U];
@lc=[a b c d e f g h i j k l m n o p q r s t u v w x y z];
@sc=[Asmall Bsmall Csmall Dsmall Esmall Fsmall Gsmall Hsmall Ismall Jsmall Ksmall Lsmall Msmall Nsmall Osmall Psmall Qsmall Rsmall Ssmall Tsmall Usmall Vsmall Wsmall Xsmall Ysmall Zsmall];
@uc=[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z];
@acute=[cacute sacute zacute nacute oacute];
@kreska=[ckreska skreska zkreska nkreska okreska];
@_n1=[a h m n aring adieresis agrave aacute acircumflex];
@_period=[period comma quotesinglbase quotedblbase];
@_n2=[m n r u udieresis uacute ugrave ucircumflex];
@_o1=[b e o p oslash edieresis eacute oacute odieresis ograve egrave ocircumflex ecircumflex];
@_o2=[c d e o q oslash edieresis eacute oacute odieresis ograve egrave ocircumflex ecircumflex];
@_i3=[i j dotlessi iacute igrave icircumflex];
@_v3=[v w x y ydieresis yacute];
@_dashes=[hyphen endash emdash];
@_upperquote=[quotesingle quoteleft quoteright quotedblleft quotedblright];
@_k1=[k ];
@_l2=[h l k];
@_O2=[C Ccedilla G O Oslash Q];
@_O1=[D O Oslash Q];
@_H2=[B D E F H I K L M N P R U];
@_H1=[H I M N U];
@lc=[a b c d e f g h i j k l m n o p q r s t u v w x y z];
@sc=[Asmall Bsmall Csmall Dsmall Esmall Fsmall Gsmall Hsmall Ismall Jsmall Ksmall Lsmall Msmall Nsmall Osmall Psmall Qsmall Rsmall Ssmall Tsmall Usmall Vsmall Wsmall Xsmall Ysmall Zsmall];
@uc=[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z];
@acute=[cacute sacute zacute nacute oacute];
@kreska=[ckreska skreska zkreska nkreska okreska];
languagesystem latn dflt;
languagesystem latn PLK;
languagesystem latn MOL;
languagesystem latn ROM;
languagesystem latn TRK;
languagesystem latn AZE;
languagesystem latn CRT;
languagesystem cyrl dflt;
languagesystem cyrl SRB;
languagesystem grek dflt;

feature locl { # Localized Forms
# Latin
# Handling of Turkish i
language TRK exclude_dflt;
lookup locl_TRK {
sub [i Ismall] by [i.TRK Idotaccentsmall];
# The Òi.TRKÓ glyph should be an identical copy of ÒiÓ
} locl_TRK;
language AZE exclude_dflt;
lookup locl_TRK;
language CRT exclude_dflt;
lookup locl_TRK;
# Handling of Romanian Scommaaccent
language ROM exclude_dflt; # Romanian
lookup locl_ROM {
sub [Scedilla scedilla] by [uni0218 uni0219];
sub [uni0162 uni0163] by [uni021A uni021B];
} locl_ROM;
language MOL exclude_dflt; # Moldavian
lookup locl_ROM;
language PLK exclude_dflt; # Polish;
sub @acute by @kreska;
} locl;

feature c2sc {
sub @uc by @sc;
} c2sc;

feature smcp {
sub @lc by @sc;
} smcp;

feature liga {
sub f f l by ffl;
sub f f i by ffi;
sub f f by ff;
sub f i by fi;
sub f i.TRK by fi;
sub f l by fl;
sub f b by f_b;
sub f f b by f_f_b;
sub f h by f_h;
sub f f h by f_f_h;
sub f j by f_j;
sub f f j by f_f_j;
sub f k by f_k;
sub f f k by f_f_k;
sub T h by T_h;
} liga;

feature kern {
pos slash slash -357;
pos backslash backslash -357;
} kern;

k.l.'s picture

I could be wrong but have you tried inserting an explicit line "script latn;" below your line "# Latin" in locl?
ID does casing first, then applies c2sc to the uppercased string. Idotaccent and Idotaccentsmall are not covered in your classes @uc and @sc, so are not available to c2sc. Also I think you can omit Ismall and Idotaccentsmall from "sub [i Ismall] by [i.TRK Idotaccentsmall];" in locl but then need an additional line in smcp, as sketched here.

By the way, I spotted "sub f i.TRK by fi;" in liga which is better removed. Part of i.TRK's job is avoiding this ligature if language is TRK. In Turkish, i-with-dot and i-without-dit are separate letters, and an f-i ligature in which the dot is connected to the f would look like f-dotlessi ...

clauses's picture

Hi Karsten
Thanks a lot for your approach. The whole thing now works in Fontlab's preview panel, but all the declared languages in the locl feature still can not display their small caps in InDesign – that problem persists.

My new features look like this:


@_n1=[a h m n aring adieresis agrave aacute acircumflex];
@_period=[period comma quotesinglbase quotedblbase];
@_n2=[m n r u udieresis uacute ugrave ucircumflex];
@_o1=[b e o p oslash edieresis eacute oacute odieresis ograve egrave ocircumflex ecircumflex];
@_o2=[c d e o q oslash edieresis eacute oacute odieresis ograve egrave ocircumflex ecircumflex];
@_i3=[i j dotlessi iacute igrave icircumflex];
@_v3=[v w x y ydieresis yacute];
@_dashes=[hyphen endash emdash];
@_upperquote=[quotesingle quoteleft quoteright quotedblleft quotedblright];
@_k1=[k x];
@_l2=[b h l k];
@_O2=[C Ccedilla G O Oslash Q];
@_O1=[D O Oslash Q];
@_H2=[B D E F H I K L M N P R U];
@_H1=[H I M N U];
@lc=[a b c d e f g h i i.TRK j k l m n o p q r s t u v w x y z];
@sc=[Asmall Bsmall Csmall Dsmall Esmall Fsmall Gsmall Hsmall Ismall Idotaccentsmall Jsmall Ksmall Lsmall Msmall Nsmall Osmall Psmall Qsmall Rsmall Ssmall Tsmall Usmall Vsmall Wsmall Xsmall Ysmall Zsmall];
@uc=[A B C D E F G H I Idotaccent J K L M N O P Q R S T U V W X Y Z];
@acute=[cacute sacute zacute nacute oacute];
@kreska=[ckreska skreska zkreska nkreska okreska];
languagesystem DFLT dflt;

languagesystem latn dflt;
languagesystem latn PLK;
languagesystem latn MOL;
languagesystem latn ROM;
languagesystem latn TRK;
languagesystem latn AZE;
languagesystem latn CRT;

languagesystem cyrl dflt;
languagesystem cyrl SRB;

languagesystem grek dflt;
feature locl {

script latn;
language TRK;
lookup ITRK {
sub i by i.TRK;
} ITRK;

language AZE;
lookup ITRK;

language CRT;
lookup ITRK;

# Handling of Romanian Scommaaccent
language ROM; # Romanian
lookup COMMAACCENT {
sub [Scedilla scedilla] by [uni0218 uni0219];
sub [uni0162 uni0163] by [uni021A uni021B];
} COMMAACCENT;

language MOL; # Moldavian
lookup COMMAACCENT;

language PLK exclude_dflt; # Polish;
sub @acute by @kreska;

} locl;
feature c2sc {
sub @uc by @sc;
} c2sc;

feature smcp {
sub @lc by @sc;
# Here, we need an additional substitution to
# cover the "dotlessi":
sub dotlessi by Ismall;
} smcp;

feature liga {
sub f f l by ffl;
sub f f i by ffi;
sub f f by ff;
sub f i by fi;
sub f l by fl;
sub f b by f_b;
sub f f b by f_f_b;
sub f h by f_h;
sub f f h by f_f_h;
sub f j by f_j;
sub f f j by f_f_j;
sub f k by f_k;
sub f f k by f_f_k;
sub T h by T_h;
} liga;

feature kern {
pos slash slash -357;
pos backslash backslash -357;
} kern;

Can you figure it out?

k.l.'s picture

I do not have any problems with this method in my fonts, here is what I get in InDesign CS4.

Could you describe what "InDesign Opentype Small Caps does no longer work for the languages excluded in locl" exactly means?

clauses's picture

For some reason my small caps doesn't work in any of the languages that are exceptions from the default in the locl feature – that is what I meant in my very convoluted sentence above. Here is what it looks like in InDesign CS4:

In Fontlab it looks allright though:

There must be some stupid thing somewhere in my code, but I can't see it.

benkiel's picture

Karsten let me know that some of this trouble was caused by my betterFontGenerate script. That's been fixed and updated at http://www.benkiel.com/typeDesign/scripts/downloads/betterGenerateFont.zip.

twardoch's picture

Claus,

it's quite simple: your smcp feature is only registered in latn dflt (also other features, I guess, such as kern).

In the lower-right part of the OpenType panel, you need to declare ALL languagesystems in which you want to register the feature definitions which do not have explicit languagesystem handling. If this is not done, the features get registered only in the implied languagesystem, which is latn dflt.

So, you should put:

languagesystem DFLT dflt;
languagesystem latn dflt;
languagesystem latn PLK;
languagesystem latn MOL;
languagesystem latn ROM;
languagesystem latn TRK;
languagesystem latn AZE;
languagesystem latn CRT;
languagesystem cyrl dflt;
languagesystem cyrl SRB;
languagesystem grek dflt;

I see that you have done this but there may be something wrong there...

Also, I advise that you don't use glyphnames outside of AGLFN. Asmall is a definietely a bad idea. A.smcp or A.sc or A.small would be much better.

Use DTL OTMaster or FontTools/TTX to examine your font and find out if the smcp-related lookups get actually registered in the latn TRK languagesystem.

Cheers,
Adam

clauses's picture

Hi Adam
The reason it didn't work was because I used Ben's BetterFontGenerate in a version 1.1, there was unfortunately a little bug, but Ben got it sorted. Then we ran into another issue in the BetterFontGenerate script, which might be solved. I just ran it on another Fontlab file tonight and had the issue again. I will inform Ben directly if I see it again. The BetterFontGenerate is now hovering around version 1.6 I believe, and I hope the issue I ran into today was just a temporary Fontlab quip.

By the way I got the 'Nsmall' idea from the FreeFont encoding that came with Fontlab. So not a good idea I understand, I will rename according to the Adobe glyph list.

twardoch's picture

Claus,

we're working on updating the FreeFont Pro font and encoding.

Cheers,
Adam

altan's picture

Clauses there's no problem with this picture
http://www.typophile.com/files/InDesign_6087.png

k.l.'s picture

(There is, though not with the dots. In the Turkish part, no smallcaps are applied to lines two and three though they should.) :D

altan's picture

No it's not a problem. Kitabım and KİTABIM is right. Turkish part absolutly works perfectly.
i=İ and ı=I
If you don't see right encoding in my message, check out this image.

clauses's picture

Altan, sorry, but you don't get what the illustration was for. It was to show the non functioning smcp and c2sc when locl was set to Turkish. The issue is resolved now.

altan's picture

Sorry for my careless mistake because of focusing to visual part, without reading.

twardoch's picture

Claus,

in your "In Fontlab it looks allright though" illustration, ccedilla is not being replaced by a smallcap glyph. Is this intended?

Cheers,
Adam

clauses's picture

Yeah, I hadn't done the small caps version of that glyph at that time. Anyhoot, my design was too boring, so I've abandoned it and have started from scratch. One for the drawer.

Bendy's picture

Very useful thread, thank you. Here's my result:

Bendy's picture

Er, coming back to this...how do I ensure that my liga feature excludes Turkish so that fi and fı don't end up looking the same?

k.l.'s picture

If you do the i.TRK trick in the 'locl' feature (for languages TRK, AZE, CRT) as described throughout this thread, then you don't need to do anything Turkish-specific in 'liga' or any other features. That's what the trick is about. :)

Syndicate content Syndicate content