How to deal with conextual alternatives and separator & punctuations?
Miklos Ferencz
Posts: 7
Hi there!
#lc=lowercase UC=uppercase
lookup x01 {
lookup x02 {
I'm working on a font which is based on the idea of contextual alternates.
I'm using only the lowercase and the uppercase characters. The idea is that with stylistic set the uppercase and the lowercase letters vary cyclicly by typing only lowercase (not using the 'shift' button).
It looks like this: AaAaAaA
The problem is when there is a space (or any kind of punctuations) between two words the cycle considers the space as a letter(?).
Looks like this: AaAaAaA AaAaAaA AaAa
What I try to do is that any time a word ends on an uppercase letter the following word should start with a lowercase, and vice versa, so start with always the opposite as the other ends, no matter how many spaces I have between the words. Like this: AaAaAaA aAaAaAa AaAa
The first code is to change the lowercase to upercase when I start typing:
The first code is to change the lowercase to upercase when I start typing:
#lc=lowercase UC=uppercase
lookup x01 {
x01;
lookup x02 {
x02;
And after I couldn't figure it out how avoid the space and punctutations.
Any idea how to tackle this question?
0
Comments
-
This should do the trick:
script latn {<br> feature StandardLigatures1;<br>}<br><br>class @UC [A-Z];<br>class @lc [a-z];<br>class @SP [space comma period exclam question];<br><br>feature StandardLigatures1 liga {<br> lookup ChainingContext1;<br>}<br><br>lookup ChainingContext1 {<br> context (@lc @SP @SP) @lc;<br> sub 0 SingleSubstitution1;<br> context (@lc @SP) @lc;<br> sub 0 SingleSubstitution1;<br> context (@lc) @lc;<br> sub 0 SingleSubstitution1;<br>}<br><br>lookup SingleSubstitution1 {<br> sub @lc -> @UC;<br>}<br>
It is in OpenType Layout Feature code as used by FontCreator, but you can easily adapt it to other code.
1 -
Thank you very much for your reply.I'm new to coding. I tried to translate it to FontLab and Glyphs, but I need to understand some parts. Could you give me a good source where I can find explanation and a way to implement these codes into FontLab or Glyphs?0
-
This is the code in AFDKO syntax as you would use it in Fontlab or Glyphs or Robofont.
<code>space comma period exclam question
];
lookup ChainingContext1 {
sub @lc @SP @SP @SP @lc' @lc by @UC;
sub @lc @SP @SP @lc' @lc by @UC;
sub @lc @SP @lc' @lc by @UC;
sub @lc @lc' @lc by @UC;
sub @lc @lc' by @UC;
} ChainingContext1;
feature liga {
lookup ChainingContext1;
} liga;
languagesystem DFLT dflt;<br>languagesystem latn dflt;<br><br>@UC = [A-Z];<br>@lc = [a-z];<br>@SP = [
2 -
Thank you so much, it works perfectly!0
Categories
- All Categories
- 43 Introductions
- 3.7K Typeface Design
- 798 Font Technology
- 1K Technique and Theory
- 617 Type Business
- 444 Type Design Critiques
- 541 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 483 Typography
- 301 History of Typography
- 114 Education
- 68 Resources
- 498 Announcements
- 79 Events
- 105 Job Postings
- 148 Type Releases
- 165 Miscellaneous News
- 269 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports