Hello, I am Catalan, and we use frequently the geminated character ( l· ), that not is showed correctly in ConTeXt. Dot is too much separated of 'l' characters. How can I control character spacing by default? I have seen Fontfeaturefiles page in wiki for create ligatures and control kerning. But my attempts have failed. Do you think it is a good choice? I keep trying? Explanation extended: ================= Typing normally, catalans use "flow dot" character ( · ) between 'l' (l·l), that in spanish keyboard is located over key '3'. Other option is use special utf-8 characters (Ŀ) and (ŀ), but this character is not in any keyboard, and must changed before compile with ConTeXt (I use SED command). But none of these options is good. See you the result of following sample in context. % =================================== % Sentence: "I want to see films at school" \mainlanguage[ca] \starttext % With flow point \section{PEL·LÍCULES} Vull veure pel·lícules al col·legi % With utf-8 character \section{PEĿLÍCULES} Vull veure peŀlícules al coŀlegi \stoptext % =================================== The first result is very bad (too separaded). The second result is better, but closer together. More than double L ( ll) I would obtain LaTeX result using special characters that are more separated than ConTeXt, using "flow point" of keyboard. See you this sample: % =================================== \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[catalan]{babel} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{newunicodechar} \newunicodechar{Ŀ}{Ŀ} \newunicodechar{ŀ}{ŀ} \newunicodechar{Ŀ}{\L.} \newunicodechar{ŀ}{\l.} % Sentence: "I want to see films at school" \begin{document} % With flow dot \section{PEL·LÍCULES} Vull veure pel·lícules al col·legi % With utf-8 characters \section{PEĿLÍCULES} Vull veure peŀlícules al coŀlegi \end{document} % =================================== The second section is with utf-8 characters, and it looks great. Thanks, 19cat
On 1/7/2015 12:28 PM, 19cat wrote:
Hello,
I am Catalan, and we use frequently the geminated character ( l· ), that not is showed correctly in ConTeXt. Dot is too much separated of 'l' characters.
How can I control character spacing by default? I have seen Fontfeaturefiles page in wiki for create ligatures and control kerning. But my attempts have failed. Do you think it is a good choice? I keep trying?
Explanation extended: =================
Typing normally, catalans use "flow dot" character ( · ) between 'l' (l·l), that in spanish keyboard is located over key '3'. Other option is use special utf-8 characters (Ŀ) and (ŀ), but this character is not in any keyboard, and must changed before compile with ConTeXt (I use SED command).
But none of these options is good. See you the result of following sample in context. % =================================== % Sentence: "I want to see films at school" \mainlanguage[ca]
\starttext % With flow point \section{PEL·LÍCULES} Vull veure pel·lícules al col·legi % With utf-8 character \section{PEĿLÍCULES} Vull veure peŀlícules al coŀlegi \stoptext % ===================================
The first result is very bad (too separaded). The second result is better, but closer together. More than double L ( ll)
I would obtain LaTeX result using special characters that are more separated than ConTeXt, using "flow point" of keyboard. See you this sample: % =================================== \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[catalan]{babel} \usepackage[T1]{fontenc} \usepackage{lmodern}
\usepackage{newunicodechar} \newunicodechar{Ŀ}{Ŀ} \newunicodechar{ŀ}{ŀ} \newunicodechar{Ŀ}{\L.} \newunicodechar{ŀ}{\l.}
% Sentence: "I want to see films at school" \begin{document} % With flow dot \section{PEL·LÍCULES} Vull veure pel·lícules al col·legi
% With utf-8 characters \section{PEĿLÍCULES} Vull veure peŀlícules al coŀlegi \end{document} % ===================================
The second section is with utf-8 characters, and it looks great.
This is kind of tricky as in unicode they are not composed characters (char vs compat) so they are not dealt with in the collapser. I've added this to the beta: \definefontfeature[default][default][char-ligatures=yes,mode=node] \definefontfeature[default][default][compat-ligatures=yes,mode=node] % \setupbodyfont[cambria] % \setupbodyfont[pagella] \starttext \startTEXpage[offset=10pt] PEL·LÍCULES pel·lícules col·legi \par PEĿLÍCULES peŀlícules coŀlegi \par \stopTEXpage \stoptext I'm not sure about the names of these pseudo features (pl01 and pl02 might make more sense or maybe xlig (extra) and plig (pseudo) ... so maybe the names will change. (Not all fonts support this properly so it always needs checking.) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hi Hans, All, Your solution is naturaly better, but I was trying to use \topaccent to solve the problem. Yet, in my test I noticed that there maybe a bug in the spacing of the Middle Dot in the default font of ConTeXt, as you can see using my MWE. Depending on the font used, the result looks likes 19cat’s LaTeX example! Of course using \topaccent causes a character spacing to the preceding character! Here again the result is the worst for the default font of ConTeXt! Here my test MWE!? \mainlanguage[ca] %\definefontfeature[default][default][char-ligatures=yes,mode=node] %\definefontfeature[default][default][compat-ligatures=yes,mode=node] \definefontfamily [mainface] [serif] [Avenir] %\definefontfamily [mainface] [serif] [TeX Gyre Schola] \setupbodyfont[mainface] %\setupbodyfont[cambria] %\setupbodyfont[pagella] \def\LdotL{\topaccent{0pt}{0.5}{0}{·}{L}L} \def\ldotl{\topaccent{0pt}{1.2}{0}{·}{l}l} \def\Ldot{\topaccent{0pt}{0.5}{0}{·}{L}} \def\ldot{\topaccent{0pt}{1.2}{0}{·}{l}} \starttext % With flow point \section{PEL·LÍCULES} Vull veure pel·lícules al col·legi affike % With utf-8 character \section{PEĿLÍCULES} Vull veure peŀlícules al coŀlegi \section{PE\LdotL ÍCULES} Vull veure pe\ldotl ícules al co\ldotl egi \section{PE\Ldot LÍCULES} Vull veure pe\ldot lícules al co\ldot legi \stoptext
Am 08.01.2015 um 15:07 schrieb Hans Hagen
: This is kind of tricky as in unicode they are not composed characters (char vs compat) so they are not dealt with in the collapser.
I've added this to the beta:
\definefontfeature[default][default][char-ligatures=yes,mode=node] \definefontfeature[default][default][compat-ligatures=yes,mode=node]
% \setupbodyfont[cambria] % \setupbodyfont[pagella]
\starttext
\startTEXpage[offset=10pt] PEL·LÍCULES pel·lícules col·legi \par PEĿLÍCULES peŀlícules coŀlegi \par \stopTEXpage
\stoptext
I'm not sure about the names of these pseudo features (pl01 and pl02 might make more sense or maybe xlig (extra) and plig (pseudo) ... so maybe the names will change.
(Not all fonts support this properly so it always needs checking.)
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com http://www.pragma-ade.com/ | www.pragma-pod.nl http://www.pragma-pod.nl/ ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
On 1/8/2015 5:34 PM, Keith J. Schultz wrote:
Hi Hans, All,
Your solution is naturaly better, but I was trying to use \topaccent to solve the problem.
Yet, in my test I noticed that there maybe a bug in the spacing of the Middle Dot in the default font of ConTeXt, as you can see using my MWE.
Hard to say ... a designers choice.
Depending on the font used, the result looks likes 19cat’s LaTeX example!
Of course using \topaccent causes a character spacing to the preceding character! Here again the result is the worst for the default font of ConTeXt!
Probably because no one ever tested it and provided feedback. One of the advantages of going to tex meetings is that one can then try to convince font/macro authors to fix / change. Anyway, this looks good enough to me: \startluacode function document.add_some_characters(target,original) local characters = target.characters local upper = characters[0x004C] local lower = characters[0x006C] local accent = characters[0x00B7] characters[0x013F] = { commands = { { "char", 0x004C }, { "push" }, { "right", - upper.width + accent.width }, { "char", 0x00B7 }, { "pop" }, }, width = upper.width, height = upper.height, depth = upper.depth, } characters[0x0140] = { commands = { { "char", 0x006C }, { "push" }, { "right", - accent.width/2 }, { "char", 0x00B7 }, { "pop" }, }, width = lower.width + accent.width/6, height = lower.height, depth = lower.depth, } end utilities.sequencers.appendaction("aftercopyingcharacters","system","document.add_some_characters") \stopluacode \setupbodyfont[schola] \starttext \section{PEL·LÍCULES} Vull veure pel·lícules al col·legi \section{PEĿLÍCULES} Vull veure peŀlícules al coŀlegi \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Thanks to All, But your solutions do not like me. And I keep trying the option of Fontfeaturefile page in wiki and Adobe feature topic. - http://wiki.contextgarden.net/fontfeaturefiles - http://wiki.contextgarden.net/TrueType_fonts_in_luaTeX - http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html With this I had found 4 good solutions. I think that for Catalans, the best is gemkerndot.fea I attached files for test. This is a short sample context file with diferent feature files options # ============== geminated.tex ============= % Check each feature \definefontfeature[default][default][featurefile=gemligature.fea] %\definefontfeature[default][default][featurefile=gemkerndot.fea] %\definefontfeature[default][default][featurefile=gemkernpair.fea] %\definefontfeature[default][default][featurefile=gemkerntrio.fea] \starttext \section{Geminated l·l} COL·LEGI Col·legi Col·Legi CoL·legi \stoptext # ======================================== 1.- Create a ligature from L· and l· to special characters This option substitute my SED command for replace L· and l· to respective special characters. # ============== gemligature.fea ============= # Script and language coverage languagesystem DFLT dflt; languagesystem latn dflt; # Ligature feature liga { # Create a ligature substitute l \u00b7 by \u0140; substitute L \u00b7 by \u013F; } liga; # ======================================== 2.- Change kerning of middle dot. This option change middle dot kerning in all cases # ============== gemkerndot.fea ============= # Script and language coverage languagesystem DFLT dflt; languagesystem latn dflt; # Kerning feature kern { # All middle dots position \u00b7 <-330 0 -660 0>; } kern; # ======================================== 3.- Change kerning of pair middle dot and L characters (suffix and prefix) This option only change middle dot and L kerning in pair cases # ============== gemkernpair.fea ============= # Script and language coverage languagesystem DFLT dflt; languagesystem latn dflt; # Kerning feature kern { # Middle dot pair arround 'L' position l \u00b7 -330; position \u00b7 l -330; position L \u00b7 -330; position \u00b7 L -330; } kern; # ======================================== 4.- Change kerning only with trio of L·L and l·l This option only change middle dot kerning with trio L·L. Have a problem with different L uppercases L·l and l·L # ============== gemkerntrio ============= # Script and language coverage languagesystem DFLT dflt; languagesystem latn dflt; # Kerning feature kern { # Middle dot arround L·L and l·l position l \u00b7' <-330 0 -660 0> l; position L \u00b7' <-330 0 -660 0> L; } kern; # ======================================== 19cat
Hello, again. I have another issue. When I put \definefontfeature command into environment file, doesn't work. I must put in product file, before \startproduct command. You know why? This is my tree structure: prd_productname env_productname c_title c_chapter1 c_chapter2 Thanks, 19cat
El 14/01/2015, a les 5:50 p.m., 19cat
va escriure: Thanks to All,
But your solutions do not like me. And I keep trying the option of Fontfeaturefile page in wiki and Adobe feature topic. - http://wiki.contextgarden.net/fontfeaturefiles - http://wiki.contextgarden.net/TrueType_fonts_in_luaTeX - http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html
With this I had found 4 good solutions. I think that for Catalans, the best is gemkerndot.fea I attached files for test.
This is a short sample context file with diferent feature files options # ============== geminated.tex ============= % Check each feature \definefontfeature[default][default][featurefile=gemligature.fea] %\definefontfeature[default][default][featurefile=gemkerndot.fea] %\definefontfeature[default][default][featurefile=gemkernpair.fea] %\definefontfeature[default][default][featurefile=gemkerntrio.fea]
\starttext
\section{Geminated l·l} COL·LEGI Col·legi Col·Legi CoL·legi
\stoptext # ========================================
1.- Create a ligature from L· and l· to special characters This option substitute my SED command for replace L· and l· to respective special characters. # ============== gemligature.fea ============= # Script and language coverage languagesystem DFLT dflt; languagesystem latn dflt;
# Ligature feature liga { # Create a ligature substitute l \u00b7 by \u0140; substitute L \u00b7 by \u013F; } liga; # ========================================
2.- Change kerning of middle dot. This option change middle dot kerning in all cases # ============== gemkerndot.fea ============= # Script and language coverage languagesystem DFLT dflt; languagesystem latn dflt;
# Kerning feature kern { # All middle dots position \u00b7 <-330 0 -660 0>; } kern; # ========================================
3.- Change kerning of pair middle dot and L characters (suffix and prefix) This option only change middle dot and L kerning in pair cases # ============== gemkernpair.fea ============= # Script and language coverage languagesystem DFLT dflt; languagesystem latn dflt;
# Kerning feature kern { # Middle dot pair arround 'L' position l \u00b7 -330; position \u00b7 l -330; position L \u00b7 -330; position \u00b7 L -330; } kern; # ========================================
4.- Change kerning only with trio of L·L and l·l This option only change middle dot kerning with trio L·L. Have a problem with different L uppercases L·l and l·L # ============== gemkerntrio ============= # Script and language coverage languagesystem DFLT dflt; languagesystem latn dflt;
# Kerning feature kern { # Middle dot arround L·L and l·l position l \u00b7' <-330 0 -660 0> l; position L \u00b7' <-330 0 -660 0> L; } kern; # ========================================
19cat
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
Am 14.01.2015 um 19:28 schrieb 19cat
: Hello, again.
I have another issue.
When I put \definefontfeature command into environment file, doesn't work. I must put in product file, before \startproduct command.
You know why?
Load the environment before \startproduct or \startcomponent, e.g. %% begin example \environment env_productname \startproduct prd_productname … \stopproduct %% end example Wolfgang
participants (4)
-
19cat
-
Hans Hagen
-
Keith J. Schultz
-
Wolfgang Schuster